diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ecd3bf3ab6233..cf8664dbec857 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,7 @@ --- name: "\U0001F41B Bug report" -about: Something isn't working correctly with a binding. This is the wrong place for user-interfaces or openhab core issues. +about: Something isn't working correctly with an add-on. This is the wrong place for user-interfaces or openHAB Core issues. +labels: bug --- @@ -19,8 +20,9 @@ about: Something isn't working correctly with a binding. This is the wrong place ## Current Behavior - - + + + @@ -40,6 +42,6 @@ about: Something isn't working correctly with a binding. This is the wrong place ## Your Environment -* Version used: (e.g., openhab and addon versions) -* Environment name and version (e.g. Chrome 39, node.js 5.4, Java 8, ...): -* Operating System and version (desktop or mobile, Windows 10, Raspbian Jessie, ...): +* Version used: (e.g., openHAB and add-on versions) +* Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...): +* Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2dd113b7ef688..1766352b9b6e0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,18 +1,19 @@ --- name: "Feature request" -about: You think that your favourite binding should gain another feature +about: You think that your favorite add-on should gain another feature +labels: enhancement --- - - + + ## Your Environment - -* Version used: (e.g., openhab and addon versions) -* Environment name and version (e.g. Chrome 39, node.js 5.4, Java 8, ...): -* Operating System and version (desktop or mobile, Windows 10, Raspbian Jessie, ...): + +* Version used: (e.g., openHAB and add-on versions) +* Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...): +* Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...): diff --git a/.github/ISSUE_TEMPLATE/usage_question.md b/.github/ISSUE_TEMPLATE/usage_question.md index bab78c42489ea..03bb3504891c3 100644 --- a/.github/ISSUE_TEMPLATE/usage_question.md +++ b/.github/ISSUE_TEMPLATE/usage_question.md @@ -1,6 +1,7 @@ --- name: "\U0001F914 Support/Usage Question" about: For usage questions, please use the openHAB community board! +labels: question --- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6106f2aad6a53..9f105d4fd1b77 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,7 +9,7 @@ Feel free to delete any comment sections in the template (starting with " - - - - - org.openhab.addons.bundles org.openhab.io.homekit diff --git a/bom/openhab-core-index/pom.xml b/bom/openhab-core-index/pom.xml index 57405f234f037..a206a3c308eb4 100644 --- a/bom/openhab-core-index/pom.xml +++ b/bom/openhab-core-index/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bom org.openhab.addons.reactor.bom - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.bom.openhab-core-index @@ -17,7 +16,7 @@ org.openhab.core.bom org.openhab.core.bom.openhab-core - ${project.version} + ${ohc.version} pom compile true diff --git a/bom/pom.xml b/bom/pom.xml index aa94b339d29b2..c1ceb7f02209a 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons org.openhab.addons.reactor - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.bom @@ -38,11 +37,11 @@ - + - + - + header diff --git a/bom/runtime-index/pom.xml b/bom/runtime-index/pom.xml index db53ceed13a01..bf865a65d9ff1 100644 --- a/bom/runtime-index/pom.xml +++ b/bom/runtime-index/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bom org.openhab.addons.reactor.bom - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.bom.runtime-index @@ -17,6 +16,7 @@ org.openhab.core.bom org.openhab.core.bom.runtime + ${ohc.version} pom compile true diff --git a/bom/test-index/pom.xml b/bom/test-index/pom.xml index da635399bf9da..643d8b8ba8e10 100644 --- a/bom/test-index/pom.xml +++ b/bom/test-index/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bom org.openhab.addons.reactor.bom - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.bom.test-index @@ -22,6 +21,7 @@ org.openhab.core.bom org.openhab.core.bom.test + ${ohc.version} pom compile true diff --git a/buildci.sh b/buildci.sh index 71f88a63adb7f..3e12e312bbfa0 100755 --- a/buildci.sh +++ b/buildci.sh @@ -50,8 +50,8 @@ fi if [[ ! -z "$CHANGED_DIR" ]] && [[ -e "bundles/$CHANGED_DIR" ]]; then echo "Single addon pull request: Building $CHANGED_DIR" echo "MAVEN_OPTS='-Xms1g -Xmx2g -Dorg.slf4j.simpleLogger.log.org.openhab.tools.analysis.report.ReportUtility=DEBUG -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN'" > ~/.mavenrc - cd "bundles/$CHANGED_DIR" - mvn clean install -B 2>&1 | + ARTIFACT_ID=$(mvn -f bundles/${CHANGED_DIR}/pom.xml help:evaluate -Dexpression=project.artifactId -q -DforceStdout) + mvn clean install -B -am -pl ":$ARTIFACT_ID" 2>&1 | stdbuf -o0 grep -vE "Download(ed|ing) from [a-z.]+: https:" | # Filter out Download(s) stdbuf -o0 grep -v "target/code-analysis" | # filter out some debug code from reporting utility tee ${CDIR}/.build.log @@ -60,9 +60,9 @@ if [[ ! -z "$CHANGED_DIR" ]] && [[ -e "bundles/$CHANGED_DIR" ]]; then fi # add the postfix to make sure we actually find the correct itest - if [[ -e "../itests/$CHANGED_DIR.tests" ]]; then + if [[ -e "itests/$CHANGED_DIR.tests" ]]; then echo "Single addon pull request: Building itest $CHANGED_DIR" - cd "../itests/$CHANGED_DIR.tests" + cd "itests/$CHANGED_DIR.tests" mvn clean install -B 2>&1 | stdbuf -o0 grep -vE "Download(ed|ing) from [a-z.]+: https:" | # Filter out Download(s) stdbuf -o0 grep -v "target/code-analysis" | # filter out some debug code from reporting utility diff --git a/bundles/create_openhab_binding_skeleton.cmd b/bundles/create_openhab_binding_skeleton.cmd index fcb98e200ff35..d09375c528348 100644 --- a/bundles/create_openhab_binding_skeleton.cmd +++ b/bundles/create_openhab_binding_skeleton.cmd @@ -10,7 +10,8 @@ IF %ARGC% NEQ 3 ( exit /B 1 ) -SET OpenhabVersion="2.5.0-SNAPSHOT" +SET OpenhabCoreVersion="2.5.0" +SET OpenhabVersion="2.5.2-SNAPSHOT" SET BindingIdInCamelCase=%~1 SET BindingIdInLowerCase=%BindingIdInCamelCase% @@ -19,10 +20,14 @@ SET GithubUser=%~3 call :LoCase BindingIdInLowerCase -call mvn -s archetype-settings.xml archetype:generate -N -DarchetypeGroupId=org.openhab.core.tools.archetypes -DarchetypeArtifactId=org.openhab.core.tools.archetypes.binding -DarchetypeVersion=%OpenhabVersion% -DgroupId=org.openhab.binding -DartifactId=org.openhab.binding.%BindingIdInLowerCase% -Dpackage=org.openhab.binding.%BindingIdInLowerCase% -Dversion=%OpenhabVersion% -DbindingId=%BindingIdInLowerCase% -DbindingIdCamelCase=%BindingIdInCamelCase% -DvendorName=openHAB -Dnamespace=org.openhab -Dauthor="%Author%" -DgithubUser="%GithubUser%" +call mvn -s archetype-settings.xml archetype:generate -N -DarchetypeGroupId=org.openhab.core.tools.archetypes -DarchetypeArtifactId=org.openhab.core.tools.archetypes.binding -DarchetypeVersion=%OpenhabCoreVersion% -DgroupId=org.openhab.binding -DartifactId=org.openhab.binding.%BindingIdInLowerCase% -Dpackage=org.openhab.binding.%BindingIdInLowerCase% -Dversion=%OpenhabVersion% -DbindingId=%BindingIdInLowerCase% -DbindingIdCamelCase=%BindingIdInCamelCase% -DvendorName=openHAB -Dnamespace=org.openhab -Dauthor="%Author%" -DgithubUser="%GithubUser%" COPY ..\src\etc\NOTICE org.openhab.binding.%BindingIdInLowerCase%\ +:: temporary fix +:: replace ${project.version} by ${ohc.version} in src/main/feature/feature.xml +@powershell -command "(Get-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml).replace('-core/${project.version}', '-core/${ohc.version}') | Set-Content org.openhab.binding.$env:BindingIdInLowerCase/src/main/feature/feature.xml" + (SET BindingIdInLowerCase=) (SET BindingIdInCamelCase=) (SET Author=) @@ -30,7 +35,6 @@ COPY ..\src\etc\NOTICE org.openhab.binding.%BindingIdInLowerCase%\ GOTO:EOF - :LoCase :: Subroutine to convert a variable VALUE to all lower case. :: The argument for this subroutine is the variable NAME. diff --git a/bundles/create_openhab_binding_skeleton.sh b/bundles/create_openhab_binding_skeleton.sh index 19e28529b79d3..64301bef9dfeb 100755 --- a/bundles/create_openhab_binding_skeleton.sh +++ b/bundles/create_openhab_binding_skeleton.sh @@ -2,7 +2,8 @@ [ $# -lt 3 ] && { echo "Usage: $0 "; exit 1; } -openHABVersion=2.5.0-SNAPSHOT +openHABCoreVersion=2.5.0 +openHABVersion=2.5.2-SNAPSHOT camelcaseId=$1 id=`echo $camelcaseId | tr '[:upper:]' '[:lower:]'` @@ -13,7 +14,7 @@ githubUser=$3 mvn -s archetype-settings.xml archetype:generate -N \ -DarchetypeGroupId=org.openhab.core.tools.archetypes \ -DarchetypeArtifactId=org.openhab.core.tools.archetypes.binding \ - -DarchetypeVersion=$openHABVersion \ + -DarchetypeVersion=$openHABCoreVersion \ -DgroupId=org.openhab.binding \ -DartifactId=org.openhab.binding.$id \ -Dpackage=org.openhab.binding.$id \ @@ -29,3 +30,6 @@ directory="org.openhab.binding.$id/" cp ../src/etc/NOTICE "$directory" +# temporary fix +# replace ${project.version} by ${ohc.version} in src/main/feature/feature.xml +sed -i -e "s|\-core\/\${project.version}|\-core\/\${ohc.version}|g" "$directory/src/main/feature/feature.xml" diff --git a/bundles/org.openhab.binding.airquality/NOTICE b/bundles/org.openhab.binding.airquality/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.airquality/NOTICE +++ b/bundles/org.openhab.binding.airquality/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.airquality/README.md b/bundles/org.openhab.binding.airquality/README.md index ac5b1cca6b888..b921ab749329e 100644 --- a/bundles/org.openhab.binding.airquality/README.md +++ b/bundles/org.openhab.binding.airquality/README.md @@ -1,12 +1,13 @@ # Air Quality Binding -This binding uses the [AQIcn.org service](http://aqicn.org) for providing air quality information for any location worldwide. +This binding uses the [AQIcn.org service](https://aqicn.org) for providing air quality information for any location worldwide. -The World Air Quality Index project is a social enterprise project started in 2007. Its mission is to promote Air Pollution awareness and provide a unified Air Quality information for the whole world. +The World Air Quality Index project is a social enterprise project started in 2007. +Its mission is to promote Air Pollution awareness and provide a unified Air Quality information for the whole world. -The project is proving a transparent Air Quality information for more than 70 countries, covering more than 9000 stations in 600 major cities, via those two websites: [aqicn.org](http://aqicn.org) and [waqi.info](http://waqi.info). +The project is proving a transparent Air Quality information for more than 70 countries, covering more than 9000 stations in 600 major cities, via those two websites: [aqicn.org](https://aqicn.org) and [waqi.info](https://waqi.info). -To use this binding, you first need to [register and get your API token](http://aqicn.org/data-platform/token/). +To use this binding, you first need to [register and get your API token](https://aqicn.org/data-platform/token/). ## Supported Things @@ -17,7 +18,7 @@ Of course, you can add multiple Things, e.g. for measuring AQI for different loc ## Discovery Local Air Quality can be autodiscovered based on system location. -You'll have complete default configuration with your apiKey. +You will have complete default configuration with your apiKey. ## Binding Configuration diff --git a/bundles/org.openhab.binding.airquality/pom.xml b/bundles/org.openhab.binding.airquality/pom.xml index 6b1cec5fa4a7b..bf6949a4345f2 100644 --- a/bundles/org.openhab.binding.airquality/pom.xml +++ b/bundles/org.openhab.binding.airquality/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.airquality diff --git a/bundles/org.openhab.binding.airquality/src/main/feature/feature.xml b/bundles/org.openhab.binding.airquality/src/main/feature/feature.xml index 1c8eb5ce750fd..6e9f744f2a713 100644 --- a/bundles/org.openhab.binding.airquality/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.airquality/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java index 8a60f6bb7f736..65bb101bf3aa8 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityConfiguration.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityConfiguration.java index c34dc18e05c5b..7bb3253d21042 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityConfiguration.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityHandlerFactory.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityHandlerFactory.java index afdf79d8f310c..d7e4ec691a23d 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityHandlerFactory.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/AirQualityHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/discovery/AirQualityDiscoveryService.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/discovery/AirQualityDiscoveryService.java index 3247ca113bfc5..6f603d8d4697f 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/discovery/AirQualityDiscoveryService.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/discovery/AirQualityDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java index 625c09890d561..472d4dbfa72db 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/handler/AirQualityHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java index 98b37fc04d2d4..99506931fb57e 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonCity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java index 7ff607565b9cf..f5274840bb47e 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonIaqi.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonIaqi.java index 189859e553b0d..b2f8b550975b5 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonIaqi.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonIaqi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonResponse.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonResponse.java index af2cd1e5389c2..cf85c87ed7263 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonResponse.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonTime.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonTime.java index 73e6dbc029078..c7a008ef419c1 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonTime.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityJsonTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityValue.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityValue.java index 68c29ce7253a0..7723c11946252 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityValue.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/AirQualityValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/Attribute.java b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/Attribute.java index 6fd96276671c4..d1b358d8ea0c4 100644 --- a/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/Attribute.java +++ b/bundles/org.openhab.binding.airquality/src/main/java/org/openhab/binding/airquality/internal/json/Attribute.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airquality/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.airquality/src/main/resources/ESH-INF/thing/thing-types.xml index f2641deab14c9..e687504542d88 100644 --- a/bundles/org.openhab.binding.airquality/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.airquality/src/main/resources/ESH-INF/thing/thing-types.xml @@ -46,7 +46,7 @@ Fill only in case you want to receive data from the specific station - + Specifies the refresh interval in minutes. 60 @@ -143,7 +143,7 @@ DateTime - + Observation date and time Observation time diff --git a/bundles/org.openhab.binding.airvisualnode/NOTICE b/bundles/org.openhab.binding.airvisualnode/NOTICE index aca8eebc15b0f..4839ea0985207 100644 --- a/bundles/org.openhab.binding.airvisualnode/NOTICE +++ b/bundles/org.openhab.binding.airvisualnode/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.allplay/embedExternalDependency.profile b/bundles/org.openhab.binding.airvisualnode/noEmbedDependencies.profile similarity index 100% rename from bundles/org.openhab.binding.allplay/embedExternalDependency.profile rename to bundles/org.openhab.binding.airvisualnode/noEmbedDependencies.profile diff --git a/bundles/org.openhab.binding.airvisualnode/pom.xml b/bundles/org.openhab.binding.airvisualnode/pom.xml index e9bb7091def72..b49c792f304e9 100644 --- a/bundles/org.openhab.binding.airvisualnode/pom.xml +++ b/bundles/org.openhab.binding.airvisualnode/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.airvisualnode @@ -18,7 +17,7 @@ org.samba.jcifs jcifs 1.3.17 - provided + compile diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/feature/feature.xml b/bundles/org.openhab.binding.airvisualnode/src/main/feature/feature.xml index 2f81c5988e0c2..36da7d2e34811 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.airvisualnode/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeBindingConstants.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeBindingConstants.java index 08f13ac7d7dd1..9d6a4f13a05e8 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeBindingConstants.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeHandlerFactory.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeHandlerFactory.java index cdb7cb3a38721..6c7f6194f01ff 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeHandlerFactory.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/AirVisualNodeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/config/AirVisualNodeConfig.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/config/AirVisualNodeConfig.java index 65b0233eb6096..4a637c4746e97 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/config/AirVisualNodeConfig.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/config/AirVisualNodeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/discovery/AirVisualNodeDiscoveryService.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/discovery/AirVisualNodeDiscoveryService.java index 4abd7d344be2a..7448fd07ffece 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/discovery/AirVisualNodeDiscoveryService.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/discovery/AirVisualNodeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java index 5c73d238d0b76..b99a34f33c639 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/handler/AirVisualNodeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/DateAndTime.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/DateAndTime.java index e239336dd6440..f8e58b2b64323 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/DateAndTime.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/DateAndTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Measurements.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Measurements.java index 5087f0bedbb38..8d0a9bd93000d 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Measurements.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Measurements.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/NodeData.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/NodeData.java index 3785972b4091f..be3aa436a129e 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/NodeData.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/NodeData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSaving.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSaving.java index 44c95bf5b0193..ed201f3b34e86 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSaving.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSaving.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTime.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTime.java index 6cf1248d05aaa..9871d0a02be1f 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTime.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTimeSlot.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTimeSlot.java index 0663ea596df6b..3b3ac553a1b4a 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTimeSlot.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/PowerSavingTimeSlot.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Settings.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Settings.java index c87fc2695296b..45643d3e6afec 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Settings.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Settings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Status.java b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Status.java index 96b237ddfbc40..1f53ac377ca8f 100644 --- a/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Status.java +++ b/bundles/org.openhab.binding.airvisualnode/src/main/java/org/openhab/binding/airvisualnode/internal/json/Status.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.allplay/NOTICE b/bundles/org.openhab.binding.allplay/NOTICE index eeb92b138528f..8f714df48e9e8 100644 --- a/bundles/org.openhab.binding.allplay/NOTICE +++ b/bundles/org.openhab.binding.allplay/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.allplay/README.md b/bundles/org.openhab.binding.allplay/README.md index be92c18aed69e..d7bc08ec9d3df 100644 --- a/bundles/org.openhab.binding.allplay/README.md +++ b/bundles/org.openhab.binding.allplay/README.md @@ -18,7 +18,8 @@ If there is need for another architecture/platform, please open a [ticket on Git ## Supported Things All AllPlay compatible speakers are supported by this binding. -This includes for example the [Panasonic ALL series](http://www.panasonic.com/uk/consumer/home-entertainment/wireless-speaker-systems.html). All AllPlay speakers are registered as an audio sink in the framework. +This includes for example the [Panasonic ALL series](http://www.panasonic.com/uk/consumer/home-entertainment/wireless-speaker-systems.html). +All AllPlay speakers are registered as an audio sink in the framework. ## Discovery diff --git a/bundles/org.openhab.binding.allplay/pom.xml b/bundles/org.openhab.binding.allplay/pom.xml index 7808b68a88fb0..7d836de77ff09 100644 --- a/bundles/org.openhab.binding.allplay/pom.xml +++ b/bundles/org.openhab.binding.allplay/pom.xml @@ -1,30 +1,23 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.allplay openHAB Add-ons :: Bundles :: AllPlay Binding - - org.openhab.osgiify - de.kaizencode.tchaikovsky - 0.0.1 - - org.openhab.osgiify de.kaizencode.tchaikovsky 0.0.1 - provided + compile diff --git a/bundles/org.openhab.binding.allplay/src/main/feature/feature.xml b/bundles/org.openhab.binding.allplay/src/main/feature/feature.xml index 386e237564666..5215b1397b52a 100644 --- a/bundles/org.openhab.binding.allplay/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.allplay/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayAudioSink.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayAudioSink.java index 941741b27f25c..f33e5c8abae4d 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayAudioSink.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingConstants.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingConstants.java index 63c2544506bf9..275d2791d21ec 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingConstants.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java index adc8f9bed0374..b825c80f59d2f 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayBindingProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java index 1e9eb523cb4a0..1d533b842bfe3 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/AllPlayHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,6 +26,7 @@ import org.eclipse.smarthome.core.net.HttpServiceUtil; import org.eclipse.smarthome.core.net.NetworkAddressService; import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingRegistry; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; import org.eclipse.smarthome.core.thing.binding.ThingHandler; @@ -33,6 +34,7 @@ import org.openhab.binding.allplay.internal.handler.AllPlayHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; @@ -53,15 +55,27 @@ public class AllPlayHandlerFactory extends BaseThingHandlerFactory { private final Logger logger = LoggerFactory.getLogger(AllPlayHandlerFactory.class); private static final Set SUPPORTED_THING_TYPES_UIDS = Collections.singleton(SPEAKER_THING_TYPE); - private Map> audioSinkRegistrations = new ConcurrentHashMap<>(); + private final Map> audioSinkRegistrations = new ConcurrentHashMap<>(); private AllPlay allPlay; private AllPlayBindingProperties bindingProperties; - private AudioHTTPServer audioHTTPServer; - private NetworkAddressService networkAddressService; + // Bindings should not use the ThingRegistry! See https://github.com/openhab/openhab-addons/pull/6080 and + // https://github.com/eclipse/smarthome/issues/5182 + private final ThingRegistry thingRegistry; + private final AudioHTTPServer audioHTTPServer; + private final NetworkAddressService networkAddressService; private String callbackUrl; + @Activate + public AllPlayHandlerFactory(final @Reference ThingRegistry thingRegistry, + final @Reference AudioHTTPServer audioHTTPServer, + final @Reference NetworkAddressService networkAddressService) { + this.thingRegistry = thingRegistry; + this.audioHTTPServer = audioHTTPServer; + this.networkAddressService = networkAddressService; + } + @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); @@ -70,10 +84,10 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); - if (thingTypeUID.equals(AllPlayBindingConstants.SPEAKER_THING_TYPE)) { + if (thingTypeUID.equals(SPEAKER_THING_TYPE)) { logger.debug("Creating AllPlayHandler for thing {}", thing.getUID()); - AllPlayHandler handler = new AllPlayHandler(thing, allPlay, bindingProperties); + AllPlayHandler handler = new AllPlayHandler(thingRegistry, thing, allPlay, bindingProperties); registerAudioSink(thing, handler); return handler; @@ -126,24 +140,6 @@ protected void deactivate(ComponentContext componentContext) { super.deactivate(componentContext); } - @Reference - protected void setAudioHTTPServer(AudioHTTPServer audioHTTPServer) { - this.audioHTTPServer = audioHTTPServer; - } - - protected void unsetAudioHTTPServer(AudioHTTPServer audioHTTPServer) { - this.audioHTTPServer = null; - } - - @Reference - protected void setNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = networkAddressService; - } - - protected void unsetNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = null; - } - private String assembleCallbackUrl() { String callbackUrl = bindingProperties.getCallbackUrl(); if (callbackUrl == null) { diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/discovery/AllPlaySpeakerDiscoveryService.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/discovery/AllPlaySpeakerDiscoveryService.java index f550b80e1448f..0f1c22ab8268e 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/discovery/AllPlaySpeakerDiscoveryService.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/discovery/AllPlaySpeakerDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/handler/AllPlayHandler.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/handler/AllPlayHandler.java index 7bfbca5b43298..85f7985bfa4e2 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/handler/AllPlayHandler.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/internal/handler/AllPlayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,6 +36,7 @@ import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingRegistry; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; @@ -74,6 +75,8 @@ public class AllPlayHandler extends BaseThingHandler implements SpeakerChangedListener, SpeakerAnnouncedListener, SpeakerConnectionListener { private final Logger logger = LoggerFactory.getLogger(AllPlayHandler.class); + + private final ThingRegistry localThingRegistry; private final AllPlay allPlay; private final AllPlayBindingProperties bindingProperties; private Speaker speaker; @@ -83,8 +86,10 @@ public class AllPlayHandler extends BaseThingHandler private ScheduledFuture reconnectionJob; private final ScheduledExecutorService scheduler = ThreadPoolManager.getScheduledPool(ALLPLAY_THREADPOOL_NAME); - public AllPlayHandler(Thing thing, AllPlay allPlay, AllPlayBindingProperties properties) { + public AllPlayHandler(ThingRegistry thingRegistry, Thing thing, AllPlay allPlay, + AllPlayBindingProperties properties) { super(thing); + this.localThingRegistry = thingRegistry; this.allPlay = allPlay; this.bindingProperties = properties; } @@ -599,11 +604,9 @@ private void cancelReconnectionJob() { } private String getHandlerIdByLabel(String thingLabel) throws IllegalStateException { - if (thingRegistry != null) { - for (Thing thing : thingRegistry.getAll()) { - if (thingLabel.equals(thing.getLabel())) { - return thing.getUID().getId(); - } + for (Thing thing : localThingRegistry.getAll()) { + if (thingLabel.equals(thing.getLabel())) { + return thing.getUID().getId(); } } throw new IllegalStateException("Could not find thing with label " + thingLabel); diff --git a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/package-info.java b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/package-info.java index add2ca5a41294..a1b4829badb20 100644 --- a/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/package-info.java +++ b/bundles/org.openhab.binding.allplay/src/main/java/org/openhab/binding/allplay/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,4 +18,4 @@ * * @author Jan N. Klug - Initial contribution * - */ \ No newline at end of file + */ diff --git a/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/binding/binding.xml index 75e1a1f2d8a97..b8c2197b9cc8a 100644 --- a/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/binding/binding.xml @@ -7,14 +7,14 @@ Dominic Lerbs - - + + Seconds to jump backwards if the rewind command is executed 10 s - - + + Seconds to jump forward if the fastforward command is executed 10 s diff --git a/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/thing/thing-types.xml index d41e8eb018d9d..a2b3e6a9cd593 100644 --- a/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.allplay/src/main/resources/ESH-INF/thing/thing-types.xml @@ -44,7 +44,7 @@ false - + Step size to use if the volume is changed using the increase/decrease command. 1 true diff --git a/bundles/org.openhab.binding.amazondashbutton/NOTICE b/bundles/org.openhab.binding.amazondashbutton/NOTICE index db4e5c39b091f..e138783176479 100644 --- a/bundles/org.openhab.binding.amazondashbutton/NOTICE +++ b/bundles/org.openhab.binding.amazondashbutton/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content @@ -18,8 +18,3 @@ pcap4J * License: MIT License * Project: https://www.pcap4j.org * Source: https://github.com/kaitoy/pcap4j - -jna -* License: Apache 2.0 License -* Project: https://github.com/java-native-access/jna -* Source: https://github.com/java-native-access/jna diff --git a/bundles/org.openhab.binding.amazondashbutton/README.md b/bundles/org.openhab.binding.amazondashbutton/README.md index e6db98c9ff272..40f110168bcc8 100644 --- a/bundles/org.openhab.binding.amazondashbutton/README.md +++ b/bundles/org.openhab.binding.amazondashbutton/README.md @@ -19,7 +19,7 @@ You might want to keep that in mind during product selection or task assignment. The Binding uses [Pcap4J](https://www.pcap4j.org/) in order to capture `ARP` and `BOOTP` requests send by the Amazon Dash Button. Buttons will hence only be usable within the same network as your openHAB instance. -Start with installing libpcap (for Mac/Linux/UNIX) or WinPcap (for Windows) on your computer. +Start with installing libpcap (for Mac/Linux/Unix) or WinPcap (for Windows) on your computer. They are native libraries that power the core functionalities of Pcap4J. **Note:** @@ -28,7 +28,7 @@ Instructions for Debian/Ubuntu are given below. ### Installing libpcap on Debian/Ubuntu -Installing [libpcap](http://www.tcpdump.org/) should be as simple as: +Installing [libpcap](https://www.tcpdump.org/) should be as simple as: ```shell sudo apt-get install libpcap-dev diff --git a/bundles/org.openhab.binding.amazondashbutton/pom.xml b/bundles/org.openhab.binding.amazondashbutton/pom.xml index ffa046ecdae10..b31e63962c9b8 100644 --- a/bundles/org.openhab.binding.amazondashbutton/pom.xml +++ b/bundles/org.openhab.binding.amazondashbutton/pom.xml @@ -1,36 +1,40 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.amazondashbutton openHAB Add-ons :: Bundles :: Amazon Dash Button Binding + + !org.slf4j.impl.* + jna + + net.java.dev.jna jna - 4.2.1 - provided + 5.4.0 + compile - org.openhab.osgiify - org.pcap4j.pcap4j-core - 1.6.6 - provided + org.pcap4j + pcap4j-core + 1.8.2 + compile - org.openhab.osgiify - org.pcap4j.pcap4j-packetfactory-static - 1.6.6 - provided + org.pcap4j + pcap4j-packetfactory-static + 1.8.2 + compile diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/feature/feature.xml b/bundles/org.openhab.binding.amazondashbutton/src/main/feature/feature.xml index eb9e5f48a4c1a..1947c72512e69 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/feature/feature.xml @@ -1,12 +1,10 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base - mvn:net.java.dev.jna/jna/4.2.1 - mvn:org.openhab.osgiify/org.pcap4j.pcap4j-core/1.6.6 - mvn:org.openhab.osgiify/org.pcap4j.pcap4j-packetfactory-static/1.6.6 + openhab-runtime-jna mvn:org.openhab.addons.bundles/org.openhab.binding.amazondashbutton/${project.version} diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonBindingConstants.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonBindingConstants.java index ea2b84c81a9c0..f0bbd0088c90d 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonBindingConstants.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonHandlerFactory.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonHandlerFactory.java index 5acf9f9efffbe..805f3f5d69551 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonHandlerFactory.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/AmazonDashButtonHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingHandler.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingHandler.java index cd777974ad05b..c792a673dc11c 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingHandler.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingService.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingService.java index 200d4e2748475..a84cb477c9653 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingService.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/capturing/PacketCapturingService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfig.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfig.java index b99bd6bea4130..522dd51cfd42f 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfig.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfigOptionProvider.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfigOptionProvider.java index 604f90b54f1cb..8ed12afcac3cc 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfigOptionProvider.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/config/AmazonDashButtonConfigOptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/discovery/AmazonDashButtonDiscoveryService.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/discovery/AmazonDashButtonDiscoveryService.java index 62e1633a593c1..736966477d2f7 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/discovery/AmazonDashButtonDiscoveryService.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/discovery/AmazonDashButtonDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/handler/AmazonDashButtonHandler.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/handler/AmazonDashButtonHandler.java index 818b215a1398f..4122ed2be685e 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/handler/AmazonDashButtonHandler.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/handler/AmazonDashButtonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceListener.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceListener.java index 6c5a812c77447..e15a3269e625c 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceListener.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceService.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceService.java index 92b63d165ec2b..7808850fb1ad8 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceService.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java index 9715fb5b0bcb7..1f73fd9876436 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapNetworkInterfaceWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapUtil.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapUtil.java index f78a5e201f77b..1ef2a09924b11 100644 --- a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapUtil.java +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/internal/pcap/PcapUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/package-info.java b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/package-info.java new file mode 100644 index 0000000000000..fca2f0ca88c79 --- /dev/null +++ b/bundles/org.openhab.binding.amazondashbutton/src/main/java/org/openhab/binding/amazondashbutton/package-info.java @@ -0,0 +1,28 @@ +/** + * 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 + */ +@Requirement(namespace = ExtenderNamespace.EXTENDER_NAMESPACE, filter = "(osgi.extender=osgi.serviceloader.registrar)") +@Requirement(namespace = ExtenderNamespace.EXTENDER_NAMESPACE, filter = "(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0)(!(version>=2.0)))") +@Requirement(namespace = "osgi.serviceloader", filter = "(osgi.serviceloader=org.pcap4j.packet.factory.PacketFactoryBinderProvider)", cardinality = Cardinality.MULTIPLE) +@Capability(namespace = "osgi.serviceloader", name = "org.pcap4j.packet.factory.PacketFactoryBinderProvider") +package org.openhab.binding.amazondashbutton; + +import org.osgi.annotation.bundle.Capability; +import org.osgi.annotation.bundle.Requirement; +import org.osgi.annotation.bundle.Requirement.Cardinality; +import org.osgi.namespace.extender.ExtenderNamespace; +/** + * Additional information for AmazonDashButton package + * + * @author Jan N. Klug - Initial contribution + * + */ diff --git a/bundles/org.openhab.binding.amazonechocontrol/.classpath b/bundles/org.openhab.binding.amazonechocontrol/.classpath old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.amazonechocontrol/.project b/bundles/org.openhab.binding.amazonechocontrol/.project old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.amazonechocontrol/NOTICE b/bundles/org.openhab.binding.amazonechocontrol/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/NOTICE +++ b/bundles/org.openhab.binding.amazonechocontrol/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.amazonechocontrol/README.md b/bundles/org.openhab.binding.amazonechocontrol/README.md old mode 100755 new mode 100644 index e30c1a95881bc..36539453468be --- a/bundles/org.openhab.binding.amazonechocontrol/README.md +++ b/bundles/org.openhab.binding.amazonechocontrol/README.md @@ -25,6 +25,7 @@ It provides features to control and view the current state of echo devices: - change the volume of the alarm - change the equalizer settings - get information about the next alarm, reminder and timer +- send a message to the echo devices Some ideas what you can do in your home by using rules and other openHAB controlled devices: @@ -34,13 +35,13 @@ Some ideas what you can do in your home by using rules and other openHAB control - The echo starts playing radio at specified time - Remind you with a voice message, that a window is open for a long time and it is winter - Start a routine which welcome you, if you come home -- Start a routine which switch a smart home device connected to alexa +- Start a routine which switch a smart home device connected to Alexa - Start your briefing if you turn on the light first time in the morning - Have different flash briefing in the morning and evening -- Let alexa say 'welcome' to you if you open the door +- Let Alexa say 'welcome' to you if you open the door - Implement own handling for voice commands in a rule - Change the equalizer settings depending on the bluetooth connection -- Turn on a light on your alexa alarm time +- Turn on a light on your Alexa alarm time ## Note @@ -69,15 +70,15 @@ The binding is tested with amazon.de, amazon.fr, amazon.it, amazon.com and amazo ## Discovery -After configuration of the account thing with the login data, the echo devices registered in the amazon account, get discovered. +After configuration of the account thing with the login data, the echo devices registered in the Amazon account, get discovered. If the device type is not known by the binding, the device will not be discovered. -But you can define any device listed in your alexa app with the best matching existing device (e.g. echo). -You will find the required serial number in settings of the device in the alexa app. +But you can define any device listed in your Alexa app with the best matching existing device (e.g. echo). +You will find the required serial number in settings of the device in the Alexa app. ## Binding Configuration The binding does not have any configuration. -The configuration of your amazon account must be done in the 'Amazon Account' device. +The configuration of your Amazon account must be done in the 'Amazon Account' device. ## Thing Configuration @@ -89,9 +90,9 @@ All Amazon devices (echo, echospot, echoshow, wha) needs the following configura | Configuration name | Description | |--------------------------|----------------------------------------------------| -| serialNumber | Serial number of the amazon echo in the Alexa app | +| serialNumber | Serial number of the Amazon Echo in the Alexa app | -You will find the serial number in the alexa app or on the webpage YOUR_OPENHAB/amazonechocontrol/YOUR_ACCOUNT (e.g. http://openhab:8080/amazonechocontrol/account1). +You will find the serial number in the Alexa app or on the webpage YOUR_OPENHAB/amazonechocontrol/YOUR_ACCOUNT (e.g. http://openhab:8080/amazonechocontrol/account1). ### Flash Briefing Profile @@ -100,28 +101,28 @@ It will be configured at runtime by using the save channel to store the current ## Channels -| Channel Type ID | Item Type | Access Mode | Thing Type | Description -|-----------------------|-------------|-------------|------------|------------------------------------------------------------------------------------------ -| player | Player | R/W | echo, echoshow, echospot, wha | Control the music player (Supported commands: PLAY or ON, PAUSE or OFF, NEXT, PREVIOUS, REWIND, FASTFORWARD) -| volume | Dimmer | R/W | echo, echoshow, echospot | Control the volume -| equalizerTreble | Number | R/W | echo, echoshow, echospot | Control the treble (value from -6 to 6) -| equalizerMidrange | Number | R/W | echo, echoshow, echospot | Control the midrange (value from -6 to 6) -| equalizerBass | Number | R/W | echo, echoshow, echospot | Control the bass (value from -6 to 6) -| shuffle | Switch | R/W | echo, echoshow, echospot, wha | Shuffle play if applicable, e.g. playing a playlist -| imageUrl | String | R | echo, echoshow, echospot, wha | Url of the album image or radio station logo -| title | String | R | echo, echoshow, echospot, wha | Title of the current media -| subtitle1 | String | R | echo, echoshow, echospot, wha | Subtitle of the current media -| subtitle2 | String | R | echo, echoshow, echospot, wha | Additional subtitle of the current media -| providerDisplayName | String | R | echo, echoshow, echospot, wha | Name of the music provider -| bluetoothMAC | String | R/W | echo, echoshow, echospot | Bluetooth device MAC. Used to connect to a specific device or disconnect if a empty string was provided +| Channel Type ID | Item Type | Access Mode | Thing Type | Description +|-----------------------|-------------|-------------|-------------------------------|------------------------------------------------------------------------------------------ +| player | Player | R/W | echo, echoshow, echospot, wha | Control the music player (Supported commands: PLAY or ON, PAUSE or OFF, NEXT, PREVIOUS, REWIND, FASTFORWARD) +| volume | Dimmer | R/W | echo, echoshow, echospot | Control the volume +| equalizerTreble | Number | R/W | echo, echoshow, echospot | Control the treble (value from -6 to 6) +| equalizerMidrange | Number | R/W | echo, echoshow, echospot | Control the midrange (value from -6 to 6) +| equalizerBass | Number | R/W | echo, echoshow, echospot | Control the bass (value from -6 to 6) +| shuffle | Switch | R/W | echo, echoshow, echospot, wha | Shuffle play if applicable, e.g. playing a playlist +| imageUrl | String | R | echo, echoshow, echospot, wha | Url of the album image or radio station logo +| title | String | R | echo, echoshow, echospot, wha | Title of the current media +| subtitle1 | String | R | echo, echoshow, echospot, wha | Subtitle of the current media +| subtitle2 | String | R | echo, echoshow, echospot, wha | Additional subtitle of the current media +| providerDisplayName | String | R | echo, echoshow, echospot, wha | Name of the music provider +| bluetoothMAC | String | R/W | echo, echoshow, echospot | Bluetooth device MAC. Used to connect to a specific device or disconnect if an empty string was provided | bluetooth | Switch | R/W | echo, echoshow, echospot | Connect/Disconnect to the last used bluetooth device (works after a bluetooth connection was established after the openHAB start) | bluetoothDeviceName | String | R | echo, echoshow, echospot | User friendly name of the connected bluetooth device -| radioStationId | String | R/W | echo, echoshow, echospot, wha | Start playing of a TuneIn radio station by specifying it's id or stops playing if a empty string was provided +| radioStationId | String | R/W | echo, echoshow, echospot, wha | Start playing of a TuneIn radio station by specifying its id or stops playing if an empty string was provided | radio | Switch | R/W | echo, echoshow, echospot, wha | Start playing of the last used TuneIn radio station (works after the radio station started after the openhab start) -| amazonMusicTrackId | String | R/W | echo, echoshow, echospot, wha | Start playing of a Amazon Music track by it's id od stops playing if a empty string was provided -| amazonMusicPlayListId | String | W | echo, echoshow, echospot, wha | Write Only! Start playing of a Amazon Music playlist by specifying it's id od stops playing if a empty string was provided. Selection will only work in PaperUI +| amazonMusicTrackId | String | R/W | echo, echoshow, echospot, wha | Start playing of an Amazon Music track by its id or stops playing if an empty string was provided +| amazonMusicPlayListId | String | W | echo, echoshow, echospot, wha | Write Only! Start playing of an Amazon Music playlist by specifying its id or stops playing if an empty string was provided. Selection will only work in PaperUI | amazonMusic | Switch | R/W | echo, echoshow, echospot, wha | Start playing of the last used Amazon Music song (works after at least one song was started after the openhab start) -| remind | String | R/W | echo, echoshow, echospot | Write Only! Speak the reminder and sends a notification to the Alexa app (Currently the reminder is played and notified two times, this seems to be a bug in the amazon software) +| remind | String | R/W | echo, echoshow, echospot | Write Only! Speak the reminder and sends a notification to the Alexa app (Currently the reminder is played and notified two times, this seems to be a bug in the Amazon software) | nextReminder | DateTime | R | echo, echoshow, echospot | Next reminder on the device | playAlarmSound | String | W | echo, echoshow, echospot | Write Only! Plays ans Alarm sound | nextAlarm | DateTime | R | echo, echoshow, echospot | Next alarm on the device @@ -129,26 +130,28 @@ It will be configured at runtime by using the save channel to store the current | nextTimer | DateTime | R | echo, echoshow, echospot | Next timer on the device | startRoutine | String | W | echo, echoshow, echospot | Write Only! Type in what you normally say to Alexa without the preceding "Alexa," | musicProviderId | String | R/W | echo, echoshow, echospot | Current Music provider -| playMusicVoiceCommand | String | W | echo, echoshow, echospot | Write Only! Voice command as text. E.g. 'Yesterday from the Beatles' -| startCommand | String | W | echo, echoshow, echospot | Write Only! Used to start anything. Available options: Weather, Traffic, GoodMorning, SingASong, TellStory, FlashBriefing and FlashBriefing. (Note: The options are case sensitive) -| announcement | String | W | echo, echoshow, echospot | Write Only! Display the announcement message on the display. See in the tutorial section to learn how it’s possible to set the title and turn off the sound. -| textToSpeech | String | W | echo, echoshow, echospot | Write Only! Write some text to this channel and alexa will speak it. It is possible to use plain text or SSML: e.g. `I want to tell you a secret.I am not a real human.` -| textToSpeechVolume | Dimmer | R/W | echo, echoshow, echospot | Volume of the textToSpeech channel, if 0 the current volume will be used +| playMusicVoiceCommand | String | W | echo, echoshow, echospot | Write Only! Voice command as text. E.g. 'Yesterday from the Beatles' +| startCommand | String | W | echo, echoshow, echospot | Write Only! Used to start anything. Available options: Weather, Traffic, GoodMorning, SingASong, TellStory, FlashBriefing and FlashBriefing. (Note: The options are case sensitive) +| announcement | String | W | echo, echoshow, echospot | Write Only! Display the announcement message on the display. Please note: the announcement feature must be activated in the alexa app at the echo device. See in the tutorial section to learn how it’s possible to set the title and turn off the sound. +| textToSpeech | String | W | echo, echoshow, echospot | Write Only! Write some text to this channel and Alexa will speak it. It is possible to use plain text or SSML: e.g. `I want to tell you a secret.I am not a real human. Please note: the announcement feature must be activated in the alexa app at the echo device to use SSML. ` +| textToSpeechVolume | Dimmer | R/W | echo, echoshow, echospot | Volume of the textToSpeech channel, if 0 the current volume will be used | lastVoiceCommand | String | R/W | echo, echoshow, echospot | Last voice command spoken to the device. Writing to the channel starts voice output. | mediaProgress | Dimmer | R/W | echo, echoshow, echospot | Media progress in percent | mediaProgressTime | Number:Time | R/W | echo, echoshow, echospot | Media play time | mediaLength | Number:Time | R | echo, echoshow, echospot | Media length | notificationVolume | Dimmer | R | echo, echoshow, echospot | Notification volume | ascendingAlarm | Switch | R/W | echo, echoshow, echospot | Ascending alarm up to the configured volume -| save | Switch | W | flashbriefingprofile | Write Only! Stores the current configuration of flash briefings within the thing -| active | Switch | R/W | flashbriefingprofile | Active the profile -| playOnDevice | String | W | flashbriefingprofile | Specify the echo serial number or name to start the flash briefing. +| sendMessage | String | W | account | Write Only! Sends a message to the Echo devices. +| save | Switch | W | flashbriefingprofile | Write Only! Stores the current configuration of flash briefings within the thing +| active | Switch | R/W | flashbriefingprofile | Active the profile +| playOnDevice | String | W | flashbriefingprofile | Specify the echo serial number or name to start the flash briefing. ## Advanced Feature Technically Experienced Users -The url /amazonechocontrol//PROXY/ provides a proxy server with an authenticated connection to the amazon alexa server. This can be used to call alexa api from rules. +The url /amazonechocontrol//PROXY/ provides a proxy server with an authenticated connection to the Amazon Alexa server. +This can be used to call Alexa API from rules. -E.g. to read out the history call from an installation on openhab:8080 with a account named account1: +E.g. to read out the history call from an installation on openhab:8080 with an account named account1: http://openhab:8080/amazonechocontrol/account1/PROXY/api/activities?startTime=&size=50&offset=1 @@ -180,69 +183,69 @@ Take a look in the channel description above to know, which channels are support Group Alexa_Living_Room // Player control -Player Echo_Living_Room_Player "Player" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:player"} -Dimmer Echo_Living_Room_Volume "Volume [%.0f %%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:volume"} -Number Echo_Living_Room_Treble "Treble" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerTreble"} -Number Echo_Living_Room_Midrange "Midrange" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerMidrange"} -Number Echo_Living_Room_Bass "Bass" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerBass"} -Switch Echo_Living_Room_Shuffle "Shuffle" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:shuffle"} +Player Echo_Living_Room_Player "Player" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:player"} +Dimmer Echo_Living_Room_Volume "Volume [%.0f %%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:volume"} +Number Echo_Living_Room_Treble "Treble" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerTreble"} +Number Echo_Living_Room_Midrange "Midrange" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerMidrange"} +Number Echo_Living_Room_Bass "Bass" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:equalizerBass"} +Switch Echo_Living_Room_Shuffle "Shuffle" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:shuffle"} // Media channels -Dimmer Echo_Living_Room_MediaProgress "Media progress" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgress"} -Number:Time Echo_Living_Room_MediaProgressTime "Media progress time [%d %unit%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgressTime"} -Number:Time Echo_Living_Room_MediaLength "Media length [%d %unit%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaLength"} +Dimmer Echo_Living_Room_MediaProgress "Media progress" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgress"} +Number:Time Echo_Living_Room_MediaProgressTime "Media progress time [%d %unit%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaProgressTime"} +Number:Time Echo_Living_Room_MediaLength "Media length [%d %unit%]" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:mediaLength"} // Player Information -String Echo_Living_Room_ImageUrl "Image URL" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:imageUrl"} -String Echo_Living_Room_Title "Title" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:title"} -String Echo_Living_Room_Subtitle1 "Subtitle 1" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle1"} -String Echo_Living_Room_Subtitle2 "Subtitle 2" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle2"} -String Echo_Living_Room_ProviderDisplayName "Provider" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:providerDisplayName"} +String Echo_Living_Room_ImageUrl "Image URL" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:imageUrl"} +String Echo_Living_Room_Title "Title" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:title"} +String Echo_Living_Room_Subtitle1 "Subtitle 1" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle1"} +String Echo_Living_Room_Subtitle2 "Subtitle 2" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:subtitle2"} +String Echo_Living_Room_ProviderDisplayName "Provider" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:providerDisplayName"} // Music provider and start command -String Echo_Living_Room_MusicProviderId "Music Provider Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:musicProviderId"} -String Echo_Living_Room_PlayMusicCommand "Play music voice command (Write Only)" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playMusicVoiceCommand"} -String Echo_Living_Room_StartCommand "Start Information" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startCommand"} +String Echo_Living_Room_MusicProviderId "Music Provider Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:musicProviderId"} +String Echo_Living_Room_PlayMusicCommand "Play music voice command (Write Only)" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playMusicVoiceCommand"} +String Echo_Living_Room_StartCommand "Start Information" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startCommand"} // TuneIn Radio -String Echo_Living_Room_RadioStationId "TuneIn Radio Station Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radioStationId"} -Switch Echo_Living_Room_Radio "TuneIn Radio" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radio"} +String Echo_Living_Room_RadioStationId "TuneIn Radio Station Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radioStationId"} +Switch Echo_Living_Room_Radio "TuneIn Radio" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:radio"} // Amazon Music -String Echo_Living_Room_AmazonMusicTrackId "Amazon Music Track Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicTrackId"} -String Echo_Living_Room_AmazonMusicPlayListId "Amazon Music Playlist Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicPlayListId"} -Switch Echo_Living_Room_AmazonMusic "Amazon Music" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusic"} +String Echo_Living_Room_AmazonMusicTrackId "Amazon Music Track Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicTrackId"} +String Echo_Living_Room_AmazonMusicPlayListId "Amazon Music Playlist Id" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusicPlayListId"} +Switch Echo_Living_Room_AmazonMusic "Amazon Music" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:amazonMusic"} // Bluetooth -String Echo_Living_Room_BluetoothMAC "Bluetooth MAC Address" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothMAC"} -Switch Echo_Living_Room_Bluetooth "Bluetooth" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetooth"} -String Echo_Living_Room_BluetoothDeviceName "Bluetooth Device" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothDeviceName"} +String Echo_Living_Room_BluetoothMAC "Bluetooth MAC Address" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothMAC"} +Switch Echo_Living_Room_Bluetooth "Bluetooth" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetooth"} +String Echo_Living_Room_BluetoothDeviceName "Bluetooth Device" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:bluetoothDeviceName"} // Commands -String Echo_Living_Room_Announcement "Announcement" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:announcement"} -String Echo_Living_Room_TTS "Text to Speech" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeech"} -Dimmer Echo_Living_Room_TTS_Volume "Text to Speech Volume" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeechVolume"} -String Echo_Living_Room_Remind "Remind" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:remind"} -String Echo_Living_Room_PlayAlarmSound "Play Alarm Sound" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playAlarmSound"} -String Echo_Living_Room_StartRoutine "Start Routine" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startRoutine"} -Dimmer Echo_Living_Room_NotificationVolume "Notification volume" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:notificationVolume"} -Switch Echo_Living_Room_AscendingAlarm "Ascending alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:ascendingAlarm"} +String Echo_Living_Room_Announcement "Announcement" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:announcement"} +String Echo_Living_Room_TTS "Text to Speech" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeech"} +Dimmer Echo_Living_Room_TTS_Volume "Text to Speech Volume" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:textToSpeechVolume"} +String Echo_Living_Room_Remind "Remind" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:remind"} +String Echo_Living_Room_PlayAlarmSound "Play Alarm Sound" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:playAlarmSound"} +String Echo_Living_Room_StartRoutine "Start Routine" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:startRoutine"} +Dimmer Echo_Living_Room_NotificationVolume "Notification volume" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:notificationVolume"} +Switch Echo_Living_Room_AscendingAlarm "Ascending alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:ascendingAlarm"} // Feedbacks -String Echo_Living_Room_LastVoiceCommand "Last voice command" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:lastVoiceCommand"} -DateTime Echo_Living_Room_NextReminder "Next reminder" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextReminder"} -DateTime Echo_Living_Room_NextAlarm "Next alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextAlarm"} -DateTime Echo_Living_Room_NextMusicAlarm "Next music alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextMusicAlarm"} -DateTime Echo_Living_Room_NextTimer "Next timer" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextTimer"} +String Echo_Living_Room_LastVoiceCommand "Last voice command" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:lastVoiceCommand"} +DateTime Echo_Living_Room_NextReminder "Next reminder" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextReminder"} +DateTime Echo_Living_Room_NextAlarm "Next alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextAlarm"} +DateTime Echo_Living_Room_NextMusicAlarm "Next music alarm" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextMusicAlarm"} +DateTime Echo_Living_Room_NextTimer "Next timer" (Alexa_Living_Room) {channel="amazonechocontrol:echo:account1:echo1:nextTimer"} // Flashbriefings Switch FlashBriefing_Technical_Save "Save (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:save"} -Switch FlashBriefing_Technical_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:active"} +Switch FlashBriefing_Technical_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:active"} String FlashBriefing_Technical_Play "Play (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing1:playOnDevice"} Switch FlashBriefing_LifeStyle_Save "Save (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:save"} -Switch FlashBriefing_LifeStyle_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:active"} +Switch FlashBriefing_LifeStyle_Active "Active" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:active"} String FlashBriefing_LifeStyle_Play "Play (Write only)" { channel="amazonechocontrol:flashbriefingprofile:account1:flashbriefing2:playOnDevice"} ``` @@ -284,7 +287,7 @@ sitemap amazonechocontrol label="Echo Devices" Switch item=Echo_Living_Room_AmazonMusic Text item=Echo_Living_Room_BluetoothMAC - // Change the Place holder with the MAC address shown, if alexa is connected to the device + // Change the Place holder with the MAC address shown, if Alexa is connected to the device Selection item=Echo_Living_Room_BluetoothMAC mappings=[ ''='Disconnected', ''='Bluetooth Device 1', ''='Bluetooth Device 2'] // These are only view of the possible options. Enable ShowIDsInGUI in the binding configuration and look in drop-down-box of this channel in the Paper UI Control section @@ -320,7 +323,7 @@ sitemap amazonechocontrol label="Echo Devices" ## Tutorials -### Let alexa speak a text from a rule: +### Let Alexa speak a text from a rule: 1) Create a rule with a trigger of your choice @@ -360,15 +363,19 @@ end ``` Expert: -You can use a json formatted string to control the title and the sound: +You can use a json formatted string to control title, sound and volume: ```php -{ "sound": true, "speak":"" "title": "", "body": "<Body Text>"} +{ "sound": true, "speak":"<Speak>" "title": "<Title>", "body": "<Body Text>", "volume": 20} ``` -The combination of sound=true and speak in SSML syntax is not allowed +The combination of `sound=true` and `speak` in SSML syntax is not allowed. +Not all properties need to be specified. +The value for `volume` can be between 0 and 100 to set the volume. +A volume value smaller then 0 means that the current alexa volume should be used. +No specification uses the volume from the `textToSpeechVolume` channel. -Note: If you turn off the sound and alexa is playing music, it will anyway turn down the volume for a moment. This behavior can not be changed. +Note: If you turn off the sound and Alexa is playing music, it will anyway turn down the volume for a moment. This behavior can not be changed. ```php rule "Say welcome if the door opens" @@ -404,10 +411,10 @@ then end ``` -Note 1: Do not use a to short time for playing the sound, because alexa needs some time to start playing the sound. -It's not recommended to use a time below 10 seconds. +Note 1: Do not use a to short time for playing the sound, because Alexa needs some time to start playing the sound. +It is not recommended to use a time below 10 seconds. -Note 2: The rule have no effect for your default alarm sound used in the alexa app. +Note 2: The rule have no effect for your default alarm sound used in the Alexa app. ### Play a spotify playlist if a switch was changed to on: @@ -425,7 +432,7 @@ then end ``` -Note: It's recommended to test the command send to play music command first with the voice and the real alexa device. E.g. say 'Alexa, Playlist Party' +Note: It is recommended to test the command send to play music command first with the voice and the real Alexa device. E.g. say 'Alexa, Playlist Party' ### Start playing weather/traffic/etc: @@ -458,9 +465,9 @@ end ## Credits -The idea for writing this binding came from this blog: http://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html (German). +The idea for writing this binding came from this blog: https://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html (German). Thank you Alex! -The technical information for the web socket connection to get live alexa state updates cames from Ingo. He has done the alexa iobrokern implementation https://github.com/Apollon77 +The technical information for the web socket connection to get live Alexa state updates cames from Ingo. He has done the Alexa ioBroker implementation https://github.com/Apollon77 Thank you Ingo! ## Trademark Disclaimer diff --git a/bundles/org.openhab.binding.amazonechocontrol/pom.xml b/bundles/org.openhab.binding.amazonechocontrol/pom.xml old mode 100755 new mode 100644 index f70d3a6bf158c..fd6c339e739ab --- a/bundles/org.openhab.binding.amazonechocontrol/pom.xml +++ b/bundles/org.openhab.binding.amazonechocontrol/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.amazonechocontrol</artifactId> diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/feature/feature.xml b/bundles/org.openhab.binding.amazonechocontrol/src/main/feature/feature.xml index 2ab102669fd09..038bb5321e4ce 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.amazonechocontrol-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-amazonechocontrol" description="Amazon Echo Control Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java index a4c32e59db2ab..c9cbec6a130ab 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AccountServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -95,16 +95,14 @@ public AccountServlet(HttpService httpService, String id, AccountHandler account } catch (UnsupportedEncodingException e) { servletUrlWithoutRoot = ""; servletUrl = ""; - logger.warn("Register servlet fails {}", e); + logger.warn("Register servlet fails", e); return; } servletUrl = "/" + servletUrlWithoutRoot; try { httpService.registerServlet(servletUrl, this, null, httpService.createDefaultHttpContext()); - } catch (ServletException e) { - logger.warn("Register servlet fails {}", e); - } catch (NamespaceException e) { - logger.warn("Register servlet fails {}", e); + } catch (NamespaceException | ServletException e) { + logger.warn("Register servlet fails", e); } } @@ -325,7 +323,7 @@ protected void doGet(@Nullable HttpServletRequest req, @Nullable HttpServletResp String html = connection.getLoginPage(); returnHtml(connection, resp, html, "amazon.com"); } catch (URISyntaxException e) { - logger.warn("get failed with uri syntax error {}", e); + logger.warn("get failed with uri syntax error", e); } } @@ -341,7 +339,7 @@ public Map<String, String> getQueryMap(@Nullable String query) { try { value = URLDecoder.decode(elements[1], "UTF8"); } catch (UnsupportedEncodingException e) { - logger.info("Unsupported encoding {}", e); + logger.info("Unsupported encoding", e); } map.put(name, value); } @@ -472,7 +470,7 @@ private void createPageEndAndSent(HttpServletResponse resp, StringBuilder html) try { resp.getWriter().write(html.toString()); } catch (IOException e) { - logger.warn("return html failed with IO error {}", e); + logger.warn("return html failed with IO error", e); } } @@ -697,7 +695,7 @@ private void returnHtml(Connection connection, HttpServletResponse resp, String try { resp.getWriter().write(resultHtml); } catch (IOException e) { - logger.warn("return html failed with IO error {}", e); + logger.warn("return html failed with IO error", e); } } @@ -706,7 +704,7 @@ void returnError(HttpServletResponse resp, String errorMessage) { resp.getWriter().write("<html>" + StringEscapeUtils.escapeHtml(errorMessage) + "<br><a href='" + servletUrl + "'>Try again</a></html>"); } catch (IOException e) { - logger.info("Returning error message failed {}", e); + logger.info("Returning error message failed", e); } } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlBindingConstants.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlBindingConstants.java old mode 100755 new mode 100644 index 45675aadba7a1..c1229f4e94b57 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlBindingConstants.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlHandlerFactory.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlHandlerFactory.java old mode 100755 new mode 100644 index f0cf1faf5e142..47242988769f2 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlHandlerFactory.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/AmazonEchoControlHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/BindingServlet.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/BindingServlet.java index 9984ece665d94..a7bd193dc491b 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/BindingServlet.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/BindingServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -57,10 +57,8 @@ public BindingServlet(HttpService httpService) { servletUrl = "/" + servletUrlWithoutRoot; try { httpService.registerServlet(servletUrl, this, null, httpService.createDefaultHttpContext()); - } catch (ServletException e) { - logger.warn("Register servlet fails {}", e); - } catch (NamespaceException e) { - logger.warn("Register servlet fails {}", e); + } catch (NamespaceException | ServletException e) { + logger.warn("Register servlet fails", e); } } @@ -123,7 +121,7 @@ protected void doGet(@Nullable HttpServletRequest req, @Nullable HttpServletResp try { resp.getWriter().write(html.toString()); } catch (IOException e) { - logger.warn("return html failed with uri syntax error {}", e); + logger.warn("return html failed with uri syntax error", e); } } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java old mode 100755 new mode 100644 index 8f95e4070985d..7f8ed58eabb9c --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -429,7 +429,7 @@ public boolean tryRestoreLogin(@Nullable String data, @Nullable String overloade } } } catch (URISyntaxException | IOException | ConnectionException e) { - logger.debug("Getting account customer Id failed {}", e); + logger.debug("Getting account customer Id failed", e); } return loginTime; } @@ -450,7 +450,7 @@ public boolean tryRestoreLogin(@Nullable String data, @Nullable String overloade return authentication; } } catch (JsonSyntaxException | IllegalStateException e) { - logger.info("No valid json received {}", e); + logger.info("No valid json received", e); return null; } } @@ -624,7 +624,7 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String try { makeRequest(verb, url, postData, json, autoredirect, customHeaders, badRequestRepeats - 1); } catch (IOException | URISyntaxException e) { - logger.debug("Repeat fails {}", e); + logger.debug("Repeat fails", e); } }, 500, TimeUnit.MILLISECONDS); return connection; @@ -652,7 +652,7 @@ public HttpsURLConnection makeRequest(String verb, String url, @Nullable String if (connection != null) { connection.disconnect(); } - logger.warn("Request to url '{}' fails with unkown error", url, e); + logger.warn("Request to url '{}' fails with unknown error", url, e); throw e; } catch (Exception e) { if (connection != null) { @@ -887,7 +887,7 @@ private <T> T parseJson(String json, Class<T> type) throws JsonSyntaxException, try { return gson.fromJson(json, type); } catch (JsonParseException | IllegalStateException e) { - logger.warn("Parsing json failed {}", e); + logger.warn("Parsing json failed", e); logger.warn("Illegal json: {}", json); throw e; } @@ -905,7 +905,7 @@ public WakeWord[] getWakeWords() { return result; } } catch (IOException | URISyntaxException e) { - logger.info("getting wakewords failed {}", e); + logger.info("getting wakewords failed", e); } return new WakeWord[0]; } @@ -950,7 +950,7 @@ public Activity[] getActivities(int number, @Nullable Long startTime) { return activiesArray; } } catch (IOException | URISyntaxException e) { - logger.info("getting activities failed {}", e); + logger.info("getting activities failed", e); } return new Activity[0]; } @@ -1008,7 +1008,7 @@ public DeviceNotificationState[] getDeviceNotificationStates() { return deviceNotificationStates; } } catch (IOException | URISyntaxException e) { - logger.info("Error getting device notification states {}", e); + logger.info("Error getting device notification states", e); } return new DeviceNotificationState[0]; } @@ -1023,7 +1023,7 @@ public AscendingAlarmModel[] getAscendingAlarm() { return ascendingAlarmModelList; } } catch (IOException | URISyntaxException e) { - logger.info("Error getting device notification states {}", e); + logger.info("Error getting device notification states", e); } return new AscendingAlarmModel[0]; } @@ -1100,8 +1100,8 @@ public void sendNotificationToMobileApp(String customerId, String text, @Nullabl executeSequenceCommand(null, "Alexa.Notifications.SendMobilePush", parameters); } - public void sendAnnouncement(Device device, String text, String bodyText, @Nullable String title, int ttsVolume, - int standardVolume) throws IOException, URISyntaxException { + public void sendAnnouncement(Device device, String speak, String bodyText, @Nullable String title, + @Nullable Integer ttsVolume, int standardVolume) throws IOException, URISyntaxException { Map<String, Object> parameters = new HashMap<>(); parameters.put("expireAfter", "PT5S"); JsonAnnouncementContent[] contentArray = new JsonAnnouncementContent[1]; @@ -1112,10 +1112,10 @@ public void sendAnnouncement(Device device, String text, String bodyText, @Nulla content.display.title = title; } content.display.body = bodyText; - if (text.startsWith("<speak>") && text.endsWith("</speak>")) { + if (speak.startsWith("<speak>") && speak.endsWith("</speak>")) { content.speak.type = "ssml"; } - content.speak.value = text; + content.speak.value = speak; contentArray[0] = content; @@ -1140,7 +1140,7 @@ public void sendAnnouncement(Device device, String text, String bodyText, @Nulla executeSequenceCommandWithVolume(device, "AlexaAnnouncement", parameters, ttsVolume, standardVolume); } - public void textToSpeech(Device device, String text, int ttsVolume, int standardVolume) + public void textToSpeech(Device device, String text, @Nullable Integer ttsVolume, int standardVolume) throws IOException, URISyntaxException { Map<String, Object> parameters = new HashMap<>(); parameters.put("textToSpeak", text); @@ -1148,28 +1148,23 @@ public void textToSpeech(Device device, String text, int ttsVolume, int standard } private void executeSequenceCommandWithVolume(@Nullable Device device, String command, - @Nullable Map<String, Object> parameters, int ttsVolume, int standardVolume) + @Nullable Map<String, Object> parameters, @Nullable Integer ttsVolume, int standardVolume) throws IOException, URISyntaxException { - if (ttsVolume != 0) { - + if (ttsVolume != null) { JsonArray nodesToExecute = new JsonArray(); - Map<String, Object> volumeParameters = new HashMap<>(); // add tts volume volumeParameters.clear(); volumeParameters.put("value", ttsVolume); nodesToExecute.add(createExecutionNode(device, "Alexa.DeviceControls.Volume", volumeParameters)); - // add command nodesToExecute.add(createExecutionNode(device, command, parameters)); - // add volume volumeParameters.clear(); volumeParameters.put("value", standardVolume); nodesToExecute.add(createExecutionNode(device, "Alexa.DeviceControls.Volume", volumeParameters)); executeSequenceNodes(nodesToExecute); - } else { executeSequenceCommand(device, command, parameters); } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/ConnectionException.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/ConnectionException.java index ba0f3e06791a8..3d7abf5a6df4e 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/ConnectionException.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/ConnectionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/HttpException.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/HttpException.java old mode 100755 new mode 100644 index da55580791ea6..2faa954cb967d --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/HttpException.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/HttpException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/IWebSocketCommandHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/IWebSocketCommandHandler.java index 345507692e775..3e00770a9f4b8 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/IWebSocketCommandHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/IWebSocketCommandHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java index 302e7c90dcbaa..2ebcc2e842629 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/WebSocketConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -101,7 +101,7 @@ public WebSocketConnection(String amazonSite, List<HttpCookie> sessionCookies, try { webSocketClient.start(); } catch (Exception e) { - logger.warn("Web socket start failed: {}", e); + logger.warn("Web socket start failed", e); throw new IOException("Web socket start failed"); } @@ -117,7 +117,7 @@ public WebSocketConnection(String amazonSite, List<HttpCookie> sessionCookies, webSocketClient.connect(listener, uri, request); } catch (URISyntaxException e) { - logger.debug("Initialize web socket failed: {}", e); + logger.debug("Initialize web socket failed", e); } } @@ -152,7 +152,7 @@ public void close() { try { session.close(); } catch (Exception e) { - logger.debug("Closing sessing failed {}", e); + logger.debug("Closing sessing failed", e); } } try { @@ -160,7 +160,7 @@ public void close() { } catch (InterruptedException e) { // Just ignore } catch (Exception e) { - logger.debug("Stopping websocket failed {}", e); + logger.debug("Stopping websocket failed", e); } webSocketClient.destroy(); } @@ -347,7 +347,7 @@ Message parseIncomingMessage(byte[] data) { message.content.pushCommand = gson.fromJson(message.content.payload, JsonPushCommand.class); } catch (JsonSyntaxException e) { - logger.info("Parsing json failed {}", e); + logger.info("Parsing json failed", e); logger.info("Illegal json: {}", payload); } } @@ -408,7 +408,7 @@ public void onWebSocketBinary(byte @Nullable [] data, int offset, int len) { return; } } catch (Exception e) { - logger.debug("Handling of push notification failed {}", e); + logger.debug("Handling of push notification failed", e); } } @@ -427,7 +427,7 @@ public void onWebSocketClose(int code, @Nullable String reason) { @Override public void onWebSocketError(@Nullable Throwable error) { - logger.info("Web Socket error {}", error); + logger.info("Web Socket error", error); WebSocketConnection.this.close(); } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandler.java index cd288e6dc3d46..b24bb64594f48 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -48,7 +48,7 @@ protected ChannelHandler(IAmazonThingHandler thingHandler, Gson gson) { try { return gson.fromJson(json, type); } catch (JsonSyntaxException e) { - logger.debug("Json parse error {}", e); + logger.debug("Json parse error", e); return null; } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java index 3d663522d61ba..2464c2e3cb068 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerAnnouncement.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,6 @@ import java.net.URISyntaxException; import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.types.Command; @@ -32,10 +31,13 @@ * @author Michael Geramb - Initial contribution */ public class ChannelHandlerAnnouncement extends ChannelHandler { - public static final String CHANNEL_NAME = "announcement"; + private static final String CHANNEL_NAME = "announcement"; - public ChannelHandlerAnnouncement(IAmazonThingHandler thingHandler, Gson gson) { + protected final IEchoThingHandler thingHandler; + + public ChannelHandlerAnnouncement(IEchoThingHandler thingHandler, Gson gson) { super(thingHandler, gson); + this.thingHandler = thingHandler; } @Override @@ -47,15 +49,16 @@ public boolean tryHandleCommand(Device device, Connection connection, String cha String body = commandValue; String title = null; String speak = commandValue; + Integer volume = null; if (commandValue.startsWith("{") && commandValue.endsWith("}")) { try { AnnouncementRequestJson request = parseJson(commandValue, AnnouncementRequestJson.class); if (request != null) { - if (StringUtils.isEmpty(request.speak)) { + speak = request.speak; + if (speak == null || speak.length() == 0) { speak = " "; // blank generates a beep - } else { - speak = request.speak; } + volume = request.volume; title = request.title; body = request.body; if (body == null) { @@ -72,6 +75,9 @@ public boolean tryHandleCommand(Device device, Connection connection, String cha speak = "<speak><lang xml:lang=\"en-UK\">Error: The combination of sound and speak in <prosody rate=\"x-slow\"><say-as interpret-as=\"characters\">SSML</say-as></prosody> syntax is not allowed</lang></speak>"; } } + if ("<speak> </speak>".equals(speak)) { + volume = -1; // Do not change volume + } } } catch (JsonSyntaxException e) { body = "Invalid Json." + e.getLocalizedMessage(); @@ -81,7 +87,7 @@ public boolean tryHandleCommand(Device device, Connection connection, String cha body = e.getLocalizedMessage(); } } - connection.sendAnnouncement(device, speak, body, title, 0, 0); + thingHandler.startAnnouncment(device, speak, body, title, volume); } RefreshChannel(); } @@ -97,5 +103,6 @@ static class AnnouncementRequestJson { public @Nullable String title; public @Nullable String body; public @Nullable String speak; + public @Nullable Integer volume; } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerSendMessage.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerSendMessage.java new file mode 100644 index 0000000000000..75893ec405310 --- /dev/null +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/ChannelHandlerSendMessage.java @@ -0,0 +1,128 @@ +/** + * 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.amazonechocontrol.internal.channelhandler; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.time.LocalDateTime; + +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.amazonechocontrol.internal.Connection; +import org.openhab.binding.amazonechocontrol.internal.jsons.JsonDevices.Device; + +import com.google.gson.Gson; + +/** + * The {@link ChannelHandlerSendMessage} is responsible for the announcement channel + * + * @author Michael Geramb - Initial contribution + */ +public class ChannelHandlerSendMessage extends ChannelHandler { + private static final String CHANNEL_NAME = "sendMessage"; + private @Nullable AccountJson accountJson; + private int lastMessageId = 1000; + + public ChannelHandlerSendMessage(IAmazonThingHandler thingHandler, Gson gson) { + super(thingHandler, gson); + } + + @Override + public boolean tryHandleCommand(Device device, Connection connection, String channelId, Command command) + throws IOException, URISyntaxException { + if (channelId.equals(CHANNEL_NAME)) { + if (command instanceof StringType) { + String commandValue = ((StringType) command).toFullString(); + String baseUrl = "https://alexa-comms-mobile-service." + connection.getAmazonSite(); + + AccountJson currentAccountJson = this.accountJson; + if (currentAccountJson == null) { + String accountResult = connection.makeRequestAndReturnString(baseUrl + "/accounts"); + AccountJson[] accountsJson = this.gson.fromJson(accountResult, AccountJson[].class); + if (accountsJson == null) { + return false; + } + for (AccountJson accountJson : accountsJson) { + Boolean signedInUser = accountJson.signedInUser; + if (signedInUser != null && signedInUser) { + this.accountJson = accountJson; + currentAccountJson = accountJson; + break; + } + } + } + if (currentAccountJson == null) { + return false; + } + String commsId = currentAccountJson.commsId; + if (commsId == null) { + return false; + } + String senderCommsId = commsId; + String receiverCommsId = commsId; + + SendConversationJson conversationJson = new SendConversationJson(); + conversationJson.conversationId = "amzn1.comms.messaging.id.conversationV2~31e6fe8f-8b0c-4e84-a1e4-80030a09009b"; + conversationJson.clientMessageId = java.util.UUID.randomUUID().toString(); + conversationJson.messageId = lastMessageId++; + conversationJson.sender = senderCommsId; + conversationJson.time = LocalDateTime.now().toString(); + conversationJson.payload.text = commandValue; + + String sendConversationBody = this.gson.toJson(new SendConversationJson[] { conversationJson }); + String sendUrl = baseUrl + "/users/" + senderCommsId + "/conversations/" + receiverCommsId + + "/messages"; + connection.makeRequestAndReturnString("POST", sendUrl, sendConversationBody, true, null); + } + RefreshChannel(); + } + return false; + } + + void RefreshChannel() { + thingHandler.updateChannelState(CHANNEL_NAME, new StringType("")); + } + + static class AccountJson { + public @Nullable String commsId; + public @Nullable String directedId; + public @Nullable String phoneCountryCode; + public @Nullable String phoneNumber; + public @Nullable String firstName; + public @Nullable String lastName; + public @Nullable String phoneticFirstName; + public @Nullable String phoneticLastName; + public @Nullable String commsProvisionStatus; + public @Nullable Boolean isChild; + public @Nullable Boolean signedInUser; + public @Nullable Boolean commsProvisioned; + public @Nullable Boolean speakerProvisioned; + } + + static class SendConversationJson { + public @Nullable String conversationId; + public @Nullable String clientMessageId; + public @Nullable Integer messageId; + public @Nullable String time; + public @Nullable String sender; + public String type = "message/text"; + public Payload payload = new Payload(); + public Integer status = 1; + + static class Payload { + public @Nullable String text; + } + } + +} diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IAmazonThingHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IAmazonThingHandler.java index f0e412c9879ed..c5c7684b2eb48 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IAmazonThingHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IAmazonThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IEchoThingHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IEchoThingHandler.java new file mode 100644 index 0000000000000..967926ccbd256 --- /dev/null +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/channelhandler/IEchoThingHandler.java @@ -0,0 +1,31 @@ +/** + * 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.amazonechocontrol.internal.channelhandler; + +import java.io.IOException; +import java.net.URISyntaxException; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.amazonechocontrol.internal.jsons.JsonDevices.Device; + +/** + * The {@link IEchoThingHandler} is used from ChannelHandlers to communicate with the thing + * + * @author Michael Geramb - Initial contribution + */ +@NonNullByDefault +public interface IEchoThingHandler extends IAmazonThingHandler { + void startAnnouncment(Device device, String speak, String bodyText, @Nullable String title, + @Nullable Integer volume) throws IOException, URISyntaxException; +} diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java old mode 100755 new mode 100644 index 29158a5d9c701..0cb44a44a5588 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/discovery/AmazonEchoDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java old mode 100755 new mode 100644 index 871c56798e13b..b4482c4024ed3 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/AccountHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -40,12 +40,16 @@ import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; import org.openhab.binding.amazonechocontrol.internal.AccountServlet; import org.openhab.binding.amazonechocontrol.internal.Connection; import org.openhab.binding.amazonechocontrol.internal.ConnectionException; import org.openhab.binding.amazonechocontrol.internal.HttpException; import org.openhab.binding.amazonechocontrol.internal.IWebSocketCommandHandler; import org.openhab.binding.amazonechocontrol.internal.WebSocketConnection; +import org.openhab.binding.amazonechocontrol.internal.channelhandler.ChannelHandler; +import org.openhab.binding.amazonechocontrol.internal.channelhandler.ChannelHandlerSendMessage; +import org.openhab.binding.amazonechocontrol.internal.channelhandler.IAmazonThingHandler; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonActivities.Activity; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonActivities.Activity.SourceDeviceId; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonAscendingAlarm.AscendingAlarmModel; @@ -78,7 +82,7 @@ * @author Michael Geramb - Initial Contribution */ @NonNullByDefault -public class AccountHandler extends BaseBridgeHandler implements IWebSocketCommandHandler { +public class AccountHandler extends BaseBridgeHandler implements IWebSocketCommandHandler, IAmazonThingHandler { private final Logger logger = LoggerFactory.getLogger(AccountHandler.class); private Storage<String> stateStorage; @@ -97,12 +101,14 @@ public class AccountHandler extends BaseBridgeHandler implements IWebSocketComma private @Nullable AccountServlet accountServlet; private final Gson gson; int checkDataCounter; + private List<ChannelHandler> channelHandlers = new ArrayList<>(); public AccountHandler(Bridge bridge, HttpService httpService, Storage<String> stateStorage, Gson gson) { super(bridge); this.gson = gson; this.httpService = httpService; this.stateStorage = stateStorage; + channelHandlers.add(new ChannelHandlerSendMessage(this, this.gson)); } @Override @@ -127,11 +133,31 @@ public void initialize() { logger.debug("amazon account bridge handler started."); } + @Override + public void updateChannelState(String channelId, State state) { + updateState(channelId, state); + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.trace("Command '{}' received for channel '{}'", command, channelUID); - if (command instanceof RefreshType) { - refreshData(); + try { + logger.trace("Command '{}' received for channel '{}'", command, channelUID); + Connection connection = this.connection; + if (connection == null) { + return; + } + + String channelId = channelUID.getId(); + for (ChannelHandler channelHandler : channelHandlers) { + if (channelHandler.tryHandleCommand(new Device(), connection, channelId, command)) { + return; + } + } + if (command instanceof RefreshType) { + refreshData(); + } + } catch (IOException | URISyntaxException e) { + logger.info("handleCommand fails", e); } } @@ -318,7 +344,7 @@ private void checkLogin() { } } catch (Exception e) { // this handler can be removed later, if we know that nothing else can fail. - logger.error("check login fails with unexpected error {}", e); + logger.error("check login fails with unexpected error", e); } } @@ -359,7 +385,7 @@ boolean checkWebSocketConnection() { this.webSocketConnection = new WebSocketConnection(connection.getAmazonSite(), connection.getSessionCookies(), this); } catch (IOException e) { - logger.warn("Web socket connection starting failed: {}", e); + logger.warn("Web socket connection starting failed", e); } } return false; @@ -383,9 +409,9 @@ private void checkData() { } logger.debug("checkData {} finished", getThing().getUID().getAsString()); } catch (HttpException | JsonSyntaxException | ConnectionException e) { - logger.debug("checkData fails {}", e); + logger.debug("checkData fails", e); } catch (Exception e) { // this handler can be removed later, if we know that nothing else can fail. - logger.error("checkData fails with unexpected error {}", e); + logger.error("checkData fails with unexpected error", e); } } } @@ -403,7 +429,7 @@ private void refreshNotifications(@Nullable JsonCommandPayloadPushNotificationCh try { notifications = currentConnection.notifications(); } catch (IOException | URISyntaxException e) { - logger.debug("refreshNotifications failed {}", e); + logger.debug("refreshNotifications failed", e); return; } ZonedDateTime timeStampNow = ZonedDateTime.now(); @@ -454,7 +480,7 @@ private void refreshData() { try { musicProviders = currentConnection.getMusicProviders(); } catch (HttpException | JsonSyntaxException | ConnectionException e) { - logger.debug("Update music provider failed {}", e); + logger.debug("Update music provider failed", e); } } } @@ -470,13 +496,13 @@ private void refreshData() { try { notificationSounds = currentConnection.getNotificationSounds(device); } catch (IOException | HttpException | JsonSyntaxException | ConnectionException e) { - logger.debug("Update notification sounds failed {}", e); + logger.debug("Update notification sounds failed", e); } // update playlists try { playlists = currentConnection.getPlaylists(device); } catch (IOException | HttpException | JsonSyntaxException | ConnectionException e) { - logger.debug("Update playlist failed {}", e); + logger.debug("Update playlist failed", e); } } @@ -517,9 +543,9 @@ private void refreshData() { logger.debug("refresh data {} finished", getThing().getUID().getAsString()); } catch (HttpException | JsonSyntaxException | ConnectionException e) { - logger.debug("refresh data fails {}", e); + logger.debug("refresh data fails", e); } catch (Exception e) { // this handler can be removed later, if we know that nothing else can fail. - logger.error("refresh data fails with unexpected error {}", e); + logger.error("refresh data fails with unexpected error", e); } } } @@ -611,7 +637,7 @@ public void setEnabledFlashBriefingsJson(String flashBriefingJson) { try { currentConnection.setEnabledFlashBriefings(feeds); } catch (IOException | URISyntaxException e) { - logger.warn("Set flashbriefing profile failed {}", e); + logger.warn("Set flashbriefing profile failed", e); } } updateFlashBriefingHandlers(); @@ -673,7 +699,7 @@ private void updateFlashBriefingProfiles(Connection currentConnection) { } this.currentFlashBriefingJson = gson.toJson(forSerializer); } catch (HttpException | JsonSyntaxException | IOException | URISyntaxException | ConnectionException e) { - logger.warn("get flash briefing profiles fails {}", e); + logger.warn("get flash briefing profiles fails", e); } } @@ -684,7 +710,7 @@ public void webSocketCommandReceived(JsonPushCommand pushCommand) { handleWebsocketCommand(pushCommand); } catch (Exception e) { // should never happen, but if the exception is going out of this function, the binding stop working. - logger.warn("handling of websockets fails: {}", e); + logger.warn("handling of websockets fails", e); } } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java old mode 100755 new mode 100644 index b5c5901023ded..5867ec69de201 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,7 +12,46 @@ */ package org.openhab.binding.amazonechocontrol.internal.handler; -import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.*; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC_PLAY_LIST_ID; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_AMAZON_MUSIC_TRACK_ID; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_ASCENDING_ALARM; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH_DEVICE_NAME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_BLUETOOTH_MAC; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_BASS; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_MIDRANGE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_EQUALIZER_TREBLE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_IMAGE_URL; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_LAST_VOICE_COMMAND; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_LENGTH; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_PROGRESS; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MEDIA_PROGRESS_TIME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_MUSIC_PROVIDER_ID; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_ALARM; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_MUSIC_ALARM; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_REMINDER; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NEXT_TIMER; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_NOTIFICATION_VOLUME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAYER; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_ALARM_SOUND; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_MUSIC_VOICE_COMMAND; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PLAY_ON_DEVICE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_PROVIDER_DISPLAY_NAME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_RADIO; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_RADIO_STATION_ID; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_REMIND; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SHUFFLE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_START_COMMAND; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_START_ROUTINE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SUBTITLE1; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_SUBTITLE2; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TEXT_TO_SPEECH; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TEXT_TO_SPEECH_VOLUME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_TITLE; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.CHANNEL_VOLUME; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.DEVICE_PROPERTY_SERIAL_NUMBER; +import static org.openhab.binding.amazonechocontrol.internal.AmazonEchoControlBindingConstants.FLASH_BRIEFING_COMMAND_PREFIX; import java.io.IOException; import java.net.URISyntaxException; @@ -63,7 +102,7 @@ import org.openhab.binding.amazonechocontrol.internal.HttpException; import org.openhab.binding.amazonechocontrol.internal.channelhandler.ChannelHandler; import org.openhab.binding.amazonechocontrol.internal.channelhandler.ChannelHandlerAnnouncement; -import org.openhab.binding.amazonechocontrol.internal.channelhandler.IAmazonThingHandler; +import org.openhab.binding.amazonechocontrol.internal.channelhandler.IEchoThingHandler; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonActivities.Activity; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonActivities.Activity.Description; import org.openhab.binding.amazonechocontrol.internal.jsons.JsonAscendingAlarm.AscendingAlarmModel; @@ -99,7 +138,7 @@ * @author Michael Geramb - Initial contribution */ @NonNullByDefault -public class EchoHandler extends BaseThingHandler implements IAmazonThingHandler { +public class EchoHandler extends BaseThingHandler implements IEchoThingHandler { private final Logger logger = LoggerFactory.getLogger(EchoHandler.class); private Gson gson; @@ -686,10 +725,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { } else { this.updateStateJob = scheduler.schedule(doRefresh, waitForUpdate, TimeUnit.MILLISECONDS); } - } catch (IOException | - - URISyntaxException e) { - logger.info("handleCommand fails: {}", e); + } catch (IOException | URISyntaxException e) { + logger.info("handleCommand fails", e); } } @@ -719,7 +756,7 @@ private boolean handleEqualizerCommands(String channelId, Command command, Conne connection.SetEqualizer(device, newEqualizerSetting); return true; } catch (HttpException | IOException | ConnectionException e) { - logger.debug("Update equalizer failed {}", e); + logger.debug("Update equalizer failed", e); this.lastKnownEqualizer = null; } @@ -730,22 +767,38 @@ private boolean handleEqualizerCommands(String channelId, Command command, Conne private void startTextToSpeech(Connection connection, Device device, String text) throws IOException, URISyntaxException { + Integer volume = null; if (textToSpeechVolume != 0) { - @Nullable - ScheduledFuture<?> oldIgnoreVolumeChange = this.ignoreVolumeChange; - if (oldIgnoreVolumeChange != null) { - oldIgnoreVolumeChange.cancel(false); - } - this.ignoreVolumeChange = scheduler.schedule(this::stopIgnoreVolumeChange, 2000, TimeUnit.MILLISECONDS); + startIgnoreVolumeChange(); + volume = textToSpeechVolume; } if (text.startsWith("<speak>") && text.endsWith("</speak>")) { String bodyText = text.replaceAll("<[^>]+>", ""); - connection.sendAnnouncement(device, text, bodyText, null, textToSpeechVolume, lastKnownVolume); + connection.sendAnnouncement(device, text, bodyText, null, volume, lastKnownVolume); } else { - connection.textToSpeech(device, text, textToSpeechVolume, lastKnownVolume); + connection.textToSpeech(device, text, volume, lastKnownVolume); } } + @Override + public void startAnnouncment(Device device, String speak, String bodyText, @Nullable String title, + @Nullable Integer volume) throws IOException, URISyntaxException { + Connection connection = this.findConnection(); + if (connection == null) { + return; + } + if (volume == null && textToSpeechVolume != 0) { + volume = textToSpeechVolume; + } + if (volume != null && volume < 0) { + volume = null; // the meaning of negative values is 'do not use'. The api requires null in this case. + } + if (volume != null) { + startIgnoreVolumeChange(); + } + connection.sendAnnouncement(device, speak, bodyText, title, volume, lastKnownVolume); + } + private void stopCurrentNotification() { ScheduledFuture<?> currentNotifcationUpdateTimer = this.currentNotifcationUpdateTimer; if (currentNotifcationUpdateTimer != null) { @@ -760,7 +813,7 @@ private void stopCurrentNotification() { try { currentConnection.stopNotification(currentNotification); } catch (IOException | URISyntaxException e) { - logger.warn("Stop notification failed: {}", e); + logger.warn("Stop notification failed", e); } } } @@ -780,7 +833,7 @@ private void updateNotificationTimerState() { } } } catch (IOException | URISyntaxException e) { - logger.warn("update notification state fails: {}", e); + logger.warn("update notification state fails", e); } if (stopCurrentNotifcation) { if (currentNotification != null) { @@ -891,10 +944,10 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device, if (e.getCode() == 400) { // Ignore } else { - logger.info("getPlayer fails: {}", e); + logger.info("getPlayer fails", e); } } catch (IOException | URISyntaxException e) { - logger.info("getPlayer fails: {}", e); + logger.info("getPlayer fails", e); } // check playing isPlaying = (playerInfo != null && StringUtils.equals(playerInfo.state, "PLAYING")); @@ -947,10 +1000,10 @@ public void updateState(AccountHandler accountHandler, @Nullable Device device, updateState(CHANNEL_RADIO_STATION_ID, new StringType("")); } else { - logger.info("getMediaState fails: {}", e); + logger.info("getMediaState fails", e); } } catch (IOException | URISyntaxException e) { - logger.info("getMediaState fails: {}", e); + logger.info("getMediaState fails", e); } // handle music provider id @@ -1175,7 +1228,7 @@ private void updateEqualizerState() { treble = equalizer.treble; this.lastKnownEqualizer = equalizer; } catch (IOException | URISyntaxException | HttpException | ConnectionException e) { - logger.debug("Get equalizer failes {}", e); + logger.debug("Get equalizer failes", e); return; } if (bass != null) { @@ -1253,6 +1306,15 @@ public void handlePushActivity(Activity pushActivity) { } } + private void startIgnoreVolumeChange() { + @Nullable + ScheduledFuture<?> oldIgnoreVolumeChange = this.ignoreVolumeChange; + if (oldIgnoreVolumeChange != null) { + oldIgnoreVolumeChange.cancel(false); + } + this.ignoreVolumeChange = scheduler.schedule(this::stopIgnoreVolumeChange, 2000, TimeUnit.MILLISECONDS); + } + private void stopIgnoreVolumeChange() { this.ignoreVolumeChange = null; } diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/FlashBriefingProfileHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/FlashBriefingProfileHandler.java index a190b05274674..bf8b2a9de8956 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/FlashBriefingProfileHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/FlashBriefingProfileHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -156,7 +156,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } } catch (IOException | URISyntaxException e) { - logger.warn("Handle command failed {}", e); + logger.warn("Handle command failed", e); } if (waitForUpdate >= 0) { this.updateStateJob = scheduler.schedule(() -> accountHandler.updateFlashBriefingHandlers(), waitForUpdate, diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonActivities.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonActivities.java index b09660af70a1e..7892ce1300ce3 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonActivities.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonActivities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementContent.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementContent.java index ce2296773e417..9d94cd5d84f6d 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementContent.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementContent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementTarget.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementTarget.java index 6e99bec84f1c6..5612805da66b8 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementTarget.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAnnouncementTarget.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAscendingAlarm.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAscendingAlarm.java index 95c4d6c81a8a5..444a2ec67c461 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAscendingAlarm.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAscendingAlarm.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAutomation.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAutomation.java index d3be585e7c7f4..6f529e216bc22 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAutomation.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonAutomation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBluetoothStates.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBluetoothStates.java index 4d2ba0adb07cc..db8d256ba6770 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBluetoothStates.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBluetoothStates.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBootstrapResult.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBootstrapResult.java index dffce100b83b8..747d24f67dd6b 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBootstrapResult.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonBootstrapResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushActivity.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushActivity.java index c53128cf0966a..e62fcdf02b7f0 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushActivity.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushActivity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushAudioPlayerState.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushAudioPlayerState.java index 3aa0740893081..d33188b4372a4 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushAudioPlayerState.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushAudioPlayerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushBluetoothStateChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushBluetoothStateChange.java index fec5439c523c0..2736fa6772a4d 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushBluetoothStateChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushBluetoothStateChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushContentFocusChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushContentFocusChange.java index 20c539d50b007..f29b0be84a69d 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushContentFocusChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushContentFocusChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDevice.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDevice.java index c7b42709229ec..95fee29973f9a 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDevice.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDopllerConnectionChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDopllerConnectionChange.java index 6376e50a439a2..55c833358f75d 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDopllerConnectionChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushDopllerConnectionChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushEqualizerChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushEqualizerChange.java index d2354255b2c5f..d88e9737a43ee 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushEqualizerChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushEqualizerChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaChange.java index 31e08d3cc3e55..4f56a5f340c7e 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaQueueChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaQueueChange.java index 4fb4d30252478..265b0dc7fbb58 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaQueueChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushMediaQueueChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushNotificationChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushNotificationChange.java index c32f9e8518340..676555de250c6 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushNotificationChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushNotificationChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushVolumeChange.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushVolumeChange.java index 0fe803aa91e71..125edf9c92cbb 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushVolumeChange.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonCommandPayloadPushVolumeChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDeviceNotificationState.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDeviceNotificationState.java index 596c172a2048b..1d5093860c7b0 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDeviceNotificationState.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDeviceNotificationState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDevices.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDevices.java old mode 100755 new mode 100644 index 2ff3a02ad65d1..37e074e3e4112 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDevices.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonDevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEnabledFeeds.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEnabledFeeds.java index 50162a3e4c0f5..b2976238f2f5e 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEnabledFeeds.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEnabledFeeds.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEqualizer.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEqualizer.java index b9903243b1a28..daccdcccb130d 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEqualizer.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonEqualizer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonExchangeTokenResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonExchangeTokenResponse.java index 48807bea68910..559837d514779 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonExchangeTokenResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonExchangeTokenResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonFeed.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonFeed.java index 143983cae69ba..cdda3fc862790 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonFeed.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonFeed.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMediaState.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMediaState.java old mode 100755 new mode 100644 index 0d23fb92d1995..92389c207c6cb --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMediaState.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMediaState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMusicProvider.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMusicProvider.java index 4890a5dd0371d..da28a765b015c 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMusicProvider.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonMusicProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationRequest.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationRequest.java index 25e3eb182e0b2..34acee7e78fb2 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationRequest.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationResponse.java index e339d176c5bad..fd4f55c1b7c25 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSound.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSound.java index 2853cfb34f34c..b99502d4258ec 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSound.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSound.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSounds.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSounds.java index ea715dae85c0a..a4eb8b4be7773 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSounds.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationSounds.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationsResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationsResponse.java index b0f8d38917bca..c12a0d12124fb 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationsResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonNotificationsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaySearchPhraseOperationPayload.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaySearchPhraseOperationPayload.java index 49a1c327f1ad3..dda429a2fc31f 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaySearchPhraseOperationPayload.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaySearchPhraseOperationPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayValidationResult.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayValidationResult.java index d6a522c9c0796..fc23e2567f146 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayValidationResult.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayValidationResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayerState.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayerState.java old mode 100755 new mode 100644 index f3013b518cc13..dd106fd811623 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayerState.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlayerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaylists.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaylists.java index d079c686df8c5..3210623b9853c 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaylists.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPlaylists.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPushCommand.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPushCommand.java index fd493d87d2c83..b2b78bb02a723 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPushCommand.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonPushCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppRequest.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppRequest.java index 8b2e2762a22d5..42e5d2d94e1e5 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppRequest.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppResponse.java index b2a22649f54ea..8a7391b4c3fce 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRegisterAppResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRenewTokenResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRenewTokenResponse.java index 4f48efc5e02a9..7133fb8451963 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRenewTokenResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonRenewTokenResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonStartRoutineRequest.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonStartRoutineRequest.java index 219bca29b313a..5e93e372af1ec 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonStartRoutineRequest.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonStartRoutineRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonTokenResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonTokenResponse.java index ab812c7042f92..e95ced344848f 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonTokenResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonTokenResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonUsersMeResponse.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonUsersMeResponse.java index c8714c9de184d..87b283a3fee68 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonUsersMeResponse.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonUsersMeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWakeWords.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWakeWords.java index c59a5bca171ab..57b7fdf5ac228 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWakeWords.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWakeWords.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWebSiteCookie.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWebSiteCookie.java index 2af5feeb24129..948b01711983b 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWebSiteCookie.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/jsons/JsonWebSiteCookie.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/statedescription/AmazonEchoDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/statedescription/AmazonEchoDynamicStateDescriptionProvider.java index 72f2c3b98f0af..9c50084a11c3e 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/statedescription/AmazonEchoDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/statedescription/AmazonEchoDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -79,6 +79,9 @@ protected void unsetThingRegistry(ThingRegistry thingRegistry) { return null; } ThingUID accountThingId = thing.getBridgeUID(); + if (accountThingId == null) { + return null; + } Thing accountThing = thingRegistry.get(accountThingId); if (accountThing == null) { return null; diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/binding/binding.xml old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/i18n/amazonechocontrol_de.properties b/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/i18n/amazonechocontrol_de.properties old mode 100755 new mode 100644 index 3c39840e2980e..699cd51b94144 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/i18n/amazonechocontrol_de.properties +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/i18n/amazonechocontrol_de.properties @@ -56,6 +56,9 @@ channel-type.amazonechocontrol.providerDisplayName.description = Name des Musika channel-type.amazonechocontrol.bluetoothMAC.label = Bluetooth Verbindung channel-type.amazonechocontrol.bluetoothMAC.description = MAC-Adresse des verbundenen Bluetoothgerätes +channel-type.amazonechocontrol.sendMessage.label = Nachricht senden +channel-type.amazonechocontrol.sendMessage.description = Schickt eine Nachricht an die Echo Geräte (Nur schreiben). + channel-type.amazonechocontrol.announcement.label = Ankündigung channel-type.amazonechocontrol.announcement.description = Zeigt die Ankündungsnachricht am Display (Nur schreiben). In der Binding Beschreibung ist im Tutorials Abschnitt eine Erklärung wie der Title gesetzt und der Sound deaktiviert wird. diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/thing/thing-types.xml index dfc4a2efde084..ae8b0443f071b 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,12 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bindingId="amazonechocontrol" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="account"> <label>Amazon Account</label> <description>Amazon Account where the amazon echo devices are registered.</description> + <channels> + <channel id="sendMessage" typeId="sendMessage" /> + </channels> </bridge-type> <thing-type id="echo"> <supported-bridge-type-refs> @@ -40,7 +43,7 @@ <channel id="amazonMusicPlayListId" typeId="amazonMusicPlayListId" /> <channel id="amazonMusic" typeId="amazonMusic" /> - <channel id="announcement" typeId="announcement" /> + <channel id="announcement" typeId="announcement" /> <channel id="textToSpeech" typeId="textToSpeech" /> <channel id="textToSpeechVolume" typeId="textToSpeechVolume" /> <channel id="remind" typeId="remind" /> @@ -261,7 +264,7 @@ </channel-type> <channel-type id="startRoutine" advanced="true"> <item-type>String</item-type> - <label>Start A Routine</label> + <label>Start a Routine</label> <description>The command which must be spoken to active the routing without the preceding "Alexa," (Write Only) </description> </channel-type> @@ -384,6 +387,11 @@ <label>Music Voice Command</label> <description>Voice command as text. E.g. 'Yesterday from the Beatles' (Write only)</description> </channel-type> + <channel-type id="sendMessage" advanced="false"> + <item-type>String</item-type> + <label>Send Message</label> + <description>Sends a message to the Echo devices (Write only).</description> + </channel-type> <channel-type id="announcement" advanced="true"> <item-type>String</item-type> <label>Announcement</label> @@ -440,7 +448,7 @@ </channel-type> <channel-type id="notificationVolume" advanced="true"> <item-type>Dimmer</item-type> - <label>Notification volume</label> + <label>Notification Volume</label> <description>Notification Volume</description> <state readOnly="false" /> </channel-type> diff --git a/bundles/org.openhab.binding.ambientweather/NOTICE b/bundles/org.openhab.binding.ambientweather/NOTICE index 47910b33d6c9f..b490a72fbb6ce 100644 --- a/bundles/org.openhab.binding.ambientweather/NOTICE +++ b/bundles/org.openhab.binding.ambientweather/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content @@ -37,4 +37,4 @@ okio socket.io-client * License: MIT License * Project: https://socketio.github.io/socket.io-client-java/ -* Source: https://github.com/socketio/socket.io-client-java \ No newline at end of file +* Source: https://github.com/socketio/socket.io-client-java diff --git a/bundles/org.openhab.binding.ambientweather/README.md b/bundles/org.openhab.binding.ambientweather/README.md index af4054bf246a2..70c18a79032bd 100644 --- a/bundles/org.openhab.binding.ambientweather/README.md +++ b/bundles/org.openhab.binding.ambientweather/README.md @@ -1,16 +1,20 @@ # Ambient Weather Binding The Ambient Weather binding integrates weather station data that's stored on the Ambient Weather online service. -The binding uses Ambient Weather's real-time API, so updates from weather stations are delivered the the binding in near real-time. +The binding uses Ambient Weather's real-time API, so updates from weather stations are delivered to the binding in near real-time. ## Supported Things -The binding currently supports weather data from these weather stations +The binding currently supports weather data from these weather stations. -- WS-0900-IP, -- WS-1400-IP / WS-1401-IP, -- WS-2902A, and -- WS-8482. +| Thing | ID | +|--------------------------|-----------| +| Account | bridge | +| WS-0900-IP | ws0900ip | +| WS-1400-IP / WS-1401-IP | ws1400ip | +| WS-2902A | ws2902a | +| WS-8482 | ws8482 | +| WS-0265 | ws0265 | Other stations can be added relatively easily with changes in just several places in the source code. @@ -20,15 +24,18 @@ Automatic discovery is currently not supported due to the lack of weather statio ## Thing Configuration -### Bridge Thing Configuration +### Account -The Bridge thing requires a valid application Key and API key. -Application and API keys can be obtained on the *My Account* page of your `ambientweather.net` dashboard. +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|-------------------|-------------------|-------------| +| API Key | apiKey | Required | Obtain the API key on the *My Account* page of your `ambientweather.net` dashboard. | +| Application Key | apiKey | Required | Obtain the Application key on the *My Account* page of your `ambientweather.net` dashboard. | -### Weather Station Thing Configuration +### Weather Station -The Weather Station things require the MAC address of the weather station. -This MAC address must be on the same `ambientweather.net` dashboard as the API and Application keys. +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|-------------------|-------------------|-------------| +| MAC Address | macAddress | Required | This is the weather station's MAC address. It must be configured in your `ambientweather.net` dashboard. | ## Channels @@ -76,6 +83,8 @@ The following channels are supported by the binding. Note that specific weather | indoorSensor | batteryIndicator | String | Battery indicator | | | | | | | remoteSensor\<1-10\> | temperature | Number:Temperature | Temperature | +| remoteSensor\<1-10\> | dewPoint | Number:Temperature | Dew Point | +| remoteSensor\<1-10\> | feelingTemperature | Number:Temperature | "Real feel" temperature | | remoteSensor\<1-10\> | humidity | Number:Dimensionless | Humidity | | remoteSensor\<1-10\> | batteryIndicator | String | Battery indicator | | remoteSensor\<1-10\> | co2 | Number:Dimensionless | Carbon Dioxide level | @@ -89,9 +98,9 @@ The following channels are supported by the binding. Note that specific weather ### Things ``` -Bridge ambientweather:bridge:mybridge [ applicationKey="abcdefg", apiKey="tuvwxyz" ] { - Thing ambientweather:ws1400ip:ws1400ip WS-1400IP [ macAddress="00:f1:bb:00:00:01" ] - Thing ambientweather:ws8482:ws8482 WS-8482 [ macAddress="00:f1:bb:00:00:ab" ] +Bridge ambientweather:bridge:account "Ambient Weather Account" [ applicationKey="bd7eb3fe87f74e9.....", apiKey="efe88d6202be43e6a40....." ] { + Thing ws1400ip 1400 "Ambient Weather WS-1400-IP" [ macAddress="00:ab:cd:00:00:01" ] + Thing ws8482 8482 "Ambient Weather WS-8482" [ macAddress="00:ab:cd:00:00:02" ] } ``` @@ -99,64 +108,64 @@ Bridge ambientweather:bridge:mybridge [ applicationKey="abcdefg", apiKey="tuvwxy ``` // WS-1400-IP Weather Station -String WS1400IP_StationName "Station Name [%s]" { channel="ambientweather:ws1400ip:ws1400ip:station#name" } -String WS1400IP_StationLocation "Station Location [%s]" { channel="ambientweather:ws1400ip:ws1400ip:station#location" } - -DateTime WS1400IP_ObservationTime "Station Observation Time [%s]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#observationTime" } -String WS1400IP_StationBattery "Station Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#batteryIndicator" } -Number:Temperature WS1400IP_Temperature "Temperature [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#temperature" } -Number:Temperature WS1400IP_DewPoint "Dew Point [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#dewPoint" } -Number:Temperature WS1400IP_RealFeel "RealFeel [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#feelingTemperature" } -Number:Dimensionless WS1400IP_Humidity "Humidity [%.1f %%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#relativeHumidity" } -Number:Pressure WS1400IP_PressureAbsolute "Pressure Absolute [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#pressureAbsolute" } -Number:Pressure WS1400IP_PressureRelative "Pressure Relative [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#pressureRelative" } -String WS1400IP_PressureTrend "Pressure Trend [%s] { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#pressureTrend" } - -Number:Speed WS1400IP_WindSpeed "Wind Speed [%.0f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#windSpeed" } -Number:Angle WS1400IP_WindDirectionDegrees "Wind Direction Degrees [%d %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#windDirectionDegrees" } -String WS1400IP_WindDirection "Wind Direction [%s]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#windDirection" } -Number:Speed WS1400IP_WindGust "Wind Gust [%.0f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#windGust" } -Number:Speed WS1400IP_WindGustDailyMax "Wind Gust Max Daily [%.0f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#windGustMaxDaily" } +String WS1400IP_StationName "Station Name [%s]" { channel="ambientweather:ws1400ip:account:1400:station#name" } +String WS1400IP_StationLocation "Station Location [%s]" { channel="ambientweather:ws1400ip:account:1400:station#location" } + +DateTime WS1400IP_ObservationTime "Station Observation Time [%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#observationTime" } +String WS1400IP_StationBattery "Station Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#batteryIndicator" } +Number:Temperature WS1400IP_Temperature "Temperature [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#temperature" } +Number:Temperature WS1400IP_DewPoint "Dew Point [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#dewPoint" } +Number:Temperature WS1400IP_RealFeel "RealFeel [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#feelingTemperature" } +Number:Dimensionless WS1400IP_Humidity "Humidity [%.1f %%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#relativeHumidity" } +Number:Pressure WS1400IP_PressureAbsolute "Pressure Absolute [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#pressureAbsolute" } +Number:Pressure WS1400IP_PressureRelative "Pressure Relative [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#pressureRelative" } +String WS1400IP_PressureTrend "Pressure Trend [%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#pressureTrend" } + +Number:Speed WS1400IP_WindSpeed "Wind Speed [%.0f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#windSpeed" } +Number:Angle WS1400IP_WindDirectionDegrees "Wind Direction Degrees [%d %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#windDirectionDegrees" } +String WS1400IP_WindDirection "Wind Direction [%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#windDirection" } +Number:Speed WS1400IP_WindGust "Wind Gust [%.0f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#windGust" } +Number:Speed WS1400IP_WindGustDailyMax "Wind Gust Max Daily [%.0f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#windGustMaxDaily" } // Use this if your units are SI -Number:Speed WS1400IP_RainHourlyRate "Rain Hourly Rate [%.1f mm/h]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainHourlyRate" } +Number:Speed WS1400IP_RainHourlyRate "Rain Hourly Rate [%.1f mm/h]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainHourlyRate" } // Use this if your units are Imperial -Number:Speed WS1400IP_RainHourlyRate "Rain Hourly Rate [%.2f in/h]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainHourlyRate" } +Number:Speed WS1400IP_RainHourlyRate "Rain Hourly Rate [%.2f in/h]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainHourlyRate" } -Number:Length WS1400IP_RainDaily "Rain Daily [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainDay" } -Number:Length WS1400IP_RainWeekly "Rain Weekly [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainWeek" } -Number:Length WS1400IP_RainMonthly "Rain Monthly [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainMonth" } -Number:Length WS1400IP_RainYearly "Rain Yearly [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainYear" } -Number:Length WS1400IP_RainTotal "Rain Total [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainTotal" } -Number:Length WS1400IP_RainEvent "Rain Event [%.2f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainEvent" } -DateTime WS1400IP_RainLastTime "Rain Last Time [%s]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#rainLastTime" } +Number:Length WS1400IP_RainDaily "Rain Daily [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainDay" } +Number:Length WS1400IP_RainWeekly "Rain Weekly [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainWeek" } +Number:Length WS1400IP_RainMonthly "Rain Monthly [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainMonth" } +Number:Length WS1400IP_RainYearly "Rain Yearly [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainYear" } +Number:Length WS1400IP_RainTotal "Rain Total [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainTotal" } +Number:Length WS1400IP_RainEvent "Rain Event [%.2f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainEvent" } +DateTime WS1400IP_RainLastTime "Rain Last Time [%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#rainLastTime" } -Number:Intensity WS1400IP_SolarRadiation "Solar Radiation [%.0f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#solarRadiation" } -Number WS1400IP_UVIndex "UV Index [%.0f]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#uvIndex" } -String WS1400IP_UVDanger "UV Danger Level [%s]" { channel="ambientweather:ws1400ip:ws1400ip:weatherDataWs1400ip#uvDanger" } +Number:Intensity WS1400IP_SolarRadiation "Solar Radiation [%.0f %unit%]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#solarRadiation" } +Number WS1400IP_UVIndex "UV Index [%.0f]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#uvIndex" } +String WS1400IP_UVDanger "UV Danger Level [%s]" { channel="ambientweather:ws1400ip:account:1400:weatherDataWs1400ip#uvDanger" } -Number:Temperature WS1400IP_IndoorTemperature "Indoor Temperature [%.1f %unit%]" { channel="ambientweather:ws1400ip:ws1400ip:indoorSensor#temperature" } -Number:Dimensionless WS1400IP_IndoorHumidity "Indoor Humidity [%.1f %%]" { channel="ambientweather:ws1400ip:ws1400ip:indoorSensor#relativeHumidity" } -String WS1400IP_IndoorBattery "Indoor Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws1400ip:ws1400ip:indoorSensor#batteryIndicator" } +Number:Temperature WS1400IP_IndoorTemperature "Indoor Temperature [%.1f %unit%]" { channel="ambientweather:ws1400ip:account:1400:indoorSensor#temperature" } +Number:Dimensionless WS1400IP_IndoorHumidity "Indoor Humidity [%.1f %%]" { channel="ambientweather:ws1400ip:account:1400:indoorSensor#relativeHumidity" } +String WS1400IP_IndoorBattery "Indoor Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws1400ip:account:1400:indoorSensor#batteryIndicator" } // WS-8482 Weather Station String WS8482_StationName "Station Name [%s]" { channel="ambientweather:ws8482:ws8482:station#name" } String WS8482_StationLocation "Station Location [%s]" { channel="ambientweather:ws8482:ws8482:station#location" } -DateTime WS8482_ObservationTime "Observation Time [%s]" { channel="ambientweather:ws8482:ws8482:weatherDataWs8482#observationTime" } -Number:Temperature WS8482_IndoorTemperature "Indoor Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:ws8482:weatherDataWs8482#temperature" } -Number:Dimensionless WS8482_IndoorHumidity "Indoor Humidity [%.1f %%]" { channel="ambientweather:ws8482:ws8482:weatherDataWs8482#relativeHumidity" } -String WS8482_StationBattery "Station Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:ws8482:weatherDataWs8482#batteryIndicator" } +DateTime WS8482_ObservationTime "Observation Time [%s]" { channel="ambientweather:ws8482:account:8482:weatherDataWs8482#observationTime" } +Number:Temperature WS8482_IndoorTemperature "Indoor Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:account:8482:weatherDataWs8482#temperature" } +Number:Dimensionless WS8482_IndoorHumidity "Indoor Humidity [%.1f %%]" { channel="ambientweather:ws8482:account:8482:weatherDataWs8482#relativeHumidity" } +String WS8482_StationBattery "Station Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:account:8482:weatherDataWs8482#batteryIndicator" } -Number:Temperature WS8482_RemoteTemperature "Remote Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:ws8482:remoteSensor1#temperature" } -Number:Dimensionless WS8482_RemoteHumidity "Remote Humidity [%.1f %%]" { channel="ambientweather:ws8482:ws8482:remoteSensor1#relativeHumidity" } -String WS8482_RemoteBattery "Remote Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:ws8482:remoteSensor1#batteryIndicator" } +Number:Temperature WS8482_RemoteTemperature "Remote Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:account:8482:remoteSensor1#temperature" } +Number:Dimensionless WS8482_RemoteHumidity "Remote Humidity [%.1f %%]" { channel="ambientweather:ws8482:account:8482:remoteSensor1#relativeHumidity" } +String WS8482_RemoteBattery "Remote Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:account:8482:remoteSensor1#batteryIndicator" } -Number:Temperature WS8482_SoilTemperature "Soil Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:ws8482:remoteSensor2#soilTemperature" } -Number:Dimensionless WS8482_SoilMoisture "Soil Moisture [%.1f %%]" { channel="ambientweather:ws8482:ws8482:remoteSensor2#soilMoisture" } -String WS8482_SoilMoistureLevel "Soil Moisture Level [%s]" { channel="ambientweather:ws8482:ws8482:remoteSensor2#soilMoistureLevel" } -String WS8482_SoilSensorBattery "Remote Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:ws8482:remoteSensor2#batteryIndicator" } +Number:Temperature WS8482_SoilTemperature "Soil Temperature [%.1f %unit%]" { channel="ambientweather:ws8482:account:8482:remoteSensor2#soilTemperature" } +Number:Dimensionless WS8482_SoilMoisture "Soil Moisture [%.1f %%]" { channel="ambientweather:ws8482:account:8482:remoteSensor2#soilMoisture" } +String WS8482_SoilMoistureLevel "Soil Moisture Level [%s]" { channel="ambientweather:ws8482:account:8482:remoteSensor2#soilMoistureLevel" } +String WS8482_SoilSensorBattery "Remote Battery [MAP(ambient-battery.map):%s]" { channel="ambientweather:ws8482:account:8482:remoteSensor2#batteryIndicator" } ``` ### Transforms diff --git a/bundles/org.openhab.binding.bluetooth.bluez/embedExternalDependency.profile b/bundles/org.openhab.binding.ambientweather/noEmbedDependencies.profile similarity index 100% rename from bundles/org.openhab.binding.bluetooth.bluez/embedExternalDependency.profile rename to bundles/org.openhab.binding.ambientweather/noEmbedDependencies.profile diff --git a/bundles/org.openhab.binding.ambientweather/pom.xml b/bundles/org.openhab.binding.ambientweather/pom.xml index f6ce535ebc4c5..1c189cee07733 100644 --- a/bundles/org.openhab.binding.ambientweather/pom.xml +++ b/bundles/org.openhab.binding.ambientweather/pom.xml @@ -1,13 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.ambientweather</artifactId> @@ -15,44 +13,40 @@ <name>openHAB Add-ons :: Bundles :: Ambient Weather Binding</name> <dependencies> - <!-- https://mvnrepository.com/artifact/io.socket/socket.io-client --> <dependency> - <groupId>io.socket</groupId> - <artifactId>socket.io-client</artifactId> + <groupId>org.openhab.osgiify</groupId> + <artifactId>io.socket.socket.io-client</artifactId> <version>1.0.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> - <!-- https://mvnrepository.com/artifact/io.socket/engine.io-client --> <dependency> - <groupId>io.socket</groupId> - <artifactId>engine.io-client</artifactId> + <groupId>org.openhab.osgiify</groupId> + <artifactId>io.socket.engine.io-client</artifactId> <version>1.0.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> - <!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp --> <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>okhttp</artifactId> - <version>3.12.1</version> - <scope>provided</scope> + <groupId>org.apache.servicemix.bundles</groupId> + <artifactId>org.apache.servicemix.bundles.okhttp</artifactId> + <version>3.8.1_1</version> + <scope>compile</scope> </dependency> - <!-- https://mvnrepository.com/artifact/com.squareup.okio/okio --> <dependency> - <groupId>com.squareup.okio</groupId> - <artifactId>okio</artifactId> - <version>1.15.0</version> - <scope>provided</scope> + <groupId>org.apache.servicemix.bundles</groupId> + <artifactId>org.apache.servicemix.bundles.okio</artifactId> + <version>1.13.0_1</version> + <scope>compile</scope> </dependency> - <!-- https://mvnrepository.com/artifact/org.json/json --> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20180813</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> <properties> <bnd.importpackage>android.*;resolution:=optional,com.android.org.*;resolution:=optional,dalvik.*;resolution:=optional,javax.annotation.meta.*;resolution:=optional,org.apache.harmony.*;resolution:=optional,org.conscrypt.*;resolution:=optional,sun.security.*;resolution:=optional</bnd.importpackage> </properties> + </project> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/feature/feature.xml b/bundles/org.openhab.binding.ambientweather/src/main/feature/feature.xml index 0ee1bc41f42ac..f7a6bc88e646d 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/feature/feature.xml @@ -1,15 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.ambientweather-${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/${project.version}/xml/features - </repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-ambientweather" description="Ambient Weather Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> + <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.okhttp/3.8.1_1</bundle> + <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.okio/1.13.0_1</bundle> + <bundle dependency="true">mvn:org.openhab.osgiify/io.socket.socket.io-client/1.0.0</bundle> + <bundle dependency="true">mvn:org.openhab.osgiify/io.socket.engine.io-client/1.0.0</bundle> + <bundle dependency="true">mvn:org.json/json/20180813</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ambientweather/${project.version}</bundle> - <bundle dependency="true">wrap:mvn:io.socket/socket.io-client/1.0.0$Bundle-Name=SocketIo%20Client&Bundle-SymbolicName=io.socket.socket.io-client&Bundle-Version=1.0.0</bundle> - <bundle dependency="true">wrap:mvn:io.socket/engine.io-client/1.0.0$Bundle-Name=EngineIo%20Client&Bundle-SymbolicName=io.socket.engine.io-client&Bundle-Version=1.0.0</bundle> - <bundle dependency="true">wrap:mvn:com.squareup.okhttp3/okhttp/3.12.1$Bundle-Name=OkHttp&Bundle-SymbolicName=com.squareup.okhttp3.okhttp&Bundle-Version=3.12.1</bundle> - <bundle dependency="true">wrap:mvn:com.squareup.okio/okio/1.15.0$Bundle-Name=Okio&Bundle-SymbolicName=com.squareup.okio.okio&Bundle-Version=1.15.0</bundle> - <bundle dependency="true">wrap:mvn:org.json/json/20180813$Bundle-Name=Json&Bundle-SymbolicName=org.json.json&Bundle-Version=20180813</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherBindingConstants.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherBindingConstants.java index 2a81b69e6805d..87b75ce025b65 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherBindingConstants.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -49,13 +49,17 @@ public class AmbientWeatherBindingConstants { public static final String THING_TYPE_WS8482 = "ws8482"; public static final ThingTypeUID UID_WS8482 = new ThingTypeUID(BINDING_ID, THING_TYPE_WS8482); - // WS-1400-IP series weather stations + // WS-0900-IP series weather stations public static final String THING_TYPE_WS0900IP = "ws0900ip"; public static final ThingTypeUID UID_WS0900IP = new ThingTypeUID(BINDING_ID, THING_TYPE_WS0900IP); + // WS-0265 weather station + public static final String THING_TYPE_WS0265 = "ws0265"; + public static final ThingTypeUID UID_WS0265 = new ThingTypeUID(BINDING_ID, THING_TYPE_WS0265); + // Collection of weather station thing types public static final Set<ThingTypeUID> SUPPORTED_STATION_THING_TYPES_UIDS = Collections.unmodifiableSet( - Stream.of(UID_WS1400IP, UID_WS2902A, UID_WS8482, UID_WS0900IP).collect(Collectors.toSet())); + Stream.of(UID_WS1400IP, UID_WS2902A, UID_WS8482, UID_WS0900IP, UID_WS0265).collect(Collectors.toSet())); // Collection of all supported thing types public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet( @@ -67,6 +71,7 @@ public class AmbientWeatherBindingConstants { public static final String CHGRP_WS2902A = "weatherDataWs2902a"; public static final String CHGRP_WS8482 = "weatherDataWs8482"; public static final String CHGRP_WS0900IP = "weatherDataWs0900ip"; + public static final String CHGRP_WS0265 = "weatherDataWs0265"; // Channel groups used across weather station types public static final String CHGRP_STATION = "station"; diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherHandlerFactory.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherHandlerFactory.java index 3f76f9b52cedd..8075403939ca0 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherHandlerFactory.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/AmbientWeatherHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,10 +24,9 @@ import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherBridgeHandler; import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The {@link AmbientWeatherHandlerFactory} is responsible for creating the @@ -37,10 +36,14 @@ */ @Component(configurationPid = "binding.ambientweather", service = ThingHandlerFactory.class) public class AmbientWeatherHandlerFactory extends BaseThingHandlerFactory { - private final Logger logger = LoggerFactory.getLogger(AmbientWeatherHandlerFactory.class); // Needed for converting UTC time to local time - private TimeZoneProvider timeZoneProvider; + private final TimeZoneProvider timeZoneProvider; + + @Activate + public AmbientWeatherHandlerFactory(@Reference TimeZoneProvider timeZoneProvider) { + this.timeZoneProvider = timeZoneProvider; + } @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { @@ -59,14 +62,4 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { } return null; } - - @Reference - protected void setTimeZoneProvider(TimeZoneProvider timeZoneProvider) { - this.timeZoneProvider = timeZoneProvider; - } - - protected void unsetTimeZoneProvider(TimeZoneProvider timeZone) { - this.timeZoneProvider = null; - } - } diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/BridgeConfig.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/BridgeConfig.java index 2ebe00d2681a2..423213b245460 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/BridgeConfig.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/BridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/StationConfig.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/StationConfig.java index dc68ae4dd506f..cae072847e06d 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/StationConfig.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/config/StationConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherBridgeHandler.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherBridgeHandler.java index 020d0c0e5a005..de91ba46eaf45 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherBridgeHandler.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java index 504fb11a419c1..031675e6f8461 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -181,6 +181,15 @@ private void disconnectFromService() { } } + /* + * Attempt to reconnect to the Ambient Weather real-time API + */ + private void reconnectToService() { + logger.debug("Listener: Attempting to reconnect to service"); + disconnectFromService(); + connectToService(); + } + /* * Socket.io event callbacks */ @@ -220,7 +229,8 @@ public void call(final Object... args) { private Emitter.Listener onEventReconnect = new Emitter.Listener() { @Override public void call(final Object... args) { - logger.debug("Listener: Received socket event: {}", Socket.EVENT_RECONNECT); + logger.debug("Listener: Received reconnect event from service"); + reconnectToService(); } }; diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherStationHandler.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherStationHandler.java index 0efedb7437d44..496ded6e6cbbc 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherStationHandler.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherStationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/DeviceJson.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/DeviceJson.java index 4a2c17143be53..eb086e1be48ef 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/DeviceJson.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/DeviceJson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataGenericJson.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataGenericJson.java index d43a1c0ef2ab4..a948c4dc4851a 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataGenericJson.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataGenericJson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataJson.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataJson.java index eeb03a2b61561..fc977ff87090c 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataJson.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventDataJson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventSubscribedJson.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventSubscribedJson.java index 316f3a391ed33..cda5d52de7d17 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventSubscribedJson.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/EventSubscribedJson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/StationInfoJson.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/StationInfoJson.java index 4d42beddaca3c..52b103a49ed5f 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/StationInfoJson.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/model/StationInfoJson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/AbstractProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/AbstractProcessor.java index 0e9a5b25c4247..ef0df868ebd0c 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/AbstractProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/AbstractProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorFactory.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorFactory.java index 2d412136a0d2d..0c659405967f5 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorFactory.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,6 +39,7 @@ public class ProcessorFactory { private @Nullable static Ws2902aProcessor WS2902A_PROCESSOR; private @Nullable static Ws8482Processor WS8482_PROCESSOR; private @Nullable static Ws0900ipProcessor WS0900IP_PROCESSOR; + private @Nullable static Ws0265Processor WS0265_PROCESSOR; /** * Individual weather station processors use this one Gson instance, @@ -93,6 +94,14 @@ public static AbstractProcessor getProcessor(Thing thing) throws ProcessorNotFou } return processor; } + case "ambientweather:ws0265": { + Ws0265Processor processor = WS0265_PROCESSOR; + if (processor == null) { + processor = new Ws0265Processor(); + WS0265_PROCESSOR = processor; + } + return processor; + } } throw new ProcessorNotFoundException("No processor for thing type " + thingType); } diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorInterface.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorInterface.java index 0c72e86dc666c..6d59dce847f82 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorInterface.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorNotFoundException.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorNotFoundException.java index 1027c90f0b98e..f04567867aacc 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorNotFoundException.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/ProcessorNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java index af996e7d6407c..0e2ae2e430899 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/RemoteSensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -83,6 +83,12 @@ private void updateSensorChannels(AmbientWeatherStationHandler handler, int i, f if (("temp" + sensorNumber + "f").equals(name)) { handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_TEMPERATURE, reader.nextDouble(), ImperialUnits.FAHRENHEIT); + } else if (("dewPoint" + sensorNumber).equals(name)) { + handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_DEW_POINT, reader.nextDouble(), + ImperialUnits.FAHRENHEIT); + } else if (("feelsLike" + sensorNumber).equals(name)) { + handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_FEELING_TEMPERATURE, + reader.nextDouble(), ImperialUnits.FAHRENHEIT); } else if (("humidity" + sensorNumber).equals(name)) { handler.updateQuantity(CHGRP_REMOTE_SENSOR + sensorNumber, CH_HUMIDITY, reader.nextDouble(), SmartHomeUnits.PERCENT); diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0265Processor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0265Processor.java new file mode 100644 index 0000000000000..7d0926e09472d --- /dev/null +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0265Processor.java @@ -0,0 +1,64 @@ +/** + * 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.ambientweather.internal.processor; + +import static org.openhab.binding.ambientweather.internal.AmbientWeatherBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.openhab.binding.ambientweather.internal.handler.AmbientWeatherStationHandler; +import org.openhab.binding.ambientweather.internal.model.EventDataJson; + +/** + * The {@link Ws0265Processor} is responsible for updating + * the channels associated with the WS-0265 series weather stations in + * response to the receipt of a weather data update from the Ambient + * Weather real-time API. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class Ws0265Processor extends AbstractProcessor { + + @Override + public void setChannelGroupId() { + channelGroupId = CHGRP_WS0265; + } + + @Override + public void setNumberOfSensors() { + remoteSensor.setNumberOfSensors(7); + } + + @Override + public void processInfoUpdate(AmbientWeatherStationHandler handler, String station, String name, String location) { + // Update name and location channels + handler.updateString(CHGRP_STATION, CH_NAME, name); + handler.updateString(CHGRP_STATION, CH_LOCATION, location); + } + + @Override + public void processWeatherData(AmbientWeatherStationHandler handler, String station, String jsonData) { + EventDataJson data = parseEventData(station, jsonData); + if (data == null) { + return; + } + + // Update the weather data channels + handler.updateDate(channelGroupId, CH_OBSERVATION_TIME, data.date); + handler.updateQuantity(channelGroupId, CH_TEMPERATURE, data.tempinf, ImperialUnits.FAHRENHEIT); + + // Update the remote sensor channels + remoteSensor.updateChannels(handler, jsonData); + } +} diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java index 5b90e56b39147..be8bfb0839f88 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws0900ipProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java index 403d78ffa63b9..bca0047d452f6 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws1400ipProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java index a225144e5cbe3..f2c190d639ddf 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws2902aProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java index aa9e249d3b5bd..4f7be14d2ac88 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/processor/Ws8482Processor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/PressureTrend.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/PressureTrend.java index fdcf9966f46a6..2a83899911d59 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/PressureTrend.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/PressureTrend.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/SlidingTimeWindow.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/SlidingTimeWindow.java index 9b505b5bc4187..ad5774f005da2 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/SlidingTimeWindow.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/util/SlidingTimeWindow.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/binding/binding.xml index 6dab2a8d40971..33b4b07fe3f9b 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>AmbientWeather Binding</name> <description>This binding supports weather stations from Ambient Weather</description> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/bridge-config.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/bridge-config.xml index 5312aed8f50f3..b7700982f44dc 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/bridge-config.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/bridge-config.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:ambientweather:bridge"> <parameter name="applicationKey" type="text" required="true"> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/station-config.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/station-config.xml index be28ead38d72e..3f8f31c13303f 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/station-config.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/config/station-config.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:ambientweather:station"> <parameter name="macAddress" type="text" required="true"> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/bridge.xml index 8c907936b54c6..bd26988812923 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <!-- Ambient Weather Bridge --> + <!-- Ambient Weather Account --> <bridge-type id="bridge"> - <label>Ambient Weather Bridge</label> - <description>The Ambient Weather bridge represents a connection to the Ambient Weasther service</description> + <label>Ambient Weather Account</label> + <description>Represents an account at Ambient Weather (ambientweather.net)</description> <config-description-ref uri="thing-type:ambientweather:bridge" /> </bridge-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channel-group-types.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channel-group-types.xml index a117f09f1190f..6d9310a214598 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channel-group-types.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channel-group-types.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Channel group types in common for all weather stations --> <!-- The channel group type for a specific station is in the xml file for that station --> @@ -29,6 +29,8 @@ <description>Remote Sensor</description> <channels> <channel id="temperature" typeId="temperature" /> + <channel id="dewPoint" typeId="dewPoint" /> + <channel id="feelingTemperature" typeId="feelingTemperature" /> <channel id="relativeHumidity" typeId="relativeHumidity" /> <channel id="soilTemperature" typeId="soilTemperature" /> <channel id="soilMoisture" typeId="soilMoisture" /> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channels.xml index 4f77c27466d31..a18e7e5860a5b 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/channels.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="stationName"> <item-type>String</item-type> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0265.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0265.xml new file mode 100644 index 0000000000000..9a2a8869367fb --- /dev/null +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0265.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- Ambient Weather WS-0265 --> + <thing-type id="ws0265"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>WS-0265</label> + <description>Ambient Weather Station WS-0265</description> + <channel-groups> + <channel-group id="station" typeId="station"> + <label>Weather Station</label> + <description></description> + </channel-group> + <channel-group id="weatherDataWs0265" typeId="weatherDataWs0265"> + <label>Weather Data</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor1" typeId="remoteSensor"> + <label>Remote Sensor 1</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor2" typeId="remoteSensor"> + <label>Remote Sensor 2</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor3" typeId="remoteSensor"> + <label>Remote Sensor 3</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor4" typeId="remoteSensor"> + <label>Remote Sensor 4</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor5" typeId="remoteSensor"> + <label>Remote Sensor 5</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor6" typeId="remoteSensor"> + <label>Remote Sensor 6</label> + <description></description> + </channel-group> + <channel-group id="remoteSensor7" typeId="remoteSensor"> + <label>Remote Sensor 7</label> + <description></description> + </channel-group> + </channel-groups> + <config-description-ref uri="thing-type:ambientweather:station" /> + </thing-type> + + <channel-group-type id="weatherDataWs0265"> + <label>Weather Data</label> + <description>Weather Data</description> + <channels> + <channel id="observationTime" typeId="observationTime" /> + <channel id="temperature" typeId="temperature" /> + </channels> + </channel-group-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0900.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0900.xml index 24763264a7382..c6a73c55705e6 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0900.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws0900.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Ambient Weather WS-0900-IP --> <thing-type id="ws0900ip"> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws1400ip.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws1400ip.xml index 9358902daef67..13fbd28271e10 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws1400ip.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws1400ip.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Ambient Weather WS-1400-IP --> <thing-type id="ws1400ip"> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws2902a.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws2902a.xml index 9be36d0ad092e..e91c25130d7e3 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws2902a.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws2902a.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Ambient Weather WS-2902A --> <thing-type id="ws2902a"> diff --git a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws8482.xml b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws8482.xml index a4328f6a1f383..11d02807e81e5 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws8482.xml +++ b/bundles/org.openhab.binding.ambientweather/src/main/resources/ESH-INF/thing/ws8482.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="ambientweather" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Ambient Weather WS-8482 --> <thing-type id="ws8482"> diff --git a/bundles/org.openhab.binding.astro/NOTICE b/bundles/org.openhab.binding.astro/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.astro/NOTICE +++ b/bundles/org.openhab.binding.astro/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.astro/README.md b/bundles/org.openhab.binding.astro/README.md index 3aa73f955beee..2de237b309078 100644 --- a/bundles/org.openhab.binding.astro/README.md +++ b/bundles/org.openhab.binding.astro/README.md @@ -20,7 +20,7 @@ No binding configuration required. ## Thing Configuration -All Things require the parameter `geolocation` (as `<latitude>,<longitude>,[<altitude in m>]`) for which the calculation is done. +All Things require the parameter `geolocation` (as `<latitude>,<longitude>[,<altitude in m>]`) for which the calculation is done. The altitude segment is optional and sharpens results provided by the Radiation group. Optionally, a refresh `interval` (in seconds) can be defined to also calculate positional data like azimuth and elevation. @@ -159,7 +159,7 @@ astro:sun:home [ geolocation="52.5200066,13.4049540,100", interval=60 ] { } ``` -or a offset and latest +or an offset and latest ``` astro:sun:home [ geolocation="52.5200066,13.4049540,100", interval=60 ] { diff --git a/bundles/org.openhab.binding.astro/pom.xml b/bundles/org.openhab.binding.astro/pom.xml index c4b8ba4251386..64039b086689e 100644 --- a/bundles/org.openhab.binding.astro/pom.xml +++ b/bundles/org.openhab.binding.astro/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.astro</artifactId> diff --git a/bundles/org.openhab.binding.astro/src/main/feature/feature.xml b/bundles/org.openhab.binding.astro/src/main/feature/feature.xml index 54ce647443ecb..ea697a208bd43 100644 --- a/bundles/org.openhab.binding.astro/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.astro/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.astro-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-astro" description="Astro Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroBindingConstants.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroBindingConstants.java index db29c82d294fe..702ac09d70b71 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroBindingConstants.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroHandlerFactory.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroHandlerFactory.java index 515fd88053408..590971da7fc6e 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroHandlerFactory.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/AstroHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/MoonCalc.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/MoonCalc.java index 69a1ce3610c9b..8da448e623289 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/MoonCalc.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/MoonCalc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SeasonCalc.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SeasonCalc.java index d7a995486d9f5..fe8971bee9b30 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SeasonCalc.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SeasonCalc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java index 4fc564b83d32f..13ecfb7096609 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunZodiacCalc.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunZodiacCalc.java index 63788dc6c6c73..dff40d1f70474 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunZodiacCalc.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunZodiacCalc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroChannelConfig.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroChannelConfig.java index 6fbcf404d85fc..e9f501829fc6a 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroChannelConfig.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroThingConfig.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroThingConfig.java index 71620578074e2..ada798c0d55a1 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroThingConfig.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/config/AstroThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/discovery/AstroDiscoveryService.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/discovery/AstroDiscoveryService.java index e0f215d46622a..e67a27b642c76 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/discovery/AstroDiscoveryService.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/discovery/AstroDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/AstroThingHandler.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/AstroThingHandler.java index ae50d00a9b6ae..20eb9e5543a91 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/AstroThingHandler.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/AstroThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/MoonHandler.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/MoonHandler.java index ae27aaf2018a6..380bbd149fd05 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/MoonHandler.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/MoonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java index 260a3308d3851..60fee63061ae5 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/handler/SunHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/AbstractJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/AbstractJob.java index 50d79db2dee2e..67ecc35a226fa 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/AbstractJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/AbstractJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/CompositeJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/CompositeJob.java index 971d14376b1fc..8d798365c621d 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/CompositeJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/CompositeJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobMoon.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobMoon.java index 2673c70038b78..6daa1f269118f 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobMoon.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobMoon.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobSun.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobSun.java index 89477dae19509..b8736298b1cea 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobSun.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/DailyJobSun.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/EventJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/EventJob.java index 2a41570f019de..649654735c119 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/EventJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/EventJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/Job.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/Job.java index a472aa300ded5..9f4c0638f5059 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/Job.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/Job.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PositionalJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PositionalJob.java index 6dd2e90f8ba4a..f1caa38f612fa 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PositionalJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PositionalJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PublishPlanetJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PublishPlanetJob.java index c77ac85a6e7d1..63eff15deabe0 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PublishPlanetJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/PublishPlanetJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/SunPhaseJob.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/SunPhaseJob.java index b1a93065e04dd..2614190ce427d 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/SunPhaseJob.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/job/SunPhaseJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Eclipse.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Eclipse.java index 453dd084cbb5f..e3d50dab066b1 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Eclipse.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Eclipse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Moon.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Moon.java index 043e7bf3e46c9..0be35eeb019c5 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Moon.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Moon.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonDistance.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonDistance.java index c6d779c73da12..9ac71887a9317 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonDistance.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonDistance.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java index 8aa2c6d69e2e5..f7bd01cfa44cd 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhaseName.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhaseName.java index 7ac5f1d5bfc0b..465eeeecf9c26 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhaseName.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/MoonPhaseName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Planet.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Planet.java index c6c0ff25aaaaa..0b10b1748db2c 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Planet.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Planet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Position.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Position.java index 959cda467075b..484749a293a15 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Position.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Position.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Radiation.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Radiation.java index 6093da69da472..1d9a27558a757 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Radiation.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Radiation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Range.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Range.java index 0a0dfe360a244..13a824f598f34 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Range.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Range.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/RiseSet.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/RiseSet.java index 4a2db6f1e6aac..7c6e1ecdddac7 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/RiseSet.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/RiseSet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Season.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Season.java index 345810c7036d7..d298aefeea07c 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Season.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Season.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SeasonName.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SeasonName.java index 299c9028b374a..e372fcdec7578 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SeasonName.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SeasonName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Sun.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Sun.java index 708896475c03e..7fbd251ae888a 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Sun.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Sun.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunEclipse.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunEclipse.java index cc1622a72d676..d936a1bea82f9 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunEclipse.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunEclipse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhase.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhase.java index 7fb646e477c20..bc229a9099f07 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhase.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhaseName.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhaseName.java index 588615923a36f..a1ccef050cc3e 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhaseName.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunPhaseName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunZodiac.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunZodiac.java index 6372f3fd57387..be331e8cb2d28 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunZodiac.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/SunZodiac.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Zodiac.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Zodiac.java index d9db8c0959e22..c8aefbaba03d1 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Zodiac.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/Zodiac.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/ZodiacSign.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/ZodiacSign.java index 39142c4c137d6..fbafbbe0a6e00 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/ZodiacSign.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/model/ZodiacSign.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java index 25d0c9a27cede..dc3fbf43185ea 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/DateTimeUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/PropertyUtils.java b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/PropertyUtils.java index 02ae87577d15a..fec1cd6eac9da 100644 --- a/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/PropertyUtils.java +++ b/bundles/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/util/PropertyUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/moon.xml b/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/moon.xml index 849de457b593d..7e8918b151584 100644 --- a/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/moon.xml +++ b/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/moon.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="moon"> - <label>Astro moon data</label> + <label>Astro Moon Data</label> <description>Provides astronomical data from the moon</description> <channel-groups> diff --git a/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/sun.xml b/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/sun.xml index a0ca343e193c2..79d07f7704606 100644 --- a/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/sun.xml +++ b/bundles/org.openhab.binding.astro/src/main/resources/ESH-INF/thing/sun.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="sun"> - <label>Astro sun data</label> + <label>Astro Sun Data</label> <description>Provides astronomical data from the sun</description> <channel-groups> diff --git a/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/calc/SunCalcTest.java b/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/calc/SunCalcTest.java index c9cfd4059a6a9..f93c5a2708b8f 100644 --- a/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/calc/SunCalcTest.java +++ b/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/calc/SunCalcTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,9 +36,9 @@ * <li>checks if the generated {@link Sun#getAllRanges()} are consistent with * each other</li> * </ul> - * + * * @author Witold Markowski - Initial contribution - * @see <a href="https://github.com/openhab/openhab2-addons/issues/5006">[astro] + * @see <a href="https://github.com/openhab/openhab-addons/issues/5006">[astro] * Sun Phase returns UNDEF</a> * @see <a href="https://www.heavens-above.com/sun.aspx">Heavens Above Sun</a> */ diff --git a/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/model/SunTest.java b/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/model/SunTest.java index 28933e87cf007..bf77b1aaa3027 100644 --- a/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/model/SunTest.java +++ b/bundles/org.openhab.binding.astro/src/test/java/org/openhab/binding/astro/internal/model/SunTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,9 +27,9 @@ /*** * A set of standard unit test of {@link Sun} class. In particular it checks if * {@link Sun#getAllRanges()} contains a correct {@link SunPhaseName}. - * + * * @author Witold Markowski - Initial contribution - * @see <a href="https://github.com/openhab/openhab2-addons/issues/5006">[astro] + * @see <a href="https://github.com/openhab/openhab-addons/issues/5006">[astro] * Sun Phase returns UNDEF</a> */ public class SunTest { diff --git a/bundles/org.openhab.binding.atlona/NOTICE b/bundles/org.openhab.binding.atlona/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.atlona/NOTICE +++ b/bundles/org.openhab.binding.atlona/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.atlona/README.md b/bundles/org.openhab.binding.atlona/README.md index b4c6d9a3d6b99..668e4e0dd523d 100644 --- a/bundles/org.openhab.binding.atlona/README.md +++ b/bundles/org.openhab.binding.atlona/README.md @@ -1,6 +1,6 @@ # Atlona Binding -This binding integrates Atlona AT-UHD-PRO3 HdBaseT matrix switches [Atlona AT-UHD-PRO3 HdBaseT matrix switches](http://www.atlona.com) into your openHAB installation. +This binding integrates Atlona AT-UHD-PRO3 HdBaseT matrix switches [Atlona AT-UHD-PRO3 HdBaseT matrix switches](https://www.atlona.com) into your openHAB installation. ## Supported Things @@ -163,24 +163,24 @@ The # of presets allowed depends on the firmware you are using (5 presets up to The matrixcmd channel will take the following commands: -| Command | Description | -|-------------|---------------------------------------------------------------------------------------------------------------------------------------| -| resetmatrix | Resets the matrix back to it's default values (USE WITH CARE!). Note: some firmware upgrades require a resetmatrix after installing. | -| resetports | Resets the ports back to their default values (outputX=inputX) | -| allportsX | Sets all the output ports to the input port X | +| Command | Description | +|-------------|-------------------------------------------------------------------------------------------------------------------------------------| +| resetmatrix | Resets the matrix back to its default values (USE WITH CARE!). Note: some firmware upgrades require a resetmatrix after installing. | +| resetports | Resets the ports back to their default values (outputX=inputX) | +| allportsX | Sets all the output ports to the input port X | Note: if X doesn't exist - nothing will occur. The # of presets allowed depends on the firmware you are using (5 presets up to rev 13, 10 for rev 14 and above). ## Changes/Warnings -As of firmware 1.6.03 (rev 13), there are three issues on Atlona firmware (I've notified them on these issues): +As of firmware 1.6.03 (rev 13), there are three issues on Atlona firmware (I have notified them on these issues): - clearX command does not work. The TCP/IP command "ClearX" as specified in Atlona's protocol will ALWAYS return a "Command Failed". Please avoid this channel until atlona releases a new firmware. -- There is no way to query what the current status is of: panellock, and irenable. This addon simply assumes that panellock is off and irenable is on at startup. +- There is no way to query what the current status is of: panellock, and irenable. This add-on simply assumes that panellock is off and irenable is on at startup. -- If you make a change in the switches UI that requires a reboot (mainly changing any of the settings on the "Network" tab in the switch configuration UI), this addon's connection will be inconsistently closed at different times. +- If you make a change in the switches UI that requires a reboot (mainly changing any of the settings on the "Network" tab in the switch configuration UI), this add-on's connection will be inconsistently closed at different times. The thing will go OFFLINE and then back ONLINE when the reconnect attempt is made - and then it starts all over again. Please make sure you reboot as soon as possible when the switch UI notifies you. - a bug in the firmware will sometimes cause memory presets to disappear after a reboot diff --git a/bundles/org.openhab.binding.atlona/pom.xml b/bundles/org.openhab.binding.atlona/pom.xml index 8ade82b6228e5..8b4894e209dd4 100644 --- a/bundles/org.openhab.binding.atlona/pom.xml +++ b/bundles/org.openhab.binding.atlona/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.atlona</artifactId> diff --git a/bundles/org.openhab.binding.atlona/src/main/feature/feature.xml b/bundles/org.openhab.binding.atlona/src/main/feature/feature.xml index 1ee49b503b9dc..602ed7fc48665 100644 --- a/bundles/org.openhab.binding.atlona/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.atlona/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.atlona-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-atlona" description="Atlona PRO3 Switch Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaBindingConstants.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaBindingConstants.java index 1a6ec68d1a50b..c4faa20669b2f 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaBindingConstants.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerCallback.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerCallback.java index c7eb3ffb316a4..5aa63f4eb0ee3 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerCallback.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerFactory.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerFactory.java index dda7876a0a1d5..15ebb302f4255 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerFactory.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/AtlonaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/StatefulHandlerCallback.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/StatefulHandlerCallback.java index 28b85571dd028..0395b8aebd827 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/StatefulHandlerCallback.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/StatefulHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/discovery/AtlonaDiscovery.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/discovery/AtlonaDiscovery.java index 2d10e276665be..0146b870e584a 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/discovery/AtlonaDiscovery.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/discovery/AtlonaDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaCapabilities.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaCapabilities.java index 58d5c1cf54a4e..acc689d7b972e 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaCapabilities.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaCapabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaHandler.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaHandler.java index d045ad4ddfaaf..defa9a011881d 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaHandler.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/handler/AtlonaHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketChannelSession.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketChannelSession.java index 5b8ac3b422d5a..bf4570248bf9c 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketChannelSession.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketChannelSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSession.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSession.java index 68bdbb5693abb..cd8b3e33d3b32 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSession.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSessionListener.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSessionListener.java index e551dd7d0b2b0..bfc66ba6fc854 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSessionListener.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/net/SocketSessionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Capabilities.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Capabilities.java index 130064d1f9b08..91c9ba51cbc93 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Capabilities.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Capabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Config.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Config.java index 93863f81269f9..99e0954d3724d 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Config.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Constants.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Constants.java index ae5e3b463606c..94eda2fa6e0c9 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Constants.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Constants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Handler.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Handler.java index f3462afe7b826..2a0b62ace3bba 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Handler.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3PortocolHandler.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3PortocolHandler.java index 0fa8ad1937268..e2637d0e32130 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3PortocolHandler.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3PortocolHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Utilities.java b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Utilities.java index 3db8b59d7335d..5a6f92da6649c 100644 --- a/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Utilities.java +++ b/bundles/org.openhab.binding.atlona/src/main/java/org/openhab/binding/atlona/internal/pro3/AtlonaPro3Utilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.atlona/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.atlona/src/main/resources/ESH-INF/thing/thing-types.xml index 5956195415af1..4bd479432f5a8 100644 --- a/bundles/org.openhab.binding.atlona/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.atlona/src/main/resources/ESH-INF/thing/thing-types.xml @@ -57,14 +57,14 @@ <required>true</required> </parameter> <parameter name="userName" type="text"> - <label>UserName to login with</label> + <label>UserName to Login With</label> <description>User Name to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="password" type="text"> <context>password</context> - <label>Password to login with</label> + <label>Password to Login With</label> <description>Password to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> @@ -82,7 +82,7 @@ <advanced>true</advanced> </parameter> <parameter name="retryPolling" type="integer"> - <label>Polling Interval to try to reconnect</label> + <label>Polling Interval to Try to Reconnect</label> <description>Interval (in seconds) to try to (re)connect to the matrix</description> <default>10</default> <advanced>true</advanced> @@ -163,14 +163,14 @@ <required>true</required> </parameter> <parameter name="userName" type="text"> - <label>UserName to login with</label> + <label>UserName to Login With</label> <description>User Name to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="password" type="text"> <context>password</context> - <label>Password to login with</label> + <label>Password to Login With</label> <description>Password to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> @@ -188,7 +188,7 @@ <advanced>true</advanced> </parameter> <parameter name="retryPolling" type="integer"> - <label>Polling Interval to try to reconnect</label> + <label>Polling Interval to Try to Reconnect</label> <description>Interval (in seconds) to try to (re)connect to the matrix</description> <default>10</default> <advanced>true</advanced> @@ -292,7 +292,7 @@ </parameter> <parameter name="password" type="text"> <context>password</context> - <label>Password to login with</label> + <label>Password to Login With</label> <description>Password to use (if Telnet Login is ON)</description> <default></default> <advanced>true</advanced> @@ -310,7 +310,7 @@ <advanced>true</advanced> </parameter> <parameter name="retryPolling" type="integer"> - <label>Polling Interval to try to reconnect</label> + <label>Polling Interval to Try to Reconnect</label> <description>Interval (in seconds) to try to (re)connect</description> <default>10</default> <advanced>true</advanced> @@ -479,14 +479,14 @@ <required>true</required> </parameter> <parameter name="userName" type="text"> - <label>UserName to login with</label> + <label>UserName to Login With</label> <description>User Name to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="password" type="text"> <context>password</context> - <label>Password to login with</label> + <label>Password to Login With</label> <description>Password to login with if Telnet Login is on</description> <required>false</required> <advanced>true</advanced> @@ -504,7 +504,7 @@ <advanced>true</advanced> </parameter> <parameter name="retryPolling" type="integer"> - <label>Polling Interval to try to reconnect</label> + <label>Polling Interval to Try to Reconnect</label> <description>Interval (in seconds) to try to (re)connect to the matrix</description> <default>10</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.autelis/NOTICE b/bundles/org.openhab.binding.autelis/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.autelis/NOTICE +++ b/bundles/org.openhab.binding.autelis/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.autelis/README.md b/bundles/org.openhab.binding.autelis/README.md index e6bfbeb47c686..ed592ec378f55 100644 --- a/bundles/org.openhab.binding.autelis/README.md +++ b/bundles/org.openhab.binding.autelis/README.md @@ -1,6 +1,7 @@ # Autelis Pool Control Binding -Autelis manufactures a network enabled pool interface for many popular pool systems. See [the Autelis website](http://www.autelis.com) and the [Autelis Command Protocol](http://www.autelis.com/wiki/index.php?title=Pool_Control_(PI)_HTTP_Command_Reference) for more information. +Autelis manufactures a network enabled pool interface for many popular pool systems. +See [the Autelis website](https://www.autelis.com) and the [Autelis Command Protocol](http://www.autelis.com/wiki/index.php?title=Pool_Control_(PI)_HTTP_Command_Reference) for more information. This binding supports: @@ -11,7 +12,8 @@ This binding supports: ## Auto Discovery -The binding will automatically discover Autelis controllers using UPNP. If found it will try and connect with the factory default username and password. +The binding will automatically discover Autelis controllers using UPnP. +If found it will try and connect with the factory default username and password. ## Binding Configuration @@ -81,6 +83,7 @@ Pentair devices support the following channels: | temp-pooltemp | Number | | temp-spatemp | Number | | temp-airtemp | Number | +| temp-soltemp | Number | | temp-tempunits | String | | temp-htpump | Number | | pump-pump1 | String | diff --git a/bundles/org.openhab.binding.autelis/pom.xml b/bundles/org.openhab.binding.autelis/pom.xml index bcdb4e05c8214..1478f43ce9037 100644 --- a/bundles/org.openhab.binding.autelis/pom.xml +++ b/bundles/org.openhab.binding.autelis/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.autelis</artifactId> diff --git a/bundles/org.openhab.binding.autelis/src/main/feature/feature.xml b/bundles/org.openhab.binding.autelis/src/main/feature/feature.xml index a79992ac079d2..53541e4096688 100644 --- a/bundles/org.openhab.binding.autelis/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.autelis/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.autelis-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-autelis" description="Autelis Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisBindingConstants.java b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisBindingConstants.java index 6ddb860bc3a5e..0f50292eaab4e 100644 --- a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisBindingConstants.java +++ b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisHandlerFactory.java b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisHandlerFactory.java index 19ba2b51b5af2..23eddd7f397c4 100644 --- a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisHandlerFactory.java +++ b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/AutelisHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/config/AutelisConfiguration.java b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/config/AutelisConfiguration.java index 4a72ca4d054af..89216a3a36794 100644 --- a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/config/AutelisConfiguration.java +++ b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/config/AutelisConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/discovery/AutelisDiscoveryParticipant.java b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/discovery/AutelisDiscoveryParticipant.java index 9df0b5b9e8408..25d15fc21516e 100644 --- a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/discovery/AutelisDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/discovery/AutelisDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/handler/AutelisHandler.java b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/handler/AutelisHandler.java index bff175c48f456..ee32edaea597f 100644 --- a/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/handler/AutelisHandler.java +++ b/bundles/org.openhab.binding.autelis/src/main/java/org/openhab/binding/autelis/internal/handler/AutelisHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/jandy.xml b/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/jandy.xml index f5611427e0f46..c2dd522bbd228 100644 --- a/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/jandy.xml +++ b/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/jandy.xml @@ -200,7 +200,7 @@ <label>Host or IP</label> <description>The host name or IP address of the Autelis Controller.</description> </parameter> - <parameter name="port" type="integer" min="1" max="65335" required="false"> + <parameter name="port" type="integer" min="1" max="65535" required="false"> <context>network-address</context> <label>Port</label> <description>The port the Autelis Controller is listening on.</description> @@ -388,7 +388,7 @@ <channel-type id="chem-avail" advanced="true"> <item-type>Number</item-type> - <label>Equipment is Available</label> + <label>Equipment Is Available</label> <description>Indicates what equipment is available</description> <state readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/pentair.xml b/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/pentair.xml index cc3127e0b271f..93e1d8f0140bc 100644 --- a/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/pentair.xml +++ b/bundles/org.openhab.binding.autelis/src/main/resources/ESH-INF/thing/pentair.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="pentair"> <label>Pentair Pool Controller</label> - <description>A Pentair pool control thing represents a Autelis pool controller for Pentair systems</description> + <description>A Pentair pool control thing represents an Autelis pool controller for Pentair systems</description> <channels> <channel id="system-runstate" typeId="system-runstate" /> <channel id="system-model" typeId="system-model" /> @@ -127,6 +127,7 @@ <channel id="temp-pooltemp" typeId="temp-pooltemp" /> <channel id="temp-spatemp" typeId="temp-spatemp" /> <channel id="temp-airtemp" typeId="temp-airtemp" /> + <channel id="temp-soltemp" typeId="temp-soltemp" /> <channel id="temp-tempunits" typeId="temp-tempunits" /> <channel id="temp-htpump" typeId="temp-htpump" /> <channel id="pumps-pump1" typeId="pumps-pump1" /> @@ -179,7 +180,7 @@ <label>Host or IP</label> <description>The host name or IP address of the Autelis Controller.</description> </parameter> - <parameter name="port" type="integer" min="1" max="65335" required="false"> + <parameter name="port" type="integer" min="1" max="65535" required="false"> <context>network-address</context> <label>Port</label> <description>The port the Autelis Controller is listening on.</description> @@ -194,7 +195,7 @@ <description>The password to use when connecting to a Autelis Controller.</description> </parameter> <parameter name="refresh" type="integer" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds</description> <default>5</default> </parameter> @@ -335,7 +336,15 @@ <channel-type id="temp-airtemp"> <item-type>Number</item-type> <label>Air Temperature</label> - <description>The current air temperature</description> + <description>The current temperature measured by the air sensor</description> + <category>Temperature</category> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="temp-soltemp"> + <item-type>Number</item-type> + <label>Solar Temperature</label> + <description>The current temperature measured by the solar sensor</description> <category>Temperature</category> <state readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.avmfritz/NOTICE b/bundles/org.openhab.binding.avmfritz/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.avmfritz/NOTICE +++ b/bundles/org.openhab.binding.avmfritz/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.avmfritz/README.md b/bundles/org.openhab.binding.avmfritz/README.md index e30936edb77cc..777a6a214fae6 100644 --- a/bundles/org.openhab.binding.avmfritz/README.md +++ b/bundles/org.openhab.binding.avmfritz/README.md @@ -1,6 +1,6 @@ # AVM FRITZ! Binding -The binding integrates the AHA ( [AVM Home Automation](http://avm.de/ratgeber/smart-home/) ) system. +The binding integrates the AHA ( [AVM Home Automation](https://avm.de/ratgeber/smart-home/) ) system. ## Supported Things @@ -23,7 +23,7 @@ It only supports temperature readings. ### FRITZ!Powerline 546E -This [powerline adapter](http://avm.de/produkte/fritzpowerline/fritzpowerline-546e/) can be used via the bridge or in stand-alone mode. +This [powerline adapter](https://avm.de/produkte/fritzpowerline/fritzpowerline-546e/) can be used via the bridge or in stand-alone mode. It supports switching the outlet and reading the current power, current voltage and accumulated energy consumption. This device does not contain a temperature sensor. **NOTE:** The `voltage` channel will be added to the thing during runtime - if the interface supports it (FRITZ!OS 7 or higher). @@ -79,7 +79,7 @@ If correct credentials are set in the bridge configuration, connected AHA device - `ipAddress` (mandatory), default "fritz.box" - `protocol` (optional, "http" or "https"), default "http" -- `port` (optional, 0 to 65335), no default (derived from protocol: 80 or 443) +- `port` (optional, 1 to 65535), no default (derived from protocol: 80 or 443) - `password` (optional), no default (depends on FRITZ!Box security configuration) - `user` (optional), no default (depends on FRITZ!Box security configuration) - `pollingInterval` (optional, 5 to 60), default 15 (in seconds) @@ -91,7 +91,7 @@ If correct credentials are set in the bridge configuration, connected AHA device - `ain` (optional, advanced), no default (AIN number of the device) - `ipAddress` (mandatory), default "fritz.powerline" - `protocol` (optional, "http" or "https"), default "http" -- `port` (optional, 0 to 65335), no default (derived from protocol: 80 or 443) +- `port` (optional, 1 to 65535), no default (derived from protocol: 80 or 443) - `password` (optional), no default (depends on FRITZ!Powerline security configuration) - `pollingInterval` (optional, 5 to 60), default 15 (in seconds) - `asyncTimeout` (optional, 1000 to 60000), default 10000 (in milliseconds) diff --git a/bundles/org.openhab.binding.avmfritz/pom.xml b/bundles/org.openhab.binding.avmfritz/pom.xml index 5b11175a5f9c1..d6e8a49a94c5a 100644 --- a/bundles/org.openhab.binding.avmfritz/pom.xml +++ b/bundles/org.openhab.binding.avmfritz/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.avmfritz</artifactId> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/feature/feature.xml b/bundles/org.openhab.binding.avmfritz/src/main/feature/feature.xml index 97e80f964bc3d..73e0fc4f79453 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.avmfritz-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-avmfritz" description="AVM FRITZ!Box Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzDynamicStateDescriptionProvider.java index b9d6a35501a83..04644aca9cfba 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzHandlerFactory.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzHandlerFactory.java index c88cf2ae84677..b6d2ca17d7659 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzHandlerFactory.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzTlsTrustManagerProvider.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzTlsTrustManagerProvider.java new file mode 100644 index 0000000000000..122c0b57f6b72 --- /dev/null +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/AVMFritzTlsTrustManagerProvider.java @@ -0,0 +1,40 @@ +/** + * 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.avmfritz.internal; + +import javax.net.ssl.X509ExtendedTrustManager; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.io.net.http.TlsTrustManagerProvider; +import org.eclipse.smarthome.io.net.http.TrustAllTrustMananger; +import org.osgi.service.component.annotations.Component; + +/** + * Provides a TrustManager to allow secure connections to any FRITZ!Box + * + * @author Chritoph Weitkamp - Initial Contribution + */ +@Component +@NonNullByDefault +public class AVMFritzTlsTrustManagerProvider implements TlsTrustManagerProvider { + + @Override + public String getHostName() { + return "fritz.box"; + } + + @Override + public X509ExtendedTrustManager getTrustManager() { + return TrustAllTrustMananger.getInstance(); + } +} diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/BindingConstants.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/BindingConstants.java index d06b02988e041..21831628cf8bb 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/BindingConstants.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/BindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzBaseModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzBaseModel.java index 79f119d1b63d7..aa2c3f3e40212 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzBaseModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzBaseModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AlertModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AlertModel.java index 8541ce9bce97a..09b27253e7b57 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AlertModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/AlertModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/ButtonModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/ButtonModel.java index 618cd58c7e3f6..5b5aa6f47f3f3 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/ButtonModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/ButtonModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceListModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceListModel.java index bc196c6b15d96..d2c52088a8cab 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceListModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceListModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceModel.java index acfbac9e7910a..b729ad4e35040 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/DeviceModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/GroupModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/GroupModel.java index 20e113c1ca77e..a4e3b01612c66 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/GroupModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/GroupModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModel.java index b9870a2f7fd07..90c27cc57da72 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/PowerMeterModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/PowerMeterModel.java index 1c76faa78f2cd..c90e50d5ec9c7 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/PowerMeterModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/PowerMeterModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/SwitchModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/SwitchModel.java index fa65868c333ba..d6fa3473ea09c 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/SwitchModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/SwitchModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/TemperatureModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/TemperatureModel.java index fc19426e43c59..98826ffd56d42 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/TemperatureModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/TemperatureModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/ApplyMaskListModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/ApplyMaskListModel.java index cf560283a2001..508991e858020 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/ApplyMaskListModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/ApplyMaskListModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceListModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceListModel.java index c0216f225c9d5..3e509e5d6621b 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceListModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceListModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceModel.java index 56e5882cf47a6..c76c4399488f4 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/DeviceModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateListModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateListModel.java index c7f6ae30136b5..b3be020a88df3 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateListModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateListModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateModel.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateModel.java index 112e0be197fdd..10042d216909c 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateModel.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/ahamodel/templates/TemplateModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzConfiguration.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzConfiguration.java index f34e1843ef9da..9c81cec6b4cea 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzConfiguration.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzTemperatureChannelConfig.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzTemperatureChannelConfig.java index 6d62a55201225..7e1a962f020f5 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzTemperatureChannelConfig.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/config/AVMFritzTemperatureChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzDiscoveryService.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzDiscoveryService.java index e405c27362ac3..bbe1a73bad3bf 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzDiscoveryService.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzUpnpDiscoveryParticipant.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzUpnpDiscoveryParticipant.java index 37e6abd51c2e7..f6528dd68063e 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzUpnpDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/discovery/AVMFritzUpnpDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseBridgeHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseBridgeHandler.java index 6a6adc8b54f6b..c9e9a7d092068 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseBridgeHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java index 0f8799b23e4bb..de752c698766b 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/BoxHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/BoxHandler.java index 11c240c3fad6e..f364e36013be7 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/BoxHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/BoxHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/DeviceHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/DeviceHandler.java index da862ab7e9663..68bcab484314c 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/DeviceHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/DeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/GroupHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/GroupHandler.java index 4b746c50f206b..ba5048ef77914 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/GroupHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/GroupHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/Powerline546EHandler.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/Powerline546EHandler.java index 62f9d759a3e08..d9ae2584f05a6 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/Powerline546EHandler.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/handler/Powerline546EHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaContentExchange.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaContentExchange.java index da3578cb06764..8245c7ad8481c 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaContentExchange.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaContentExchange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -54,7 +54,7 @@ public FritzAhaContentExchange(FritzAhaCallback callback) { */ @Override public void onSuccess(Response response) { - logger.debug("HTTP response: {}", response.getStatus()); + logger.debug("{} response: {}", response.getRequest().getScheme().toUpperCase(), response.getStatus()); } /** diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java index 4842ebb220193..c7fe6b40f9cd7 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/FritzAhaWebInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaApplyTemplateCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaApplyTemplateCallback.java index 58fa1467145fb..0a9f15bf0f44f 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaApplyTemplateCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaApplyTemplateCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaCallback.java index 9d469acc32f91..6383e64bf20a3 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaDiscoveryCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaDiscoveryCallback.java index bb0dd227e9fa4..e35b97c96cf4c 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaDiscoveryCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaDiscoveryCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaReauthCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaReauthCallback.java index aa07e29790753..bb74e93719380 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaReauthCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaReauthCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,8 +12,6 @@ */ package org.openhab.binding.avmfritz.internal.hardware.callbacks; -import static org.eclipse.jetty.http.HttpMethod.*; - import org.eclipse.jetty.http.HttpMethod; import org.openhab.binding.avmfritz.internal.hardware.FritzAhaWebInterface; @@ -77,7 +75,7 @@ public boolean isFinalAttempt() { * after decremented retry counter) * * @param newRetryCallback - * Callback to retry with + * Callback to retry with */ public void setRetryCallback(FritzAhaCallback newRetryCallback) { retryCallback = newRetryCallback; @@ -104,10 +102,15 @@ public void execute(int status, String response) { if (retries >= 1) { webIface.authenticate(); retries--; - if (httpMethod == GET) { - webIface.asyncGet(path, args, retryCallback); - } else if (httpMethod == POST) { - webIface.asyncPost(path, args, retryCallback); + switch (httpMethod) { + case GET: + webIface.asyncGet(path, args, retryCallback); + break; + case POST: + webIface.asyncPost(path, args, retryCallback); + break; + default: + break; } } } else { @@ -119,15 +122,15 @@ public void execute(int status, String response) { * Constructor for retryable authentication * * @param path - * Path to HTTP interface + * Path to HTTP interface * @param args - * Arguments to use + * Arguments to use * @param webIface - * Web interface to use + * Web interface to use * @param httpMethod - * Method used + * Method used * @param retries - * Number of retries + * Number of retries */ public FritzAhaReauthCallback(String path, String args, FritzAhaWebInterface webIface, HttpMethod httpMethod, int retries) { diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetHeatingTemperatureCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetHeatingTemperatureCallback.java index 616e33501d546..290d8aca7146e 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetHeatingTemperatureCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetHeatingTemperatureCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetSwitchCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetSwitchCallback.java index 0cf7cd5e80489..d5c3e04883ec5 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetSwitchCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaSetSwitchCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateCallback.java index b20cc1d081fd0..a98c3d6686f0d 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateTemplatesCallback.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateTemplatesCallback.java index bfd4ffaed7fcc..31955c59bd804 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateTemplatesCallback.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/hardware/callbacks/FritzAhaUpdateTemplatesCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/util/JAXBUtils.java b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/util/JAXBUtils.java old mode 100755 new mode 100644 index bbda56c8f5b7c..734333eef771e --- a/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/util/JAXBUtils.java +++ b/bundles/org.openhab.binding.avmfritz/src/main/java/org/openhab/binding/avmfritz/internal/util/JAXBUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/binding/binding.xml index d74b552faa5cf..352d70b5eea51 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/binding/binding.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="avmfritz" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<binding:binding id="avmfritz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/config/config.xml index bb8112515d0ad..6934c281ffcf3 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/config/config.xml @@ -19,11 +19,11 @@ </parameter-group> <parameter name="ipAddress" type="text" required="true" groupName="network"> <context>network-address</context> - <label>IP address</label> + <label>IP Address</label> <description>The local IP address or hostname of the FRITZ!Box.</description> <default>fritz.box</default> </parameter> - <parameter name="port" type="integer" required="false" min="0" max="65335" groupName="network"> + <parameter name="port" type="integer" required="false" min="1" max="65535" groupName="network"> <label>Port</label> <description>Port of the FRITZ!Box.</description> </parameter> @@ -85,11 +85,11 @@ </parameter> <parameter name="ipAddress" type="text" required="true" groupName="network"> <context>network-address</context> - <label>IP address</label> + <label>IP Address</label> <description>The localIP address or hostname of the FRITZ!Powerline.</description> <default>fritz.powerline</default> </parameter> - <parameter name="port" type="integer" required="false" min="0" max="65335" groupName="network"> + <parameter name="port" type="integer" required="false" min="1" max="65535" groupName="network"> <label>Port</label> <description>Port of the FRITZ!Powerline.</description> </parameter> @@ -143,7 +143,7 @@ <config-description uri="channel-type:avmfritz:temperature"> <parameter name="offset" type="decimal" required="false" readOnly="true" unit="Cel"> - <label>Temperature offset</label> + <label>Temperature Offset</label> <description>Current temperature offset (in °C).</description> <default>0</default> </parameter> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/bridge-types.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/bridge-types.xml index bb0ca0c1834a7..3baf1d84574f5 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/bridge-types.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/bridge-types.xml @@ -2,7 +2,7 @@ <thing:thing-descriptions bindingId="avmfritz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Supported FRITZ!Box and FRITZ!Powerline --> <bridge-type id="fritzbox"> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/channel-types.xml index 7e93d6fc6e7b9..05bb38c688e88 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/channel-types.xml @@ -28,7 +28,7 @@ <channel-type id="locked" advanced="true"> <item-type>Contact</item-type> - <label>Device locked (external)</label> + <label>Device Locked (external)</label> <description>Device is locked for switching over external sources.</description> <category>Contact</category> <state pattern="%s" readOnly="true" /> @@ -118,7 +118,7 @@ <channel-type id="radiator_mode"> <item-type>String</item-type> - <label>Radiator mode</label> + <label>Radiator Mode</label> <description>States the mode of the radiator (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN).</description> <state pattern="%s"> <options> diff --git a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/thing-types.xml index 296af5642ddd3..b251b0fda53c8 100644 --- a/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.avmfritz/src/main/resources/ESH-INF/thing/thing-types.xml @@ -188,7 +188,7 @@ <bridge-type-ref id="FRITZ_Powerline_546E_Solo" /> </supported-bridge-type-refs> - <label>HAN-FUN contact</label> + <label>HAN-FUN Contact</label> <description>HAN-FUN contact (e.g. SmartHome Tür-/Fensterkontakt or SmartHome Bewegungsmelder).</description> <channels> @@ -206,12 +206,12 @@ <bridge-type-ref id="FRITZ_Powerline_546E_Solo" /> </supported-bridge-type-refs> - <label>HAN-FUN switch</label> + <label>HAN-FUN Switch</label> <description>HAN-FUN switch (e.g. SmartHome Wandtaster).</description> <channels> <channel id="press" typeId="system.rawbutton"> - <label>Button press</label> + <label>Button Press</label> <description>Triggered when a button was pressed.</description> </channel> <channel typeId="last_change" id="last_change" /> diff --git a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzDeviceListModelTest.java b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzDeviceListModelTest.java index 9c79a74dcb72a..0a743776fc6d5 100644 --- a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzDeviceListModelTest.java +++ b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzDeviceListModelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzTemplateListModelTest.java b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzTemplateListModelTest.java index 6315a2ca9edf8..b00707aaad810 100644 --- a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzTemplateListModelTest.java +++ b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/AVMFritzTemplateListModelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModelTest.java b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModelTest.java index 4d442592e5cd9..8292fe288cd3b 100644 --- a/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModelTest.java +++ b/bundles/org.openhab.binding.avmfritz/src/test/java/org/openhab/binding/avmfritz/internal/ahamodel/HeatingModelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/NOTICE b/bundles/org.openhab.binding.bigassfan/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.bigassfan/NOTICE +++ b/bundles/org.openhab.binding.bigassfan/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.bigassfan/README.md b/bundles/org.openhab.binding.bigassfan/README.md index 52e1a1dcd330d..e9fc5c11da12f 100644 --- a/bundles/org.openhab.binding.bigassfan/README.md +++ b/bundles/org.openhab.binding.bigassfan/README.md @@ -1,14 +1,39 @@ # BigAssFan Binding -The [BigAssFan](http://www.bigassfans.com/) binding is used to enable communication between openHAB and Big Ass Fans' Haiku family of residential fans and lights that implement the SenseME technology. +The [BigAssFan](https://www.bigassfans.com/) binding is used to enable communication between openHAB and Big Ass Fans' Haiku family of residential fans and lights that implement the SenseME technology. ## Overview -Fans and lights are discovered dynamically. -There is a single thing created for each fan and/or connected to the network. +Fans, lights and controllers are discovered dynamically. +There is a single thing created for each fan, light, or controller that's connected to the local WiFi network. Each thing has channels that allow control of the fan and light, as well as to monitor the status. When a fan or light is controlled from the remote control, Wall Controller, or smartphone app, the openHAB items linked to the device's channels will be updated to reflect the status. +## Supported Things + +The binding currently supports the following devices. + +| Thing | ID | | +|-------------|-------------|--------------------| +| Fan | fan | BigAssFan consisting of fan and integrated LED light | +| Light | light | Standalone LED light | +| Controller | controller | Fan wall controller | + +## Thing Configuration + +| Parameter | Parameter ID | Required/Optional | Description | +|--------------|---------------|-------------------|-------------| +| Label | label | Required | Label given to device in the Haiku Smartphone app. | +| IP Address | ipAddress | Required | IP address of the device. | +| MAC Address | macAddress | Required | MAC address of the device. | + +In the event that any of this information is changed on the device, the thing configuration must be updated manually, as it cannot be determined automatically by the binding. + +### Manual Thing Creation + +Fans and lights can be manually created in the *Paper UI* or *HABmin*, or by placing a *.things* file in the *conf/things* directory. +See example below. + ## Device Discovery The BigAssFan binding discovers Haiku fans and lights on the network, and creates an inbox entry for each discovered device. @@ -22,16 +47,6 @@ To **disable** background discovery, add the following line to the *conf/service discovery.bigassfan:background=false ``` -## Thing Configuration - -The device's IP address, MAC address, and name is set at time of discovery. -However, in the event that any of this information changes, the configuration must be updated. - -### Manual Thing Creation - -Fans and lights can be manually created in the *PaperUI* or *HABmin*, or by placing a *.things* file in the *conf/things* directory. -See example below. - ## Channels The following channels are supported for fans: @@ -84,50 +99,50 @@ The following channels are supported for wall controllers: The following item definitions would be used to control the fan. ```java -Switch PorchFanPower { channel="bigassfan:fan:20F85EDAA56A:fan-power" } -Dimmer PorchFanSpeed { channel="bigassfan:fan:20F85EDAA56A:fan-speed" } -Switch PorchFanAuto { channel="bigassfan:fan:20F85EDAA56A:fan-auto" } -Switch PorchFanWhoosh { channel="bigassfan:fan:20F85EDAA56A:fan-whoosh" } -Switch PorchFanSleep { channel="bigassfan:fan:20F85EDAA56A:fan-sleep" } -String PorchFanSmartmode { channel="bigassfan:fan:20F85EDAA56A:fan-smartmode" } -Dimmer PorchFanSpeedMin { channel="bigassfan:fan:20F85EDAA56A:fan-learn-minspeed" } -Dimmer PorchFanSpeedMax { channel="bigassfan:fan:20F85EDAA56A:fan-learn-maxspeed" } +Switch PorchFanPower { channel="bigassfan:fan:20F85EDAA56A:fan-power" } +Dimmer PorchFanSpeed { channel="bigassfan:fan:20F85EDAA56A:fan-speed" } +Switch PorchFanAuto { channel="bigassfan:fan:20F85EDAA56A:fan-auto" } +Switch PorchFanWhoosh { channel="bigassfan:fan:20F85EDAA56A:fan-whoosh" } +Switch PorchFanSleep { channel="bigassfan:fan:20F85EDAA56A:fan-sleep" } +String PorchFanSmartmode { channel="bigassfan:fan:20F85EDAA56A:fan-smartmode" } +Dimmer PorchFanSpeedMin { channel="bigassfan:fan:20F85EDAA56A:fan-learn-minspeed" } +Dimmer PorchFanSpeedMax { channel="bigassfan:fan:20F85EDAA56A:fan-learn-maxspeed" } ``` The following item definitions would be used to control the light. ```java -Switch PorchFanLightPower { channel="bigassfan:fan:20F85EDAA56A:light-power" } -Dimmer PorchFanLightLevel { channel="bigassfan:fan:20F85EDAA56A:light-level" } -Switch PorchFanLightAuto { channel="bigassfan:fan:20F85EDAA56A:light-auto" } -Switch PorchFanLightSmarter { channel="bigassfan:fan:20F85EDAA56A:light-smarter" } -Dimmer PorchFanLightLevelMin { channel="bigassfan:fan:20F85EDAA56A:light-level-min" } -Dimmer PorchFanLightLevelMax { channel="bigassfan:fan:20F85EDAA56A:light-level-max" } +Switch PorchFanLightPower { channel="bigassfan:fan:20F85EDAA56A:light-power" } +Dimmer PorchFanLightLevel { channel="bigassfan:fan:20F85EDAA56A:light-level" } +Switch PorchFanLightAuto { channel="bigassfan:fan:20F85EDAA56A:light-auto" } +Switch PorchFanLightSmarter { channel="bigassfan:fan:20F85EDAA56A:light-smarter" } +Dimmer PorchFanLightLevelMin { channel="bigassfan:fan:20F85EDAA56A:light-level-min" } +Dimmer PorchFanLightLevelMax { channel="bigassfan:fan:20F85EDAA56A:light-level-max" } ``` The following read-only items are provided by the fan. ```java -String PorchFanLightPresent { channel="bigassfan:fan:20F85EDAA56A:light-present" } -Switch PorchFanMotionSensor { channel="bigassfan:fan:20F85EDAA56A:motion" } -DateTime PorchFanTime { channel="bigassfan:fan:20F85EDAA56A:time" } +String PorchFanLightPresent { channel="bigassfan:fan:20F85EDAA56A:light-present" } +Switch PorchFanMotionSensor { channel="bigassfan:fan:20F85EDAA56A:motion" } +DateTime PorchFanTime { channel="bigassfan:fan:20F85EDAA56A:time" } ``` ## Light Items ```java -Switch KitchenLightPower { channel="bigassfan:light:20F85EDA87A0:light-power" } -Dimmer KitchenLightLevel { channel="bigassfan:light:20F85EDA87A0:light-level" } -Switch KitchenLightHue { channel="bigassfan:light:20F85EDA87A0:light-hue" } +Switch KitchenLightPower { channel="bigassfan:light:20F85EDA87A0:light-power" } +Dimmer KitchenLightLevel { channel="bigassfan:light:20F85EDA87A0:light-level" } +Switch KitchenLightHue { channel="bigassfan:light:20F85EDA87A0:light-hue" } ``` The following read-only items are provided by the light. ```java -String KitchenLightPresent { channel="bigassfan:light:20F85EDA87A0:light-present" } -String KitchenLightColor { channel="bigassfan:light:20F85EDA87A0:light-color" } -Switch KitchenLightMotionSensor { channel="bigassfan:light:20F85EDA87A0:motion" } -DateTime KitchenLightTime { channel="bigassfan:light:20F85EDA87A0:time" } +String KitchenLightPresent { channel="bigassfan:light:20F85EDA87A0:light-present" } +String KitchenLightColor { channel="bigassfan:light:20F85EDA87A0:light-color" } +Switch KitchenLightMotionSensor { channel="bigassfan:light:20F85EDA87A0:motion" } +DateTime KitchenLightTime { channel="bigassfan:light:20F85EDA87A0:time" } ``` ## Wall Controller Items @@ -135,8 +150,8 @@ DateTime KitchenLightTime { channel="bigassfan:light:20F85EDA87A0:time The following read-only items are provided by the wall controller. ```java -Switch PorchControllerMotionSensor { channel="bigassfan:controller:20F85ED87F01:motion" } -DateTime PorchControllerTime { channel="bigassfan:controller:20F85ED87F01:time" } +Switch PorchControllerMotionSensor { channel="bigassfan:controller:20F85ED87F01:motion" } +DateTime PorchControllerTime { channel="bigassfan:controller:20F85ED87F01:time" } ``` ### Sitemap @@ -165,7 +180,3 @@ The file should contain lines formatted like this. ```java bigassfan:fan:20F85EDAA56A [ label="Porch Fan", ipAddress="192.168.12.62", macAddress="20:F8:5E:DA:A5:6A" ] ``` - -#### Unsupported Features - -Standalone lights are not supported. diff --git a/bundles/org.openhab.binding.bigassfan/pom.xml b/bundles/org.openhab.binding.bigassfan/pom.xml index fa5590f3b57aa..8b214499065e2 100644 --- a/bundles/org.openhab.binding.bigassfan/pom.xml +++ b/bundles/org.openhab.binding.bigassfan/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bigassfan</artifactId> diff --git a/bundles/org.openhab.binding.bigassfan/src/main/feature/feature.xml b/bundles/org.openhab.binding.bigassfan/src/main/feature/feature.xml index 6bd5d0fb37ba7..a1fe880d1f1d2 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bigassfan/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bigassfan-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bigassfan" description="Big Ass Fan Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanBindingConstants.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanBindingConstants.java index 39570cd508ac4..7f95c40777b92 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanBindingConstants.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanConfig.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanConfig.java index f2b287c4d2e2e..1149975907a32 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanConfig.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanHandlerFactory.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanHandlerFactory.java index ef57bb29283a9..6ccd5f6fc4b1c 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanHandlerFactory.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/BigAssFanHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDevice.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDevice.java index 5245ebfd5c4fa..dc1123753b80d 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDevice.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDiscoveryService.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDiscoveryService.java index 7408101965a57..c9cf1ed89ec84 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDiscoveryService.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/BigAssFanDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/DiscoveryListener.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/DiscoveryListener.java index f1885feb75499..10bb5778c959e 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/DiscoveryListener.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/discovery/DiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/handler/BigAssFanHandler.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/handler/BigAssFanHandler.java index 79c2b747c071a..8887aebe579a4 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/handler/BigAssFanHandler.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/handler/BigAssFanHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/utils/BigAssFanConverter.java b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/utils/BigAssFanConverter.java index aaaca1610d426..a2636309d0acd 100644 --- a/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/utils/BigAssFanConverter.java +++ b/bundles/org.openhab.binding.bigassfan/src/main/java/org/openhab/binding/bigassfan/internal/utils/BigAssFanConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/pom.xml b/bundles/org.openhab.binding.bluetooth.bluegiga/pom.xml index d7fd872f525f7..d381b5d2bc373 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/pom.xml +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bluetooth.bluegiga</artifactId> diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/feature/feature.xml b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/feature/feature.xml index 37c4c90553787..20d5b6946e564 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bluetooth.bluegiga-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bluetooth-bluegiga" description="Bluetooth Binding Bluegiga" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaAdapterConstants.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaAdapterConstants.java index a07c17363543e..619a1623248d6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaAdapterConstants.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaAdapterConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java index beeaaba81156d..c8a0ba8b93055 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java index eaf08050e5dcf..4c5eafabc2c30 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java index 3573b5d11df48..7e971e1251994 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java index 62dc80cb72ebb..852f926b45b3d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaException.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaException.java index a0c5612f8a57e..46e4e17b32ccb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaException.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java index e0869e8da9a1a..cda1ff5e6644e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaHandlerListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java index fb62787b80744..3dd1896c44b30 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java index f2cf9e85cb3d4..5e5c2160a39ad 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java index d4a432ced5432..9d57955c72fe1 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaSerialHandler.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaSerialHandler.java index ab969b3cd3de8..3e88fb13ce98f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaSerialHandler.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaSerialHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java index 178cf92134ee1..8cf9924ef1a16 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java index cb953f64cdf40..5f7ec0a11efb1 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java index 1198288197e7e..ec966afa67948 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java index c5915d02cb336..5a624a68071b4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java index ed7b7677f53f4..cec2ead41c399 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java index e62f0d444ccf2..ccf281cdd84ef 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java index 87946d9200162..86c96b905a826 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java index 8e501d9f9eaf1..6765ada61c250 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java index 3256faa515da1..e17b95d1af39f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java index 41a3af02f2c53..fd8dad5b61a53 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java index c70673c573fca..0e7440f1a2381 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java index 7abf11247147b..c0e54fbb35c7a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java index 26e8abe360ffd..366c86e07e96d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java index 2269224a0b693..94349ff6b0f32 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java index e4545eee04876..ad232759d68e4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java index 2302ab2914d10..f1e11225d8482 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java index 16a6505a9431b..85f261c0543bf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java index f2475b749f640..b2193f7364d2e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java index d24eda841dd87..79e8fa3b6f4c8 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java index 2072b3866e5d9..cbc258b76f17a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java index 515a1ba3d1a56..75ecd0bed6605 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java index 53173543f625d..20623366ee043 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java index d061882e5313c..7015d38ed8892 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java index a05ae08d79028..3d989043d74ce 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java index fe752795fa412..a1129951639f6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java index 69a307b3b95e6..15b2b29cda71a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java index a1d788b64b2d4..06ee10b3c1ad0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java index 9f6d25c874ff4..b06960b0684e7 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java index adbf224817a11..41caead0acf14 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java index e8be148fcdcb0..79ee6a098b363 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java index 11c8d63487d1b..9ab1eafeb8532 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java index d5ca6d77001a1..fb7444bc48513 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java index 81221c9657606..c8dd6856fe45d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java index 517bbf3bf3199..93a4027f09f50 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java index 758e362203983..a62dd049e3431 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java index 1de7798fc6984..6e8fbc2104354 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java index 86bd65b15a7a5..7244b10705ab5 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java index ae1010ea1b36f..df16c1018f81b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java index 95330696a3b60..16b8fb89d83cf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java index 742f209ada7bb..74da2e70897aa 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java index 3b5ec01f95e84..90400f4b559df 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java index 08bd5817af7f7..9601de52efc99 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java index ad1eb5f776052..0a815e8bde105 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java index 3551214812c35..50755d781a53d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java index e662d1099b8d1..220972f32f8a9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java index 67c594b17eb12..927b7025d0c44 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java index 4ef59edbaeee4..0679e7aaad33b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java index 40e420c82c0b9..3401ef10e02fc 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java index 1a4e8daa414ad..2ddd2bffc152b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java index 7b943148c67be..b108a187a70f3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java index f8fb3bfe6ad37..a3d3a3954addb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java index ab9a48b0d39fa..b0e67213c3281 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java index 3dff0a5489f92..fd2a8ee9a9a91 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java index 7ea7443986e76..bcbcf35716278 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java index 207821c455d80..e0c8bf2923215 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java index 13d1e0c731470..57870c12d6af6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java index 21f2e2d7be1aa..5c119f632f240 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java index 8acb784b496eb..68e5431d44a43 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java index 4a33bb6b9afda..aaffb35041915 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java index 0e2a94e63f978..c5e0812baac4b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java index a35d2a2b2adbd..30beb84ff3cbd 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java index 204d6bec60701..1021a4f1ff0d5 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java index f8afb2f50ab38..92f9e1587df51 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java index a1984b4d9232f..3bca00a7abc33 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java index 43ebd12e3f3e8..b0f86206a724b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java index 113f890ddb2dc..51ae404bfcf37 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java index c24745791f8fb..ba3bc8a67b916 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java index d54058aa10fa3..16a8eb8e86fec 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java index e21a8cd9da44f..13ed72e92bf69 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java index bc8007f7c0eec..3c48eb69adb4b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java index c583bdcb5dd5f..04cb1689e6e2c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java index c0c1fe4f4f83a..1445aeec38226 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java index 68fab95df40e9..3c3020b0f896a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java index 5646662b473d7..92ac111ba6f68 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java index 196a0a16de501..c9163bcaa6bc2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java index e7a312bb93250..7dc257dd9fc85 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java index 23507311ddaa7..3802b06a7815a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java index acb77830639c2..b844ba6a82108 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java index e864b7a6af7f9..c385cb7d2670f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java index d955f5a419799..df90fb90bcb0a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java index f1ea469fe459a..533a856d29aa4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java index c44633f8f3d5d..c5d8c895031fe 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java index 39f9315fc3284..4cbcd2c60f28e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java index 8b8dee328a22e..a890daef832a9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java index 92e58f5fd8aa0..d076267c59b98 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java index 9453af16f0135..f307905a6c421 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java index 1a74c9d4dbaae..4e77874e89ff3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java index 644cf5c63096f..5a34be40513bf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java index 24ae53e0e65f6..c28571d33ac4d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java index 6afc64c8fad19..633a22dc7e459 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java index 4301cd195b374..a16f2524f0308 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java index 774a2ee273f40..1004f3ca1fdbb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java index 046563a9e52f8..52b4de92bcdaa 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java index 954a9da845d95..230e658535466 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java index 5dcac06b8caf2..0d6cb973d9c0e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java index 5de4c6ec225a2..ca238ce66e26e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java index fdee13bf04ff9..c27e9d4614eb3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java index 99530be3d674c..7408c036c79eb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java index cf0f03afbb6cc..cae6da2eb2b86 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java index 49bc0cf69c8a2..f5af500901c72 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java index 7f9c7035ed3a3..c7a321a3269ee 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java index 110ebc386a0dd..6b2416c397a48 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java index 687ef06775cce..d3f1b9a33fa9a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java index 16186e4f9e223..d3c22ff5037d9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java index f4d16922a632d..27dd4ab357730 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java index 4880f57361c63..ddaf2340bf43a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java index 2571f54f402e2..61f1fcf1492c5 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java index 4d2143dffd1f8..2563bb35fa783 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java index f271b4721a49f..6a5e0b68344ee 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java index ffdac606b09b6..82b3965c584f9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java index 8f9e74875c91b..862450c90a6a3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java index a80073eecd2aa..e1585c628f9d0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java index 5281501436fbb..265b97e41fb49 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java index 52f3a43471388..f1a1ab3e95563 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java index 5227e3f347f6e..61c88c3af611f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java index dc8129b898d7b..267084041a63d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java index 573deb9759a35..0b9452d6b7201 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java index eb207062d4337..82cf6c5168533 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java index d3ebcef4088c4..7f71475cbbc4f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirPacket.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirPacket.java index e01a2a1ebb88e..6c7b7de8da5fb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirPacket.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecord.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecord.java index bc215fc28f4d6..69d71bf0d6be2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecord.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecord.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java index fa1be06ad3431..a38ce72c05cab 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java index 7bb19a2b2be66..4fff21eeb63d5 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java index a062f79f446b0..d44c1bd2c977f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java index fbf9415446c48..598caf2eb4818 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java index 0068741ba862d..538de850dd64a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java index 958cb92eb7dcb..e576b469e60a0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java index a94f5977a72c9..d4b5e9d731015 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java index 8b9b0b905ae6e..e0bad97b97e71 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java index 0050de0ff1cd7..0517ef3554186 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java index 0e2c23964cd1a..3f4ece9237494 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java index 1d2a86d46b104..56d9ffa98e00e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/test/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecordTest.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/test/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecordTest.java index fcd6e843ce3b8..9a09cb8408db4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/test/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecordTest.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/test/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirRecordTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,9 +19,12 @@ import java.util.UUID; import org.junit.Test; -import org.openhab.binding.bluetooth.bluegiga.internal.eir.EirDataType; -import org.openhab.binding.bluetooth.bluegiga.internal.eir.EirRecord; +/** + * Tests {@link EirRecord}. + * + * @author Kai Kreuzer - Initial contribution + */ public class EirRecordTest { @SuppressWarnings("unchecked") diff --git a/bundles/org.openhab.binding.bluetooth.bluez/NOTICE b/bundles/org.openhab.binding.bluetooth.bluez/NOTICE index 14d2cd35aa10f..9de2136994836 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/NOTICE +++ b/bundles/org.openhab.binding.bluetooth.bluez/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content @@ -43,4 +43,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/bundles/org.openhab.binding.bluetooth.bluez/README.md b/bundles/org.openhab.binding.bluetooth.bluez/README.md index 77e347f540dcf..28b23b31b454c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/README.md +++ b/bundles/org.openhab.binding.bluetooth.bluez/README.md @@ -2,9 +2,39 @@ This extension supports Bluetooth access via BlueZ on Linux (ARMv6hf). +# Setup + Please note that at least BlueZ 5.43 is required, while 5.48 or above are [not (yet) supported](https://github.com/intel-iot-devkit/tinyb/issues/131) either. -Also note that the OS user needs to be a member of the "bluetooth" group of Linux in order to have the rights to access the BlueZ stack. +Some settings are required to ensure that openHAB has access to Bluez. +To allow openHAB to access Bluez via dbus you need to add the following entry within your dbus configuration in `/etc/dbus-1/system.d/bluetooth.conf` + +```xml +<busconfig> + <policy user="root"> + ... + </policy> + <policy group="bluetooth"> + <allow send_destination="org.bluez"/> + </policy> + ... +</busconfig> +``` + +and add openHAB to the "bluetooth" group. + +```shell +sudo adduser openhab bluetooth +``` + +Also, in case you don't want to manually enable your bluetooth adapters with `bluetoothctl`, ensure that it's automatically enabled by setting the option `AutoEnable` in your `/etc/bluetooth/main.conf` to `true`. +Restart running services for changes to take effect. + +``` +systemctl restart dbus +systemctl restart bluetooth +systemctl restart openhab2 +``` ## Supported Things diff --git a/bundles/org.openhab.binding.bluetooth.bluez/pom.xml b/bundles/org.openhab.binding.bluetooth.bluez/pom.xml index 0b5ef883b9789..74ecbc52b211b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/pom.xml +++ b/bundles/org.openhab.binding.bluetooth.bluez/pom.xml @@ -1,24 +1,17 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bluetooth.bluez</artifactId> <name>openHAB Add-ons :: Bundles :: BlueZ Bluetooth Adapter</name> - <properties> - <embedDependency.groupId>org.openhab.osgiify</embedDependency.groupId> - <embedDependency.artifactId>intel-iot-devkit.tinyb</embedDependency.artifactId> - <embedDependency.version>0.5.1</embedDependency.version> - </properties> - <dependencies> <dependency> <groupId>org.openhab.addons.bundles</groupId> @@ -30,7 +23,7 @@ <groupId>org.openhab.osgiify</groupId> <artifactId>intel-iot-devkit.tinyb</artifactId> <version>0.5.1</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/feature/feature.xml b/bundles/org.openhab.binding.bluetooth.bluez/src/main/feature/feature.xml index 9c1f255ac4d0a..9885924e6ef87 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bluetooth.bluez-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bluetooth-bluez" description="Bluetooth Binding Bluez" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZAdapterConstants.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZAdapterConstants.java index 6ef6d804b9899..9bacff6ea89b9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZAdapterConstants.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZAdapterConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZBluetoothDevice.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZBluetoothDevice.java index 95bf4d39935d7..c06a3c248148e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZBluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/BlueZBluetoothDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZAdapterConfiguration.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZAdapterConfiguration.java index 2dc3f9aca362f..43e874c230a18 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZAdapterConfiguration.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZAdapterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZBridgeHandler.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZBridgeHandler.java index 54bf41a03014c..181e5e84625f4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZBridgeHandler.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/handler/BlueZBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -98,7 +98,7 @@ public void initialize() { throw new IllegalStateException("BlueZ JNI connection cannot be established.", e); } catch (RuntimeException e) { // we do not get anything more specific from TinyB here - if (e.getMessage().contains("AccessDenied")) { + if (e.getMessage() != null && e.getMessage().contains("AccessDenied")) { throw new IllegalStateException( "Cannot access BlueZ stack due to permission problems. Make sure that your OS user is part of the 'bluetooth' group of BlueZ."); } else { diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZHandlerFactory.java index d0b5b3ed5d9e5..cf8029a372150 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/BlueZHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/discovery/BlueZDiscoveryService.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/discovery/BlueZDiscoveryService.java index 7144d09f8a587..6e020b84c1dbf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/discovery/BlueZDiscoveryService.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/internal/discovery/BlueZDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -61,11 +61,11 @@ protected void startScan() { return; } catch (RuntimeException e) { // we do not get anything more specific from TinyB here - if (e.getMessage().contains("AccessDenied")) { + if (e.getMessage() != null && e.getMessage().contains("AccessDenied")) { logger.warn( "Cannot access BlueZ stack due to permission problems. Make sure that your OS user is part of the 'bluetooth' group of BlueZ."); } else { - logger.warn("Failed to scan for Bluetooth devices: {} ", e.getMessage(), e); + logger.warn("Failed to scan for Bluetooth devices", e); } } } diff --git a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/package-info.java b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/package-info.java index 7719f7f7c9ab8..40479c28eadd4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/package-info.java +++ b/bundles/org.openhab.binding.bluetooth.bluez/src/main/java/org/openhab/binding/bluetooth/bluez/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,7 +10,8 @@ * * SPDX-License-Identifier: EPL-2.0 */ -@org.osgi.annotation.bundle.Header(name = org.osgi.framework.Constants.BUNDLE_NATIVECODE, value = "lib/armv6hf/libjavatinyb.so;lib/armv6hf/libtinyb.so;processor=arm;osname=linux,*") +@org.osgi.annotation.bundle.Header(name = org.osgi.framework.Constants.BUNDLE_NATIVECODE, value = "lib/armv6hf/libjavatinyb.so;lib/armv6hf/libtinyb.so;processor=arm;osname=linux, lib/x86-64/libjavatinyb.so;lib/x86-64/libtinyb.so;processor=amd64;osname=linux, *") +@org.osgi.annotation.bundle.Header(name = "Specification-Version", value = "0.5.0-28-gac6d308.0.5.0-28-gac6d308") package org.openhab.binding.bluetooth.bluez; /** @@ -18,4 +19,4 @@ * * @author Jan N. Klug - Initial contribution * - */ \ No newline at end of file + */ diff --git a/bundles/org.openhab.binding.bluetooth.blukii/NOTICE b/bundles/org.openhab.binding.bluetooth.blukii/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/NOTICE +++ b/bundles/org.openhab.binding.bluetooth.blukii/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.bluetooth.blukii/README.md b/bundles/org.openhab.binding.bluetooth.blukii/README.md index 48fd2b16e6828..1d98626a2304e 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/README.md +++ b/bundles/org.openhab.binding.bluetooth.blukii/README.md @@ -1,6 +1,6 @@ # Blukii -This extension adds support for [Blukii](http://www.blukii.com/) Sensor Beacons. +This extension adds support for [Blukii](https://www.blukii.com/) Sensor Beacons. ## Supported Things @@ -50,4 +50,4 @@ Number:Illuminance luminance "Luminance [%.0f %unit%]" { channel=" Number:Angle tiltX "Tilt (X-Axis) [%.0f %unit%]" { channel="bluetooth:blukii:hci0:beacon:tiltx" } Number:Angle tiltY "Tilt (Y-Axis) [%.0f %unit%]" { channel="bluetooth:blukii:hci0:beacon:tilty" } Number:Angle tiltZ "Tilt (Z-Axis) [%.0f %unit%]" { channel="bluetooth:blukii:hci0:beacon:tiltz" } -``` \ No newline at end of file +``` diff --git a/bundles/org.openhab.binding.bluetooth.blukii/pom.xml b/bundles/org.openhab.binding.bluetooth.blukii/pom.xml index e59172cb28583..b057e94babce9 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/pom.xml +++ b/bundles/org.openhab.binding.bluetooth.blukii/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bluetooth.blukii</artifactId> diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/feature/feature.xml b/bundles/org.openhab.binding.bluetooth.blukii/src/main/feature/feature.xml index 79be2a0140906..9de45bf093a61 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bluetooth.blukii-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bluetooth-bluuki" description="Bluetooth Binding Blukii" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java index bc7ec507f2ee0..555d537ac34c8 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/BlukiiBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java index 64feac1d67969..90239d47e9e8a 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/handler/BlukiiHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiDiscoveryParticipant.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiDiscoveryParticipant.java index 50881b15f9ad3..83ec28e117328 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java index 6486c88c4d4c7..247b04ec561e7 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/BlukiiHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Accelerometer.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Accelerometer.java index 876c2fc27bbf6..33eb5e88b01c9 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Accelerometer.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Accelerometer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiData.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiData.java index 9f6599f4f7e6d..71dab74be4caf 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiData.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiDataDecoder.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiDataDecoder.java index 8a17a7ba99e59..4afa8504faf5c 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiDataDecoder.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/BlukiiDataDecoder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Environment.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Environment.java index 40f194e596b63..c8b8a8d20a6ee 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Environment.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Environment.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Magnetometer.java b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Magnetometer.java index 5671ba903664c..7ae9597d62dcf 100644 --- a/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Magnetometer.java +++ b/bundles/org.openhab.binding.bluetooth.blukii/src/main/java/org/openhab/binding/bluetooth/blukii/internal/data/Magnetometer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/NOTICE b/bundles/org.openhab.binding.bluetooth.ruuvitag/NOTICE index b50307325bc27..2733452284a12 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/NOTICE +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/README.md b/bundles/org.openhab.binding.bluetooth.ruuvitag/README.md index cd29e1d7f75b4..63c9c00591893 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/README.md +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/README.md @@ -1,6 +1,6 @@ # Ruuvi Tag -This extension adds support for [Ruuvi Tag](http://www.ruuvitag.com/) Sensor Beacons. +This extension adds support for [Ruuvi Tag](https://ruuvi.com/) Sensor Beacons. ## Supported Things diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/pom.xml b/bundles/org.openhab.binding.bluetooth.ruuvitag/pom.xml index f4f896b160df5..d3f53a928cac0 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/pom.xml +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bluetooth.ruuvitag</artifactId> diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/feature/feature.xml b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/feature/feature.xml index 8b73134128e3e..0e9d99154bb29 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bluetooth.ruuvitag-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bluetooth-ruuvitag" description="Bluetooth Binding Ruuvitag" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagBindingConstants.java b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagBindingConstants.java index e7e53e7e95d68..316a13777f933 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagBindingConstants.java +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagDiscoveryParticipant.java b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagDiscoveryParticipant.java index c10ef6d3f7a6c..17f885b148e8c 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandler.java b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandler.java index 43b80c12c3565..5b7aa963a3df4 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandler.java +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandlerFactory.java index 1d73b700282a1..a595f6f97126a 100644 --- a/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.ruuvitag/src/main/java/org/openhab/binding/bluetooth/ruuvitag/internal/RuuviTagHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/CONTRIBUTE.md b/bundles/org.openhab.binding.bluetooth/CONTRIBUTE.md index 61e06062b4613..700b04af9ce25 100644 --- a/bundles/org.openhab.binding.bluetooth/CONTRIBUTE.md +++ b/bundles/org.openhab.binding.bluetooth/CONTRIBUTE.md @@ -15,13 +15,13 @@ This includes the main classes required to implement Bluetooth: ## Implementing a new Bluetooth Adapter bundle -Bluetooth adapters are modelled as a bridge in ESH. +Bluetooth adapters are modelled as a bridge in openHAB. The bridge handler provides the link with the Bluetooth hardware (eg a dongle, or system Bluetooth API). An adapter bundle needs to implement two main classes: the `BridgeHandler` which should implement `BluetoothAdapter` (any be registered as a service), and a `ThingFactory`, which is required to instantiate the handler. The bridge handler must implement any functionality required to interface to the Bluetooth layer. It is responsible for managing the Bluetooth scanning, device discovery (i.e. the device interrogation to get the list of services and characteristics) and reading and writing of characteristics. -The bridge needs to manage any interaction between the interface with any things it provides – this needs to account for any constraints that a interface may impose such that things do not need to worry about any peculiarities imposed by a specific interface. +The bridge needs to manage any interaction between the interface with any things it provides – this needs to account for any constraints that an interface may impose such that things do not need to worry about any peculiarities imposed by a specific interface. Classes such as `BluetoothCharacteristic` or `BluetoothService` may be extended to provide additional functionality to interface to a specific library if needed. diff --git a/bundles/org.openhab.binding.bluetooth/NOTICE b/bundles/org.openhab.binding.bluetooth/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.bluetooth/NOTICE +++ b/bundles/org.openhab.binding.bluetooth/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.bluetooth/pom.xml b/bundles/org.openhab.binding.bluetooth/pom.xml index 067864de9f56b..3bff93d8fab67 100644 --- a/bundles/org.openhab.binding.bluetooth/pom.xml +++ b/bundles/org.openhab.binding.bluetooth/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bluetooth</artifactId> diff --git a/bundles/org.openhab.binding.bluetooth/src/main/feature/feature.xml b/bundles/org.openhab.binding.bluetooth/src/main/feature/feature.xml index 66d2468568763..bb33699dbe6af 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bluetooth/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bluetooth-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bluetooth" description="Bluetooth Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BeaconBluetoothHandler.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BeaconBluetoothHandler.java index 6d26814c125b4..3149716c0a52c 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BeaconBluetoothHandler.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BeaconBluetoothHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAdapter.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAdapter.java index 2a9106d453e96..552bac5d4a7a2 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAdapter.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAddress.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAddress.java index 0ab3015b22268..06bdf262f29bb 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAddress.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothAddress.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothBindingConstants.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothBindingConstants.java index 637371fee9c96..6e9669cdef320 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothBindingConstants.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCharacteristic.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCharacteristic.java index e5703630020a6..6cb407d2333a7 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCharacteristic.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCharacteristic.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothClass.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothClass.java index 58787493b037c..48edfff214714 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothClass.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothClass.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompanyIdentifiers.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompanyIdentifiers.java index 1cb2da9387b0f..627c060792f44 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompanyIdentifiers.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompanyIdentifiers.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompletionStatus.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompletionStatus.java index 48c39c42e7369..933b8f443f8ef 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompletionStatus.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothCompletionStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDescriptor.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDescriptor.java index 45403c44e35cc..2d406253c9c6c 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDescriptor.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDescriptor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDevice.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDevice.java index af3222e1c0747..c64f7fa6651f3 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDeviceListener.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDeviceListener.java index 4f7afb3bc012b..6c58812cb33e8 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDeviceListener.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDeviceListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDiscoveryListener.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDiscoveryListener.java index bde307cad9efc..6ab7c99194368 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDiscoveryListener.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothDiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothService.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothService.java index 412d4d3f75a8b..c407f6a75f3b8 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothService.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/BluetoothService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/ConnectedBluetoothHandler.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/ConnectedBluetoothHandler.java index 03d1d8dace945..7e7dd0440ecba 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/ConnectedBluetoothHandler.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/ConnectedBluetoothHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/BluetoothDiscoveryParticipant.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/BluetoothDiscoveryParticipant.java index 3a544af6f036b..038d25a1fdb1f 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/BluetoothDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/BluetoothDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java index 2762e326e1de2..2917ba21d9a85 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/discovery/internal/BluetoothDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/internal/BluetoothHandlerFactory.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/internal/BluetoothHandlerFactory.java index 3f79cf4611a1d..e00e78b4d92b3 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/internal/BluetoothHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/internal/BluetoothHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothConnectionStatusNotification.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothConnectionStatusNotification.java index 29fea3e989a4a..4483f4d35d750 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothConnectionStatusNotification.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothConnectionStatusNotification.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothNotification.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothNotification.java index 35ad0869cff93..50e9a2aefda7a 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothNotification.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothNotification.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothScanNotification.java b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothScanNotification.java index cd39a7b00533d..d6a2a08b7e43b 100644 --- a/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothScanNotification.java +++ b/bundles/org.openhab.binding.bluetooth/src/main/java/org/openhab/binding/bluetooth/notification/BluetoothScanNotification.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bluetooth/src/test/java/org/openhab/binding/bluetooth/BluetoothAddressTest.java b/bundles/org.openhab.binding.bluetooth/src/test/java/org/openhab/binding/bluetooth/BluetoothAddressTest.java index b96b289c66cc8..b4fe82408d272 100644 --- a/bundles/org.openhab.binding.bluetooth/src/test/java/org/openhab/binding/bluetooth/BluetoothAddressTest.java +++ b/bundles/org.openhab.binding.bluetooth/src/test/java/org/openhab/binding/bluetooth/BluetoothAddressTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,8 +13,12 @@ package org.openhab.binding.bluetooth; import org.junit.Test; -import org.openhab.binding.bluetooth.BluetoothAddress; +/** + * Tests {@link BluetoothAddress}. + * + * @author Kai Kreuzer - Initial contribution + */ public class BluetoothAddressTest { @Test(expected = IllegalArgumentException.class) diff --git a/bundles/org.openhab.binding.boschindego/NOTICE b/bundles/org.openhab.binding.boschindego/NOTICE index b97e7c167cd1b..496122bf2c4f3 100644 --- a/bundles/org.openhab.binding.boschindego/NOTICE +++ b/bundles/org.openhab.binding.boschindego/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.boschindego/pom.xml b/bundles/org.openhab.binding.boschindego/pom.xml index 93360e34df14a..175a019af0919 100644 --- a/bundles/org.openhab.binding.boschindego/pom.xml +++ b/bundles/org.openhab.binding.boschindego/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.boschindego</artifactId> @@ -15,10 +14,10 @@ <dependencies> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>de.zazaz.iot.bosch.indego.bosch-indego-controller-lib</artifactId> + <groupId>de.zazaz.iot.bosch.indego</groupId> + <artifactId>bosch-indego-controller-lib</artifactId> <version>0.8</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.boschindego/src/main/feature/feature.xml b/bundles/org.openhab.binding.boschindego/src/main/feature/feature.xml index 7d5c0d0e4506c..22bafe1398949 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.boschindego/src/main/feature/feature.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.boschindego-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-boschindego" description="Bosch Indego Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature dependency="true">openhab.tp-jackson</feature> <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.9</bundle> <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.5</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/de.zazaz.iot.bosch.indego.bosch-indego-controller-lib/0.8</bundle> + <bundle dependency="true">mvn:commons-codec/commons-codec/1.10</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.boschindego/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoBindingConstants.java b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoBindingConstants.java index 2a5c9374dff16..7a1fb6e9da62a 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoBindingConstants.java +++ b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoHandlerFactory.java b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoHandlerFactory.java index 231e407619166..5317c4220bc0d 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoHandlerFactory.java +++ b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/BoschIndegoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoStateConstants.java b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoStateConstants.java index dc7f36002666a..5c325339aa8ee 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoStateConstants.java +++ b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/IndegoStateConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/handler/BoschIndegoHandler.java b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/handler/BoschIndegoHandler.java index ae60c9ea3290d..04b011f270bc2 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/handler/BoschIndegoHandler.java +++ b/bundles/org.openhab.binding.boschindego/src/main/java/org/openhab/binding/boschindego/internal/handler/BoschIndegoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.boschindego/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.boschindego/src/main/resources/ESH-INF/thing/thing-types.xml index 4f0799fc1fd44..cc6798ff0179c 100644 --- a/bundles/org.openhab.binding.boschindego/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.boschindego/src/main/resources/ESH-INF/thing/thing-types.xml @@ -26,7 +26,7 @@ <description>Password for the Bosch Indego account.</description> </parameter> <parameter name="refresh" type="integer" min="60"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> <default>180</default> </parameter> @@ -35,7 +35,7 @@ <channel-type id="state"> <item-type>Number</item-type> - <label>Numeric state</label> + <label>Numeric State</label> <state readOnly="false"> <options> <option value="1">Mow</option> @@ -52,7 +52,7 @@ </channel-type> <channel-type id="statecode" advanced="true"> <item-type>Number</item-type> - <label>State code</label> + <label>State Code</label> <description>API-code of the Indego state</description> <state readOnly="true"> <options> @@ -90,7 +90,7 @@ </channel-type> <channel-type id="mowed"> <item-type>Dimmer</item-type> - <label>Cut grass</label> + <label>Cut Grass</label> <description></description> <state readOnly="true" pattern="%d %%"></state> </channel-type> diff --git a/bundles/org.openhab.binding.bosesoundtouch/NOTICE b/bundles/org.openhab.binding.bosesoundtouch/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/NOTICE +++ b/bundles/org.openhab.binding.bosesoundtouch/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.bosesoundtouch/pom.xml b/bundles/org.openhab.binding.bosesoundtouch/pom.xml index ee1fb03aa18e2..ebd0cf33d3f76 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/pom.xml +++ b/bundles/org.openhab.binding.bosesoundtouch/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.bosesoundtouch</artifactId> diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/feature/feature.xml b/bundles/org.openhab.binding.bosesoundtouch/src/main/feature/feature.xml index d2297f41f5eda..fc7d06348db1a 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.bosesoundtouch-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-bosesoundtouch" description="Bose SoundTouch Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/APIRequest.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/APIRequest.java index b23189469ca04..15dd1e59a3bc1 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/APIRequest.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/APIRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,4 +45,4 @@ private APIRequest(String name) { public String toString() { return name; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/AvailableSources.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/AvailableSources.java index a468c40ca9a37..c3ac1f63ef2ee 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/AvailableSources.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/AvailableSources.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java index 3845ffd5efdd1..6118940695601 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchConfiguration.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchConfiguration.java index 4fb45f449ac62..dede672884757 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchConfiguration.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchHandlerFactory.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchHandlerFactory.java index 963fc92efdeb2..40904de720200 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchHandlerFactory.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotFoundException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotFoundException.java index c0673142bc885..5a85e535388fe 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotFoundException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public BoseSoundTouchNotFoundException(String message, Throwable cause) { public BoseSoundTouchNotFoundException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotificationChannelConfiguration.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotificationChannelConfiguration.java index 8c6b98800a72b..a40e8b302b321 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotificationChannelConfiguration.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseSoundTouchNotificationChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseStateDescriptionOptionProvider.java index 562942e421dab..ca139fba52713 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/BoseStateDescriptionOptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/CommandExecutor.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/CommandExecutor.java index 207f8955a4b7b..0a0e651e66fea 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/CommandExecutor.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/CommandExecutor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItem.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItem.java index 04754280a54b3..b8b79d18b539d 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItem.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemMaker.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemMaker.java index e9275a03b2b5a..6b150abc801ec 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemMaker.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemMaker.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -234,4 +234,4 @@ private ContentItem getTV() throws OperationModeNotAvailableException { } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemNotPresetableException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemNotPresetableException.java index 92f2607ce743e..4eedf809fe76d 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemNotPresetableException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/ContentItemNotPresetableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public ContentItemNotPresetableException(String message, Throwable cause) { public ContentItemNotPresetableException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoInternetRadioPresetFoundException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoInternetRadioPresetFoundException.java index 3192d6dc010d7..138250aa61d45 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoInternetRadioPresetFoundException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoInternetRadioPresetFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public NoInternetRadioPresetFoundException(String message, Throwable cause) { public NoInternetRadioPresetFoundException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoPresetFoundException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoPresetFoundException.java index d22d1948ae32d..d2c062e5904d1 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoPresetFoundException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoPresetFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public NoPresetFoundException(String message, Throwable cause) { public NoPresetFoundException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoStoredMusicPresetFoundException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoStoredMusicPresetFoundException.java index 07369e2e61294..0f059c7fdd740 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoStoredMusicPresetFoundException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/NoStoredMusicPresetFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public NoStoredMusicPresetFoundException(String message, Throwable cause) { public NoStoredMusicPresetFoundException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeNotAvailableException.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeNotAvailableException.java index b36d7d93c6cd5..a75d0ec4d200a 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeNotAvailableException.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeNotAvailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public OperationModeNotAvailableException(String message, Throwable cause) { public OperationModeNotAvailableException(Throwable cause) { super(cause); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeType.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeType.java index 0bbb44eef1a1c..65c65c217e1e4 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeType.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/OperationModeType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -49,4 +49,4 @@ private OperationModeType() { public String toString() { return name; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java index d3d60cee67272..30e75ec41575b 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/PresetContainer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/RemoteKeyType.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/RemoteKeyType.java index b39bcbd3d15e2..f2e4321d65d6d 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/RemoteKeyType.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/RemoteKeyType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -58,4 +58,4 @@ public String toString() { return name; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLHandlerState.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLHandlerState.java index e1e14fae433e0..f7ad34366cc90 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLHandlerState.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLHandlerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseHandler.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseHandler.java index 57d59ccc994dd..3033de1ccd132 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseHandler.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -688,4 +688,4 @@ private void updateSkipEnabled(OnOffType state) { private void updateSkipPreviousEnabled(OnOffType state) { handler.updateState(CHANNEL_SKIPPREVIOUSENABLED, state); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseProcessor.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseProcessor.java index cbc6b47156db0..f4ee3762ec72d 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseProcessor.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/XMLResponseProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/DiscoveryUtil.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/DiscoveryUtil.java index 7369f2e092b84..f02491967de57 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/DiscoveryUtil.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/DiscoveryUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java index 578adfd507750..a01d3e2815212 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/discovery/SoundTouchDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java index b318df962094b..ae9eb40a7edd7 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/java/org/openhab/binding/bosesoundtouch/internal/handler/BoseSoundTouchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/config/config.xml index 8450593c75016..c9160a16d4f2c 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/config/config.xml @@ -54,4 +54,4 @@ </description> </parameter> </config-description> -</config-description:config-descriptions> \ No newline at end of file +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/thing/channels.xml index 3d1d59ac051d8..ae82eee4f9267 100644 --- a/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.bosesoundtouch/src/main/resources/ESH-INF/thing/channels.xml @@ -91,14 +91,14 @@ <channel-type id="nowPlayingStationLocation" advanced="true"> <item-type>String</item-type> - <label>Station location</label> + <label>Station Location</label> <description>Location of current playing radio station</description> <state readOnly="true" /> </channel-type> <channel-type id="nowPlayingStationName" advanced="true"> <item-type>String</item-type> - <label>Station name</label> + <label>Station Name</label> <description>Name of current playing radio station</description> <state readOnly="true" /> </channel-type> @@ -156,27 +156,27 @@ <channel-type id="rateEnabled" advanced="true"> <item-type>Switch</item-type> - <label>Rating enabled</label> + <label>Rating Enabled</label> <description>Current source allows rating</description> <state readOnly="true" /> </channel-type> <channel-type id="saveAsPreset" advanced="true"> <item-type>Number</item-type> - <label>Save As Preset</label> + <label>Save as Preset</label> <description>A selected presetable Contentitem is save as Preset with number >6</description> </channel-type> <channel-type id="skipEnabled" advanced="true"> <item-type>Switch</item-type> - <label>Skip enabled</label> + <label>Skip Enabled</label> <description>Current source allows skipping to next track</description> <state readOnly="true" /> </channel-type> <channel-type id="skipPreviousEnabled" advanced="true"> <item-type>Switch</item-type> - <label>Skip/Previous enabled</label> + <label>Skip/Previous Enabled</label> <description>Current source allows scrolling through tracks</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.buienradar/NOTICE b/bundles/org.openhab.binding.buienradar/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.buienradar/NOTICE +++ b/bundles/org.openhab.binding.buienradar/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.buienradar/README.md b/bundles/org.openhab.binding.buienradar/README.md index 03d0133d1cc2d..20eeb03f10a70 100644 --- a/bundles/org.openhab.binding.buienradar/README.md +++ b/bundles/org.openhab.binding.buienradar/README.md @@ -19,7 +19,7 @@ No auto-discovery is currently possible. ## Configuration of the thing -The configuration can be done via the PaperUI web interface, or manually by adding a Thing to your `.things` file: +The configuration can be done via the Paper UI web interface, or manually by adding a Thing to your `.things` file: ``` Thing buienradar:rain_forecast:home [ location="52.198864211111925,5.4192629660193585" ] diff --git a/bundles/org.openhab.binding.buienradar/pom.xml b/bundles/org.openhab.binding.buienradar/pom.xml index 7bee1270d67b7..e302c21ceff4a 100644 --- a/bundles/org.openhab.binding.buienradar/pom.xml +++ b/bundles/org.openhab.binding.buienradar/pom.xml @@ -1,10 +1,9 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.buienradar</artifactId> <name>openHAB Add-ons :: Bundles :: Buienradar Binding</name> diff --git a/bundles/org.openhab.binding.buienradar/src/main/feature/feature.xml b/bundles/org.openhab.binding.buienradar/src/main/feature/feature.xml index 3a36188a6ae61..a5ecbeaf6b236 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.buienradar/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.buienradar-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-buienradar" description="Buienradar Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarBindingConstants.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarBindingConstants.java index c3df364683531..445ed12743ef0 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarBindingConstants.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarConfiguration.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarConfiguration.java index 601b0c74876fd..17939a5a77c10 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarConfiguration.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java index 02dd02ff7e617..4d03395bc39c3 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandlerFactory.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandlerFactory.java index 0354fe8f7ac5a..ffaceab04bc8c 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandlerFactory.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/BuienradarHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarParseException.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarParseException.java index 22304027d7e49..a04bd7f5e53b6 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarParseException.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarParseException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java index 529d8f3ad8340..67e007da3cf0d 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/BuienradarPredictionAPI.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/Prediction.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/Prediction.java index 8aabe8d33c7de..c6d5e7ab7fd70 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/Prediction.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/Prediction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/PredictionAPI.java b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/PredictionAPI.java index 18f3ea978281a..fba5737e3972e 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/PredictionAPI.java +++ b/bundles/org.openhab.binding.buienradar/src/main/java/org/openhab/binding/buienradar/internal/buienradarapi/PredictionAPI.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/binding/binding.xml index 5fb8b6e93f664..7467ff2d25851 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="buienradar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Buienradar Binding</name> <description>The Buienradar Binding periodically (5 minutes) retrieves results from the Buienradar API. For personal use only.</description> diff --git a/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/thing/thing-types.xml index 0ff4e018c8c02..9331977e8d02b 100644 --- a/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.buienradar/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,12 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="buienradar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <!-- Sample Thing Type --> <thing-type id="rain_forecast"> - <label>Rain forecast</label> + <label>Rain Forecast</label> <description>Does a simple rain forecast at the specified longitude/latitude of two hours, in 5 minute increments using the buienradar.nl webservice. </description> @@ -47,7 +46,7 @@ </parameter> <parameter name="refreshIntervalMinutes" type="integer" required="true" min="5" unit="min"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval in minutes</description> <default>5</default> </parameter> @@ -76,7 +75,7 @@ <channel-type id="forecast_0"> <item-type>Number:Speed</item-type> - <label>Current rainfall</label> + <label>Current Rainfall</label> <description>Current rainfall</description> <state readOnly="true" pattern="%.10f %unit%" /> </channel-type> diff --git a/bundles/org.openhab.binding.buienradar/src/test/java/org/openhab/binding/buienradar/BuienradarPredictionAPITest.java b/bundles/org.openhab.binding.buienradar/src/test/java/org/openhab/binding/buienradar/BuienradarPredictionAPITest.java index f60a5e329d85b..5ccec06efbf87 100644 --- a/bundles/org.openhab.binding.buienradar/src/test/java/org/openhab/binding/buienradar/BuienradarPredictionAPITest.java +++ b/bundles/org.openhab.binding.buienradar/src/test/java/org/openhab/binding/buienradar/BuienradarPredictionAPITest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,6 +24,11 @@ import org.openhab.binding.buienradar.internal.buienradarapi.BuienradarPredictionAPI; import org.openhab.binding.buienradar.internal.buienradarapi.Prediction; +/** + * Tests {@link BuienradarPredictionAPI}. + * + * @author Edwin de Jong - Initial contribution + */ public class BuienradarPredictionAPITest { private static final ZonedDateTime NOW = ZonedDateTime.of(2019, 3, 10, 20, 37, 0, 0, ZoneId.of("Europe/Amsterdam")); diff --git a/bundles/org.openhab.binding.chromecast/NOTICE b/bundles/org.openhab.binding.chromecast/NOTICE index 64345eb4919d9..7f3293872baf9 100644 --- a/bundles/org.openhab.binding.chromecast/NOTICE +++ b/bundles/org.openhab.binding.chromecast/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.chromecast/pom.xml b/bundles/org.openhab.binding.chromecast/pom.xml index 8e6917bfb1ec0..0e025eadec2f0 100644 --- a/bundles/org.openhab.binding.chromecast/pom.xml +++ b/bundles/org.openhab.binding.chromecast/pom.xml @@ -1,24 +1,51 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.chromecast</artifactId> <name>openHAB Add-ons :: Bundles :: Chromecast Binding</name> + <properties> + <dep.noembedding>jackson-core,jackson-annotations,jackson-databind</dep.noembedding> + </properties> + <dependencies> <dependency> <groupId>su.litvak.chromecast</groupId> <artifactId>api-v2</artifactId> - <version>0.11.1</version> - <scope>provided</scope> + <version>0.11.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-java</artifactId> + <version>2.6.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>2.9.9</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>2.9.9</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>2.9.9</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.chromecast/src/main/feature/feature.xml b/bundles/org.openhab.binding.chromecast/src/main/feature/feature.xml index fd3a96e1c588d..d2722594f1652 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.chromecast/src/main/feature/feature.xml @@ -1,13 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.chromecast-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-chromecast" description="Chromecast Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-mdns</feature> <feature dependency="true">openhab.tp-jackson</feature> - <bundle dependency="true">mvn:com.google.protobuf/protobuf-java/2.6.0</bundle> - <bundle dependency="true">mvn:su.litvak.chromecast/api-v2/0.11.1</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.chromecast/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastAudioSink.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastAudioSink.java index cc415a8c8747a..cad428ccc4edf 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastAudioSink.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,7 @@ import org.eclipse.smarthome.core.audio.FixedLengthAudioStream; import org.eclipse.smarthome.core.audio.URLAudioStream; import org.eclipse.smarthome.core.audio.UnsupportedAudioFormatException; +import org.eclipse.smarthome.core.library.types.OnOffType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,30 +42,37 @@ public ChromecastAudioSink(ChromecastCommander commander, AudioHTTPServer audioH } public void process(AudioStream audioStream) throws UnsupportedAudioFormatException { - String url; - if (audioStream instanceof URLAudioStream) { - // it is an external URL, the speaker can access it itself and play it. - URLAudioStream urlAudioStream = (URLAudioStream) audioStream; - url = urlAudioStream.getURL(); + if (audioStream == null) { + // in case the audioStream is null, this should be interpreted as a request to end any currently playing + // stream. + logger.trace("Stop currently playing stream."); + commander.handleStop(OnOffType.ON); } else { - if (callbackUrl != null) { - // we serve it on our own HTTP server - String relativeUrl; - if (audioStream instanceof FixedLengthAudioStream) { - relativeUrl = audioHTTPServer.serve((FixedLengthAudioStream) audioStream, 10); + String url; + if (audioStream instanceof URLAudioStream) { + // it is an external URL, the speaker can access it itself and play it. + URLAudioStream urlAudioStream = (URLAudioStream) audioStream; + url = urlAudioStream.getURL(); + } else { + if (callbackUrl != null) { + // we serve it on our own HTTP server + String relativeUrl; + if (audioStream instanceof FixedLengthAudioStream) { + relativeUrl = audioHTTPServer.serve((FixedLengthAudioStream) audioStream, 10); + } else { + relativeUrl = audioHTTPServer.serve(audioStream); + } + url = callbackUrl + relativeUrl; } else { - relativeUrl = audioHTTPServer.serve(audioStream); + logger.warn("We do not have any callback url, so Chromecast cannot play the audio stream!"); + return; } - url = callbackUrl + relativeUrl; - } else { - logger.warn("We do not have any callback url, so Chromecast cannot play the audio stream!"); - return; } - } - String mimeType = Objects.equals(audioStream.getFormat().getCodec(), AudioFormat.CODEC_MP3) ? "audio/mpeg" - : "audio/wav"; + String mimeType = Objects.equals(audioStream.getFormat().getCodec(), AudioFormat.CODEC_MP3) ? "audio/mpeg" + : "audio/wav"; - commander.playMedia("Notification", url, mimeType); + commander.playMedia("Notification", url, mimeType); + } } } diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastBindingConstants.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastBindingConstants.java index 4adf6a0fd549e..82e3d15c3ab10 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastBindingConstants.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastCommander.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastCommander.java index 7b7c6737fb6f5..23c3584a24be3 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastCommander.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastCommander.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -172,7 +172,7 @@ private void handleControl(final Command command) { } } - private void handleStop(final Command command) { + public void handleStop(final Command command) { if (command == OnOffType.ON) { try { chromeCast.stopApp(); @@ -255,8 +255,8 @@ private void stopMediaPlayerApp() { chromeCast.stopApp(); logger.debug("Media player app stopped"); } - } catch (final Exception e) { - logger.debug("Failed stopping media player app: {}", e); + } catch (final IOException e) { + logger.debug("Failed stopping media player app", e); } } } diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastEventReceiver.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastEventReceiver.java index 6f5270a604925..85c74702bda2b 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastEventReceiver.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastEventReceiver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastScheduler.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastScheduler.java index d0f440a43666e..eb071b113d082 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastScheduler.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastScheduler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastStatusUpdater.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastStatusUpdater.java index 879f5172db92a..cc48007d832f4 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastStatusUpdater.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/ChromecastStatusUpdater.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -257,7 +257,8 @@ private void updateImage(Map<String, Object> metadata) { } if (callback.isLinked(CHANNEL_IMAGE)) { - callback.updateState(CHANNEL_IMAGE, imageSrc == null ? UNDEF : HttpUtil.downloadImage(imageSrc)); + State image = imageSrc == null ? UNDEF : HttpUtil.downloadImage(imageSrc); + callback.updateState(CHANNEL_IMAGE, image == null ? UNDEF : image); } } diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/discovery/ChromecastDiscoveryParticipant.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/discovery/ChromecastDiscoveryParticipant.java index d77bb4e687bd9..1d9c161db2b36 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/discovery/ChromecastDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/discovery/ChromecastDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/factory/ChromecastHandlerFactory.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/factory/ChromecastHandlerFactory.java index 3073daf74e216..0fd92389800a1 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/factory/ChromecastHandlerFactory.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/factory/ChromecastHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/handler/ChromecastHandler.java b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/handler/ChromecastHandler.java index 79c247b72d8f4..74bdfd691eec4 100644 --- a/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/handler/ChromecastHandler.java +++ b/bundles/org.openhab.binding.chromecast/src/main/java/org/openhab/binding/chromecast/internal/handler/ChromecastHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/NOTICE b/bundles/org.openhab.binding.cm11a/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.cm11a/NOTICE +++ b/bundles/org.openhab.binding.cm11a/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.cm11a/README.md b/bundles/org.openhab.binding.cm11a/README.md index 0e911ad3e65d3..298836421e1ab 100644 --- a/bundles/org.openhab.binding.cm11a/README.md +++ b/bundles/org.openhab.binding.cm11a/README.md @@ -89,6 +89,6 @@ DimmerA2 "Porch lights" <slider> (someGroup) { channel="cm11a:dimmer:MyCm11a ## References -1. [CM11A (X10) Protocol Document](http://wanderingsamurai.net/electronics/cm11a-x10-protocol-document) -2. [Heyu - control software for the cm11a](http://www.heyu.org/) +1. [CM11A (X10) Protocol Document](https://wanderingsamurai.net/electronics/cm11a-x10-protocol-document) +2. [Heyu - control software for the cm11a](https://www.heyu.org/) 3. cm11a Controllers are available for purchase from several sites on the internet diff --git a/bundles/org.openhab.binding.cm11a/pom.xml b/bundles/org.openhab.binding.cm11a/pom.xml index 84a927a41ba50..235a1d376d9ec 100644 --- a/bundles/org.openhab.binding.cm11a/pom.xml +++ b/bundles/org.openhab.binding.cm11a/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.cm11a</artifactId> diff --git a/bundles/org.openhab.binding.cm11a/src/main/feature/feature.xml b/bundles/org.openhab.binding.cm11a/src/main/feature/feature.xml index 45545e930829a..18a0f4dcce5ad 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.cm11a/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.cm11a-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-cm11a" description="cm11a Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/CM11ABindingConstants.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/CM11ABindingConstants.java index 68b24d50785a9..80a5a72e87108 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/CM11ABindingConstants.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/CM11ABindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/Cm11aHandlerFactory.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/Cm11aHandlerFactory.java index 89020bcc914dc..ceba2e9f4adc7 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/Cm11aHandlerFactory.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/Cm11aHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/InvalidAddressException.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/InvalidAddressException.java index 28ac8ae035f0f..1232884e13cce 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/InvalidAddressException.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/InvalidAddressException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java index 17fb9bcbcbc64..9560b33f3c585 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10Interface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10ReceivedData.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10ReceivedData.java index eec173c4ece0c..d3e271cc22ced 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10ReceivedData.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/X10ReceivedData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/config/Cm11aConfig.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/config/Cm11aConfig.java index 3b35ceea17999..d7dacf5e2751c 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/config/Cm11aConfig.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/config/Cm11aConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aAbstractHandler.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aAbstractHandler.java index dac86358c43a0..32089eb176e97 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aAbstractHandler.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aAbstractHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aApplianceHandler.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aApplianceHandler.java index 174696a7d0555..c85cd19f54e45 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aApplianceHandler.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aApplianceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aBridgeHandler.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aBridgeHandler.java index 21124a4299218..1ba1242651063 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aBridgeHandler.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aLampHandler.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aLampHandler.java index 66de2c1cea7c8..d168f1bc8bd1f 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aLampHandler.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/Cm11aLampHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/ReceivedDataListener.java b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/ReceivedDataListener.java index dcfb5f789bf43..e09e79e591a2e 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/ReceivedDataListener.java +++ b/bundles/org.openhab.binding.cm11a/src/main/java/org/openhab/binding/cm11a/internal/handler/ReceivedDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.cm11a/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.cm11a/src/main/resources/ESH-INF/thing/thing-types.xml index 3e1754f83fbb8..99a27a40b31ee 100644 --- a/bundles/org.openhab.binding.cm11a/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.cm11a/src/main/resources/ESH-INF/thing/thing-types.xml @@ -6,17 +6,17 @@ <!-- Bridge which is the cm11a device --> <bridge-type id="cm11a"> - <label>CM11a controller for X10 devices</label> + <label>CM11a Controller for X10 Devices</label> <description>CM11 is a device that allows control of X10 devices for a computer. </description> <config-description> <parameter name="serialPort" type="text" required="true" > - <label>Serial port</label> + <label>Serial Port</label> <context>serial-port</context> <description>Serial port used to communicate with the CM11a</description> </parameter> <parameter name="refresh" type="integer" min="1"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> <default>60</default> </parameter> @@ -38,7 +38,7 @@ <config-description> <parameter name="houseUnitCode" type="text" required="true"> - <label>X10 House and Unit code</label> + <label>X10 House and Unit Code</label> <description>Address of dimmer in the X10 system</description> </parameter> </config-description> @@ -59,7 +59,7 @@ <config-description> <parameter name="houseUnitCode" type="text" required="true"> - <label>X10 House and Unit code</label> + <label>X10 House and Unit Code</label> <description>Address of switch in the X10 system</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.coolmasternet/NOTICE b/bundles/org.openhab.binding.coolmasternet/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.coolmasternet/NOTICE +++ b/bundles/org.openhab.binding.coolmasternet/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.coolmasternet/pom.xml b/bundles/org.openhab.binding.coolmasternet/pom.xml index d70eb1db7e37c..2d7be14641163 100644 --- a/bundles/org.openhab.binding.coolmasternet/pom.xml +++ b/bundles/org.openhab.binding.coolmasternet/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.coolmasternet</artifactId> diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/feature/feature.xml b/bundles/org.openhab.binding.coolmasternet/src/main/feature/feature.xml index f92aeb6b4b5ca..419f735e4e4ab 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.coolmasternet/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.coolmasternet-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-coolmasternet" description="CoolMasterNet Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/ControllerHandler.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/ControllerHandler.java index 703fbe03dfb85..f92c4239353b0 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/ControllerHandler.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/ControllerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetBindingConstants.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetBindingConstants.java index 382d0971d8aa6..857fa0aa0b4ea 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetBindingConstants.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetHandlerFactory.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetHandlerFactory.java index f5f5faeb802c2..2fa4ae89dffde 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetHandlerFactory.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/CoolMasterNetHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/ControllerConfiguration.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/ControllerConfiguration.java index c99ec54b13013..6f559dd232325 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/ControllerConfiguration.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/ControllerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/HVACConfiguration.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/HVACConfiguration.java index 7e7013ae5b83f..5c46a50418b8f 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/HVACConfiguration.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/config/HVACConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/handler/HVACHandler.java b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/handler/HVACHandler.java index 0af4a9fe34d35..0aa4b8b279f30 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/handler/HVACHandler.java +++ b/bundles/org.openhab.binding.coolmasternet/src/main/java/org/openhab/binding/coolmasternet/internal/handler/HVACHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.coolmasternet/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.coolmasternet/src/main/resources/ESH-INF/thing/thing-types.xml index 09cb953bb4157..3ac019c18fb18 100644 --- a/bundles/org.openhab.binding.coolmasternet/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.coolmasternet/src/main/resources/ESH-INF/thing/thing-types.xml @@ -24,7 +24,7 @@ </parameter> <parameter name="refresh" type="integer"> - <label>Refresh frequency</label> + <label>Refresh Frequency</label> <description>Frequency to poll the controller for updates, in seconds. Defaults to every 5 seconds.</description> <default>5</default> <required>false</required> diff --git a/bundles/org.openhab.binding.daikin/NOTICE b/bundles/org.openhab.binding.daikin/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.daikin/NOTICE +++ b/bundles/org.openhab.binding.daikin/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.daikin/README.md b/bundles/org.openhab.binding.daikin/README.md index 1bd8508117be7..e95b4cbde4271 100644 --- a/bundles/org.openhab.binding.daikin/README.md +++ b/bundles/org.openhab.binding.daikin/README.md @@ -1,14 +1,17 @@ # Daikin Binding -The Daikin binding allows you to control your Daikin air conditioning units with openHAB. In order to do so, your Daikin air conditioning unit must have a BRP072A42 or BRP15B61 WiFi adapter installed. +The Daikin binding allows you to control your Daikin air conditioning units with openHAB. +In order to do so, your Daikin air conditioning unit must have a BRP072A42 or BRP15B61 WiFi adapter installed. ## Supported Things -Daikin air conditioning units with a BRP072A42 or BRP15B61 installed. This may work with the older KRP series of wired adapters, but has not been tested with them. +Daikin air conditioning units with a BRP072A42 or BRP15B61 installed. +This may work with the older KRP series of wired adapters, but has not been tested with them. ## Discovery -This addon will broadcast messages on your local network looking for Daikin air conditioning units and adding them to the queue of new items discovered. You can also manually add a new item if you know the IP address. +This add-on will broadcast messages on your local network looking for Daikin air conditioning units and adding them to the queue of new items discovered. +You can also manually add a new item if you know the IP address. ## Thing Configuration @@ -88,7 +91,7 @@ Selection item=DaikinACUnit_Mode mappings=["AUTO"="Auto", "DEHUMIDIFIER"="Dehumi Selection item=DaikinACUnit_Fan mappings=["AUTO"="Auto", "SILENCE"="Silence", "LEVEL_1"="Level 1", "LEVEL_2"="Level 2", "LEVEL_3"="Level 3", "LEVEL_4"="Level 4", "LEVEL_5"="Level 5"] visibility=[DaikinACUnit_Power==ON] Text item=DaikinACUnit_IndoorTemperature Text item=DaikinACUnit_OutdoorTemperature -# Additional items for BRP1B61 +# Additional items for BRP15B61 Switch item=DaikinACUnit_Zone1 visibility=[DaikinACUnit_Power==ON] Switch item=DaikinACUnit_Zone2 visibility=[DaikinACUnit_Power==ON] Switch item=DaikinACUnit_Zone3 visibility=[DaikinACUnit_Power==ON] diff --git a/bundles/org.openhab.binding.daikin/pom.xml b/bundles/org.openhab.binding.daikin/pom.xml index 3e6ef6b908e49..a917419470ccc 100644 --- a/bundles/org.openhab.binding.daikin/pom.xml +++ b/bundles/org.openhab.binding.daikin/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.daikin</artifactId> diff --git a/bundles/org.openhab.binding.daikin/src/main/feature/feature.xml b/bundles/org.openhab.binding.daikin/src/main/feature/feature.xml index 26cb87e648c4d..0406457d131c1 100644 --- a/bundles/org.openhab.binding.daikin/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.daikin/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.daikin-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-daikin" description="Daikin Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinBindingConstants.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinBindingConstants.java index db66c28027d7d..278b5297d6f6b 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinBindingConstants.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinCommunicationException.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinCommunicationException.java index ebae7cda0deec..eff77e990bf5a 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinCommunicationException.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinHandlerFactory.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinHandlerFactory.java index d3233fae08de8..c0ddb5a1a77ee 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinHandlerFactory.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinWebTargets.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinWebTargets.java index 5e7194c9dc5ca..6a776d728c222 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinWebTargets.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/DaikinWebTargets.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/ControlInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/ControlInfo.java index ac30c22a7c8f5..3f2a1cce57ebe 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/ControlInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/ControlInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/Enums.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/Enums.java index c363e18b0f8c4..fd356b0400aee 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/Enums.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/Enums.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/SensorInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/SensorInfo.java index 459222d6573bf..d4124016565ff 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/SensorInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/SensorInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseBasicInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseBasicInfo.java index 4e30cade0f706..603bbd0b22f47 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseBasicInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseBasicInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseControlInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseControlInfo.java index 4311c629acc52..9560ffcf197b0 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseControlInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseControlInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java index ea80a9bb27227..dc196ad6f8a66 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseEnums.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseModelInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseModelInfo.java index 504000b15bbd2..2f8fddc37c907 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseModelInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseModelInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseZoneInfo.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseZoneInfo.java index 28ecd880375c5..d3114efc7cf69 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseZoneInfo.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/api/airbase/AirbaseZoneInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/config/DaikinConfiguration.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/config/DaikinConfiguration.java index ccb1ba3c1e7c1..ccdbc33a759bb 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/config/DaikinConfiguration.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/config/DaikinConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/discovery/DaikinACUnitDiscoveryService.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/discovery/DaikinACUnitDiscoveryService.java index a31e9cb50b490..2076bbdc6ebc8 100644 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/discovery/DaikinACUnitDiscoveryService.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/discovery/DaikinACUnitDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java old mode 100644 new mode 100755 index ee6eb93d0b06b..7ad1938a80124 --- a/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java +++ b/bundles/org.openhab.binding.daikin/src/main/java/org/openhab/binding/daikin/internal/handler/DaikinAcUnitHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -136,7 +136,7 @@ private void handleCommandInternal(ChannelUID channelUID, Command command) throw return; } } - logger.warn("Received command of wrong type for thing '{}' on channel {}", thing.getUID().getAsString(), + logger.debug("Received command ({}) of wrong type for thing '{}' on channel {}", command, thing.getUID().getAsString(), channelUID.getId()); } diff --git a/bundles/org.openhab.binding.daikin/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.daikin/src/main/resources/ESH-INF/thing/thing-types.xml index 07666ceeaf24e..5e7f1d4b85c5a 100644 --- a/bundles/org.openhab.binding.daikin/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.daikin/src/main/resources/ESH-INF/thing/thing-types.xml @@ -98,7 +98,7 @@ </state> </channel-type> - <channel-type id="acunit-fan" advanced="true"> + <channel-type id="acunit-fan"> <item-type>String</item-type> <label>Fan</label> <description>Current fan speed setting of the AC unit</description> @@ -115,7 +115,7 @@ </state> </channel-type> - <channel-type id="acunit-fandir" advanced="true"> + <channel-type id="acunit-fandir"> <item-type>String</item-type> <label>Fan Swing</label> <description>Current fan swing setting of the AC unit</description> diff --git a/bundles/org.openhab.binding.darksky/NOTICE b/bundles/org.openhab.binding.darksky/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.darksky/NOTICE +++ b/bundles/org.openhab.binding.darksky/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.darksky/README.md b/bundles/org.openhab.binding.darksky/README.md index 24543e9401dee..b443e1b2e0451 100644 --- a/bundles/org.openhab.binding.darksky/README.md +++ b/bundles/org.openhab.binding.darksky/README.md @@ -29,10 +29,10 @@ Once the system location will be changed, the background discovery updates the c ### Dark Sky Account | Parameter | Description | -|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| apikey | API key to access the Dark Sky API. **Mandatory** | -| refreshInterval | Specifies the refresh interval (in minutes). Optional, the default value is 60, the minimum value is 1. Note: when using a free API key (1000 calls/day), do not use an interval less than 2. | -| language | Language to be used by the Dark Sky API. Optional, valid values are: `ar`, `az`, `be`, `bg`, `bs`, `ca`, `cs`, `da`, `de`, `el`, `en`, `es`, `et`, `fi`, `fr`, `he`, `hr`, `hu`, `id`, `is`, `it`, `ja`, `ka`, `ko`, `kw`, `lv`, `nb`, `nl`, `no`, `pl`, `pt`, `ro`, `ru`, `sk`, `sl`, `sr`, `sv`, `tet`, `tr`, `uk`, `x-pig-latin`, `zh`, `zh-tw`. | +| apikey | API key to access the Dark Sky API. **Mandatory** | +|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| refreshInterval | Specifies the refresh interval (in minutes). Optional, the default value is 60, the minimum value is 1. Note: when using a free API key (1000 calls/day), do not use an interval less than 2. | +| language | Language to be used by the Dark Sky API. Optional, valid values are: `ar`, `az`, `be`, `bg`, `bn`, `bs`, `ca`, `cs`, `da`, `de`, `el`, `en`, `eo`, `es`, `et`, `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `is`, `it`, `ja`, `ka`, `ko`, `kn`, `kw`, `lv`, `mr`, `nb`, `nl`, `no`, `pa`, `pl`, `pt`, `ro`, `ru`, `sk`, `sl`, `sr`, `sv`, `ta`, `te`, `tet`, `tr`, `uk`, `x-pig-latin`, `zh`, `zh-tw`. | ### Current Weather And Forecast @@ -49,76 +49,80 @@ Once one of the parameters `forecastHours`, `forecastDays` or `numberOfAlerts` w ### Current Weather -| Channel Group ID | Channel ID | Item Type | Description | -|------------------|--------------------|----------------------|-------------------------------------------------------------------------| -| current | time-stamp | DateTime | Time of data observation. | -| current | condition | String | Current weather condition. | -| current | icon | Image | Icon representing the current weather condition. | -| current | icon-id | String | Id of the icon representing the current weather condition. **Advanced** | -| current | temperature | Number:Temperature | Current temperature. | -| current | pressure | Number:Pressure | Current barometric pressure. | -| current | humidity | Number:Dimensionless | Current atmospheric humidity. | -| current | wind-speed | Number:Speed | Current wind speed. | -| current | wind-direction | Number:Angle | Current wind direction. | -| current | gust-speed | Number:Speed | Current gust speed. **Advanced** | -| current | cloudiness | Number:Dimensionless | Current cloudiness. | -| current | visibility | Number:Length | Current visibility. | -| current | rain | Number:Speed | Current rain intensity. | -| current | snow | Number:Speed | Current snow intensity. | -| current | precip-intensity | Number:Speed | Current precipitation intensity. | -| current | precip-probability | Number:Dimensionless | Current precipitation probability. | -| current | precip-type | String | Current precipitation type (Rain, Snow or Sleet). | -| current | uvindex | Number | Current UV index. | -| current | ozone | Number:ArealDensity | Current ozone. | +| Channel Group ID | Channel ID | Item Type | Description | +|------------------|----------------------|----------------------|-------------------------------------------------------------------------| +| current | time-stamp | DateTime | Time of data observation. | +| current | condition | String | Current weather condition. | +| current | icon | Image | Icon representing the current weather condition. | +| current | icon-id | String | Id of the icon representing the current weather condition. **Advanced** | +| current | temperature | Number:Temperature | Current temperature. | +| current | apparent-temperature | Number:Temperature | Current apparent temperature. | +| current | pressure | Number:Pressure | Current barometric pressure. | +| current | humidity | Number:Dimensionless | Current atmospheric humidity. | +| current | wind-speed | Number:Speed | Current wind speed. | +| current | wind-direction | Number:Angle | Current wind direction. | +| current | gust-speed | Number:Speed | Current gust speed. **Advanced** | +| current | cloudiness | Number:Dimensionless | Current cloudiness. | +| current | visibility | Number:Length | Current visibility. | +| current | rain | Number:Speed | Current rain intensity. | +| current | snow | Number:Speed | Current snow intensity. | +| current | precip-intensity | Number:Speed | Current precipitation intensity. | +| current | precip-probability | Number:Dimensionless | Current precipitation probability. | +| current | precip-type | String | Current precipitation type (Rain, Snow or Sleet). | +| current | uvindex | Number | Current UV index. | +| current | ozone | Number:ArealDensity | Current ozone. | ### Hourly Forecast -| Channel Group ID | Channel ID | Item Type | Description | -|-------------------------------------------------------|--------------------|----------------------|------------------------------------------------------| -| forecastHours01, forecastHours02, ... forecastHours48 | time-stamp | DateTime | Time of data forecasted. | -| forecastHours01, forecastHours02, ... forecastHours48 | condition | String | Forecast weather condition. | -| forecastHours01, forecastHours02, ... forecastHours48 | icon | Image | Icon representing the forecasted weather condition. | -| forecastHours01, forecastHours02, ... forecastHours48 | icon-id | String | Id of the forecasted weather condition. **Advanced** | -| forecastHours01, forecastHours02, ... forecastHours48 | temperature | Number:Temperature | Forecasted temperature. | -| forecastHours01, forecastHours02, ... forecastHours48 | pressure | Number:Pressure | Forecasted barometric pressure. | -| forecastHours01, forecastHours02, ... forecastHours48 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | -| forecastHours01, forecastHours02, ... forecastHours48 | wind-speed | Number:Speed | Forecasted wind speed. | -| forecastHours01, forecastHours02, ... forecastHours48 | wind-direction | Number:Angle | Forecasted wind direction. | -| forecastHours01, forecastHours02, ... forecastHours48 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | -| forecastHours01, forecastHours02, ... forecastHours48 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | -| forecastHours01, forecastHours02, ... forecastHours48 | visibility | Number:Length | Forecasted visibility. | -| forecastHours01, forecastHours02, ... forecastHours48 | rain | Number:Speed | Forecasted rain intensity. | -| forecastHours01, forecastHours02, ... forecastHours48 | snow | Number:Speed | Forecasted snow intensity. | -| forecastHours01, forecastHours02, ... forecastHours48 | precip-intensity | Number:Speed | Forecasted precipitation intensity. | -| forecastHours01, forecastHours02, ... forecastHours48 | precip-probability | Number:Dimensionless | Forecasted precipitation probability. | -| forecastHours01, forecastHours02, ... forecastHours48 | precip-type | String | Forecasted precipitation type (Rain, Snow or Sleet). | -| forecastHours01, forecastHours02, ... forecastHours48 | uvindex | Number | Forecasted UV index. | -| forecastHours01, forecastHours02, ... forecastHours48 | ozone | Number:ArealDensity | Forecasted ozone. | +| Channel Group ID | Channel ID | Item Type | Description | +|-------------------------------------------------------|----------------------|----------------------|------------------------------------------------------| +| forecastHours01, forecastHours02, ... forecastHours48 | time-stamp | DateTime | Time of data forecasted. | +| forecastHours01, forecastHours02, ... forecastHours48 | condition | String | Forecast weather condition. | +| forecastHours01, forecastHours02, ... forecastHours48 | icon | Image | Icon representing the forecasted weather condition. | +| forecastHours01, forecastHours02, ... forecastHours48 | icon-id | String | Id of the forecasted weather condition. **Advanced** | +| forecastHours01, forecastHours02, ... forecastHours48 | temperature | Number:Temperature | Forecasted temperature. | +| forecastHours01, forecastHours02, ... forecastHours48 | apparent-temperature | Number:Temperature | Forecasted apparent temperature. | +| forecastHours01, forecastHours02, ... forecastHours48 | pressure | Number:Pressure | Forecasted barometric pressure. | +| forecastHours01, forecastHours02, ... forecastHours48 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | +| forecastHours01, forecastHours02, ... forecastHours48 | wind-speed | Number:Speed | Forecasted wind speed. | +| forecastHours01, forecastHours02, ... forecastHours48 | wind-direction | Number:Angle | Forecasted wind direction. | +| forecastHours01, forecastHours02, ... forecastHours48 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | +| forecastHours01, forecastHours02, ... forecastHours48 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | +| forecastHours01, forecastHours02, ... forecastHours48 | visibility | Number:Length | Forecasted visibility. | +| forecastHours01, forecastHours02, ... forecastHours48 | rain | Number:Speed | Forecasted rain intensity. | +| forecastHours01, forecastHours02, ... forecastHours48 | snow | Number:Speed | Forecasted snow intensity. | +| forecastHours01, forecastHours02, ... forecastHours48 | precip-intensity | Number:Speed | Forecasted precipitation intensity. | +| forecastHours01, forecastHours02, ... forecastHours48 | precip-probability | Number:Dimensionless | Forecasted precipitation probability. | +| forecastHours01, forecastHours02, ... forecastHours48 | precip-type | String | Forecasted precipitation type (Rain, Snow or Sleet). | +| forecastHours01, forecastHours02, ... forecastHours48 | uvindex | Number | Forecasted UV index. | +| forecastHours01, forecastHours02, ... forecastHours48 | ozone | Number:ArealDensity | Forecasted ozone. | ### Daily Forecast -| Channel Group ID | Channel ID | Item Type | Description | -|-----------------------------------------------------------------|--------------------|----------------------|------------------------------------------------------| -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | time-stamp | DateTime | Time of data forecasted. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | condition | String | Forecast weather condition. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | icon | Image | Icon representing the forecasted weather condition. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | icon-id | String | Id of the forecasted weather condition. **Advanced** | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | min-temperature | Number:Temperature | Minimum forecasted temperature of a day. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | max-temperature | Number:Temperature | Maximum forecasted temperature of a day. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | pressure | Number:Pressure | Forecasted barometric pressure. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | wind-speed | Number:Speed | Forecasted wind speed. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | wind-direction | Number:Angle | Forecasted wind direction. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | visibility | Number:Length | Forecasted visibility. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | rain | Number:Speed | Forecasted rain intensity. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | snow | Number:Speed | Forecasted snow intensity. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-intensity | Number:Speed | Forecasted precipitation intensity. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-probability | Number:Dimensionless | Forecasted precipitation probability. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-type | String | Forecasted precipitation type (Rain, Snow or Sleet). | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | uvindex | Number | Forecasted UV index. | -| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | ozone | Number:ArealDensity | Forecasted ozone. | +| Channel Group ID | Channel ID | Item Type | Description | +|-----------------------------------------------------------------|--------------------------|----------------------|------------------------------------------------------| +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | time-stamp | DateTime | Time of data forecasted. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | condition | String | Forecast weather condition. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | icon | Image | Icon representing the forecasted weather condition. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | icon-id | String | Id of the forecasted weather condition. **Advanced** | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | min-temperature | Number:Temperature | Minimum forecasted temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | max-temperature | Number:Temperature | Maximum forecasted temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | min-apparent-temperature | Number:Temperature | Minimum forecasted apparent temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | max-apparent-temperature | Number:Temperature | Maximum forecasted apparent temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | pressure | Number:Pressure | Forecasted barometric pressure. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | wind-speed | Number:Speed | Forecasted wind speed. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | wind-direction | Number:Angle | Forecasted wind direction. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | visibility | Number:Length | Forecasted visibility. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | rain | Number:Speed | Forecasted rain intensity. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | snow | Number:Speed | Forecasted snow intensity. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-intensity | Number:Speed | Forecasted precipitation intensity. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-probability | Number:Dimensionless | Forecasted precipitation probability. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | precip-type | String | Forecasted precipitation type (Rain, Snow or Sleet). | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | uvindex | Number | Forecasted UV index. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay7 | ozone | Number:ArealDensity | Forecasted ozone. | ### Severe Weather Alerts @@ -184,6 +188,7 @@ DateTime localLastMeasurement "Timestamp of last measurement [%1$tY-%1$tm-%1$tdT String localCurrentCondition "Current condition [%s]" <sun_clouds> { channel="darksky:weather-and-forecast:api:local:current#condition" } Image localCurrentConditionIcon "Icon" { channel="darksky:weather-and-forecast:api:local:current#icon" } Number:Temperature localCurrentTemperature "Current temperature [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:current#temperature" } +Number:Temperature localCurrentApparentTemperature "Current apparent temperature [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:current#apparent-temperature" } Number:Pressure localCurrentPressure "Current barometric pressure [%.1f %unit%]" <pressure> { channel="darksky:weather-and-forecast:api:local:current#pressure" } Number:Dimensionless localCurrentHumidity "Current atmospheric humidity [%d %unit%]" <humidity> { channel="darksky:weather-and-forecast:api:local:current#humidity" } Number:Speed localCurrentWindSpeed "Current wind speed [%.1f km/h]" <wind> { channel="darksky:weather-and-forecast:api:local:current#wind-speed" } @@ -195,7 +200,7 @@ Number:Speed localCurrentSnowIntensity "Current snow intensity [%.2f mm/h]" <sno Number:Speed localCurrentPrecipitationIntensity "Current precipitation intensity [%.2f mm/h]" <rain> { channel="darksky:weather-and-forecast:api:local:current#precip-intensity" } Number:Dimensionless localCurrentPrecipitationProbability "Current precipitation probability [%d %unit%]" <rain> { channel="darksky:weather-and-forecast:api:local:current#precip-probability" } String localCurrentPrecipitationType "Current precipitation type [%s]" <rain> { channel="darksky:weather-and-forecast:api:local:current#precip-type" } -Number localCurrentUVIndex "Current precipitation probability [%d]" <none> { channel="darksky:weather-and-forecast:api:local:current#uvindex" } +Number localCurrentUVIndex "Current UV index [%d]" <none> { channel="darksky:weather-and-forecast:api:local:current#uvindex" } Number:ArealDensity localCurrentOzone "Current ozone [%.1f %unit%]" <none> { channel="darksky:weather-and-forecast:api:local:current#ozone" } DateTime localSunrise "Sunrise [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <sun> { channel="darksky:weather-and-forecast:api:local:current#sunrise" } DateTime localSunset "Sunset [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <sun> { channel="darksky:weather-and-forecast:api:local:current#sunset" } @@ -205,6 +210,8 @@ String localDailyForecastTodayCondition "Condition for today [%s]" <sun_clouds> Image localDailyForecastTodayConditionIcon "Icon" { channel="darksky:weather-and-forecast:api:local:forecastToday#icon" } Number:Temperature localDailyForecastTodayMinTemperature "Minimum temperature for today [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:forecastToday#min-temperature" } Number:Temperature localDailyForecastTodayMaxTemperature "Maximum temperature for today [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:forecastToday#max-temperature" } +Number:Temperature localDailyForecastTodayMinApparentTemperature "Minimum apparent temperature for today [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:forecastToday#min-apparent-temperature" } +Number:Temperature localDailyForecastTodayMaxApparentTemperature "Maximum apparent temperature for today [%.1f %unit%]" <temperature> { channel="darksky:weather-and-forecast:api:local:forecastToday#max-apparent-temperature" } Number:Pressure localDailyForecastTodayPressure "Barometric pressure for today [%.1f %unit%]" <pressure> { channel="darksky:weather-and-forecast:api:local:forecastToday#pressure" } Number:Dimensionless localDailyForecastTodayHumidity "Atmospheric humidity for today [%d %unit%]" <humidity> { channel="darksky:weather-and-forecast:api:local:forecastToday#humidity" } Number:Speed localDailyForecastTodayWindSpeed "Wind speed for today [%.1f km/h]" <wind> { channel="darksky:weather-and-forecast:api:local:forecastToday#wind-speed" } @@ -264,6 +271,7 @@ sitemap demo label="Dark Sky" { Text item=localCurrentCondition Image item=localCurrentConditionIcon Text item=localCurrentTemperature + Text item=localCurrentApparentTemperature Text item=localCurrentPressure Text item=localCurrentHumidity Text item=localCurrentWindSpeed @@ -286,6 +294,8 @@ sitemap demo label="Dark Sky" { Image item=localDailyForecastTodayConditionIcon Text item=localDailyForecastTodayMinTemperature Text item=localDailyForecastTodayMaxTemperature + Text item=localDailyForecastTodayMinApparentTemperature + Text item=localDailyForecastTodayMaxApparentTemperature Text item=localDailyForecastTodayPressure Text item=localDailyForecastTodayHumidity Text item=localDailyForecastTodayWindSpeed diff --git a/bundles/org.openhab.binding.darksky/pom.xml b/bundles/org.openhab.binding.darksky/pom.xml index ba72c0301a021..d39f7e4cf801d 100644 --- a/bundles/org.openhab.binding.darksky/pom.xml +++ b/bundles/org.openhab.binding.darksky/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.darksky</artifactId> diff --git a/bundles/org.openhab.binding.darksky/src/main/feature/feature.xml b/bundles/org.openhab.binding.darksky/src/main/feature/feature.xml index 5d4f11afdb6d8..665164779eb5c 100644 --- a/bundles/org.openhab.binding.darksky/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.darksky/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.darksky-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-darksky" description="Dark Sky Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/DarkSkyBindingConstants.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/DarkSkyBindingConstants.java index 94d543d7b5c90..59db385752aba 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/DarkSkyBindingConstants.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/DarkSkyBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -62,6 +62,9 @@ public class DarkSkyBindingConstants { public static final String CHANNEL_TEMPERATURE = "temperature"; public static final String CHANNEL_MIN_TEMPERATURE = "min-temperature"; public static final String CHANNEL_MAX_TEMPERATURE = "max-temperature"; + public static final String CHANNEL_APPARENT_TEMPERATURE = "apparent-temperature"; + public static final String CHANNEL_MIN_APPARENT_TEMPERATURE = "min-apparent-temperature"; + public static final String CHANNEL_MAX_APPARENT_TEMPERATURE = "max-apparent-temperature"; public static final String CHANNEL_PRESSURE = "pressure"; public static final String CHANNEL_HUMIDITY = "humidity"; public static final String CHANNEL_WIND_SPEED = "wind-speed"; diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyAPIConfiguration.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyAPIConfiguration.java index bd88fc410e611..6e855d90292a1 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyAPIConfiguration.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyAPIConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,37 +30,12 @@ public class DarkSkyAPIConfiguration { // supported languages (see https://darksky.net/dev/docs#forecast-request) - public static final Set<String> SUPPORTED_LANGUAGES = Collections.unmodifiableSet(Stream - .of("ar", "az", "be", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "he", "hr", - "hu", "id", "is", "it", "ja", "ka", "ko", "kw", "lv", "nb", "nl", "no", "pl", "pt", "ro", "ru", - "sk", "sl", "sr", "sv", "tet", "tr", "uk", "x-pig-latin", "zh", "zh-tw") - .collect(Collectors.toSet())); - - private @Nullable String apikey; - private int refreshInterval; - private @Nullable String language; - - public @Nullable String getApikey() { - return apikey; - } - - public void setApikey(String apikey) { - this.apikey = apikey; - } - - public int getRefreshInterval() { - return refreshInterval; - } - - public void setRefreshInterval(int refreshInterval) { - this.refreshInterval = refreshInterval; - } - - public @Nullable String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } + public static final Set<String> SUPPORTED_LANGUAGES = Collections.unmodifiableSet(Stream.of("ar", "az", "be", "bg", + "bn", "bs", "ca", "cs", "da", "de", "el", "en", "eo", "es", "et", "fi", "fr", "he", "hi", "hr", "hu", "id", + "is", "it", "ja", "ka", "kn", "ko", "kw", "lv", "mr", "nb", "nl", "no", "pa", "pl", "pt", "ro", "ru", "sk", + "sl", "sr", "sv", "ta", "te", "tet", "tr", "uk", "x-pig-latin", "zh", "zh-tw").collect(Collectors.toSet())); + + public @Nullable String apikey; + public int refreshInterval = 60; + public @Nullable String language; } diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyChannelConfiguration.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyChannelConfiguration.java index dfe0bba496989..3a71c4e95c336 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyChannelConfiguration.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyWeatherAndForecastConfiguration.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyWeatherAndForecastConfiguration.java index 162a9a6b38372..dbe24e51e94b8 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyWeatherAndForecastConfiguration.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/config/DarkSkyWeatherAndForecastConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyCommunicationException.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyCommunicationException.java index 8a7aac0689964..206d23a558310 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyCommunicationException.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConfigurationException.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConfigurationException.java index f2906be1981e4..3ffb847051a78 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConfigurationException.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConnection.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConnection.java index 9566fafca3227..029b08010fa77 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConnection.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/connection/DarkSkyConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -59,7 +59,6 @@ public class DarkSkyConnection { private static final String PNG_CONTENT_TYPE = "image/png"; private static final String PARAM_EXCLUDE = "exclude"; - private static final String PARAM_EXTEND = "extend"; private static final String PARAM_UNITS = "units"; private static final String PARAM_LANG = "lang"; @@ -81,7 +80,7 @@ public DarkSkyConnection(DarkSkyAPIHandler handler, HttpClient httpClient) { this.httpClient = httpClient; DarkSkyAPIConfiguration config = handler.getDarkSkyAPIConfig(); - cache = new ExpiringCacheMap<>(TimeUnit.MINUTES.toMillis(config.getRefreshInterval())); + cache = new ExpiringCacheMap<>(TimeUnit.MINUTES.toMillis(config.refreshInterval)); } /** @@ -101,7 +100,7 @@ public DarkSkyConnection(DarkSkyAPIHandler handler, HttpClient httpClient) { DarkSkyAPIConfiguration config = handler.getDarkSkyAPIConfig(); - String url = String.format(Locale.ROOT, WEATHER_URL, StringUtils.trimToEmpty(config.getApikey()), + String url = String.format(Locale.ROOT, WEATHER_URL, StringUtils.trimToEmpty(config.apikey), location.getLatitude().doubleValue(), location.getLongitude().doubleValue()); return gson.fromJson(getResponseFromCache(buildURL(url, getRequestParams(config))), @@ -147,7 +146,7 @@ private Map<String, String> getRequestParams(DarkSkyAPIConfiguration config) { params.put(PARAM_UNITS, "si"); - String language = StringUtils.trimToEmpty(config.getLanguage()); + String language = StringUtils.trimToEmpty(config.language); if (!language.isEmpty()) { params.put(PARAM_LANG, language.toLowerCase()); } diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/discovery/DarkSkyDiscoveryService.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/discovery/DarkSkyDiscoveryService.java index 29055e8f66275..1532ba62fb3bb 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/discovery/DarkSkyDiscoveryService.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/discovery/DarkSkyDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/factory/DarkSkyHandlerFactory.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/factory/DarkSkyHandlerFactory.java index 54b516633214a..82ba97dd0563e 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/factory/DarkSkyHandlerFactory.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/factory/DarkSkyHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyAPIHandler.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyAPIHandler.java index 3d469605a11a9..2606364388908 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyAPIHandler.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyAPIHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -75,18 +75,18 @@ public void initialize() { config = getConfigAs(DarkSkyAPIConfiguration.class); boolean configValid = true; - if (StringUtils.trimToNull(config.getApikey()) == null) { + if (StringUtils.trimToNull(config.apikey) == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-missing-apikey"); configValid = false; } - int refreshInterval = config.getRefreshInterval(); - if (refreshInterval < 10) { + int refreshInterval = config.refreshInterval; + if (refreshInterval < 1) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.conf-error-not-supported-refreshInterval"); configValid = false; } - String language = config.getLanguage(); + String language = config.language; if (language != null) { language = StringUtils.trimToEmpty(language); if (!DarkSkyAPIConfiguration.SUPPORTED_LANGUAGES.contains(language.toLowerCase())) { @@ -109,7 +109,8 @@ public void initialize() { updateStatus(ThingStatus.UNKNOWN); - if (refreshJob == null || refreshJob.isCancelled()) { + ScheduledFuture<?> localRefreshJob = refreshJob; + if (localRefreshJob == null || localRefreshJob.isCancelled()) { logger.debug("Start refresh job at interval {} min.", refreshInterval); refreshJob = scheduler.scheduleWithFixedDelay(this::updateThings, INITIAL_DELAY_IN_SECONDS, TimeUnit.MINUTES.toSeconds(refreshInterval), TimeUnit.SECONDS); @@ -120,9 +121,10 @@ public void initialize() { @Override public void dispose() { logger.debug("Dispose Dark Sky API handler '{}'.", getThing().getUID()); - if (refreshJob != null && !refreshJob.isCancelled()) { + ScheduledFuture<?> localRefreshJob = refreshJob; + if (localRefreshJob != null && !localRefreshJob.isCancelled()) { logger.debug("Stop refresh job."); - if (refreshJob.cancel(true)) { + if (localRefreshJob.cancel(true)) { refreshJob = null; } } diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyWeatherAndForecastHandler.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyWeatherAndForecastHandler.java index fd71fe036a600..bcf6d0a89aeeb 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyWeatherAndForecastHandler.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/handler/DarkSkyWeatherAndForecastHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -425,6 +425,9 @@ private void updateCurrentChannel(ChannelUID channelUID) { case CHANNEL_TEMPERATURE: state = getQuantityTypeState(currentData.getTemperature(), CELSIUS); break; + case CHANNEL_APPARENT_TEMPERATURE: + state = getQuantityTypeState(currentData.getApparentTemperature(), CELSIUS); + break; case CHANNEL_PRESSURE: state = getQuantityTypeState(currentData.getPressure(), HECTO(PASCAL)); break; @@ -512,6 +515,9 @@ private void updateHourlyForecastChannel(ChannelUID channelUID, int count) { case CHANNEL_TEMPERATURE: state = getQuantityTypeState(forecastData.getTemperature(), CELSIUS); break; + case CHANNEL_APPARENT_TEMPERATURE: + state = getQuantityTypeState(forecastData.getApparentTemperature(), CELSIUS); + break; case CHANNEL_PRESSURE: state = getQuantityTypeState(forecastData.getPressure(), HECTO(PASCAL)); break; @@ -599,6 +605,12 @@ private void updateDailyForecastChannel(ChannelUID channelUID, int count) { case CHANNEL_MAX_TEMPERATURE: state = getQuantityTypeState(forecastData.getTemperatureMax(), CELSIUS); break; + case CHANNEL_MIN_APPARENT_TEMPERATURE: + state = getQuantityTypeState(forecastData.getApparentTemperatureMin(), CELSIUS); + break; + case CHANNEL_MAX_APPARENT_TEMPERATURE: + state = getQuantityTypeState(forecastData.getApparentTemperatureMax(), CELSIUS); + break; case CHANNEL_PRESSURE: state = getQuantityTypeState(forecastData.getPressure(), HECTO(PASCAL)); break; diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyCurrentlyData.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyCurrentlyData.java index f9dce6af96e09..70a163c38ba0b 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyCurrentlyData.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyCurrentlyData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyDailyData.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyDailyData.java index 8d1efc7e2debb..ef858b62ff3b9 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyDailyData.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyDailyData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyHourlyData.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyHourlyData.java index 1efb787a44c48..6279eaf7d80c4 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyHourlyData.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyHourlyData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyJsonWeatherData.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyJsonWeatherData.java index 5336dd08fccac..adc2d9d0bbfdd 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyJsonWeatherData.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/model/DarkSkyJsonWeatherData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCache.java b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCache.java index d964bdc15599d..591849dc4b9b4 100644 --- a/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCache.java +++ b/bundles/org.openhab.binding.darksky/src/main/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/config/config.xml index da4259bbada04..4d78a0b12d5f9 100644 --- a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/config/config.xml @@ -24,6 +24,7 @@ <option value="az">Azerbaijani</option> <option value="be">Belarusian</option> <option value="bg">Bulgarian</option> + <option value="bn">Bengali</option> <option value="bs">Bosnian</option> <option value="ca">Catalan</option> <option value="cs">Czech</option> @@ -31,11 +32,13 @@ <option value="de">German</option> <option value="el">Greek</option> <option value="en">English</option> + <option value="eo">Esperanto</option> <option value="es">Spanish</option> <option value="et">Estonian</option> <option value="fi">Finnish</option> <option value="fr">French</option> <option value="he">Hebrew</option> + <option value="hi">Hindi</option> <option value="hr">Croatian</option> <option value="hu">Hungarian</option> <option value="id">Indonesian</option> @@ -43,12 +46,15 @@ <option value="it">Italian</option> <option value="ja">Japanese</option> <option value="ka">Georgian</option> + <option value="kn">Kannada</option> <option value="ko">Korean</option> <option value="kw">Cornish</option> <option value="lv">Latvian</option> + <option value="mr">Marathi</option> <option value="nb">Norwegian BokmÃ¥l</option> <option value="nl">Dutch</option> <option value="no">Norwegian BokmÃ¥l (alias for 'nb')</option> + <option value="pa">Punjabi</option> <option value="pl">Polish</option> <option value="pt">Portuguese</option> <option value="ro">Romanian</option> @@ -57,6 +63,8 @@ <option value="sl">Slovenian</option> <option value="sr">Serbian</option> <option value="sv">Swedish</option> + <option value="ta">Tamil</option> + <option value="te">Telugu</option> <option value="tet">Tetum</option> <option value="tr">Turkish</option> <option value="uk">Ukrainian</option> diff --git a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/i18n/darksky_de.properties b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/i18n/darksky_de.properties index 3d993b67559e0..2c81facc175e1 100644 --- a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/i18n/darksky_de.properties +++ b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/i18n/darksky_de.properties @@ -19,6 +19,7 @@ bridge-type.config.darksky.weather-api.language.option.ar = Arabisch bridge-type.config.darksky.weather-api.language.option.az = Aserbaidschaner bridge-type.config.darksky.weather-api.language.option.be = Belarussisch bridge-type.config.darksky.weather-api.language.option.bg = Bulgarisch +bridge-type.config.darksky.weather-api.language.option.bn = Bengali bridge-type.config.darksky.weather-api.language.option.bs = Bosnisch bridge-type.config.darksky.weather-api.language.option.ca = Katalanisch bridge-type.config.darksky.weather-api.language.option.cz = Tschechisch @@ -26,11 +27,13 @@ bridge-type.config.darksky.weather-api.language.option.da = D bridge-type.config.darksky.weather-api.language.option.de = Deutsch bridge-type.config.darksky.weather-api.language.option.el = Griechisch bridge-type.config.darksky.weather-api.language.option.en = Englisch +bridge-type.config.darksky.weather-api.language.option.eo = Esperanto bridge-type.config.darksky.weather-api.language.option.es = Spanisch bridge-type.config.darksky.weather-api.language.option.et = Estnisch bridge-type.config.darksky.weather-api.language.option.fi = Finnisch bridge-type.config.darksky.weather-api.language.option.fr = Französisch bridge-type.config.darksky.weather-api.language.option.he = Hebräisch +bridge-type.config.darksky.weather-api.language.option.hi = Hindi bridge-type.config.darksky.weather-api.language.option.hr = Kroatisch bridge-type.config.darksky.weather-api.language.option.hu = Ungarisch bridge-type.config.darksky.weather-api.language.option.id = Indonesian @@ -38,12 +41,15 @@ bridge-type.config.darksky.weather-api.language.option.is = Isl bridge-type.config.darksky.weather-api.language.option.it = Italienisch bridge-type.config.darksky.weather-api.language.option.ja = Japanisch bridge-type.config.darksky.weather-api.language.option.ka = Georgisch +bridge-type.config.darksky.weather-api.language.option.kn = Kanadisch bridge-type.config.darksky.weather-api.language.option.ko = Koreanisch bridge-type.config.darksky.weather-api.language.option.kw = Kornisch bridge-type.config.darksky.weather-api.language.option.lv = Lettisch +bridge-type.config.darksky.weather-api.language.option.mr = Marathi bridge-type.config.darksky.weather-api.language.option.nb = Norwegischer Bokmål bridge-type.config.darksky.weather-api.language.option.nl = Holländisch bridge-type.config.darksky.weather-api.language.option.no = Norwegischer Bokmål (Alias für 'nb') +bridge-type.config.darksky.weather-api.language.option.pa = Punjabi bridge-type.config.darksky.weather-api.language.option.pl = Polnisch bridge-type.config.darksky.weather-api.language.option.pt = Portugiesisch bridge-type.config.darksky.weather-api.language.option.ro = Rumänisch @@ -51,7 +57,9 @@ bridge-type.config.darksky.weather-api.language.option.ru = Russisch bridge-type.config.darksky.weather-api.language.option.sk = Slowakisch bridge-type.config.darksky.weather-api.language.option.sl = Slowenisch bridge-type.config.darksky.weather-api.language.option.sr = Serbisch -bridge-type.config.darksky.weather-api.language.option.sw = Schwedisch +bridge-type.config.darksky.weather-api.language.option.sv = Schwedisch +bridge-type.config.darksky.weather-api.language.option.ta = Tamil +bridge-type.config.darksky.weather-api.language.option.te = Telugu bridge-type.config.darksky.weather-api.language.option.tet = Tetum bridge-type.config.darksky.weather-api.language.option.tr = Türkisch bridge-type.config.darksky.weather-api.language.option.uk = Ukrainisch @@ -223,6 +231,18 @@ channel-type.darksky.forecasted-min-outdoor-temperature.description = Zeigt die channel-type.darksky.forecasted-max-outdoor-temperature.label = Maximale Temperatur channel-type.darksky.forecasted-max-outdoor-temperature.description = Zeigt die vorhergesagte maximale Außentemperatur an. +channel-type.darksky.apparent-temperature.label = Gefühlte Temperatur +channel-type.darksky.apparent-temperature.description = Zeigt die gefühlte Außentemperatur an. + +channel-type.darksky.forecasted-apparent-temperature.label = Vorhergesagte Gefühlte Temperatur +channel-type.darksky.forecasted-apparent-temperature.description = Zeigt die vorhergesagte gefühlte Außentemperatur an. + +channel-type.darksky.forecasted-min-apparent-temperature.label = Minimale Gefühlte Temperatur +channel-type.darksky.forecasted-min-apparent-temperature.description = Zeigt die vorhergesagte minimale gefühlte Außentemperatur an. + +channel-type.darksky.forecasted-max-apparent-temperature.label = Maximale Gefühlte Temperatur +channel-type.darksky.forecasted-max-apparent-temperature.description = Zeigt die vorhergesagte maximale gefühlte Außentemperatur an. + channel-type.darksky.forecasted-barometric-pressure.label = Vorhergesagter Luftdruck channel-type.darksky.forecasted-barometric-pressure.description = Zeigt den vorhergesagten Luftdruck an. @@ -354,13 +374,13 @@ channel-type.config.darksky.sunrise-sunset-event.latest.label = Sp channel-type.config.darksky.sunrise-sunset-event.latest.description = Spätester Zeitpunkt eines Triggers am aktuellen Tag (in hh:mm). # thing status -offline.conf-error-missing-apikey = Der Parameter 'API Schlüssel' muss konfiguriert werden. -offline.conf-error-invalid-apikey = Ungültiger 'API Schlüssel'. Mehr Infos unter https://darksky.net/dev/docs/faq#faq-general. -offline.conf-error-not-supported-refreshInterval = Der Parameter 'Abfrageintervall' muss mindestens 1 min betragen. -offline.conf-error-not-supported-language = Der angegebene Parameter 'Sprache' wird nicht unterstützt. +offline.conf-error-missing-apikey = Der Parameter 'apikey' muss konfiguriert werden. +offline.conf-error-invalid-apikey = Ungültiger API Schlüssel. Mehr Infos unter https://darksky.net/dev/docs/faq#faq-general. +offline.conf-error-not-supported-refreshInterval = Der Parameter 'refreshInterval' muss mindestens 1 min betragen. +offline.conf-error-not-supported-language = Der angegebene Parameter 'language' wird nicht unterstützt. -offline.conf-error-missing-location = Der Parameter 'Ort' muss konfiguriert werden. -offline.conf-error-parsing-location = Der Parameter 'Ort' kann nicht in Latitude und Longitude getrennt werden. +offline.conf-error-missing-location = Der Parameter 'location' muss konfiguriert werden. +offline.conf-error-parsing-location = Der Parameter 'location' kann nicht in Latitude und Longitude getrennt werden. offline.conf-error-not-supported-number-of-hours = Der Parameter 'forecastHours' muss zwischen 0 und 120 liegen - Schrittweite: 3. offline.conf-error-not-supported-number-of-days = Der Parameter 'forecastDays' muss zwischen 0 und 16 liegen. offline.conf-error-not-supported-number-of-alerts = Der Parameter 'numberOfAlerts' muss größer als 0 sein. diff --git a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/channel-types.xml index 81fefcd5f392e..34117f3c7284d 100644 --- a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/channel-types.xml @@ -14,6 +14,7 @@ <channel id="icon" typeId="condition-icon" /> <channel id="icon-id" typeId="condition-icon-id" /> <channel id="temperature" typeId="system.outdoor-temperature" /> + <channel id="apparent-temperature" typeId="apparent-temperature" /> <channel id="pressure" typeId="system.barometric-pressure" /> <channel id="humidity" typeId="system.atmospheric-humidity" /> <channel id="wind-speed" typeId="system.wind-speed" /> @@ -44,6 +45,7 @@ <channel id="icon" typeId="condition-icon" /> <channel id="icon-id" typeId="condition-icon-id" /> <channel id="temperature" typeId="forecasted-outdoor-temperature" /> + <channel id="apparent-temperature" typeId="forecasted-apparent-temperature" /> <channel id="pressure" typeId="forecasted-barometric-pressure" /> <channel id="humidity" typeId="forecasted-atmospheric-humidity" /> <channel id="wind-speed" typeId="forecasted-wind-speed" /> @@ -71,6 +73,8 @@ <channel id="icon-id" typeId="condition-icon-id" /> <channel id="min-temperature" typeId="forecasted-min-outdoor-temperature" /> <channel id="max-temperature" typeId="forecasted-max-outdoor-temperature" /> + <channel id="min-apparent-temperature" typeId="forecasted-min-apparent-temperature" /> + <channel id="max-apparent-temperature" typeId="forecasted-max-apparent-temperature" /> <channel id="pressure" typeId="forecasted-barometric-pressure" /> <channel id="humidity" typeId="forecasted-atmospheric-humidity" /> <channel id="wind-speed" typeId="forecasted-wind-speed" /> @@ -182,6 +186,38 @@ <state readOnly="true" pattern="%.1f %unit%" /> </channel-type> + <channel-type id="apparent-temperature"> + <item-type>Number:Temperature</item-type> + <label>Apparent Temperature</label> + <description>Current apparent temperature.</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="forecasted-apparent-temperature"> + <item-type>Number:Temperature</item-type> + <label>Forecasted Apparent Temperature</label> + <description>Forecasted apparent temperature.</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="forecasted-min-apparent-temperature"> + <item-type>Number:Temperature</item-type> + <label>Minimum Apparent Temperature</label> + <description>Minimum forecasted apparent temperature.</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="forecasted-max-apparent-temperature"> + <item-type>Number:Temperature</item-type> + <label>Maximum Apparent Temperature</label> + <description>Maximum forecasted apparent temperature.</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + <channel-type id="forecasted-barometric-pressure"> <item-type>Number:Pressure</item-type> <label>Forecasted Pressure</label> diff --git a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/thing-types.xml index 0d4cf8f9e6317..0e8abcb5929e7 100644 --- a/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.darksky/src/main/resources/ESH-INF/thing/thing-types.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="weather-api" /> </supported-bridge-type-refs> - <label>Weather And Forecast</label> + <label>Weather and Forecast</label> <description>Provides current weather and forecast data from the Dark Sky API.</description> <channel-groups> diff --git a/bundles/org.openhab.binding.darksky/src/test/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCacheTest.java b/bundles/org.openhab.binding.darksky/src/test/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCacheTest.java index 52a237e9a3af4..0906f0799322e 100644 --- a/bundles/org.openhab.binding.darksky/src/test/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCacheTest.java +++ b/bundles/org.openhab.binding.darksky/src/test/java/org/openhab/binding/darksky/internal/utils/ByteArrayFileCacheTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/NOTICE b/bundles/org.openhab.binding.deconz/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.deconz/NOTICE +++ b/bundles/org.openhab.binding.deconz/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.deconz/README.md b/bundles/org.openhab.binding.deconz/README.md index b13a1046c14d1..cbd47dea5d307 100644 --- a/bundles/org.openhab.binding.deconz/README.md +++ b/bundles/org.openhab.binding.deconz/README.md @@ -1,12 +1,11 @@ # Dresden Elektronik deCONZ Binding The Zigbee binding currently does not support the Dresden Elektronik Raspbee and Conbee Zigbee dongles. -The manufacturer provides a companion app called deCONZ together with the mentioned hardware. deCONZ -offers a documented real-time channel that this binding makes use of to bring support for all -paired Zigbee sensors and switches. +The manufacturer provides a companion app called deCONZ together with the mentioned hardware. +deCONZ offers a documented real-time channel that this binding makes use of to bring support for all paired Zigbee sensors and switches. -deCONZ also acts as a HUE bridge. This binding is meant to be used together with the HUE binding -which makes the lights and plugs available. +deCONZ also acts as a HUE bridge. +This binding is meant to be used together with the HUE binding which makes the lights and plugs available. ## Supported Things @@ -26,6 +25,7 @@ These things are supported: | Open/Close Sensor | ZHAOpenClose | `openclosesensor` | | Water Leakage Sensor | ZHAWater | `waterleakagesensor` | | Alarm Sensor | ZHAAlarm | `alarmsensor` | +| Fire Sensor | ZHAFire | `firesensor` | | Vibration Sensor | ZHAVibration | `vibrationsensor` | | deCONZ Artificial Daylight Sensor | deCONZ specific: simulated sensor | `daylightsensor` | @@ -38,14 +38,22 @@ Sensors, switches are discovered as soon as a `deconz` bridge Thing comes online These configuration parameters are available: -| Parameter | Description | Type | Default | -| :-------- | :------------------------------------------------------------ | :-------: | :-------: | -| host | Host address (hostname/ip:port) of deCONZ interface | string | n/a | -| apikey | Authorization API key (optional, can be filled automatically) | string | n/a | +| Parameter | Description | Type | Default | +|-----------|---------------------------------------------------------------------------------|---------|---------| +| host | Host address (hostname / ip) of deCONZ interface | string | n/a | +| httpPort | Port of deCONZ HTTP interface | string | 80 | +| port | Port of deCONZ Websocket (optional, can be filled automatically) **(Advanced)** | string | n/a | +| apikey | Authorization API key (optional, can be filled automatically) | string | n/a | +| timeout | Timeout for asynchronous HTTP requests (in milliseconds) | integer | 2000 | The deCONZ bridge requires the IP address or hostname as a configuration value in order for the binding to know where to access it. +If needed you can specify an optional port for the HTTP interface or the Websocket. +The Websocket port can be filled automatically by requesting it via the HTTP interface - you only need to specify it if your deCONZ instance is running containerized. -The API key is an optional value. If a deCONZ API key is available because it has already been created manually, it can also be entered as a configuration value. Otherwise the field can be left empty and the binding will generate the key automatically. For this process the deCONZ bridge must be unlocked in the deCONZ software so that third party applications can register. [See deCONZ documentation](http://dresden-elektronik.github.io/deconz-rest-doc/getting_started/#unlock-the-gateway) +The API key is an optional value. +If a deCONZ API key is available because it has already been created manually, it can also be entered as a configuration value. +Otherwise the field can be left empty and the binding will generate the key automatically. +For this process the deCONZ bridge must be unlocked in the deCONZ software so that third party applications can register ([see deCONZ documentation](https://dresden-elektronik.github.io/deconz-rest-doc/getting_started/#unlock-the-gateway)). ### Textual Thing Configuration - Retrieving an API Key @@ -55,14 +63,16 @@ If you use the textual configuration, the thing file without an API key will loo Bridge deconz:deconz:homeserver [ host="192.168.0.10" ] ``` -In this case, the API key is generated automatically as described above (the deCONZ bridge has to be unlocked). Please note that the generated key cannot be written automatically to the `.thing` file, and has to be set manually. -The generated key can be queried from the configuration using the openHAB console. To do this log into the [console](https://www.openhab.org/docs/administration/console.html) and use the command `things show` to display the configuration parameters, e.g: +In this case, the API key is generated automatically as described above (the deCONZ bridge has to be unlocked). +Please note that the generated key cannot be written automatically to the `.thing` file, and has to be set manually. +The generated key can be queried from the configuration using the openHAB console. +To do this log into the [console](https://www.openhab.org/docs/administration/console.html) and use the command `things show` to display the configuration parameters, e.g: ``` things show deconz:deconz:homeserver ``` -Afterwards the displayed API key has to be inserted in the `.thing` file as `apikey` configuration value, e.g.: +Afterwards the API key has to be inserted in the `.thing` file as `apikey` configuration value, e.g.: ``` Bridge deconz:deconz:homeserver [ host="192.168.0.10", apikey="ABCDEFGHIJ" ] @@ -90,6 +100,7 @@ The devices support some of the following channels: | pressure | Number:Pressure | R | Current pressure in hPa | pressuresensor | | open | Contact | R | Status of contacts: `OPEN`; `CLOSED` | openclosesensor | | waterleakage | Switch | R | Status of water leakage: `ON` = water leakage detected; `OFF` = no water leakage detected | waterleakagesensor | +| fire | Switch | R | Status of a fire: `ON` = fire was detected; `OFF` = no fire detected | firesensor | | alarm | Switch | R | Status of an alarm: `ON` = alarm was triggered; `OFF` = no alarm | alarmsensor | | tampered | Switch | R | Status of a zone: `ON` = zone is being tampered; `OFF` = zone is not tampered | any IAS sensor | | vibration | Switch | R | Status of vibration: `ON` = vibration was detected; `OFF` = no vibration | alarmsensor | diff --git a/bundles/org.openhab.binding.deconz/pom.xml b/bundles/org.openhab.binding.deconz/pom.xml index 098a0cfda26af..5245f4ad06255 100644 --- a/bundles/org.openhab.binding.deconz/pom.xml +++ b/bundles/org.openhab.binding.deconz/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.deconz</artifactId> diff --git a/bundles/org.openhab.binding.deconz/src/main/feature/feature.xml b/bundles/org.openhab.binding.deconz/src/main/feature/feature.xml index e72bbf9d70e69..dff0a3b336b82 100644 --- a/bundles/org.openhab.binding.deconz/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.deconz/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.deconz-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-deconz" description="Dresden Elektronik deCONZ Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/BindingConstants.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/BindingConstants.java index 61beb5ffdafee..eef9a79dff1af 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/BindingConstants.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/BindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -41,6 +41,7 @@ public class BindingConstants { public static final ThingTypeUID THING_TYPE_OPENCLOSE_SENSOR = new ThingTypeUID(BINDING_ID, "openclosesensor"); public static final ThingTypeUID THING_TYPE_WATERLEAKAGE_SENSOR = new ThingTypeUID(BINDING_ID, "waterleakagesensor"); + public static final ThingTypeUID THING_TYPE_FIRE_SENSOR = new ThingTypeUID(BINDING_ID, "firesensor"); public static final ThingTypeUID THING_TYPE_ALARM_SENSOR = new ThingTypeUID(BINDING_ID, "alarmsensor"); public static final ThingTypeUID THING_TYPE_VIBRATION_SENSOR = new ThingTypeUID(BINDING_ID, "vibrationsensor"); @@ -64,6 +65,7 @@ public class BindingConstants { public static final String CHANNEL_BUTTONEVENT = "buttonevent"; public static final String CHANNEL_OPENCLOSE = "open"; public static final String CHANNEL_WATERLEAKAGE = "waterleakage"; + public static final String CHANNEL_FIRE = "fire"; public static final String CHANNEL_ALARM = "alarm"; public static final String CHANNEL_TAMPERED = "tampered"; public static final String CHANNEL_VIBRATION = "vibration"; @@ -72,15 +74,16 @@ public class BindingConstants { // Thing configuration public static final String CONFIG_HOST = "host"; + public static final String CONFIG_HTTP_PORT = "httpPort"; public static final String CONFIG_APIKEY = "apikey"; public static final String UNIQUE_ID = "uid"; - public static String url(String host, @Nullable String apikey, @Nullable String endpointType, + public static String url(String host, int port, @Nullable String apikey, @Nullable String endpointType, @Nullable String endpointID) { StringBuilder url = new StringBuilder(); url.append("http://"); - url.append(host); + url.append(host).append(":").append(port); url.append("/api/"); if (apikey != null) { url.append(apikey); diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/HandlerFactory.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/HandlerFactory.java index 7484f00cbde88..844b5c1e42046 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/HandlerFactory.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/HandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,9 +32,12 @@ import org.openhab.binding.deconz.internal.handler.DeconzBridgeHandler; import org.openhab.binding.deconz.internal.handler.SensorThingHandler; import org.openhab.binding.deconz.internal.netutils.AsyncHttpClient; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +import com.google.gson.Gson; + /** * The {@link HandlerFactory} is responsible for creating things and thing * handlers. @@ -44,48 +47,38 @@ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.deconz") @NonNullByDefault public class HandlerFactory extends BaseThingHandlerFactory { - private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections - .unmodifiableSet(Stream.of(BRIDGE_TYPE, THING_TYPE_PRESENCE_SENSOR, THING_TYPE_DAYLIGHT_SENSOR, - THING_TYPE_POWER_SENSOR, THING_TYPE_CONSUMPTION_SENSOR, THING_TYPE_LIGHT_SENSOR, - THING_TYPE_TEMPERATURE_SENSOR, THING_TYPE_HUMIDITY_SENSOR, THING_TYPE_PRESSURE_SENSOR, - THING_TYPE_SWITCH, THING_TYPE_OPENCLOSE_SENSOR, THING_TYPE_WATERLEAKAGE_SENSOR, + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet( + Stream.of(BRIDGE_TYPE, THING_TYPE_PRESENCE_SENSOR, THING_TYPE_DAYLIGHT_SENSOR, THING_TYPE_POWER_SENSOR, + THING_TYPE_CONSUMPTION_SENSOR, THING_TYPE_LIGHT_SENSOR, THING_TYPE_TEMPERATURE_SENSOR, + THING_TYPE_HUMIDITY_SENSOR, THING_TYPE_PRESSURE_SENSOR, THING_TYPE_SWITCH, + THING_TYPE_OPENCLOSE_SENSOR, THING_TYPE_WATERLEAKAGE_SENSOR, THING_TYPE_FIRE_SENSOR, THING_TYPE_ALARM_SENSOR, THING_TYPE_VIBRATION_SENSOR).collect(Collectors.toSet())); - private @NonNullByDefault({}) WebSocketFactory webSocketFactory; - private @NonNullByDefault({}) HttpClientFactory httpClientFactory; + private final Gson gson = new Gson(); + private final WebSocketFactory webSocketFactory; + private final HttpClientFactory httpClientFactory; + + @Activate + public HandlerFactory(final @Reference WebSocketFactory webSocketFactory, + final @Reference HttpClientFactory httpClientFactory) { + this.webSocketFactory = webSocketFactory; + this.httpClientFactory = httpClientFactory; + } @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); } - @Reference - public void setWebSocketFactory(WebSocketFactory factory) { - webSocketFactory = factory; - } - - @Reference - public void setHttpClientFactory(HttpClientFactory factory) { - httpClientFactory = factory; - } - - public void unsetWebSocketFactory(WebSocketFactory factory) { - webSocketFactory = null; - } - - public void unsetHttpClientFactory(HttpClientFactory factory) { - httpClientFactory = null; - } - @Override protected @Nullable ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (BRIDGE_TYPE.equals(thingTypeUID)) { return new DeconzBridgeHandler((Bridge) thing, webSocketFactory, - new AsyncHttpClient(httpClientFactory.getCommonHttpClient())); + new AsyncHttpClient(httpClientFactory.getCommonHttpClient()), gson); } else { - return new SensorThingHandler(thing); + return new SensorThingHandler(thing, gson); } } } diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/BridgeDiscoveryParticipant.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/BridgeDiscoveryParticipant.java index 0c9945ab60cbf..8a95a2a7ba77d 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/BridgeDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/BridgeDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,8 @@ */ package org.openhab.binding.deconz.internal.discovery; +import static org.openhab.binding.deconz.internal.BindingConstants.*; + import java.net.URL; import java.util.Collections; import java.util.Map; @@ -27,7 +29,6 @@ import org.eclipse.smarthome.core.thing.ThingUID; import org.jupnp.model.meta.DeviceDetails; import org.jupnp.model.meta.RemoteDevice; -import org.openhab.binding.deconz.internal.BindingConstants; import org.osgi.service.component.annotations.Component; /** @@ -45,7 +46,7 @@ public class BridgeDiscoveryParticipant implements UpnpDiscoveryParticipant { @Override public Set<ThingTypeUID> getSupportedThingTypeUIDs() { - return Collections.singleton(BindingConstants.BRIDGE_TYPE); + return Collections.singleton(BRIDGE_TYPE); } @Override @@ -64,12 +65,14 @@ public Set<ThingTypeUID> getSupportedThingTypeUIDs() { name = name.substring(0, name.indexOf('(') - 1); } // Add host+port - String host = descriptorURL.getHost() + ":" + String.valueOf(descriptorURL.getPort()); - name = name + " (" + host + ")"; + String host = descriptorURL.getHost(); + int port = descriptorURL.getPort(); + name = name + " (" + host + ":" + String.valueOf(port) + ")"; Map<String, Object> properties = new TreeMap<>(); - properties.put(BindingConstants.CONFIG_HOST, host); + properties.put(CONFIG_HOST, host); + properties.put(CONFIG_HTTP_PORT, port); return DiscoveryResultBuilder.create(uid).withProperties(properties).withLabel(name) .withRepresentationProperty(UDN).build(); @@ -80,7 +83,7 @@ public Set<ThingTypeUID> getSupportedThingTypeUIDs() { DeviceDetails details = device.getDetails(); if (details != null && details.getManufacturerDetails() != null && "dresden elektronik".equals(details.getManufacturerDetails().getManufacturer())) { - return new ThingUID(BindingConstants.BRIDGE_TYPE, details.getSerialNumber()); + return new ThingUID(BRIDGE_TYPE, details.getSerialNumber()); } return null; } diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java index 5a858f18e7783..f14a10791cc2c 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/discovery/ThingDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,8 +47,8 @@ public class ThingDiscoveryService extends AbstractDiscoveryService implements D .unmodifiableSet(Stream.of(THING_TYPE_PRESENCE_SENSOR, THING_TYPE_DAYLIGHT_SENSOR, THING_TYPE_POWER_SENSOR, THING_TYPE_CONSUMPTION_SENSOR, THING_TYPE_LIGHT_SENSOR, THING_TYPE_TEMPERATURE_SENSOR, THING_TYPE_HUMIDITY_SENSOR, THING_TYPE_PRESSURE_SENSOR, THING_TYPE_SWITCH, - THING_TYPE_OPENCLOSE_SENSOR, THING_TYPE_WATERLEAKAGE_SENSOR, THING_TYPE_ALARM_SENSOR, - THING_TYPE_VIBRATION_SENSOR).collect(Collectors.toSet())); + THING_TYPE_OPENCLOSE_SENSOR, THING_TYPE_WATERLEAKAGE_SENSOR, THING_TYPE_FIRE_SENSOR, + THING_TYPE_ALARM_SENSOR, THING_TYPE_VIBRATION_SENSOR).collect(Collectors.toSet())); private @Nullable DeconzBridgeHandler handler; private @Nullable ScheduledFuture<?> scanningJob; @@ -107,6 +107,8 @@ private void addDevice(String sensorID, SensorMessage sensor) { thingTypeUID = THING_TYPE_OPENCLOSE_SENSOR; } else if (sensor.type.contains("ZHAWater")) { // ZHAWater thingTypeUID = THING_TYPE_WATERLEAKAGE_SENSOR; + } else if (sensor.type.contains("ZHAFire")) { + thingTypeUID = THING_TYPE_FIRE_SENSOR; // ZHAFire } else if (sensor.type.contains("ZHAAlarm")) { thingTypeUID = THING_TYPE_ALARM_SENSOR; // ZHAAlarm } else if (sensor.type.contains("ZHAVibration")) { diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/ApiKeyMessage.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/ApiKeyMessage.java index f0d2de37cec40..d1eababee804a 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/ApiKeyMessage.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/ApiKeyMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/BridgeFullState.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/BridgeFullState.java index 002976c01a292..13e06f7cf84df 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/BridgeFullState.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/BridgeFullState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorConfig.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorConfig.java index f0b4a71969490..cda5e008dc13a 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorConfig.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorMessage.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorMessage.java index 9ce45fb6c6282..70c91bb14f838 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorMessage.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorState.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorState.java index 250fd5e2ea306..3813f3426e11d 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorState.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/dto/SensorState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeConfig.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeConfig.java index 02610939ba189..6fdef4f5673ac 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeConfig.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,6 +23,16 @@ @NonNullByDefault public class DeconzBridgeConfig { public String host = ""; + public int httpPort = 80; + public int port = 0; public @Nullable String apikey; int timeout = 2000; + + public String getHostWithoutPort() { + String hostWithoutPort = host; + if (hostWithoutPort.indexOf(':') > 0) { + hostWithoutPort = hostWithoutPort.substring(0, hostWithoutPort.indexOf(':')); + } + return hostWithoutPort; + } } diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java index 0be0a9d579dd5..3dac30459c814 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/DeconzBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,8 +19,10 @@ import java.util.Collections; import java.util.Map; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -61,21 +63,22 @@ public class DeconzBridgeHandler extends BaseBridgeHandler implements WebSocketC private final WebSocketConnection websocket; private final AsyncHttpClient http; private DeconzBridgeConfig config = new DeconzBridgeConfig(); - private final Gson gson = new Gson(); + private final Gson gson; private @Nullable ScheduledFuture<?> scheduledFuture; - private int websocketport = 0; + private int websocketPort = 0; /** Prevent a dispose/init cycle while this flag is set. Use for property updates */ private boolean ignoreConfigurationUpdate; /** The poll frequency for the API Key verification */ private static final int POLL_FREQUENCY_SEC = 10; - public DeconzBridgeHandler(Bridge thing, WebSocketFactory webSocketFactory, AsyncHttpClient http) { + public DeconzBridgeHandler(Bridge thing, WebSocketFactory webSocketFactory, AsyncHttpClient http, Gson gson) { super(thing); this.http = http; + this.gson = gson; String websocketID = thing.getUID().getAsString().replace(':', '-'); websocketID = websocketID.length() < 3 ? websocketID : websocketID.substring(websocketID.length() - 20); - this.websocket = new WebSocketConnection(this, webSocketFactory.createWebSocketClient(websocketID)); + this.websocket = new WebSocketConnection(this, webSocketFactory.createWebSocketClient(websocketID), gson); } @Override @@ -157,12 +160,13 @@ public void requestFullState() { if (config.apikey == null) { return; } - String url = url(config.host, config.apikey, null, null); - + String url = url(config.getHostWithoutPort(), config.httpPort, config.apikey, null, null); http.get(url, config.timeout).thenApply(this::parseBridgeFullStateResponse).exceptionally(e -> { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - if (!(e instanceof SocketTimeoutException)) { - logger.warn("Get full state failed", e); + if (e instanceof SocketTimeoutException || e instanceof TimeoutException + || e instanceof CompletionException) { + logger.debug("Get full state failed", e); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } return null; }).whenComplete((value, error) -> { @@ -171,9 +175,7 @@ public void requestFullState() { thingDiscoveryService.stateRequestFinished(value != null ? value.sensors : null); } }).thenAccept(fullState -> { - // Auth failed if (fullState == null) { - requestApiKey(); return; } if (fullState.config.name.isEmpty()) { @@ -199,7 +201,8 @@ public void requestFullState() { updateProperties(editProperties); ignoreConfigurationUpdate = false; - websocketport = fullState.config.websocketport; + // Use requested websocket port if no specific port is given + websocketPort = config.port == 0 ? fullState.config.websocketport : config.port; startWebsocket(); }).exceptionally(e -> { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, e.getMessage()); @@ -213,18 +216,14 @@ public void requestFullState() { * {@link #requestFullState} need to be called first to obtain the websocket port. */ private void startWebsocket() { - if (websocket.isConnected() || websocketport == 0) { + if (websocket.isConnected() || websocketPort == 0) { return; } - String host = config.host; - if (host.indexOf(':') > 0) { - host = host.substring(0, host.indexOf(':')); - } stopTimer(); scheduledFuture = scheduler.schedule(this::startWebsocket, POLL_FREQUENCY_SEC, TimeUnit.SECONDS); - websocket.start(host + ":" + String.valueOf(websocketport)); + websocket.start(config.getHostWithoutPort() + ":" + String.valueOf(websocketPort)); } /** @@ -235,7 +234,7 @@ private void startWebsocket() { private CompletableFuture<?> requestApiKey() { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_PENDING, "Requesting API Key"); stopTimer(); - String url = url(config.host, null, null, null); + String url = url(config.getHostWithoutPort(), config.httpPort, null, null, null); return http.post(url, "{\"devicetype\":\"openHAB\"}", config.timeout).thenAccept(this::parseAPIKeyResponse) .exceptionally(e -> { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingConfig.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingConfig.java index ad1cfac459dd1..9d3dd328c8722 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingConfig.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java index 55f7e41b35659..e659867e9b0b3 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/handler/SensorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,12 +17,17 @@ import static org.eclipse.smarthome.core.library.unit.SmartHomeUnits.*; import static org.openhab.binding.deconz.internal.BindingConstants.*; +import java.net.SocketTimeoutException; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Map; +import java.util.concurrent.CompletionException; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import javax.measure.quantity.Dimensionless; import javax.measure.quantity.ElectricCurrent; @@ -33,7 +38,6 @@ import javax.measure.quantity.Pressure; import javax.measure.quantity.Temperature; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.DateTimeType; @@ -58,8 +62,8 @@ import org.openhab.binding.deconz.internal.dto.SensorMessage; import org.openhab.binding.deconz.internal.dto.SensorState; import org.openhab.binding.deconz.internal.netutils.AsyncHttpClient; -import org.openhab.binding.deconz.internal.netutils.ValueUpdateListener; import org.openhab.binding.deconz.internal.netutils.WebSocketConnection; +import org.openhab.binding.deconz.internal.netutils.WebSocketValueUpdateListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,20 +84,23 @@ * @author David Graeff - Initial contribution */ @NonNullByDefault -public class SensorThingHandler extends BaseThingHandler implements ValueUpdateListener { +public class SensorThingHandler extends BaseThingHandler implements WebSocketValueUpdateListener { private final Logger logger = LoggerFactory.getLogger(SensorThingHandler.class); private SensorThingConfig config = new SensorThingConfig(); private DeconzBridgeConfig bridgeConfig = new DeconzBridgeConfig(); - private final Gson gson = new Gson(); + private final Gson gson; + private @Nullable ScheduledFuture<?> scheduledFuture; private @Nullable WebSocketConnection connection; + private @Nullable AsyncHttpClient http; /** The sensor state. Contains all possible fields for all supported sensors and switches */ private SensorState state = new SensorState(); /** Prevent a dispose/init cycle while this flag is set. Use for property updates */ private boolean ignoreConfigurationUpdate; - public SensorThingHandler(Thing thing) { + public SensorThingHandler(Thing thing, Gson gson) { super(thing); + this.gson = gson; } @Override @@ -113,6 +120,17 @@ public void handleConfigurationUpdate(Map<String, Object> configurationParameter } } + /** + * Stops the API request + */ + private void stopTimer() { + ScheduledFuture<?> future = scheduledFuture; + if (future != null && !future.isCancelled()) { + future.cancel(true); + scheduledFuture = null; + } + } + private @Nullable SensorMessage parseStateResponse(AsyncHttpClient.Result r) { if (r.getResponseCode() == 403) { return null; @@ -124,7 +142,7 @@ public void handleConfigurationUpdate(Map<String, Object> configurationParameter } @Override - public void bridgeStatusChanged(@NonNull ThingStatusInfo bridgeStatusInfo) { + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { if (config.id.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "ID not set"); return; @@ -148,103 +166,118 @@ public void bridgeStatusChanged(@NonNull ThingStatusInfo bridgeStatusInfo) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); return; } - DeconzBridgeHandler handler = (DeconzBridgeHandler) bridge.getHandler(); - if (handler == null) { + DeconzBridgeHandler bridgeHandler = (DeconzBridgeHandler) bridge.getHandler(); + if (bridgeHandler == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); return; } - final WebSocketConnection webSocketConnection = handler.getWebsocketConnection(); + final WebSocketConnection webSocketConnection = bridgeHandler.getWebsocketConnection(); this.connection = webSocketConnection; - this.bridgeConfig = handler.getBridgeConfig(); + final AsyncHttpClient asyncHttpClient = bridgeHandler.getHttp(); + this.http = asyncHttpClient; + this.bridgeConfig = bridgeHandler.getBridgeConfig(); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_PENDING); - String url = url(bridgeConfig.host, bridgeConfig.apikey, "sensors", config.id); + // Real-time data + webSocketConnection.registerValueListener(config.id, this); + + requestState(); + } + /** + * Perform a request to the REST API for retrieving the full sensor state with all data and configuration. + */ + public void requestState() { + AsyncHttpClient asyncHttpClient = http; + if (asyncHttpClient == null) { + return; + } + String url = url(bridgeConfig.host, bridgeConfig.httpPort, bridgeConfig.apikey, "sensors", config.id); // Get initial data - handler.getHttp().get(url.toString(), bridgeConfig.timeout).thenApply(this::parseStateResponse) // - .exceptionally(e -> { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - logger.debug("Get state failed", e); - return null; - }).thenAccept(newState -> { - // Auth failed - if (newState == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Auth failed"); - return; - } + asyncHttpClient.get(url, bridgeConfig.timeout).thenApply(this::parseStateResponse).exceptionally(e -> { + if (e instanceof SocketTimeoutException || e instanceof TimeoutException + || e instanceof CompletionException) { + logger.debug("Get new state failed", e); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } - // Add some information about the sensor - if (!newState.config.reachable) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Not reachable"); - return; - } + stopTimer(); + scheduledFuture = scheduler.schedule(this::requestState, 10, TimeUnit.SECONDS); - if (!newState.config.on) { - updateStatus(ThingStatus.OFFLINE); - return; - } + return null; + }).thenAccept(newState -> { + if (newState == null) { + return; + } - Map<String, String> editProperties = editProperties(); - editProperties.put(Thing.PROPERTY_FIRMWARE_VERSION, newState.swversion); - editProperties.put(Thing.PROPERTY_MODEL_ID, newState.modelid); - editProperties.put(UNIQUE_ID, newState.uniqueid); - ignoreConfigurationUpdate = true; - updateProperties(editProperties); - - // Some sensors support optional channels - // (see https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Supported-Devices#sensors) - // any battery-powered sensor - Integer batteryLevel = newState.config.battery; - if (batteryLevel != null) { - createAndUpdateChannelIfExists(CHANNEL_BATTERY_LEVEL, - new DecimalType(batteryLevel.longValue())); - createAndUpdateChannelIfExists(CHANNEL_BATTERY_LOW, - batteryLevel <= 10 ? OnOffType.ON : OnOffType.OFF); - } + // Add some information about the sensor + if (!newState.config.reachable) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE, "Not reachable"); + return; + } - // some Xiaomi sensors - Float temperature = newState.config.temperature; - if (temperature != null) { - createAndUpdateChannelIfExists(CHANNEL_TEMPERATURE, - new QuantityType<Temperature>(temperature / 100, CELSIUS)); - } + if (!newState.config.on) { + updateStatus(ThingStatus.OFFLINE); + return; + } - // ZHAPresence - e.g. IKEA TRÃ…DFRI motion sensor - if (newState.state.dark != null) { - createChannel(CHANNEL_DARK); - } + Map<String, String> editProperties = editProperties(); + editProperties.put(Thing.PROPERTY_FIRMWARE_VERSION, newState.swversion); + editProperties.put(Thing.PROPERTY_MODEL_ID, newState.modelid); + editProperties.put(UNIQUE_ID, newState.uniqueid); + ignoreConfigurationUpdate = true; + updateProperties(editProperties); + + // Some sensors support optional channels + // (see https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Supported-Devices#sensors) + // any battery-powered sensor + Integer batteryLevel = newState.config.battery; + if (batteryLevel != null) { + createAndUpdateChannelIfExists(CHANNEL_BATTERY_LEVEL, new DecimalType(batteryLevel.longValue())); + createAndUpdateChannelIfExists(CHANNEL_BATTERY_LOW, batteryLevel <= 10 ? OnOffType.ON : OnOffType.OFF); + } - // ZHAConsumption - e.g Bitron 902010/25 or Heiman SmartPlug - if (newState.state.power != null) { - createChannel(CHANNEL_POWER); - } + // some Xiaomi sensors + Float temperature = newState.config.temperature; + if (temperature != null) { + createAndUpdateChannelIfExists(CHANNEL_TEMPERATURE, + new QuantityType<Temperature>(temperature / 100, CELSIUS)); + } - // ZHAPower - e.g. Heiman SmartPlug - if (newState.state.voltage != null) { - createChannel(CHANNEL_VOLTAGE); - } - if (newState.state.current != null) { - createChannel(CHANNEL_CURRENT); - } + // ZHAPresence - e.g. IKEA TRÃ…DFRI motion sensor + if (newState.state.dark != null) { + createChannel(CHANNEL_DARK); + } - // IAS Zone sensor - e.g. Heiman HS1MS motion sensor - if (newState.state.tampered != null) { - createChannel(CHANNEL_TAMPERED); - } - ignoreConfigurationUpdate = false; + // ZHAConsumption - e.g Bitron 902010/25 or Heiman SmartPlug + if (newState.state.power != null) { + createChannel(CHANNEL_POWER); + } - // Initial data - for (Channel channel : thing.getChannels()) { - valueUpdated(channel.getUID(), newState.state, true); - } + // ZHAPower - e.g. Heiman SmartPlug + if (newState.state.voltage != null) { + createChannel(CHANNEL_VOLTAGE); + } + if (newState.state.current != null) { + createChannel(CHANNEL_CURRENT); + } - // Real-time data - webSocketConnection.registerValueListener(config.id, this); - updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE); - }); + // IAS Zone sensor - e.g. Heiman HS1MS motion sensor + if (newState.state.tampered != null) { + createChannel(CHANNEL_TAMPERED); + } + ignoreConfigurationUpdate = false; + + // Initial data + for (Channel channel : thing.getChannels()) { + valueUpdated(channel.getUID(), newState.state, true); + } + updateStatus(ThingStatus.ONLINE); + }); } private void createAndUpdateChannelIfExists(String channelId, State state) { @@ -282,6 +315,7 @@ private void createAndUpdateChannelIfExists(String channelId, State state) { @Override public void dispose() { + stopTimer(); WebSocketConnection webSocketConnection = connection; if (webSocketConnection != null) { webSocketConnection.unregisterValueListener(config.id); @@ -299,32 +333,32 @@ public void initialize() { } } - public void valueUpdated(ChannelUID channelUID, SensorState state, boolean initializing) { - this.state = state; - - Integer buttonevent = state.buttonevent; - String lastUpdated = state.lastupdated; - Integer status = state.status; - Boolean presence = state.presence; - Boolean open = state.open; - Float power = state.power; - Float consumption = state.consumption; - Float voltage = state.voltage; - Float current = state.current; - Integer lux = state.lux; - Integer lightlevel = state.lightlevel; - Float temperature = state.temperature; - Float humidity = state.humidity; - Integer pressure = state.pressure; + public void valueUpdated(ChannelUID channelUID, SensorState newState, boolean initializing) { + this.state = newState; + + Integer buttonevent = newState.buttonevent; + String lastUpdated = newState.lastupdated; + Integer status = newState.status; + Boolean presence = newState.presence; + Boolean open = newState.open; + Float power = newState.power; + Float consumption = newState.consumption; + Float voltage = newState.voltage; + Float current = newState.current; + Integer lux = newState.lux; + Integer lightlevel = newState.lightlevel; + Float temperature = newState.temperature; + Float humidity = newState.humidity; + Integer pressure = newState.pressure; switch (channelUID.getId()) { case CHANNEL_LIGHT: - if (state.dark != null) { - boolean dark = state.dark; + Boolean dark = newState.dark; + if (dark != null) { + Boolean daylight = newState.daylight; if (dark) { // if it's dark, it's dark ;) updateState(channelUID, new StringType("Dark")); - } else if (state.daylight != null) { // if its not dark, it might be between darkness and daylight - boolean daylight = state.daylight; + } else if (daylight != null) { // if its not dark, it might be between darkness and daylight if (daylight) { updateState(channelUID, new StringType("Daylight")); } else if (!daylight) { @@ -366,10 +400,10 @@ public void valueUpdated(ChannelUID channelUID, SensorState state, boolean initi } break; case CHANNEL_DARK: - updateState(channelUID, Boolean.TRUE.equals(state.dark) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.dark) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_DAYLIGHT: - updateState(channelUID, Boolean.TRUE.equals(state.daylight) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.daylight) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_TEMPERATURE: if (temperature != null) { @@ -402,16 +436,19 @@ public void valueUpdated(ChannelUID channelUID, SensorState state, boolean initi } break; case CHANNEL_WATERLEAKAGE: - updateState(channelUID, Boolean.TRUE.equals(state.water) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.water) ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_FIRE: + updateState(channelUID, Boolean.TRUE.equals(newState.fire) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_ALARM: - updateState(channelUID, Boolean.TRUE.equals(state.alarm) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.alarm) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_TAMPERED: - updateState(channelUID, Boolean.TRUE.equals(state.tampered) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.tampered) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_VIBRATION: - updateState(channelUID, Boolean.TRUE.equals(state.vibration) ? OnOffType.ON : OnOffType.OFF); + updateState(channelUID, Boolean.TRUE.equals(newState.vibration) ? OnOffType.ON : OnOffType.OFF); break; case CHANNEL_BUTTON: if (buttonevent != null) { diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/AsyncHttpClient.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/AsyncHttpClient.java index cc8d578cc8c30..b3b98c092d92c 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/AsyncHttpClient.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/AsyncHttpClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,6 @@ package org.openhab.binding.deconz.internal.netutils; import java.io.ByteArrayInputStream; -import java.io.IOException; import java.net.URI; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; @@ -34,6 +33,7 @@ */ @NonNullByDefault public class AsyncHttpClient { + private final HttpClient client; public AsyncHttpClient(HttpClient client) { @@ -47,7 +47,6 @@ public AsyncHttpClient(HttpClient client) { * @param jsonString The message body * @param timeout A timeout * @return The result - * @throws IOException Any IO exception in an error case. */ public CompletableFuture<Result> post(String address, String jsonString, int timeout) { return doNetwork(HttpMethod.POST, address, jsonString, timeout); @@ -60,7 +59,6 @@ public CompletableFuture<Result> post(String address, String jsonString, int tim * @param jsonString The message body * @param timeout A timeout * @return The result - * @throws IOException Any IO exception in an error case. */ public CompletableFuture<Result> put(String address, String jsonString, int timeout) { return doNetwork(HttpMethod.PUT, address, jsonString, timeout); @@ -72,7 +70,6 @@ public CompletableFuture<Result> put(String address, String jsonString, int time * @param address The address * @param timeout A timeout * @return The result - * @throws IOException Any IO exception in an error case. */ public CompletableFuture<Result> get(String address, int timeout) { return doNetwork(HttpMethod.GET, address, null, timeout); @@ -84,14 +81,13 @@ public CompletableFuture<Result> get(String address, int timeout) { * @param address The address * @param timeout A timeout * @return The result - * @throws IOException Any IO exception in an error case. */ public CompletableFuture<Result> delete(String address, int timeout) { return doNetwork(HttpMethod.DELETE, address, null, timeout); } private CompletableFuture<Result> doNetwork(HttpMethod method, String address, @Nullable String body, int timeout) { - final CompletableFuture<Result> f = new CompletableFuture<Result>(); + final CompletableFuture<Result> f = new CompletableFuture<>(); Request request = client.newRequest(URI.create(address)); if (body != null) { try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes()); diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnection.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnection.java index d39a1e55b4d07..d832ded7bc896 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnection.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -44,13 +44,15 @@ public class WebSocketConnection { private final WebSocketClient client; private final WebSocketConnectionListener connectionListener; - private final Map<String, ValueUpdateListener> valueListener = new HashMap<>(); - private final Gson gson = new Gson(); + private final Map<String, WebSocketValueUpdateListener> valueListener = new HashMap<>(); + private final Gson gson; private boolean connected = false; - public WebSocketConnection(WebSocketConnectionListener listener, WebSocketClient client) { + public WebSocketConnection(WebSocketConnectionListener listener, WebSocketClient client, Gson gson) { this.connectionListener = listener; this.client = client; + this.client.setMaxIdleTimeout(0); + this.gson = gson; } public void start(String ip) { @@ -74,12 +76,12 @@ public void close() { connected = false; client.stop(); } catch (Exception e) { - logger.debug("Error while closing connection: {}", e); + logger.debug("Error while closing connection", e); } client.destroy(); } - public void registerValueListener(String sensorID, ValueUpdateListener listener) { + public void registerValueListener(String sensorID, WebSocketValueUpdateListener listener) { valueListener.put(sensorID, listener); } @@ -98,7 +100,7 @@ public void onConnect(Session session) { @OnWebSocketMessage public void onMessage(String message) { SensorMessage changedMessage = gson.fromJson(message, SensorMessage.class); - ValueUpdateListener listener = valueListener.get(changedMessage.id); + WebSocketValueUpdateListener listener = valueListener.get(changedMessage.id); if (listener != null) { listener.websocketUpdate(changedMessage.id, changedMessage.state); } diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnectionListener.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnectionListener.java index 0c90f4f862ded..01749714e1d21 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnectionListener.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketConnectionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/ValueUpdateListener.java b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketValueUpdateListener.java similarity index 88% rename from bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/ValueUpdateListener.java rename to bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketValueUpdateListener.java index 8af5f8f083169..a5c31b021e74a 100644 --- a/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/ValueUpdateListener.java +++ b/bundles/org.openhab.binding.deconz/src/main/java/org/openhab/binding/deconz/internal/netutils/WebSocketValueUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,7 @@ * @author David Graeff - Initial contribution */ @NonNullByDefault -public interface ValueUpdateListener { +public interface WebSocketValueUpdateListener { /** * A sensor state was updated. * diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/config/config.xml index 4f018848c2eb6..7a455b32502fc 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/config/config.xml @@ -8,12 +8,28 @@ <parameter name="host" type="text" required="true"> <label>Host Address</label> <context>network-address</context> - <description>IP address or host name and port</description> + <description>IP address or host name of deCONZ interface.</description> + </parameter> + <parameter name="httpPort" type="integer" required="false" min="1" max="65535"> + <label>HTTP Port</label> + <description>Port of the deCONZ HTTP interface.</description> + <default>80</default> + </parameter> + <parameter name="port" type="integer" required="false" min="1" max="65535"> + <label>Websocket Port</label> + <description>Port of the deCONZ Websocket.</description> + <advanced>true</advanced> </parameter> <parameter name="apikey" type="text" required="false"> <label>API Key</label> - <description>If no API Key is provided, a new one will be requested. You need to authorize the access on the deCONZ - web interface.</description> + <context>password</context> + <description>If no API Key is provided, a new one will be requested. You need to authorize the access on the deCONZ web interface.</description> + </parameter> + <parameter name="timeout" type="integer" required="false" unit="ms" min="0"> + <label>Timeout</label> + <description>Timeout for asynchronous HTTP requests (in milliseconds).</description> + <advanced>true</advanced> + <default>2000</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/thing/thing-types.xml index 22490c9b083f4..05362ff619ae7 100644 --- a/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.deconz/src/main/resources/ESH-INF/thing/thing-types.xml @@ -335,6 +335,29 @@ <state readOnly="true" /> </channel-type> + <thing-type id="firesensor"> + <supported-bridge-type-refs> + <bridge-type-ref id="deconz" /> + </supported-bridge-type-refs> + <label>Fire Sensor</label> + <description>A fire sensor</description> + <channels> + <channel typeId="fire" id="fire" /> + <channel typeId="last_updated" id="last_updated" /> + </channels> + + <representation-property>uid</representation-property> + + <config-description-ref uri="thing-type:deconz:sensor" /> + </thing-type> + + <channel-type id="fire"> + <item-type>Switch</item-type> + <label>Fire</label> + <description>A fire was detected.</description> + <state readOnly="true" /> + </channel-type> + <thing-type id="alarmsensor"> <supported-bridge-type-refs> <bridge-type-ref id="deconz" /> diff --git a/bundles/org.openhab.binding.denonmarantz/NOTICE b/bundles/org.openhab.binding.denonmarantz/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.denonmarantz/NOTICE +++ b/bundles/org.openhab.binding.denonmarantz/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.denonmarantz/README.md b/bundles/org.openhab.binding.denonmarantz/README.md index 55c2ae2334780..c49b1b30e6996 100644 --- a/bundles/org.openhab.binding.denonmarantz/README.md +++ b/bundles/org.openhab.binding.denonmarantz/README.md @@ -112,6 +112,6 @@ These resources can be useful to learn what to send using the `command`channel: - [AVR-X2000/E400](http://www2.aerne.com/Public/dok-sw.nsf/0c6187bc750a16fcc1256e3c005a9740/96a2ba120706d10dc1257bdd0033493f/$FILE/AVRX2000_E400_PROTOCOL(10.1.0)_V04.pdf) - [AVR-X4000](https://usa.denon.com/us/product/hometheater/receivers/avrx4000?docname=AVRX4000_PROTOCOL(10%203%200)_V03.pdf) -- [AVR-3311CI/AVR-3311/AVR-991](http://www.awe-europe.com/documents/Control%20Docs/Denon/Archive/AVR3311CI_AVR3311_991_PROTOCOL_V7.1.0.pdf) +- [AVR-3311CI/AVR-3311/AVR-991](https://www.awe-europe.com/documents/Control%20Docs/Denon/Archive/AVR3311CI_AVR3311_991_PROTOCOL_V7.1.0.pdf) - [CEOL Piccolo DRA-N5/RCD-N8](http://www.audioproducts.com.au/downloadcenter/products/Denon/CEOLPICCOLOBK/Manuals/DRAN5_RCDN8_PROTOCOL_V.1.0.0.pdf) - [Marantz Control Protocol (2014+)](http://m.us.marantz.com/DocumentMaster/US/Marantz%202014%20NR%20Series%20-%20SR%20Series%20RS232%20IP%20Protocol.xls) diff --git a/bundles/org.openhab.binding.denonmarantz/pom.xml b/bundles/org.openhab.binding.denonmarantz/pom.xml index bc97f4d55a6d9..fb55e867bf830 100644 --- a/bundles/org.openhab.binding.denonmarantz/pom.xml +++ b/bundles/org.openhab.binding.denonmarantz/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.denonmarantz</artifactId> diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/feature/feature.xml b/bundles/org.openhab.binding.denonmarantz/src/main/feature/feature.xml index 7491fc7910fb0..ddc816aaaf4f0 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.denonmarantz/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.denonmarantz-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-denonmarantz" description="Denon / Marantz Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java index 01b60a3ef580e..ff3bc920fe844 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzHandlerFactory.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzHandlerFactory.java index eb5de3f25e173..2be47557fd86f 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzHandlerFactory.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzState.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzState.java index d46d7689f04db..ba74bb2347238 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzState.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzStateChangedListener.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzStateChangedListener.java index 8b269fe6bb233..96307e224623b 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzStateChangedListener.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/DenonMarantzStateChangedListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/UnsupportedCommandTypeException.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/UnsupportedCommandTypeException.java index 07f8137db82d9..0cf72b4625f56 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/UnsupportedCommandTypeException.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/UnsupportedCommandTypeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/config/DenonMarantzConfiguration.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/config/DenonMarantzConfiguration.java index 8f606686dcb9d..a307a57c2a831 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/config/DenonMarantzConfiguration.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/config/DenonMarantzConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnector.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnector.java index 2ecfd28579f49..816897198b240 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnector.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnectorFactory.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnectorFactory.java index 89dc4b8f0382c..5c4ef4b9e2911 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnectorFactory.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/DenonMarantzConnectorFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/http/DenonMarantzHttpConnector.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/http/DenonMarantzHttpConnector.java index d6495edad00fd..3a470eff6166d 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/http/DenonMarantzHttpConnector.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/http/DenonMarantzHttpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -127,7 +127,7 @@ public void connect() { try { refreshHttpProperties(); } catch (IOException e) { - logger.debug("IO error while retrieving document: {}", e); + logger.debug("IO error while retrieving document", e); state.connectionError("IO error while connecting to AVR: " + e.getMessage()); stopPolling(); } catch (RuntimeException e) { diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetClient.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetClient.java index 3daf22f62092f..496c523931eb0 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetClient.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java index 7f91ff1d214be..2942c36c84d2a 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetListener.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetListener.java index d6db11ccf43b9..1bf3bb3d486ce 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetListener.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/connector/telnet/DenonMarantzTelnetListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/discovery/DenonMarantzDiscoveryParticipant.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/discovery/DenonMarantzDiscoveryParticipant.java index b313fec5b9e5e..d2167ff942e07 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/discovery/DenonMarantzDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/discovery/DenonMarantzDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java index 23d7d9d16d266..7bf78b46ca878 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -208,7 +208,7 @@ private void autoConfigure() { httpApiUsable = true; } } catch (InterruptedException | TimeoutException | ExecutionException e) { - logger.debug("Error when trying to access AVR using HTTP on port 80: {}, reverting to Telnet mode.", e); + logger.debug("Error when trying to access AVR using HTTP on port 80, reverting to Telnet mode.", e); } if (telnetEnable) { @@ -224,7 +224,7 @@ private void autoConfigure() { httpApiUsable = true; } } catch (InterruptedException | TimeoutException | ExecutionException e) { - logger.debug("Additionally tried to connect to port 8080, this also failed: {}", e); + logger.debug("Additionally tried to connect to port 8080, this also failed", e); } } @@ -240,7 +240,7 @@ private void autoConfigure() { .timeout(3, TimeUnit.SECONDS).send(); status = response.getStatus(); } catch (InterruptedException | TimeoutException | ExecutionException e) { - logger.debug("Failed in fetching the Deviceinfo.xml to determine zone count: {}", e); + logger.debug("Failed in fetching the Deviceinfo.xml to determine zone count", e); } if (status == HttpURLConnection.HTTP_OK && response != null) { diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/OnOffAdapter.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/OnOffAdapter.java index 9d66006220183..fe99770220e45 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/OnOffAdapter.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/OnOffAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/StringAdapter.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/StringAdapter.java index 9bb396731ac60..76411bce37660 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/StringAdapter.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/StringAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/VolumeAdapter.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/VolumeAdapter.java index 4e4a59d634a58..4bbda93770957 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/VolumeAdapter.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/adapters/VolumeAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Deviceinfo.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Deviceinfo.java index 77fa38d058fc6..9ae1fd8c8cade 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Deviceinfo.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Deviceinfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Main.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Main.java index 66249780f9033..b4943aff107a2 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Main.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/Main.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatus.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatus.java index daa7847a3b7ed..ae2fe3dec63b9 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatus.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatusLite.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatusLite.java index e57c3b2fc4b2d..e017d92c924b0 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatusLite.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/ZoneStatusLite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java index ae0ed3f7b9e72..40a6d42f37f37 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java index 7a91c544266fe..34127e6d6a8e8 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/AppCommandResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java index 1ccb972837a66..9280e57e1fd67 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandRx.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandTx.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandTx.java index 1d8580fc64d83..e46c2d532b1da 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandTx.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/CommandTx.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/DeletedSourceList.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/DeletedSourceList.java index bb3b9f951e304..0cadd5ac9a2d1 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/DeletedSourceList.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/DeletedSourceList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/RenameSourceList.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/RenameSourceList.java index 5d55c98f8ce53..ba12f159194e8 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/RenameSourceList.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/RenameSourceList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/Text.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/Text.java index 5c214bbe7d3f0..bb2a46537200e 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/Text.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/commands/Text.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/OnOffType.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/OnOffType.java index 99775dc15737c..90826605784dc 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/OnOffType.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/OnOffType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/StringType.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/StringType.java index 74ab9630ef7af..c1adc93b4ed05 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/StringType.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/StringType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/VolumeType.java b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/VolumeType.java index e1d1de7b6b9cc..fa4082cdfe1c3 100644 --- a/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/VolumeType.java +++ b/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/xml/entities/types/VolumeType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/NOTICE b/bundles/org.openhab.binding.digiplex/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.digiplex/NOTICE +++ b/bundles/org.openhab.binding.digiplex/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.digiplex/README.md b/bundles/org.openhab.binding.digiplex/README.md index ee682768f3cca..21be39fd64eeb 100644 --- a/bundles/org.openhab.binding.digiplex/README.md +++ b/bundles/org.openhab.binding.digiplex/README.md @@ -99,7 +99,7 @@ Message format is as follows: `<pin>` is your PIN as entered on a keypad. -**Note**: For security reasons please consider not storing your PIN in openhab configuration files. +**Note**: For security reasons please consider not storing your PIN in openHAB configuration files. **Note2**: Please consult your alarm system manual how to enable `Quick Arm` feature. It is not enabled by default. @@ -107,4 +107,4 @@ For example, the following sitemap item can be used to send commands to the area ``` Switch item=areaControl label="Actions[]" mappings=[QA="Regular Quick Arm",QS="Stay Quick Arm",D1111="Disarm"] labelcolor=[Ok="green",Fail="red"] -``` \ No newline at end of file +``` diff --git a/bundles/org.openhab.binding.digiplex/pom.xml b/bundles/org.openhab.binding.digiplex/pom.xml index 602de896293ae..a7ac73facfb71 100644 --- a/bundles/org.openhab.binding.digiplex/pom.xml +++ b/bundles/org.openhab.binding.digiplex/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.digiplex</artifactId> diff --git a/bundles/org.openhab.binding.digiplex/src/main/feature/feature.xml b/bundles/org.openhab.binding.digiplex/src/main/feature/feature.xml index 2afd8dccfb985..f927556337fe0 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.digiplex/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.digiplex-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-digiplex" description="Digiplex/EVO Alarm System Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java index 3745cda75a41d..9314b8090fd90 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexAreaConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBindingConstants.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBindingConstants.java index 11fb2d11d25d4..9713fcbdc393e 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBindingConstants.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java index f61efb4b41ce5..bbc11dbe4ea53 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexHandlerFactory.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexHandlerFactory.java index 119e83ecdefcb..9732fa2a0a32c 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexHandlerFactory.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/DigiplexHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AbstractResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AbstractResponse.java index 945455104c385..7716f54331d11 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AbstractResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AbstractResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmDisarmResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmDisarmResponse.java index 4ec6d8281dc5b..560fa0668c38d 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmDisarmResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmDisarmResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmRequest.java index 610a7459b1e4c..c43cdc140081b 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaArmRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaDisarmRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaDisarmRequest.java index fb956b36fc5ca..3eaff49d74c78 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaDisarmRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaDisarmRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelRequest.java index 2f15664b91d98..e4573fc5d1409 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelResponse.java index 70cc9a6df8983..f4149ea481e6f 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaLabelResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaQuickArmRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaQuickArmRequest.java index e290f045cc55a..46c48c71136d4 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaQuickArmRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaQuickArmRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatus.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatus.java index 164f0edf89906..7da08ff102dae 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatus.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusRequest.java index 43a15902066fa..48ff540fd5132 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusResponse.java index 27337810335a2..75e11719a56cc 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/AreaStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmDisarmType.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmDisarmType.java index 8ac2949d5a59e..ae6d7ff08c08f 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmDisarmType.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmDisarmType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmType.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmType.java index d4bd86cf3c82e..f11c321b61949 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmType.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ArmType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/CommunicationStatus.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/CommunicationStatus.java index 7af5679da92a1..e404bed64f621 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/CommunicationStatus.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/CommunicationStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessage.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessage.java index 3bb4a6e877235..6952080282594 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessage.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessageHandler.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessageHandler.java index 820cf1ec3fc06..aa6a0ae29e796 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessageHandler.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexMessageHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexRequest.java index 4a3ea46ca9b47..04133a3314c98 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponse.java index e0e74ac968c62..003d36e43246b 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponseResolver.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponseResolver.java index 4a41c68a9f129..b436d1a8fe0c4 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponseResolver.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/DigiplexResponseResolver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/UnknownResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/UnknownResponse.java index 19431413b9d11..3fd8991cb9726 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/UnknownResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/UnknownResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelRequest.java index f3bb4347a7c85..2d750df1e603b 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelResponse.java index 3529fb2123083..3398fc074e752 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneLabelResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatus.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatus.java index 0b7014bd735a8..f1b1226bd5575 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatus.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusRequest.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusRequest.java index d2b74c5ce3ab7..41e4df3c9a4f5 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusRequest.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusResponse.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusResponse.java index c5ae249df5a36..453ea9b09f94d 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusResponse.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/ZoneStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AbstractEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AbstractEvent.java index c1aa9adb10f6f..a981de3b6d323 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AbstractEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AbstractEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEvent.java index 1025d58b1dd32..53eb468fbcae5 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEventType.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEventType.java index 025e02f73d244..5d60f7fd43538 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEventType.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/AreaEventType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/GenericEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/GenericEvent.java index 7d0d21604c7a4..aa9303e0f03c4 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/GenericEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/GenericEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmEvent.java index 4a0d8a58ef4f5..bf7a05194fe89 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmType.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmType.java index 3243977575be7..ebd593d6d49a0 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmType.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/SpecialAlarmType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEvent.java index f1996add070a2..bda34d54900fc 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEventType.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEventType.java index 601b2623b5854..c152248d3bf73 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEventType.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneEventType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneStatusEvent.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneStatusEvent.java index 743af364bf0cf..52cd3ab4f8167 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneStatusEvent.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/communication/events/ZoneStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/discovery/DigiplexDiscoveryService.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/discovery/DigiplexDiscoveryService.java index bebf19ec4d7ca..b24c49a547c6e 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/discovery/DigiplexDiscoveryService.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/discovery/DigiplexDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexAreaHandler.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexAreaHandler.java index 4f1ec29387ca1..1210f85183748 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexAreaHandler.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexAreaHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java index 5a7e213e3f9c9..9d929b2b27109 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexZoneHandler.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexZoneHandler.java index 7ca0504177ebc..57f1070c42ad0 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexZoneHandler.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/DigiplexZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/TypeUtils.java b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/TypeUtils.java index 94bb424e13f56..4e0203eb17192 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/TypeUtils.java +++ b/bundles/org.openhab.binding.digiplex/src/main/java/org/openhab/binding/digiplex/internal/handler/TypeUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/area.xml b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/area.xml index 1b6e5735c6f70..bc0e7ea788425 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/area.xml +++ b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/area.xml @@ -22,8 +22,8 @@ <channel typeId="control" id="control" /> </channels> <config-description> - <parameter name="refreshPeriod" type="integer"> - <label>Refresh time of area status (in seconds)</label> + <parameter name="refreshPeriod" type="integer" unit="s"> + <label>Refresh Time of Area Status</label> <description>Controls how often area status will be refreshed from the PRT3 module</description> <default>60</default> </parameter> @@ -48,7 +48,7 @@ <channel-type id="area_armed"> <item-type>Contact</item-type> - <label>Area armed</label> + <label>Area Armed</label> <description>Indicates if area is armed</description> <state readOnly="true"> <options> @@ -60,7 +60,7 @@ <channel-type id="zone_in_memory"> <item-type>Contact</item-type> - <label>Zone in memory</label> + <label>Zone in Memory</label> <state readOnly="true"> <options> <option value="CLOSED">Ok</option> @@ -86,15 +86,15 @@ <description>Indicates if area is ready (no open zones)</description> <state readOnly="true"> <options> - <option value="CLOSED">Ready</option> - <option value="OPEN">Not ready</option> + <option value="CLOSED">Not ready</option> + <option value="OPEN">Ready</option> </options> </state> </channel-type> <channel-type id="in_programming"> <item-type>Contact</item-type> - <label>Area in programming mode</label> + <label>Area in Programming Mode</label> <description>Indicates if area is in the programming mode</description> <state readOnly="true"> <options> @@ -106,7 +106,7 @@ <channel-type id="alarm"> <item-type>Contact</item-type> - <label>Area in alarm</label> + <label>Area in Alarm</label> <description>Indicates if area is in alarm</description> <state readOnly="true"> <options> diff --git a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/bridge.xml index b4ffefaaec3cd..44f828e5ae1b5 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/bridge.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridge"> - <label>Digiplex PRT3 module</label> + <label>Digiplex PRT3 Module</label> <description>Digiplex PRT3 module with Serial Interface</description> <channels> <channel typeId="messages_sent" id="messages_sent" /> @@ -46,19 +46,19 @@ <channel-type id="messages_sent"> <item-type>Number</item-type> - <label>Messages sent</label> + <label>Messages Sent</label> <description>Counts messages sent to the alarm system</description> </channel-type> <channel-type id="responses_received"> <item-type>Number</item-type> - <label>Responses received</label> + <label>Responses Received</label> <description>Counts responses received from the alarm system</description> </channel-type> <channel-type id="events_received"> <item-type>Number</item-type> - <label>Events received</label> + <label>Events Received</label> <description>Counts events received from the alarm system</description> </channel-type> diff --git a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/zone.xml b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/zone.xml index 339751e32f966..69e11cff68c3c 100644 --- a/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/zone.xml +++ b/bundles/org.openhab.binding.digiplex/src/main/resources/ESH-INF/thing/zone.xml @@ -35,7 +35,7 @@ <channel-type id="extended_status"> <item-type>String</item-type> - <label>Extended zone status</label> + <label>Extended Zone Status</label> <description>Indicates actual zone state as a string</description> <state readOnly="true"> <options> @@ -49,7 +49,7 @@ <channel-type id="alarm"> <item-type>Contact</item-type> - <label>Alarm triggered</label> + <label>Alarm Triggered</label> <description>Indicates if zone is in alarm</description> <state readOnly="true"> <options> @@ -61,7 +61,7 @@ <channel-type id="fire_alarm"> <item-type>Contact</item-type> - <label>Fire alarm triggered</label> + <label>Fire Alarm Triggered</label> <description>Indicates if zone is in fire alarm</description> <state readOnly="true"> <options> @@ -73,7 +73,7 @@ <channel-type id="supervision_lost"> <item-type>Contact</item-type> - <label>Supervision lost</label> + <label>Supervision Lost</label> <description>Indicates if zone has lost a supervision</description> <state readOnly="true"> <options> @@ -85,7 +85,7 @@ <channel-type id="low_battery"> <item-type>Contact</item-type> - <label>Low battery warning</label> + <label>Low Battery Warning</label> <description>Indicates if zone is low on battery</description> <state readOnly="true"> <options> @@ -97,7 +97,7 @@ <channel-type id="last_triggered"> <item-type>DateTime</item-type> - <label>Last triggered time</label> + <label>Last Triggered Time</label> <description>Indicates when the zone has been triggered for the last time</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.digitalstrom/NOTICE b/bundles/org.openhab.binding.digitalstrom/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.digitalstrom/NOTICE +++ b/bundles/org.openhab.binding.digitalstrom/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.digitalstrom/README.md b/bundles/org.openhab.binding.digitalstrom/README.md index 205ba8faa45b5..4b17a8f83850c 100644 --- a/bundles/org.openhab.binding.digitalstrom/README.md +++ b/bundles/org.openhab.binding.digitalstrom/README.md @@ -1,6 +1,6 @@ # digitalSTROM Binding - This binding integrates the [digitalSTROM-System](http://www.digitalstrom.de/). + This binding integrates the [digitalSTROM-System](https://www.digitalstrom.de/). The integration happens through the digitalSTROM-Server, which acts as a gateway to connect the digitalSTROM-Devices. The digitalSTROM-Server communicates through the digitalSTROM-Meters with the digitalSTROM-Devices, which are directly connected to the power-line. @@ -16,10 +16,13 @@ The digitalSTROM-Server is required for accessing any other digitalSTROM-Devices ### digitalSTROM-Devices -At this point almost all available **GE**, **SW**, **GR** and **BL** digitalSTROM-Devices with a set output-mode, unequal *disabled*, are supported by this binding. Furthermore sensor devices like the **dS-iSens200** and **SW-devices** with binary-inputs are supported. +At this point almost all available **GE**, **SW**, **GR** and **BL** digitalSTROM-Devices with a set output-mode, unequal *disabled*, are supported by this binding. +Furthermore sensor devices like the **dS-iSens200** and **SW-devices** with binary-inputs are supported. Last but not least the **circuit** (dS-Meter) is supported, too. They will provide the power consumption and electric meter as channels. -For that there are identically named thing types. Only the *GR* type has a channel (shade), which cannot be changed. The other types add their channels dynamically affected by the set color-group and output-mode. They also automatically change or add the channels, if the color-group or output-mode has changed through the dSS-web-configuration or the configured sensor priorities of the thing has changed. +For that there are identically named thing types. Only the *GR* type has a channel (shade), which cannot be changed. +The other types add their channels dynamically affected by the set color-group and output-mode. +They also automatically change or add the channels, if the color-group or output-mode has changed through the dSS-web-configuration or the configured sensor priorities of the thing has changed. - The following table shows all tested digitalSTROM-Devices with their output-modes. @@ -30,7 +33,7 @@ For that there are identically named thing types. Only the *GR* type has a chann | GE-TKM210 | switched, dimmed | yellow | | GE-SDM200 | switched, dimmed | yellow | | GE-UMV200 | 1-10V dimmed | yellow | -| GR-KL200 | standard output-mode | grey | +| GR-KL200 | standard output-mode | grey | | GR-KL210 | standard output-mode| grey | | GR-KL220 | standard output-mode | grey | | SW-KL200 | switch, powersave, wipe | black, yellow | @@ -57,7 +60,8 @@ The different scene thing types are listed in the following table. ### digitalSTROM-Zone-Temperature-Control Last but not least, the digitalSTROM-Zone-Temperature-Control is also supported, if a zone-temerature-control is configured, as thing-type **zone_temperature_control**. -The difference between the digitalSTROM-heating-control-app is, that there are no operation-modes, like *comfort* or *eco*. You can directly set the target temperature, in case *pid-control* is configured, otherwise you can set the value in percent of heating valves at the zone. +The difference between the digitalSTROM-heating-control-app is, that there are no operation-modes, like *comfort* or *eco*. +You can directly set the target temperature, in case *pid-control* is configured, otherwise you can set the value in percent of heating valves at the zone. The needed channels will be added automatically, as it is also the case for the devices. ## Discovery @@ -87,7 +91,7 @@ The digitalSTROM-Server thing has the following configuration parameter groups: #### Connection configuration If the digitalSTROM-Server isn’t found automatically, e.g. because the server isn’t placed at the local network or the mDNS-service is deactivated, you have to insert the network address or URL and the authentication data manually through the graphical user interface or type it into the \*.thing with textual configuration. -If you use your user name and password for authentication and there is already a token for this application, it will be automatically retrieved from the digitalSTROM-Server, otherwise a new application-token will be generated. +If you use your user name and password for authentication and there is already a token for this application, it will be automatically retrieved from the digitalSTROM-Server, otherwise a new application-token will be generated. | Parameter Label | Parameter ID | Description | Required | Advanced |--------------|------------|--------------------------------|----------------- |------------- | @@ -137,7 +141,7 @@ In addition to the configuration the digitalSTROM-Server has the following prope | Serial | The digitalSTROM-Server hardware serial number. | | Ethernet | The digitalSTROM-Server IEEE mac address. | | MachineID | The digitalSTROM-Server unique id. | -| Kernel | The digitalSTROM-Server linux kernel release string. | +| Kernel | The digitalSTROM-Server Linux kernel release string. | ### digitalSTROM-Devices @@ -156,7 +160,7 @@ The following table shows the parameter: #### Sensor setup The GE, BL and SW digitalSTROM-Devices usually have sensors to capture power consumption data. -So these devices have the following parameters to read them out. +So these devices have the following parameters to read them out. | Parameter Label | Parameter ID| Description | Required | Advanced | Default | |-----------------|--------------------|-----------------------------|----------------- |------------- | -----------| @@ -173,12 +177,12 @@ The following table shows all informative properties: | ------------- | ------------------------------------- | |dSUID | The unique identifier of a digitalSTORM-device with virtual devices. | | deviceName | he name of a digitalSTROM-Device. | -| meterDSID | Identifier of the meter to which the device is connected. | -| hwInfo | The hardware type from this digitalSTROM-Device. | -| zoneID |The digitalSTROM-Device is part of this zone. | -| groups | The digitalSTROM-Device is part of this user-defined or functional groups. | -| output mode | The current digitalSTROM-Device output mode e.g. 22 = dimmable. | -| funcColorGroup | The current digitalSTROM-Device functional color group e.g. yellow = light. | +| meterDSID | Identifier of the meter to which the device is connected. | +| hwInfo | The hardware type from this digitalSTROM-Device. | +| zoneID |The digitalSTROM-Device is part of this zone. | +| groups | The digitalSTROM-Device is part of this user-defined or functional groups. | +| output mode | The current digitalSTROM-Device output mode e.g. 22 = dimmable. | +| funcColorGroup | The current digitalSTROM-Device functional color group e.g. yellow = light. | The device scene configurations will also be persisted in the properties. There are in the format: @@ -224,7 +228,7 @@ As configuration only the zone ID or the zone name, to identify the controlled z ### digitalSTROM-Scenes -The digitalSTROM-Scenes can be defined with following parameters. +The digitalSTROM-Scenes can be defined with following parameters. | Parameter Label | Parameter ID| Description | Required | Advanced | |-----------------|------------------------|----------------------------------|----------------- |------------- | @@ -269,7 +273,7 @@ Thing digitalstrom:groupScene:preset1 (digitalstrom:dssBridge:myDssBridge) [ zon ## Channels -All devices support some of the following channels: +All devices support some of the following channels: ### Output-Channels @@ -331,10 +335,10 @@ digitalSTROM-Devices which are able to set a binary-input sensor like SW-UMR200 |-------|---------|------------------------------------|----------------- | | binary_input_presence | Switch | Will be activated, if a presence is detected. | SW | | binary_input_brightness | Switch | Will be activated, if the brightness is higher than a setted value. | SW | -| binary_input_presence_in_darkness | Switch | Will be activated, if a presence is detected. Sensor has a integrated twilight sensor. | SW | +| binary_input_presence_in_darkness | Switch | Will be activated, if a presence is detected. Sensor has an integrated twilight sensor. | SW | | binary_input_twilight | Switch | Will be activated by twilight. | SW | | binary_input_motion | Switch | Will be activated, if a motion is detected. | SW | -| binary_input_motion_in_darkness | Switch | Will be activated, if a motion is detected. Sensor has a integrated twilight sensor. | SW | +| binary_input_motion_in_darkness | Switch | Will be activated, if a motion is detected. Sensor has an integrated twilight sensor. | SW | | binary_input_smoke | Switch | Will be activated, if smoke is detected. | SW | | binary_input_wind_strenght_above_limit | Switch | Will be activated, if wind strength is above a user adjusted limit. | SW | | binary_input_rain | Switch | Will be activated, if rain is detected. | SW | @@ -379,7 +383,7 @@ The digitalSTROM-Server * The digitalSTROM-Server only informs the binding about scene-commands. So if you set the output value of devices e.g. through the dSS-App, the binding will not be informed about the changes and you have to send a "refresh-command" to update the channel. * If you press a physical switch at your digitalSTROM-installation and the called scene-value is not red out yet, it can take a bit time to read it out and change the state of the channel. It the scene-value is red out, the state will change immediately. -See also *General-Informations/digitalSTROM-Scenes*. +See also *General-Informations/digitalSTROM-Scenes*. *Channels with accepted command type increase and decrease:* @@ -400,10 +404,10 @@ Bridge digitalstrom:dssBridge:dSS [ dSSAddress="urlOfMyDss", userName="dssadmin SW SW-ZWS-200 [ dSID="3504175fe0000000000651c0"] SW SW-UMR-200 [ dSID="302ed89f43f00ec0000a1034"] dSiSens200 dS-iSens200 [ dSID="302ed89f43f026800003543d"] - zoneTemperatureControl zoneTemperatureControl [ zoneID="livingroom"] + zoneTemperatureControl zoneTemperatureControl [ zoneID="livingroom"] GR GR-KL220 [ dSID="3504175fe0000000000651c1" ] namedScene Scene1 [ zoneID="5", groupID="1", sceneID="5"] - circuit circuit1 [ dSID="3504175fe0000010000004e4" ] + circuit circuit1 [ dSID="3504175fe0000010000004e4" ] GR GR-KL200 [ dSID="3504175fe0000000000651c1" ] } ``` @@ -511,7 +515,7 @@ sitemap demo label="Main Menu" Frame label="TV"{ Switch item=DeviceSwitch - } + } } } ``` @@ -530,7 +534,7 @@ The current troubleshooting to read out the new scene configuration after a save 1. delete the thing to delete the persistently saved scene configuration 2. restart the server to delete the temporary saved scene configuration -3. add the thing again to read out the scene configuration again. +3. add the thing again to read out the scene configuration again. ### Initial state of digitalSTROM-Scenes and devices @@ -550,5 +554,5 @@ If you configure your system with textual configuration files, like *\*.thing*, If you want to create a rule, which uses things of the digitalSTROM-Binding, there are also two things you have to consider. -1. If the rule contains several digitalSTROM-Devices, which can be summarized in a digitalSTROM-Scene, e.g. some lights in a zone, please use a equivalent supported scene. That will significantly reduce the communication to the digitalSTROM-Server, increases performance and does not bypass the digitalSTROM state-machine. +1. If the rule contains several digitalSTROM-Devices, which can be summarized in a digitalSTROM-Scene, e.g. some lights in a zone, please use an equivalent supported scene. That will significantly reduce the communication to the digitalSTROM-Server, increases performance and does not bypass the digitalSTROM state-machine. 2. If you implement your own temperature control algorithm for a zone/room, e.g. because you want to use other temperature sensors, and call more than one digitalSTROM-BL-KM200, please use the *zone_temperature_control* for valve value control. The *zone_temperature_control* for valve value control will call all digitalSTROM-BL-KM200 with one command and increases the performance. To get the needed channel at the *zone_temperature_control* you have to choose a control mode unequal to *pid-controlled* for the affected zone at the digitalSTROM-heating-control-app. diff --git a/bundles/org.openhab.binding.digitalstrom/pom.xml b/bundles/org.openhab.binding.digitalstrom/pom.xml index bb94a7a6b4f6f..09313cbb8eb0f 100644 --- a/bundles/org.openhab.binding.digitalstrom/pom.xml +++ b/bundles/org.openhab.binding.digitalstrom/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.digitalstrom</artifactId> diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/feature/feature.xml b/bundles/org.openhab.binding.digitalstrom/src/main/feature/feature.xml index df8d8f004b5b0..7d06aa273d5df 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.digitalstrom/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.digitalstrom-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-digitalstrom" description="digitalSTROM Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMBindingConstants.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMBindingConstants.java index 7c76467a5f5db..f91ddddd3bcfe 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMBindingConstants.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java index 2dc9028d4c2e8..c1f3e2cdda757 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/DigitalSTROMHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeDiscoveryService.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeDiscoveryService.java index eb63876aaaa3e..2f91b45c22230 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeMDNSDiscoveryParticipant.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeMDNSDiscoveryParticipant.java index 69b363d7922f6..31a6d5d639f0a 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeMDNSDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/BridgeMDNSDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DeviceDiscoveryService.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DeviceDiscoveryService.java index a0a8e51688635..1876237fb3952 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java index be66c3c8496b4..e721edfc1fd7d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/DiscoveryServiceManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java index 254bbc1043500..0e321d3e86ac7 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/SceneDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/ZoneTemperatureControlDiscoveryService.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/ZoneTemperatureControlDiscoveryService.java index 07999a018e8be..567650d12a528 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/ZoneTemperatureControlDiscoveryService.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/discovery/ZoneTemperatureControlDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java index 24216f8be1af8..c51c2539001d6 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/BridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java index d89c97854e53d..e82a5a82f12e1 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/CircuitHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java index cf72c449cd344..f6aca36cc2233 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/DeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/SceneHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/SceneHandler.java index 35cfb0064e880..be199d9853b11 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/SceneHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/SceneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java index 5a5391a4b032c..36f03b09da645 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/handler/ZoneTemperatureControlHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/GeneralLibConstance.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/GeneralLibConstance.java index 5cab4c5b601e8..8034bf8ad0d1a 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/GeneralLibConstance.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/GeneralLibConstance.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/TemperatureControlSensorTransmitter.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/TemperatureControlSensorTransmitter.java index cadc16cace6ce..4adefa0370517 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/TemperatureControlSensorTransmitter.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/TemperatureControlSensorTransmitter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlModes.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlModes.java index 40a543ecadea5..135c124a2d86e 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlModes.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlModes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlStates.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlStates.java index e07e1e5aaf0a3..4767d9794c69d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlStates.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/ControlStates.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/OperationModes.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/OperationModes.java index f1fbcb1d0137c..e96784aa17586 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/OperationModes.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/constants/OperationModes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/AssignSensorType.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/AssignSensorType.java index 5acb5dc0280d9..e9c95f87fb4ea 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/AssignSensorType.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/AssignSensorType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/CachedSensorValue.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/CachedSensorValue.java index 44daaf3d83b8f..e8ff19e5cc264 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/CachedSensorValue.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/datatypes/CachedSensorValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java index fc493fb0f502e..4c4656c5a959b 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseSensorValues.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseTemperatureControl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseTemperatureControl.java index 9e33b6a87ab99..004012a074b3e 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseTemperatureControl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseTemperatureControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseZoneIdentifier.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseZoneIdentifier.java index 5670cea929a9b..b24ea905851bd 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseZoneIdentifier.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/BaseZoneIdentifier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/ZoneIdentifier.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/ZoneIdentifier.java index c0dbfa384bd34..7e58f1deb56cf 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/ZoneIdentifier.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/ZoneIdentifier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java index b0dccfc301318..3b7896d8d1e28 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/AssignedSensors.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/SensorValues.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/SensorValues.java index b61c8d64307d6..df9beddd06255 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/SensorValues.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/SensorValues.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlConfig.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlConfig.java index 96a349fddd801..71dfe5be732bc 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlConfig.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlInternals.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlInternals.java index e918376fb7e78..bf62c3f1ebb6c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlInternals.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlInternals.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlStatus.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlStatus.java index 7d258cc24bb3c..91db13d8969d8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlStatus.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java index 0334859b0e56d..6828d026ae11e 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/TemperatureControlValues.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/WeatherSensorData.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/WeatherSensorData.java index a68adf24ade1a..470939094a5f9 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/WeatherSensorData.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/climate/jsonresponsecontainer/impl/WeatherSensorData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/config/Config.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/config/Config.java index ad6a39a524420..1c9a687faca26 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/config/Config.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/config/Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventHandler.java index c077aa9e4522f..50efadc50b6f6 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java index 1a403010f4299..c71b017da35b0 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/EventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -341,7 +341,8 @@ private boolean subscribe(String eventName) { logger.debug("subscribed event: {} to subscriptionID: {}", eventName, subscriptionID); } else { logger.error( - "Couldn't subscribe event {} ... maybe timeout because system is too busy ... event will be tried to subscribe later again ... "); + "Couldn't subscribe event {} ... maybe timeout because system is too busy ... event will be tried to subscribe later again ... ", + eventName); } return subscribed; } diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventNames.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventNames.java index d89dc56949b7d..28d69fc624e44 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventNames.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventNames.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java index 0a64e53ae87c9..ff4b747b6885f 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/constants/EventResponseEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/Event.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/Event.java index 707bb2b802c59..12806b23c6773 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/Event.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/Event.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItem.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItem.java index 98c133cc08d6c..26cdc4ce35b57 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItem.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java index 7eb0c59b0bfb2..b29eab5b923cd 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/EventItemImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java index edec6309ea085..e11595e87c21c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/event/types/JSONEventImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ConnectionListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ConnectionListener.java index 6b7e83796c730..d6f8bffccf6a0 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ConnectionListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ConnectionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/DeviceStatusListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/DeviceStatusListener.java index ed952a2ad6310..7a258f5561c3e 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/DeviceStatusListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/DeviceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ManagerStatusListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ManagerStatusListener.java index 2df32c3770428..01704b88723c3 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ManagerStatusListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/ManagerStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SceneStatusListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SceneStatusListener.java index 431bc01358fe7..58887b48e82b3 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SceneStatusListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SceneStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SystemStateChangeListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SystemStateChangeListener.java index 08d86f04a4200..9cd50cc3b64c6 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SystemStateChangeListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/SystemStateChangeListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TemperatureControlStatusListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TemperatureControlStatusListener.java index fab65ae1b9c18..fb1ccc5fd7739 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TemperatureControlStatusListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TemperatureControlStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TotalPowerConsumptionListener.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TotalPowerConsumptionListener.java index fea815c8b4292..344fe51b46375 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TotalPowerConsumptionListener.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/TotalPowerConsumptionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerStates.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerStates.java index 6bcc74cfb93d4..2678858f9716f 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerStates.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerStates.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerTypes.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerTypes.java index e21c3140b1a74..6b4c70dad28b8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerTypes.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/listener/stateenums/ManagerTypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/ConnectionManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/ConnectionManager.java index 390f63ad77e06..240e8cebf9081 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/ConnectionManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/ConnectionManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/DeviceStatusManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/DeviceStatusManager.java index 6d03d8a52cedc..dcf75c93ba096 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/DeviceStatusManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/DeviceStatusManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/SceneManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/SceneManager.java index d2083246f4344..398ef3969241b 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/SceneManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/SceneManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java index 35e7e2b6016fa..58f781fe5c632 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/StructureManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/ConnectionManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/ConnectionManagerImpl.java index d939756f162c7..f0b82b081adb4 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/ConnectionManagerImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/ConnectionManagerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java index f809ab09fe022..791e6b43d0fc1 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/DeviceStatusManagerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java index cb2f6c3b8a601..1334e664e4457 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/SceneManagerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java index 9f96a53ddcbf7..5fca6688aa1e1 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/StructureManagerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java index db49bf7e1f224..767b10173e106 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/manager/impl/TemperatureControlManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java index 151d62a3482e7..d4a86717c4637 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/AbstractSensorJobExecutor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java index 12ebe3bc281cf..f7fec839446c3 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/CircuitScheduler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SceneReadingJobExecutor.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SceneReadingJobExecutor.java index 6b5dd91b1e13a..2681d5d63e755 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SceneReadingJobExecutor.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SceneReadingJobExecutor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SensorJobExecutor.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SensorJobExecutor.java index 3b11dfc410c74..561c5ad820c00 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SensorJobExecutor.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/SensorJobExecutor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/SensorJob.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/SensorJob.java index 3e2df663d7e9d..ac6c7933a94b8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/SensorJob.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/SensorJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceConsumptionSensorJob.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceConsumptionSensorJob.java index 8840a9fde9736..40ce1e4025d5c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceConsumptionSensorJob.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceConsumptionSensorJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceOutputValueSensorJob.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceOutputValueSensorJob.java index 0a6a4d4ec284c..262da686fb6e8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceOutputValueSensorJob.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/DeviceOutputValueSensorJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneConfigReadingJob.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneConfigReadingJob.java index 5e2fa60325c35..1b1b23bd7e2b4 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneConfigReadingJob.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneConfigReadingJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneOutputValueReadingJob.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneOutputValueReadingJob.java index e8b71d5118081..cb71f5fb6bdad 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneOutputValueReadingJob.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/sensorjobexecutor/sensorjob/impl/SceneOutputValueReadingJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java index cccf945301406..1aa03836a49d4 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/DsAPI.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/HttpTransport.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/HttpTransport.java index 80ab5568257e1..e9eb8b3d83696 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/HttpTransport.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/HttpTransport.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java index 3b1a4c0a1ab8d..02e295fb97a23 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/constants/JSONApiResponseKeysEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java index 7e6c11ca17191..0f868290c4596 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/DsAPIImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/HttpTransportImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/HttpTransportImpl.java index 079aa7777893b..5003012f7d157 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/HttpTransportImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/HttpTransportImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/JSONResponseHandler.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/JSONResponseHandler.java index 87dbe1645b57a..da0d4d2b2550d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/JSONResponseHandler.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/impl/JSONResponseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/SimpleRequestBuilder.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/SimpleRequestBuilder.java index 25b3e5425c738..6dd65757f1e77 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/SimpleRequestBuilder.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/SimpleRequestBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ClassKeys.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ClassKeys.java index c0aff7a5b919d..e6b68ac8c4aaf 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ClassKeys.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ClassKeys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ExeptionConstants.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ExeptionConstants.java index 923dfad1d67b0..06c88f78814b9 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ExeptionConstants.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ExeptionConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/FunctionKeys.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/FunctionKeys.java index a875199dc676b..ef9adf2be398b 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/FunctionKeys.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/FunctionKeys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/InterfaceKeys.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/InterfaceKeys.java index da48cd3eadbdc..b0a1127686bfc 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/InterfaceKeys.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/InterfaceKeys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ParameterKeys.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ParameterKeys.java index 6441f175881c1..3c7236d69a8cd 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ParameterKeys.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/serverconnection/simpledsrequestbuilder/constants/ParameterKeys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Apartment.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Apartment.java index c2d1bb48979db..fb75370ceaf56 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Apartment.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Apartment.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/DetailedGroupInfo.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/DetailedGroupInfo.java index 8a25659ed9cc9..d2ad2be615e10 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/DetailedGroupInfo.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/DetailedGroupInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Group.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Group.java index e4f468dbd8b5f..3edf68e7901b2 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Group.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Group.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Zone.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Zone.java index 5b52e6f236110..e574bc91c4430 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Zone.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/Zone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/AbstractGeneralDeviceInformations.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/AbstractGeneralDeviceInformations.java index 841db0fcc03fe..7c9140d0704cc 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/AbstractGeneralDeviceInformations.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/AbstractGeneralDeviceInformations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Circuit.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Circuit.java index 3ed8154ee68fd..7c95f42f1e6e8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Circuit.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Circuit.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Device.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Device.java index 4eaf870fd74b4..7766f4b38731d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Device.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/GeneralDeviceInformation.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/GeneralDeviceInformation.java index 295453deed144..6a9c18c57f981 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/GeneralDeviceInformation.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/GeneralDeviceInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/CachedMeteringValue.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/CachedMeteringValue.java index 747838c2a3846..a4b8bc857fb6b 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/CachedMeteringValue.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/CachedMeteringValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConfig.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConfig.java index 7b6400df51724..9f4966033f30c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConfig.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConstants.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConstants.java index 731d67a8cd2f6..5ef7bc86482fa 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConstants.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceSceneSpec.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceSceneSpec.java index fb0767aa26fcd..e567c661d957d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceSceneSpec.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceSceneSpec.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceStateUpdate.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceStateUpdate.java index 9dc16063cb285..da448f2c5e462 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceStateUpdate.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/DeviceStateUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/ChangeableDeviceConfigEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/ChangeableDeviceConfigEnum.java index 68b5a835d396a..9692ab0affe7d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/ChangeableDeviceConfigEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/ChangeableDeviceConfigEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceBinarayInputEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceBinarayInputEnum.java index fd19aa2eb234d..0bac5bfbffeaf 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceBinarayInputEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceBinarayInputEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceParameterClassEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceParameterClassEnum.java index 77b827ee47693..f7a3406736d58 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceParameterClassEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/DeviceParameterClassEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FuncNameAndColorGroupEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FuncNameAndColorGroupEnum.java index 42ffc5704f2ce..d5aa248d7d9a8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FuncNameAndColorGroupEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FuncNameAndColorGroupEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FunctionalColorGroupEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FunctionalColorGroupEnum.java index 5008f331eb43d..add9cad553560 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FunctionalColorGroupEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/FunctionalColorGroupEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringTypeEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringTypeEnum.java index 6d07b4fea2d9e..44c4dcf77ec0a 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringTypeEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringTypeEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringUnitsEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringUnitsEnum.java index 787b207e9eb99..b1c9e7f98efe1 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringUnitsEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/MeteringUnitsEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/OutputModeEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/OutputModeEnum.java index 614655b7bc713..cdcde7b619952 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/OutputModeEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/OutputModeEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/SensorEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/SensorEnum.java index 0ee752771f2f6..7a887553e114e 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/SensorEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/constants/SensorEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DSID.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DSID.java index cb271354ba0f9..9cf59e36ca741 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DSID.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DSID.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceBinaryInput.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceBinaryInput.java index 405a5e2e6cdfd..0294647dce774 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceBinaryInput.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceBinaryInput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceSensorValue.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceSensorValue.java index 095d0030c7617..cec6210d342e5 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceSensorValue.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceSensorValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceStateUpdateImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceStateUpdateImpl.java index b9116aaa46bc9..b1165ae3ac80d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceStateUpdateImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/DeviceStateUpdateImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONCachedMeteringValueImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONCachedMeteringValueImpl.java index 249ef69ec7814..f8ec3ba83503c 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONCachedMeteringValueImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONCachedMeteringValueImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceConfigImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceConfigImpl.java index 159cebd1662b9..e0b9b8096f4c8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceConfigImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceConfigImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceSceneSpecImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceSceneSpecImpl.java index de1d684c43115..da95bc51edbf0 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceSceneSpecImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/deviceparameters/impl/JSONDeviceSceneSpecImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/CircuitImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/CircuitImpl.java index 91d725608fa95..6a9339863546f 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/CircuitImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/CircuitImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/DeviceImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/DeviceImpl.java index 9855c2e60be33..33400de0d2e3d 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/DeviceImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/devices/impl/DeviceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONApartmentImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONApartmentImpl.java index 39edc21684726..2ed1f57f7e409 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONApartmentImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONApartmentImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONDetailedGroupInfoImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONDetailedGroupInfoImpl.java index f107a45b50754..700585d8b8074 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONDetailedGroupInfoImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONDetailedGroupInfoImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONZoneImpl.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONZoneImpl.java index c5b123d110e0a..d12ad3b7b1f27 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONZoneImpl.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/impl/JSONZoneImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/InternalScene.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/InternalScene.java index 5d786a648fa19..89736643a03b8 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/InternalScene.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/InternalScene.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/SceneDiscovery.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/SceneDiscovery.java index 7aad4728bd118..ba7ce818dbcd7 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/SceneDiscovery.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/SceneDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ApartmentSceneEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ApartmentSceneEnum.java index fa2c089af4af2..34ad4a36e1663 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ApartmentSceneEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ApartmentSceneEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/Scene.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/Scene.java index 0487a8483003f..824ebe0537ec0 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/Scene.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/Scene.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneEnum.java index 7117afdb5df7b..ca251b1a1b01a 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneTypes.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneTypes.java index 1208cc4f59bdc..05eef8d9912fd 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneTypes.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/SceneTypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ZoneSceneEnum.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ZoneSceneEnum.java index e608e24ed3d70..bef880cce01b0 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ZoneSceneEnum.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/lib/structure/scene/constants/ZoneSceneEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/BaseDsI18n.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/BaseDsI18n.java index 78e3a0b626cf6..084434f03cdda 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/BaseDsI18n.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/BaseDsI18n.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java index 5a0f003606f45..7f552cde30ee5 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsChannelTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,7 +25,6 @@ import java.util.Set; import org.eclipse.smarthome.core.i18n.TranslationProvider; -import org.eclipse.smarthome.core.thing.type.ChannelGroupType; import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; @@ -185,7 +184,7 @@ public static MeteringTypeEnum getMeteringType(String channelID) { return null; } - private static List<String> supportedOutputChannelTypes = new ArrayList<>(); + private static final List<String> SUPPORTED_OUTPUT_CHANNEL_TYPES = new ArrayList<>(); /** * Returns true, if the given channel type id is a output channel. @@ -194,7 +193,7 @@ public static MeteringTypeEnum getMeteringType(String channelID) { * @return true, if channel type id is output channel */ public static boolean isOutputChannel(String channelTypeID) { - return supportedOutputChannelTypes.contains(channelTypeID); + return SUPPORTED_OUTPUT_CHANNEL_TYPES.contains(channelTypeID); } @Activate @@ -229,19 +228,19 @@ protected void init() { } if (i == 2) { channelIDpre = HEATING; - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, TEMPERATURE_CONTROLLED)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, TEMPERATURE_CONTROLLED)); } - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, SWITCH)); - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, DIMMER)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, SWITCH)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, DIMMER)); if (i < 2) { - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, "2", STAGE)); - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, "3", STAGE)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, "2", STAGE)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, "3", STAGE)); } } channelIDpre = SHADE; - supportedOutputChannelTypes.add(channelIDpre); - supportedOutputChannelTypes.add(buildIdentifier(channelIDpre, ANGLE)); - supportedOutputChannelTypes.add(SCENE); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(channelIDpre); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(buildIdentifier(channelIDpre, ANGLE)); + SUPPORTED_OUTPUT_CHANNEL_TYPES.add(SCENE); } private String getSensorCategory(SensorEnum sensorType) { @@ -455,8 +454,8 @@ private static boolean stringContains(String string, String compare) { @Override public Collection<ChannelType> getChannelTypes(Locale locale) { - List<ChannelType> channelTypeList = new LinkedList<ChannelType>(); - for (String channelTypeId : supportedOutputChannelTypes) { + List<ChannelType> channelTypeList = new LinkedList<>(); + for (String channelTypeId : SUPPORTED_OUTPUT_CHANNEL_TYPES) { channelTypeList.add( getChannelType(new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, channelTypeId), locale)); } @@ -464,19 +463,16 @@ public Collection<ChannelType> getChannelTypes(Locale locale) { channelTypeList.add(getChannelType( new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, buildIdentifier(sensorType)), locale)); } - for (MeteringTypeEnum meteringType : MeteringTypeEnum.values()) { channelTypeList.add(getChannelType(new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, buildIdentifier(meteringType, MeteringUnitsEnum.WH)), locale)); channelTypeList.add(getChannelType(new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, buildIdentifier(TOTAL_PRE, meteringType, MeteringUnitsEnum.WH)), locale)); } - for (DeviceBinarayInputEnum binaryInput : DeviceBinarayInputEnum.values()) { channelTypeList.add(getChannelType(new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, buildIdentifier(BINARY_INPUT_PRE, binaryInput)), locale)); } - return channelTypeList; } @@ -491,7 +487,7 @@ public ChannelType getChannelType(ChannelTypeUID channelTypeUID, Locale locale) .withTags(getSimpleTags(channelID, locale)) .withStateDescription(getSensorStateDescription(sensorType)).build(); } catch (IllegalArgumentException e) { - if (supportedOutputChannelTypes.contains(channelID)) { + if (SUPPORTED_OUTPUT_CHANNEL_TYPES.contains(channelID)) { return ChannelTypeBuilder .state(channelTypeUID, getLabelText(channelID, locale), getItemType(channelID)) .withDescription(getDescText(channelID, locale)).withCategory(getCategory(channelID)) @@ -524,20 +520,7 @@ public ChannelType getChannelType(ChannelTypeUID channelTypeUID, Locale locale) // ignore } } - } - - return null; - - } - - @Override - public ChannelGroupType getChannelGroupType(ChannelGroupTypeUID channelGroupTypeUID, Locale locale) { - return null; - } - - @Override - public Collection<ChannelGroupType> getChannelGroupTypes(Locale locale) { return null; } diff --git a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsDeviceThingTypeProvider.java b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsDeviceThingTypeProvider.java index a495d55a6e803..f111f75a02963 100644 --- a/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsDeviceThingTypeProvider.java +++ b/bundles/org.openhab.binding.digitalstrom/src/main/java/org/openhab/binding/digitalstrom/internal/providers/DsDeviceThingTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/NOTICE b/bundles/org.openhab.binding.dlinksmarthome/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/NOTICE +++ b/bundles/org.openhab.binding.dlinksmarthome/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.dlinksmarthome/noEmbedDependencies.profile b/bundles/org.openhab.binding.dlinksmarthome/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.dlinksmarthome/pom.xml b/bundles/org.openhab.binding.dlinksmarthome/pom.xml index f2f2831333c1a..c383f5a91ab90 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/pom.xml +++ b/bundles/org.openhab.binding.dlinksmarthome/pom.xml @@ -1,38 +1,19 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.dlinksmarthome</artifactId> <name>openHAB Add-ons :: Bundles :: D-Link Smart Home Binding</name> - - <dependencies> - <!-- JAX-WS --> - <dependency> - <groupId>javax.xml.soap</groupId> - <artifactId>javax.xml.soap-api</artifactId> - <version>1.4.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sun.xml.ws</groupId> - <artifactId>jaxws-rt</artifactId> - <version>2.2.10</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.sun.xml.messaging.saaj</groupId> - <artifactId>saaj-impl</artifactId> - <version>1.5.1</version> - <scope>provided</scope> - </dependency> - </dependencies> + + <properties> + <bnd.importpackage>!javax.xml.soap, com.sun.xml.messaging.saaj.soap</bnd.importpackage> + </properties> </project> diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/feature/feature.xml b/bundles/org.openhab.binding.dlinksmarthome/src/main/feature/feature.xml index a95f5f643efd8..89ec4f621cdd8 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/feature/feature.xml @@ -1,16 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.dlinksmarthome-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-dlinksmarthome" description="D-Link Smart Home Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-mdns</feature> - <feature dependency="true">openhab.tp-jaxb</feature> - <feature prerequisite="true">wrap</feature> - <!-- JAX-WS (SOAP) bundles --> - <bundle dependency="true">mvn:javax.xml.soap/javax.xml.soap-api/1.4.0</bundle> - <bundle dependency="true">wrap:mvn:com.sun.xml.ws/jaxws-rt/2.2.10$Bundle-Name=JAX%20WS%20RI%20Runtime%20Bundle&Bundle-SymbolicName=com.sun.xml.ws.jaxws-rt&Bundle-Version=2.3.2</bundle> - <bundle dependency="true">mvn:com.sun.xml.messaging.saaj/saaj-impl/1.5.1</bundle> + <feature dependency="true">openhab.tp-jaxws</feature> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.dlinksmarthome/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkHNAPCommunication.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkHNAPCommunication.java index 41a245047c34e..42b1fc7fb1407 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkHNAPCommunication.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkHNAPCommunication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeBindingConstants.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeBindingConstants.java index f41c0e5f2cefe..cbde12f77aa51 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeBindingConstants.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeDiscoveryParticipant.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeDiscoveryParticipant.java index 6bd83467c5b77..96e0293a42e0b 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeHandlerFactory.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeHandlerFactory.java index eb120876c51cc..c98f1c1cea995 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeHandlerFactory.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/DLinkSmartHomeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/handler/DLinkMotionSensorHandler.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/handler/DLinkMotionSensorHandler.java index 6b1fce88dff0b..08e5f06fb1a84 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/handler/DLinkMotionSensorHandler.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/handler/DLinkMotionSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorCommunication.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorCommunication.java index e5af02631cfd5..df08ef3f28edc 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorCommunication.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorCommunication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorConfig.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorConfig.java index 64bc538260c8b..87f3627fa59e0 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorConfig.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorListener.java b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorListener.java index 194da19fb814d..a963136021743 100644 --- a/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorListener.java +++ b/bundles/org.openhab.binding.dlinksmarthome/src/main/java/org/openhab/binding/dlinksmarthome/internal/motionsensor/DLinkMotionSensorListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/NOTICE b/bundles/org.openhab.binding.dmx/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.dmx/NOTICE +++ b/bundles/org.openhab.binding.dmx/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.dmx/README.md b/bundles/org.openhab.binding.dmx/README.md index 5c60b9774c6b9..59be03274a560 100644 --- a/bundles/org.openhab.binding.dmx/README.md +++ b/bundles/org.openhab.binding.dmx/README.md @@ -34,11 +34,12 @@ Chaser things define a control channel that can be used to dynamically change th ## Discovery -Discovery is not supported at the moment. You have to add all bridges and things manually. +Discovery is not supported at the moment. +You have to add all bridges and things manually. ## Thing Configuration -Since the brightness perception of the human eye is not linear, all bridges support `applycurve`, a list of channels `applycurve` that have a CIE 1931 lightness correction (cf. [Poynton, C.A.: “Gamma†and its Disguises: The Nonlinear Mappings of Intensity in Perception, CRTs, Film and Video, SMPTE Journal Dec. 1993, pp. 1099 - 1108](http://www.poynton.com/PDFs/SMPTE93_Gamma.pdf)) applied. +Since the brightness perception of the human eye is not linear, all bridges support `applycurve`, a list of channels `applycurve` that have a CIE 1931 lightness correction (cf. [Poynton, C.A.: “Gamma†and its Disguises: The Nonlinear Mappings of Intensity in Perception, CRTs, Film and Video, SMPTE Journal Dec. 1993, pp. 1099 - 1108](https://www.poynton.com/PDFs/SMPTE93_Gamma.pdf)) applied. This list follows the format of the thing channel definition. This is used regardless of the thing(s) that are associated to the channel. @@ -204,7 +205,8 @@ The next `ON` command uses these values instead of the default (or configuration |switch |chaser |Switch | turns the chaser ON or OFF | |mute |(all bridges) |Switch | mutes the DMX output of the bridge | -*Note:* the string send to the control channel of chaser things has to be formatted like the `steps` configuration of the chaser thing. If the new string is invalid, the old configuration will be used. +*Note:* the string send to the control channel of chaser things has to be formatted like the `steps` configuration of the chaser thing. +If the new string is invalid, the old configuration will be used. ## Rule Actions @@ -227,7 +229,7 @@ Defining more than one step in `fadeString` is supported, too. ## Full Example -This example defines a sACN/E1.31 bridge in unicast mode which transmits universe 2 and three things: a three channel dimmer used to control a RGB light, which takes 1s to fade from one color to another and 10s from 0-100% on incremental dim commands, a single channel dimmer which will turn on only to 90% if it receives a ON command and does not fully switch off (to 10%) if it receives an OFF command and chaser which changes the colors like a traffic light. +This example defines a sACN/E1.31 bridge in unicast mode which transmits universe 2 and three things: a three channel dimmer used to control a RGB light, which takes 1s to fade from one color to another and 10s from 0-100% on incremental dim commands, a single channel dimmer which will turn on only to 90% if it receives an ON command and does not fully switch off (to 10%) if it receives an OFF command and chaser which changes the colors like a traffic light. ### demo.things: diff --git a/bundles/org.openhab.binding.dmx/pom.xml b/bundles/org.openhab.binding.dmx/pom.xml index 2764a889f0c1f..b784130b1848c 100644 --- a/bundles/org.openhab.binding.dmx/pom.xml +++ b/bundles/org.openhab.binding.dmx/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.dmx</artifactId> diff --git a/bundles/org.openhab.binding.dmx/src/main/feature/feature.xml b/bundles/org.openhab.binding.dmx/src/main/feature/feature.xml index a471955568370..44ef74cf2fc1a 100644 --- a/bundles/org.openhab.binding.dmx/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dmx/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.dmx-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-dmx" description="DMX Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/action/DmxActions.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/action/DmxActions.java index fa0f7508abc52..942b96c56bf47 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/action/DmxActions.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/action/DmxActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBindingConstants.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBindingConstants.java index 2422e37b95440..70c90665f5a04 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBindingConstants.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBridgeHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBridgeHandler.java index d66930aa191cc..115cd6f8f66ff 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBridgeHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxHandlerFactory.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxHandlerFactory.java index 714c5843c9b2e..4a1497bddd8c3 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxHandlerFactory.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxThingHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxThingHandler.java index a4c6112fee16e..2f274a9f345e8 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxThingHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/DmxThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/Util.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/Util.java index 3deadc7ca0f43..cc8d5e9c60435 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/Util.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/Util.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/ValueSet.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/ValueSet.java index c49711af85f16..2c696a1363db3 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/ValueSet.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/ValueSet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ActionState.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ActionState.java index fef5ea31ad689..2a5a8275cd41e 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ActionState.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ActionState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/BaseAction.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/BaseAction.java index a9e6ae76eea79..6bf1137517462 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/BaseAction.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/BaseAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeAction.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeAction.java index 074b5afc757f8..a761f1e7d588b 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeAction.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeDirection.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeDirection.java index 621f7fda3748b..adb22183ae3c9 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeDirection.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/FadeDirection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ResumeAction.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ResumeAction.java index 29cd14c77090d..71defc48f77ca 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ResumeAction.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/action/ResumeAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ArtnetBridgeHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ArtnetBridgeHandlerConfiguration.java index 76790110cc11b..4ed099f8f674e 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ArtnetBridgeHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ArtnetBridgeHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ChaserThingHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ChaserThingHandlerConfiguration.java index 1b1f00ee60d4b..618e3c7cd83cf 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ChaserThingHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ChaserThingHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ColorThingHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ColorThingHandlerConfiguration.java index e1cd9cd0810b7..3cff3754092c0 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ColorThingHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/ColorThingHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DimmerThingHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DimmerThingHandlerConfiguration.java index de17de0d0c8c2..9dad4aafcd39f 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DimmerThingHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DimmerThingHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DmxBridgeHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DmxBridgeHandlerConfiguration.java index a5646cc248066..2cf648879e85b 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DmxBridgeHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/DmxBridgeHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/Lib485BridgeHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/Lib485BridgeHandlerConfiguration.java index 42ae3faeba356..787ad1163f0f2 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/Lib485BridgeHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/Lib485BridgeHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/SacnBridgeHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/SacnBridgeHandlerConfiguration.java index ba87a4628f843..9a0fd927e0351 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/SacnBridgeHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/SacnBridgeHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/TunableWhiteThingHandlerConfiguration.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/TunableWhiteThingHandlerConfiguration.java index ea905c0ee3d9b..461d9db5f1045 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/TunableWhiteThingHandlerConfiguration.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/config/TunableWhiteThingHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetNode.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetNode.java index a867c17314038..31ddb811120cb 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetNode.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetNode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetPacket.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetPacket.java index 9278c75cac63c..6e13bb9a57911 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetPacket.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/ArtnetPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetHandler.java index 6ddc13cb1099f..e0603383b117d 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetPacket.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetPacket.java index e067968c5ef44..d2b88598b7360 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetPacket.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/DmxOverEthernetPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java index 55e6e5875fd75..d347db5439fcf 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnNode.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnNode.java index f994f7dd354d4..c0254a62a132b 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnNode.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnNode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnPacket.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnPacket.java index e746d8e411d4a..58957ffe9a5a4 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnPacket.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/SacnPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandler.java index 513f6d16351a2..037524006258e 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandler.java index e92c91a46ea22..9e6fe2f8f9477 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ColorThingHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ColorThingHandler.java index 71c89032561ba..74b456a8b732b 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ColorThingHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/ColorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandler.java index a53b9898b1f39..c723005e4d854 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandler.java index 682a22cd6693a..61570ac3aa3a9 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandler.java index 05a92379d2c3b..71803b9626ad0 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandler.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandler.java index 38dafbf59bfe0..42bcabcfbabc9 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandler.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/BaseDmxChannel.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/BaseDmxChannel.java index 96c1b607501c1..a528d1b4317b1 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/BaseDmxChannel.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/BaseDmxChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/DmxChannel.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/DmxChannel.java index 5b4ea5d15da52..1cd08c2401239 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/DmxChannel.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/DmxChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/Universe.java b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/Universe.java index 03a70655fe2aa..c82f5c5d7a6a9 100644 --- a/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/Universe.java +++ b/bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/multiverse/Universe.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/artnet-bridge.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/artnet-bridge.xml index 4e3bd1258bcf7..e74d37cbe7116 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/artnet-bridge.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/artnet-bridge.xml @@ -24,7 +24,7 @@ <default>0</default> </parameter> <parameter name="refreshmode" type="text"> - <label>Refresh mode</label> + <label>Refresh Mode</label> <description>Suppress re-transmission and refresh every 800ms or send every packet.</description> <options> <option value="always">Always</option> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/channels.xml index 2472bb58560f1..77955368c244a 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/channels.xml @@ -13,7 +13,7 @@ <!-- Color Temperature --> <channel-type id="color_temperature"> <item-type>Dimmer</item-type> - <label>Color temperature</label> + <label>Color Temperature</label> <description>Relative intensity of two adjacent DMX channels</description> <category>ColorLight</category> <tags> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/chaser-thing.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/chaser-thing.xml index 375d6c324b017..7daa425457294 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/chaser-thing.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/chaser-thing.xml @@ -15,18 +15,18 @@ </channels> <config-description> <parameter name="dmxid" type="text"> - <label>DMX channel configuration</label> + <label>DMX Channel Configuration</label> <description>Format is channel[,channel, ...] or channel[/width]</description> <required>true</required> </parameter> <parameter name="resumeafter" type="boolean"> - <label>Resume after finish</label> + <label>Resume After Finish</label> <description>resume old actions after this completes</description> <default>false</default> <required>false</required> </parameter> <parameter name="steps" type="text"> - <label>Step configuration</label> + <label>Step Configuration</label> <description>fadeTime:value[, ...]:holdTime </description> <required>true</required> </parameter> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/color-thing.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/color-thing.xml index deb7bafc5521b..47043bbbd7b79 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/color-thing.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/color-thing.xml @@ -17,28 +17,28 @@ </channels> <config-description> <parameter name="dmxid" type="text"> - <label>DMX channel configuration</label> + <label>DMX Channel Configuration</label> <description>Format is channel[,channel, ...] or channel[/width], has to be multiple of three</description> <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>0</default> </parameter> <parameter name="dimtime" type="integer" min="0"> - <label>Dim time</label> + <label>Dim Time</label> <description>Time in ms for dimming from 0-100%</description> <default>0</default> </parameter> <parameter name="turnonvalue" type="text"> - <label>Turn-On value(s)</label> + <label>Turn-On Value(s)</label> <description>Format is "value[, value, ...]", has to be a multiple of three. If less values than channels are defined, they are reused from the beginning.</description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="turnoffvalue" type="text"> - <label>Turn-Off value(s)</label> + <label>Turn-Off Value(s)</label> <description>Format is "value[, value, ...]", has to be a multiple of three. If less values than channels are defined, they are reused from the beginning.</description> <advanced>true</advanced> </parameter> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/dimmer-thing.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/dimmer-thing.xml index dd71853aede6b..a7ebf222281e9 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/dimmer-thing.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/dimmer-thing.xml @@ -17,28 +17,28 @@ </channels> <config-description> <parameter name="dmxid" type="text"> - <label>DMX channel configuration</label> + <label>DMX Channel Configuration</label> <description>Format is channel[,channel, ...] or channel[/width]</description> <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>0</default> </parameter> <parameter name="dimtime" type="integer" min="0"> - <label>Dim time</label> + <label>Dim Time</label> <description>Time in ms for dimming from 0-100%</description> <default>0</default> </parameter> <parameter name="turnonvalue" type="text"> - <label>Turn-On value(s)</label> + <label>Turn-On Value(s)</label> <description>Format is "value[, value, ...]". If less values than channels are defined, they are reused from the beginning. </description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="turnoffvalue" type="text"> - <label>Turn-Off value(s)</label> + <label>Turn-Off Value(s)</label> <description>Format is "value[, value, ...]". If less values than channels are defined, they are reused from the beginning. </description> <advanced>true</advanced> </parameter> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/sacn-bridge.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/sacn-bridge.xml index 38f8e434b67ea..634133cf29cf8 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/sacn-bridge.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/sacn-bridge.xml @@ -37,7 +37,7 @@ <required>false</required> </parameter> <parameter name="refreshmode" type="text"> - <label>Refresh mode</label> + <label>Refresh Mode</label> <description>Suppress re-transmission and refresh every 800ms or send every packet.</description> <required>false</required> <options> diff --git a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/tunablewhite-thing.xml b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/tunablewhite-thing.xml index 6dd3df15118b9..d676c1cbe0d31 100644 --- a/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/tunablewhite-thing.xml +++ b/bundles/org.openhab.binding.dmx/src/main/resources/ESH-INF/thing/tunablewhite-thing.xml @@ -17,28 +17,28 @@ </channels> <config-description> <parameter name="dmxid" type="text"> - <label>DMX channel configuration</label> + <label>DMX Channel Configuration</label> <description>Format is channel[,channel, ...] or channel[/width], has to be an even number</description> <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>0</default> </parameter> <parameter name="dimtime" type="integer" min="0"> - <label>Dim time</label> + <label>Dim Time</label> <description>Time in ms for dimming from 0-100%</description> <default>0</default> </parameter> <parameter name="turnonvalue" type="text"> - <label>Turn-On value(s)</label> + <label>Turn-On Value(s)</label> <description>Format is "value[, value, ...]", has to be a multiple of two. If less values than channels are defined, they are reused from the beginning. </description> <required>false</required> <advanced>true</advanced> </parameter> <parameter name="turnoffvalue" type="text"> - <label>Turn-Off value(s)</label> + <label>Turn-Off Value(s)</label> <description>Format is "value[, value, ...]", has to be a multiple of two. If less values than channels are defined, they are reused from the beginning. </description> <advanced>true</advanced> </parameter> diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/FadeActionTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/FadeActionTest.java index 6258226f0dbde..643edc7fd9f35 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/FadeActionTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/FadeActionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/UtilTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/UtilTest.java index eea278d36df46..5de9678c250e9 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/UtilTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/UtilTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/ValueSetTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/ValueSetTest.java index 8f894cb2a18fa..46b552968645f 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/ValueSetTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/ValueSetTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandlerTest.java index 4e85829108daa..403347b1eac2a 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ArtnetBridgeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandlerTest.java index 05c766c2331d5..fc935469d057b 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ChaserThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ColorThingHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ColorThingHandlerTest.java index 74673dc73a5b3..022a52491684a 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ColorThingHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/ColorThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandlerTest.java index d054575b25667..1d9df89c78d12 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DimmerThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DmxBridgeHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DmxBridgeHandlerTest.java index da19d958451e1..307ac25127bfd 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DmxBridgeHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/DmxBridgeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandlerTest.java index 57b95894c6855..9adf10eafd556 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/Lib485BridgeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandlerTest.java index 85c07fec30e89..8d5c1bb0428ef 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/SacnBridgeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandlerTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandlerTest.java index e8c1018cd3a68..315c857caabda 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandlerTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/handler/TunableWhiteThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/BaseChannelTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/BaseChannelTest.java index 2245bf698954e..f1e1e507374cf 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/BaseChannelTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/BaseChannelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/DmxChannelTest.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/DmxChannelTest.java index 9d229bed65c93..7d642e6420272 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/DmxChannelTest.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/internal/multiverse/DmxChannelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/AbstractDmxThingTestParent.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/AbstractDmxThingTestParent.java index a674009caac50..a46274a72cff6 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/AbstractDmxThingTestParent.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/AbstractDmxThingTestParent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/TestBridgeHandler.java b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/TestBridgeHandler.java index 0b578198b7772..f643a2506983c 100644 --- a/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/TestBridgeHandler.java +++ b/bundles/org.openhab.binding.dmx/src/test/java/org/openhab/binding/dmx/test/TestBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.doorbird/.classpath b/bundles/org.openhab.binding.doorbird/.classpath new file mode 100644 index 0000000000000..ffcab154155c7 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/.classpath @@ -0,0 +1,33 @@ +<?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> diff --git a/bundles/org.openhab.binding.doorbird/.project b/bundles/org.openhab.binding.doorbird/.project new file mode 100644 index 0000000000000..0d02c43eefc3d --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.doorbird</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> diff --git a/bundles/org.openhab.binding.toon/NOTICE b/bundles/org.openhab.binding.doorbird/NOTICE similarity index 88% rename from bundles/org.openhab.binding.toon/NOTICE rename to bundles/org.openhab.binding.doorbird/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.toon/NOTICE +++ b/bundles/org.openhab.binding.doorbird/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.doorbird/README.md b/bundles/org.openhab.binding.doorbird/README.md new file mode 100644 index 0000000000000..62f29a3d8b90f --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/README.md @@ -0,0 +1,250 @@ +# Doorbird Binding + +Binding for Doorbird D101 and D210x video doorbells. + +## Supported Things + +Two thing types are supported: + +- Doorbird D101 +- Doorbird D210x + +## Discovery + +Auto-discovery is not supported at this time. + +## Thing Configuration + +The following configuration parameters are available on the Doorbird thing: + +| Parameter | Required/Optional | Description | +|--------------------------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ID | Required | The ID number of the Doorbird device. This is usually a single digit (e.g. 1). | +| Hostname | Required | The hostname or IP address of the Doorbird device. | +| User ID | Required | User Id of a Doorbird user that has permissions to access the camera, motion sensor, etc. The User ID and Password must be created using the Doorbird smart phone application. | +| Password | Required | Password of a Doorbird user. | +| Image Refresh Rate | Optional | Rate at which image channel should be automatically updated. Leave field blank (default) to disable refresh. | +| Doorbell Off Delay | Optional | Number of seconds to wait before setting doorbell channel OFF after a doorbell event. Leave field blank to disable. | +| Motion Off Delay | Optional | Number of seconds to wait before setting motion channel OFF after a motion event. Leave field blank to disable. | +| Montage Number of Images | Required | Number of images to include in the doorbell and motion montage images. Default is 0. | +| Montage Scale Factor | Required | Percent scaling factor for montage image. Default is 100. | + + +## Channels + +The following channels are supported by the binding. + +| Channel ID | Item Type | Description | +|--------------------------|-----------|---------------------------------------------------| +| doorbell | Trigger | Generates PRESSED event when doorbell is pressed | +| doorbellTimestamp | DateTime | Timestamp when doorbell was pressed | +| doorbellImage | Image | Image captured when the doorbell was pressed | +| doorbellHistoryIndex | Number | Index of historical image for doorbell press | +| doorbellHistoryTimestamp | DateTime | Time when doorbell was pressed for history image | +| doorbellHistoryImage | Image | Historical image for doorbell press | +| doorbellMontage | Image | Concatenation of first n doorbell history images | +| motion | Switch | Changes to ON when the device detects motion | +| motionTimestamp | DateTime | Timestamp when motion sensor was triggered | +| motionImage | Image | Image captured when motion was detected | +| motionHistoryIndex | Number | Index of Historical image for motion | +| motionHistoryTimestamp | DateTime | Time when motion was detected for history image | +| motionHistoryImage | Image | Historical image for motion sensor | +| motionMontage | Image | Concatenation of first n motion history images | +| light | Switch | Activates the light relay | +| openDoor1 | Switch | Activates the door 1 relay | +| openDoor2 | Switch | Activates the door 2 relay (D210x only) | +| image | Image | Image from the doorbird camera | +| imageTimestamp | DateTime | Time when image was captured from device | + +## Profiles + +Using the system default switch profile *rawbutton-on-off-switch* in a *doorbell* channel item definition will cause ON/OFF +states to be set when the doorbell is pressed and released. +See *Items* example below. + +## Rule Actions + +The binding supports the following actions. +In classic rules these are accessible as shown in this example (adjust getActions with your ThingId): + +### restart() + +Restarts the Doorbird device. + +### sipHangup() + +Hangs up a SIP call. + +Example + +``` +val actions = getActions("doorbird","doorbird:d101:doorbell") +if(actions === null) { + logInfo("actions", "Actions not found, check thing ID") + return + } + actions.sipHangup() + ``` + +## Known Issues + +The Doorbird uses the UDP protocol on port 6524 to broadcast events for Doorbird actions, such as doorbell pressed, motion detected, etc. +If the Doorbord is on a separate subnet or VLAN from openHAB, those UDP packets will not route by default. +In that case, the Doorbird binding will not receive those events. +Either put the Doorbird and openHAB on the same subnet/VLAN, or set up your network to explicitly route those UDP packets. + +## Full Example + +### Things + +``` +Thing doorbird:d101:doorbell Doorbird D101 + [ + doorbirdId="1", + doorbirdHost="192.168.1.100", + userId="dtfubb0004", + userPassword="HG7afc5TvN", + imageRefreshRate=60, + doorbellOffDelay=3, + motionOffDelay=30, + montageNumImages=3, + montageScaleFactor=35 + ] +``` + +### Items + +``` +Switch Doorbell_Pressed + "Doorbell Pressed [%s]" + <switch> + ["Switch"] + { channel="doorbird:d101:doorbell:doorbell" [profile="rawbutton-on-off-switch"] } + +DateTime Doorbell_PressedTimestamp + "Doorbell Pressed Timestamp [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" + <time> + { channel="doorbird:d101:doorbell:doorbellTimestamp" } + +Image Doorbell_PressedImage + "Doorbell Pressed Image [%s]" + { channel="doorbird:d101:doorbell:doorbellImage" } + +Switch Doorbell_Motion + "Doorbell Motion [%s]" + <switch> + ["Switch"] + { channel="doorbird:d101:doorbell:motion" } + +DateTime Doorbell_MotionTimestamp + "Doorbell Motion Timestamp [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" + <time> + { channel="doorbird:d101:doorbell:motionTimestamp" } + +Image Doorbell_MotionDetectedImage + "Motion Detected Image [%s]" + { channel="doorbird:d101:doorbell:motionImage" } + +Switch Doorbell_Light + "Doorbell Light [%s]" + <switch> + ["Switch"] + { channel="doorbird:d101:doorbell:light", expire="5s,command=OFF" } + +Switch Doorbell_OpenDoor1 + "Doorbell Open Door 1 [%s]" + <switch> + ["Switch"] + { channel="doorbird:d101:doorbell:openDoor1", expire="5s,command=OFF" } + +Image Doorbell_Image + "Doorbell Image [%s]" + { channel="doorbird:d101:doorbell:image" } + +Number Doorbell_DoorbellHistoryIndex + "Doorbell History Index [%.0f]" + <none> + { channel="doorbird:d101:doorbell:doorbellHistoryIndex" } + +DateTime Doorbell_DoorbellHistoryTimestamp + "Doorbell History Timestamp [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" + <time> + { channel="doorbird:d101:doorbell:doorbellHistoryTimestamp" } + +Image Doorbell_DoorbellHistoryImage + "Doorbell History Image [%s]" + { channel="doorbird:d101:doorbell:doorbellHistoryImage" } + +Number Doorbell_MotionHistoryIndex + "Motion History Index [%.0f]" + <none> + { channel="doorbird:d101:doorbell:motionHistoryIndex" } + +DateTime Doorbell_MotionHistoryTimestamp + "Motion History Timestamp [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" + <time> + { channel="doorbird:d101:doorbell:motionHistoryTimestamp" } + +Image Doorbell_MotionHistoryImage + "Motion History Image [%s]" + { channel="doorbird:d101:doorbell:motionHistoryImage" } + +Image Doorbell_DoorbellMontage + "Doorbell History Montage [%s]" + { channel="doorbird:d101:doorbell:doorbellMontage" } + +Image Doorbell_MotionMontage + "Motion History Montage [%s]" + { channel="doorbird:d101:doorbell:motionMontage" } +``` + +### Sitemap + +``` +Frame { + Text label="Doorbird" { + Frame label="Image" { + Image item=Doorbell_Image + } + Frame label="Events" { + Text item=Doorbell_Pressed + Text item=Doorbell_PressedTimestamp + Image item=Doorbell_PressedImage + Text item=Doorbell_Motion + Text item=Doorbell_MotionTimestamp + Image item=Doorbell_MotionImage + } + Frame label="Actions" { + Switch item=Doorbell_OpenDoor1 + Switch item=Doorbell_Light + } + Frame label="History" { + Setpoint item=Doorbell_DoorbellHistoryIndex minValue=1 maxValue=50 step=1 + Switch item=Doorbell_DoorbellHistoryIndex label="Reset Index []" mappings=[1="Reset"] + Text item=Doorbell_DoorbellHistoryTimestamp + Image item=Doorbell_DoorbellHistoryImage + Setpoint item=Doorbell_MotionHistoryIndex minValue=1 maxValue=50 step=1 + Switch item=Doorbell_MotionHistoryIndex label="Reset Index []" mappings=[1="Reset"] + Text item=Doorbell_MotionHistoryTimestamp + Image item=Doorbell_MotionHistoryImage + } + Frame label="Doorbell Montage" { + Image item=Doorbell_DoorbellMontage + } + Frame label="Motion Montage" { + Image item=Doorbell_MotionMontage + } + } +} +``` + +### Rule + +``` +rule "Doorbell Button Pressed" +when + Channel "doorbird:d101:doorbell:doorbell" triggered PRESSED +then + // Do something when the doorbell is pressed +end +``` diff --git a/bundles/org.openhab.binding.doorbird/pom.xml b/bundles/org.openhab.binding.doorbird/pom.xml new file mode 100644 index 0000000000000..6109a4032e23c --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/pom.xml @@ -0,0 +1,34 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.doorbird</artifactId> + + <name>openHAB Add-ons :: Bundles :: Doorbird Binding</name> + + <properties> + <dep.noembedding>jna</dep.noembedding> + </properties> + + <dependencies> + <dependency> + <groupId>com.goterl.lazycode</groupId> + <artifactId>lazysodium-java</artifactId> + <version>4.0.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>net.java.dev.jna</groupId> + <artifactId>jna</artifactId> + <version>5.4.0</version> + <scope>compile</scope> + </dependency> + </dependencies> + +</project> diff --git a/bundles/org.openhab.binding.doorbird/src/main/feature/feature.xml b/bundles/org.openhab.binding.doorbird/src/main/feature/feature.xml new file mode 100644 index 0000000000000..6091fb9054fca --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/feature/feature.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.doorbird-${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-doorbird" description="Doorbird Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <feature>openhab-runtime-jna</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.doorbird/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/action/DoorbirdActions.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/action/DoorbirdActions.java new file mode 100644 index 0000000000000..28f0e90367709 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/action/DoorbirdActions.java @@ -0,0 +1,88 @@ +/** + * 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.doorbird.action; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.binding.ThingActions; +import org.eclipse.smarthome.core.thing.binding.ThingActionsScope; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.openhab.binding.doorbird.internal.DoorbirdHandler; +import org.openhab.core.automation.annotation.RuleAction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link DoorbirdActions} defines rule actions for the doorbird binding. + * + * @author Mark Hilbush - Initial contribution + */ +@ThingActionsScope(name = "doorbird") +@NonNullByDefault +public class DoorbirdActions implements ThingActions { + private final static Logger logger = LoggerFactory.getLogger(DoorbirdActions.class); + + private @Nullable DoorbirdHandler handler; + + public DoorbirdActions() { + logger.debug("Doorbird actions service created"); + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof DoorbirdHandler) { + this.handler = (DoorbirdHandler) handler; + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return this.handler; + } + + @RuleAction(label = "Restart Doorbird", description = "restarts the Doorbird device") + public void restart() { + logger.debug("Doorbird action 'restart' called"); + if (handler != null) { + handler.actionRestart(); + } else { + logger.info("Doorbird Action service ThingHandler is null!"); + } + } + + public static void restart(@Nullable ThingActions actions) { + if (actions instanceof DoorbirdActions) { + ((DoorbirdActions) actions).restart(); + } else { + throw new IllegalArgumentException("Instance is not a DoorbirdActionsService class"); + } + } + + @RuleAction(label = "SIP Hangup", description = "hangup SIP call") + public void sipHangup() { + logger.debug("Doorbird action 'sipHangup' called"); + if (handler != null) { + handler.actionSIPHangup(); + } else { + logger.info("Doorbird Action service ThingHandler is null!"); + } + } + + public static void sipHangup(@Nullable ThingActions actions) { + if (actions instanceof DoorbirdActions) { + ((DoorbirdActions) actions).sipHangup(); + } else { + throw new IllegalArgumentException("Instance is not a DoorbirdActionsService class"); + } + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdBindingConstants.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdBindingConstants.java new file mode 100644 index 0000000000000..799e16c78dfd0 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdBindingConstants.java @@ -0,0 +1,59 @@ +/** + * 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.doorbird.internal; + +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 {@link DoorbirdBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class DoorbirdBindingConstants { + public static final String BINDING_ID = "doorbird"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_D101 = new ThingTypeUID(BINDING_ID, "d101"); + public static final ThingTypeUID THING_TYPE_D210X = new ThingTypeUID(BINDING_ID, "d210x"); + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream.of(THING_TYPE_D101, THING_TYPE_D210X) + .collect(Collectors.toSet()); + + // List of all Channel IDs + public static final String CHANNEL_DOORBELL = "doorbell"; + public static final String CHANNEL_DOORBELL_TIMESTAMP = "doorbellTimestamp"; + public static final String CHANNEL_DOORBELL_IMAGE = "doorbellImage"; + public static final String CHANNEL_MOTION = "motion"; + public static final String CHANNEL_MOTION_TIMESTAMP = "motionTimestamp"; + public static final String CHANNEL_MOTION_IMAGE = "motionImage"; + public static final String CHANNEL_LIGHT = "light"; + public static final String CHANNEL_OPENDOOR1 = "openDoor1"; + public static final String CHANNEL_OPENDOOR2 = "openDoor2"; + public static final String CHANNEL_IMAGE = "image"; + public static final String CHANNEL_IMAGE_TIMESTAMP = "imageTimestamp"; + public static final String CHANNEL_DOORBELL_HISTORY_INDEX = "doorbellHistoryIndex"; + public static final String CHANNEL_DOORBELL_HISTORY_IMAGE = "doorbellHistoryImage"; + public static final String CHANNEL_DOORBELL_HISTORY_TIMESTAMP = "doorbellHistoryTimestamp"; + public static final String CHANNEL_MOTION_HISTORY_INDEX = "motionHistoryIndex"; + public static final String CHANNEL_MOTION_HISTORY_IMAGE = "motionHistoryImage"; + public static final String CHANNEL_MOTION_HISTORY_TIMESTAMP = "motionHistoryTimestamp"; + public static final String CHANNEL_DOORBELL_IMAGE_MONTAGE = "doorbellMontage"; + public static final String CHANNEL_MOTION_IMAGE_MONTAGE = "motionMontage"; +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdConfiguration.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdConfiguration.java new file mode 100644 index 0000000000000..715d88709dd6a --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdConfiguration.java @@ -0,0 +1,65 @@ +/** + * 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.doorbird.internal; + +/** + * The {@link DoorbirdConfig} class contains fields mapping thing configuration parameters. + * + * @author Mark Hilbush - Initial contribution + */ +public class DoorbirdConfiguration { + /** + * Doorbird ID must match the ID returned in UDP events + */ + public String doorbirdId; + + /** + * Hostname or IP address of doorbell + */ + public String doorbirdHost; + + /** + * User ID used for API requests + */ + public String userId; + + /** + * Password used in API requests, and to decrypt doorbird events + */ + public String userPassword; + + /** + * Rate at which image channel will be updated + */ + public Integer imageRefreshRate; + + /** + * Delay to set doorbell channel OFF after doorbell event + */ + public Integer doorbellOffDelay; + + /** + * Delay to set motion channel OFF after motion event + */ + public Integer motionOffDelay; + + /** + * Number of images in doorbell and motion montages + */ + public Integer montageNumImages; + + /** + * Scale factor for montages + */ + public Integer montageScaleFactor; +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandler.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandler.java new file mode 100644 index 0000000000000..f0bf59e169f7c --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandler.java @@ -0,0 +1,615 @@ +/** + * 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.doorbird.internal; + +import static org.openhab.binding.doorbird.internal.DoorbirdBindingConstants.*; + +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.Instant; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Collection; +import java.util.Collections; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import javax.imageio.ImageIO; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.smarthome.core.common.ThreadPoolManager; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.RawType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.CommonTriggerEvents; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.eclipse.smarthome.io.net.http.HttpRequestBuilder; +import org.openhab.binding.doorbird.action.DoorbirdActions; +import org.openhab.binding.doorbird.internal.listener.DoorbirdUdpListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link DoorbirdHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class DoorbirdHandler extends BaseThingHandler { + private static final long API_REQUEST_TIMEOUT_SECONDS = 3L; + private static final long MONTAGE_UPDATE_DELAY_SECONDS = 5L; + + // Maximum number of doorbell and motion history images stored on Doorbird backend + private static final int MAX_HISTORY_IMAGES = 50; + + private final Logger logger = LoggerFactory.getLogger(DoorbirdHandler.class); + + // Get a dedicated threadpool for the long-running listener thread + private final ScheduledExecutorService doorbirdScheduler = ThreadPoolManager.getScheduledPool("doorbirdHandler"); + private @Nullable ScheduledFuture<?> listenerJob; + private final DoorbirdUdpListener udpListener; + + private @Nullable ScheduledFuture<?> imageRefreshJob; + private @Nullable ScheduledFuture<?> doorbellOffJob; + private @Nullable ScheduledFuture<?> motionOffJob; + + private @NonNullByDefault({}) DoorbirdConfiguration config; + + private @Nullable String authorization; + + private final TimeZoneProvider timeZoneProvider; + private final HttpClient httpClient; + + public DoorbirdHandler(Thing thing, TimeZoneProvider timeZoneProvider, HttpClient httpClient) { + super(thing); + this.timeZoneProvider = timeZoneProvider; + this.httpClient = httpClient; + udpListener = new DoorbirdUdpListener(this); + } + + @Override + public void initialize() { + updateStatus(ThingStatus.UNKNOWN); + + config = getConfigAs(DoorbirdConfiguration.class); + if (StringUtils.isEmpty(config.doorbirdId)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Doorbird id not provided"); + return; + } + if (StringUtils.isEmpty(config.doorbirdHost)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Doorbird host not provided"); + return; + } + if (StringUtils.isEmpty(config.userId)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "User ID not provided"); + return; + } + if (StringUtils.isEmpty(config.userPassword)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "User password not provided"); + return; + } + // Create the basic authorization string for the HTTP requests + authorization = new String(Base64.getEncoder().encode((config.userId + ":" + config.userPassword).getBytes()), + StandardCharsets.UTF_8); + + startImageRefreshJob(); + startUDPListenerJob(); + } + + @Override + public void dispose() { + stopUDPListenerJob(); + stopImageRefreshJob(); + stopDoorbellOffJob(); + stopMotionOffJob(); + } + + // Callback used by listener to get Doorbird host name + public @Nullable String getDoorbirdHost() { + return config.doorbirdHost; + } + + // Callback used by listener to get Doorbird password + public @Nullable String getUserId() { + return config.userId; + } + + // Callback used by listener to get Doorbird password + public @Nullable String getUserPassword() { + return config.userPassword; + } + + // Callback used by listener to update doorbell channel + public void updateDoorbellChannel(long timestamp) { + logger.debug("Handler: Update DOORBELL channels for thing {}", getThing().getUID()); + DoorbirdImage dbImage = downloadImage(buildUrl("/bha-api/image.cgi")); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(CHANNEL_DOORBELL_IMAGE, image != null ? image : UnDefType.UNDEF); + updateState(CHANNEL_DOORBELL_TIMESTAMP, getLocalDateTimeType(dbImage.getTimestamp())); + } + triggerChannel(CHANNEL_DOORBELL, CommonTriggerEvents.PRESSED); + startDoorbellOffJob(); + updateDoorbellMontage(); + } + + // Callback used by listener to update motion channel + public void updateMotionChannel(long timestamp) { + logger.debug("Handler: Update MOTION channels for thing {}", getThing().getUID()); + DoorbirdImage dbImage = downloadImage(buildUrl("/bha-api/image.cgi")); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(CHANNEL_MOTION_IMAGE, image != null ? image : UnDefType.UNDEF); + updateState(CHANNEL_MOTION_TIMESTAMP, getLocalDateTimeType(dbImage.getTimestamp())); + } + updateState(CHANNEL_MOTION, OnOffType.ON); + startMotionOffJob(); + updateMotionMontage(); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("Got command {} for channel {} of thing {}", command, channelUID, getThing().getUID()); + + switch (channelUID.getId()) { + case CHANNEL_DOORBELL_IMAGE: + if (command instanceof RefreshType) { + refreshDoorbellImageFromHistory(); + } + break; + case CHANNEL_MOTION_IMAGE: + if (command instanceof RefreshType) { + refreshMotionImageFromHistory(); + } + break; + case CHANNEL_LIGHT: + handleLight(command); + break; + case CHANNEL_OPENDOOR1: + handleOpenDoor(command, "1"); + break; + case CHANNEL_OPENDOOR2: + handleOpenDoor(command, "2"); + break; + case CHANNEL_IMAGE: + if (command instanceof RefreshType) { + handleGetImage(command); + } + break; + case CHANNEL_DOORBELL_HISTORY_INDEX: + case CHANNEL_MOTION_HISTORY_INDEX: + if (!(command instanceof RefreshType)) { + handleHistoryImage(channelUID, command); + } + break; + case CHANNEL_DOORBELL_IMAGE_MONTAGE: + if (command instanceof RefreshType) { + updateDoorbellMontage(); + } + break; + case CHANNEL_MOTION_IMAGE_MONTAGE: + if (command instanceof RefreshType) { + updateMotionMontage(); + } + break; + } + } + + private void refreshDoorbellImageFromHistory() { + logger.debug("Handler: REFRESH doorbell image channel using most recent doorbell history image"); + scheduler.execute(() -> { + String url = buildUrl("/bha-api/history.cgi", "?event=doorbell&index=1"); + DoorbirdImage dbImage = downloadImage(url); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(CHANNEL_DOORBELL_IMAGE, image != null ? image : UnDefType.UNDEF); + updateState(CHANNEL_DOORBELL_TIMESTAMP, getLocalDateTimeType(dbImage.getTimestamp())); + } + updateState(CHANNEL_DOORBELL, OnOffType.OFF); + }); + } + + private void refreshMotionImageFromHistory() { + logger.debug("Handler: REFRESH motion image channel using most recent motion history image"); + scheduler.execute(() -> { + String url = buildUrl("/bha-api/history.cgi", "?event=motionsensor&index=1"); + DoorbirdImage dbImage = downloadImage(url); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(CHANNEL_MOTION_IMAGE, image != null ? image : UnDefType.UNDEF); + updateState(CHANNEL_MOTION_TIMESTAMP, getLocalDateTimeType(dbImage.getTimestamp())); + } + updateState(CHANNEL_MOTION, OnOffType.OFF); + }); + } + + private void handleLight(Command command) { + if (command instanceof OnOffType && command.equals(OnOffType.ON)) { + String url = buildUrl("/bha-api/light-on.cgi"); + logger.debug("Turn light on using url={}", url); + try { + String response = executeGetRequest(url); + logger.debug("Response={}", response); + } catch (IOException e) { + logger.debug("IOException turning on light: {}", e.getMessage()); + } + } + } + + private void handleOpenDoor(Command command, String doorNumber) { + if (command instanceof OnOffType && command.equals(OnOffType.ON)) { + String url = buildUrl("/bha-api/open-door.cgi", "?r=" + doorNumber); + logger.debug("Open door using url={}", url); + try { + String response = executeGetRequest(url); + logger.debug("Response={}", response); + } catch (IOException e) { + logger.debug("IOException opening door: {}", e.getMessage()); + } + } + } + + public void actionRestart() { + String url = buildUrl("/bha-api/restart.cgi"); + logger.debug("Restart device using url={}", url); + try { + String response = executeGetRequest(url); + logger.debug("Response={}", response); + } catch (IOException e) { + logger.debug("IOException restarting device: {}", e.getMessage()); + } + } + + private void handleGetImage(Command command) { + if (command instanceof OnOffType && command.equals(OnOffType.ON)) { + scheduler.execute(() -> { + updateImageAndTimestamp(); + }); + } + } + + private void handleHistoryImage(ChannelUID channelUID, Command command) { + if (!(command instanceof DecimalType)) { + logger.debug("History index must be of type DecimalType"); + return; + } + int value = ((DecimalType) command).intValue(); + if (value < 0 || value > MAX_HISTORY_IMAGES) { + logger.debug("History index must be in range 1 to 50"); + return; + } + boolean isDoorbell = CHANNEL_DOORBELL_HISTORY_INDEX.equals(channelUID.getId()); + String event = isDoorbell ? "doorbell" : "motionsensor"; + String imageChannelId = isDoorbell ? CHANNEL_DOORBELL_HISTORY_IMAGE : CHANNEL_MOTION_HISTORY_IMAGE; + String timestampChannelId = isDoorbell ? CHANNEL_DOORBELL_HISTORY_TIMESTAMP : CHANNEL_MOTION_HISTORY_TIMESTAMP; + String url = buildUrl("/bha-api/history.cgi", "?event=" + event + "&index=" + command.toString()); + + DoorbirdImage dbImage = downloadImage(url); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(imageChannelId, image != null ? image : UnDefType.UNDEF); + updateState(timestampChannelId, getLocalDateTimeType(dbImage.getTimestamp())); + } + } + + public void actionSIPHangup() { + String url = buildUrl("/bha-api/sip.cgi", "?action=hangup"); + logger.debug("Hang up SIP call using url={}", url); + try { + String response = executeGetRequest(url); + logger.debug("Response={}", response); + } catch (IOException e) { + logger.debug("IOException hanging up SIP call: {}", e.getMessage()); + } + } + + private void startImageRefreshJob() { + Integer imageRefreshRate = config.imageRefreshRate; + if (imageRefreshRate != null) { + imageRefreshJob = scheduler.scheduleWithFixedDelay(() -> { + try { + updateImageAndTimestamp(); + } catch (RuntimeException e) { + logger.debug("Refresh image job got unhandled exception: {}", e.getMessage(), e); + } + }, 8L, imageRefreshRate, TimeUnit.SECONDS); + logger.debug("Scheduled job to refresh image channel every {} seconds", imageRefreshRate); + } + } + + private void stopImageRefreshJob() { + if (imageRefreshJob != null) { + imageRefreshJob.cancel(true); + imageRefreshJob = null; + logger.debug("Canceling image refresh job"); + } + } + + private void startUDPListenerJob() { + logger.debug("Scheduled listener job to start in 5 seconds"); + listenerJob = doorbirdScheduler.schedule(udpListener, 5, TimeUnit.SECONDS); + updateStatus(ThingStatus.ONLINE); + } + + private void stopUDPListenerJob() { + if (listenerJob != null) { + listenerJob.cancel(true); + udpListener.shutdown(); + logger.debug("Canceling listener job"); + } + } + + private void startDoorbellOffJob() { + Integer offDelay = config.doorbellOffDelay; + if (offDelay == null) { + return; + } + if (doorbellOffJob != null) { + doorbellOffJob.cancel(true); + } + doorbellOffJob = scheduler.schedule(() -> { + logger.debug("Update channel 'doorbell' to OFF for thing {}", getThing().getUID()); + triggerChannel(CHANNEL_DOORBELL, CommonTriggerEvents.RELEASED); + }, offDelay, TimeUnit.SECONDS); + } + + private void stopDoorbellOffJob() { + if (doorbellOffJob != null) { + doorbellOffJob.cancel(true); + doorbellOffJob = null; + logger.debug("Canceling doorbell off job"); + } + } + + private void startMotionOffJob() { + Integer offDelay = config.motionOffDelay; + if (offDelay == null) { + return; + } + if (motionOffJob != null) { + motionOffJob.cancel(true); + } + motionOffJob = scheduler.schedule(() -> { + logger.debug("Update channel 'motion' to OFF for thing {}", getThing().getUID()); + updateState(CHANNEL_MOTION, OnOffType.OFF); + }, offDelay, TimeUnit.SECONDS); + } + + private void stopMotionOffJob() { + if (motionOffJob != null) { + motionOffJob.cancel(true); + motionOffJob = null; + logger.debug("Canceling motion off job"); + } + } + + private void updateDoorbellMontage() { + if (config.montageNumImages == 0) { + return; + } + logger.debug("Scheduling DOORBELL montage update to run in {} seconds", MONTAGE_UPDATE_DELAY_SECONDS); + scheduler.schedule(() -> { + updateMontage("doorbell", CHANNEL_DOORBELL_IMAGE_MONTAGE); + }, MONTAGE_UPDATE_DELAY_SECONDS, TimeUnit.SECONDS); + } + + private void updateMotionMontage() { + if (config.montageNumImages == 0) { + return; + } + logger.debug("Scheduling MOTION montage update to run in {} seconds", MONTAGE_UPDATE_DELAY_SECONDS); + scheduler.schedule(() -> { + updateMontage("motionsensor", CHANNEL_MOTION_IMAGE_MONTAGE); + }, MONTAGE_UPDATE_DELAY_SECONDS, TimeUnit.SECONDS); + } + + private void updateMontage(String event, String channelId) { + logger.debug("Update '{}' montage for channel '{}'", event, channelId); + ArrayList<BufferedImage> images = getImages(event); + if (images.size() > 0) { + State state = createMontage(images); + if (state != null) { + logger.debug("Got a '{}' montage. Updating channel '{}' with image montage", event, channelId); + updateState(channelId, state); + return; + } + } + logger.debug("Updating channel '{}' with NULL image montage", channelId); + updateState(channelId, UnDefType.NULL); + } + + // Get an array list of history images + private ArrayList<BufferedImage> getImages(String event) { + ArrayList<BufferedImage> images = new ArrayList<>(); + int numberOfImages = config.montageNumImages; + String url = buildUrl("/bha-api/history.cgi", "?event=" + event + "&index="); + for (int imageNumber = 1; imageNumber <= numberOfImages; imageNumber++) { + String imageUrl = url + String.valueOf(imageNumber); + logger.debug("Downloading '{}' montage image {}", event, imageNumber); + DoorbirdImage historyImage = downloadImage(imageUrl); + if (historyImage != null) { + RawType image = historyImage.getImage(); + if (image != null) { + try { + BufferedImage i = ImageIO.read(new ByteArrayInputStream(image.getBytes())); + images.add(i); + } catch (IOException e) { + logger.debug("IOException creating BufferedImage from downloaded image: {}", e.getMessage()); + } + } + } + } + if (images.size() < numberOfImages) { + logger.debug("Some images could not be downloaded: wanted={}, actual={}", numberOfImages, images.size()); + } + return images; + } + + // Assemble the array of images into a single scaled image + private @Nullable State createMontage(ArrayList<BufferedImage> images) { + int height = (int) (images.get(0).getHeight() * (config.montageScaleFactor / 100.0)); + int width = (int) (images.get(0).getWidth() * (config.montageScaleFactor / 100.0)); + int widthTotal = width * images.size(); + logger.debug("Dimensions of final montage image: w={}, h={}", widthTotal, height); + + // Create concatenated image + int currentWidth = 0; + BufferedImage concatImage = new BufferedImage(widthTotal, height, BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = concatImage.createGraphics(); + logger.debug("Concatenating images array into single image"); + for (int j = 0; j < images.size(); j++) { + g2d.drawImage(images.get(j), currentWidth, 0, width, height, null); + currentWidth += width; + } + g2d.dispose(); + + // Convert image to a state + logger.debug("Rendering image to byte array and converting to RawType state"); + byte[] imageBytes = convertImageToByteArray(concatImage); + State state = null; + if (imageBytes != null) { + state = new RawType(imageBytes, "image/png"); + } + return state; + } + + private byte @Nullable [] convertImageToByteArray(BufferedImage image) { + byte[] data = null; + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + ImageIO.write(image, "png", out); + data = out.toByteArray(); + } catch (IOException ioe) { + logger.debug("IOException occurred converting image to byte array", ioe); + } + return data; + } + + private void updateImageAndTimestamp() { + DoorbirdImage dbImage = downloadImage(buildUrl("/bha-api/image.cgi")); + if (dbImage != null) { + RawType image = dbImage.getImage(); + updateState(CHANNEL_IMAGE, image != null ? image : UnDefType.UNDEF); + updateState(CHANNEL_IMAGE_TIMESTAMP, getLocalDateTimeType(dbImage.getTimestamp())); + } + } + + private String buildUrl(String path) { + return buildUrl(path, null); + } + + private String buildUrl(String path, @Nullable String parameters) { + String url = "http://" + getDoorbirdHost() + path; + if (parameters != null) { + url = url + parameters; + } + return url; + } + + private String executeGetRequest(String url) throws IOException { + // @formatter:off + return HttpRequestBuilder.getFrom(url) + .withTimeout(Duration.ofSeconds(API_REQUEST_TIMEOUT_SECONDS)) + .withHeader("Authorization", "Basic " + authorization) + .withHeader("charset", "utf-8") + .withHeader("Accept-language", "en-us") + .getContentAsString(); + // @formatter:on + } + + private @Nullable synchronized DoorbirdImage downloadImage(String url) { + logger.debug("Downloading image using url={}", url); + Request request = httpClient.newRequest(url); + request.method(HttpMethod.GET); + request.header("Authorization", "Basic " + authorization); + request.timeout(6, TimeUnit.SECONDS); + + String errorMsg; + try { + ContentResponse contentResponse = request.send(); + switch (contentResponse.getStatus()) { + case HttpStatus.OK_200: + DoorbirdImage doorbirdImage = new DoorbirdImage(); + doorbirdImage.setImage(new RawType(contentResponse.getContent(), + contentResponse.getHeaders().get(HttpHeader.CONTENT_TYPE))); + doorbirdImage.setTimestamp(convertXTimestamp(contentResponse.getHeaders().get("X-Timestamp"))); + return doorbirdImage; + + default: + errorMsg = String.format("HTTP GET failed: %d, %s", contentResponse.getStatus(), + contentResponse.getReason()); + break; + } + } catch (TimeoutException e) { + errorMsg = "TimeoutException: Call to Doorbird API timed out"; + } catch (ExecutionException e) { + errorMsg = String.format("ExecutionException: %s", e.getMessage()); + } catch (InterruptedException e) { + errorMsg = String.format("InterruptedException: %s", e.getMessage()); + Thread.currentThread().interrupt(); + } + logger.debug(errorMsg); + return null; + } + + private long convertXTimestamp(@Nullable String timestamp) { + // Convert Unix Epoch string timestamp to long value + // Use current time if passed null string + long value = ZonedDateTime.now().toEpochSecond(); + if (timestamp != null) { + try { + value = Integer.parseInt(timestamp); + } catch (NumberFormatException e) { + logger.debug("X-Timestamp header is not a number: {}", timestamp); + } + } + return value; + } + + private DateTimeType getLocalDateTimeType(long dateTimeSeconds) { + return new DateTimeType(Instant.ofEpochSecond(dateTimeSeconds).atZone(timeZoneProvider.getTimeZone())); + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singletonList(DoorbirdActions.class); + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandlerFactory.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandlerFactory.java new file mode 100644 index 0000000000000..a4bacfbdd695c --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdHandlerFactory.java @@ -0,0 +1,63 @@ +/** + * 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.doorbird.internal; + +import static org.openhab.binding.doorbird.internal.DoorbirdBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link DoorbirdHandlerFactory} is responsible for creating Doorbird thing + * handlers. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.doorbird", service = ThingHandlerFactory.class) +public class DoorbirdHandlerFactory extends BaseThingHandlerFactory { + private final TimeZoneProvider timeZoneProvider; + private final HttpClient httpClient; + + @Activate + public DoorbirdHandlerFactory(@Reference TimeZoneProvider timeZoneProvider, + @Reference HttpClientFactory httpClientFactory) { + this.timeZoneProvider = timeZoneProvider; + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + if (THING_TYPE_D101.equals(thingTypeUID) || THING_TYPE_D210X.equals(thingTypeUID)) { + return new DoorbirdHandler(thing, timeZoneProvider, httpClient); + } + return null; + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdImage.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdImage.java new file mode 100644 index 0000000000000..e90370d5e1a1f --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/DoorbirdImage.java @@ -0,0 +1,44 @@ +/** + * 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.doorbird.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.RawType; + +/** + * The {@link DoorbirdImage} represents an image received from a doorbird. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class DoorbirdImage { + private @Nullable RawType image; + private long timestamp; + + public @Nullable RawType getImage() { + return image; + } + + public void setImage(RawType image) { + this.image = image; + } + + public long getTimestamp() { + return timestamp; + } + + public void setTimestamp(long timestamp) { + this.timestamp = timestamp; + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdEvent.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdEvent.java new file mode 100644 index 0000000000000..98628fbe67994 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdEvent.java @@ -0,0 +1,255 @@ +/** + * 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.doorbird.internal.listener; + +import java.net.DatagramPacket; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.util.HexUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.goterl.lazycode.lazysodium.LazySodiumJava; +import com.goterl.lazycode.lazysodium.SodiumJava; +import com.goterl.lazycode.lazysodium.exceptions.SodiumException; +import com.goterl.lazycode.lazysodium.interfaces.PwHash; +import com.sun.jna.NativeLong; + +/** + * The {@link DoorbirdEvent} is responsible for decoding event packets received + * from the Doorbird. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class DoorbirdEvent { + private final Logger logger = LoggerFactory.getLogger(DoorbirdEvent.class); + + // These values are extracted from the UDP packet + private byte version; + private int opslimit; + private long memlimit; + private byte[] salt = new byte[16]; + private byte[] nonce = new byte[8]; + private byte[] ciphertext = new byte[34]; + + // Starting 6 characters from the user name + private @Nullable String eventIntercomId; + + // Doorbell number for doorbell event, or "motion" for motion events + private @Nullable String eventId; + + // Timestamp of event + private long eventTimestamp; + + private boolean isDoorbellEvent; + + /* + * We want a single instance of LazySodium. Also, try to load the libsodium library + * from multiple sources. + * + * To load the libsodium library, + * - first try to load the library from the resources that are bundled with + * the LazySodium jar. (i.e. new SodiumJava()) + * - if that fails with an UnsatisfiedLinkError, then try to load the library + * from the operating system (i.e. new SodiumJava("sodium"). + * - if both of these attempts fail, the binding will be functional, except for + * its ability to decrypt the UDP events. + */ + private static class LazySodiumJavaHolder { + private static final Logger LOGGER = LoggerFactory.getLogger(LazySodiumJavaHolder.class); + + static final @Nullable LazySodiumJava LAZY_SODIUM_JAVA_INSTANCE = loadLazySodiumJava(); + + private static @Nullable LazySodiumJava loadLazySodiumJava() { + LOGGER.debug("LazySodium has not been loaded yet. Try to load it now."); + LazySodiumJava lazySodiumJava = null; + try { + lazySodiumJava = new LazySodiumJava(new SodiumJava()); + LOGGER.debug("Successfully loaded bundled libsodium crypto library!!"); + } catch (UnsatisfiedLinkError e1) { + try { + LOGGER.debug("Unable to load bundled libsodium crypto library!! Try to load OS version.", e1); + lazySodiumJava = new LazySodiumJava(new SodiumJava("sodium")); + LOGGER.debug("Successfully loaded libsodium crypto library from operating system!!"); + } catch (UnsatisfiedLinkError e2) { + LOGGER.info("Failed to load libsodium crypto library!!", e2); + LOGGER.info("Try manually installing libsodium on your OS if libsodium supports your architecture"); + } + } + return lazySodiumJava; + } + } + + public static @Nullable LazySodiumJava getLazySodiumJavaInstance() { + return LazySodiumJavaHolder.LAZY_SODIUM_JAVA_INSTANCE; + } + + // Will be true if this is a valid Doorbird event + public boolean isDoorbellEvent() { + return isDoorbellEvent; + } + + // Contains the intercomId for valid Doorbird events + public @Nullable String getIntercomId() { + return eventIntercomId; + } + + // Contains the eventId for valid Doorbird events + public @Nullable String getEventId() { + return eventId; + } + + // Contains the timestamp for valid Doorbird events + public long getTimestamp() { + return eventTimestamp; + } + + /* + * The following functions support the decryption of the doorbell event + * using the LazySodium wrapper for the libsodium crypto library + */ + public void decrypt(DatagramPacket p, String password) { + isDoorbellEvent = false; + + int length = p.getLength(); + byte[] data = Arrays.copyOf(p.getData(), length); + + // A valid event contains a 3 byte signature followed by the decryption version + if (length < 4) { + return; + } + + // Only the first 5 characters of the password are used to generate the decryption key + if (password.length() < 5) { + logger.info("Invalid password length, must be at least 5 characters"); + return; + } + String passwordFirstFive = password.substring(0, 5); + + try { + // Load the message into the ByteBuffer + ByteBuffer bb = ByteBuffer.allocate(length); + bb.put(data, 0, length); + bb.rewind(); + // Check for proper event signature + if (!isValidSignature(bb)) { + logger.trace("Received event not a doorbell event: {}", new String(data, StandardCharsets.US_ASCII)); + return; + } + // Get the decryption version + version = getVersion(bb); + if (version == 1) { + // Decrypt using version 1 decryption scheme + decryptV1(bb, passwordFirstFive); + } else { + logger.info("Don't know how to decrypt version {} doorbell event", version); + } + } catch (IndexOutOfBoundsException e) { + logger.info("IndexOutOfBoundsException decrypting doorbell event", e); + } catch (BufferUnderflowException e) { + logger.info("BufferUnderflowException decrypting doorbell event", e); + } + } + + private boolean isValidSignature(ByteBuffer bb) throws IndexOutOfBoundsException, BufferUnderflowException { + // Check the first three bytes for the proper signature + return (bb.get() & 0xFF) == 0xDE && (bb.get() & 0xFF) == 0xAD && (bb.get() & 0xFF) == 0xBE; + } + + private byte getVersion(ByteBuffer bb) throws IndexOutOfBoundsException, BufferUnderflowException { + // Extract the decryption version from the packet + return bb.get(); + } + + private void decryptV1(ByteBuffer bb, String password5) throws IndexOutOfBoundsException, BufferUnderflowException { + LazySodiumJava sodium = getLazySodiumJavaInstance(); + if (sodium == null) { + logger.debug("Unable to decrypt event because libsodium is not loaded"); + return; + } + if (bb.capacity() != 70) { + logger.info("Received malformed version 1 doorbell event, length not 70 bytes"); + return; + } + // opslimit and memlimit are 4 bytes each + opslimit = bb.getInt(); + memlimit = bb.getInt(); + // Get salt, nonce, and ciphertext arrays + bb.get(salt, 0, salt.length); + bb.get(nonce, 0, nonce.length); + bb.get(ciphertext, 0, ciphertext.length); + + // Create the hash, which will be used to decrypt the ciphertext + byte[] hash; + try { + logger.trace("Calling cryptoPwHash with passwordFirstFive='{}', opslimit={}, memlimit={}, salt='{}'", + password5, opslimit, memlimit, HexUtils.bytesToHex(salt, " ")); + String hashAsString = sodium.cryptoPwHash(password5, 32, salt, opslimit, new NativeLong(memlimit), + PwHash.Alg.PWHASH_ALG_ARGON2I13); + hash = HexUtils.hexToBytes(hashAsString); + } catch (SodiumException e) { + logger.info("Got SodiumException", e); + return; + } + + // Set up the variables for the decryption algorithm + byte[] m = new byte[30]; + long[] mLen = new long[30]; + byte[] nSec = null; + byte[] c = ciphertext; + long cLen = ciphertext.length; + byte[] ad = null; + long adLen = 0; + byte[] nPub = nonce; + byte[] k = hash; + + // Decrypt the ciphertext + logger.trace("Call cryptoAeadChaCha20Poly1305Decrypt with ciphertext='{}', nonce='{}', key='{}'", + HexUtils.bytesToHex(ciphertext, " "), HexUtils.bytesToHex(nonce, " "), HexUtils.bytesToHex(k, " ")); + boolean success = sodium.cryptoAeadChaCha20Poly1305Decrypt(m, mLen, nSec, c, cLen, ad, adLen, nPub, k); + if (!success) { + /* + * Don't log at debug level since the decryption will fail for events encrypted with + * passwords other than the password contained in the thing configuration (reference API + * documentation for details) + */ + logger.trace("Decryption FAILED"); + return; + } + int decryptedTextLength = (int) mLen[0]; + if (decryptedTextLength != 18L) { + logger.info("Length of decrypted text is invalid, must be 18 bytes"); + return; + } + // Get event fields from decrypted text + logger.debug("Received and successfully decrypted a Doorbird event!!"); + ByteBuffer b = ByteBuffer.allocate(decryptedTextLength); + b.put(m, 0, decryptedTextLength); + b.rewind(); + byte[] buf = new byte[8]; + b.get(buf, 0, 6); + eventIntercomId = new String(buf, 0, 6).trim(); + b.get(buf, 0, 8); + eventId = new String(buf, 0, 8).trim(); + eventTimestamp = b.getInt(); + + logger.debug("Event is eventId='{}', intercomId='{}', timestamp={}", eventId, eventIntercomId, eventTimestamp); + isDoorbellEvent = true; + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdUdpListener.java b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdUdpListener.java new file mode 100644 index 0000000000000..37bbafd5667d5 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/java/org/openhab/binding/doorbird/internal/listener/DoorbirdUdpListener.java @@ -0,0 +1,160 @@ +/** + * 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.doorbird.internal.listener; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetSocketAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.doorbird.internal.DoorbirdHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link DoorbirdUdpListener} is responsible for receiving + * UDP braodcasts from the Doorbird doorbell. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class DoorbirdUdpListener extends Thread { + // Doorbird devices report status on a UDP port + private static final int UDP_PORT = 6524; + + // How long to wait in milliseconds for a UDP packet + private static final int SOCKET_TIMEOUT_MILLISECONDS = 3000; + + private static final int BUFFER_SIZE = 80; + + private final Logger logger = LoggerFactory.getLogger(DoorbirdUdpListener.class); + + private final DoorbirdEvent event = new DoorbirdEvent(); + + // Used for callbacks to handler + private final DoorbirdHandler thingHandler; + + // UDP socket used to receive status events from doorbell + private @Nullable DatagramSocket socket; + + private byte @Nullable [] lastData; + private int lastDataLength; + private long lastDataTime; + + public DoorbirdUdpListener(DoorbirdHandler thingHandler) { + this.thingHandler = thingHandler; + } + + @Override + public void run() { + receivePackets(); + } + + public void shutdown() { + if (socket != null) { + socket.close(); + logger.debug("Listener closing listener socket"); + socket = null; + } + } + + private void receivePackets() { + try { + DatagramSocket s = new DatagramSocket(null); + s.setSoTimeout(SOCKET_TIMEOUT_MILLISECONDS); + s.setReuseAddress(true); + InetSocketAddress address = new InetSocketAddress(UDP_PORT); + s.bind(address); + socket = s; + logger.debug("Listener got UDP socket on port {} with timeout {}", UDP_PORT, SOCKET_TIMEOUT_MILLISECONDS); + } catch (SocketException e) { + logger.debug("Listener got SocketException: {}", e.getMessage(), e); + socket = null; + return; + } + + DatagramPacket packet = new DatagramPacket(new byte[BUFFER_SIZE], BUFFER_SIZE); + while (socket != null) { + try { + socket.receive(packet); + processPacket(packet); + } catch (SocketTimeoutException e) { + // Nothing to do on socket timeout + } catch (IOException e) { + logger.debug("Listener got IOException waiting for datagram: {}", e.getMessage()); + socket = null; + } + } + logger.debug("Listener exiting"); + } + + private void processPacket(DatagramPacket packet) { + logger.trace("Got datagram of length {} from {}", packet.getLength(), packet.getAddress().getHostAddress()); + + // Check for duplicate packet + if (isDuplicate(packet)) { + logger.trace("Dropping duplicate packet"); + return; + } + + String userId = thingHandler.getUserId(); + String userPassword = thingHandler.getUserPassword(); + if (userId == null || userPassword == null) { + logger.info("Doorbird user id and/or password is not set in configuration"); + return; + } + try { + event.decrypt(packet, userPassword); + } catch (RuntimeException e) { + // The libsodium library might generate a runtime exception if the packet is malformed + logger.info("DoorbirdEvent got unhandled exception: {}", e.getMessage(), e); + return; + } + + if (event.isDoorbellEvent()) { + if ("motion".equalsIgnoreCase(event.getEventId())) { + thingHandler.updateMotionChannel(event.getTimestamp()); + } else { + String intercomId = event.getIntercomId(); + if (intercomId != null && userId.toLowerCase().startsWith(intercomId.toLowerCase())) { + thingHandler.updateDoorbellChannel(event.getTimestamp()); + } else { + logger.info("Received doorbell event for unknown device: {}", event.getIntercomId()); + } + } + } + } + + private boolean isDuplicate(DatagramPacket packet) { + boolean packetIsDuplicate = false; + if (lastData != null && lastDataLength == packet.getLength()) { + // Packet must be received within 750 ms of previous packet to be considered a duplicate + if ((System.currentTimeMillis() - lastDataTime) < 750) { + // Compare packets byte-for-byte + if (Arrays.equals(lastData, Arrays.copyOf(packet.getData(), packet.getLength()))) { + packetIsDuplicate = true; + } + } + } + // Remember this packet for duplicate check + lastDataLength = packet.getLength(); + lastData = Arrays.copyOf(packet.getData(), lastDataLength); + lastDataTime = System.currentTimeMillis(); + return packetIsDuplicate; + } +} diff --git a/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..50c9a9d2f3520 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="doorbird" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Doorbird Binding</name> + <description>This is the binding for Doorbird video doorbells.</description> + <author>Mark Hilbush</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/config/config.xml new file mode 100644 index 0000000000000..ac53de3862f1e --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/config/config.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> + + <config-description uri="thing-type:doorbird:config"> + <parameter name="doorbirdId" type="text" required="true"> + <label>ID</label> + <description>Doorbird Identifier (e.g. 1)</description> + </parameter> + <parameter name="doorbirdHost" type="text" required="true"> + <label>Host</label> + <description>Hostname or IP address of Doorbird</description> + <context>network-address</context> + </parameter> + <parameter name="userId" type="text" required="true"> + <label>User ID</label> + </parameter> + <parameter name="userPassword" type="text" required="true"> + <label>Password</label> + <context>password</context> + </parameter> + <parameter name="imageRefreshRate" type="integer" min="2" max="600"> + <label>Image Refresh Rate</label> + <description>Image refresh rate in seconds (blank to disable)</description> + </parameter> + <parameter name="doorbellOffDelay" type="integer" min="1"> + <label>Doorbell Off Delay</label> + <description>Delay to set doorbell channel OFF after doorbell event (blank to disable)</description> + </parameter> + <parameter name="motionOffDelay" type="integer" min="1"> + <label>Motion Off Delay</label> + <description>Delay to set motion channel OFF after motion event (blank to disable)</description> + </parameter> + <parameter name="montageNumImages" type="integer" min="0" max="6"> + <label>Montage Number of Images</label> + <description>Number of images to include in history montage</description> + <default>0</default> + </parameter> + <parameter name="montageScaleFactor" type="integer" min="1" max="100"> + <label>Montage Scale Factor</label> + <description>Scaling factor to apply to history montage</description> + <default>25</default> + </parameter> + </config-description> + +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..bb8fd14c024e6 --- /dev/null +++ b/bundles/org.openhab.binding.doorbird/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="doorbird" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="d101"> + <label>Doorbird D101</label> + <description>Doorbird doorbell model D101</description> + <channels> + <channel id="doorbell" typeId="system.rawbutton" /> + <channel id="doorbellTimestamp" typeId="doorbellTimestamp" /> + <channel id="doorbellImage" typeId="doorbellImage" /> + <channel id="doorbellHistoryIndex" typeId="doorbellHistoryIndex" /> + <channel id="doorbellHistoryTimestamp" typeId="doorbellHistoryTimestamp" /> + <channel id="doorbellHistoryImage" typeId="doorbellHistoryImage" /> + <channel id="doorbellMontage" typeId="doorbellMontage" /> + <channel id="motion" typeId="system.motion" /> + <channel id="motionTimestamp" typeId="motionTimestamp" /> + <channel id="motionImage" typeId="motionImage" /> + <channel id="motionHistoryIndex" typeId="motionHistoryIndex" /> + <channel id="motionHistoryTimestamp" typeId="motionHistoryTimestamp" /> + <channel id="motionHistoryImage" typeId="motionHistoryImage" /> + <channel id="motionMontage" typeId="motionMontage" /> + <channel id="light" typeId="light" /> + <channel id="openDoor1" typeId="openDoor1" /> + <channel id="image" typeId="image" /> + <channel id="imageTimestamp" typeId="imageTimestamp" /> + </channels> + <config-description-ref uri="thing-type:doorbird:config" /> + </thing-type> + + <thing-type id="d210x"> + <label>Doorbird D210x</label> + <description>Doorbird doorbell model D210x</description> + <channels> + <channel id="doorbell" typeId="system.rawbutton" /> + <channel id="doorbellTimestamp" typeId="doorbellTimestamp" /> + <channel id="doorbellImage" typeId="doorbellImage" /> + <channel id="doorbellHistoryIndex" typeId="doorbellHistoryIndex" /> + <channel id="doorbellHistoryTimestamp" typeId="doorbellHistoryTimestamp" /> + <channel id="doorbellHistoryImage" typeId="doorbellHistoryImage" /> + <channel id="doorbellMontage" typeId="doorbellMontage" /> + <channel id="motion" typeId="system.motion" /> + <channel id="motionTimestamp" typeId="motionTimestamp" /> + <channel id="motionImage" typeId="motionImage" /> + <channel id="motionHistoryIndex" typeId="motionHistoryIndex" /> + <channel id="motionHistoryTimestamp" typeId="motionHistoryTimestamp" /> + <channel id="motionHistoryImage" typeId="motionHistoryImage" /> + <channel id="motionMontage" typeId="motionMontage" /> + <channel id="light" typeId="light" /> + <channel id="openDoor1" typeId="openDoor1" /> + <channel id="openDoor2" typeId="openDoor2" /> + <channel id="image" typeId="image" /> + <channel id="imageTimestamp" typeId="imageTimestamp" /> + </channels> + <config-description-ref uri="thing-type:doorbird:config" /> + </thing-type> + + <channel-type id="doorbellTimestamp"> + <item-type>DateTime</item-type> + <label>Doorbell Timestamp</label> + <description>Time when doorbell was last pressed</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="doorbellImage"> + <item-type>Image</item-type> + <label>Doorbell Pressed Image</label> + <description>Image when doorbell was last pressed</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="motionTimestamp"> + <item-type>DateTime</item-type> + <label>Motion Timestamp</label> + <description>Time when motion was last detected</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="motionImage"> + <item-type>Image</item-type> + <label>Motion Detected Image</label> + <description>Image when motion was last detected</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="light"> + <item-type>Switch</item-type> + <label>Light</label> + <description>Energize the light relay</description> + <state pattern="%s"></state> + </channel-type> + <channel-type id="openDoor1"> + <item-type>Switch</item-type> + <label>Open Door 1</label> + <description>Energize opendoor / alarm output relay 1</description> + <state pattern="%s"></state> + </channel-type> + <channel-type id="openDoor2"> + <item-type>Switch</item-type> + <label>Open Door 2</label> + <description>Energize opendoor / alarm output relay 2</description> + <state pattern="%s"></state> + </channel-type> + <channel-type id="imageTimestamp"> + <item-type>DateTime</item-type> + <label>Image Timestamp</label> + <description>Time when image was captured from device</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="image"> + <item-type>Image</item-type> + <label>Image</label> + <description>Image from device</description> + </channel-type> + <channel-type id="doorbellHistoryIndex"> + <item-type>Number</item-type> + <label>Doorbell History Index</label> + <description>Index of historical image for doorbell press</description> + <state min="1" max="50" step="1"></state> + </channel-type> + <channel-type id="doorbellHistoryTimestamp"> + <item-type>DateTime</item-type> + <label>Doorbell History Timestamp</label> + <description>Time when doorbell was pressed for history image</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="doorbellHistoryImage"> + <item-type>Image</item-type> + <label>Doorbell History Image</label> + <description>Historical image for doorbell press</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="motionHistoryIndex"> + <item-type>Number</item-type> + <label>Motion History Index</label> + <description>Index of Historical image for motion</description> + <state min="1" max="50" step="1"></state> + </channel-type> + <channel-type id="motionHistoryTimestamp"> + <item-type>DateTime</item-type> + <label>Motion History Timestamp</label> + <description>Time when motion was detected for history image</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="motionHistoryImage"> + <item-type>Image</item-type> + <label>Motion History Image</label> + <description>Historical image for motion sensor</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="doorbellMontage"> + <item-type>Image</item-type> + <label>Doorbell Montage Image</label> + <description>Montage of multiple doorbell history images</description> + </channel-type> + <channel-type id="motionMontage"> + <item-type>Image</item-type> + <label>Motion Montage Image</label> + <description>Montage of multiple motion history images</description> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.dscalarm/NOTICE b/bundles/org.openhab.binding.dscalarm/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.dscalarm/NOTICE +++ b/bundles/org.openhab.binding.dscalarm/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.dscalarm/README.md b/bundles/org.openhab.binding.dscalarm/README.md index 2021b4e2680b8..45200886870ff 100644 --- a/bundles/org.openhab.binding.dscalarm/README.md +++ b/bundles/org.openhab.binding.dscalarm/README.md @@ -30,14 +30,14 @@ Most settings are through thing configuration parameters. The DSC Alarm binding incorporates several discovery modes in order to find DSC Alarm systems. First, there is the Envisalink bridge discovery mode which performs a network query for any Envisalink adapters and adds them to the discovery inbox. Second, there is The IT-100 bridge discovery mode which will search serial ports for any IT-100 adapters and add them to the discovery inbox. -The bridge discovery modes are started manually through PaperUI. +The bridge discovery modes are started manually through Paper UI. Third, after a bridge is discovered and available to openHAB, the binding will attempt to discover DSC Alarm things and add them to the discovery inbox. The TCP Server bridge does not implement bridge discovery but will utilize thing discovery once it is online. Note: The Envisalink Bridge discovery does a TCP scan across your local network to find the interface. This may create issues on the network so it is suggested that caution be used when trying this discovery. -The recommended method would be to manually add and configure the bridge through the 'dscalarm.thing' file or the PaperUI. +The recommended method would be to manually add and configure the bridge through the 'dscalarm.thing' file or the Paper UI. And then allow the binding to discover the DSC Alarm things. ## Thing Configuration diff --git a/bundles/org.openhab.binding.dscalarm/pom.xml b/bundles/org.openhab.binding.dscalarm/pom.xml index 77d8f2bc8f8ab..783468ee99e75 100644 --- a/bundles/org.openhab.binding.dscalarm/pom.xml +++ b/bundles/org.openhab.binding.dscalarm/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.dscalarm</artifactId> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/feature/feature.xml b/bundles/org.openhab.binding.dscalarm/src/main/feature/feature.xml index 6980f4c81e4d0..9cc7883e0784a 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.dscalarm-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-dscalarm" description="DSCAlarm Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmBindingConstants.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmBindingConstants.java index 89d83e35f8aa2..6dcaf1c397c18 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmBindingConstants.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmCode.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmCode.java index a01f5121ff6be..a2f5f8f6dbb9f 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmCode.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmEvent.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmEvent.java index 6e82582cb6d4d..0c52a8404bd38 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmEvent.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmMessage.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmMessage.java index 1cc414cc066e5..24f76f95e67cd 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmMessage.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/DSCAlarmMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPanelConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPanelConfiguration.java index be19e971fa030..1955c6e3bce41 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPanelConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPanelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPartitionConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPartitionConfiguration.java index 99755c21c67f4..58c7c6b5880c5 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPartitionConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmPartitionConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmZoneConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmZoneConfiguration.java index 4895ac30f85d8..7329a74fb7a62 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmZoneConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/DSCAlarmZoneConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/EnvisalinkBridgeConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/EnvisalinkBridgeConfiguration.java index e0b020851c942..22fb97000368a 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/EnvisalinkBridgeConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/EnvisalinkBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/IT100BridgeConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/IT100BridgeConfiguration.java index fd5fb297b3d0b..a67a5481203d4 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/IT100BridgeConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/IT100BridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/TCPServerBridgeConfiguration.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/TCPServerBridgeConfiguration.java index 9ef627f6b865a..d31264410077a 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/TCPServerBridgeConfiguration.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/config/TCPServerBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmBridgeDiscovery.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmBridgeDiscovery.java index b3e4bd735f1d9..d0923b7d6feaf 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmBridgeDiscovery.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -81,7 +81,7 @@ public void addEnvisalinkBridge(String ipAddress) { logger.trace("addBridge(): '{}' was added to Smarthome inbox.", thingUID); } catch (Exception e) { - logger.error("addBridge(): Error: {}", e); + logger.error("addBridge(): Error", e); } } @@ -117,7 +117,7 @@ public void addIT100Bridge(String port) { logger.trace("addBridge(): '{}' was added to Smarthome inbox.", thingUID); } catch (Exception e) { - logger.error("addBridge(): Error: {}", e); + logger.error("addBridge(): Error", e); } } } diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmDiscoveryService.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmDiscoveryService.java index 87a5d532a8a6e..7fc80005f90f9 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmDiscoveryService.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/DSCAlarmDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/EnvisalinkBridgeDiscovery.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/EnvisalinkBridgeDiscovery.java index 72eefed45cb09..db2e7a3fb89fb 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/EnvisalinkBridgeDiscovery.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/EnvisalinkBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/IT100BridgeDiscovery.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/IT100BridgeDiscovery.java index 2904c07d07165..93aea7aa3d360 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/IT100BridgeDiscovery.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/discovery/IT100BridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/factory/DSCAlarmHandlerFactory.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/factory/DSCAlarmHandlerFactory.java index 22eca6035bfda..a998fa242da04 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/factory/DSCAlarmHandlerFactory.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/factory/DSCAlarmHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseBridgeHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseBridgeHandler.java index 993104ae5bb61..86595de1db84d 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseBridgeHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseThingHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseThingHandler.java index 4f863186ffe12..ec1523d27bdfe 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseThingHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBridgeType.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBridgeType.java index 45cc4d462f0b2..3e68eb1d0bcb8 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBridgeType.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmBridgeType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmProtocol.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmProtocol.java index c8f6643342130..c58dfc20cfb74 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmProtocol.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmThingType.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmThingType.java index e28821693df8f..67721a25669a4 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmThingType.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/DSCAlarmThingType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/EnvisalinkBridgeHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/EnvisalinkBridgeHandler.java index 9f628350f4035..0b9cba93fa169 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/EnvisalinkBridgeHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/EnvisalinkBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/IT100BridgeHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/IT100BridgeHandler.java index 30854118e8528..a0142f483cc24 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/IT100BridgeHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/IT100BridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/KeypadThingHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/KeypadThingHandler.java index d2264d41a1e88..b7f6a11092d30 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/KeypadThingHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/KeypadThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PanelThingHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PanelThingHandler.java index 1bbe799b52e8e..394e35a4eeb3b 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PanelThingHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PanelThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PartitionThingHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PartitionThingHandler.java index ea8e8d8838997..7db02a69808fc 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PartitionThingHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/PartitionThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/TCPServerBridgeHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/TCPServerBridgeHandler.java index c0c3092cc377b..f84a6a09ba48a 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/TCPServerBridgeHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/TCPServerBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/ZoneThingHandler.java b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/ZoneThingHandler.java index d8bc2cc745a1a..bf9182d04294e 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/ZoneThingHandler.java +++ b/bundles/org.openhab.binding.dscalarm/src/main/java/org/openhab/binding/dscalarm/internal/handler/ZoneThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/channels.xml index f1b4b5fe04a98..21aa1b35f81d7 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/channels.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="dscalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- bridge --> <channel-type id="reset"> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/envisalinkbridge.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/envisalinkbridge.xml index adc0c4705cabf..d592210b09d3e 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/envisalinkbridge.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/envisalinkbridge.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="dscalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="envisalink"> <label>EyezOn Envisalink</label> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/it100bridge.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/it100bridge.xml index 1974354b48066..d2c150383ea57 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/it100bridge.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/it100bridge.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="dscalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="it100"> <label>DSC IT-100</label> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/partition.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/partition.xml index 0b6b6682914d1..482b6cc2a0bdc 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/partition.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/partition.xml @@ -35,7 +35,7 @@ <description>Partition In Exit Delay Mode</description> </channel> <channel id="partition_in_alarm" typeId="status"> - <label>Partition In Alarm</label> + <label>Partition in Alarm</label> <description>Partition In Alarm</description> </channel> <channel id="partition_opening_closing_mode" typeId="message"> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/tcpserverbridge.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/tcpserverbridge.xml index 13e1797a3019f..78c13d939a4f7 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/tcpserverbridge.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/tcpserverbridge.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="dscalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="tcpserver"> <label>TCP Server</label> diff --git a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/zone.xml b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/zone.xml index 25ac84cfbf925..b12fa49bb099e 100644 --- a/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/zone.xml +++ b/bundles/org.openhab.binding.dscalarm/src/main/resources/ESH-INF/thing/zone.xml @@ -27,7 +27,7 @@ <description>Zone Bypass Mode (OFF=Armed, ON=Bypassed)</description> </channel> <channel id="zone_in_alarm" typeId="status"> - <label>Zone In Alarm</label> + <label>Zone in Alarm</label> <description>Zone In Alarm</description> </channel> <channel id="zone_tamper" typeId="status"> diff --git a/bundles/org.openhab.binding.dsmr/NOTICE b/bundles/org.openhab.binding.dsmr/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.dsmr/NOTICE +++ b/bundles/org.openhab.binding.dsmr/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.dsmr/README.md b/bundles/org.openhab.binding.dsmr/README.md index 7b3896cddcd60..312e16bd65d69 100644 --- a/bundles/org.openhab.binding.dsmr/README.md +++ b/bundles/org.openhab.binding.dsmr/README.md @@ -1,14 +1,18 @@ # DSMR Binding -The DSMR-binding is targeted towards Dutch and Luxembourger users having a smart meter (Dutch: 'Slimme meter'). -Data of Dutch/Luxembourg smart meters can be obtained via the P1-port. +The DSMR-binding is targeted towards Dutch, Belgium and Luxembourger users having a smart meter (Dutch: 'Slimme meter'). +Data of Dutch/Belgium/Luxembourg smart meters can be obtained via the P1-port. When connecting this port from a serial port the data can be read out. -This binding reads the P1-port of the Dutch Smart Meters that comply to NTA8130, DSMR v2.1, DSMR v2.2, DSMR v3.0, DSMR v4.0, DSMR v4.04, and DSMR 5.0. -This binding reads the P1-port of the Luxembourg’s electricity meter "Smarty" that comply to V1.0. +This binding reads the P1-port of: + +* Dutch Smart Meters that comply to NTA8130, DSMR v2.1, DSMR v2.2, DSMR v3.0, DSMR v4.0, DSMR v4.04, and DSMR 5.0. +* Belgium Smart Meters that comply to e-MUCS v1.0. +* Luxembourg’s electricity meter "Smarty" that comply to V1.0. + Although DSMR v4.2 is not an official specification, the binding has support for this version. -If you are not living in the Netherlands/Luxembourg but do want to read a meter please have look at the [SmartMeter Binding](https://www.openhab.org/addons/bindings/smartmeter). +If you are not living in the Netherlands/Belgium/Luxembourg but do want to read a meter please have look at the [SmartMeter Binding](/addons/bindings/smartmeter/). Because the Dutch Meter standard is based on the IEC-62056-21 standard it might be desirable to build support for other country metering systems based on that standard in this binding. ## Serial Port Configuration @@ -17,19 +21,23 @@ The P1-port is a serial port. To configure the serial port within openHAB see th ## Supported Things -### dsmrBridge (The Netherlands) +### dsmrBridge (The Netherlands/Belgium) `dsmrBridge`: This is the device that communicated between the binding (serial) and its internal meters. -You always have to have a 'Dutch Smart Meter'-bridge. The bridge contains the serial port configuration. +You always have to have a 'Dutch/Belgium Smart Meter'-bridge. The bridge contains the serial port configuration. Specific meters are bound via the bridge to the smart meter. A smart meter consists typically out of minimal 2 meters. A generic meter and the electricity meter. Each meter is bound to the DSMR protocol the physical meter supports. For each meter it is possible to set a refresh rate at which the status is updated. -The physical meter might update with a high frequency per second, while it's desired to have only values per minute. +The physical meter might update with a high frequency per second, while it is desired to have only values per minute. + +The Belgium e-MUCS protocol is an extension to the DSMR standard. +Belgium meters have `emucs` in the thing name. +Due to it similarities the bridge for Belgium meters is also a dsmrBridge. ### smartyBridge (Luxembourg) `smartyBridge`: This is the device that communicated between the binding (serial) and its internal meters. -You always have to have a 'Dutch Smart Meter'-bridge. The bridge contains the serial port configuration. +You always have to have a 'Smarty Smart Meter'-bridge. The bridge contains the serial port configuration. ## Discovery @@ -83,6 +91,7 @@ Supported meters: | DSMR V2 / V3 Device | `device_v2_v3` | -1 | 10 seconds | | DSMR V4 Device | `device_v4` | -1 | 10 seconds | | DSMR V5 Device | `device_v5` | -1 | 10 seconds | +| e-MUCS V1.0 Device | `device_emucs_v1_0` | -1 | ? | | ACE4000 GTMM Mk3 Electricity meter | `electricity_ace4000` | 0 | 10 seconds | | DSMR V2.1 Electricity meter | `electricity_v2_1` | 0 | 10 seconds | | DSMR V2.2 Electricity meter | `electricity_v2_2` | 0 | 10 seconds | @@ -91,11 +100,13 @@ Supported meters: | DSMR V4.0.4 Electricity meter | `electricity_v4_0_4` | 0 | 10 seconds | | DSMR V4.2 Electricity meter | `electricity_v4_2` | 0 | 10 seconds | | DSMR V5 Electricity meter | `electricity_v5_0` | 0 | 10 seconds | +| e-MUCS V1.0 Electricity meter | `electricity_emucs_v1_0` | 0 | ? | | Smarty V1.0 Electricity Meter | `electricity_smarty_v1_0` | 0 | 10 seconds | | ACE4000 GTMM Mk3 Gas meter | `gas_ace4000` | 3 | 1 hour | | DSMR V2.1 Gas meter | `gas_v2_1` | 0 | 24 hours | | DSMR V2.2 Gas meter | `gas_v2_2` | 0 | 24 hours | | DSMR V3.0 Gas meter | `gas_v3_0` | *note 1* | 1 hour | +| e-MUCS V1.0 Gas meter | `gas_emucs_v1_0` | *note 1* | ? | | ACE4000 GTMM Mk3 Cooling meter | `cooling_ace4000` | 6 | 1 hour | | DSMR V2.2 Cooling meter | `cooling_v2_2` | 0 | 1 hour | | ACE4000 GTMM Mk3 Heating meter | `heating_ace4000` | 4 | 1 hour | @@ -151,131 +162,133 @@ The following channels are supported: - O channel is supported only if the device has this functionality -| Channel Type ID | Item Type | Description | Ace4000 | DSMR V2.1 | DSMR V2.2 | DSMR V3.0 | DSMR V4.0 | DSMR V4.0.4 | DSMR V4.2 | DSMR V5 | SMARTY V1.0 | -|--------------------------------------------------|--------------------------|------------------------------------------------------------------------|---------|-----------|-----------|-----------|-----------|-------------|-----------|---------|-------------| -| | | **Channels for the generic device** | | | | | | | | | | -| `p1_text_code` | String | Text code from the device | - | Y | Y | Y | Y | Y | Y | - | - | -| `p1_text_string` | String | Text string from the device | - | Y | Y | Y | Y | Y | Y | Y | Y | -| `p1_version_output` | String | Version information (most times this refers to the DSMR specification) | - | - | - | - | Y | Y | Y | Y | Y | -| `p1_timestamp` | DateTime | Timestamp of the last device reading | - | - | - | - | Y | Y | Y | Y | Y | -| | | **Channels for the cooling meter** | | | | | | | | | | -| `cmeter_value_v2` | Number:Energy | The total amount of cooling used in the past period (GJ) | Y | - | Y | - | - | - | - | - | - | -| `cmeter_value_v2_timestamp` | DateTime | Timestamp of the last meter reading | Y | - | Y | - | - | - | - | - | - | -| `cmeter_equipment_identifier_v2_2` | String | Equipment identifier | - | - | Y | - | - | - | - | - | - | -| | | **Channels for the main electricity meter** | | | | | | | | | | -| `emeter_equipment_identifier_v2_x` | String | Electricity Equipment identifier | - | Y | Y | - | - | - | - | - | Y | -| `emeter_equipment_identifier` | String | Electricity Equipment identifier | - | - | - | Y | Y | Y | Y | Y | - | -| `emeter_delivery_tariff0` | Number:Energy | Total amount of electricity used for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | Y | -| `emeter_delivery_tariff1` | Number:Energy | Total amount of electricity used for tariff 1 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | -| `emeter_delivery_tariff2` | Number:Energy | Total amount of electricity used for tariff 2 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | -| `emeter_production_tariff0` | Number:Energy | Total amount of electricity produced for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | Y | -| `emeter_production_tariff1` | Number:Energy | Total amount of electricity produced for tariff 1 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | -| `emeter_production_tariff2` | Number:Energy | Total amount of electricity produced for tariff 2 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | -| `emeter_delivery_tariff0_antifraud` | Number:Energy | Total amount of electricity used for tariff 2 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_delivery_tariff1_antifraud` | Number:Energy | Total amount of electricity used for tariff 1 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_delivery_tariff2_antifraud` | Number:Energy | Total amount of electricity used for tariff 2 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_total_imported_energy_register_q` | Number:Energy | Total Imported Energy (Q+) (kvarh) | - | - | - | - | - | - | - | - | Y | -| `emeter_total_exported_energy_register_q` | Number:Energy | Total Exported Energy (Q-) (kvarh) | - | - | - | - | - | - | - | - | Y | -| `emeter_tariff_indicator` | String | Current tariff indicator | Y | Y | Y | Y | Y | Y | Y | Y | - | -| `emeter_treshold_a_v2_1` | Number:ElectricCurrent | Actual treshold (A) | - | Y | - | - | - | - | - | - | - | -| `emeter_treshold_a` | Number:ElectricCurrent | Actual treshold (A) | Y | - | Y | Y | - | - | - | - | - | -| `emeter_treshold_kwh` | Number:Power | Actual treshold (kW) | - | - | - | - | Y | Y | - | - | - | -| `emeter_switch_position_v2_1` | Number | Switch position | - | Y | - | - | - | - | - | - | - | -| `emeter_switch_position` | Number | Switch position | Y | - | Y | Y | Y | Y | - | - | Y | -| `emeter_active_import_power` | Number:Power | Aggregate active import power (W) | Y | - | - | - | - | - | - | - | - | -| `emeter_actual_delivery` | Number:Power | Current power delivery (kW) | - | Y | Y | Y | Y | Y | Y | Y | Y | -| `emeter_actual_production` | Number:Power | Current power production (kW) | - | - | - | Y | Y | Y | Y | Y | Y | -| `emeter_actual_reactive_delivery` | Number | Actual Reactive Power Delivery (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_actual_reactive_production` | Number | Actual Reactive Power Production (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_active_threshold_smax` | Number | Active threshold (SMAX) (kVA) | - | - | - | - | - | - | - | - | Y | -| `emeter_power_failures` | Number | Number of power failures | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_long_power_failures` | Number | Number of long power failures | - | - | - | - | Y | Y | Y | Y | - | -| `emeter_power_failure_log_entries` | Number | Number of entries in the power failure log | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_power_failure_log_timestamp[x]` *note 2* | DateTime | Timestamp for entry [x] in the power failure log | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_power_failure_log_duration[x]` *note 2* | Number:Time | Duration for entry [x] the power failure log | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_voltage_sags_l1` | Number | Number of voltage sags L1 | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_voltage_sags_l2` | Number | Number of voltage sags L2 | - | - | - | - | O | O | O | O | O | -| `emeter_voltage_sags_l3` | Number | Number of voltage sags L3 | - | - | - | - | O | O | O | O | O | -| `emeter_voltage_swells_l1` | Number | Number of voltage swells L1 | - | - | - | - | Y | Y | Y | Y | - | -| `emeter_voltage_swells_l2` | Number | Number of voltage swells L2 | - | - | - | - | O | O | O | O | - | -| `emeter_voltage_swells_l3` | Number | Number of voltage swells L3 | - | - | - | - | O | O | O | O | - | -| `emeter_instant_current_l1` | Number:ElectricCurrent | Instant Current L1 (A) | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_instant_current_l2` | Number:ElectricCurrent | Instant Current L2 (A) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_current_l3` | Number:ElectricCurrent | Instant Current L3 (A) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_power_delivery_l1` | Number:Power | Instant Power Delivery L1 (kW) | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_instant_power_delivery_l2` | Number:Power | Instant Power Delivery L2 (kW) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_power_delivery_l3` | Number:Power | Instant Power Delivery L3 (kW) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_power_production_l1` | Number:Power | Instant Power Production L1 (kW) | - | - | - | - | Y | Y | Y | Y | Y | -| `emeter_instant_power_production_l2` | Number:Power | Instant Power Production L2 (kW) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_power_production_l3` | Number:Power | Instant Power Production L3 (kW) | - | - | - | - | O | O | O | O | O | -| `emeter_instant_reactive_power_delivery_l1` | Number:Power | Instant Reactive Power Delivery L1 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_reactive_power_delivery_l2` | Number:Power | Instant Reactive Power Delivery L2 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_reactive_power_delivery_l3` | Number:Power | Instant Reactive Power Delivery L3 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_reactive_power_production_l1` | Number:Power | Instant Reactive Power Prodcution L1 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_reactive_power_production_l2` | Number:Power | Instant Reactive Power Prodcution L2 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_reactive_power_production_l3` | Number:Power | Instant Reactive Power Prodcution L3 (kvar) | - | - | - | - | - | - | - | - | Y | -| `emeter_instant_voltage_l1` | Number:ElectricPotential | Instant Voltage L1 (V) | - | - | - | - | - | - | - | Y | - | -| `emeter_instant_voltage_l2` | Number:ElectricPotential | Instant Voltage L2 (V) | - | - | - | - | - | - | - | O | - | -| `emeter_instant_voltage_l3` | Number:ElectricPotential | Instant Voltage L3 (V) | - | - | - | - | - | - | - | O | - | -| | | **Channels for the slave electricity meter** | | | | | | | | | | -| `meter_device_type` | String | Slave Electricity Meter Device Type | - | - | - | - | Y | Y | Y | Y | - | -| `meter_equipment_identifier` | String | Slave Electricity Meter ID | - | - | - | - | Y | Y | Y | Y | - | -| `emeter_delivery_tariff0` | Number:Energy | Total amount of slave electricity used for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_delivery_tariff1` | Number:Energy | Total amount of slave electricity used for tariff 1 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_delivery_tariff2` | Number:Energy | Total amount of slave electricity used for tariff 2 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_production_tariff0` | Number:Energy | Total amount of slave electricity produced for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_production_tariff1` | Number:Energy | Total amount of slave electricity produced for tariff 1 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_production_tariff2` | Number:Energy | Total amount of slave electricity produced for tariff 2 (kWh) | Y | - | - | - | - | - | - | - | - | -| `emeter_tariff_indicator` | String | Current slave tariff indicator | Y | - | - | - | - | - | - | - | - | -| `emeter_treshold_a` | Number:ElectricCurrent | Actual slave treshold (A) | Y | - | - | - | - | - | - | - | - | -| `meter_switch_position` | Number | Slave electricity switch position | Y | - | - | Y | Y | Y | - | - | - | -| `emeter_active_import_power` | Number:Power | Slave aggregate active import power (W) | Y | - | - | - | - | - | - | - | - | -| `emeter_value` | Number:Energy | Slave electricity usage (kWh) in the past period | - | - | - | - | Y | Y | Y | Y | - | -| `emeter_value_timestamp` | DateTime | Timestamp of the last reading | - | - | - | - | Y | Y | Y | Y | - | -| `meter_device_type` | String | Gas Meter Device Type | - | - | - | Y | - | - | - | - | - | -| `meter_equipment_identifier` | String | Gas Meter ID | Y | - | - | Y | - | - | - | - | - | -| | | **Channels for the gas meter** | | | | | | | | | | -| `gmeter_equipment_identifier_v2` | String | Gas Meter ID | - | Y | Y | - | - | - | - | - | - | -| `gmeter_24h_delivery_v2` | Number:Volume | Gas Delivery past 24 hours | Y | Y | Y | - | - | - | - | - | - | -| `gmeter_24h_delivery_v2_timestamp` | DateTime | Timestamp of the last reading | Y | Y | Y | - | - | - | - | - | - | -| `gmeter_24h_delivery_compensated_v2` | Number:Volume | Gas Delivery past 24 hours (compensated) | - | Y | Y | - | - | - | - | - | - | -| `gmeter_24h_delivery_compensated_v2_timestamp` | DateTime | Timestamp of the last reading | - | Y | Y | - | - | - | - | - | - | -| `gmeter_value_v3` | Number:Volume | Gas Delivery past period | - | - | - | Y | - | - | - | - | - | -| `gmeter_value_v3_timestamp` | DateTime | Timestamp of the last reading | - | - | - | Y | - | - | - | - | - | -| `gmeter_valve_position_v2_1` | Number | Gas Valve position | - | Y | - | - | - | - | - | - | - | -| `gmeter_valve_position_v2_2` | Number | Gas Valve position | Y | - | Y | - | - | - | - | - | - | -| | | **Channels for the generic meter** | | | | | | | | | | -| `meter_valve_switch_position` | Number | Gas Valve position | - | - | - | Y | - | - | - | - | - | -| `meter_device_type` | String | Generic Meter Device Type | - | - | - | Y | - | - | - | - | - | -| `gmeter_equipment_identifier` | String | Generic Meter ID | - | - | - | Y | - | - | - | - | - | -| `genmeter_value_v3` | Number | Delivery past period | - | - | - | Y | - | - | - | - | - | -| `meter_valve_switch_position` | Number | Generic Meter Valve/Switch position | - | - | - | Y | - | - | - | - | - | -| | | **Channels for the GJ meter (Heating or Cooling)** | | | | | | | | | | -| `meter_device_type` | String | GJ Meter Device Type | - | - | - | Y | Y | Y | Y | Y | - | -| `meter_equipment_identifier` | Number | GJ Meter ID | - | - | - | Y | Y | Y | Y | Y | - | -| `gjmeter_value_v3` | Number:Energy | GJ Delivery past period | - | - | - | Y | - | - | - | - | - | -| `gjmeter_value_v3_timestamp` | DateTime | Timestamp of the last reading | - | - | - | Y | - | - | - | - | - | -| `gjmeter_value_v4` | Number:Energy | GJ Delivery past period | - | - | - | - | Y | Y | Y | Y | - | -| `gjmeter_value_v4_timestamp` | DateTime | Timestamp of the last reading | - | - | - | - | Y | Y | Y | Y | - | -| | | **Channels for the heating meter** | | | | | | | | | | -| `meter_valve_switch_position` | Number | GJ Meter Valve position | - | - | - | Y | Y | Y | Y | - | - | -| `meter_equipment_identifier` | String | Heating Meter ID | Y | - | - | - | - | - | - | - | - | -| `hmeter_equipment_identifier_v2_2` | String | Heating Meter ID | - | - | Y | - | - | - | - | - | - | -| `hmeter_value_v2` | Number:Energy | Heating Delivery past period | Y | - | Y | - | - | - | - | - | - | -| `hmeter_value_v2_timestamp` | DateTime | Timestamp of the last reading | Y | - | Y | - | - | - | - | - | - | -| | | **Channels for the m3 meter (Gas or Water)** | | | | | | | | | | -| `meter_device_type` | String | m3 Meter Device Type | - | - | - | - | Y | Y | Y | Y | - | -| `meter_equipment_identifier` | String | m3 Meter ID | - | - | - | - | Y | Y | Y | Y | - | -| `m3meter_value` | Number:Volume | m3 Delivery past period | - | - | - | - | Y | Y | Y | Y | - | -| `meter_valve_switch_position` | Number | m3 Meter Valve position | - | - | - | - | Y | Y | Y | - | - | -| | | **Channels for the water meter** | | | | | | | | | | -| `meter_device_type` | String | Water Meter Device Type | - | - | - | Y | - | - | - | - | - | -| `meter_equipment_identifier` | String | Water Meter ID | Y | - | - | Y | - | - | - | - | - | -| `wmeter_equipment_identifier_v2_2` | String | Water Meter ID | - | - | Y | - | - | - | - | - | - | -| `wmeter_value_v2` | Number:Volume | Water Delivery past period | Y | - | Y | - | - | - | - | - | - | -| `wmeter_value_v2_timestamp` | DateTime | Timestamp of the last reading | Y | - | Y | - | - | - | - | - | - | -| `wmeter_value_v3` | Number:Volume | Water Delivery past period | - | - | - | Y | - | - | - | - | - | -| `meter_valve_switch_position` | Number | Water Meter Valve position | - | - | - | Y | - | - | - | - | - | +| Channel Type ID | Item Type | Description | Ace4000 | DSMR V2.1 | DSMR V2.2 | DSMR V3.0 | DSMR V4.0 | DSMR V4.0.4 | DSMR V4.2 | DSMR V5 |SMARTY V1.0 | e-MUCS V1.0 | +|--------------------------------------------------|--------------------------|------------------------------------------------------------------------|---------|-----------|-----------|-----------|-----------|-------------|-----------|---------|-------------|-------------| +| | | **Channels for the generic device** | | | | | | | | | | | +| `p1_text_code` | String | Text code from the device | - | Y | Y | Y | Y | Y | Y | - | - | - | +| `p1_text_string` | String | Text string from the device | - | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `p1_version_output` | String | Version information (most times this refers to the DSMR specification) | - | - | - | - | Y | Y | Y | Y | Y | - | +| `p1_emucs_version_output` | String | e-MUCS version information | - | - | - | - | - | - | - | - | Y | y | +| `p1_timestamp` | DateTime | Timestamp of the last device reading | - | - | - | - | Y | Y | Y | Y | Y | Y | +| | | **Channels for the cooling meter** | | | | | | | | | | | +| `cmeter_value_v2` | Number:Energy | The total amount of cooling used in the past period (GJ) | Y | - | Y | - | - | - | - | - | - | - | +| `cmeter_value_v2_timestamp` | DateTime | Timestamp of the last meter reading | Y | - | Y | - | - | - | - | - | - | - | +| `cmeter_equipment_identifier_v2_2` | String | Equipment identifier | - | - | Y | - | - | - | - | - | - | - | +| | | **Channels for the main electricity meter** | | | | | | | | | | | +| `emeter_equipment_identifier_v2_x` | String | Electricity Equipment identifier | - | Y | Y | - | - | - | - | - | Y | - | +| `emeter_equipment_identifier` | String | Electricity Equipment identifier | - | - | - | Y | Y | Y | Y | Y | - | Y | +| `emeter_delivery_tariff0` | Number:Energy | Total amount of electricity used for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | Y | - | +| `emeter_delivery_tariff1` | Number:Energy | Total amount of electricity used for tariff 1 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | +| `emeter_delivery_tariff2` | Number:Energy | Total amount of electricity used for tariff 2 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | +| `emeter_production_tariff0` | Number:Energy | Total amount of electricity produced for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | Y | - | +| `emeter_production_tariff1` | Number:Energy | Total amount of electricity produced for tariff 1 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | +| `emeter_production_tariff2` | Number:Energy | Total amount of electricity produced for tariff 2 (kWh) | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | +| `emeter_delivery_tariff0_antifraud` | Number:Energy | Total amount of electricity used for tariff 2 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_delivery_tariff1_antifraud` | Number:Energy | Total amount of electricity used for tariff 1 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_delivery_tariff2_antifraud` | Number:Energy | Total amount of electricity used for tariff 2 [antifraud] (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_total_imported_energy_register_q` | Number:Energy | Total Imported Energy (Q+) (kvarh) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_total_exported_energy_register_q` | Number:Energy | Total Exported Energy (Q-) (kvarh) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_tariff_indicator` | String | Current tariff indicator | Y | Y | Y | Y | Y | Y | Y | Y | - | Y | +| `emeter_treshold_a_v2_1` | Number:ElectricCurrent | Actual treshold (A) | - | Y | - | - | - | - | - | - | - | - | +| `emeter_treshold_a` | Number:ElectricCurrent | Actual treshold (A) | Y | - | Y | Y | - | - | - | - | - | - | +| `emeter_treshold_kwh` | Number:Power | Actual treshold (kW) | - | - | - | - | Y | Y | - | - | - | Y | +| `emeter_switch_position_v2_1` | Number | Switch position | - | Y | - | - | - | - | - | - | - | - | +| `emeter_switch_position` | Number | Switch position | Y | - | Y | Y | Y | Y | - | - | Y | Y | +| `emeter_active_import_power` | Number:Power | Aggregate active import power (W) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_actual_delivery` | Number:Power | Current power delivery (kW) | - | Y | Y | Y | Y | Y | Y | Y | Y | Y | +| `emeter_actual_production` | Number:Power | Current power production (kW) | - | - | - | Y | Y | Y | Y | Y | Y | Y | +| `emeter_actual_reactive_delivery` | Number | Actual Reactive Power Delivery (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_actual_reactive_production` | Number | Actual Reactive Power Production (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_active_threshold_smax` | Number | Active threshold (SMAX) (kVA) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_power_failures` | Number | Number of power failures | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_long_power_failures` | Number | Number of long power failures | - | - | - | - | Y | Y | Y | Y | - | - | +| `emeter_power_failure_log_entries` | Number | Number of entries in the power failure log | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_power_failure_log_timestamp[x]` *note 2* | DateTime | Timestamp for entry [x] in the power failure log | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_power_failure_log_duration[x]` *note 2* | Number:Time | Duration for entry [x] the power failure log | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_voltage_sags_l1` | Number | Number of voltage sags L1 | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_voltage_sags_l2` | Number | Number of voltage sags L2 | - | - | - | - | O | O | O | O | O | - | +| `emeter_voltage_sags_l3` | Number | Number of voltage sags L3 | - | - | - | - | O | O | O | O | O | - | +| `emeter_voltage_swells_l1` | Number | Number of voltage swells L1 | - | - | - | - | Y | Y | Y | Y | - | - | +| `emeter_voltage_swells_l2` | Number | Number of voltage swells L2 | - | - | - | - | O | O | O | O | - | - | +| `emeter_voltage_swells_l3` | Number | Number of voltage swells L3 | - | - | - | - | O | O | O | O | - | - | +| `emeter_instant_current_l1` | Number:ElectricCurrent | Instant Current L1 (A) | - | - | - | - | Y | Y | Y | Y | Y | Y | +| `emeter_instant_current_l2` | Number:ElectricCurrent | Instant Current L2 (A) | - | - | - | - | O | O | O | O | O | Y | +| `emeter_instant_current_l3` | Number:ElectricCurrent | Instant Current L3 (A) | - | - | - | - | O | O | O | O | O | Y | +| `emeter_instant_power_delivery_l1` | Number:Power | Instant Power Delivery L1 (kW) | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_instant_power_delivery_l2` | Number:Power | Instant Power Delivery L2 (kW) | - | - | - | - | O | O | O | O | O | - | +| `emeter_instant_power_delivery_l3` | Number:Power | Instant Power Delivery L3 (kW) | - | - | - | - | O | O | O | O | O | - | +| `emeter_instant_power_production_l1` | Number:Power | Instant Power Production L1 (kW) | - | - | - | - | Y | Y | Y | Y | Y | - | +| `emeter_instant_power_production_l2` | Number:Power | Instant Power Production L2 (kW) | - | - | - | - | O | O | O | O | O | - | +| `emeter_instant_power_production_l3` | Number:Power | Instant Power Production L3 (kW) | - | - | - | - | O | O | O | O | O | - | +| `emeter_instant_reactive_power_delivery_l1` | Number:Power | Instant Reactive Power Delivery L1 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_reactive_power_delivery_l2` | Number:Power | Instant Reactive Power Delivery L2 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_reactive_power_delivery_l3` | Number:Power | Instant Reactive Power Delivery L3 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_reactive_power_production_l1` | Number:Power | Instant Reactive Power Prodcution L1 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_reactive_power_production_l2` | Number:Power | Instant Reactive Power Prodcution L2 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_reactive_power_production_l3` | Number:Power | Instant Reactive Power Prodcution L3 (kvar) | - | - | - | - | - | - | - | - | Y | - | +| `emeter_instant_voltage_l1` | Number:ElectricPotential | Instant Voltage L1 (V) | - | - | - | - | - | - | - | Y | - | Y | +| `emeter_instant_voltage_l2` | Number:ElectricPotential | Instant Voltage L2 (V) | - | - | - | - | - | - | - | O | - | Y | +| `emeter_instant_voltage_l3` | Number:ElectricPotential | Instant Voltage L3 (V) | - | - | - | - | - | - | - | O | - | Y | +| | | **Channels for the slave electricity meter** | | | | | | | | | | | +| `meter_device_type` | String | Slave Electricity Meter Device Type | - | - | - | - | Y | Y | Y | Y | - | - | +| `meter_equipment_identifier` | String | Slave Electricity Meter ID | - | - | - | - | Y | Y | Y | Y | - | - | +| `emeter_delivery_tariff0` | Number:Energy | Total amount of slave electricity used for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_delivery_tariff1` | Number:Energy | Total amount of slave electricity used for tariff 1 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_delivery_tariff2` | Number:Energy | Total amount of slave electricity used for tariff 2 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_production_tariff0` | Number:Energy | Total amount of slave electricity produced for tariff 0 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_production_tariff1` | Number:Energy | Total amount of slave electricity produced for tariff 1 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_production_tariff2` | Number:Energy | Total amount of slave electricity produced for tariff 2 (kWh) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_tariff_indicator` | String | Current slave tariff indicator | Y | - | - | - | - | - | - | - | - | - | +| `emeter_treshold_a` | Number:ElectricCurrent | Actual slave treshold (A) | Y | - | - | - | - | - | - | - | - | - | +| `meter_switch_position` | Number | Slave electricity switch position | Y | - | - | Y | Y | Y | - | - | - | - | +| `emeter_active_import_power` | Number:Power | Slave aggregate active import power (W) | Y | - | - | - | - | - | - | - | - | - | +| `emeter_value` | Number:Energy | Slave electricity usage (kWh) in the past period | - | - | - | - | Y | Y | Y | Y | - | - | +| `emeter_value_timestamp` | DateTime | Timestamp of the last reading | - | - | - | - | Y | Y | Y | Y | - | - | +| | | **Channels for the gas meter** | | | | | | | | | | | +| `meter_device_type` | String | Gas Meter Device Type | - | - | - | Y | - | - | - | - | - | Y | +| `meter_equipment_identifier` | String | Gas Meter ID | Y | - | - | Y | - | - | - | - | - | Y | +| `gmeter_equipment_identifier_v2` | String | Gas Meter ID | - | Y | Y | - | - | - | - | - | - | - | +| `gmeter_24h_delivery_v2` | Number:Volume | Gas Delivery past 24 hours | Y | Y | Y | - | - | - | - | - | - | - | +| `gmeter_24h_delivery_v2_timestamp` | DateTime | Timestamp of the last reading | Y | Y | Y | - | - | - | - | - | - | - | +| `gmeter_24h_delivery_compensated_v2` | Number:Volume | Gas Delivery past 24 hours (compensated) | - | Y | Y | - | - | - | - | - | - | - | +| `gmeter_24h_delivery_compensated_v2_timestamp` | DateTime | Timestamp of the last reading | - | Y | Y | - | - | - | - | - | - | - | +| `gmeter_value_v3` | Number:Volume | Gas Delivery past period | - | - | - | Y | - | - | - | - | - | - | +| `gmeter_value_v3_timestamp` | DateTime | Timestamp of the last reading | - | - | - | Y | - | - | - | - | - | - | +| `gmeter_last_value` | Number:Volume | Gas Delivery last reading value | - | - | - | - | - | - | - | - | - | Y | +| `gmeter_last_value_timestamp` | DateTime | Timesamp of last Gas Delivery reading | - | - | - | - | - | - | - | - | - | Y | +| `gmeter_valve_position_v2_1` | Number | Gas Valve position | - | Y | - | - | - | - | - | - | - | - | +| `gmeter_valve_position_v2_2` | Number | Gas Valve position | Y | - | Y | - | - | - | - | - | - | - | +| `meter_valve_switch_position` | Number | Gas Valve position | - | - | - | Y | - | - | - | - | - | Y | +| | | **Channels for the generic meter** | | | | | | | | | | | +| `meter_device_type` | String | Generic Meter Device Type | - | - | - | Y | - | - | - | - | - | - | +| `gmeter_equipment_identifier` | String | Generic Meter ID | - | - | - | Y | - | - | - | - | - | - | +| `genmeter_value_v3` | Number | Delivery past period | - | - | - | Y | - | - | - | - | - | - | +| `meter_valve_switch_position` | Number | Generic Meter Valve/Switch position | - | - | - | Y | - | - | - | - | - | - | +| | | **Channels for the GJ meter (Heating or Cooling)** | | | | | | | | | | - | +| `meter_device_type` | String | GJ Meter Device Type | - | - | - | Y | Y | Y | Y | Y | - | | +| `meter_equipment_identifier` | Number | GJ Meter ID | - | - | - | Y | Y | Y | Y | Y | - | - | +| `gjmeter_value_v3` | Number:Energy | GJ Delivery past period | - | - | - | Y | - | - | - | - | - | - | +| `gjmeter_value_v3_timestamp` | DateTime | Timestamp of the last reading | - | - | - | Y | - | - | - | - | - | - | +| `gjmeter_value_v4` | Number:Energy | GJ Delivery past period | - | - | - | - | Y | Y | Y | Y | - | - | +| `gjmeter_value_v4_timestamp` | DateTime | Timestamp of the last reading | - | - | - | - | Y | Y | Y | Y | - | - | +| | | **Channels for the heating meter** | | | | | | | | | | | +| `meter_valve_switch_position` | Number | GJ Meter Valve position | - | - | - | Y | Y | Y | Y | - | - | - | +| `meter_equipment_identifier` | String | Heating Meter ID | Y | - | - | - | - | - | - | - | - | - | +| `hmeter_equipment_identifier_v2_2` | String | Heating Meter ID | - | - | Y | - | - | - | - | - | - | - | +| `hmeter_value_v2` | Number:Energy | Heating Delivery past period | Y | - | Y | - | - | - | - | - | - | - | +| `hmeter_value_v2_timestamp` | DateTime | Timestamp of the last reading | Y | - | Y | - | - | - | - | - | - | - | +| | | m3 Meter Device Type | - | - | - | - | Y | Y | Y | Y | - | - | +| `meter_equipment_identifier` | String | m3 Meter ID | - | - | - | - | Y | Y | Y | Y | - | - | +| `m3meter_value` | Number:Volume | m3 Delivery past period | - | - | - | - | Y | Y | Y | Y | - | - | +| `meter_valve_switch_position` | Number | m3 Meter Valve position | - | - | - | - | Y | Y | Y | - | - | - | +| | | **Channels for the water meter** | | | | | | | | | | | +| `meter_device_type` | String | Water Meter Device Type | - | - | - | Y | - | - | - | - | - | - | +| `meter_equipment_identifier` | String | Water Meter ID | Y | - | - | Y | - | - | - | - | - | - | +| `wmeter_equipment_identifier_v2_2` | String | Water Meter ID | - | - | Y | - | - | - | - | - | - | - | +| `wmeter_value_v2` | Number:Volume | Water Delivery past period | Y | - | Y | - | - | - | - | - | - | - | +| `wmeter_value_v2_timestamp` | DateTime | Timestamp of the last reading | Y | - | Y | - | - | - | - | - | - | - | +| `wmeter_value_v3` | Number:Volume | Water Delivery past period | - | - | - | Y | - | - | - | - | - | - | +| `meter_valve_switch_position` | Number | Water Meter Valve position | - | - | - | Y | - | - | - | - | - | - | *note 2*. The power failure log has a dynamic number of entries starting at `0`. So `emeter_power_failure_log_timestamp0`, `emeter_power_failure_log_duration0` refers to the first entry, @@ -288,7 +301,7 @@ Channel identifier: `dsmr:<ThingTypeID>:<bridge id>:<id>:<channel type id>` - id. The configured id for the ThingType you want to address - channel type id. The channel type id -The following configuration must to be added to a item configuration file. E.g. `things/dsmr.items` +The following configuration must to be added to an item configuration file. E.g. `things/dsmr.items` ``` ItemType <name> "<description>" (<Group>) {channel="<Channel identifier>"} diff --git a/bundles/org.openhab.binding.dsmr/pom.xml b/bundles/org.openhab.binding.dsmr/pom.xml index 826f1fffd996d..60efbc0aa91b3 100644 --- a/bundles/org.openhab.binding.dsmr/pom.xml +++ b/bundles/org.openhab.binding.dsmr/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.dsmr</artifactId> diff --git a/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml b/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml index 3c2c4b9ca019e..f848335f9d1ec 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.dsmr-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-dsmr" description="DSMR Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRBindingConstants.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRBindingConstants.java index 6c1160fdd3f02..97fb20c10dc91 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRBindingConstants.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRHandlerFactory.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRHandlerFactory.java index d00799f9b104b..b5b9e54d9f718 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRHandlerFactory.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/DSMRHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDevice.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDevice.java index ed0ee99a02c08..f7b34d8d9768b 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDevice.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceConfiguration.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceConfiguration.java index 034ef1b042841..7da696ef52d8e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceConfiguration.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceRunnable.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceRunnable.java index 218ee4f46fbc0..ba7e9b9dcdae3 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceRunnable.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRDeviceRunnable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMREventListener.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMREventListener.java index f7e953729bf8a..dee4d0a38fa44 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMREventListener.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMREventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRFixedConfigDevice.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRFixedConfigDevice.java index 4b1278b218bf8..41491295c2df1 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRFixedConfigDevice.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRFixedConfigDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java index f2b4c47aa8921..e8b4b4811a1a8 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -40,18 +40,18 @@ public class DSMRSerialAutoDevice implements DSMRDevice, DSMREventListener { * Enum to keep track of the internal state of {@link DSMRSerialAutoDevice}. */ enum DeviceState { - /** - * Discovers the settings of the serial port. - */ - DISCOVER_SETTINGS, - /** - * Device is receiving telegram data from the serial port. - */ - NORMAL, - /** - * Communication with serial port isn't working. - */ - ERROR + /** + * Discovers the settings of the serial port. + */ + DISCOVER_SETTINGS, + /** + * Device is receiving telegram data from the serial port. + */ + NORMAL, + /** + * Communication with serial port isn't working. + */ + ERROR } /** diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRTelegramListener.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRTelegramListener.java index 6c54535043d1c..55d31d40836f1 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRTelegramListener.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/DSMRTelegramListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypter.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypter.java index 0702965d0e319..77d32e010063d 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypter.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRBaseConnector.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRBaseConnector.java index 9e47ee3ca3200..90daf8bbcd54d 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRBaseConnector.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRBaseConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorErrorEvent.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorErrorEvent.java index 4a11d85a200a6..ce84cc4ae730a 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorErrorEvent.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorErrorEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorListener.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorListener.java index 023bc168c8e74..ce42428171f99 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorListener.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRConnectorListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java index ebd271351ae8f..16e1743057440 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialSettings.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialSettings.java index 9f53baef1c49d..3326e1e4e1d0d 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialSettings.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialSettings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDate.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDate.java index 54141856ca251..1e32cfc23c058 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDate.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDecimal.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDecimal.java index a09f093ac8af7..f65606fdcd2cc 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDecimal.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemDecimal.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemHexString.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemHexString.java index 9587570f6a9c0..0746dc6c63c38 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemHexString.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemHexString.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,7 +39,7 @@ class CosemHexString extends CosemValueDescriptor<StringType> { */ @Override protected StringType getStateValue(String cosemValue) throws ParseException { - final String cosemHexValue = cosemValue.replaceAll("\\r\\n", ""); + final String cosemHexValue = cosemValue.replaceAll("\\r\\n", "").trim(); if (cosemHexValue.length() % 2 != 0) { throw new ParseException(cosemHexValue + " is not a valid hexadecimal string", 0); @@ -50,7 +50,11 @@ protected StringType getStateValue(String cosemValue) throws ParseException { final String hexValue = cosemHexValue.substring(i, i + 2); if (!NO_VALUE.equals(hexValue)) { - sb.append((char) Integer.parseInt(hexValue, 16)); + try { + sb.append((char) Integer.parseInt(hexValue, 16)); + } catch (NumberFormatException e) { + throw new ParseException("Failed to parse hex value from '" + cosemValue + "' as char", i); + } } } return new StringType(sb.toString()); diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObject.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObject.java index c25caa3857b37..8229140fc80f8 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObject.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectFactory.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectFactory.java index f2f665992f167..a53202d903527 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectFactory.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,17 +35,22 @@ public class CosemObjectFactory { /** * Lookup cache for fixed OBIS Identifiers */ - private final Map<OBISIdentifier, CosemObjectType> obisLookupTableFixed; + private final Map<OBISIdentifier, CosemObjectType> obisLookupTableFixed = new HashMap<>(); + + /** + * Lookup cache for fixed OBIS Identifiers that has the same id for different data types + */ + private final Map<OBISIdentifier, List<CosemObjectType>> obisLookupTableMultipleFixed = new HashMap<>(); /** * Lookup cache for dynamic OBIS Identifiers */ - private final HashMap<OBISIdentifier, CosemObjectType> obisLookupTableDynamic; + private final HashMap<OBISIdentifier, CosemObjectType> obisLookupTableDynamic = new HashMap<>(); /** * Lookup cache for wild card Cosem Object types */ - private final List<CosemObjectType> obisWildcardCosemTypeList; + private final List<CosemObjectType> obisWildcardCosemTypeList = new ArrayList<>(); /** * Creates a new CosemObjectFactory @@ -66,13 +71,12 @@ public CosemObjectFactory() { * To facilitate autodiscovery the list has all supported CosemObjectTypes. To improve performance once the * correct OBISIdentifier is discovered for a certain OBISMsgType this is added to the obisLookupTableDynamic. */ - obisLookupTableFixed = new HashMap<>(); - obisLookupTableDynamic = new HashMap<>(); - obisWildcardCosemTypeList = new ArrayList<>(); - for (CosemObjectType msgType : CosemObjectType.values()) { if (msgType.obisId.reducedOBISIdentifierIsWildCard()) { obisWildcardCosemTypeList.add(msgType); + } else if (msgType.obisId.isConflict()) { + obisLookupTableMultipleFixed.computeIfAbsent(msgType.obisId, r -> new ArrayList<CosemObjectType>()) + .add(msgType); } else { obisLookupTableFixed.put(msgType.obisId, msgType); } @@ -106,6 +110,14 @@ public CosemObjectFactory() { if (obisLookupTableFixed.containsKey(reducedObisId)) { cosemObject = getCosemObjectInternal(obisLookupTableFixed.get(reducedObisId), obisId, cosemStringValues); logger.trace("Found obisId {} in the fixed lookup table", reducedObisId); + } else if (obisLookupTableMultipleFixed.containsKey(reducedObisId)) { + for (CosemObjectType cosemObjectType : obisLookupTableMultipleFixed.get(reducedObisId)) { + cosemObject = getCosemObjectInternal(cosemObjectType, obisId, cosemStringValues); + if (cosemObject != null) { + logger.trace("Found obisId {} in the fixed lookup table", reducedObisId); + break; + } + } } else if (obisLookupTableDynamic.containsKey(reducedObisId)) { logger.trace("Found obisId {} in the dynamic lookup table", reducedObisId); cosemObject = getCosemObjectInternal(obisLookupTableDynamic.get(reducedObisId), obisId, cosemStringValues); diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectType.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectType.java index 0206af77dae51..df7fad7a75817 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectType.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemObjectType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -43,6 +43,7 @@ public enum CosemObjectType { /* General messages */ P1_VERSION_OUTPUT(new OBISIdentifier(1, 3, 0, 2, 8, null), CosemString.INSTANCE), + P1_EMUCS_VERSION_OUTPUT(new OBISIdentifier(0, 0, 96, 1, 4, null), CosemString.INSTANCE), P1_TIMESTAMP(new OBISIdentifier(0, 0, 1, 0, 0, null), new CosemDate("")), P1_TEXT_CODE(new OBISIdentifier(0, 0, 96, 13, 1, null), CosemHexString.INSTANCE), P1_TEXT_STRING(new OBISIdentifier(0, 0, 96, 13, 0, null), CosemHexString.INSTANCE), @@ -70,8 +71,8 @@ public enum CosemObjectType { EMETER_ACTUAL_DELIVERY(new OBISIdentifier(1, 0, 1, 7, 0, null), CosemQuantity.KILO_WATT), EMETER_ACTUAL_PRODUCTION(new OBISIdentifier(1, 0, 2, 7, 0, null), CosemQuantity.KILO_WATT), EMETER_TRESHOLD_A_V2_1(new OBISIdentifier(1, 0, 17, 0, 0, null), CosemQuantity.AMPERE), - EMETER_TRESHOLD_A(new OBISIdentifier(0, 0, 17, 0, 0, null), CosemQuantity.AMPERE), - EMETER_TRESHOLD_KWH(new OBISIdentifier(0, 0, 17, 0, 0, null), CosemQuantity.KILO_WATT), + EMETER_TRESHOLD_A(new OBISIdentifier(0, 0, 17, 0, 0, null, true), CosemQuantity.AMPERE), + EMETER_TRESHOLD_KWH(new OBISIdentifier(0, 0, 17, 0, 0, null, true), CosemQuantity.KILO_WATT), EMETER_SWITCH_POSITION_V2_1(new OBISIdentifier(1, 0, 96, 3, 10, null), CosemDecimal.INSTANCE), EMETER_SWITCH_POSITION(new OBISIdentifier(0, 0, 96, 3, 10, null), CosemDecimal.INSTANCE), EMETER_POWER_FAILURES(new OBISIdentifier(0, 0, 96, 7, 21, null), CosemDecimal.INSTANCE), @@ -104,6 +105,7 @@ public enum CosemObjectType { GMETER_24H_DELIVERY_V2(new OBISIdentifier(7, 0, 23, 1, 0, null), CosemQuantity.CUBIC_METRE, CosemDate.INSTANCE), GMETER_24H_DELIVERY_COMPENSATED_V2(new OBISIdentifier(7, 0, 23, 2, 0, null), CosemQuantity.CUBIC_METRE, CosemDate.INSTANCE), + GMETER_LAST_VALUE(new OBISIdentifier(0, null, 24, 2, 3, null), CosemDate.INSTANCE, CosemQuantity.CUBIC_METRE), GMETER_VALUE_V3(new OBISIdentifier(0, null, 24, 3, 0, null), CosemDate.INSTANCE, // Time stamp off the reading new CosemString("val1"), // Specification is not clear what this value is new CosemDecimal("val2"), // Specification is not clear what this value is @@ -143,7 +145,7 @@ public enum CosemObjectType { // The actual reactive's and threshold have no unit in the data and therefore are not quantity types. EMETER_ACTUAL_REACTIVE_DELIVERY(new OBISIdentifier(1, 0, 3, 7, 0, null), CosemDecimal.INSTANCE), EMETER_ACTUAL_REACTIVE_PRODUCTION(new OBISIdentifier(1, 0, 4, 7, 0, null), CosemDecimal.INSTANCE), - EMETER_ACTIVE_THRESHOLD_SMAX(new OBISIdentifier(0, 0, 17, 0, 0, null), CosemDecimal.INSTANCE), + EMETER_ACTIVE_THRESHOLD_SMAX(new OBISIdentifier(0, 0, 17, 0, 0, null, true), CosemDecimal.INSTANCE), EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L1(new OBISIdentifier(1, 0, 23, 7, 0, null), CosemQuantity.KILO_VAR), EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L2(new OBISIdentifier(1, 0, 43, 7, 0, null), CosemQuantity.KILO_VAR), EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L3(new OBISIdentifier(1, 0, 63, 7, 0, null), CosemQuantity.KILO_VAR), diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemQuantity.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemQuantity.java index 765c8b708cc1e..90545a9c6db8c 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemQuantity.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemQuantity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemString.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemString.java index 424e8a82369fb..048c8ea452daf 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemString.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemString.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemValueDescriptor.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemValueDescriptor.java index 45af03244ddea..7deb9030676c5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemValueDescriptor.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/CosemValueDescriptor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/OBISIdentifier.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/OBISIdentifier.java index 16db852cafcfc..714d193303df1 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/OBISIdentifier.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/cosem/OBISIdentifier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -46,6 +46,8 @@ public class OBISIdentifier { private @Nullable Integer groupE; private @Nullable Integer groupF; + private boolean conflict; + /** * Constructs a new OBIS Identifier (A-B:C.D.E.F) * @@ -58,12 +60,29 @@ public class OBISIdentifier { */ public OBISIdentifier(int groupA, @Nullable Integer groupB, int groupC, int groupD, @Nullable Integer groupE, @Nullable Integer groupF) { + this(groupA, groupB, groupC, groupD, groupE, groupF, false); + } + + /** + * Constructs a new OBIS Identifier (A-B:C.D.E.F) + * + * @param groupA A value + * @param groupB B value + * @param groupC C value + * @param groupD D value + * @param groupE E value + * @param groupF F value + * @param conflict if true indicates this OBIS Identifier is used for different types of data. + */ + public OBISIdentifier(int groupA, @Nullable Integer groupB, int groupC, int groupD, @Nullable Integer groupE, + @Nullable Integer groupF, boolean conflict) { this.groupA = groupA; this.groupB = groupB; this.groupC = groupC; this.groupD = groupD; this.groupE = groupE; this.groupF = groupF; + this.conflict = conflict; } /** @@ -104,6 +123,10 @@ public OBISIdentifier(String obisIDString) throws ParseException { } } + public boolean isConflict() { + return conflict; + } + /** * @return the groupA */ diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/CRC16.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/CRC16.java index d7bc51fac9a78..2304011dc606a 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/CRC16.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/CRC16.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java index d350eaa9deabb..c9b6be42c226c 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1Telegram.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,23 +32,24 @@ public class P1Telegram { * The TelegramState described the meta data of the P1Telegram */ public enum TelegramState { - /** - * OK. Telegram was successful received and CRC16 checksum is verified (CRC16 only for DSMR V4 and up) - */ - OK("P1 telegram received OK"), - /** - * CRC_ERROR. CRC16 checksum failed (only DSMR V4 and up) - */ - CRC_ERROR("CRC checksum failed for received P1 telegram"), - /** - * DATA_CORRUPTION. The P1 telegram has syntax errors. - */ - DATA_CORRUPTION("Received P1 telegram is corrupted"), - /** - * P1TelegramListener. The smarty telegram was successful received but could not be decoded because of an invalid - * encryption key. - */ - INVALID_ENCRYPTION_KEY("Failed to decrypt P1 telegram due to invalid encryption key"); + /** + * OK. Telegram was successful received and CRC16 checksum is verified (CRC16 only for DSMR V4 and up) + */ + OK("P1 telegram received OK"), + /** + * CRC_ERROR. CRC16 checksum failed (only DSMR V4 and up) + */ + CRC_ERROR("CRC checksum failed for received P1 telegram"), + /** + * DATA_CORRUPTION. The P1 telegram has syntax errors. + */ + DATA_CORRUPTION("Received P1 telegram is corrupted"), + /** + * P1TelegramListener. The smarty telegram was successful received but could not be decoded because of an + * invalid + * encryption key. + */ + INVALID_ENCRYPTION_KEY("Failed to decrypt P1 telegram due to invalid encryption key"); /** * public accessible state details diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramListener.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramListener.java index b262c1425883b..cfbc3b30231c2 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramListener.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java index 3ea47f207c3d7..b8da983340061 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,20 +42,20 @@ public class P1TelegramParser implements TelegramParser { * State of the parser */ private enum State { - /** Wait for the '/' character */ - WAIT_FOR_START, - /** '/' character seen */ - HEADER, - /** Waiting for the header to end with a CR & LF */ - CRLF, - /** Handling OBIS Identifier */ - DATA_OBIS_ID, - /** Parsing OBIS value */ - DATA_OBIS_VALUE, - /** OBIS value end seen ')' */ - DATA_OBIS_VALUE_END, - /** Parsing CRC value following '!' */ - CRC_VALUE + /** Wait for the '/' character */ + WAIT_FOR_START, + /** '/' character seen */ + HEADER, + /** Waiting for the header to end with a CR & LF */ + CRLF, + /** Handling OBIS Identifier */ + DATA_OBIS_ID, + /** Parsing OBIS value */ + DATA_OBIS_VALUE, + /** OBIS value end seen ')' */ + DATA_OBIS_VALUE_END, + /** Parsing CRC value following '!' */ + CRC_VALUE } /** diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/TelegramParser.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/TelegramParser.java index 8f4601ae67673..6091e272de1f0 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/TelegramParser.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/p1telegram/TelegramParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRBridgeDiscoveryService.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRBridgeDiscoveryService.java index 5a8eb9f81b515..9b27a0957977e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRBridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRBridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRDiscoveryService.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRDiscoveryService.java index fabee46834ac8..81a12b2ad468f 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRDiscoveryService.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetector.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetector.java index 3335aba9f89f6..49c12c8927b23 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetector.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java index a53232764cdbd..fee29f99612da 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -82,36 +82,36 @@ public void telegramReceived(P1Telegram telegram) { logger.debug("Detect meters from #{} objects", telegram.getCosemObjects().size()); } final Entry<Collection<DSMRMeterDescriptor>, Map<CosemObjectType, CosemObject>> detectedMeters = meterDetector - .detectMeters(telegram); + .detectMeters(telegram); verifyUnregisteredCosemObjects(telegram, detectedMeters.getValue()); validateConfiguredMeters(dsmrBridgeHandler.getThing().getThings(), - detectedMeters.getKey().stream().map(md -> md.getMeterType()).collect(Collectors.toSet())); + detectedMeters.getKey().stream().map(md -> md.getMeterType()).collect(Collectors.toSet())); detectedMeters.getKey().forEach(m -> meterDiscovered(m, dsmrBridgeHandler.getThing().getUID())); } protected void verifyUnregisteredCosemObjects(P1Telegram telegram, - Map<CosemObjectType, CosemObject> undetectedCosemObjects) { + Map<CosemObjectType, CosemObject> undetectedCosemObjects) { if (!undetectedCosemObjects.isEmpty()) { if (undetectedCosemObjects.entrySet().stream() - .anyMatch(e -> e.getKey() == CosemObjectType.METER_EQUIPMENT_IDENTIFIER - && e.getValue().getCosemValues().entrySet().stream() - .anyMatch(cv -> cv.getValue() instanceof StringType && cv.getValue().toString().isEmpty()))) { + .anyMatch(e -> e.getKey() == CosemObjectType.METER_EQUIPMENT_IDENTIFIER + && e.getValue().getCosemValues().entrySet().stream().anyMatch( + cv -> cv.getValue() instanceof StringType && cv.getValue().toString().isEmpty()))) { // Unregistered meter detected. log to the user. reportUnregisteredMeters(); } else { reportUnrecognizedCosemObjects(undetectedCosemObjects); logger.info("There are unrecognized cosem values in the data received from the meter," - + " which means some meters might not be detected. Please report your raw data as reference: {}", - telegram.getRawTelegram()); + + " which means some meters might not be detected. Please report your raw data as reference: {}", + telegram.getRawTelegram()); } } if (!telegram.getUnknownCosemObjects().isEmpty()) { logger.info("There are unrecognized cosem values in the data received from the meter," - + " which means you have values that can't be read by a channel: {}. Please report them and your raw data as reference: {}", - telegram.getUnknownCosemObjects().stream() - .map(e -> String.format("obis id:{}, value:{}", e.getKey(), e.getValue())) - .collect(Collectors.joining(", ")), - telegram.getRawTelegram()); + + " which means you have values that can't be read by a channel: {}. Please report them and your raw data as reference: {}", + telegram.getUnknownCosemObjects().stream() + .map(e -> String.format("obis id:{}, value:{}", e.getKey(), e.getValue())) + .collect(Collectors.joining(", ")), + telegram.getRawTelegram()); } } @@ -122,7 +122,7 @@ protected void verifyUnregisteredCosemObjects(P1Telegram telegram, */ protected void reportUnrecognizedCosemObjects(Map<CosemObjectType, CosemObject> unidentifiedCosemObjects) { unidentifiedCosemObjects - .forEach((k, v) -> logger.info("Unrecognized cosem object '{}' found in the data: {}", k, v)); + .forEach((k, v) -> logger.info("Unrecognized cosem object '{}' found in the data: {}", k, v)); } /** @@ -130,7 +130,7 @@ protected void reportUnrecognizedCosemObjects(Map<CosemObjectType, CosemObject> */ protected void reportUnregisteredMeters() { logger.info( - "An unregistered meter has been found. Probably a new meter. Retry discovery once the meter is registered with the energy provider."); + "An unregistered meter has been found. Probably a new meter. Retry discovery once the meter is registered with the energy provider."); } /** @@ -155,10 +155,10 @@ private void validateConfiguredMeters(List<Thing> things, Set<DSMRMeterType> con // Create list of all configured meters that are not in the detected list. If not empty meters might not be // correctly configured. final List<DSMRMeterType> invalidConfigured = configuredMeters.stream() - .filter(dm -> !configuredMeterTypes.contains(dm)).collect(Collectors.toList()); + .filter(dm -> !configuredMeterTypes.contains(dm)).collect(Collectors.toList()); // Create a list of all detected meters not yet configured. final List<DSMRMeterType> unconfiguredMeters = configuredMeterTypes.stream() - .filter(dm -> !configuredMeters.contains(dm)).collect(Collectors.toList()); + .filter(dm -> !configuredMeters.contains(dm)).collect(Collectors.toList()); if (!invalidConfigured.isEmpty()) { reportConfigurationValidationResults(invalidConfigured, unconfiguredMeters); @@ -172,12 +172,12 @@ private void validateConfiguredMeters(List<Thing> things, Set<DSMRMeterType> con * @param unconfiguredMeters The list of meters that were detected, but not configured */ protected void reportConfigurationValidationResults(List<DSMRMeterType> invalidConfigured, - List<DSMRMeterType> unconfiguredMeters) { + List<DSMRMeterType> unconfiguredMeters) { logger.info( - "Possible incorrect meters configured. These are configured: {}." - + "But the following unconfigured meters are found in the data received from the meter: {}", - invalidConfigured.stream().map(m -> m.name()).collect(Collectors.joining(", ")), - unconfiguredMeters.stream().map(m -> m.name()).collect(Collectors.joining(", "))); + "Possible incorrect meters configured. These are configured: {}." + + "But the following unconfigured meters are found in the data received from the meter: {}", + invalidConfigured.stream().map(m -> m.name()).collect(Collectors.joining(", ")), + unconfiguredMeters.stream().map(m -> m.name()).collect(Collectors.joining(", "))); } public void setLocaleProvider(final LocaleProvider localeProvider) { diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRBridgeHandler.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRBridgeHandler.java index d42452fd493c2..fe412e5b9cae8 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRBridgeHandler.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRMeterHandler.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRMeterHandler.java index add2cf8818055..e77361ccea98d 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRMeterHandler.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/handler/DSMRMeterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeter.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeter.java index b64400c461c66..60ca6fdae9a96 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeter.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConfiguration.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConfiguration.java index 9a4efe1425eb4..80d3d3b602f67 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConfiguration.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConstants.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConstants.java index d2a52b1de989d..548197df6cdaf 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConstants.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterDescriptor.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterDescriptor.java index b0d4b14e0834c..e9bd0c2369239 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterDescriptor.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterDescriptor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterKind.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterKind.java index 2ec83542aafa4..f075623833de5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterKind.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterKind.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterType.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterType.java index 2ec3ca428ce41..23855169e5cab 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterType.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -291,7 +291,31 @@ public enum DSMRMeterType { CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L1, CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L2, CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_DELIVERY_L3, CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_PRODUCTION_L1, CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_PRODUCTION_L2, CosemObjectType.EMETER_INSTANT_REACTIVE_POWER_PRODUCTION_L3, - }); + }), + /** Belgium Smart Meter for the e-MUCS specification */ + DEVICE_EMUCS_V1_0(DSMRMeterKind.DEVICE, CosemObjectType.UNKNOWN, + CosemObjectType.P1_TEXT_STRING, CosemObjectType.P1_TEXT_STRING, CosemObjectType.P1_EMUCS_VERSION_OUTPUT, + CosemObjectType.P1_TIMESTAMP), + + /** Belgium Smart Electricity Meter for the e-MUCS specification */ + ELECTRICITY_EMUCS_V1_0(DSMRMeterKind.MAIN_ELECTRICITY, CosemObjectType.EMETER_EQUIPMENT_IDENTIFIER, + new CosemObjectType[] { + CosemObjectType.EMETER_EQUIPMENT_IDENTIFIER, CosemObjectType.EMETER_DELIVERY_TARIFF1, + CosemObjectType.EMETER_DELIVERY_TARIFF2, CosemObjectType.EMETER_PRODUCTION_TARIFF1, + CosemObjectType.EMETER_PRODUCTION_TARIFF2, CosemObjectType.EMETER_TARIFF_INDICATOR, + CosemObjectType.EMETER_ACTUAL_DELIVERY, CosemObjectType.EMETER_ACTUAL_PRODUCTION, + CosemObjectType.EMETER_TRESHOLD_KWH, CosemObjectType.EMETER_SWITCH_POSITION}, + new CosemObjectType[] { + CosemObjectType.EMETER_INSTANT_CURRENT_L1, CosemObjectType.EMETER_INSTANT_CURRENT_L2, + CosemObjectType.EMETER_INSTANT_CURRENT_L3, CosemObjectType.EMETER_INSTANT_VOLTAGE_L1, + CosemObjectType.EMETER_INSTANT_VOLTAGE_L2, CosemObjectType.EMETER_INSTANT_VOLTAGE_L3 + }), + + /** Belgium Smart Gas Meter for the e-MUCS specification */ + GAS_EMUCS_V1_0(DSMRMeterKind.GAS, CosemObjectType.EMETER_EQUIPMENT_IDENTIFIER, + new CosemObjectType[] { + CosemObjectType.EMETER_EQUIPMENT_IDENTIFIER, CosemObjectType.METER_DEVICE_TYPE, + CosemObjectType.GMETER_LAST_VALUE, CosemObjectType.METER_VALVE_SWITCH_POSITION }); // @formatter:on public static final Set<ThingTypeUID> METER_THING_TYPES = Arrays.asList(DSMRMeterType.values()).stream() @@ -377,6 +401,8 @@ public DSMRMeterDescriptor isCompatible(Map<CosemObjectType, CosemObject> availa if (!availableCosemObjects.containsKey(objectType)) { logger.trace("Required objectType {} not found", objectType); return null; + } else { + logger.trace("FOUND Required objectType {}", objectType); } CosemObject cosemObject = availableCosemObjects.get(objectType); diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml index cb8a3d6caadd0..a5fddb51f50c5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/binding/binding.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" +<binding:binding id="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>DSMR Binding</name> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/i18n/dsmr_nl.properties b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/i18n/dsmr_nl.properties index bc735ecec8970..224e38fab3ae6 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/i18n/dsmr_nl.properties +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/i18n/dsmr_nl.properties @@ -29,7 +29,7 @@ error.connector.read_error = Leesfout. # thing types thing-type.dsmr.dsmrBridge.label = Slimme Meter -thing-type.dsmr.dsmrBridge.description = De Nederlandse Slimme Meter (DSMR) +thing-type.dsmr.dsmrBridge.description = De Slimme Meter (DSMR Nederland, e-MUCS Belgie) thing-type.dsmr.smartyBridge.label = Smarty Meter thing-type.dsmr.smartyBridge.description = De luxemburgse Slimme Meter 'Smarty' @@ -131,8 +131,12 @@ channel-type.dsmr.deliveryTariff0Type.label = Elektriciteitsverbruik Tarief 0 channel-type.dsmr.deliveryTariff0Type.description = Het totale elektriciteitsverbruik voor tarief 0. channel-type.dsmr.deliveryTariff1Type.label = Elektriciteitsverbruik Daltarief channel-type.dsmr.deliveryTariff1Type.description = Het totale elektriciteitsverbruik voor dal/nacht tarief 1. +channel-type.dsmr.deliveryTariff1BelgiumType.label = Elektriciteitsverbruik Piektarief +channel-type.dsmr.deliveryTariff1BelgiumType.description = Het totale elektriciteitsverbruik voor piek/dag tarief 1. channel-type.dsmr.deliveryTariff2Type.label = Elektriciteitsverbruik Piektarief channel-type.dsmr.deliveryTariff2Type.description = Het totale elektriciteitsverbruik voor piek/dag tarief 2. +channel-type.dsmr.deliveryTariff2BelgiumType.label = Elektriciteitsverbruik Daltarief +channel-type.dsmr.deliveryTariff2BelgiumType.description = Het totale elektriciteitsverbruik voor dal/nacht tarief 2. channel-type.dsmr.deliveryTariff0AntiFraudType.label = Elektriciteitsverbruik Tarief 0 channel-type.dsmr.deliveryTariff0AntiFraudType.description = Het totale elektriciteitsverbruik voor tarief 0 (anti-fraude). channel-type.dsmr.deliveryTariff1AntiFraudType.label = Elektriciteitsverbruik Daltarief @@ -143,8 +147,12 @@ channel-type.dsmr.productionTariff0Type.label = Teruggeleverde Elektriciteit Tar channel-type.dsmr.productionTariff0Type.description = De totale teruggeleverde elektriciteit voor tarief 0. channel-type.dsmr.productionTariff1Type.label = Teruggeleverde Elektriciteit Daltarief channel-type.dsmr.productionTariff1Type.description = De totale teruggeleverde elektriciteit voor dal/nacht tarief (1). +channel-type.dsmr.productionTariff1BelgiumType.label = Injectie Piektarief +channel-type.dsmr.productionTariff1BelgiumType.description = De totale injectie elektriciteit voor piek/dag tarief (1). channel-type.dsmr.productionTariff2Type.label = Teruggeleverde Elektriciteit Piektarief channel-type.dsmr.productionTariff2Type.description = De totale teruggeleverde elektriciteit voor piek/dag tarief (2). +channel-type.dsmr.productionTariff2BelgiumType.label = Injectie Daltarief +channel-type.dsmr.productionTariff2BelgiumType.description = De totale injectie elektriciteit voor dal/nacht tarief (2). channel-type.dsmr.tariffIndicatorType.label = Tarief Indicator channel-type.dsmr.tariffIndicatorType.description = De tarief indicatie van het huidge tarief (1 = dal/nacht, 2 = piek/dag). channel-type.dsmr.activeImportPowerType.label = Opgetelde Huidige Elektriciteit @@ -212,6 +220,11 @@ channel-type.dsmr.gasCompensatedDelivery24HType.label = Gecompenseerd Gasverbrui channel-type.dsmr.gasCompensatedDelivery24HType.description = Het totaal gecompenseerd gasverbruik in kubieke meter (m3) in de afgelopen 24 uur. channel-type.dsmr.gasDeliveryType.label = Gasverbruik channel-type.dsmr.gasDeliveryType.description = Het totaal aantal kubieke meter (m3) gasverbruik in de afgelopen periode. +channel-type.dsmr.gasLastDeliveryType.label = Gasverbruik +channel-type.dsmr.gasLastDeliveryType.description = Het totaal niet temperatuur gecorrigeerd aantal kubieke meter (m3) gasverbruik. +channel-type.dsmr.gasLastTimestampType.label = Tijd Gasmeting +channel-type.dsmr.gasLastTimestampType.description = Tijd van de laatste niet temperatuur gecorrigeerd gasverbruik registratie. + channel-type.dsmr.gasValvePositionType.label = Gasklepstand channel-type.dsmr.gasValvePositionType.description = De stand van de gasklep. diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml index 5aba8db01437b..53c58873a1b11 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_cooling.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml index 684b446a364b2..67436919487fb 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_electricity.xml @@ -28,6 +28,18 @@ <description>The total amount of electricity used for tariff 2.</description> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> + <channel-type id="deliveryTariff1BelgiumType"> + <item-type>Number:Energy</item-type> + <label>Delivery Tariff 1</label> + <description>The total amount of electricity used for tariff 1.</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="deliveryTariff2BelgiumType"> + <item-type>Number:Energy</item-type> + <label>Delivery Tariff 2</label> + <description>The total amount of electricity used for tariff 2.</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> <channel-type id="deliveryTariff0AntiFraudType" advanced="true"> <item-type>Number:Energy</item-type> <label>Delivery Tariff 0</label> @@ -64,6 +76,18 @@ <description>The total amount of electricity produced for tariff 2.</description> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> + <channel-type id="productionTariff1BelgiumType" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Production Tariff 1</label> + <description>The total amount of electricity produced for tariff 1.</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="productionTariff2BelgiumType" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Production Tariff 2</label> + <description>The total amount of electricity produced for tariff 2.</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> <channel-type id="totalImportedEnergyRegisterPType"> <item-type>Number:Energy</item-type> <label>Total Imported Energy (P+)</label> @@ -132,7 +156,7 @@ </channel-type> <channel-type id="actualTresholdkWType" advanced="true"> <item-type>Number:Power</item-type> - <label>Actual threshold</label> + <label>Actual Threshold</label> <description>The actual threshold.</description> <state pattern="%.3f %unit%" readOnly="true" /> </channel-type> @@ -150,13 +174,13 @@ </channel-type> <channel-type id="powerFailuresType" advanced="true"> <item-type>Number</item-type> - <label>Number Of Power Failures</label> + <label>Number of Power Failures</label> <description>The number of power failures.</description> <state readOnly="true" /> </channel-type> <channel-type id="longPowerFailuresType" advanced="true"> <item-type>Number</item-type> - <label>Number Of Long Power Failures</label> + <label>Number of Long Power Failures</label> <description>The number of long power failures.</description> <state readOnly="true" /> </channel-type> @@ -169,50 +193,50 @@ <channel-type id="powerFailureLogEndType" advanced="true"> <item-type>DateTime</item-type> <label>Power Failure End</label> - <description>Timestamp when the power failure ended. There can be multiple log entries. -Each entry has its own channel (emeter_power_failure_log_timestamp*x*, *x* = 0 - 9)</description> + <description>Timestamp when the power failure ended. There can be multiple log entries. + Each entry has its own channel (emeter_power_failure_log_timestamp*x*, *x* = 0 - 9)</description> <state readOnly="true" /> </channel-type> <channel-type id="powerFailureLogDurationType" advanced="true"> <item-type>Number:Time</item-type> <label>Power Failure Duration</label> - <description>Duration of the power failure. -Each entry has its own channel (emeter_power_failure_log_duration*x*, *x* = 0 - 9)</description> + <description>Duration of the power failure. + Each entry has its own channel (emeter_power_failure_log_duration*x*, *x* = 0 - 9)</description> <state pattern="%.0f %unit%" readOnly="true" /> </channel-type> <channel-type id="voltageSagsL1Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Sags L1</label> + <label>Number of Voltage Sags L1</label> <description>The number of voltage sags L1.</description> <state readOnly="true" /> </channel-type> <channel-type id="voltageSagsL2Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Sags L2</label> + <label>Number of Voltage Sags L2</label> <description>The number of voltage sags L2.</description> <state readOnly="true" /> </channel-type> <channel-type id="voltageSagsL3Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Sags L3</label> + <label>Number of Voltage Sags L3</label> <description>The number of voltage sags L3.</description> <state readOnly="true" /> </channel-type> <channel-type id="voltageSwellsL1Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Swells L1</label> + <label>Number of Voltage Swells L1</label> <description>The number of voltage swells L1.</description> <state readOnly="true" /> </channel-type> <channel-type id="voltageSwellsL2Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Swells L2</label> + <label>Number of Voltage Swells L2</label> <description>The number of voltage swells L2.</description> <state readOnly="true" /> </channel-type> <channel-type id="voltageSwellsL3Type" advanced="true"> <item-type>Number</item-type> - <label>Number Of Voltage Swells L3</label> + <label>Number of Voltage Swells L3</label> <description>The number of voltage swells L3.</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml index f5f803d4d738d..08927c882c8bc 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gas.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -21,6 +22,18 @@ <description>The total amount used in the past period.</description> <state pattern="%.3f %unit%" readOnly="true"></state> </channel-type> + <channel-type id="gasLastDeliveryType"> + <item-type>Number:Volume</item-type> + <label>Gas Delivery</label> + <description>Last value of not temperature corrected gas volume.</description> + <state pattern="%.3f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="gasLastTimestampType"> + <item-type>DateTime</item-type> + <label>Timestamp</label> + <description>Timestamp of the last gas meter capture time.</description> + <state readOnly="true"></state> + </channel-type> <channel-type id="gasValvePositionType"> <item-type>Number</item-type> <label>Gas Valve Position</label> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml index a7d9d47f7ce3b..84015d1216eea 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_generic.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml index 18e141f632013..f7c60cc24204e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_genericmeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml index 915be4ede6a20..c2a2e3089b174 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_gj.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml index 717ab571faeac..9bab08f6742a5 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_heating.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml index f1273b725c82d..d6958c48bd8d4 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_m3.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -11,7 +12,7 @@ </channel-type> <channel-type id="m3ValvePositionType"> <item-type>Number</item-type> - <label>Valve position</label> + <label>Valve Position</label> <description>The valve switch position.</description> <state pattern="%.3f %unit%" readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml index 3acc7eb50a3bf..af036d88ea070 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/channeltypes_water.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml index fa7f3019e6594..1c93d46e5eb5e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/dsmr_device.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="dsmrBridge"> <label>Smart Meter</label> - <description>The Dutch Smart Meter (DSMR)</description> + <description>The Dutch/Belgium Smart Meter (DSMR/e-MUCS)</description> <config-description-ref uri="thing-type:dsmr:bridgesettings" /> </bridge-type> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml index 25adb1adc8d2a..1e951864d4937 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_dsmr_v4.xml @@ -7,7 +7,7 @@ <thing-type id="device_v4" listed="false"> <supported-bridge-type-refs> <bridge-type-ref id="dsmrBridge" /> - <bridge-type-ref id="smartyBridge"/> + <bridge-type-ref id="smartyBridge" /> </supported-bridge-type-refs> <label>Device Meter (DSMR V4.x)</label> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_emucs_v1_0.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_emucs_v1_0.xml new file mode 100644 index 0000000000000..f332c5eb7a332 --- /dev/null +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_device_emucs_v1_0.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="device_v1_0" listed="false"> + <supported-bridge-type-refs> + <bridge-type-ref id="dsmrBridge" /> + </supported-bridge-type-refs> + + <label>Device Meter (e-MUCS V1.0)</label> + <description>This is the device meter that complies to the e-MUCS 1.0 specification.</description> + + <channels> + <channel id="p1_text_string" typeId="p1TextStringType" /> + <channel id="p1_emucs_version_output" typeId="p1VersionType" /> + <channel id="p1_timestamp" typeId="p1TimestampType" /> + </channels> + <config-description-ref uri="thing-type:dsmr:meterdescriptor" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml index 937985e7b48b2..fd622d40a390e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_ace4000.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml index c576c7b793710..4f4eb0909526e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_1.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml index 6c2d99e6b927d..705c73e50b399 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v2_2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml index d98e11cff2fcc..c9c7aad24153e 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_dsmr_v3.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_emucs_v1_0.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_emucs_v1_0.xml new file mode 100644 index 0000000000000..2f13b85a03bcc --- /dev/null +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_electricity_emucs_v1_0.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="electricity_emucs_v1_0" listed="false"> + <supported-bridge-type-refs> + <bridge-type-ref id="dsmrBridge" /> + </supported-bridge-type-refs> + + <label>Electricity Meter (e-MUCS V1.0)</label> + <description>This is an electricity meter that complies to the e-MUCS V1.0 specification.</description> + + <channels> + <channel id="emeter_equipment_identifier" typeId="equipmentIdType" /> + <channel id="emeter_delivery_tariff1" typeId="deliveryTariff1BelgiumType" /> + <channel id="emeter_delivery_tariff2" typeId="deliveryTariff2BelgiumType" /> + <channel id="emeter_production_tariff1" typeId="productionTariff1BelgiumType" /> + <channel id="emeter_production_tariff2" typeId="productionTariff2BelgiumType" /> + <channel id="emeter_tariff_indicator" typeId="tariffIndicatorType" /> + <channel id="emeter_actual_delivery" typeId="actualDeliveryType" /> + <channel id="emeter_actual_production" typeId="actualProductionType" /> + <channel id="emeter_switch_position" typeId="switchPositionType" /> + <channel id="emeter_treshold_kw" typeId="actualTresholdkWType" /> + <channel id="emeter_instant_current_l1" typeId="instantCurrentL1Type" /> + <channel id="emeter_instant_current_l2" typeId="instantCurrentL2Type" /> + <channel id="emeter_instant_current_l3" typeId="instantCurrentL3Type" /> + <channel id="emeter_instant_voltage_l1" typeId="instantVoltageL1Type" /> + <channel id="emeter_instant_voltage_l2" typeId="instantVoltageL2Type" /> + <channel id="emeter_instant_voltage_l3" typeId="instantVoltageL3Type" /> + </channels> + <config-description-ref uri="thing-type:dsmr:meterdescriptor" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_gasmeter_emucs_v1_0.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_gasmeter_emucs_v1_0.xml new file mode 100644 index 0000000000000..cc7feb33bfb70 --- /dev/null +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/meter_gasmeter_emucs_v1_0.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="gas_emucs_v1_0" listed="false"> + <supported-bridge-type-refs> + <bridge-type-ref id="dsmrBridge" /> + </supported-bridge-type-refs> + + <label>Gas Meter (e-MUCS V1.0)</label> + <description>This is a gas meter that complies to the e-MUCS V1.0 specification.</description> + + <channels> + <channel id="meter_device_type" typeId="deviceType" /> + <channel id="meter_equipment_identifier" typeId="equipmentIdType" /> + <channel id="gmeter_last_value" typeId="gasLastDeliveryType" /> + <channel id="gmeter_last_value_timestamp" typeId="gasLastTimestampType" /> + <channel id="meter_valve_switch_position" typeId="gasValvePositionType" /> + </channels> + <config-description-ref uri="thing-type:dsmr:meterdescriptor" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml index 7a9da2e565b40..2ea0a18555b1a 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml +++ b/bundles/org.openhab.binding.dsmr/src/main/resources/ESH-INF/thing/smarty_device.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="dsmr" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="dsmr" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java index dea925a61c35f..ad23950d24a2c 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/TelegramReaderUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -57,7 +57,7 @@ public static byte[] readRawTelegram(String telegramName) { * @return a P1Telegram object */ public static P1Telegram readTelegram(String telegramName, TelegramState expectedTelegramState) { - AtomicReference<P1Telegram> p1Telegram = new AtomicReference<>(null); + AtomicReference<P1Telegram> p1Telegram = new AtomicReference<>(); byte[] telegram = readRawTelegram(telegramName); P1TelegramParser parser = new P1TelegramParser(p1Telegram::set); diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java index ef2b4018f6647..8cf328a1d23bd 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/DSMRSerialAutoDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,7 +25,6 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.io.transport.serial.PortInUseException; import org.eclipse.smarthome.io.transport.serial.SerialPort; import org.eclipse.smarthome.io.transport.serial.SerialPortEvent; @@ -66,7 +65,7 @@ public SerialPortIdentifier getIdentifier(String name) { } @Override - public @NonNull Stream<@NonNull SerialPortIdentifier> getIdentifiers() { + public Stream<SerialPortIdentifier> getIdentifiers() { return Stream.empty(); } }; @@ -87,12 +86,12 @@ public void testHandlingDataAndRestart() throws IOException, PortInUseException AtomicReference<P1Telegram> telegramRef = new AtomicReference<>(null); DSMREventListener listener = new DSMREventListener() { @Override - public void handleTelegramReceived(@NonNull P1Telegram telegram) { + public void handleTelegramReceived(P1Telegram telegram) { telegramRef.set(telegram); } @Override - public void handleErrorEvent(@NonNull DSMRConnectorErrorEvent connectorErrorEvent) { + public void handleErrorEvent(DSMRConnectorErrorEvent connectorErrorEvent) { fail("No handleErrorEvent Expected" + connectorErrorEvent); } }; @@ -120,12 +119,12 @@ public void testHandleError() throws IOException, PortInUseException { AtomicReference<DSMRConnectorErrorEvent> eventRef = new AtomicReference<>(null); DSMREventListener listener = new DSMREventListener() { @Override - public void handleTelegramReceived(@NonNull P1Telegram telegram) { + public void handleTelegramReceived(P1Telegram telegram) { fail("No telegram expected:" + telegram); } @Override - public void handleErrorEvent(@NonNull DSMRConnectorErrorEvent connectorErrorEvent) { + public void handleErrorEvent(DSMRConnectorErrorEvent connectorErrorEvent) { eventRef.set(connectorErrorEvent); } }; diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypterTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypterTest.java index 601196d514c00..56181ecb2f381 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypterTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/SmartyDecrypterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParserTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParserTest.java index 1b099f3569db1..06a9c31b6fa42 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParserTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/device/p1telegram/P1TelegramParserTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -37,10 +37,11 @@ public class P1TelegramParserTest { @Parameters(name = "{0}") public static final List<Object[]> data() { return Arrays.asList(new Object[][] { - { "ace4000", 57, }, + { "ace4000", 59, }, { "dsmr_40", 39, }, { "dsmr_42", 39, }, { "dsmr_50", 41, }, + { "flu5", 20, }, { "Iskra_AM550", 41, }, { "Landis_Gyr_E350", 10, }, { "Landis_Gyr_ZCF110", 25, }, diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetectorTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetectorTest.java index 906f8d98af10c..b1f5f3c6222fc 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetectorTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDetectorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,7 @@ import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -52,6 +53,7 @@ public static final List<Object[]> data() { { "dsmr_40", EnumSet.of( DEVICE_V4, ELECTRICITY_V4_2, M3_V5_0)}, { "dsmr_42", EnumSet.of( DEVICE_V4, ELECTRICITY_V4_2, M3_V5_0)}, { "dsmr_50", EnumSet.of( DEVICE_V5, ELECTRICITY_V5_0, M3_V5_0)}, + { "flu5", EnumSet.of( DEVICE_EMUCS_V1_0, ELECTRICITY_EMUCS_V1_0, GAS_EMUCS_V1_0)}, { "Iskra_AM550", EnumSet.of( DEVICE_V5, ELECTRICITY_V5_0, M3_V5_0)}, { "Landis_Gyr_E350", EnumSet.of( DEVICE_V2_V3, ELECTRICITY_V3_0)}, { "Landis_Gyr_ZCF110", EnumSet.of( DEVICE_V4, ELECTRICITY_V4_2, M3_V5_0)}, @@ -74,10 +76,12 @@ public void testDetectMeters() { Entry<Collection<DSMRMeterDescriptor>, Map<CosemObjectType, CosemObject>> entry = detector .detectMeters(telegram); Collection<DSMRMeterDescriptor> detectMeters = entry.getKey(); + assertEquals("Should detect correct number of meters: " + Arrays.toString(detectMeters.toArray()), expectedMeters.size(), detectMeters.size()); - assertEquals("Should not have any undetected cosem objects", 0, entry.getValue().size()); - assertEquals("Should not have any unknown cosem objects", 0, telegram.getUnknownCosemObjects().size()); + assertEquals("Should not have any undetected cosem objects: ", Collections.emptyMap(), entry.getValue()); + assertEquals("Should not have any unknown cosem objects", Collections.emptyList(), + telegram.getUnknownCosemObjects()); for (DSMRMeterType meter : expectedMeters) { assertEquals( String.format("Meter '%s' not found: %s", meter, diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryServiceTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryServiceTest.java index 29b00dc44141f..1f4382ae63b84 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/discovery/DSMRMeterDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterTest.java b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterTest.java index 4e8fcc6be48d4..0952dab62704e 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterTest.java +++ b/bundles/org.openhab.binding.dsmr/src/test/java/org/openhab/binding/dsmr/internal/meter/DSMRMeterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes b/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes index d60cb9af4a020..35178d8987747 100644 --- a/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes +++ b/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes @@ -1,2 +1,2 @@ # Always keep the CRLF line endings because the CRC depends on it. -*.telegram binary \ No newline at end of file +*.telegram binary diff --git a/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/flu5.telegram b/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/flu5.telegram new file mode 100644 index 0000000000000..d3ba113f4b878 --- /dev/null +++ b/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/flu5.telegram @@ -0,0 +1,23 @@ +/FLU5\123456789_A + +0-0:96.1.4(50213) +0-0:96.1.1(1234567890123456789012345678) +0-0:1.0.0(191128000000W) +1-0:1.8.1(000123.456kWh) +1-0:1.8.2(000234.567kWh) +1-0:2.8.1(000345.678kWh) +1-0:2.8.2(000456.789kWh) +0-0:96.14.0(0001) +1-0:1.7.0(01.234kW) +1-0:2.7.0(00.000kW) +1-0:32.7.0(234.5V) +1-0:31.7.0(005A) +0-0:96.3.10(1) +0-0:17.0.0(999.9kW) +1-0:31.4.0(999A) +0-0:96.13.0() +0-1:24.1.0(003) +0-1:96.1.1(1234567890123456789012345678) +0-1:24.4.0(1) +0-1:24.2.3(191128000000W)(00099.999*m3) +!6EFB diff --git a/bundles/org.openhab.binding.dwdunwetter/NOTICE b/bundles/org.openhab.binding.dwdunwetter/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.dwdunwetter/NOTICE +++ b/bundles/org.openhab.binding.dwdunwetter/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.dwdunwetter/pom.xml b/bundles/org.openhab.binding.dwdunwetter/pom.xml index 46b4b45ea400b..0734e00f8aff8 100644 --- a/bundles/org.openhab.binding.dwdunwetter/pom.xml +++ b/bundles/org.openhab.binding.dwdunwetter/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.dwdunwetter</artifactId> diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/feature/feature.xml b/bundles/org.openhab.binding.dwdunwetter/src/main/feature/feature.xml index cfec8771f1d3b..73926267cd318 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.dwdunwetter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-dwdunwetter" description="DwdUnwetter Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/DwdUnwetterBindingConstants.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/DwdUnwetterBindingConstants.java index de77cd7f9f5f9..76bb37c0572e9 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/DwdUnwetterBindingConstants.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/DwdUnwetterBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/config/DwdUnwetterConfiguration.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/config/DwdUnwetterConfiguration.java index 6a51995ae8c20..e553a7976064d 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/config/DwdUnwetterConfiguration.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/config/DwdUnwetterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCache.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCache.java index 93162a38ba848..85997b7739eb2 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCache.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningData.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningData.java index a2cc4d9e72546..f69884021b5d6 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningData.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningDataAccess.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningDataAccess.java index 74127fc72f244..fdff4d3155281 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningDataAccess.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningDataAccess.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsData.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsData.java index ca19829b9edb0..9fbfdead74fa7 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsData.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdXmlTag.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdXmlTag.java index f5881ff74392b..9be42f877e66a 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdXmlTag.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/DwdXmlTag.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Severity.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Severity.java index 63f1c932c59d1..3c30efcb1e40b 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Severity.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Severity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/SeverityComparator.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/SeverityComparator.java index e426bc787e0ec..e0c5abe2fd638 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/SeverityComparator.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/SeverityComparator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Urgency.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Urgency.java index e756e23314150..90db7d82ac9d9 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Urgency.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/data/Urgency.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/factory/DwdUnwetterHandlerFactory.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/factory/DwdUnwetterHandlerFactory.java index f395301627bf6..07c2a28f052ea 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/factory/DwdUnwetterHandlerFactory.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/factory/DwdUnwetterHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/handler/DwdUnwetterHandler.java b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/handler/DwdUnwetterHandler.java index 7b96132437d11..afc51d87e9a6c 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/handler/DwdUnwetterHandler.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/java/org/openhab/binding/dwdunwetter/internal/handler/DwdUnwetterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -187,8 +187,8 @@ private List<Channel> createChannels() { channels.add(createChannel(CHANNEL_SEVERITY, "String", "Severity", i)); channels.add(createChannel(CHANNEL_DESCRIPTION, "String", "Description", i)); channels.add(createChannel(CHANNEL_EFFECTIVE, "DateTime", "Issued", i)); - channels.add(createChannel(CHANNEL_ONSET, "DateTime", "Valid from", i)); - channels.add(createChannel(CHANNEL_EXPIRES, "DateTime", "Valid to", i)); + channels.add(createChannel(CHANNEL_ONSET, "DateTime", "Valid From", i)); + channels.add(createChannel(CHANNEL_EXPIRES, "DateTime", "Valid To", i)); channels.add(createChannel(CHANNEL_EVENT, "String", "Type", i)); channels.add(createChannel(CHANNEL_HEADLINE, "String", "Headline", i)); channels.add(createChannel(CHANNEL_ALTITUDE, "Number:Length", "Height (from)", i)); diff --git a/bundles/org.openhab.binding.dwdunwetter/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.dwdunwetter/src/main/resources/ESH-INF/thing/thing-types.xml index 44e3d91a4833b..5710b40ff2cf5 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.dwdunwetter/src/main/resources/ESH-INF/thing/thing-types.xml @@ -16,12 +16,12 @@ With the % sign at the end it is possible to query multiple cells at once. For e </parameter> <parameter name="refresh" type="integer" unit="min" min="15"> <default>30</default> - <label>Refresh in minutes</label> + <label>Refresh in Minutes</label> <description>Time between to API requests in minutes. Minimum 15 minutes.</description> </parameter> <parameter name="warningCount" type="integer" min="1" max="15"> <default>1</default> - <label>Number of provided warnings</label> + <label>Number of Provided Warnings</label> <description><![CDATA[Number of warnings to provide. For each warning there will multiple channels. The warnings are sorted by severity first and begin second so the first warning is always the one with the highest severity.]]></description> @@ -81,13 +81,13 @@ This happens after all other channels are populated]]></description> </channel-type> <channel-type id="onset"> <item-type>DateTime</item-type> - <label>Valid from</label> + <label>Valid From</label> <description>Start Date and Time for which the warning is valid</description> <state readOnly="true" /> </channel-type> <channel-type id="expires"> <item-type>DateTime</item-type> - <label>Valid to</label> + <label>Valid To</label> <description>End Date and Time for which the warning is valid</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/DwdUnwetterHandlerTest.java b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/DwdUnwetterHandlerTest.java index 3b613385a8c21..eded0a5d7a779 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/DwdUnwetterHandlerTest.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/DwdUnwetterHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCacheTest.java b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCacheTest.java index f1ad0d1aed8b4..eb02be90dd287 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCacheTest.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningCacheTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsDataTest.java b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsDataTest.java index d30bcdd60763c..f5a588e700949 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsDataTest.java +++ b/bundles/org.openhab.binding.dwdunwetter/src/test/java/org/openhab/binding/dwdunwetter/internal/data/DwdWarningsDataTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.dwdunwetter/src/test/resources/org/openhab/binding/dwdunwetter/internal/data/warnings.xml b/bundles/org.openhab.binding.dwdunwetter/src/test/resources/org/openhab/binding/dwdunwetter/internal/data/warnings.xml index 96c219e59498b..888e531769988 100644 --- a/bundles/org.openhab.binding.dwdunwetter/src/test/resources/org/openhab/binding/dwdunwetter/internal/data/warnings.xml +++ b/bundles/org.openhab.binding.dwdunwetter/src/test/resources/org/openhab/binding/dwdunwetter/internal/data/warnings.xml @@ -123,4 +123,4 @@ </dwd:THE_GEOM> </dwd:Warnungen_Gemeinden> </wfs:member> -</wfs:FeatureCollection> \ No newline at end of file +</wfs:FeatureCollection> diff --git a/bundles/org.openhab.binding.elerotransmitterstick/NOTICE b/bundles/org.openhab.binding.elerotransmitterstick/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/NOTICE +++ b/bundles/org.openhab.binding.elerotransmitterstick/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.elerotransmitterstick/pom.xml b/bundles/org.openhab.binding.elerotransmitterstick/pom.xml index 4c24948819190..92f1bf15219c3 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/pom.xml +++ b/bundles/org.openhab.binding.elerotransmitterstick/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.elerotransmitterstick</artifactId> diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/feature/feature.xml b/bundles/org.openhab.binding.elerotransmitterstick/src/main/feature/feature.xml index 7287643d41699..1c83b9aa29f8c 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.elerotransmitterstick-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-elerotransmitterstick" description="Elero TransmitterStick Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickBindingConstants.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickBindingConstants.java index 4dc66b3e8c22c..67897e997f561 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickBindingConstants.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickHandlerFactory.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickHandlerFactory.java index e77502ad3c9a4..edffbfebd45b5 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickHandlerFactory.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/EleroTransmitterStickHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroChannelConfig.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroChannelConfig.java index b0a14a62c5c24..d628de9739612 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroChannelConfig.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroTransmitterStickConfig.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroTransmitterStickConfig.java index 7d05bc585288e..b76f76abff1cd 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroTransmitterStickConfig.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/config/EleroTransmitterStickConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/discovery/EleroChannelDiscoveryService.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/discovery/EleroChannelDiscoveryService.java index c2b6d6a0cdafa..fd0f70bd16ab8 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/discovery/EleroChannelDiscoveryService.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/discovery/EleroChannelDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroChannelHandler.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroChannelHandler.java index bbd494ee41032..b35e5f82a006a 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroChannelHandler.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroTransmitterStickHandler.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroTransmitterStickHandler.java index e766c2d21088b..dc6be5eb58928 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroTransmitterStickHandler.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/EleroTransmitterStickHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/StatusListener.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/StatusListener.java index ccd5bb6475dc4..a68093152c0a3 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/StatusListener.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/handler/StatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Command.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Command.java index 07c42fea7ff4a..bef446642cd8d 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Command.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandPacket.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandPacket.java index 86ebf6591429c..08b721a454e5d 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandPacket.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandType.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandType.java index ad13dd980f25f..1777fa15d05d9 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandType.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -46,4 +46,4 @@ public static CommandType getForPercent(int percentage) { return null; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandUtil.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandUtil.java index 9f55d8f831678..08728941dd8ca 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandUtil.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/CommandUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ConnectException.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ConnectException.java index 63ca535a18ea3..91fc70e4b6c11 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ConnectException.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ConnectException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/DelayedCommand.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/DelayedCommand.java index b5a334dcaf281..d33e1af2f3392 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/DelayedCommand.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/DelayedCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Response.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Response.java index 5d6ab910f5201..119a4a9c8cbbb 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Response.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseStatus.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseStatus.java index 261f1314b8ede..69cb306964650 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseStatus.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseUtil.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseUtil.java index a46452b6cbb83..b853f5ee921d2 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseUtil.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/ResponseUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/SerialConnection.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/SerialConnection.java index ee4031760d0e5..a189e51f47cd6 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/SerialConnection.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/SerialConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TimedCommand.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TimedCommand.java index 50e9f4d2f5d6a..573428d01f181 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TimedCommand.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TimedCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TransmitterStick.java b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TransmitterStick.java index 1152ccdcb5ed4..7a33446a5b320 100644 --- a/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TransmitterStick.java +++ b/bundles/org.openhab.binding.elerotransmitterstick/src/main/java/org/openhab/binding/elerotransmitterstick/internal/stick/TransmitterStick.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -409,4 +409,4 @@ public interface StickListener { void connectionDropped(Exception e); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/NOTICE b/bundles/org.openhab.binding.enocean/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.enocean/NOTICE +++ b/bundles/org.openhab.binding.enocean/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.enocean/README.md b/bundles/org.openhab.binding.enocean/README.md index 4dd7cc9f24a3e..1d98a619c3eef 100644 --- a/bundles/org.openhab.binding.enocean/README.md +++ b/bundles/org.openhab.binding.enocean/README.md @@ -68,7 +68,7 @@ Hence if your device supports one of the following EEPs the chances are good tha |Thing type | EEP family | EEP Types | Channels¹ | Devices² | Pairing | |---------------------------------|-------------|---------------|------------------------------|--------------------------------|-----------| | bridge | - | - | repeaterMode, setBaseId | USB300, EnOceanPi | - | -| pushButton | F6-01 | 0x01 | pushButton | | Manually | +| pushButton | F6-01/D2-03 | 0x01/0x0A | pushButton, doublePress,<br/>longPress, batteryLevel | NodOn soft button | Manually/Discovery | | rockerSwitch | F6-02 | 0x01-02 | rockerswitchA, rockerswitchB | Eltako FT55 | Discovery | | mechanicalHandle | F6-10 | 0x00-01 | windowHandleState, contact | Hoppe SecuSignal handles, Eltako TF-FGB | Discovery | | contact | D5-00 | 0x01 | contact | Eltako FTK(E) & TF-FKB | Discovery | @@ -79,6 +79,7 @@ Hence if your device supports one of the following EEPs the chances are good tha | lightSensor | A5-06 | 0x01 | illumination | Eltako TF-AHDSB | Discovery | | roomOperatingPanel | A5-10 | 0x01-23 | temperature, setPoint, fanSpeedStage,<br/>occupancy | Thermokon SR04 | Discovery | | automatedMeterSensor | A5-12 | 0x00-03 | counter, currentNumber, instantpower,<br/>totalusage, amrLitre, amrCubicMetre | FWZ12 | Discovery | +| environmentalSensor | A5-13 | 0x01-02 | temperature, windspeed, illumination,<br/>rainStatus | FWS61 | Discovery | | centralCommand | A5-38 | 0x08 | dimmer, generalSwitch | Eltako FUD14, FSR14 | Teach-in | | rollershutter | A5-3F/D2-05/A5-38 | 0x7F/00/08 | rollershutter | Eltako FSB14, NodOn SIN-2-RS-01| Teach-in/Discovery | | measurementSwitch | D2-01 | 0x00-0F,11,12 | generalSwitch(/A/B), instantpower,<br/>totalusage, repeaterMode | NodOn In Wall Switch | Discovery | @@ -146,7 +147,7 @@ If you change the SenderId of your thing, you have to pair again the thing with |---------------------------------|-------------------|-----------------------------|---| | bridge | path | Path to the EnOcean Gateway | COM3, /dev/ttyAMA0, rfc2217://x.x.x.x:3001 | | | nextSenderId | Set SenderId of next created thing.<br/>If omitted, the next unused SenderId is taken | 1-127 | -| pushButton | receivingEEPId | EEP used for receiving msg | F6_01_01 | +| pushButton | receivingEEPId | EEP used for receiving msg | F6_01_01, D2_03_0A | | | enoceanId | EnOceanId of device this thing belongs to | hex value as string | | rockerSwitch | receivingEEPId | | F6_02_01, F6_02_02 | | | enoceanId | | | @@ -168,6 +169,8 @@ If you change the SenderId of your thing, you have to pair again the thing with | | enoceanId | | | | automatedMeterSensor | receivingEEPId | | A5_12_00-03 | | | enoceanId | | | +| environmentalSensor | receivingEEPId | | A5_13_01 | +| | enoceanId | | | | centralCommand | senderIdOffset | SenderId used for sending msg.<br/>If omitted, nextSenderId of bridge is used | 1-127 | | | enoceanId | | | | | sendingEEPId | EEP used for sending msg | A5_38_08_01, A5_38_08_02 | @@ -206,12 +209,19 @@ The channels of a thing are determined automatically based on the chosen EEP. | repeaterMode | String | Set repeater level to 1, 2 or disable | | setBaseId | String | Changes the BaseId of your gateway. This can only be done 10 times! So use it with care. | | pushButton | Trigger | Channel type system:rawbutton, emits PRESSED and RELEASED events | +| doublePress | Trigger | Channel type system:rawbutton, emits PRESSED | +| longPress | Trigger | Channel type system:rawbutton, emits PRESSED and RELEASED events | | rockerswitchA/B | Trigger | Channel type system:rawrocker, emits DIR1_PRESSED, DIR1_RELEASED, DIR2_PRESSED, DIR2_RELEASED events | | windowHandleState | String | Textual representation of handle position (OPEN, CLOSED, TILTED) | | contact | Contact | State OPEN/CLOSED (tilted handle => OPEN) | | temperature | Number:Temperature | Temperature in degree Celsius | | humidity | Number | Relative humidity level in percentages | | illumination | Number:Illuminance | Illumination in lux | +| illuminationWest | Number:Illuminance | Illumination in lux | +| illuminationSouthNorth| Number:Illuminance | Illumination in lux | +| illuminationEast | Number:Illuminance | Illumination in lux | +| rainStatus | Switch | Rain indicator | +| windspeed | Number:Speed | windspeed in m/s | | occupancy | Switch | Occupancy button pressed (ON) or released (OFF) | | motionDetection | Switch | On=Motion detected, Off=not | | setPoint | Number | linear set point | @@ -230,6 +240,7 @@ The channels of a thing are determined automatically based on the chosen EEP. | virtualRockerswitchB | String | Used to send plain rocker switch messages (channel B used) | | batteryVoltage | Number:ElectricPotential | Battery voltage for things with battery | | energyStorage | Number:ElectricPotential | Energy storage, don't know what this means... | +| batterLevel | Number | Battery level in percent | | rssi | Number | Received Signal Strength Indication (dBm) of last received message | | repeatCount | Number | Number of repeaters involved in the transmission of the telegram | | lastReceived | DateTime | Date and time the last telegram was received | diff --git a/bundles/org.openhab.binding.enocean/pom.xml b/bundles/org.openhab.binding.enocean/pom.xml index 69768a4dbaa4f..05ec6fab883c6 100644 --- a/bundles/org.openhab.binding.enocean/pom.xml +++ b/bundles/org.openhab.binding.enocean/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.enocean</artifactId> diff --git a/bundles/org.openhab.binding.enocean/src/main/feature/feature.xml b/bundles/org.openhab.binding.enocean/src/main/feature/feature.xml index cce96c1ad7278..5ec15b2681c8d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.enocean/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.enocean-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-enocean" description="EnOcean Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanBindingConstants.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanBindingConstants.java index cd4619c87a00d..2766e55e99b23 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanBindingConstants.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,8 +19,19 @@ import java.util.Map; import java.util.Set; +import javax.measure.quantity.Angle; +import javax.measure.quantity.ElectricPotential; +import javax.measure.quantity.Energy; +import javax.measure.quantity.Illuminance; +import javax.measure.quantity.Power; +import javax.measure.quantity.Speed; +import javax.measure.quantity.Temperature; +import javax.measure.quantity.Volume; + import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.smarthome.core.items.ItemUtil; import org.eclipse.smarthome.core.library.CoreItemFactory; +import org.eclipse.smarthome.core.library.dimension.VolumetricFlowRate; import org.eclipse.smarthome.core.thing.DefaultSystemChannelTypeProvider; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; @@ -59,6 +70,8 @@ public class EnOceanBindingConstants { public final static ThingTypeUID THING_TYPE_LIGHTTEMPERATUREOCCUPANCYSENSOR = new ThingTypeUID(BINDING_ID, "lightTemperatureOccupancySensor"); public final static ThingTypeUID THING_TYPE_LIGHTSENSOR = new ThingTypeUID(BINDING_ID, "lightSensor"); + public final static ThingTypeUID THING_TYPE_ENVIRONMENTALSENSOR = new ThingTypeUID(BINDING_ID, + "environmentalSensor"); public final static ThingTypeUID THING_TYPE_GENERICTHING = new ThingTypeUID(BINDING_ID, "genericThing"); public final static ThingTypeUID THING_TYPE_ROLLERSHUTTER = new ThingTypeUID(BINDING_ID, "rollershutter"); @@ -67,7 +80,7 @@ public class EnOceanBindingConstants { THING_TYPE_CENTRALCOMMAND, THING_TYPE_ROOMOPERATINGPANEL, THING_TYPE_MECHANICALHANDLE, THING_TYPE_CONTACT, THING_TYPE_MEASUREMENTSWITCH, THING_TYPE_TEMPERATURESENSOR, THING_TYPE_TEMPERATUREHUMIDITYSENSOR, THING_TYPE_GENERICTHING, THING_TYPE_ROLLERSHUTTER, - THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_LIGHTTEMPERATUREOCCUPANCYSENSOR, THING_TYPE_LIGHTSENSOR, + THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_LIGHTTEMPERATUREOCCUPANCYSENSOR, THING_TYPE_LIGHTSENSOR, THING_TYPE_ENVIRONMENTALSENSOR, THING_TYPE_AUTOMATEDMETERSENSOR, THING_TYPE_THERMOSTAT)); // List of all Channel Type Ids, these type ids are also used as channel ids during dynamic creation of channels @@ -90,10 +103,17 @@ public class EnOceanBindingConstants { public final static String CHANNEL_MOTIONDETECTION = "motionDetection"; public final static String CHANNEL_VIBRATION = "vibration"; public final static String CHANNEL_ILLUMINATION = "illumination"; + public final static String CHANNEL_ILLUMINATIONWEST = "illuminationWest"; + public final static String CHANNEL_ILLUMINATIONSOUTHNORTH = "illuminationSouthNorth"; + public final static String CHANNEL_ILLUMINATIONEAST = "illuminationEast"; + public final static String CHANNEL_WINDSPEED = "windspeed"; + public final static String CHANNEL_RAINSTATUS = "rainStatus"; public final static String CHANNEL_COUNTER = "counter"; public final static String CHANNEL_CURRENTNUMBER = "currentNumber"; public final static String CHANNEL_PUSHBUTTON = "pushButton"; + public final static String CHANNEL_DOUBLEPRESS = "doublePress"; + public final static String CHANNEL_LONGPRESS = "longPress"; public final static String CHANNEL_ROCKERSWITCH_CHANNELA = "rockerswitchA"; public final static String CHANNEL_ROCKERSWITCH_CHANNELB = "rockerswitchB"; @@ -110,10 +130,11 @@ public class EnOceanBindingConstants { public final static String CHANNEL_TEACHINCMD = "teachInCMD"; public final static String CHANNEL_INSTANTPOWER = "instantpower"; public final static String CHANNEL_TOTALUSAGE = "totalusage"; - public final static String CHANNEL_INSTANTLITRE = "amrLitre"; - public final static String CHANNEL_TOTALCUBICMETRE = "amrCubicMetre"; + public final static String CHANNEL_CURRENTFLOW = "currentFlow"; + public final static String CHANNEL_CUMULATIVEVALUE = "cumulativeValue"; public final static String CHANNEL_BATTERY_VOLTAGE = "batteryVoltage"; public final static String CHANNEL_ENERGY_STORAGE = "energyStorage"; + public final static String CHANNEL_BATTERY_LEVEL = "batteryLevel"; public final static String CHANNEL_AUTOOFF = "autoOFF"; public final static String CHANNEL_DELAYRADIOOFF = "delayRadioOFF"; @@ -163,21 +184,30 @@ public class EnOceanBindingConstants { put(CHANNEL_ROLLERSHUTTER, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_ROLLERSHUTTER), CoreItemFactory.ROLLERSHUTTER)); put(CHANNEL_ANGLE, new EnOceanChannelDescription(new ChannelTypeUID(BINDING_ID, CHANNEL_ANGLE), - CoreItemFactory.NUMBER)); + CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Angle.class.getSimpleName())); put(CHANNEL_TEMPERATURE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Temperature.class.getSimpleName())); put(CHANNEL_HUMIDITY, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_HUMIDITY), CoreItemFactory.NUMBER)); put(CHANNEL_FANSPEEDSTAGE, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_FANSPEEDSTAGE), CoreItemFactory.STRING)); put(CHANNEL_OCCUPANCY, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_OCCUPANCY), CoreItemFactory.SWITCH)); - put(CHANNEL_MOTIONDETECTION, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_MOTIONDETECTION), CoreItemFactory.SWITCH)); + put(CHANNEL_MOTIONDETECTION, new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_MOTION.getUID(), CoreItemFactory.SWITCH)); put(CHANNEL_VIBRATION, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_VIBRATION), CoreItemFactory.SWITCH)); put(CHANNEL_ILLUMINATION, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_ILLUMINATION), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_ILLUMINATION), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Illuminance.class.getSimpleName())); + put(CHANNEL_ILLUMINATIONWEST, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_ILLUMINATIONWEST), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Illuminance.class.getSimpleName())); + put(CHANNEL_ILLUMINATIONSOUTHNORTH, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_ILLUMINATIONSOUTHNORTH), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Illuminance.class.getSimpleName())); + put(CHANNEL_ILLUMINATIONEAST, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_ILLUMINATIONEAST), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Illuminance.class.getSimpleName())); + put(CHANNEL_WINDSPEED, new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_WIND_SPEED.getUID(), + CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Speed.class.getSimpleName())); + put(CHANNEL_RAINSTATUS, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_RAINSTATUS), CoreItemFactory.SWITCH)); put(CHANNEL_COUNTER, new EnOceanChannelDescription(new ChannelTypeUID(BINDING_ID, CHANNEL_COUNTER), CoreItemFactory.NUMBER)); put(CHANNEL_CURRENTNUMBER, new EnOceanChannelDescription( @@ -189,15 +219,23 @@ public class EnOceanBindingConstants { put(CHANNEL_WINDOWHANDLESTATE, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_WINDOWHANDLESTATE), CoreItemFactory.STRING)); put(CHANNEL_BATTERY_VOLTAGE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_BATTERY_VOLTAGE), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_BATTERY_VOLTAGE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + ElectricPotential.class.getSimpleName())); put(CHANNEL_ENERGY_STORAGE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_ENERGY_STORAGE), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_ENERGY_STORAGE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + ElectricPotential.class.getSimpleName())); + put(CHANNEL_BATTERY_LEVEL, new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_BATTERY_LEVEL.getUID(), + CoreItemFactory.NUMBER)); put(CHANNEL_TEACHINCMD, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_TEACHINCMD), CoreItemFactory.SWITCH)); put(CHANNEL_PUSHBUTTON, new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_RAWBUTTON.getUID(), null, "Push button", false, true)); + put(CHANNEL_DOUBLEPRESS, + new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_RAWBUTTON.getUID(), + null, "Double press", false, true)); + put(CHANNEL_LONGPRESS, + new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_RAWBUTTON.getUID(), + null, "Long press", false, true)); put(CHANNEL_ROCKERSWITCH_CHANNELA, new EnOceanChannelDescription(DefaultSystemChannelTypeProvider.SYSTEM_RAWROCKER.getUID(), @@ -224,13 +262,13 @@ public class EnOceanBindingConstants { CoreItemFactory.ROLLERSHUTTER, "Rocker Switch Listener (Rollershutter)", true, false)); put(CHANNEL_INSTANTPOWER, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_INSTANTPOWER), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_INSTANTPOWER), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Power.class.getSimpleName())); put(CHANNEL_TOTALUSAGE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_TOTALUSAGE), CoreItemFactory.NUMBER)); - put(CHANNEL_INSTANTLITRE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_INSTANTLITRE), CoreItemFactory.NUMBER)); - put(CHANNEL_TOTALCUBICMETRE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_TOTALCUBICMETRE), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_TOTALUSAGE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Energy.class.getSimpleName())); + put(CHANNEL_CURRENTFLOW, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_CURRENTFLOW), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + VolumetricFlowRate.class.getSimpleName())); + put(CHANNEL_CUMULATIVEVALUE, new EnOceanChannelDescription( + new ChannelTypeUID(BINDING_ID, CHANNEL_CUMULATIVEVALUE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Volume.class.getSimpleName())); put(CHANNEL_AUTOOFF, new EnOceanChannelDescription(new ChannelTypeUID(BINDING_ID, CHANNEL_AUTOOFF), CoreItemFactory.NUMBER)); put(CHANNEL_DELAYRADIOOFF, new EnOceanChannelDescription( @@ -272,9 +310,9 @@ public class EnOceanBindingConstants { put(CHANNEL_DISPLAY_ORIENTATION, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_DISPLAY_ORIENTATION), CoreItemFactory.NUMBER)); put(CHANNEL_TEMPERATURE_SETPOINT, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE_SETPOINT), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE_SETPOINT), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Temperature.class.getSimpleName())); put(CHANNEL_FEED_TEMPERATURE, new EnOceanChannelDescription( - new ChannelTypeUID(BINDING_ID, CHANNEL_FEED_TEMPERATURE), CoreItemFactory.NUMBER)); + new ChannelTypeUID(BINDING_ID, CHANNEL_FEED_TEMPERATURE), CoreItemFactory.NUMBER + ItemUtil.EXTENSION_SEPARATOR + Temperature.class.getSimpleName())); put(CHANNEL_MEASUREMENT_CONTROL, new EnOceanChannelDescription( new ChannelTypeUID(BINDING_ID, CHANNEL_MEASUREMENT_CONTROL), CoreItemFactory.SWITCH)); put(CHANNEL_FAILURE_CODE, new EnOceanChannelDescription( diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanChannelDescription.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanChannelDescription.java index 7a49772edbec6..2b786e4ca0d83 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanChannelDescription.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanChannelDescription.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanConfigStatusMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanConfigStatusMessage.java index aaf127d3ed42b..d49aaec86be7d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanConfigStatusMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanConfigStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,4 +30,4 @@ private EnOceanConfigStatusMessage(String messageKey) { public String getMessageKey() { return messageKey; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanException.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanException.java index 083d9fcd433d8..345f5de2906e3 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanException.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanHandlerFactory.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanHandlerFactory.java index c28b6578eac0a..42896bd8250e8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanHandlerFactory.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/EnOceanHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,7 +36,6 @@ import org.openhab.binding.enocean.internal.handler.EnOceanClassicDeviceHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.ConfigurationPolicy; import org.osgi.service.component.annotations.Reference; /** diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanActuatorConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanActuatorConfig.java index 4bbe3048820af..aafe151741efa 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanActuatorConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanActuatorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanBaseConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanBaseConfig.java index a79bf151b2534..68ecd579e332f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanBaseConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanBaseConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelContactConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelContactConfig.java index aee0b6555fa42..e4967b3c790cd 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelContactConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelContactConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,7 +10,6 @@ * * SPDX-License-Identifier: EPL-2.0 */ - package org.openhab.binding.enocean.internal.config; /** diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelDimmerConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelDimmerConfig.java index 93be459974919..0aa71f74b3121 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelDimmerConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelDimmerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,7 +10,6 @@ * * SPDX-License-Identifier: EPL-2.0 */ - package org.openhab.binding.enocean.internal.config; /** diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchConfigBase.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchConfigBase.java index 69c9fdf5811f6..5b99af7d7d002 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchConfigBase.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchConfigBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchListenerConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchListenerConfig.java index e86f34f572ff0..99b542acac262 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchListenerConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRockerSwitchListenerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRollershutterConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRollershutterConfig.java index 9e2291b8028e1..819846f506b45 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRollershutterConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelRollershutterConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTeachInConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTeachInConfig.java index b69d122cc50b4..123161b7f9b0b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTeachInConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTeachInConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTotalusageConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTotalusageConfig.java index 75b19049ec8e2..30f27aeb48776 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTotalusageConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTotalusageConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTransformationConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTransformationConfig.java index 84caf7e31bdb0..e3eee68d62869 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTransformationConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelTransformationConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelVirtualRockerSwitchConfig.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelVirtualRockerSwitchConfig.java index 06920363939a6..c9e333dccfdba 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelVirtualRockerSwitchConfig.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/config/EnOceanChannelVirtualRockerSwitchConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanDeviceDiscoveryService.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanDeviceDiscoveryService.java index 6b8ebca751ab6..8157ea80f0d22 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanUsbSerialDiscoveryParticipant.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanUsbSerialDiscoveryParticipant.java index 42104ce9e57b8..92917a5dc0d69 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanUsbSerialDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/discovery/EnOceanUsbSerialDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02.java index 1328204a40176..edeea1532f6b1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_01.java index 8edc175347948..b9a28c3c718e0 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_02.java index bfea4cc7c7f82..0d0023b8b6955 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_03.java index 2c03af00943ea..b7b5d6e36e846 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_04.java index c822f633e045a..619e99b0af669 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_05.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_05.java index f6f91c9133fd8..1e18e383713ca 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_05.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_05.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_06.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_06.java index ab78266d4cd69..f22c9c4584cdb 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_06.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_06.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_07.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_07.java index fc1a12fb27395..4393637b90d20 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_07.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_07.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_08.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_08.java index 336321c22dec4..7145e9a9765fa 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_08.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_08.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_09.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_09.java index 87c20cbbc4d12..8debb668e6670 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_09.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_09.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0A.java index c2ab009aaf366..a539cd3125574 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0B.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0B.java index d3adba7c47a5b..90882522951a8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0B.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_0B.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_10.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_10.java index 8b35344425c08..f21872e76f677 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_10.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_10.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_11.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_11.java index 1121b89896569..4ae2ede806b93 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_11.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_11.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_12.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_12.java index 9a6789d00a349..7a759904f649b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_12.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_12.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_13.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_13.java index bfc034eba5160..45ee90ecccc5c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_13.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_13.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_14.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_14.java index 9738896df684b..77d44784163f1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_14.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_14.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_15.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_15.java index c89fee2f75d17..fccab8005bc7a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_15.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_15.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_16.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_16.java index 1c2942c41b6f4..ed14044705e29 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_16.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_16.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_17.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_17.java index 9ce436bc9a1c9..dfa7e7bb1b922 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_17.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_17.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_18.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_18.java index 8c30e90c9369b..a9248f046b193 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_18.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_18.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_19.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_19.java index 4ff583fa6539b..29d59b49d325d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_19.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_19.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1A.java index 91ed32357024d..0a92c7fbd2d5b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1B.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1B.java index 75f9959989c4a..fdfb87152335a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1B.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_1B.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_20.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_20.java index 4ca62f7d5dfca..fcbe158d32c73 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_20.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_20.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,6 +33,16 @@ protected double getScaledMin() { protected double getScaledMax() { return 41.2; } + + @Override + protected double getUnscaledMin() { + return 1023; + } + + @Override + protected double getUnscaledMax() { + return 0; + } @Override protected int getUnscaledTemperatureValue() { diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_30.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_30.java index 16ea321a2192b..2ce86dde6c492 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_30.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_02/A5_02_30.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -34,6 +34,16 @@ protected double getScaledMax() { return 62.3; } + @Override + protected double getUnscaledMin() { + return 1023; + } + + @Override + protected double getUnscaledMax() { + return 0; + } + @Override protected int getUnscaledTemperatureValue() { return getDB_1Value() + ((getDB_2Value() & 0b11) << 8); diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04.java index 85a4e64a5f1a7..ac277ee794912 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_01.java index 9768f28fd756d..bc23e6e7f87d7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02.java index cbde6b103d866..5768b7867303b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02_Eltako.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02_Eltako.java index c9556db1ee053..d454a2814f3c0 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02_Eltako.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_02_Eltako.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_03.java index f5241f02339f0..1e4549eed763c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_04/A5_04_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01.java index 3772137c08d78..3a03d01c1f0ec 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01_ELTAKO.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01_ELTAKO.java index eaa48995f05c0..e8de281d3d8be 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01_ELTAKO.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_06/A5_06_01_ELTAKO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07.java index 7f50b36ec8e82..fded4a608d310 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_01.java index 56fb8355a60ea..b62e2c160b66b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_02.java index 7f94ac4b8513b..723043bb31034 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_03.java index 7f30ed0d85b02..8d1dfb1a80b86 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_07/A5_07_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08.java index 4ff6b3fe6bbdb..efeee2c90c2d9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01.java index 37dcbdd8192cb..4bf3293823387 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01_FXBH.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01_FXBH.java index 7e00a514c3c3b..98c779fdcd504 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01_FXBH.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_01_FXBH.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_02.java index 5450058dedd0b..5a20e33856004 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_03.java index f24bd2a97bb5b..996375da6812f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_08/A5_08_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10.java index 6241df6618425..687522376fab4 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_01.java index 29171bea02fbf..834b584141316 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_02.java index 78a17804fad6b..fda16f26a731b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_03.java index f0082b6b11107..14e70b874229f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_04.java index 6f21d488579af..8b17db4ad4bcf 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_05.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_05.java index f3387348c7558..aa4602ca10eff 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_05.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_05.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_06.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_06.java index 385ad21539aa8..7bcdd7095359f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_06.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_06.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_07.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_07.java index 77102577b7fe9..d2b7da706da22 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_07.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_07.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_08.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_08.java index 77f522cd0c413..4b681b9cba55b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_08.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_08.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_09.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_09.java index a8ef053516af6..511dd99b441f7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_09.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_09.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0A.java index 5ffaaf4a38db3..a195ad791550d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0B.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0B.java index 28352f5fc140d..bb86d2a3c1b59 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0B.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0B.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0C.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0C.java index 43f2e682f12cd..60d3a43eb422a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0C.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0C.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0D.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0D.java index 693b7b8d32e2b..c337b4987cea1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0D.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_0D.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_10.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_10.java index 25ff2969e64a1..ead768bc2c1d6 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_10.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_10.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_11.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_11.java index 847b35d4b8336..d3d6f5df0c0e3 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_11.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_11.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_12.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_12.java index 5055c5c3c0cf1..da00c43d95161 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_12.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_12.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_13.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_13.java index d943bedc71929..c848e96ed0d25 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_13.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_13.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_14.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_14.java index f8be66050d0a2..b3905484f3559 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_14.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_14.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_15.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_15.java index 735a64b946f7c..a5e9c1af31ccb 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_15.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_15.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_16.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_16.java index 1e3e4ddd5fb16..09093e0db92a9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_16.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_16.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_17.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_17.java index 603feed5851cc..fbb3c55edf4b8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_17.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_17.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_18.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_18.java index 9f322474170b9..b63f4fa30afc1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_18.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_18.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_19.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_19.java index 81b4ec176dbd2..4fb6c43a1668b 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_19.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_19.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1A.java index 463f6ce180d30..a15a1d41edefe 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1B.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1B.java index 2e6697fde0886..d424dfb7eca17 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1B.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1B.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1C.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1C.java index c31b7d136d6c7..862138a45da9e 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1C.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1C.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1D.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1D.java index 22e1f68db3a09..245527104f7a4 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1D.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1D.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1E.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1E.java index f77b0c8be6bd7..7fdc4ee2da8b8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1E.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1E.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1F.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1F.java index fbc84835a7d08..c511cac08cbb9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1F.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_1F.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_20.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_20.java index efc95acb68101..7205eeed8de64 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_20.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_20.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_21.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_21.java index fe65abc66063a..aa846a5ef60c8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_21.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_21.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_22.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_22.java index d88949b48733b..10eb5e0ab6c1a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_22.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_22.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_23.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_23.java index 676868f2b558a..e7537f8c64b4c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_23.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_10/A5_10_23.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_03.java index d68c4ac3a030f..9201e9d579a4e 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_04.java index 30a2fdb901996..6b53e882a3698 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_11/A5_11_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -202,4 +202,4 @@ protected State convertToStateImpl(String channelId, String channelTypeId, Funct return UnDefType.UNDEF; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12.java index d65d535ca5607..75af695edc276 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -117,18 +117,18 @@ protected State convertToStateImpl(String channelId, String channelTypeId, Funct Configuration config) { switch (channelId) { case CHANNEL_INSTANTPOWER: - case CHANNEL_INSTANTLITRE: + case CHANNEL_CURRENTFLOW: case CHANNEL_CURRENTNUMBER: return getCurrentValue(); case CHANNEL_TOTALUSAGE: State value = getCumulativeValue(); State currentState = getCurrentStateFunc.apply(channelId); return EEPHelper.validateTotalUsage(value, currentState, config); - case CHANNEL_TOTALCUBICMETRE: + case CHANNEL_CUMULATIVEVALUE: case CHANNEL_COUNTER: return getCumulativeValue(); } return UnDefType.UNDEF; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_00.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_00.java index 3e2e62cd001d0..c810b336a157c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_00.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_00.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_01.java index 5b249a1bff089..bde2b5d6d8b6d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,4 +36,4 @@ protected State calcCumulativeValue(float value) { protected State calcCurrentValue(float value) { return new QuantityType<>(value, SmartHomeUnits.WATT); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_02.java index 08d49c98d08ad..f515405430787 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,6 +35,7 @@ protected State calcCumulativeValue(float value) { @Override protected State calcCurrentValue(float value) { - return new QuantityType<>(value, SmartHomeUnits.LITRE); + // value is given in litre/second, hence multiply by 60 + return new QuantityType<>(value * 60, SmartHomeUnits.LITRE_PER_MINUTE); } } diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_03.java index b21bff18aa842..f49c202d0e3e0 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_12/A5_12_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,6 +35,7 @@ protected State calcCumulativeValue(float value) { @Override protected State calcCurrentValue(float value) { - return new QuantityType<>(value, SmartHomeUnits.LITRE); + // value is given in litre/second, hence multiply by 60 + return new QuantityType<>(value * 60, SmartHomeUnits.LITRE_PER_MINUTE); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13.java new file mode 100644 index 0000000000000..23486842fedd5 --- /dev/null +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13.java @@ -0,0 +1,42 @@ +/** + * 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.enocean.internal.eep.A5_13; + +import org.openhab.binding.enocean.internal.eep.Base._4BSMessage; +import org.openhab.binding.enocean.internal.messages.ERP1Message; + +/** + * Base class for A5-13 EEP message handling + * + * @author Daniel Weber - Initial contribution + */ +public abstract class A5_13 extends _4BSMessage { + public A5_13(ERP1Message packet) { + super(packet); + } + + protected final int PARTONE = 0x10; + protected final int PARTTWO = 0x20; + + protected int getMessageIdentifier() { + return getDB_0Value() & 0xF0; + } + + protected boolean isPartOne() { + return getMessageIdentifier() == PARTONE; + } + + protected boolean isPartTwo() { + return getMessageIdentifier() == PARTTWO; + } +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13_01.java new file mode 100644 index 0000000000000..71bc7a6d1df30 --- /dev/null +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_13/A5_13_01.java @@ -0,0 +1,101 @@ +/** + * 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.enocean.internal.eep.A5_13; + +import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.*; + +import java.util.function.Function; + +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.enocean.internal.messages.ERP1Message; + +/** + * Convertes EEP A5-13 messages of type 0x01 into Temperature, Illumination, Wind Speed and Temperature states + * + * @author Daniel Weber - Initial contribution + */ +public class A5_13_01 extends A5_13 { + + public A5_13_01(ERP1Message packet) { + super(packet); + } + + protected State getIllumination() { + return new QuantityType<>(((getDB_3Value() * 1000.0) / 255.0), SmartHomeUnits.LUX); + } + + protected State getIllumination(double value) { + return new QuantityType<>(((value * 1000.0 * 150.0) / 255.0), SmartHomeUnits.LUX); + } + + protected State getIlluminationWest() { + return getIllumination(getDB_3Value()); + } + + protected State getIlluminationSouthNorth() { + return getIllumination(getDB_2Value()); + } + + protected State getIlluminationEast() { + return getIllumination(getDB_1Value()); + } + + protected State getTemperature() { + return new QuantityType<>(-40.0 + ((getDB_2Value() * 120.0) / 255.0), SIUnits.CELSIUS); + } + + protected State getWindSpeed() { + return new QuantityType<>(((getDB_1Value() * 70.0) / 255.0), SmartHomeUnits.METRE_PER_SECOND); + } + + protected State getRainStatus() { + return getBit(getDB_0Value(), 1) ? OnOffType.ON : OnOffType.OFF; + } + + @Override + protected State convertToStateImpl(String channelId, String channelTypeId, Function<String, State> getCurrentStateFunc, + Configuration config) { + + if (isPartOne()) { + switch (channelId) { + case CHANNEL_ILLUMINATION: + return getIllumination(); + case CHANNEL_TEMPERATURE: + return getTemperature(); + case CHANNEL_WINDSPEED: + return getWindSpeed(); + case CHANNEL_RAINSTATUS: + return getRainStatus(); + } + } + + if (isPartTwo()) { + switch (channelId) { + case CHANNEL_ILLUMINATIONWEST: + return getIlluminationWest(); + case CHANNEL_ILLUMINATIONSOUTHNORTH: + return getIlluminationSouthNorth(); + case CHANNEL_ILLUMINATIONEAST: + return getIlluminationEast(); + } + } + + return UnDefType.UNDEF; + } +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14.java index 805b2575535b9..a21144fb02cb2 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01.java index 8b82e5aaf9ff1..e3fb22d561667 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01_ELTAKO.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01_ELTAKO.java index a427e5acd6d8b..e8549ed5eafd7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01_ELTAKO.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_01_ELTAKO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_09.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_09.java index 759cad06c42a8..7cca9da6fd565 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_09.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_09.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_0A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_0A.java index 10cfcddb7d2c7..9c11511680e34 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_0A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_14/A5_14_0A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20.java index 4e5b7f17c1f13..e5898dea4fbaa 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20_04.java index a1e53ffe788c0..a75231457db17 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_20/A5_20_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Blinds.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Blinds.java index 8a2075e97903b..d24920c3293da 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Blinds.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Blinds.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Dimming.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Dimming.java index 683987dce7bd9..fbd6e1702492c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Dimming.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Dimming.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Switching.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Switching.java index 1298e73caa950..85c0bdfb2ba9f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Switching.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_38/A5_38_08_Switching.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_EltakoFSB.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_EltakoFSB.java index 0da5eb17c2132..91e18f121da3a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_EltakoFSB.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_EltakoFSB.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_Universal.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_Universal.java index 5830965786bf4..4b7f84022cebf 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_Universal.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/A5_3F/A5_3F_7F_Universal.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/PTM200Message.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/PTM200Message.java index 09821adc3a30b..9062748d67014 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/PTM200Message.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/PTM200Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/UTEResponse.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/UTEResponse.java index 593fdbda6358a..3c0549c4141c2 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/UTEResponse.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/UTEResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_1BSMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_1BSMessage.java index a400f2d3937eb..c8f7b9aa1c473 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_1BSMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_1BSMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSMessage.java index 938a67d954f5b..7490817602e80 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSTeachInVariation3Response.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSTeachInVariation3Response.java index 51d7c7b6c0f10..5d949b30cd7b4 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSTeachInVariation3Response.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_4BSTeachInVariation3Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_RPSMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_RPSMessage.java index e0c4688c7cdc2..b89c0e56e6ae9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_RPSMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_RPSMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_VLDMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_VLDMessage.java index 94719494b74d9..1d6cbfa90ee2e 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_VLDMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Base/_VLDMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01.java index 8a796a69e0e3e..aa15520e203f7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_00.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_00.java index 39a48a6178b61..8fc9e113a04c3 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_00.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_00.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_01.java index 4babcaeee4b27..64ed22a2a75c8 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_02.java index 0f02ae757222d..82306de24d914 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_03.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_03.java index 200f759a51d09..0cd96f699488f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_03.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_03.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_04.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_04.java index 6676dd5c19656..05acb9b7f68d1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_04.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_04.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_05.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_05.java index c51d24a3c99b9..254aee2169934 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_05.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_05.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_06.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_06.java index ae5e8e9c50728..9145f8f7540dd 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_06.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_06.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_07.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_07.java index 4043baedb8e43..1a7e345670db5 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_07.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_07.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_08.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_08.java index bac8bf9bb6801..48b746cd60d74 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_08.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_08.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09.java index 98c862c6f5ea2..e89f0878175ad 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09_Permundo.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09_Permundo.java index 344445f761f7a..f9dcd6a8f54bf 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09_Permundo.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_09_Permundo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0A.java index d54e013870779..cac7af5f12f7a 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0A.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0A.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0B.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0B.java index 6857ddcbc342f..c67752898c918 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0B.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0B.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0C.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0C.java index 7a31d337f7920..6a486bb51247d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0C.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0C.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0D.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0D.java index f3166ca94ab49..cd664fbb12a59 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0D.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0D.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0E.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0E.java index 399a67a6a5c59..428a7f7d610b9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0E.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0E.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F.java index cb0489f8374a1..4f3b495b0f54d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F_NodON.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F_NodON.java index 220704395148f..b3596fdefdaa5 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F_NodON.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_0F_NodON.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_11.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_11.java index 3f59b2bc44db0..f9ff8462a3d1c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_11.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_11.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12.java index 6f6efbada0490..a6db08fea8319 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12_NodON.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12_NodON.java index fb4c2220d9528..afc0b069f14cc 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12_NodON.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_01/D2_01_12_NodON.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_03/D2_03_0A.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_03/D2_03_0A.java new file mode 100644 index 0000000000000..8e94d6c3c9e81 --- /dev/null +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_03/D2_03_0A.java @@ -0,0 +1,71 @@ +/** + * 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.enocean.internal.eep.D2_03; + +import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.*; + +import java.util.function.Function; + +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.CommonTriggerEvents; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.enocean.internal.eep.Base._VLDMessage; +import org.openhab.binding.enocean.internal.messages.ERP1Message; + +/** + * + * @author Daniel Weber - Initial contribution + */ +public class D2_03_0A extends _VLDMessage { + + protected final byte ShortPress = 0x01; + protected final byte DoublePress = 0x02; + protected final byte LongPress = 0x03; + protected final byte LongRelease = 0x04; + + public D2_03_0A() { + super(); + } + + public D2_03_0A(ERP1Message packet) { + super(packet); + } + + @Override + protected String convertToEventImpl(String channelId, String channelTypeId, String lastEvent, Configuration config) { + switch (channelId) { + case CHANNEL_PUSHBUTTON: + return (bytes[1] == ShortPress) ? CommonTriggerEvents.PRESSED : null; + case CHANNEL_DOUBLEPRESS: + return (bytes[1] == DoublePress) ? CommonTriggerEvents.PRESSED : null; + case CHANNEL_LONGPRESS: + return (bytes[1] == LongPress) ? CommonTriggerEvents.PRESSED + : ((bytes[1] == LongRelease) ? CommonTriggerEvents.RELEASED : null); + default: + return null; + } + } + + @Override + public State convertToStateImpl(String channelId, String channelTypeId, Function<String, State> getCurrentStateFunc, Configuration config) { + if (CHANNEL_BATTERY_LEVEL.equals(channelId)) { + return new QuantityType<>(bytes[0] & 0xFF, SmartHomeUnits.PERCENT); + } + + return UnDefType.UNDEF; + } +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_05/D2_05_00.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_05/D2_05_00.java index 13bd98bda6634..2bd25630a76af 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_05/D2_05_00.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D2_05/D2_05_00.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D5_00/D5_00_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D5_00/D5_00_01.java index 186046e5a3598..055c5d5bbcd38 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D5_00/D5_00_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/D5_00/D5_00_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEP.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEP.java index 937c8d802a0df..b74d8fbdaa345 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEP.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEP.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPFactory.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPFactory.java index 1b23d4998f96b..ec59cdba10f7c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPFactory.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPHelper.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPHelper.java index d8b45aa45be8a..6fde01c6312bd 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPHelper.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java index 883a87149d9f8..3580154f35d5c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/EEPType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -101,6 +101,7 @@ import org.openhab.binding.enocean.internal.eep.A5_12.A5_12_01; import org.openhab.binding.enocean.internal.eep.A5_12.A5_12_02; import org.openhab.binding.enocean.internal.eep.A5_12.A5_12_03; +import org.openhab.binding.enocean.internal.eep.A5_13.A5_13_01; import org.openhab.binding.enocean.internal.eep.A5_14.A5_14_01; import org.openhab.binding.enocean.internal.eep.A5_14.A5_14_01_ELTAKO; import org.openhab.binding.enocean.internal.eep.A5_14.A5_14_09; @@ -134,6 +135,7 @@ import org.openhab.binding.enocean.internal.eep.D2_01.D2_01_11; import org.openhab.binding.enocean.internal.eep.D2_01.D2_01_12; import org.openhab.binding.enocean.internal.eep.D2_01.D2_01_12_NodON; +import org.openhab.binding.enocean.internal.eep.D2_03.D2_03_0A; import org.openhab.binding.enocean.internal.eep.D2_05.D2_05_00; import org.openhab.binding.enocean.internal.eep.D5_00.D5_00_01; import org.openhab.binding.enocean.internal.eep.F6_01.F6_01_01; @@ -171,6 +173,8 @@ public enum EEPType { CHANNEL_CONTACT), PushButton(RORG.RPS, 0x01, 0x01, false, F6_01_01.class, THING_TYPE_PUSHBUTTON, CHANNEL_PUSHBUTTON), + PushButtonTriState(RORG.VLD, 0x03, 0x0A, false, D2_03_0A.class, THING_TYPE_PUSHBUTTON, CHANNEL_PUSHBUTTON, + CHANNEL_DOUBLEPRESS, CHANNEL_LONGPRESS, CHANNEL_BATTERY_LEVEL), RockerSwitch2RockerStyle1(RORG.RPS, 0x02, 0x01, false, F6_02_01.class, THING_TYPE_ROCKERSWITCH, CHANNEL_ROCKERSWITCH_CHANNELA, CHANNEL_ROCKERSWITCH_CHANNELB, CHANNEL_VIRTUALSWITCHA, @@ -353,9 +357,13 @@ public enum EEPType { AutomatedMeterReading_01(RORG._4BS, 0x12, 0x01, false, A5_12_01.class, THING_TYPE_AUTOMATEDMETERSENSOR, CHANNEL_TOTALUSAGE, CHANNEL_INSTANTPOWER), AutomatedMeterReading_02(RORG._4BS, 0x12, 0x02, false, A5_12_02.class, THING_TYPE_AUTOMATEDMETERSENSOR, - CHANNEL_TOTALCUBICMETRE, CHANNEL_INSTANTLITRE), + CHANNEL_CUMULATIVEVALUE, CHANNEL_CURRENTFLOW), AutomatedMeterReading_03(RORG._4BS, 0x12, 0x03, false, A5_12_03.class, THING_TYPE_AUTOMATEDMETERSENSOR, - CHANNEL_TOTALCUBICMETRE, CHANNEL_INSTANTLITRE), + CHANNEL_CUMULATIVEVALUE, CHANNEL_CURRENTFLOW), + + EnvironmentalSensor_01(RORG._4BS, 0x13, 0x01, false, A5_13_01.class, THING_TYPE_ENVIRONMENTALSENSOR, + CHANNEL_ILLUMINATION, CHANNEL_TEMPERATURE, CHANNEL_WINDSPEED, CHANNEL_RAINSTATUS, CHANNEL_ILLUMINATIONWEST, + CHANNEL_ILLUMINATIONSOUTHNORTH, CHANNEL_ILLUMINATIONEAST), Rollershutter_A5(RORG._4BS, 0x11, 0x03, false, A5_11_03.class, THING_TYPE_ROLLERSHUTTER, CHANNEL_ROLLERSHUTTER, CHANNEL_ANGLE), diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_01/F6_01_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_01/F6_01_01.java index 2fd0477d26e1b..b4db001c6f8c1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_01/F6_01_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_01/F6_01_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_01.java index 666ebd88e9341..37c425a92ff6d 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_02.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_02.java index ba9bd9d47fb1b..e9a3b11d9e187 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_02.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_02/F6_02_02.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00.java index 2374a364fc4b5..1f74d1c942744 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00_EltakoFPE.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00_EltakoFPE.java index 6c401bf60b473..2cbce8c10538f 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00_EltakoFPE.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_00_EltakoFPE.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_01.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_01.java index 8ea9e335cec8f..2ef74fba04eb1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_01.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/F6_10/F6_10_01.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/Generic4BS.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/Generic4BS.java index 6f4e00b0c309e..07ea095169fd7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/Generic4BS.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/Generic4BS.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericEEP.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericEEP.java index ebe95863865d6..293cda34c8cf9 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericEEP.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericEEP.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericRPS.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericRPS.java index 898ae2e9c8952..274823326c0c7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericRPS.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericRPS.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericVLD.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericVLD.java index 4a8e57a5d04fe..254a3d34a97a0 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericVLD.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/eep/Generic/GenericVLD.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseActuatorHandler.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseActuatorHandler.java index 9de587241b7ff..f594a06f3a4e2 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseActuatorHandler.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseActuatorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,10 +15,14 @@ import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.*; import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.thing.Channel; @@ -90,14 +94,41 @@ protected EnOceanActuatorConfig getConfiguration() { return (EnOceanActuatorConfig) config; } + @Override + Collection<EEPType> getEEPTypes() { + Collection<EEPType> r = super.getEEPTypes(); + if (sendingEEPType == null) { + return r; + } + + return Collections.unmodifiableCollection(Stream.concat(r.stream(), Collections.singletonList(sendingEEPType).stream()).collect(Collectors.toList())); + } + @Override boolean validateConfig() { - if (super.validateConfig()) { + + EnOceanActuatorConfig config = getConfiguration(); + if(config == null) { + configurationErrorDescription = "Configuration is not valid"; + return false; + } + + if(config.sendingEEPId == null || config.sendingEEPId.isEmpty()) { + configurationErrorDescription = "Sending EEP must be provided"; + return false; + } - try { - sendingEEPType = EEPType.getType(getConfiguration().sendingEEPId); - updateChannels(sendingEEPType, false); + try { + sendingEEPType = EEPType.getType(getConfiguration().sendingEEPId); + } catch (IllegalArgumentException e) { + configurationErrorDescription = "Sending EEP is not supported"; + return false; + } + + if (super.validateConfig()) { + try { + if (sendingEEPType.getSupportsRefresh()) { if (getConfiguration().pollingInterval > 0) { refreshJob = scheduler.scheduleWithFixedDelay(() -> { @@ -117,7 +148,7 @@ boolean validateConfig() { } } catch (Exception e) { - configurationErrorDescription = "Sending EEP is not supported"; + configurationErrorDescription = "Configuration is not valid"; return false; } diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseSensorHandler.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseSensorHandler.java index 542dd1780a6b1..8ebd36466f763 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseSensorHandler.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,9 +12,12 @@ */ package org.openhab.binding.enocean.internal.handler; +import static java.util.Collections.unmodifiableCollection; import static org.openhab.binding.enocean.internal.EnOceanBindingConstants.*; import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.Hashtable; import java.util.Set; @@ -53,7 +56,7 @@ public class EnOceanBaseSensorHandler extends EnOceanBaseThingHandler implements Arrays.asList(THING_TYPE_ROOMOPERATINGPANEL, THING_TYPE_MECHANICALHANDLE, THING_TYPE_CONTACT, THING_TYPE_TEMPERATURESENSOR, THING_TYPE_TEMPERATUREHUMIDITYSENSOR, THING_TYPE_ROCKERSWITCH, THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_LIGHTTEMPERATUREOCCUPANCYSENSOR, THING_TYPE_LIGHTSENSOR, - THING_TYPE_PUSHBUTTON, THING_TYPE_AUTOMATEDMETERSENSOR)); + THING_TYPE_PUSHBUTTON, THING_TYPE_AUTOMATEDMETERSENSOR, THING_TYPE_ENVIRONMENTALSENSOR)); protected Hashtable<RORG, EEPType> receivingEEPTypes = null; @@ -66,13 +69,21 @@ void initializeConfig() { config = getConfigAs(EnOceanBaseConfig.class); } + @Override + Collection<EEPType> getEEPTypes() { + if (receivingEEPTypes == null) { + return Collections.emptyList(); + } + + return unmodifiableCollection(receivingEEPTypes.values()); + } + @Override boolean validateConfig() { receivingEEPTypes = null; try { if (config.receivingEEPId != null && !config.receivingEEPId.isEmpty()) { - boolean first = true; receivingEEPTypes = new Hashtable<>(); for (String receivingEEP : config.receivingEEPId) { @@ -87,8 +98,6 @@ boolean validateConfig() { } receivingEEPTypes.put(receivingEEPType.getRORG(), receivingEEPType); - updateChannels(receivingEEPType, first); - first = false; } } else { receivingEEPTypes = null; @@ -98,6 +107,8 @@ boolean validateConfig() { return false; } + updateChannels(); + if (receivingEEPTypes != null) { if (!validateEnoceanId(config.enoceanId)) { configurationErrorDescription = "EnOceanId is not a valid EnOceanId"; diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseThingHandler.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseThingHandler.java index 4cd68cc67a368..f14a49ede0b51 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseThingHandler.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,8 @@ import java.util.Hashtable; import java.util.LinkedList; import java.util.List; -import java.util.Map; +import java.util.AbstractMap.SimpleEntry; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.Set; import org.eclipse.jdt.annotation.NonNull; @@ -35,7 +36,6 @@ import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; import org.eclipse.smarthome.core.thing.link.ItemChannelLinkRegistry; import org.eclipse.smarthome.core.thing.type.ChannelKind; -import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.enocean.internal.EnOceanChannelDescription; @@ -123,50 +123,50 @@ protected boolean validateEnoceanId(String id) { abstract boolean validateConfig(); - protected void updateChannels(EEPType eep, boolean removeUnsupportedChannels) { + abstract Collection<EEPType> getEEPTypes(); + + protected void updateChannels() { @NonNull List<@NonNull Channel> channelList = new LinkedList<>(this.getThing().getChannels()); - boolean channelListChanged = false; - - if (removeUnsupportedChannels) { - channelListChanged = channelList.removeIf(channel -> !eep.isChannelSupported(channel)); + Collection<EEPType> eeps = getEEPTypes(); + if (eeps == null) { + return; } + + // First remove channels which are no longer supported by current selected eeps of thing + AtomicBoolean channelListChanged = new AtomicBoolean(channelList.removeIf(channel -> !eeps.stream().anyMatch(eep -> eep.isChannelSupported(channel)))); - for (Map.Entry<String, EnOceanChannelDescription> entry : eep.GetSupportedChannels().entrySet()) { - + // Next create supported channels of each selected eep + eeps.stream().flatMap(eep -> eep.GetSupportedChannels().keySet().stream().map(id -> new SimpleEntry<String, EEPType>(id, eep))).forEach(entry -> { String channelId = entry.getKey(); - EnOceanChannelDescription cd = entry.getValue(); + EnOceanChannelDescription cd = entry.getValue().GetSupportedChannels().get(channelId); // if we do not need to auto create channel => skip if (!cd.autoCreate) { - continue; + return; } - // if we already created a channel with the same type => skip - if (channelList.stream().anyMatch(channel -> { - ChannelTypeUID channelTypeUID = channel.getChannelTypeUID(); - String id = channelTypeUID == null ? "" : channelTypeUID.getId(); - - return cd.channelTypeUID.getId().equals(id); - })) { - continue; + // if we already created a channel with the same type and id => skip + if (channelList.stream().anyMatch(channel -> cd.channelTypeUID.equals(channel.getChannelTypeUID()) && channelId.equals(channel.getUID().getId()))){ + return; } + // create channel and add it to the channelList Channel channel = ChannelBuilder .create(new ChannelUID(this.getThing().getUID(), channelId), cd.acceptedItemType) - .withConfiguration(eep.getChannelConfig(channelId)).withType(cd.channelTypeUID) + .withConfiguration(entry.getValue().getChannelConfig(channelId)).withType(cd.channelTypeUID) .withKind(cd.isStateChannel ? ChannelKind.STATE : ChannelKind.TRIGGER).withLabel(cd.label).build(); channelList.add(channel); - channelListChanged = true; + channelListChanged.set(true); if (!cd.isStateChannel) { lastEvents.putIfAbsent(channelId, ""); } - } + }); - if (channelListChanged) { + if (channelListChanged.get()) { ThingBuilder thingBuilder = editThing(); thingBuilder.withChannels(channelList); updateThing(thingBuilder.build()); diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBridgeHandler.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBridgeHandler.java index 3e3f553bbdaf1..e16ad208f770c 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBridgeHandler.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanClassicDeviceHandler.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanClassicDeviceHandler.java index 801d2a2a8c5a6..2e0b0ac7727d0 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanClassicDeviceHandler.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/handler/EnOceanClassicDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/BaseResponse.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/BaseResponse.java index bce6c75dc5c51..d6d63e3158218 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/BaseResponse.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/BaseResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/CCMessage.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/CCMessage.java index d4885a5fb25cf..6981d244f05fa 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/CCMessage.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/CCMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ERP1Message.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ERP1Message.java index afe4ac7fd1bbe..76f4c60dc1fdc 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ERP1Message.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ERP1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3Packet.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3Packet.java index 1b18136c14661..2fc62951b1bc7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3Packet.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3Packet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3PacketFactory.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3PacketFactory.java index 9461cf9c1b554..91937695ae785 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3PacketFactory.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/ESP3PacketFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDBaseIdResponse.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDBaseIdResponse.java index 5958d6dba3086..0113aeb7d2a85 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDBaseIdResponse.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDBaseIdResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDRepeaterResponse.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDRepeaterResponse.java index 92f9da961565a..756ca141475c7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDRepeaterResponse.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDRepeaterResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDVersionResponse.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDVersionResponse.java index 3336934d6d0b5..53d74b7f69c66 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDVersionResponse.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/RDVersionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/Response.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/Response.java index f0bc1643e2117..6c1003da69359 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/Response.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/messages/Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ESP3PacketListener.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ESP3PacketListener.java index d9be0e28d9b74..a1de287479e87 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ESP3PacketListener.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ESP3PacketListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanSerialTransceiver.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanSerialTransceiver.java index 03b15b9bf5b73..b1ed07bf76283 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanSerialTransceiver.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanSerialTransceiver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanTransceiver.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanTransceiver.java index d0ec4b9e70e50..7d469f0a3ecf2 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanTransceiver.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/EnOceanTransceiver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -117,7 +117,7 @@ private synchronized void send() throws IOException { sendNext(); } } catch (EnOceanException e) { - logger.error("exception while sending data {}", e); + logger.error("exception while sending data", e); } } } @@ -309,8 +309,12 @@ private void processMessage(byte firstByte) { logger.debug("{} with RORG {} for {} payload {} received", packet.getPacketType().name(), msg.getRORG().name(), HexUtils.bytesToHex(msg.getSenderId()), HexUtils.bytesToHex(d)); - - informListeners(msg); + + if(msg.getRORG() != RORG.Unknown) { + informListeners(msg); + } else { + logger.debug("Received unknown RORG, payload {}", HexUtils.bytesToHex(d)); + } } break; case RADIO_ERP2: diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/Helper.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/Helper.java index fcc51a71d1d59..c48df4ef44aca 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/Helper.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/Helper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListener.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListener.java index edc7e9d9d8e3e..775a76d5afa64 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListener.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,4 +42,4 @@ public void handleResponse(Response response) throws EnOceanException { throw new EnOceanException(e.getMessage()); } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListenerIgnoringTimeouts.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListenerIgnoringTimeouts.java index 5cadffc2afd28..ad0dddd280001 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListenerIgnoringTimeouts.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/ResponseListenerIgnoringTimeouts.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/TransceiverErrorListener.java b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/TransceiverErrorListener.java index 85657b02f9369..b967d5f425df1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/TransceiverErrorListener.java +++ b/bundles/org.openhab.binding.enocean/src/main/java/org/openhab/binding/enocean/internal/transceiver/TransceiverErrorListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/config/config.xml index e960e6fe868a3..199039a8eafb1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/config/config.xml @@ -32,7 +32,7 @@ <default>channelA</default> </parameter> <parameter name="switchMode" type="text"> - <label>Switch mode</label> + <label>Switch Mode</label> <options> <option value="rockerSwitch">Rocker switch</option> <option value="toggleButtonDir1">Toggle button (upper button)</option> @@ -43,12 +43,12 @@ </config-description> <config-description uri="enocean:virtualRockerChannel:config"> - <parameter name="duration" type="integer"> - <label>Time in ms between Press and Release message</label> + <parameter name="duration" type="integer" unit="ms"> + <label>Time Between Press and Release Message</label> <default>250</default> </parameter> <parameter name="switchMode" type="text"> - <label>Switch mode</label> + <label>Switch Mode</label> <options> <option value="rockerSwitch">Rocker switch</option> <option value="toggleButtonDir1">Toggle button (upper button)</option> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/i18n/ocean.properties b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/i18n/ocean.properties index e586784609f5f..4eb2ebd249fdf 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/i18n/ocean.properties +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/i18n/ocean.properties @@ -1,3 +1,3 @@ config-status.error.missing-port-configuration=No serial port for the enocean bridge has been provided. config-status.error.missing-senderId-configuration=No sender Id has been provided. -config-status.error.malformed-senderId-configuration=Sender Id is malformed, must be specified in hex form. \ No newline at end of file +config-status.error.malformed-senderId-configuration=Sender Id is malformed, must be specified in hex form. diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/CentralCommand.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/CentralCommand.xml index bb104931be091..d5bf8c1bd8dca 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/CentralCommand.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/CentralCommand.xml @@ -23,7 +23,7 @@ <description>Id is used to generate the EnOcean Id (Int between [1-127]). If not specified the next free Id will be determined by bridge</description> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <options> <option value="A5_38_08_01">Gateway command - switching (A5_38_08 sub command 0x01)</option> <option value="A5_38_08_02">Gateway command - dimming (A5_38_08 sub command 0x02)</option> @@ -32,11 +32,11 @@ <required>true</required> </parameter> <parameter name="broadcastMessages" type="boolean"> - <label>Send broadcast messages</label> + <label>Send Broadcast Messages</label> <default>true</default> </parameter> <parameter name="receivingEEPId" type="text"> - <label>EEP for receiving states</label> + <label>EEP for Receiving States</label> <options> <option value="F6_00_00">PTM200 (F6 message widely used by Eltako devices)</option> <option value="A5_38_08_02">Message with dimming value (A5_38_08 sub command 0x02)</option> @@ -46,7 +46,7 @@ <required>true</required> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/ClassicDevice.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/ClassicDevice.xml index ba014ef3a95de..40fd2703f1134 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/ClassicDevice.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/ClassicDevice.xml @@ -25,7 +25,7 @@ <description>Id is used to generate the EnOcean Id (Int between [1-127]). If not specified the next free Id will be determined by bridge</description> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <description>EEP which is used to control the device</description> <options> <option value="F6_02_01">F6-02-01 (upper rocker => DIR1)</option> @@ -36,7 +36,7 @@ <required>true</required> </parameter> <parameter name="receivingEEPId" type="text"> - <label>EEP for receiving states</label> + <label>EEP for Receiving States</label> <description>EEP which is used by rocker switch listener(s)</description> <options> <option value="F6_02_01">F6-02-01 (upper rocker => DIR1)</option> @@ -47,7 +47,7 @@ <required>true</required> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> @@ -76,7 +76,7 @@ <description>The virtual rocker switch channel allows to send rocker msg with channel B.</description> <config-description> <parameter name="switchMode" type="text"> - <label>Switch mode</label> + <label>Switch Mode</label> <options> <option value="rockerSwitch">Rocker Switch</option> <option value="toggleButtonDir1">Toggle Button (upper button)</option> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/EnvironmentalSensor.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/EnvironmentalSensor.xml new file mode 100644 index 0000000000000..d89a4fdee22eb --- /dev/null +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/EnvironmentalSensor.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="enocean" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="environmentalSensor"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>Environmental Sensor</label> + <description>Sensor for different environmental sensors like a weather station (EEP: A5-13)</description> + + <config-description> + <parameter name="enoceanId" type="text"> + <label>EnOceanId</label> + <description>EnOceanId of device this thing belongs to</description> + <required>true</required> + </parameter> + <parameter name="receivingEEPId" type="text"> + <label>EEP</label> + <description>EEP which is used by sensor</description> + <options> + <option value="A5_13_01">A5-13-01 Weather station</option> + </options> + <limitToOptions>true</limitToOptions> + <required>true</required> + </parameter> + </config-description> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/GenericThing.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/GenericThing.xml index dbf64a32eeec3..89c3809b2f917 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/GenericThing.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/GenericThing.xml @@ -23,7 +23,7 @@ <description>Id is used to generate the EnOcean Id (Int between [1-127]). If not specified the next free Id will be determined by bridge</description> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <options> <option value="F6_FF_FF">Generic RPS (F6)</option> <option value="A5_FF_FF">Generic 4BS (A5)</option> @@ -33,7 +33,7 @@ <required>true</required> </parameter> <parameter name="receivingEEPId" type="text"> - <label>EEP for receiving states</label> + <label>EEP for Receiving States</label> <options> <option value="F6_FF_FF">Generic RPS (F6)</option> <option value="A5_FF_FF">Generic 4BS (A5)</option> @@ -43,11 +43,11 @@ <required>true</required> </parameter> <parameter name="broadcastMessages" type="boolean"> - <label>Send broadcast messages</label> + <label>Send Broadcast Messages</label> <default>true</default> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/MeasurementSwitch.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/MeasurementSwitch.xml index df06bdb5c4cb7..75be6d46a88e7 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/MeasurementSwitch.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/MeasurementSwitch.xml @@ -24,12 +24,12 @@ <required>true</required> </parameter> <parameter name="pollingInterval" type="integer" min="0" unit="s"> - <label>Polling interval</label> + <label>Polling Interval</label> <description>Time in seconds after a refresh is triggerd, 0 to disable</description> <default>300</default> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <options> <option value="D2_01_00">Switching and energy measurement (EEP: D2_01_00)</option> <option value="D2_01_01">Switching (EEP: D2_01_01)</option> @@ -57,11 +57,11 @@ <required>true</required> </parameter> <parameter name="broadcastMessages" type="boolean"> - <label>Send broadcast messages</label> + <label>Send Broadcast Messages</label> <default>false</default> </parameter> <parameter name="receivingEEPId" type="text" multiple="true"> - <label>EEP for receiving commands</label> + <label>EEP for Receiving Commands</label> <options> <option value="D2_01_00">Switching and energy measurement (EEP: D2_01_00)</option> <option value="D2_01_01">Switching (EEP: D2_01_01)</option> @@ -91,7 +91,7 @@ <required>true</required> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/PushButton.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/PushButton.xml index 81efd31dba0a0..1dbe16399da83 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/PushButton.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/PushButton.xml @@ -11,7 +11,7 @@ </supported-bridge-type-refs> <label>Simple Push Button</label> - <description>Represents a physical push button (EEP: F6-01)</description> + <description>Represents a physical Push Button (EEP: F6-01, D2-03)</description> <config-description> <parameter name="enoceanId" type="text"> @@ -24,6 +24,7 @@ <description>EEP which is used by push button</description> <options> <option value="F6_01_01">F6-01-01</option> + <option value="D2_03_0A">D2-03-0A</option> </options> <limitToOptions>true</limitToOptions> <default>F6_01_01</default> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Rollershutter.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Rollershutter.xml index 89aae59187e69..fc822c8111fe1 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Rollershutter.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Rollershutter.xml @@ -23,12 +23,12 @@ <description>Id is used to generate the EnOcean Id (Int between [1-127]). If not specified the next free Id will be determined by bridge</description> </parameter> <parameter name="pollingInterval" type="integer" min="0" unit="s"> - <label>Polling interval</label> + <label>Polling Interval</label> <description>Time in seconds after a refresh is triggered, 0 to disable</description> <default>300</default> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <options> <option value="A5_3F_7F_EltakoFSB">Eltako FSB14/61/71</option> <option value="D2_05_00">D2-05-00 Rollershutter (like SIN-2-RS-01)</option> @@ -39,11 +39,11 @@ <required>true</required> </parameter> <parameter name="broadcastMessages" type="boolean"> - <label>Send broadcast messages</label> + <label>Send Broadcast Messages</label> <default>true</default> </parameter> <parameter name="receivingEEPId" type="text" multiple="true"> - <label>EEP for receiving states</label> + <label>EEP for Receiving States</label> <options> <option value="A5_3F_7F_EltakoFSB">Eltako FSB14/61/71</option> <option value="D2_05_00">D2-05-00 Rollershutter (like SIN-2-RS-01)</option> @@ -55,7 +55,7 @@ <required>true</required> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Thermostat.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Thermostat.xml index 6b34267ae21c8..3750ca16f5ada 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Thermostat.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/Thermostat.xml @@ -2,7 +2,7 @@ <thing:thing-descriptions bindingId="enocean" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="thermostat"> <supported-bridge-type-refs> @@ -34,7 +34,7 @@ <required>true</required> </parameter> <parameter name="sendingEEPId" type="text"> - <label>EEP for sending commands</label> + <label>EEP for Sending Commands</label> <options> <option value="A5_20_04">Heating radiator valve actuating drive with feed and room temperature measurement, local set point control and display</option> </options> @@ -43,11 +43,11 @@ <required>true</required> </parameter> <parameter name="broadcastMessages" type="boolean"> - <label>Send broadcast messages</label> + <label>Send Broadcast Messages</label> <default>false</default> </parameter> <parameter name="suppressRepeating" type="boolean"> - <label>Suppress repeating of messages</label> + <label>Suppress Repeating of Messages</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/bridge.xml index 532d465805976..8bbe041a334f3 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/bridge.xml @@ -22,12 +22,12 @@ </parameter> <parameter name="rs485" type="boolean"> <advanced>true</advanced> - <label>Gateway connected directly to RS485 BUS</label> + <label>Gateway Connected Directly to RS485 BUS</label> <default>false</default> </parameter> <parameter name="nextSenderId" type="integer"> <advanced>true</advanced> - <label>Next device Id</label> + <label>Next Device Id</label> <description>Defines the next device Id, if empty, the next device id is automatically determined</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/channels.xml index 2f699c8ad51bd..8eb948cc844e2 100644 --- a/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.enocean/src/main/resources/ESH-INF/thing/channels.xml @@ -56,7 +56,7 @@ <category>Blinds</category> <config-description> <parameter name="shutTime" type="integer"> - <label>Shut time</label> + <label>Shut Time</label> <description>Time (in seconds) to completely close the rollershutter</description> </parameter> </config-description> @@ -70,7 +70,7 @@ <category>DimmableLight</category> <config-description> <parameter name="rampingTime" type="integer"> - <label>Ramping time</label> + <label>Ramping Time</label> <description>A5-38-08: Ramping Time (in seconds), 0 = no ramping, 1..255 = seconds to 100%; D2-01-01: 0 = switch, 1-3 = timer 1-3, 4 = stop</description> </parameter> <parameter name="eltakoDimmer" type="boolean"> @@ -79,7 +79,7 @@ <default>true</default> </parameter> <parameter name="storeValue" type="boolean"> - <label>Store value</label> + <label>Store Value</label> <description>Store final value</description> <default>false</default> </parameter> @@ -104,7 +104,7 @@ <channel-type id="setPoint"> <item-type>Number</item-type> - <label>Set point</label> + <label>Set Point</label> <description>linear set point</description> <state readOnly="true" min="0" max="255" /> </channel-type> @@ -171,7 +171,7 @@ <state pattern="%d %unit%" readOnly="true" /> <config-description> <parameter name="validateValue" type="boolean"> - <label>Validate value</label> + <label>Validate Value</label> <description>Filter out increases more than 10.0 kWh and decreases less than 1.0 kWh</description> <default>false</default> </parameter> @@ -207,7 +207,7 @@ <description>Id is used for 4BS teach in with EEP</description> </parameter> <parameter name="teachInMSG" type="text"> - <label>Teach in message</label> + <label>Teach in Message</label> <description>Use this message if teach in type and/or manufacturer id are unknown</description> </parameter> </config-description> @@ -234,14 +234,6 @@ <state readOnly="true" /> </channel-type> - <channel-type id="motionDetection"> - <item-type>Switch</item-type> - <label>Motion Detected</label> - <description>Motion detection sensor state.</description> - <category>Switch</category> - <state readOnly="true" /> - </channel-type> - <channel-type id="vibration"> <item-type>Switch</item-type> <label>Vibration Alarm</label> @@ -257,6 +249,27 @@ <state pattern="%d %unit%" readOnly="true" /> </channel-type> + <channel-type id="illuminationWest"> + <item-type>Number:Illuminance</item-type> + <label>Sun West</label> + <description>Illumination in lux</description> + <state pattern="%d %unit%" readOnly="true" /> + </channel-type> + + <channel-type id="illuminationSouthNorth"> + <item-type>Number:Illuminance</item-type> + <label>Sun South/North</label> + <description>Illumination in lux</description> + <state pattern="%d %unit%" readOnly="true" /> + </channel-type> + + <channel-type id="illuminationEast"> + <item-type>Number:Illuminance</item-type> + <label>Sun East</label> + <description>Illumination in lux</description> + <state pattern="%d %unit%" readOnly="true" /> + </channel-type> + <channel-type id="autoOFF" advanced="true"> <item-type>Number:Duration</item-type> <label>Auto Off</label> @@ -301,22 +314,20 @@ <channel-type id="angle"> <item-type>Number:Angle</item-type> <label>Angle</label> - <description>Blind angle</description> + <description>Blind Angle</description> <category>Blinds</category> <state pattern="%d %unit%" /> </channel-type> - <!-- Litre Channel --> - <channel-type id="amrLitre"> - <item-type>Number:Litre</item-type> - <label>Litre per second</label> + <channel-type id="currentFlow"> + <item-type>Number:VolumetricFlowRate</item-type> + <label>Current Flow</label> <state pattern="%d %unit%" readOnly="true" /> </channel-type> - <!-- Litre Channel --> - <channel-type id="amrCubicMetre"> - <item-type>Number:Litre</item-type> - <label>Cubic metre</label> + <channel-type id="cumulativeValue"> + <item-type>Number:Volume</item-type> + <label>Cumulative Value</label> <state pattern="%d %unit%" readOnly="true" /> </channel-type> @@ -334,9 +345,17 @@ <state readOnly="true" /> </channel-type> + <channel-type id="rainStatus"> + <item-type>Switch</item-type> + <label>Rain</label> + <description>Rain indicator</description> + <category>Switch</category> + <state readOnly="true" /> + </channel-type> + <channel-type id="valvePosition"> <item-type>Number</item-type> - <label>Valve position</label> + <label>Valve Position</label> <description>Indicates the actual percent position of the valve.</description> <category>thermostat</category> <state min="0" max="100" step="1" pattern="%d %%" /> @@ -344,21 +363,21 @@ <channel-type id="buttonLock"> <item-type>Switch</item-type> - <label>Button lock</label> + <label>Button Lock</label> <description>Enables or disables buttons on the device.</description> <category>thermostat</category> </channel-type> <channel-type id="measurementControl" advanced="true"> <item-type>Switch</item-type> - <label>Measurement control</label> + <label>Measurement Control</label> <description>Enables or disables temperature measurement on the device.</description> <category>thermostat</category> </channel-type> <channel-type id="displayOrientation" advanced="true"> <item-type>Number</item-type> - <label>Display orientation</label> + <label>Display Orientation</label> <description>Orientation of the display.</description> <category>thermostat</category> <state> @@ -373,21 +392,21 @@ <channel-type id="temperatureSetPoint"> <item-type>Number:Temperature</item-type> - <label>Set point</label> + <label>Set Point</label> <description>Desired temperature</description> <state min="10" max="30" /> </channel-type> <channel-type id="feedTemperature"> <item-type>Number:Temperature</item-type> - <label>Feed temperature</label> + <label>Feed Temperature</label> <description>Water temperature in the radiator input</description> <state readOnly="true" /> </channel-type> <channel-type id="failureCode"> <item-type>Number</item-type> - <label>Failure code</label> + <label>Failure Code</label> <description>Failure code</description> <category>thermostat</category> <state readOnly="true" /> @@ -395,7 +414,7 @@ <channel-type id="wakeUpCycle"> <item-type>Number</item-type> - <label>Wakeup cycle</label> + <label>Wakeup Cycle</label> <description>Defines the cyclic wake-up time. The time corresponding to the number has to be looked up.</description> <category>thermostat</category> <state min="0" max="63" /> @@ -403,7 +422,7 @@ <channel-type id="serviceCommand" advanced="true"> <item-type>Number</item-type> - <label>Service command</label> + <label>Service Command</label> <description>Command to be sent to actuator</description> <category>thermostat</category> <state> @@ -425,7 +444,7 @@ <channel-type id="sendCommand"> <item-type>Switch</item-type> - <label>Send command</label> + <label>Send Command</label> <description>You can send telegrams to the device by switching this channel on</description> <category>thermostat</category> </channel-type> diff --git a/bundles/org.openhab.binding.toon/.classpath b/bundles/org.openhab.binding.enturno/.classpath similarity index 100% rename from bundles/org.openhab.binding.toon/.classpath rename to bundles/org.openhab.binding.enturno/.classpath diff --git a/bundles/org.openhab.binding.enturno/.project b/bundles/org.openhab.binding.enturno/.project new file mode 100644 index 0000000000000..50f911788ee92 --- /dev/null +++ b/bundles/org.openhab.binding.enturno/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.enturno</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> diff --git a/bundles/org.openhab.binding.enturno/CONTRIBUTE.md b/bundles/org.openhab.binding.enturno/CONTRIBUTE.md index ecee9ce289613..7dc198a3fa9ee 100644 --- a/bundles/org.openhab.binding.enturno/CONTRIBUTE.md +++ b/bundles/org.openhab.binding.enturno/CONTRIBUTE.md @@ -45,4 +45,4 @@ There are several possibilities to get and process data from endpoints that entu } } } -``` \ No newline at end of file +``` diff --git a/bundles/org.openhab.binding.enturno/NOTICE b/bundles/org.openhab.binding.enturno/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.enturno/NOTICE +++ b/bundles/org.openhab.binding.enturno/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.enturno/README.md b/bundles/org.openhab.binding.enturno/README.md index 5baaa4eb4509c..11665aeeb69b6 100644 --- a/bundles/org.openhab.binding.enturno/README.md +++ b/bundles/org.openhab.binding.enturno/README.md @@ -1,17 +1,17 @@ # EnturNo Binding -This binding gets Norwegian public transport real-time (estimated) data from the [Entur.no API](https://developer.entur.org/content/journey-planner-0). +This binding gets Norwegian public transport real-time (estimated) data from the [Entur.org API](https://developer.entur.org/pages-intro-overview). ## Supported Things As for now, binding supports only one thing `linestop`. -It can change in the future as entur.no exposes API for access of different type public transport data, for example: journey planing, stop information etc. +It can change in the future as [entur.org](https://developer.entur.org) exposes API for access of different type public transport data, for example: journey planing, stop information etc. ### Entur Timetable Entur timetable provides information about departures for chosen line/service of public transport in Norway and chosen stop place. It contains informationabout stop place (id, name, transport mode) and real-time departures from that place. -**It is worth noting that binding is thought to be primarily used for busdepartures (can work for other supported by entur.no transport types). +**It is worth noting that binding is thought to be primarily used for busdepartures (can work for other supported by [entur.org](https://developer.entur.org/pages-intro-overview) transport types). Two Direction channel groups are consequence of that assumption. That will say that usually for stop place of a given name there are two bus stops for same line going in opposite directions.** Each **Direction** channel group contains information about direction,line code, 5 coming departures, and whether given departure time is real-time (estimated) or not. @@ -55,7 +55,7 @@ Since thing needs to be explicitly configured for stop id and line, no auto disc demo.things ```java -Thing enturno:linestop:1 "Småstrandgaten line nr 2" [stopPlaceId="NSR:StopPlace:30848", lineCode="2"] +Thing enturno:linestop:7e693fff "Småstrandgaten line nr 2" [stopPlaceId="NSR:StopPlace:30848", lineCode="2"] ``` ### Items @@ -64,34 +64,34 @@ demo.items ```java // Stop place -String StopId "StopId" {channel="enturno:linestop:1:stopPlace#id"} -String StopPlaceName "Stop Place [%s]" {channel="enturno:linestop:1:stopPlace#name"} -String LineCode "Line [%s]" {channel="enturno:linestop:1:Direction01#lineCode"} -String TransportMode "TransportMode [%s]" {channel="enturno:linestop:1:stopPlace#transportMode"} +String StopId "StopId" {channel="enturno:linestop:7e693fff:stopPlace#id"} +String StopPlaceName "Stop Place [%s]" {channel="enturno:linestop:7e693fff:stopPlace#name"} +String LineCode "Line [%s]" {channel="enturno:linestop:7e693fff:Direction01#lineCode"} +String TransportMode "TransportMode [%s]" {channel="enturno:linestop:7e693fff:stopPlace#transportMode"} // Direction01 -String Direction01_FrontDisplay "Direction01 front display [%s]" {channel="enturno:linestop:1:Direction01#frontDisplayText"} -DateTime RealTime_Departure01_Time1 "Departure01 time" {channel="enturno:linestop:1:Direction01#departure01"} -DateTime RealTime_Departure02_Time2 "Departure02 time" {channel="enturno:linestop:1:Direction01#departure02"} -DateTime RealTime_Departure03_Time3 "Departure03 time" {channel="enturno:linestop:1:Direction01#departure03"} -DateTime RealTime_Departure04_Time4 "Departure04 time" {channel="enturno:linestop:1:Direction01#departure04"} -DateTime RealTime_Departure05_Time5 "Departure05 time" {channel="enturno:linestop:1:Direction01#departure05"} -String RealTime_Departure01_IsReal1 "Departure01 is real-time" {channel="enturno:linestop:1:Direction01#estimatedFlag01"} -String RealTime_Departure02_IsReal2 "Departure02 is real-time" {channel="enturno:linestop:1:Direction01#estimatedFlag02"} -String RealTime_Departure03_IsReal3 "Departure03 is real-time" {channel="enturno:linestop:1:Direction01#estimatedFlag03"} -String RealTime_Departure04_IsReal4 "Departure04 is real-time" {channel="enturno:linestop:1:Direction01#estimatedFlag04"} -String RealTime_Departure05_IsReal5 "Departure05 is real-time" {channel="enturno:linestop:1:Direction01#estimatedFlag05"} +String Direction01_FrontDisplay "Direction01 front display [%s]" {channel="enturno:linestop:7e693fff:Direction01#frontDisplayText"} +DateTime RealTime_Direction01_Time1 "Departure01 time" {channel="enturno:linestop:7e693fff:Direction01#departure01"} +DateTime RealTime_Direction01_Time2 "Departure02 time" {channel="enturno:linestop:7e693fff:Direction01#departure02"} +DateTime RealTime_Direction01_Time3 "Departure03 time" {channel="enturno:linestop:7e693fff:Direction01#departure03"} +DateTime RealTime_Direction01_Time4 "Departure04 time" {channel="enturno:linestop:7e693fff:Direction01#departure04"} +DateTime RealTime_Direction01_Time5 "Departure05 time" {channel="enturno:linestop:7e693fff:Direction01#departure05"} +String RealTime_Direction01_IsReal1 "Departure01 is real-time" {channel="enturno:linestop:7e693fff:Direction01#estimatedFlag01"} +String RealTime_Direction01_IsReal2 "Departure02 is real-time" {channel="enturno:linestop:7e693fff:Direction01#estimatedFlag02"} +String RealTime_Direction01_IsReal3 "Departure03 is real-time" {channel="enturno:linestop:7e693fff:Direction01#estimatedFlag03"} +String RealTime_Direction01_IsReal4 "Departure04 is real-time" {channel="enturno:linestop:7e693fff:Direction01#estimatedFlag04"} +String RealTime_Direction01_IsReal5 "Departure05 is real-time" {channel="enturno:linestop:7e693fff:Direction01#estimatedFlag05"} //Direction02 -String Direction02_FrontDisplay "Direction02 front display [%s]" {channel="enturno:linestop:1:Direction02#frontDisplayText"} -DateTime RealTime_Departure01_Time1 "Departure01 time" {channel="enturno:linestop:1:Direction02#departure01"} -DateTime RealTime_Departure02_Time2 "Departure02 time" {channel="enturno:linestop:1:Direction02#departure02"} -DateTime RealTime_Departure03_Time3 "Departure03 time" {channel="enturno:linestop:1:Direction02#departure03"} -DateTime RealTime_Departure04_Time4 "Departure04 time" {channel="enturno:linestop:1:Direction02#departure04"} -DateTime RealTime_Departure05_Time5 "Departure05 time" {channel="enturno:linestop:1:Direction02#departure05"} -String RealTime_Departure01_IsReal1 "Departure01 is real-time" {channel="enturno:linestop:1:Direction02#estimatedFlag01"} -String RealTime_Departure02_IsReal2 "Departure02 is real-time" {channel="enturno:linestop:1:Direction02#estimatedFlag02"} -String RealTime_Departure03_IsReal3 "Departure03 is real-time" {channel="enturno:linestop:1:Direction02#estimatedFlag03"} -String RealTime_Departure04_IsReal4 "Departure04 is real-time" {channel="enturno:linestop:1:Direction02#estimatedFlag04"} -String RealTime_Departure05_IsReal5 "Departure05 is real-time" {channel="enturno:linestop:1:Direction02#estimatedFlag05"} +String Direction02_FrontDisplay "Direction02 front display [%s]" {channel="enturno:linestop:7e693fff:Direction02#frontDisplayText"} +DateTime RealTime_Direction02_Time1 "Departure01 time" {channel="enturno:linestop:7e693fff:Direction02#departure01"} +DateTime RealTime_Direction02_Time2 "Departure02 time" {channel="enturno:linestop:7e693fff:Direction02#departure02"} +DateTime RealTime_Direction02_Time3 "Departure03 time" {channel="enturno:linestop:7e693fff:Direction02#departure03"} +DateTime RealTime_Direction02_Time4 "Departure04 time" {channel="enturno:linestop:7e693fff:Direction02#departure04"} +DateTime RealTime_Direction02_Time5 "Departure05 time" {channel="enturno:linestop:7e693fff:Direction02#departure05"} +String RealTime_Direction02_IsReal1 "Departure01 is real-time" {channel="enturno:linestop:7e693fff:Direction02#estimatedFlag01"} +String RealTime_Direction02_IsReal2 "Departure02 is real-time" {channel="enturno:linestop:7e693fff:Direction02#estimatedFlag02"} +String RealTime_Direction02_IsReal3 "Departure03 is real-time" {channel="enturno:linestop:7e693fff:Direction02#estimatedFlag03"} +String RealTime_Direction02_IsReal4 "Departure04 is real-time" {channel="enturno:linestop:7e693fff:Direction02#estimatedFlag04"} +String RealTime_Direction02_IsReal5 "Departure05 is real-time" {channel="enturno:linestop:7e693fff:Direction02#estimatedFlag05"} ``` diff --git a/bundles/org.openhab.binding.enturno/pom.xml b/bundles/org.openhab.binding.enturno/pom.xml index a45564f7fb51c..4a044f5d7bf80 100644 --- a/bundles/org.openhab.binding.enturno/pom.xml +++ b/bundles/org.openhab.binding.enturno/pom.xml @@ -1,13 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.enturno</artifactId> diff --git a/bundles/org.openhab.binding.enturno/src/main/feature/feature.xml b/bundles/org.openhab.binding.enturno/src/main/feature/feature.xml index 3c18f9e4d7fad..e96c75b636c35 100644 --- a/bundles/org.openhab.binding.enturno/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.enturno/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.enturno-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-enturno" description="Enturno Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoBindingConstants.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoBindingConstants.java index 2e718e537456c..a00cc3e0bcef6 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoBindingConstants.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoConfiguration.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoConfiguration.java index cf531a102afb3..538be659431f7 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoConfiguration.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandler.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandler.java index a4fc36bbee890..54978d7f583e0 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandler.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandlerFactory.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandlerFactory.java index 5baa0a50f323d..fca5dbbb470aa 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandlerFactory.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/EnturNoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturCommunicationException.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturCommunicationException.java old mode 100755 new mode 100644 index bdda61507e418..816ba8c2102b3 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturCommunicationException.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturConfigurationException.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturConfigurationException.java old mode 100755 new mode 100644 index 8bfef2e19e49f..73773064d9701 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturConfigurationException.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturNoConnection.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturNoConnection.java index 79bf50829d4e1..e760367040cb2 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturNoConnection.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/connection/EnturNoConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/Data.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/Data.java index 7c8c869094fb0..ac64f10637a5e 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/Data.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/Data.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturData.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturData.java index 6297133c90017..d3dab2feefd5d 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturData.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturJsonData.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturJsonData.java index 497cbacb0c716..136ba692d2505 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturJsonData.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/EnturJsonData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/DestinationDisplay.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/DestinationDisplay.java index d42d7a0c8e876..39d800a05bf59 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/DestinationDisplay.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/DestinationDisplay.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/EstimatedCalls.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/EstimatedCalls.java index 35e7da7b0da78..914a45a064f69 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/EstimatedCalls.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/EstimatedCalls.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/JourneyPattern.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/JourneyPattern.java index 69554b6804c0f..cb1bf8caa0a6b 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/JourneyPattern.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/JourneyPattern.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Line.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Line.java index 6bfbf411be1bd..641d094e38dd6 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Line.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Line.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Quay.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Quay.java index 46ab17d14cf26..e09dee729995e 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Quay.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/Quay.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/ServiceJourney.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/ServiceJourney.java index 11486e7146d9e..0771c83d29b00 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/ServiceJourney.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/estimated/ServiceJourney.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/simplified/DisplayData.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/simplified/DisplayData.java index 112703e301007..30fd053a157b7 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/simplified/DisplayData.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/simplified/DisplayData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/stopplace/StopPlace.java b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/stopplace/StopPlace.java index 8910082edcb93..bb08144aaf4cd 100644 --- a/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/stopplace/StopPlace.java +++ b/bundles/org.openhab.binding.enturno/src/main/java/org/openhab/binding/enturno/internal/model/stopplace/StopPlace.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.enturno/src/main/resources/ESH-INF/i18n/enturtimetable.properties b/bundles/org.openhab.binding.enturno/src/main/resources/ESH-INF/i18n/enturtimetable.properties old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.evohome/NOTICE b/bundles/org.openhab.binding.evohome/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.evohome/NOTICE +++ b/bundles/org.openhab.binding.evohome/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.evohome/pom.xml b/bundles/org.openhab.binding.evohome/pom.xml index b228d308babe6..71a6616bc9c7b 100644 --- a/bundles/org.openhab.binding.evohome/pom.xml +++ b/bundles/org.openhab.binding.evohome/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.evohome</artifactId> diff --git a/bundles/org.openhab.binding.evohome/src/main/feature/feature.xml b/bundles/org.openhab.binding.evohome/src/main/feature/feature.xml index f2d24af8415ba..2f4ac3e249090 100644 --- a/bundles/org.openhab.binding.evohome/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.evohome/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.evohome-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-evohome" description="Evohome Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeBindingConstants.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeBindingConstants.java index 5fcd22f965748..276dc3ca2e167 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeBindingConstants.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeHandlerFactory.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeHandlerFactory.java index 5f28ef9b1468e..edef30d8c7dfe 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeHandlerFactory.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/EvohomeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -106,4 +106,4 @@ protected void unsetHttpClientFactory(HttpClientFactory httpClientFactory) { this.httpClient = null; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/RunnableWithTimeout.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/RunnableWithTimeout.java index d0a3676f20499..fb1309e1eae31 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/RunnableWithTimeout.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/RunnableWithTimeout.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/ApiAccess.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/ApiAccess.java index 1ab9d73f3c136..c28a9063f82c4 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/ApiAccess.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/ApiAccess.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClient.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClient.java index 6138ede8e9077..98ea2a22efd1b 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClient.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClientException.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClientException.java index 024edd56659dc..a699dc3a5d038 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClientException.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiClientException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiConstants.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiConstants.java index 0eeff41d99d84..f43dcffaeffd3 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiConstants.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/EvohomeApiConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java index e21f1ff389e00..f43f3ea56a802 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java index 0d1d387f3799e..09da0c6c5d952 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/HeatSetPointBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java index b9febfdbdb6fb..f03fc85565fe5 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/Mode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java index 137eeac630163..af99fa388de45 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/ModeBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java index 3f9ef711c04ec..077be44198997 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/RequestBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java index 212d9a49c87b9..7e1ef8dac3435 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/request/TimedRequestBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java index 18b25dc27e765..861091078836a 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ActiveFault.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java index dd0366f9593d8..868649038fa86 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Authentication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java index f283c337835c8..bdc9a5a05d9a7 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Gateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java index f2b01ee9720e2..e35fc048f9301 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java index 6a23f7c0bd56f..955f6fae5079d 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/GatewayStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java index d58eb0e0132a7..9bf7e024b1a1f 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointCapabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java index a05887c54b16c..f5877f1a5aef7 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/HeatSetpointStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java index f7832b6b6072b..5239e7e27defc 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Location.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java index 48cd31a607e57..396a28f05d940 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java index b01916648333c..52d41d64836c9 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationOwner.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java index 274948ab730e1..c17340831e509 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java index be69ac1ef8393..8dd9cea344bbe 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Locations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java index 10de0fd37be7d..0d81c7e2f87fa 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/LocationsStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java index 683833c42b653..a00cedbea49ca 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Mode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java index 6b6ace59ee803..b6b9af7989042 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ScheduleCapabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java index 5309c8268d1b3..8a27d62df482b 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/SystemModeStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java index 0e3f1789711f6..89f6ba049baa4 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java index 560376692f434..6baffbc00072f 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureControlSystemStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java index e7c2dae59d9bb..5ecc7d23f995a 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TemperatureStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java index c97767ad75240..376e4f91c98ad 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/TimeZone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java index 503c1a0178732..b4f3828e725af 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/UserAccount.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java index 8e3d0afefc9f7..2f08f3dd7923a 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/Zone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java index e251c9535a62c..f37708d072e38 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/api/models/v2/response/ZoneStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeAccountConfiguration.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeAccountConfiguration.java index 17dc4d039f4eb..48faccec6928a 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeAccountConfiguration.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeAccountConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeTemperatureControlSystemConfiguration.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeTemperatureControlSystemConfiguration.java index eac20ec5569fa..3c066c9e8194c 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeTemperatureControlSystemConfiguration.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeTemperatureControlSystemConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeThingConfiguration.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeThingConfiguration.java index 997a85cc69e29..4ea063998fec4 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeThingConfiguration.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/configuration/EvohomeThingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/discovery/EvohomeDiscoveryService.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/discovery/EvohomeDiscoveryService.java index 86708c1709bdc..0325f53a2efb6 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/discovery/EvohomeDiscoveryService.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/discovery/EvohomeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/AccountStatusListener.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/AccountStatusListener.java index 3e0413ecd452e..7d27203e76f13 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/AccountStatusListener.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/AccountStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/BaseEvohomeHandler.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/BaseEvohomeHandler.java index 9b792d11e9fc5..6f70227dc7938 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/BaseEvohomeHandler.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/BaseEvohomeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeAccountBridgeHandler.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeAccountBridgeHandler.java index 4983ce3ed0442..888bb23edc87e 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeAccountBridgeHandler.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeAccountBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeHeatingZoneHandler.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeHeatingZoneHandler.java index cc300980db998..81e964e9d4f49 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeHeatingZoneHandler.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeHeatingZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeTemperatureControlSystemHandler.java b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeTemperatureControlSystemHandler.java index 1ad1197e943f9..6cc6a393feea6 100644 --- a/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeTemperatureControlSystemHandler.java +++ b/bundles/org.openhab.binding.evohome/src/main/java/org/openhab/binding/evohome/internal/handler/EvohomeTemperatureControlSystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.evohome/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.evohome/src/main/resources/ESH-INF/thing/thing-types.xml index 8e7393f63b509..50cd2ce9c156b 100644 --- a/bundles/org.openhab.binding.evohome/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.evohome/src/main/resources/ESH-INF/thing/thing-types.xml @@ -25,7 +25,7 @@ <bridge-type-ref id="account" /> </supported-bridge-type-refs> <label>evohome Heating Zone</label> - <description>This represents the Evohome Heating Zone.</description> + <description>This represents the evohome Heating Zone.</description> <channels> <channel id="Temperature" typeId="temperature" /> <channel id="SetPointStatus" typeId="setpointstatus" /> diff --git a/bundles/org.openhab.binding.exec/NOTICE b/bundles/org.openhab.binding.exec/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.exec/NOTICE +++ b/bundles/org.openhab.binding.exec/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.exec/README.md b/bundles/org.openhab.binding.exec/README.md index f9091973d2769..a02d60a7c0ce7 100644 --- a/bundles/org.openhab.binding.exec/README.md +++ b/bundles/org.openhab.binding.exec/README.md @@ -40,7 +40,7 @@ Thing exec:command:uniquename [command="/command/to/execute here", interval=15, ``` -The `command` itself can be enhanced using the well known syntax of the [Java formatter class syntax](http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax). +The `command` itself can be enhanced using the well known syntax of the [Java formatter class syntax](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#syntax). The following parameters are automatically added: - the current date (as java.util.Date, example: `%1$tY-%1$tm-%1$td`) diff --git a/bundles/org.openhab.binding.exec/pom.xml b/bundles/org.openhab.binding.exec/pom.xml index 1c016bcd102c9..a2657587b8446 100644 --- a/bundles/org.openhab.binding.exec/pom.xml +++ b/bundles/org.openhab.binding.exec/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.exec</artifactId> diff --git a/bundles/org.openhab.binding.exec/src/main/feature/feature.xml b/bundles/org.openhab.binding.exec/src/main/feature/feature.xml index c0dc799b372ee..3c8ea91807234 100644 --- a/bundles/org.openhab.binding.exec/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.exec/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.exec-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-exec" description="Exec Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecBindingConstants.java b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecBindingConstants.java index a7b1893f902fe..f58b177c8736f 100644 --- a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecBindingConstants.java +++ b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java index cc906cb9ffe90..a98a0c1112d67 100644 --- a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java +++ b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java index dc60555be27e5..22c4cf48f8580 100644 --- a/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java +++ b/bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,6 +42,8 @@ import org.eclipse.smarthome.core.transform.TransformationService; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,6 +58,8 @@ public class ExecHandler extends BaseThingHandler { private Logger logger = LoggerFactory.getLogger(ExecHandler.class); + private final BundleContext bundleContext; + // List of Configurations constants public static final String INTERVAL = "interval"; public static final String TIME_OUT = "timeout"; @@ -73,6 +77,7 @@ public class ExecHandler extends BaseThingHandler { public ExecHandler(Thing thing) { super(thing); + this.bundleContext = FrameworkUtil.getBundle(ExecHandler.class).getBundleContext(); } @Override diff --git a/bundles/org.openhab.binding.feed/NOTICE b/bundles/org.openhab.binding.feed/NOTICE index 4c20ef446c1e4..b94757ece35b7 100644 --- a/bundles/org.openhab.binding.feed/NOTICE +++ b/bundles/org.openhab.binding.feed/NOTICE @@ -10,4 +10,18 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content + +JDOM Version: 2.0.6 +* License: JDOM License (modified Apache) +* Project: http://www.jdom.org +* Source: https://github.com/hunterhacker/jdom + +Rome Version 1.12.0 +* License: Apache 2.0 License +* Project: https://rometools.github.io/rome/ +* Source: https://github.com/rometools/rome + + diff --git a/bundles/org.openhab.binding.feed/README.md b/bundles/org.openhab.binding.feed/README.md index fb528f2e76842..982d52d0eb09b 100644 --- a/bundles/org.openhab.binding.feed/README.md +++ b/bundles/org.openhab.binding.feed/README.md @@ -4,7 +4,7 @@ This binding allows you to integrate feeds in the openHAB environment. The Feed binding downloads the content, tracks for changes, and displays information like feed author, feed title and description, number of entries, last update date. It can be used in combination with openHAB rules to trigger events on feed change. -It uses the [ROME library](http://rometools.github.io/rome/index.html) for parsing +It uses the [ROME library](https://rometools.github.io/rome/index.html) for parsing and supports a wide range of popular feed formats - RSS 2.00, RSS 1.00, RSS 0.94, RSS 0.93, RSS 0.92, RSS 0.91 UserLand, RSS 0.91 Netscape, RSS 0.90, Atom 1.0, Atom 0.3. diff --git a/bundles/org.openhab.binding.feed/pom.xml b/bundles/org.openhab.binding.feed/pom.xml index db55ee8875654..32c73c9554e41 100644 --- a/bundles/org.openhab.binding.feed/pom.xml +++ b/bundles/org.openhab.binding.feed/pom.xml @@ -1,30 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.feed</artifactId> <name>openHAB Add-ons :: Bundles :: Feed Binding</name> + <properties> + <bnd.importpackage>org.jaxen.*;resolution:=optional</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>com.rometools</groupId> <artifactId>rome</artifactId> <version>1.12.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.jdom</artifactId> - <version>2.0.6_1</version> - <scope>provided</scope> + <scope>compile</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> @@ -32,6 +29,18 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>com.rometools</groupId> + <artifactId>rome-utils</artifactId> + <version>1.12.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom2</artifactId> + <version>2.0.6</version> + <scope>compile</scope> + </dependency> </dependencies> </project> diff --git a/bundles/org.openhab.binding.feed/src/main/feature/feature.xml b/bundles/org.openhab.binding.feed/src/main/feature/feature.xml index 27b1d93745232..31fbe3547cfc0 100644 --- a/bundles/org.openhab.binding.feed/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.feed/src/main/feature/feature.xml @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.feed-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-feed" description="Feed Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:com.rometools/rome/1.12.0</bundle> - <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/2.0.6_1</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.feed/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedBindingConstants.java b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedBindingConstants.java index b08d18eb0a694..45e0d1356eee8 100644 --- a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedBindingConstants.java +++ b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedHandlerFactory.java b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedHandlerFactory.java index 715b60bbb7cca..be22004e89c93 100644 --- a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedHandlerFactory.java +++ b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/FeedHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/handler/FeedHandler.java b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/handler/FeedHandler.java index 65217d662f896..3e6c559d189b8 100644 --- a/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/handler/FeedHandler.java +++ b/bundles/org.openhab.binding.feed/src/main/java/org/openhab/binding/feed/internal/handler/FeedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feed/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.feed/src/main/resources/ESH-INF/thing/thing-types.xml index e10f7007934f8..6abaf258c0a84 100644 --- a/bundles/org.openhab.binding.feed/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.feed/src/main/resources/ESH-INF/thing/thing-types.xml @@ -34,7 +34,7 @@ up to date, updates the feed content stored in the channel --> <parameter name="refresh" type="integer"> - <label>Refresh time interval</label> + <label>Refresh Time Interval</label> <description>Refresh time interval in minutes.</description> <default>20</default> </parameter> @@ -44,21 +44,21 @@ <channel-type id="latest-title"> <item-type>String</item-type> - <label>Latest title</label> + <label>Latest Title</label> <description>Contains the title of the last feed entry.</description> <state readOnly="true" pattern="%s" /> </channel-type> <channel-type id="latest-description"> <item-type>String</item-type> - <label>Latest description</label> + <label>Latest Description</label> <description>Contains the description of last feed entry.</description> <state readOnly="true" pattern="%s" /> </channel-type> <channel-type id="latest-date"> <item-type>DateTime</item-type> - <label>Latest published date</label> + <label>Latest Published Date</label> <description>Contains the published date of the last feed entry.</description> <state readOnly="true" pattern="%tc %n" /> </channel-type> @@ -86,14 +86,14 @@ <channel-type id="last-update" advanced="true"> <item-type>DateTime</item-type> - <label>Last update</label> + <label>Last Update</label> <description>The last update date of the feed</description> <state readOnly="true" pattern="%tc %n" /> </channel-type> <channel-type id="number-of-entries" advanced="true"> <item-type>Number</item-type> - <label>Number of entries</label> + <label>Number of Entries</label> <description>Number of entries in the feed</description> <state readOnly="true" pattern="%d" /> </channel-type> diff --git a/bundles/org.openhab.binding.feican/NOTICE b/bundles/org.openhab.binding.feican/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.feican/NOTICE +++ b/bundles/org.openhab.binding.feican/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.feican/README.md b/bundles/org.openhab.binding.feican/README.md index fba74bdea1d38..a46ae237c1893 100644 --- a/bundles/org.openhab.binding.feican/README.md +++ b/bundles/org.openhab.binding.feican/README.md @@ -1,32 +1,33 @@ # Feican Binding -This binding adds support for the Feican Wi-Fi version of the smart light led Bulb, the WiFi RGBW Bulb. +This binding adds support for the Feican Wi-Fi version of the smart light LED Bulb, the WiFi RGBW Bulb. With this binding the light bulb can be switched on or off, set the color or set color based on color temperature. Set the brightness. And it contains a set of preset programs, where for some the program speed can be set. ## Supported Things -This binding supports the Feican smart smart light led Bulb, WiFi RGBW Bulb. This bulb supports color, color temperature, -brightness. It also has a number of preset programs, with static color, jumping color(s), gradient color(s) and flashing -color(s). With the program_speed the speed of some of the programs can be set. +This binding supports the Feican smart smart light LED Bulb, WiFi RGBW Bulb. +This bulb supports color, color temperature, brightness. +It also has a number of preset programs, with static color, jumping color(s), gradient color(s) and flashing color(s). +With the program_speed the speed of some of the programs can be set. -It might be the Feican ledstrips also work as it seems they can be controlled with the same app. But this has not been tested. +Although it has not been tested, the Feican LED strips may also be supported as it seems they can be controlled using the same app. ### Limitations -It's not possible to get the state of the bulb from the bulb itself. Therefore the state visible to the user only reflects -what was set in openHAB and may not correspond with the actual state. +It is not possible to get the state of the bulb from the bulb itself. +Therefore the state visible to the user only reflects what was set in openHAB and may not correspond with the actual state. ## Prerequisites -Before using the Feican bulb with openHab the devices must be connected to the Wi-Fi network. This can be done using the -Feican Android or iPhone DreamColor app. +Before using the Feican bulb with openHAB the devices must be connected to the Wi-Fi network. +This can be done using the Feican Android or iPhone DreamColor app. ## Discovery -Devices can be auto discovered within the local network. It's possible to connect to devices in a different network, -but these must be added manually. +Devices can be auto discovered within the local network. +It is possible to connect to devices in a different network, but these must be added manually. ## Thing Configuration diff --git a/bundles/org.openhab.binding.feican/pom.xml b/bundles/org.openhab.binding.feican/pom.xml index 68404e9145c43..21f1969c52e48 100644 --- a/bundles/org.openhab.binding.feican/pom.xml +++ b/bundles/org.openhab.binding.feican/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.feican</artifactId> diff --git a/bundles/org.openhab.binding.feican/src/main/feature/feature.xml b/bundles/org.openhab.binding.feican/src/main/feature/feature.xml index ffed8616ea20a..6b3a8d4d7c71e 100644 --- a/bundles/org.openhab.binding.feican/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.feican/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.feican-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-feican" description="Feican Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Commands.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Commands.java index 9b98ece1cf184..49264e9c46f31 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Commands.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Commands.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Connection.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Connection.java index af37bfae8c917..c792aeea6a5c9 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Connection.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/Connection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanBindingConstants.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanBindingConstants.java index c8f6bd9ea1120..5f76bd99a356b 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanBindingConstants.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanConfiguration.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanConfiguration.java index 201c5711826e3..49c5ea0580d38 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanConfiguration.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanDiscoveryService.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanDiscoveryService.java index c225478b219c5..2c6abb1b2e3ed 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanDiscoveryService.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanHandlerFactory.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanHandlerFactory.java index b11464c86f781..1a2e01cfcf83b 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanHandlerFactory.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/FeicanHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/handler/FeicanHandler.java b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/handler/FeicanHandler.java index 7114182dc61b8..624f2537ad3da 100644 --- a/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/handler/FeicanHandler.java +++ b/bundles/org.openhab.binding.feican/src/main/java/org/openhab/binding/feican/internal/handler/FeicanHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.feican/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.feican/src/main/resources/ESH-INF/thing/channels.xml index 6899415dad8b1..460550821e5d5 100644 --- a/bundles/org.openhab.binding.feican/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.feican/src/main/resources/ESH-INF/thing/channels.xml @@ -63,7 +63,7 @@ <channel-type id="program_speed" advanced="true"> <item-type>Dimmer</item-type> - <label>Program speed</label> + <label>Program Speed</label> <description>Speed of flash and gradient programs from 0 (slow) to 100 (fast).</description> </channel-type> diff --git a/bundles/org.openhab.binding.folding/NOTICE b/bundles/org.openhab.binding.folding/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.folding/NOTICE +++ b/bundles/org.openhab.binding.folding/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.folding/pom.xml b/bundles/org.openhab.binding.folding/pom.xml index a068dd3c6f903..d050c41354637 100644 --- a/bundles/org.openhab.binding.folding/pom.xml +++ b/bundles/org.openhab.binding.folding/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.folding</artifactId> diff --git a/bundles/org.openhab.binding.folding/src/main/feature/feature.xml b/bundles/org.openhab.binding.folding/src/main/feature/feature.xml index 9c5c052d2d4e4..54b659f02ebfb 100644 --- a/bundles/org.openhab.binding.folding/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.folding/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.folding-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-folding" description="Folding Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingBindingConstants.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingBindingConstants.java index 5162b5a94ae54..e68e30d7df871 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingBindingConstants.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingHandlerFactory.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingHandlerFactory.java index fc953bc545e24..d375084fef1fe 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingHandlerFactory.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/FoldingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingDiscoveryProxy.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingDiscoveryProxy.java index 2b905dbc63142..1a8b75469110b 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingDiscoveryProxy.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingDiscoveryProxy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingSlotDiscoveryService.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingSlotDiscoveryService.java index 840db2f5270ce..2e664b6712be5 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingSlotDiscoveryService.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/discovery/FoldingSlotDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/FoldingClientHandler.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/FoldingClientHandler.java index bee90084670d1..e205207895721 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/FoldingClientHandler.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/FoldingClientHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotHandler.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotHandler.java index 9b240b3490f44..1505c3726113c 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotHandler.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotInfo.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotInfo.java index 4a146d76cba83..658545aec2d99 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotInfo.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotUpdateListener.java b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotUpdateListener.java index 20b776879d0ca..4e41b2bf51464 100644 --- a/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotUpdateListener.java +++ b/bundles/org.openhab.binding.folding/src/main/java/org/openhab/binding/folding/internal/handler/SlotUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.folding/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.folding/src/main/resources/ESH-INF/thing/thing-types.xml index fe8156f8deef4..35b2c35406f9e 100644 --- a/bundles/org.openhab.binding.folding/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.folding/src/main/resources/ESH-INF/thing/thing-types.xml @@ -29,8 +29,8 @@ <description>Authentication password (leave empty for no p/w).</description> <context>password</context> </parameter> - <parameter name="polling" type="integer"> - <label>Polling interval (s)</label> + <parameter name="polling" type="integer" unit="s"> + <label>Polling Interval</label> <description>Polling interval in seconds (0=polling disabled).</description> <default>120</default> </parameter> diff --git a/bundles/org.openhab.binding.foobot/.classpath b/bundles/org.openhab.binding.foobot/.classpath new file mode 100644 index 0000000000000..1a0c5608f3440 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/.classpath @@ -0,0 +1,38 @@ +<?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 excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/bundles/org.openhab.binding.toon/.project b/bundles/org.openhab.binding.foobot/.project similarity index 92% rename from bundles/org.openhab.binding.toon/.project rename to bundles/org.openhab.binding.foobot/.project index 873dfb273cc6a..d3cea9741acc9 100644 --- a/bundles/org.openhab.binding.toon/.project +++ b/bundles/org.openhab.binding.foobot/.project @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>org.openhab.binding.toon</name> + <name>org.openhab.binding.foobot</name> <comment></comment> <projects> </projects> diff --git a/bundles/org.openhab.binding.foobot/NOTICE b/bundles/org.openhab.binding.foobot/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.foobot/README.md b/bundles/org.openhab.binding.foobot/README.md new file mode 100644 index 0000000000000..853a981e71ee0 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/README.md @@ -0,0 +1,71 @@ +# Foobot Binding + +This binding fetches the Indoor Air Quality data of each of your Foobot devices from the Foobot cloud service. + +To use this binding, you first need to [register and get your API key](https://api.foobot.io/apidoc/index.html). +The api is rate limited to 200 calls per day. If you need a higher rate limit please contact Foobot. + +## Supported Things + +The binding supports the following things: + +| Thing type | Name +|-------------|------------------------------------------ +| account | The bridge with connection configuration +| device | The sensor thing + +## Discovery + +The binding requires you to have a Foobot account and an API key. +The discovery process is able to automatically discover all devices associated with your Foobot account. + +## Bridge Configuration + +Bridge has the following configuration parameters: + +| Parameter | Description | Required +|------------------|-------------------------------------------------------|---------- +| apikey | API Key from https://api.foobot.io/apidoc/index.html | Mandatory +| username | The e-mail address used to log into the Foobot App | Mandatory +| refreshInterval | Refresh interval in minutes, minimal 5 minutes | Optional, the default value is 8 minutes. + +The minimal refresh rate is 5 minutes because the device only sends data every 5 minutes. +The default is 8 minutes. This will get you through the day with the default rate limit of 200 calls per day. + +## Channels + +The bridge has one channel: + +| Channel ID | Item Type | Description +|----------------------|-----------|----------------------------------------------- +| apiKeyLimitRemaining | Number | The remaining number of API requests for today + + +The AirQuality sensors information that is retrieved is available as these channels: + +| Channel ID | Item Type | Description +|-------------------|----------------------|--------------------------------------------- +| time | DateTime | Last time the sensor data was send to Foobot +| pm | Number:Density | Particulate Matter level (ug/m3) +| temperature | Number:Temperature | Temperature in Celsius or Fahrenheit +| humidity | Number:Dimensionless | Humidity level (%) +| co2 | Number:Dimensionless | Carbon diOxide level (ppm) +| voc | Number:Dimensionless | Volatile Organic Compounds level (ppb) +| gpi | Number:Dimensionless | Global Pollution index (%) + +## Full Example + +demo.things: + +``` +// Bridge configuration: +Bridge foobot:account:myfoobotaccount "Foobot Account" [apiKey="XXXXXX", username="XXXXXX", refreshInterval=8] { + Things: + device myfoobot "Foobot sensor" [uuid="XXXXXXXXXXXXXXXX"] +``` + +demo.items: + +``` +Number:Temperature Temperature "Temperature" <temperature> { channel="foobot:myfoobotaccount:device:myfoobot:temperature" } +``` diff --git a/bundles/org.openhab.binding.foobot/pom.xml b/bundles/org.openhab.binding.foobot/pom.xml new file mode 100644 index 0000000000000..49d2d525a1ea7 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/pom.xml @@ -0,0 +1,15 @@ +<?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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.foobot</artifactId> + + <name>openHAB Add-ons :: Bundles :: Foobot Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.foobot/src/main/feature/feature.xml b/bundles/org.openhab.binding.foobot/src/main/feature/feature.xml new file mode 100644 index 0000000000000..c28c56fe50eef --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.foobot-${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-foobot" description="Foobot Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.foobot/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiConnector.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiConnector.java new file mode 100644 index 0000000000000..4f089fdf4862f --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiConnector.java @@ -0,0 +1,175 @@ +/** + * 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.foobot.internal; + +import static org.openhab.binding.foobot.internal.FoobotBindingConstants.*; + +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.http.HttpField; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpStatus; +import org.openhab.binding.foobot.internal.json.FoobotDevice; +import org.openhab.binding.foobot.internal.json.FoobotJsonData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonParseException; +import com.google.gson.reflect.TypeToken; + +/** + * Connector class communicating with Foobot api and parsing returned json. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class FoobotApiConnector { + + public static final String API_RATE_LIMIT_EXCEEDED_MESSAGE = "Api rate limit exceeded"; + public static final int API_RATE_LIMIT_EXCEEDED = -2; + + private static final int UNKNOWN_REMAINING = -1; + private static final String HEADER_X_API_KEY_TOKEN = "X-API-KEY-TOKEN"; + private static final String HEADER_X_API_KEY_LIMIT_REMAINING = "x-api-key-limit-remaining"; + private static final int REQUEST_TIMEOUT_SECONDS = 3; + private static final Gson GSON = new Gson(); + private static final Type FOOTBOT_DEVICE_LIST_TYPE = new TypeToken<ArrayList<FoobotDevice>>() { + }.getType(); + + private final Logger logger = LoggerFactory.getLogger(FoobotApiConnector.class); + + private @Nullable HttpClient httpClient; + private String apiKey = ""; + private int apiKeyLimitRemaining = UNKNOWN_REMAINING; + + public void setHttpClient(@Nullable HttpClient httpClient) { + this.httpClient = httpClient; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + /** + * @return Returns the last known api remaining limit or -1 if not known. + */ + public int getApiKeyLimitRemaining() { + return apiKeyLimitRemaining; + } + + /** + * Retrieves the list of associated devices with the given username from the foobot api. + * + * @param username to get the associated devices for + * @return List of devices + * @throws FoobotApiException in case there was a problem communicating or parsing the response + */ + public synchronized List<FoobotDevice> getAssociatedDevices(String username) throws FoobotApiException { + try { + final String url = URL_TO_FETCH_DEVICES.replace("%username%", + URLEncoder.encode(username, StandardCharsets.UTF_8.toString())); + logger.debug("URL = {}", url); + + return GSON.fromJson(request(url, apiKey), FOOTBOT_DEVICE_LIST_TYPE); + } catch (JsonParseException | UnsupportedEncodingException e) { + throw new FoobotApiException(0, e.getMessage()); + } + } + + /** + * Retrieves the sensor data for the device with the given uuid from the foobot api. + * + * @param uuid of the device to get the sensor data for + * @return sensor data of the device + * @throws FoobotApiException in case there was a problem communicating or parsing the response + */ + public synchronized @Nullable FoobotJsonData getSensorData(String uuid) throws FoobotApiException { + try { + final String url = URL_TO_FETCH_SENSOR_DATA.replace("%uuid%", + URLEncoder.encode(uuid, StandardCharsets.UTF_8.toString())); + logger.debug("URL = {}", url); + + return GSON.fromJson(request(url, apiKey), FoobotJsonData.class); + } catch (JsonParseException | UnsupportedEncodingException e) { + throw new FoobotApiException(0, e.getMessage()); + } + } + + protected String request(String url, String apiKey) throws FoobotApiException { + apiKeyLimitRemaining = UNKNOWN_REMAINING; + if (httpClient == null) { + logger.debug("No http connection possible: httpClient == null"); + throw new FoobotApiException(0, "No http connection possible"); + } + final Request request = httpClient.newRequest(url).timeout(REQUEST_TIMEOUT_SECONDS, TimeUnit.SECONDS); + + request.header(HttpHeader.ACCEPT, "application/json"); + request.header(HttpHeader.ACCEPT_ENCODING, StandardCharsets.UTF_8.name()); + request.header(HEADER_X_API_KEY_TOKEN, apiKey); + final ContentResponse response; + + try { + response = request.send(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new FoobotApiException(0, e.getMessage()); + } catch (TimeoutException | ExecutionException e) { + throw new FoobotApiException(0, e.getMessage()); + } + final String content = response.getContentAsString(); + + logger.trace("Foobot content = {}", content); + logger.debug("Foobot response = {}", response); + setApiKeyLimitRemaining(response); + switch (response.getStatus()) { + case HttpStatus.FORBIDDEN_403: + throw new FoobotApiException(response.getStatus(), + "Access denied. Did you set the correct api-key and/or username?"); + case HttpStatus.TOO_MANY_REQUESTS_429: + apiKeyLimitRemaining = API_RATE_LIMIT_EXCEEDED; + throw new FoobotApiException(response.getStatus(), API_RATE_LIMIT_EXCEEDED_MESSAGE); + case HttpStatus.OK_200: + if (StringUtils.trimToNull(content) == null) { + throw new FoobotApiException(0, "No data returned"); + } + return content; + default: + logger.trace("Foobot returned status '{}', reason: {}, content = {}", response.getStatus(), + response.getReason(), content); + throw new FoobotApiException(response.getStatus(), response.getReason()); + } + } + + private void setApiKeyLimitRemaining(ContentResponse response) { + final HttpField field = response.getHeaders().getField(HEADER_X_API_KEY_LIMIT_REMAINING); + + if (field != null) { + apiKeyLimitRemaining = field.getIntValue(); + } + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiException.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiException.java new file mode 100644 index 0000000000000..999d669ad04cc --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotApiException.java @@ -0,0 +1,30 @@ +/** + * 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.foobot.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Exception thrown when problems occur with obtaining data for the foobot api. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class FoobotApiException extends Exception { + + private static final long serialVersionUID = 1L; + + public FoobotApiException(final int status, final String message) { + super(String.format("%s (code: %s)", message, status)); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotBindingConstants.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotBindingConstants.java new file mode 100644 index 0000000000000..148d270f39d79 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotBindingConstants.java @@ -0,0 +1,50 @@ +/** + * 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.foobot.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link FoobotBinding} class defines common constants, which are + * used across the whole binding. + * + * @author Divya Chauhan - Initial contribution + */ +@NonNullByDefault +public class FoobotBindingConstants { + + // List Foobot URLs + private static final String URL_FOOBOT_API_V2 = "https://api.foobot.io/v2/"; + public static final String URL_TO_FETCH_DEVICES = URL_FOOBOT_API_V2 + "owner/%username%/device/"; + public static final String URL_TO_FETCH_SENSOR_DATA = URL_FOOBOT_API_V2 + "device/%uuid%/datapoint/0/last/0/"; + + private static final String BINDING_ID = "foobot"; + + // List of all Thing Type UIDs + public static final ThingTypeUID BRIDGE_TYPE_FOOBOTACCOUNT = new ThingTypeUID(BINDING_ID, "account"); + public static final ThingTypeUID THING_TYPE_FOOBOT = new ThingTypeUID(BINDING_ID, "device"); + + // Bridge channel + public static final String CHANNEL_APIKEY_LIMIT_REMAINING = "apiKeyLimitRemaining"; + + // List Foobot configuration attributes + public static final String CONFIG_APIKEY = "apiKey"; + public static final String CONFIG_UUID = "uuid"; + public static final String CONFIG_MAC = "mac"; + + public static final String PROPERTY_NAME = "name"; + + public static final int MINIMUM_REFRESH_PERIOD_MINUTES = 5; + public static final int DEFAULT_REFRESH_PERIOD_MINUTES = 8; +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotHandlerFactory.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotHandlerFactory.java new file mode 100644 index 0000000000000..50ecb760426dc --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/FoobotHandlerFactory.java @@ -0,0 +1,84 @@ +/** + * 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.foobot.internal; + +import static org.openhab.binding.foobot.internal.FoobotBindingConstants.*; + +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.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.openhab.binding.foobot.internal.handler.FoobotAccountHandler; +import org.openhab.binding.foobot.internal.handler.FoobotDeviceHandler; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link FoobotHandlerFactory} is responsible for creating things and thing handlers. + * + * @author Divya Chauhan - Initial contribution + * @author George Katsis - Add Bridge thing type + * @author Hilbrand Bouwkamp - Completed implementation + */ +@Component(service = ThingHandlerFactory.class, configurationPid = "binding.foobot") +@NonNullByDefault +public class FoobotHandlerFactory extends BaseThingHandlerFactory { + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Collections + .unmodifiableSet(Stream.of(BRIDGE_TYPE_FOOBOTACCOUNT, THING_TYPE_FOOBOT).collect(Collectors.toSet())); + + public static final Set<ThingTypeUID> DISCOVERABLE_THING_TYPE_UIDS = Collections.singleton(THING_TYPE_FOOBOT); + + private final FoobotApiConnector connector = new FoobotApiConnector(); + + private @NonNullByDefault({}) HttpClient httpClient; + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPE_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + final ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (thingTypeUID.equals(THING_TYPE_FOOBOT)) { + return new FoobotDeviceHandler(thing, connector); + } else if (thingTypeUID.equals(BRIDGE_TYPE_FOOBOTACCOUNT)) { + return new FoobotAccountHandler((Bridge) thing, connector); + } + return null; + } + + @Reference + protected void setHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + connector.setHttpClient(httpClient); + } + + protected void unsetHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = null; + connector.setHttpClient(null); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/config/FoobotAccountConfiguration.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/config/FoobotAccountConfiguration.java new file mode 100644 index 0000000000000..e06b97f734343 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/config/FoobotAccountConfiguration.java @@ -0,0 +1,28 @@ +/** + * 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.foobot.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link FoobotAccountConfiguration} class contains fields mapping bridge configuration parameters. + * + * @author George Katsis - Initial contribution + */ +@NonNullByDefault +public class FoobotAccountConfiguration { + + public String apiKey = ""; + public String username = ""; + public int refreshInterval; +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/discovery/FoobotAccountDiscoveryService.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/discovery/FoobotAccountDiscoveryService.java new file mode 100644 index 0000000000000..a777363b17ac6 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/discovery/FoobotAccountDiscoveryService.java @@ -0,0 +1,110 @@ +/** + * 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.foobot.internal.discovery; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.openhab.binding.foobot.internal.FoobotApiException; +import org.openhab.binding.foobot.internal.FoobotBindingConstants; +import org.openhab.binding.foobot.internal.FoobotHandlerFactory; +import org.openhab.binding.foobot.internal.handler.FoobotAccountHandler; +import org.openhab.binding.foobot.internal.handler.FoobotDeviceHandler; +import org.openhab.binding.foobot.internal.json.FoobotDevice; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link FoobotAccountDiscoveryService} is responsible for starting the discovery procedure + * that retrieves Foobot account and imports all registered Foobot devices. + * + * @author George Katsis - Initial contribution + * @author Hilbrand Bouwkamp - Completed implementation + */ +@NonNullByDefault +public class FoobotAccountDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, ThingHandlerService { + + private static final int TIMEOUT_SECONDS = 5; + + private final Logger logger = LoggerFactory.getLogger(FoobotAccountDiscoveryService.class); + + private @Nullable FoobotAccountHandler handler; + private @NonNullByDefault({}) ThingUID bridgeUID; + + public FoobotAccountDiscoveryService() { + super(FoobotHandlerFactory.DISCOVERABLE_THING_TYPE_UIDS, TIMEOUT_SECONDS, false); + } + + @Override + protected void startScan() { + scheduler.execute(this::retrieveFoobots); + } + + private void retrieveFoobots() { + if (handler == null) { + return; + } + try { + final List<FoobotDeviceHandler> footbotHandlers = handler.getFootbotHandlers(); + + handler.getDeviceList().stream() + .filter(d -> !footbotHandlers.stream().anyMatch(h -> h.getUuid().equals(d.getUuid()))) + .forEach(this::addThing); + } catch (final FoobotApiException e) { + logger.debug("Footbot Api connection failed: {}", e.getMessage(), e); + logger.warn("Discovering new footbot devices failed: {}", e.getMessage()); + } + } + + @Override + public void deactivate() { + super.deactivate(); + } + + private void addThing(final FoobotDevice foobot) { + logger.debug("Adding new Foobot '{}' with uuid: {}", foobot.getName(), foobot.getUuid()); + + final ThingUID thingUID = new ThingUID(FoobotBindingConstants.THING_TYPE_FOOBOT, foobot.getUuid()); + final Map<String, Object> properties = new HashMap<>(); + properties.put(Thing.PROPERTY_SERIAL_NUMBER, foobot.getUuid()); + properties.put(FoobotBindingConstants.CONFIG_UUID, foobot.getUuid()); + properties.put(Thing.PROPERTY_MAC_ADDRESS, foobot.getMac()); + properties.put(FoobotBindingConstants.PROPERTY_NAME, foobot.getName()); + + thingDiscovered(DiscoveryResultBuilder.create(thingUID).withBridge(bridgeUID).withProperties(properties) + .withLabel(foobot.getName()).withRepresentationProperty(foobot.getUuid()).build()); + } + + @Override + public void setThingHandler(@Nullable final ThingHandler handler) { + if (handler instanceof FoobotAccountHandler) { + this.handler = (FoobotAccountHandler) handler; + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return handler; + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandler.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandler.java new file mode 100644 index 0000000000000..283469a195b90 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandler.java @@ -0,0 +1,241 @@ +/** + * 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.foobot.internal.handler; + +import static org.openhab.binding.foobot.internal.FoobotBindingConstants.*; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.cache.ExpiringCache; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.foobot.internal.FoobotApiConnector; +import org.openhab.binding.foobot.internal.FoobotApiException; +import org.openhab.binding.foobot.internal.FoobotBindingConstants; +import org.openhab.binding.foobot.internal.config.FoobotAccountConfiguration; +import org.openhab.binding.foobot.internal.discovery.FoobotAccountDiscoveryService; +import org.openhab.binding.foobot.internal.json.FoobotDevice; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Bridge handler to manage Foobot Account + * + * @author George Katsis - Initial contribution + * @author Hilbrand Bouwkamp - Completed implementation + */ +@NonNullByDefault +public class FoobotAccountHandler extends BaseBridgeHandler { + + /* + * Set the exact interval a little lower to compensate for the time it takes to get the new data. + */ + private static final long DEVICES_INTERVAL_MINUTES = Duration.ofDays(1).minus(Duration.ofMinutes(1)).toMinutes(); + private static final Duration SENSOR_INTERVAL_OFFSET_SECONDS = Duration.ofSeconds(15); + + private final Logger logger = LoggerFactory.getLogger(FoobotAccountHandler.class); + + private final FoobotApiConnector connector; + + private String username = ""; + private int refreshInterval; + private @Nullable ScheduledFuture<?> refreshDeviceListJob; + private @Nullable ScheduledFuture<?> refreshSensorsJob; + private @NonNullByDefault({}) ExpiringCache<List<FoobotDeviceHandler>> dataCache; + + public FoobotAccountHandler(Bridge bridge, FoobotApiConnector connector) { + super(bridge); + this.connector = connector; + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(FoobotAccountDiscoveryService.class); + } + + public List<FoobotDevice> getDeviceList() throws FoobotApiException { + return connector.getAssociatedDevices(username); + } + + public int getRefreshInterval() { + return refreshInterval; + } + + @Override + public void initialize() { + final FoobotAccountConfiguration accountConfig = getConfigAs(FoobotAccountConfiguration.class); + final List<String> missingParams = new ArrayList<>(); + + if (StringUtils.trimToNull(accountConfig.apiKey) == null) { + missingParams.add("'apikey'"); + } + if (StringUtils.trimToNull(accountConfig.username) == null) { + missingParams.add("'username'"); + } + + if (!missingParams.isEmpty()) { + final boolean oneParam = missingParams.size() == 1; + final String errorMsg = String.format( + "Parameter%s [%s] %s mandatory and must be configured and not be empty", oneParam ? "" : "s", + StringUtils.join(missingParams, ", "), oneParam ? "is" : "are"); + + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, errorMsg); + return; + } + username = accountConfig.username; + connector.setApiKey(accountConfig.apiKey); + refreshInterval = accountConfig.refreshInterval; + if (this.refreshInterval < MINIMUM_REFRESH_PERIOD_MINUTES) { + logger.warn( + "Refresh interval time [{}] is not valid. Refresh interval time must be at least {} minutes. Setting to {} minutes", + accountConfig.refreshInterval, MINIMUM_REFRESH_PERIOD_MINUTES, DEFAULT_REFRESH_PERIOD_MINUTES); + refreshInterval = DEFAULT_REFRESH_PERIOD_MINUTES; + } + logger.debug("Foobot Account bridge starting... user: {}, refreshInterval: {}", accountConfig.username, + refreshInterval); + + updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE, "Wait to get associated devices"); + + dataCache = new ExpiringCache<>(Duration.ofMinutes(refreshInterval), this::retrieveDeviceList); + this.refreshDeviceListJob = scheduler.scheduleWithFixedDelay(this::refreshDeviceList, 0, + DEVICES_INTERVAL_MINUTES, TimeUnit.MINUTES); + this.refreshSensorsJob = scheduler.scheduleWithFixedDelay(this::refreshSensors, 0, + Duration.ofMinutes(refreshInterval).minus(SENSOR_INTERVAL_OFFSET_SECONDS).getSeconds(), + TimeUnit.SECONDS); + + logger.debug("Foobot account bridge handler started."); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.trace("Command '{}' received for channel '{}'", command, channelUID); + if (command instanceof RefreshType) { + refreshDeviceList(); + } + } + + @Override + public void dispose() { + logger.debug("Dispose {}", getThing().getUID()); + + final ScheduledFuture<?> refreshDeviceListJob = this.refreshDeviceListJob; + if (refreshDeviceListJob != null) { + refreshDeviceListJob.cancel(true); + this.refreshDeviceListJob = null; + } + final ScheduledFuture<?> refreshSensorsJob = this.refreshSensorsJob; + if (refreshSensorsJob != null) { + refreshSensorsJob.cancel(true); + this.refreshSensorsJob = null; + } + } + + /** + * Retrieves the list of devices and updates the properties of the devices. This method is called by the cache to + * update the cache data. + * + * @return List of retrieved devices + */ + private List<FoobotDeviceHandler> retrieveDeviceList() { + logger.debug("Refreshing sensors for {}", getThing().getUID()); + final List<FoobotDeviceHandler> footbotHandlers = getFootbotHandlers(); + + try { + getDeviceList().stream().forEach(d -> { + footbotHandlers.stream().filter(h -> h.getUuid().equals(d.getUuid())).findAny() + .ifPresent(fh -> fh.handleUpdateProperties(d)); + }); + } catch (FoobotApiException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + return footbotHandlers; + } + + /** + * Refreshes the devices list + */ + private void refreshDeviceList() { + // This getValue() return value not used here. But if the cache is expired it refreshes the cache. + dataCache.getValue(); + updateRemainingLimitStatus(); + } + + @Override + public void childHandlerInitialized(ThingHandler childHandler, Thing childThing) { + if (childHandler instanceof FoobotDeviceHandler) { + final String uuid = ((FoobotDeviceHandler) childHandler).getUuid(); + + try { + getDeviceList().stream().filter(d -> d.getUuid().equals(uuid)).findAny() + .ifPresent(fd -> ((FoobotDeviceHandler) childHandler).handleUpdateProperties(fd)); + } catch (FoobotApiException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + } + + /** + * @return Returns the list of associated footbot devices with this bridge. + */ + public List<FoobotDeviceHandler> getFootbotHandlers() { + return getThing().getThings().stream().map(Thing::getHandler).filter(FoobotDeviceHandler.class::isInstance) + .map(FoobotDeviceHandler.class::cast).collect(Collectors.toList()); + } + + private void refreshSensors() { + logger.debug("Refreshing sensors for {}", getThing().getUID()); + logger.debug("handlers: {}", getFootbotHandlers().size()); + try { + for (FoobotDeviceHandler handler : getFootbotHandlers()) { + logger.debug("handler: {}", handler.getUuid()); + handler.refreshSensors(); + } + if (connector.getApiKeyLimitRemaining() == FoobotApiConnector.API_RATE_LIMIT_EXCEEDED) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, + FoobotApiConnector.API_RATE_LIMIT_EXCEEDED_MESSAGE); + } else if (getThing().getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + } catch (RuntimeException e) { + logger.debug("Error updating sensor data ", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, e.getMessage()); + } + } + + public void updateRemainingLimitStatus() { + final int remaining = connector.getApiKeyLimitRemaining(); + + updateState(FoobotBindingConstants.CHANNEL_APIKEY_LIMIT_REMAINING, + remaining < 0 ? UnDefType.UNDEF : new DecimalType(remaining)); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java new file mode 100644 index 0000000000000..a5966ed563f6c --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java @@ -0,0 +1,222 @@ +/** + * 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.foobot.internal.handler; + +import java.math.BigDecimal; +import java.time.Duration; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Map; + +import javax.measure.Unit; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.cache.ExpiringCache; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.foobot.internal.FoobotApiConnector; +import org.openhab.binding.foobot.internal.FoobotApiException; +import org.openhab.binding.foobot.internal.FoobotBindingConstants; +import org.openhab.binding.foobot.internal.json.FoobotDevice; +import org.openhab.binding.foobot.internal.json.FoobotJsonData; +import org.openhab.binding.foobot.internal.json.FoobotSensor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link FoobotDeviceHandler} is responsible for handling commands, which are sent to one of the channels. + * + * @author Divya Chauhan - Initial contribution + * @author George Katsis - Add Bridge thing type + * + */ +@NonNullByDefault +public class FoobotDeviceHandler extends BaseThingHandler { + + private final Logger logger = LoggerFactory.getLogger(FoobotDeviceHandler.class); + private final FoobotApiConnector connector; + + private @NonNullByDefault({}) ExpiringCache<FoobotJsonData> dataCache; + private String uuid = ""; + + public FoobotDeviceHandler(final Thing thing, final FoobotApiConnector connector) { + super(thing); + this.connector = connector; + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + if (command instanceof RefreshType) { + final FoobotJsonData sensorData = dataCache.getValue(); + + if (sensorData != null) { + updateState(channelUID, sensorDataToState(channelUID.getId(), sensorData)); + } + } else { + logger.debug("The Foobot binding is read-only and can not handle command {}", command); + } + } + + /** + * @return Returns the uuid associated with this device. + */ + public String getUuid() { + return uuid; + } + + @Override + public void initialize() { + logger.debug("Initializing Foobot handler."); + uuid = (String) getConfig().get(FoobotBindingConstants.CONFIG_UUID); + + if (StringUtils.trimToNull(uuid) == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Parameter 'uuid' is mandatory and must be configured"); + return; + } + final FoobotAccountHandler bridgeHandler = getBridgeHandler(); + final int refreshInterval = bridgeHandler == null ? FoobotBindingConstants.DEFAULT_REFRESH_PERIOD_MINUTES + : bridgeHandler.getRefreshInterval(); + + dataCache = new ExpiringCache<FoobotJsonData>(Duration.ofMinutes(refreshInterval), this::retrieveSensorData); + scheduler.execute(this::refreshSensors); + } + + /** + * Updates the thing properties as retrieved by the bridge. + * + * @param foobot device parameters. + */ + public void handleUpdateProperties(final FoobotDevice foobot) { + final Map<String, String> properties = editProperties(); + + properties.put(Thing.PROPERTY_MAC_ADDRESS, foobot.getMac()); + properties.put(FoobotBindingConstants.PROPERTY_NAME, foobot.getName()); + updateProperties(properties); + } + + /** + * Calls the footbot api to retrieve the sensor data. Sets thing offline in case of errors. + * + * @return returns the retrieved sensor data or null if no data or an error occurred. + */ + private @Nullable FoobotJsonData retrieveSensorData() { + logger.debug("Refresh sensor data for: {}", uuid); + FoobotJsonData sensorData = null; + + try { + sensorData = connector.getSensorData(uuid); + if (sensorData == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "No sensor data received"); + return sensorData; + } + } catch (FoobotApiException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + return null; + } catch (RuntimeException e) { + logger.debug("Error requesting sensor data: ", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, e.getMessage()); + return null; + } + if (getThing().getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + final FoobotAccountHandler bridgeHandler = getBridgeHandler(); + + if (bridgeHandler != null) { + bridgeHandler.updateRemainingLimitStatus(); + } + return sensorData; + } + + /** + * Refreshes the device channels. + */ + public void refreshSensors() { + final FoobotJsonData sensorData = dataCache.getValue(); + + if (sensorData != null) { + for (final Channel channel : getThing().getChannels()) { + final ChannelUID channelUid = channel.getUID(); + + updateState(channelUid, sensorDataToState(channelUid.getId(), sensorData)); + } + updateTime(sensorData); + } + } + + private void updateTime(final FoobotJsonData sensorData) { + final State lastTime = sensorDataToState(FoobotSensor.TIME.getChannelId(), sensorData); + + if (lastTime instanceof DecimalType) { + ((DecimalType) lastTime).intValue(); + } + + } + + @Override + public void dispose() { + logger.debug("Disposing the Foobot handler."); + } + + protected State sensorDataToState(final String channelId, final FoobotJsonData data) { + final FoobotSensor sensor = FoobotSensor.findSensorByChannelId(channelId); + + if (sensor == null || data.getSensors() == null || data.getDatapoints() == null + || data.getDatapoints().isEmpty()) { + return UnDefType.UNDEF; + } + final int sensorIndex = data.getSensors().indexOf(sensor.getDataKey()); + + if (sensorIndex == -1) { + return UnDefType.UNDEF; + } + final String value = data.getDatapoints().get(0).get(sensorIndex); + final String unit = data.getUnits().get(sensorIndex); + + if (value == null) { + return UnDefType.UNDEF; + } else { + final Unit<?> stateUnit = sensor.getUnit(unit); + if (sensor == FoobotSensor.TIME) { + return new DateTimeType( + ZonedDateTime.ofInstant(Instant.ofEpochSecond(Long.parseLong(value)), ZoneId.systemDefault())); + } else if (stateUnit == null) { + return new DecimalType(value); + } else { + return new QuantityType(new BigDecimal(value), stateUnit); + } + } + } + + private @Nullable FoobotAccountHandler getBridgeHandler() { + return getBridge() != null && getBridge().getHandler() instanceof FoobotAccountHandler + ? (FoobotAccountHandler) getBridge().getHandler() + : null; + } + +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotDevice.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotDevice.java new file mode 100644 index 0000000000000..96187a8990093 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotDevice.java @@ -0,0 +1,38 @@ +/** + * 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.foobot.internal.json; + +/** + * The {@link FoobotDevice} is the Java class used to map the JSON response to the foobot.io request. + * + * @author Divya Chauhan - Initial contribution + * @author George Katsis - Code refactor + */ +public class FoobotDevice { + + private String uuid; + private String mac; + private String name; + + public String getUuid() { + return uuid; + } + + public String getMac() { + return mac; + } + + public String getName() { + return name; + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotJsonData.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotJsonData.java new file mode 100644 index 0000000000000..4ce17404c1e7b --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotJsonData.java @@ -0,0 +1,58 @@ +/** + * 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.foobot.internal.json; + +import java.util.List; + +/** + * The {@link FoobotJsonData} is responsible for storing the "datapoints" from the foobot.io JSON response + * + * @author Divya Chauhan - Initial contribution + */ +public class FoobotJsonData { + + private String uuid; + private long start; + private long end; + private List<String> sensors; + private List<String> units; + private List<List<String>> datapoints; + + public String getUuid() { + return uuid; + } + + public long getStart() { + return start; + } + + public long getEnd() { + return end; + } + + public List<String> getSensors() { + return sensors; + } + + public List<String> getUnits() { + return units; + } + + public List<List<String>> getDatapoints() { + return datapoints; + } + + public void setDatapoints(List<List<String>> datapoints) { + this.datapoints = datapoints; + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotSensor.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotSensor.java new file mode 100644 index 0000000000000..e659c75fae82d --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/json/FoobotSensor.java @@ -0,0 +1,105 @@ +/** + * 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.foobot.internal.json; + +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.measure.Unit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; + +/** + * Enum for all specific sensor data returned by the Foobot device. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public enum FoobotSensor { + TIME("time", "time", null), + PM("pm", "pm", SmartHomeUnits.MICROGRAM_PER_CUBICMETRE), + TEMPERATURE("temperature", "tmp", "C", SIUnits.CELSIUS, ImperialUnits.FAHRENHEIT), + HUMIDITY("humidity", "hum", null), + CO2("co2", "co2", SmartHomeUnits.PARTS_PER_MILLION), + VOC("voc", "voc", null), + GPI("gpi", "allpollu", null); + + private final String channelId; + private final String dataKey; + private final @Nullable String matchUnit; + private final @Nullable Unit<?> unit; + private final @Nullable Unit<?> alternativeUnit; + + private static final Map<String, FoobotSensor> CHANNEL_ID_MAP = Stream.of(values()) + .collect(Collectors.toMap(FoobotSensor::getChannelId, Function.identity())); + + /** + * Constructor. + * + * @param channelId Id of the thing channel + * @param dataKey key of the sensor data in the foobot sensor json data + * @param unit Unit of the sensor data or null if no unit specified + */ + private FoobotSensor(String channelId, String dataKey, @Nullable Unit<?> unit) { + this(channelId, dataKey, null, unit, null); + } + + /** + * Constructor. + * + * @param channelId Id of the thing channel + * @param dataKey key of the sensor data in the foobot sensor json data + * @param matchUnit unit string to be matched with the foobot returned unit + * @param unit Unit of the sensor data or null if no unit specified + * @param alternativeUnit if foobot api unit doesn't match this unit is returned + */ + private FoobotSensor(String channelId, String dataKey, @Nullable String matchUnit, @Nullable Unit<?> unit, + @Nullable Unit<?> alternativeUnit) { + this.channelId = channelId; + this.dataKey = dataKey; + this.matchUnit = matchUnit; + this.unit = unit; + this.alternativeUnit = alternativeUnit; + } + + public static @Nullable FoobotSensor findSensorByChannelId(String channelId) { + return CHANNEL_ID_MAP.get(channelId); + } + + public String getChannelId() { + return channelId; + } + + /** + * @return Returns the key of the sensor type as returned by the foobot api + */ + public String getDataKey() { + return dataKey; + } + + /** + * Returns the Unit of this sensor data type or null if no unit specified. + * + * @param unitToMath match the returned unit by the foobot api with the Unit to be returned + * @return Unit or null if no unit available for the sensor + */ + public @Nullable Unit<?> getUnit(String unitToMath) { + return matchUnit == null ? unit : (matchUnit.equals(unitToMath) ? unit : alternativeUnit); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..6e75bf30e17fa --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="foobot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Foobot</name> + <description>Foobot binding allow users to connect to their foobots in home or office and get real-time updates on the Air Quality.</description> + <author>Divya Chauhan and George Katsis</author> +</binding:binding> diff --git a/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..052aa4e76714b --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="foobot" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- Foobot Account --> + <bridge-type id="account"> + <label>Foobot Account</label> + <description>Your Foobot account.</description> + + <channels> + <channel id="apiKeyLimitRemaining" typeId="api-key-limit-remaining" /> + </channels> + + <config-description> + <parameter name="apiKey" type="text" required="true"> + <context>password</context> + <label>API Key</label> + <description>You can request your API Key from https://api.foobot.io/apidoc/index.html</description> + </parameter> + + <parameter name="username" type="text" required="true"> + <label>Username</label> + <description>The e-mail address you use to login to your Foobot account</description> + </parameter> + + <parameter name="refreshInterval" type="integer" min="5" unit="m"> + <label>Refresh Interval</label> + <description>Specifies the refresh interval in minutes.</description> + <default>8</default> + </parameter> + </config-description> + </bridge-type> + + <!-- Foobot Device --> + <thing-type id="device"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Foobot</label> + <description>A Foobot device.</description> + + <channels> + <channel id="time" typeId="time" /> + <channel id="pm" typeId="pm" /> + <channel id="temperature" typeId="temperature" /> + <channel id="humidity" typeId="humidity" /> + <channel id="co2" typeId="co2" /> + <channel id="voc" typeId="voc" /> + <channel id="gpi" typeId="gpi" /> + </channels> + + <representation-property>uuid</representation-property> + + <config-description> + <parameter name="uuid" type="text" required="true"> + <label>UUID</label> + <description>The device UUID</description> + </parameter> + </config-description> + </thing-type> + + <channel-type id="time"> + <item-type>DateTime</item-type> + <label>Last Readout</label> + <description>The last time the sensor data was uploaded to Foobot</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="pm"> + <item-type>Number:Density</item-type> + <label>Particulate Matter</label> + <description>Particulate Matter Level</description> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + <channel-type id="temperature"> + <item-type>Number:Temperature</item-type> + <label>Temperature</label> + <description>Temperature</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + <channel-type id="humidity"> + <item-type>Number:Dimensionless</item-type> + <label>Humidity</label> + <description>Humidity Level</description> + <category>Humidity</category> + <state readOnly="true" pattern="%d %%" /> + </channel-type> + <channel-type id="co2"> + <item-type>Number:Dimensionless</item-type> + <label>Carbon Dioxide</label> + <description>Carbon dioxide Level</description> + <category>CarbonDioxide</category> + <state readOnly="true" pattern="%d ppm" /> + </channel-type> + <channel-type id="voc"> + <item-type>Number:Dimensionless</item-type> + <label>Volatile Compounds</label> + <description>Volatile Organic Compounds Level</description> + <state readOnly="true" pattern="%d ppb" /> + </channel-type> + <channel-type id="gpi"> + <item-type>Number:Dimensionless</item-type> + <label>Pollution Index</label> + <description>Global Pollution Index Level</description> + <state readOnly="true" pattern="%.0f %%" /> + </channel-type> + <channel-type id="api-key-limit-remaining" advanced="true"> + <item-type>Number</item-type> + <label>Remaining Api Limit</label> + <description>The remaining number of calls that can be made to the api today</description> + <state readOnly="true" pattern="%d" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandlerTest.java b/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandlerTest.java new file mode 100644 index 0000000000000..e6d8545894b7d --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotAccountHandlerTest.java @@ -0,0 +1,56 @@ +/** + * 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.foobot.internal.handler; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.eclipse.smarthome.core.thing.Bridge; +import org.junit.Test; +import org.mockito.Mock; +import org.openhab.binding.foobot.internal.FoobotApiConnector; +import org.openhab.binding.foobot.internal.FoobotApiException; +import org.openhab.binding.foobot.internal.json.FoobotDevice; + +/** + * Unit test for {@link FoobotAccountHandler}. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +public class FoobotAccountHandlerTest { + + private @Mock Bridge bridge; + private final FoobotApiConnector connector = new FoobotApiConnector() { + @Override + protected String request(String url, String apiKey) throws FoobotApiException { + try (InputStream stream = getClass().getResourceAsStream("../devices.json")) { + return IOUtils.toString(stream); + } catch (IOException e) { + throw new AssertionError(e.getMessage()); + } + }; + }; + private final FoobotAccountHandler handler = new FoobotAccountHandler(bridge, connector); + + @Test + public void testSensorDataToState() throws IOException, FoobotApiException { + final List<FoobotDevice> deviceList = handler.getDeviceList(); + + assertFalse("Device list should not return empty", deviceList.isEmpty()); + assertEquals("1234567890ABCDEF", deviceList.get(0).getUuid()); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandlerTest.java b/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandlerTest.java new file mode 100644 index 0000000000000..2cd1a72027bf2 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/test/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandlerTest.java @@ -0,0 +1,59 @@ +/** + * 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.foobot.internal.handler; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.io.InputStream; + +import org.apache.commons.io.IOUtils; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.Thing; +import org.junit.Test; +import org.mockito.Mock; +import org.openhab.binding.foobot.internal.FoobotApiConnector; +import org.openhab.binding.foobot.internal.FoobotApiException; +import org.openhab.binding.foobot.internal.json.FoobotJsonData; + +/** + * Unit test for {@link FoobotDeviceHandler}. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +public class FoobotDeviceHandlerTest { + + private @Mock Thing thing; + private final FoobotApiConnector connector = new FoobotApiConnector() { + @Override + protected String request(String url, String apiKey) throws FoobotApiException { + try (InputStream stream = getClass().getResourceAsStream("../sensors.json")) { + return IOUtils.toString(stream); + } catch (IOException e) { + throw new AssertionError(e.getMessage()); + } + }; + }; + private final FoobotDeviceHandler handler = new FoobotDeviceHandler(thing, connector); + + @Test + public void testSensorDataToState() throws IOException, FoobotApiException { + final FoobotJsonData sensorData = connector.getSensorData("1234"); + + assertNotNull("No sensor data read", sensorData); + assertEquals(handler.sensorDataToState("temperature", sensorData), new QuantityType(12.345, SIUnits.CELSIUS)); + assertEquals(handler.sensorDataToState("gpi", sensorData), new DecimalType(5.6789012)); + } +} diff --git a/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/devices.json b/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/devices.json new file mode 100644 index 0000000000000..4095ae5dfb785 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/devices.json @@ -0,0 +1,8 @@ +[ + { + "uuid": "1234567890ABCDEF", + "userId": 12345, + "mac": "AABBCCDDEEFF", + "name": "Foobot 1" + } +] diff --git a/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/sensors.json b/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/sensors.json new file mode 100644 index 0000000000000..8650b9fce9d92 --- /dev/null +++ b/bundles/org.openhab.binding.foobot/src/test/resources/org/openhab/binding/foobot/internal/sensors.json @@ -0,0 +1,34 @@ +{ + "uuid": "0123456789ABCDEF", + "start": 1234567890, + "end": 1234567890, + "sensors": [ + "time", + "pm", + "tmp", + "hum", + "co2", + "voc", + "allpollu" + ], + "units": [ + "s", + "ugm3", + "C", + "pc", + "ppm", + "ppb", + "%" + ], + "datapoints": [ + [ + 1234567890, + 1.2345678, + 12.345, + 23.456, + 345, + 456, + 5.6789012 + ] + ] +} diff --git a/bundles/org.openhab.binding.freebox/NOTICE b/bundles/org.openhab.binding.freebox/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.freebox/NOTICE +++ b/bundles/org.openhab.binding.freebox/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.freebox/README.md b/bundles/org.openhab.binding.freebox/README.md index e1f6242420c51..fb15667908ad4 100644 --- a/bundles/org.openhab.binding.freebox/README.md +++ b/bundles/org.openhab.binding.freebox/README.md @@ -1,6 +1,6 @@ # Freebox Binding -This binding integrates the [Freebox Revolution](http://www.free.fr/adsl/freebox-revolution.html) to your openHab installation. +This binding integrates the [Freebox Revolution](https://www.free.fr/freebox/freebox-revolution/) to your openHAB installation. ## Supported Things @@ -85,7 +85,7 @@ The *airplay* thing requires the following configuration parameters: ## Authentication -You'll have to authorize openHAB to connect to your Freebox. Here is the process described : +You will have to authorize openHAB to connect to your Freebox. Here is the process described : **Step 1** At binding startup, if no token is recorded in the Freebox Server (bridge) configuration, the following message will be displayed in the OSGi console : @@ -101,7 +101,7 @@ You'll have to authorize openHAB to connect to your Freebox. Here is the process **Step 3** Record the apptoken in the Freebox Server (bridge) configuration -**Optionally** you can log in your Freebox admin console to allocate needed rights to openhab +**Optionally** you can log in your Freebox admin console to allocate needed rights to openHAB Once initialized, the thing will generate all available channels. diff --git a/bundles/org.openhab.binding.freebox/pom.xml b/bundles/org.openhab.binding.freebox/pom.xml index dcb1148af0e28..181fc16f84bef 100644 --- a/bundles/org.openhab.binding.freebox/pom.xml +++ b/bundles/org.openhab.binding.freebox/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.freebox</artifactId> diff --git a/bundles/org.openhab.binding.freebox/src/main/feature/feature.xml b/bundles/org.openhab.binding.freebox/src/main/feature/feature.xml index 6201fb6b88110..7e6834d806c5c 100644 --- a/bundles/org.openhab.binding.freebox/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.freebox/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.freebox-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-freebox" description="Freebox Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxAirPlayAudioSink.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxAirPlayAudioSink.java index 747eb7050c7ee..d3398a6391f89 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxAirPlayAudioSink.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxAirPlayAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,6 +19,8 @@ import java.util.Locale; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.audio.AudioFormat; import org.eclipse.smarthome.core.audio.AudioHTTPServer; import org.eclipse.smarthome.core.audio.AudioSink; @@ -42,6 +44,7 @@ * * @author Laurent Garnier - Initial contribution for AudioSink and notifications */ +@NonNullByDefault public class FreeboxAirPlayAudioSink implements AudioSink { private final Logger logger = LoggerFactory.getLogger(FreeboxAirPlayAudioSink.class); @@ -59,13 +62,14 @@ public class FreeboxAirPlayAudioSink implements AudioSink { private static final HashSet<Class<? extends AudioStream>> SUPPORTED_STREAMS = new HashSet<>(); private AudioHTTPServer audioHTTPServer; private FreeboxThingHandler handler; - private String callbackUrl; + private @Nullable String callbackUrl; static { SUPPORTED_STREAMS.add(AudioStream.class); } - public FreeboxAirPlayAudioSink(FreeboxThingHandler handler, AudioHTTPServer audioHTTPServer, String callbackUrl) { + public FreeboxAirPlayAudioSink(FreeboxThingHandler handler, AudioHTTPServer audioHTTPServer, + @Nullable String callbackUrl) { this.handler = handler; this.audioHTTPServer = audioHTTPServer; this.callbackUrl = callbackUrl; @@ -94,12 +98,12 @@ public String getId() { } @Override - public String getLabel(Locale locale) { + public @Nullable String getLabel(@Nullable Locale locale) { return handler.getThing().getLabel(); } @Override - public void process(AudioStream audioStream) + public void process(@Nullable AudioStream audioStream) throws UnsupportedAudioFormatException, UnsupportedAudioStreamException { if (!ThingHandlerHelper.isHandlerInitialized(handler) || ((handler.getThing().getStatus() == ThingStatus.OFFLINE) @@ -109,6 +113,15 @@ public void process(AudioStream audioStream) return; } + if (audioStream == null) { + try { + handler.stopMedia(); + } catch (FreeboxException e) { + logger.warn("Exception while stopping audio stream playback: {}", e.getMessage()); + } + return; + } + String url = null; if (audioStream instanceof URLAudioStream) { // it is an external URL, we can access it directly @@ -128,11 +141,10 @@ public void process(AudioStream audioStream) logger.warn("We do not have any callback url, so AirPlay device cannot play the audio stream!"); } } - if (audioStream != null) { - try { - audioStream.close(); - } catch (IOException e) { - } + try { + audioStream.close(); + } catch (IOException e) { + logger.debug("Exception while closing audioStream", e); } try { logger.debug("AirPlay audio sink: process url {}", url); diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxBindingConstants.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxBindingConstants.java index dc33fc5cd135c..9cc6ed4593b8b 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxBindingConstants.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxDataListener.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxDataListener.java index b336acd8f28e8..41831bd4d8be9 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxDataListener.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxHandlerFactory.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxHandlerFactory.java index c5cb08466c8ba..f8b12a5919aad 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxHandlerFactory.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/FreeboxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.audio.AudioHTTPServer; @@ -64,7 +65,7 @@ public class FreeboxHandlerFactory extends BaseThingHandlerFactory { private Map<ThingUID, ServiceRegistration<AudioSink>> audioSinkRegistrations = new ConcurrentHashMap<>(); // url (scheme+server+port) to use for playing notification sounds - private String callbackUrl; + private @Nullable String callbackUrl; private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream .concat(FreeboxBindingConstants.SUPPORTED_BRIDGE_TYPES_UIDS.stream(), diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxApiManager.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxApiManager.java index 727d1e773871d..71d8bc40ce0db 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxApiManager.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxApiManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxException.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxException.java index a715af49e3d98..8d1e997f64026 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxException.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxTlsCertificateProvider.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxTlsCertificateProvider.java index 389334ed30382..1cc6661505b8b 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxTlsCertificateProvider.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/FreeboxTlsCertificateProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfig.java index 16d1fbf0b316c..81b4b68330084 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfigResponse.java index 03c194de8af76..f47e19cab0c5e 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiver.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiver.java index 9c371bed1846a..cd40f0241e941 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiver.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverCapabilities.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverCapabilities.java index 46215e381de4f..ac9809a0f6d82 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverCapabilities.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverCapabilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverRequest.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverRequest.java index 14404cb421165..2b054a8561eaa 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverRequest.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiverRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiversResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiversResponse.java index df724cc167724..e614b9f53af53 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiversResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAirMediaReceiversResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatus.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatus.java index 5b8288d8fe8a9..9c0514d752be8 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatus.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatusResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatusResponse.java index 1924e7c1841d7..3384f56f7f4ca 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatusResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizationStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeRequest.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeRequest.java index 548520c1be422..baa7acce9e3c2 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeRequest.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResponse.java index d31f840d2f6a2..5faaf49a85d88 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResult.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResult.java index e3b765a1e59ce..892999527827e 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResult.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxAuthorizeResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntry.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntry.java index 1494a5858d952..1585add4dc8a9 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntry.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntryResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntryResponse.java index a3095fad5992a..830cb9bf855ee 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntryResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxCallEntryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatus.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatus.java index bb5b848943033..50a578982267d 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatus.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatusResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatusResponse.java index 50a06dab7c41d..ae1c0db0c7690 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatusResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxConnectionStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxDiscoveryResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxDiscoveryResponse.java index 3031984defb86..0999e67f6884b 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxDiscoveryResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxDiscoveryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxEmptyResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxEmptyResponse.java index 98248991c9845..c6502c40a70f0 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxEmptyResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxEmptyResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfig.java index 8bee42390b0d3..60f475a66e8c3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfigResponse.java index b5eb939dbd290..d439b5290ddf4 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxFtpConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfig.java index 16ee894b0a265..d13a13b25b148 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfigResponse.java index 54fe71e5c87a5..bb21e1d10f5d8 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHost.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHost.java index 798b3aa158220..3951414b8f0d7 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHost.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHost.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL2Ident.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL2Ident.java index f5a8523a9643a..331a3bd56edd3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL2Ident.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL2Ident.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL3Connectivity.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL3Connectivity.java index 726da325fbe62..7c935f7141075 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL3Connectivity.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostL3Connectivity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostName.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostName.java index 27f85a530fe49..fbf508843ff39 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostName.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostsResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostsResponse.java index 73419adad2735..c726600811820 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostsResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanHostsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterface.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterface.java index c1c7750c65eef..249f2bd15875c 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterface.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterfacesResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterfacesResponse.java index b6b65b8df6c8b..2b9464711cbb3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterfacesResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLanInterfacesResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfig.java index ed4d3d0a58315..2c0a32c5959d3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfigResponse.java index 343da0b886ae9..e683fe7728826 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLcdConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResponse.java index abdaed23ffcf9..1c34cf8a040bf 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResult.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResult.java index fbb48d9f0df53..5f2f4549f5395 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResult.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxLoginResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionRequest.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionRequest.java index f6c59f4e76281..e2668510e7436 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionRequest.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResponse.java index e437f7446c5fa..ed31cf640af58 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResult.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResult.java index 69addbb3ee9e6..ec62f3cf2630b 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResult.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxOpenSessionResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPermissions.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPermissions.java index f6f88e6ec5e91..a1f58f1730baf 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPermissions.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPermissions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatus.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatus.java index a052cd29ad951..096595e03ba4e 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatus.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatusResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatusResponse.java index 860f6019784a3..74d7345e9d6a0 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatusResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxPhoneStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxResponse.java index f2ebb9d4043c3..bb3521bc9274c 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfig.java index 0a95c0bf16c4d..6481e730bba64 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfigResponse.java index d3eb039ae1433..be2689c4bb7a6 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSambaConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSensor.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSensor.java new file mode 100644 index 0000000000000..994a13a4b4408 --- /dev/null +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSensor.java @@ -0,0 +1,37 @@ +/** + * 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.freebox.internal.api.model; + +/** + * The {@link FreeboxSensor} is the Java class used to map the fans and sensors part of the "SystemConfig" + * structure used by the system API + * + * @author Laurent Garnier - Initial contribution + */ +public class FreeboxSensor { + private String id; + private String name; + private int value; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public int getValue() { + return value; + } +} diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfig.java index 391bf55425e8a..0603768b631a3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,8 @@ */ package org.openhab.binding.freebox.internal.api.model; +import java.util.List; + /** * The {@link FreeboxSystemConfig} is the Java class used to map the "SystemConfig" * structure used by the system API @@ -34,6 +36,8 @@ public class FreeboxSystemConfig { private String diskStatus; private String boxFlavor; private String userMainStorage; + private List<FreeboxSensor> fans; + private List<FreeboxSensor> sensors; public String getFirmwareVersion() { return firmwareVersion; @@ -60,18 +64,46 @@ public String getBoardName() { } public int getTempCpum() { + if (sensors != null) { + for (FreeboxSensor sensor : sensors) { + if ("temp_cpum".equals(sensor.getId())) { + return sensor.getValue(); + } + } + } return tempCpum; } public int getTempSw() { + if (sensors != null) { + for (FreeboxSensor sensor : sensors) { + if ("temp_sw".equals(sensor.getId())) { + return sensor.getValue(); + } + } + } return tempSw; } public int getTempCpub() { + if (sensors != null) { + for (FreeboxSensor sensor : sensors) { + if ("temp_cpub".equals(sensor.getId())) { + return sensor.getValue(); + } + } + } return tempCpub; } public int getFanRpm() { + if (fans != null) { + for (FreeboxSensor fan : fans) { + if ("fan0_speed".equals(fan.getId())) { + return fan.getValue(); + } + } + } return fanRpm; } diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfigResponse.java index 357c3217cb99a..494346b07cfb5 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxSystemConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfig.java index 8f16cf8a1ff57..e554f8144b59d 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfigResponse.java index 114d837a46d6d..c75c99724438c 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxUPnPAVConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfig.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfig.java index 45d67c99e3c1f..92acafe048432 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfig.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfigResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfigResponse.java index 3cb7175faee06..1d66c3bfe395f 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfigResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxWifiGlobalConfigResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatus.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatus.java index 1aa462a125659..450ba2c7714a3 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatus.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatusResponse.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatusResponse.java index d6ddad14ba415..63ee697913fea 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatusResponse.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/api/model/FreeboxXdslStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxAirPlayDeviceConfiguration.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxAirPlayDeviceConfiguration.java index 88dc2f4236af1..ab2284eb42610 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxAirPlayDeviceConfiguration.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxAirPlayDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetDeviceConfiguration.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetDeviceConfiguration.java index c69be62b7c121..b6e603c21207f 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetDeviceConfiguration.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetInterfaceConfiguration.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetInterfaceConfiguration.java index cebeaf1cdcf44..d6e0338fae1f1 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetInterfaceConfiguration.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxNetInterfaceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxPhoneConfiguration.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxPhoneConfiguration.java index 7720024e875fb..33a22d21709a7 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxPhoneConfiguration.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxPhoneConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxServerConfiguration.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxServerConfiguration.java index 805d333e2991e..0e7171ccbe09d 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxServerConfiguration.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/config/FreeboxServerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxDiscoveryService.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxDiscoveryService.java index 480d8b63938ed..787a6487a855a 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxDiscoveryService.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxServerDiscoveryParticipant.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxServerDiscoveryParticipant.java index 007c1d46032d8..63cdf5ce14eb4 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxServerDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/discovery/FreeboxServerDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxHandler.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxHandler.java index 67b2ace7d9be2..9a3e6741732e6 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxHandler.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxThingHandler.java b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxThingHandler.java index 3525a12a1c126..0246b722cad75 100644 --- a/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxThingHandler.java +++ b/bundles/org.openhab.binding.freebox/src/main/java/org/openhab/binding/freebox/internal/handler/FreeboxThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -346,7 +346,7 @@ public void updateAirPlayDevice(List<FreeboxAirMediaReceiver> receivers) { public void playMedia(String url) throws FreeboxException { if (bridgeHandler != null && url != null) { - bridgeHandler.getApiManager().stopMedia(airPlayName, airPlayPassword); + stopMedia(); bridgeHandler.getApiManager().playMedia(url, airPlayName, airPlayPassword); } } @@ -364,10 +364,16 @@ private void playMedia(ChannelUID channelUID, Command command) { } } + public void stopMedia() throws FreeboxException { + if (bridgeHandler != null) { + bridgeHandler.getApiManager().stopMedia(airPlayName, airPlayPassword); + } + } + private void stopMedia(ChannelUID channelUID, Command command) { if (command instanceof OnOffType) { try { - bridgeHandler.getApiManager().stopMedia(airPlayName, airPlayPassword); + stopMedia(); } catch (FreeboxException e) { bridgeHandler.logCommandException(e, channelUID, command); } diff --git a/bundles/org.openhab.binding.freebox/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.freebox/src/main/resources/ESH-INF/thing/thing-types.xml index b51eda8a5fe3c..5891357a6e1f5 100644 --- a/bundles/org.openhab.binding.freebox/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.freebox/src/main/resources/ESH-INF/thing/thing-types.xml @@ -49,7 +49,7 @@ </parameter> <parameter name="appToken" type="text"> - <label>Application token</label> + <label>Application Token</label> <description>Token generated by the Freebox server</description> <required>false</required> </parameter> @@ -62,7 +62,7 @@ </parameter> <parameter name="useOnlyHttp" type="boolean"> - <label>Use only HTTP API</label> + <label>Use Only HTTP API</label> <description>Use HTTP API even if HTTPS is available</description> <default>false</default> <required>false</required> @@ -211,7 +211,7 @@ <required>false</required> </parameter> <parameter name="acceptAllMp3" type="boolean"> - <label>Accept all MP3</label> + <label>Accept All MP3</label> <description>Accept any bitrate for MP3 audio or only bitrates greater than 64 kbps</description> <default>true</default> <required>false</required> @@ -242,7 +242,7 @@ </channel-group-type> <channel-group-type id="accepted"> - <label>Accepted call</label> + <label>Accepted Call</label> <description>The last accepted phone call</description> <channels> <channel id="call_number" typeId="caller_number" /> @@ -253,7 +253,7 @@ </channel-group-type> <channel-group-type id="missed"> - <label>Missed call</label> + <label>Missed Call</label> <description>The last missed phone call</description> <channels> <channel id="call_number" typeId="caller_number" /> @@ -264,7 +264,7 @@ </channel-group-type> <channel-group-type id="outgoing"> - <label>Outgoing call</label> + <label>Outgoing Call</label> <description>The last outgoing phone call</description> <channels> <channel id="call_number" typeId="called_number" /> @@ -283,14 +283,14 @@ <channel-type id="uptime" advanced="true"> <item-type>Number</item-type> - <label>Server uptime</label> + <label>Server Uptime</label> <description>Time since last reboot of the Freebox Server</description> <state readOnly="true" pattern="%d s" /> </channel-type> <channel-type id="restarted" advanced="true"> <item-type>Switch</item-type> - <label>Just restarted</label> + <label>Just Restarted</label> <description>Has the Freebox server have restarted during the last poll period</description> <category>Alarm</category> <state readOnly="true" /> @@ -520,21 +520,21 @@ <channel-type id="call_name"> <item-type>String</item-type> - <label>Call name</label> + <label>Call Name</label> <description>Called name for outgoing calls. Caller name for incoming calls</description> <state readOnly="true" /> </channel-type> <channel-type id="called_name"> <item-type>String</item-type> - <label>Called name</label> + <label>Called Name</label> <description>Called name</description> <state readOnly="true" /> </channel-type> <channel-type id="caller_name"> <item-type>String</item-type> - <label>Caller name</label> + <label>Caller Name</label> <description>Caller name</description> <state readOnly="true" /> </channel-type> @@ -549,13 +549,13 @@ <channel-type id="playurl"> <item-type>String</item-type> - <label>Play audio or video URL</label> + <label>Play Audio or Video URL</label> <description>Play an audio or video media from the given URL</description> </channel-type> <channel-type id="stop"> <item-type>Switch</item-type> - <label>Stop playback</label> + <label>Stop Playback</label> <description>Stop the media playback</description> </channel-type> diff --git a/bundles/org.openhab.binding.fronius/NOTICE b/bundles/org.openhab.binding.fronius/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.fronius/NOTICE +++ b/bundles/org.openhab.binding.fronius/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.fronius/README.md b/bundles/org.openhab.binding.fronius/README.md index a46128bedaab4..d53a8fd97e3ff 100644 --- a/bundles/org.openhab.binding.fronius/README.md +++ b/bundles/org.openhab.binding.fronius/README.md @@ -1,6 +1,6 @@ # Fronius Binding -This binding uses the [Fronius Solar API V1](http://www.fronius.com/en/photovoltaics/products/all-products/system-monitoring/open-interfaces/fronius-solar-api-json-) to obtain data from a Fronius devices. +This binding uses the [Fronius Solar API V1](https://www.fronius.com/en/photovoltaics/products/all-products/system-monitoring/open-interfaces/fronius-solar-api-json-) to obtain data from a Fronius devices. ## Supported Things diff --git a/bundles/org.openhab.binding.fronius/pom.xml b/bundles/org.openhab.binding.fronius/pom.xml index 3a7406f4cdeb6..c352cb77e775a 100644 --- a/bundles/org.openhab.binding.fronius/pom.xml +++ b/bundles/org.openhab.binding.fronius/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.fronius</artifactId> diff --git a/bundles/org.openhab.binding.fronius/src/main/feature/feature.xml b/bundles/org.openhab.binding.fronius/src/main/feature/feature.xml index d229c4324e4bf..c9781cd4a4632 100644 --- a/bundles/org.openhab.binding.fronius/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.fronius/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.fronius-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-fronius" description="Fronius Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBaseDeviceConfiguration.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBaseDeviceConfiguration.java index 37a95252602f4..a89fc54d6ab0b 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBaseDeviceConfiguration.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBaseDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java index 1d25ed031a9f5..634cae2ed9dd4 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBridgeConfiguration.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBridgeConfiguration.java index c0975ff58faf3..0498438ad1c1e 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBridgeConfiguration.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java index eaa0897d99cf6..eca79bd64fa36 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/FroniusHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/BaseFroniusResponse.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/BaseFroniusResponse.java index ed030a52554e3..145bd8ba7066c 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/BaseFroniusResponse.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/BaseFroniusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/DeviceStatus.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/DeviceStatus.java index bb797c4666e7b..0bc296f3e09e6 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/DeviceStatus.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/DeviceStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/Head.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/Head.java index 7eb1e39d53f9c..ece9903d6a43a 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/Head.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/Head.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadRequestArguments.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadRequestArguments.java index c3f29f1450c63..9c41e60b42814 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadRequestArguments.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadRequestArguments.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadStatus.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadStatus.java index 16eba75c48639..3566c63c709ff 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadStatus.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/HeadStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBody.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBody.java index c5342680ab4e4..f663ac9034282 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBody.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBody.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBodyData.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBodyData.java index fc96b774c22a9..52090e54f045b 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBodyData.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeBodyData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeResponse.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeResponse.java index 0c37cecec0bf5..0ad4aa2bd94b4 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeResponse.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/InverterRealtimeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBody.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBody.java index ca662bedd2cb1..63fbba46ac6b6 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBody.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBody.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBodyData.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBodyData.java index adddc882641c1..495f671ede401 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBodyData.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeBodyData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeInverter.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeInverter.java index ddbf5ba45091c..f518b8610567c 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeInverter.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeInverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeResponse.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeResponse.java index 1392a7aa630a6..d55dda5eeaa89 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeResponse.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeSite.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeSite.java index d8b299475f987..3d99d700cc51d 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeSite.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/PowerFlowRealtimeSite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/ValueUnit.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/ValueUnit.java index 4a9e5c3bc5dd8..7f0de200c9dcd 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/ValueUnit.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/api/ValueUnit.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBaseThingHandler.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBaseThingHandler.java index 2cc14283270b5..5e3229b3ee24c 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBaseThingHandler.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBridgeHandler.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBridgeHandler.java index 6a1f27067943a..aa3733107c8b7 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBridgeHandler.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java index 7899f075d5957..5c0f727d5cc13 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/handler/FroniusSymoInverterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/KilowattConverter.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/KilowattConverter.java index a58ae87b63dd2..3ed87f206c9da 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/KilowattConverter.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/KilowattConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/SiPrefixFactors.java b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/SiPrefixFactors.java index 66a0a63e0a46f..9f847a0baca57 100644 --- a/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/SiPrefixFactors.java +++ b/bundles/org.openhab.binding.fronius/src/main/java/org/openhab/binding/fronius/internal/math/SiPrefixFactors.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/bridge.xml index 1b93f32380e38..48c8eead643ee 100644 --- a/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/bridge.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridge"> - <label>Fronius bridge</label> + <label>Fronius Bridge</label> <description>A bridge to connect Fronius devices</description> <config-description> <parameter name="hostname" type="text" required="true" groupName="network"> @@ -13,7 +13,7 @@ <description>The hostname or IP address of the Fronius gateway/device</description> </parameter> <parameter name="refreshInterval" type="integer" min="2"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> <default>10</default> </parameter> diff --git a/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/thing-types.xml index 26dd3dcbf4f99..b3b7e97c824f1 100644 --- a/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.fronius/src/main/resources/ESH-INF/thing/thing-types.xml @@ -43,7 +43,7 @@ </channel-type> <channel-type id="pac"> <item-type>Number</item-type> - <label>AC power</label> + <label>AC Power</label> <description>AC power</description> <state pattern="%f W" readOnly="true"></state> </channel-type> @@ -62,33 +62,33 @@ <channel-type id="fac"> <item-type>Number</item-type> - <label>AC frequency</label> + <label>AC Frequency</label> <description>AC frequency</description> <state pattern="%.2f Hz" readOnly="true"></state> </channel-type> <channel-type id="iac"> <item-type>Number</item-type> - <label>AC current</label> + <label>AC Current</label> <description>AC current</description> <state pattern="%.2f A" readOnly="true"></state> </channel-type> <channel-type id="idc"> <item-type>Number</item-type> - <label>DC current</label> + <label>DC Current</label> <description>DC current</description> <state pattern="%.2f A" readOnly="true"></state> </channel-type> <channel-type id="uac"> <item-type>Number</item-type> - <label>AC voltage</label> + <label>AC Voltage</label> <description>AC voltage</description> <state pattern="%.1f V" readOnly="true"></state> </channel-type> <channel-type id="udc"> <item-type>Number</item-type> - <label>DC voltage</label> + <label>DC Voltage</label> <description>DC voltage</description> <state pattern="%.1f V" readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.fsinternetradio/NOTICE b/bundles/org.openhab.binding.fsinternetradio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.fsinternetradio/NOTICE +++ b/bundles/org.openhab.binding.fsinternetradio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.fsinternetradio/README.md b/bundles/org.openhab.binding.fsinternetradio/README.md index 9eb5f64f64490..851f219f28a2f 100644 --- a/bundles/org.openhab.binding.fsinternetradio/README.md +++ b/bundles/org.openhab.binding.fsinternetradio/README.md @@ -1,6 +1,6 @@ # FS Internet Radio Binding -This binding integrates internet radios based on the [Frontier Silicon chipset](http://www.frontier-silicon.com/). +This binding integrates internet radios based on the [Frontier Silicon chipset](https://www.frontier-silicon.com/). ## Supported Things @@ -8,17 +8,17 @@ Successfully tested are internet radios: * [Hama IR100](https://de.hama.com/00054823/hama-internetradio-ir110) * [Medion MD87180, MD86988, MD86955, MD87528](http://internetradio.medion.com/) - * [Silvercrest SMRS18A1, SMRS30A1, SMRS35A1, SIRD 14 C2](http://www.silvercrest-multiroom.de/en/products/stereo-internet-radio/) + * [Silvercrest SMRS18A1, SMRS30A1, SMRS35A1, SIRD 14 C2, SIRD 14 D1](https://www.silvercrest-multiroom.de/en/products/stereo-internet-radio/) * [Roberts Stream 83i and 93i](https://www.robertsradio.com/uk/products/radio/smart-radio/) * [Auna Connect 150, Auna KR200](https://www.auna.de/Radios/Internetradios/) * [TechniSat DIGITRADIO 350 IR and 850](https://www.technisat.com/en_XX/DAB+-Radios-with-Internetradio/352-10996/) - * [TTMicro AS Pinell Supersound](http://www.ttmicro.no/radio) + * [TTMicro AS Pinell Supersound](https://www.ttmicro.no/radio) * [Revo SuperConnect](https://revo.co.uk/products/) * [Sangean WFR-28C](http://sg.sangean.com.tw/products/product_category.asp?cid=2) * [Roku SoundBridge M1001](https://soundbridge.roku.com/soundbridge/index.php) * [Dual IR 3a](https://www.dual.de/produkte/digitalradio/radio-station-ir-3a/) -But in principle, all internet radios based on the [Frontier Silicon chipset](http://www.frontier-silicon.com/) should be supported because they share the same API. +But in principle, all internet radios based on the [Frontier Silicon chipset](https://www.frontier-silicon.com/) should be supported because they share the same API. So It is very likely that other internet radio models of the same manufacturers do also work. ## Community @@ -33,7 +33,7 @@ If your radio is not discovered, please try to access its API via: `http://<radi If you get a 404 error, maybe a different port than the standard port 80 is used by your radio; try scanning the open ports of your radio.<br/> If you get a result like `FS_OK 1902014387`, your radio is supported. -If this is the case, please [add your model to this documentation](https://github.com/eclipse/smarthome/edit/master/extensions/binding/org.openhab.binding.fsinternetradio/README.md) and/or provide discovery information in [this thread](https://community.openhab.org/t/internet-radio-i-need-your-help/2131). +If this is the case, please [add your model to this documentation](https://github.com/openhab/openhab-addons/edit/master/bundles/org.openhab.binding.fsinternetradio/README.md) and/or provide discovery information in [this thread](https://community.openhab.org/t/internet-radio-i-need-your-help/2131). ## Binding Configuration diff --git a/bundles/org.openhab.binding.fsinternetradio/pom.xml b/bundles/org.openhab.binding.fsinternetradio/pom.xml index 3571132d09c50..bb869436a54d8 100644 --- a/bundles/org.openhab.binding.fsinternetradio/pom.xml +++ b/bundles/org.openhab.binding.fsinternetradio/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.fsinternetradio</artifactId> diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/feature/feature.xml b/bundles/org.openhab.binding.fsinternetradio/src/main/feature/feature.xml index f9405d3aa8ea9..63adff40a183b 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.fsinternetradio-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-fsinternetradio" description="Frontier Silicon Internet Radio Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioBindingConstants.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioBindingConstants.java index c4d348dc77882..50981f2887ea9 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioBindingConstants.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java index 6290d485483a8..b0dce0f12bfb9 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioHandlerFactory.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioHandlerFactory.java index 080a63ed5088a..1a78738cd830b 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioHandlerFactory.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/FSInternetRadioHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/handler/FSInternetRadioHandler.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/handler/FSInternetRadioHandler.java index fa6863761d777..225f8deafa1ef 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/handler/FSInternetRadioHandler.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/handler/FSInternetRadioHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java index 52812028c69ab..788990a9981bc 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadio.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java index cbbd71d797859..687b23565e9e8 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioApiResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java index 573485ef9b503..0828aa023b2bf 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java index ad3ad37c3da81..f47bc35ade78e 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/java/org/openhab/binding/fsinternetradio/internal/radio/FrontierSiliconRadioConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.fsinternetradio/src/main/resources/ESH-INF/thing/thing-types.xml index bea9d15f21499..239a1bfb10144 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.fsinternetradio/src/main/resources/ESH-INF/thing/thing-types.xml @@ -3,7 +3,6 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <!-- Sample Thing Type --> <thing-type id="radio"> <label>Internet Radio</label> <description>An internet radio device based on the Frontier Silicon chipset.</description> @@ -41,7 +40,7 @@ <default>1234</default> </parameter> <parameter name="refresh" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> <default>60</default> </parameter> diff --git a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/internal/handler/HandlerUtils.java b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/internal/handler/HandlerUtils.java index 781220708ea1b..85dba74a3ac7e 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/internal/handler/HandlerUtils.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/internal/handler/HandlerUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioDiscoveryParticipantJavaTest.java b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioDiscoveryParticipantJavaTest.java index b341c6829320f..12a473e5c2f82 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioDiscoveryParticipantJavaTest.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioDiscoveryParticipantJavaTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioHandlerJavaTest.java b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioHandlerJavaTest.java index ea906bc430474..75d26fb22d325 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioHandlerJavaTest.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/FSInternetRadioHandlerJavaTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/MockedRadioHandler.java b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/MockedRadioHandler.java index 3a26060d44b61..6f6df8267e1ac 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/MockedRadioHandler.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/MockedRadioHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/RadioServiceDummy.java b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/RadioServiceDummy.java index 884ff24062ef5..8daeb3020a122 100644 --- a/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/RadioServiceDummy.java +++ b/bundles/org.openhab.binding.fsinternetradio/src/test/java/org/openhab/binding/fsinternetradio/test/RadioServiceDummy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/NOTICE b/bundles/org.openhab.binding.ftpupload/NOTICE index 9f523a6762066..6914a1d625ce7 100644 --- a/bundles/org.openhab.binding.ftpupload/NOTICE +++ b/bundles/org.openhab.binding.ftpupload/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.ftpupload/README.md b/bundles/org.openhab.binding.ftpupload/README.md index 9df77d9ad8388..5d102e0588818 100644 --- a/bundles/org.openhab.binding.ftpupload/README.md +++ b/bundles/org.openhab.binding.ftpupload/README.md @@ -2,11 +2,11 @@ This binding can be used to receive image files from FTP clients. The binding acts as a FTP server. -Images stored on the FTP server are not saved to the file system, therefore the binding shouldn't cause any problems on flash based openHAB installations. +Images stored on the FTP server are not saved to the file system, therefore the binding shouldn't cause any problems on flash based openHAB installations if files are uploaded to FTP server continuously (e.g. network camera images). ## Supported Things -This binding supports Things of type ```ftpupload```. +This binding supports Things of type `ftpupload`. Every Thing is identified by FTP user name. Therefore, every thing should use unique user name to login FTP server. @@ -23,14 +23,25 @@ The binding has the following configuration options: | port | TCP Port | TCP port of the FTP server | no | 2121 | | idleTimeout | Idle timeout | The number of seconds before an inactive client is disconnected. If this value is set to 0, the idle time is disabled. | no | 60 | +## Thing Configuration + +The `ftpupload` Thing has the following configuration parameters: + +| Parameter | Description | Required | Default value | +|-----------------------------|---------------------------------------------------------------------------------------------------------------------|----------|---------------| +| userName | User name to login to the FTP server. User name is used to identify the Thing, so it should be unique per Thing. | yes | | +| password | Password to login to the FTP server. | yes | | + + ## Channels This binding currently supports the following channels: -| Channel Type ID | Item Type | Description | -|-----------------|--------------|----------------------------------------------------------------------------------------| -| image | Image | Image file received via FTP. | +| Channel | Channel Type Id | Item Type | Description | +|-----------------|-----------------|--------------|----------------------------------------------------------------------------------------| +| image | image-channel | Image | Image file received via FTP. | +Additionally user can introduce custom image-channel's to Thing (see examples). When an image file is uploaded to FTP server, the binding tries to find the channel whose filename matches the uploaded image filename. If no match is found, no channel is updated. The filename parameter supports regular expression patterns. @@ -156,7 +167,7 @@ Frame label="Garage network camera" icon="camera" { ## Logging and Problem Solving -For problem solving, if binding logging is not enough, Apache FTP server logging can also be enabled by the following command in the karaf console: +For problem solving, if binding logging is not enough, Apache FTP server logging can also be enabled by the following command in the Karaf console: ``` log:set DEBUG org.apache.ftpserver @@ -170,5 +181,3 @@ log:set DEFAULT org.apache.ftpserver If you meet any problems to receive images from the network cameras, you could test connection to binding with any FTP client. You can send image files via FTP client and thing channels should be updated accordingly. - - \ No newline at end of file diff --git a/bundles/org.openhab.binding.ftpupload/pom.xml b/bundles/org.openhab.binding.ftpupload/pom.xml index da7d442d60048..5efe20890f29c 100644 --- a/bundles/org.openhab.binding.ftpupload/pom.xml +++ b/bundles/org.openhab.binding.ftpupload/pom.xml @@ -1,36 +1,39 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.ftpupload</artifactId> <name>openHAB Add-ons :: Bundles :: FTP Upload Binding</name> + <properties> + <bnd.importpackage>org.springframework.*;resolution:="optional"</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>org.apache.ftpserver</groupId> <artifactId>ftplet-api</artifactId> <version>1.1.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.ftpserver</groupId> <artifactId>ftpserver-core</artifactId> <version>1.1.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> - <version>2.0.16</version> - <scope>provided</scope> + <version>2.0.21</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.ftpupload/src/main/feature/feature.xml b/bundles/org.openhab.binding.ftpupload/src/main/feature/feature.xml index 4426048eef0a5..a15509a16a36e 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.ftpupload/src/main/feature/feature.xml @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.ftpupload-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-ftpupload" description="FTP Upload Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:org.apache.ftpserver/ftplet-api/1.1.0</bundle> - <bundle dependency="true">mvn:org.apache.ftpserver/ftpserver-core/1.1.0</bundle> - <bundle dependency="true">mvn:org.apache.mina/mina-core/2.0.16</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ftpupload/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadBindingConstants.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadBindingConstants.java index 3b52b56975e5d..8f3fe324c78b1 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadBindingConstants.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadHandlerFactory.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadHandlerFactory.java index 11e54ade91b75..c6ebb1a8aa24a 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadHandlerFactory.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/FtpUploadHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -118,7 +118,7 @@ protected synchronized void modified(ComponentContext componentContext) { } try { - logger.info("Starting FTP server, port={}, idleTimeout={}", port, idleTimeout); + logger.debug("Starting FTP server, port={}, idleTimeout={}", port, idleTimeout); ftpServer.startServer(port, idleTimeout); } catch (FtpException | FtpServerConfigurationException e) { logger.warn("FTP server starting failed, reason: {}", e.getMessage()); @@ -126,7 +126,7 @@ protected synchronized void modified(ComponentContext componentContext) { } private void stopFtpServer() { - logger.info("Stopping FTP server"); + logger.debug("Stopping FTP server"); ftpServer.stopServer(); } } diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/config/FtpUploadConfig.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/config/FtpUploadConfig.java index 2c1bf81a6a485..ea81c8264c5ed 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/config/FtpUploadConfig.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/config/FtpUploadConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUser.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUser.java index 8e5f6544d3a7b..8dd0f27cef73b 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUser.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUserManager.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUserManager.java index f505f5143d8e8..f8796d9ab56f4 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUserManager.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FTPUserManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServer.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServer.java index bc4a7e8862338..c4c2df3575b3f 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServer.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServerEventListener.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServerEventListener.java index 8eab1478902b7..1682ea8a8c47f 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServerEventListener.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/FtpServerEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFileSystemView.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFileSystemView.java index ce372417e2435..fa4467d073b01 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFileSystemView.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFileSystemView.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFtpFile.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFtpFile.java index 36a1b5ebf7e5c..6f981bd008667 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFtpFile.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/SimpleFtpFile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/UsernamePassword.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/UsernamePassword.java index 79a35d907d4ee..b6c297b2bb05d 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/UsernamePassword.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/ftp/UsernamePassword.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/handler/FtpUploadHandler.java b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/handler/FtpUploadHandler.java index ec5886de4029a..938d2ea1fe545 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/handler/FtpUploadHandler.java +++ b/bundles/org.openhab.binding.ftpupload/src/main/java/org/openhab/binding/ftpupload/internal/handler/FtpUploadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/binding/binding.xml index ba39c11e6fc61..628757333b6ae 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/binding/binding.xml @@ -8,13 +8,13 @@ <author>Pauli Anttila</author> <config-description> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>TCP Port</label> <description>TCP port of the FTP server</description> <default>2121</default> </parameter> - <parameter name="idleTimeout" type="integer" min="0" max="65335"> - <label>Idle timeout</label> + <parameter name="idleTimeout" type="integer" min="0" max="65535"> + <label>Idle Timeout</label> <description>The number of seconds before an inactive client is disconnected. If this value is set to 0, the idle time is disabled.</description> <default>60</default> </parameter> diff --git a/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/thing/thing-types.xml index e0a27ee789b6a..fec284b614b69 100644 --- a/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.ftpupload/src/main/resources/ESH-INF/thing/thing-types.xml @@ -41,7 +41,7 @@ </channel-type> <channel-type id="image-received"> <kind>trigger</kind> - <label>Image file received trigger channel</label> + <label>Image File Received Trigger Channel</label> <event> <options> <option value="IMAGE_RECEIVED">Image received</option> diff --git a/bundles/org.openhab.binding.gardena/NOTICE b/bundles/org.openhab.binding.gardena/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.gardena/NOTICE +++ b/bundles/org.openhab.binding.gardena/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.gardena/README.md b/bundles/org.openhab.binding.gardena/README.md index 3398720e6b395..82bc8f2d50627 100644 --- a/bundles/org.openhab.binding.gardena/README.md +++ b/bundles/org.openhab.binding.gardena/README.md @@ -1,6 +1,6 @@ # Gardena Binding -This is the binding for [Gardena Smart Home](http://www.gardena.com/de/rasenpflege/smartsystem/). +This is the binding for [Gardena Smart Home](https://www.gardena.com/de/rasenpflege/smartsystem/). This binding allows you to integrate, view and control Gardena Smart Home devices in the openHAB environment. ## Supported Things @@ -154,4 +154,4 @@ This is not a binding issue, it must be fixed by Gardena. When the binding sends a command to a device, it communicates only with the Gardena online service. It has not control over, whether the command is sent from the online service via your gateway to the device. -It's the same as if you send the command in the Gardena App. +It is the same as if you send the command in the Gardena App. diff --git a/bundles/org.openhab.binding.gardena/pom.xml b/bundles/org.openhab.binding.gardena/pom.xml index 9bf0462c47220..239c40ed2d15a 100644 --- a/bundles/org.openhab.binding.gardena/pom.xml +++ b/bundles/org.openhab.binding.gardena/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.gardena</artifactId> diff --git a/bundles/org.openhab.binding.gardena/src/main/feature/feature.xml b/bundles/org.openhab.binding.gardena/src/main/feature/feature.xml index 32fb312a8cd53..0f2f9bf9d3b24 100644 --- a/bundles/org.openhab.binding.gardena/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.gardena/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.gardena-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-gardena" description="Gardena Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaBindingConstants.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaBindingConstants.java index b452946d62b07..da6b61593ce76 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaBindingConstants.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmart.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmart.java index cc194a272590f..9bc6288665282 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmart.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmart.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartCommandName.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartCommandName.java index 8793a2de13fdf..810ab3596081a 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartCommandName.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartCommandName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartEventListener.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartEventListener.java index e7b60a38ef124..65d89daf8cebc 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartEventListener.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java index 61ff1947aeee1..53b7ebce7efa3 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,8 +22,8 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.eclipse.jetty.client.HttpClient; @@ -515,7 +515,7 @@ private class RefreshDevicesThread implements Runnable { public void run() { try { logger.debug("Refreshing gardena device data"); - Map<String, Device> newDevicesById = new HashMap<>(); + final Map<String, Device> newDevicesById = new HashMap<>(); for (Location location : allLocations) { Devices devices = loadDevices(location); @@ -535,22 +535,18 @@ public void run() { } // determine deleted devices - @SuppressWarnings("unchecked") - Collection<Device> deletedDevices = CollectionUtils.subtract(allDevicesById.values(), - newDevicesById.values()); + Collection<Device> deletedDevices = allDevicesById.values().stream() + .filter(d -> !newDevicesById.values().contains(d)).collect(Collectors.toSet()); // determine new devices - @SuppressWarnings("unchecked") - Collection<Device> newDevices = CollectionUtils.subtract(newDevicesById.values(), - allDevicesById.values()); + Collection<Device> newDevices = newDevicesById.values().stream() + .filter(d -> !allDevicesById.values().contains(d)).collect(Collectors.toSet()); // determine updated devices - @SuppressWarnings("unchecked") - Collection<Device> updatedDevices = CollectionUtils.intersection(allDevicesById.values(), - newDevicesById.values()); + Collection<Device> updatedDevices = allDevicesById.values().stream().distinct() + .filter(newDevicesById.values()::contains).collect(Collectors.toSet()); allDevicesById = newDevicesById; - newDevicesById = null; for (Device deletedDevice : deletedDevices) { eventListener.onDeviceDeleted(deletedDevice); diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfig.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfig.java index 0056c7957d2ec..ba6697cedb795 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfig.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigDataWrapper.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigDataWrapper.java index b558d12008eac..513f97741c815 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigDataWrapper.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigDataWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigWrapper.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigWrapper.java index 91fb793e6daeb..cdede76ef35ad 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigWrapper.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/config/GardenaConfigWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/discovery/GardenaDeviceDiscoveryService.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/discovery/GardenaDeviceDiscoveryService.java index 7ccd484e8ccab..a01dd62a91ec0 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/discovery/GardenaDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/discovery/GardenaDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,12 +20,17 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.openhab.binding.gardena.internal.GardenaSmart; import org.openhab.binding.gardena.internal.exception.GardenaException; import org.openhab.binding.gardena.internal.handler.GardenaAccountHandler; @@ -40,23 +45,37 @@ * * @author Gerhard Riegler - Initial contribution */ -public class GardenaDeviceDiscoveryService extends AbstractDiscoveryService { +public class GardenaDeviceDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, ThingHandlerService { private final Logger logger = LoggerFactory.getLogger(GardenaDeviceDiscoveryService.class); private static final int DISCOVER_TIMEOUT_SECONDS = 30; - private GardenaAccountHandler accountHandler; + private @NonNullByDefault({}) GardenaAccountHandler accountHandler; private Future<?> scanFuture; - public GardenaDeviceDiscoveryService(GardenaAccountHandler accountHandler) { + public GardenaDeviceDiscoveryService() { super(Collections.unmodifiableSet(Stream.of(new ThingTypeUID(BINDING_ID, "-")).collect(Collectors.toSet())), DISCOVER_TIMEOUT_SECONDS, false); - this.accountHandler = accountHandler; + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof GardenaAccountHandler) { + this.accountHandler = (GardenaAccountHandler) handler; + this.accountHandler.setDiscoveryService(this); + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return accountHandler; } /** * Called on component activation. */ + @Override public void activate() { super.activate(null); } diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaDeviceNotFoundException.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaDeviceNotFoundException.java index 22b72f3fa10d9..2f8f269cf3951 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaDeviceNotFoundException.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaDeviceNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaException.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaException.java index 2c520b0c8ff99..cadb6b2d44b9f 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaException.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaUnauthorizedException.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaUnauthorizedException.java index 7166b79dd3012..eefa7797f1ab7 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaUnauthorizedException.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/exception/GardenaUnauthorizedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/AccountHandlerNotAvailableException.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/AccountHandlerNotAvailableException.java index 4eb97ba48157a..4a6ac681a7705 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/AccountHandlerNotAvailableException.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/AccountHandlerNotAvailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaAccountHandler.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaAccountHandler.java index 2fd53b6d657ba..9b0d73e151da3 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaAccountHandler.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaAccountHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.gardena.internal.handler; -import java.util.Hashtable; +import java.util.Collection; +import java.util.Collections; import java.util.concurrent.TimeUnit; -import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Channel; import org.eclipse.smarthome.core.thing.ChannelUID; @@ -24,6 +24,7 @@ import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.gardena.internal.GardenaSmart; @@ -34,7 +35,6 @@ import org.openhab.binding.gardena.internal.exception.GardenaException; import org.openhab.binding.gardena.internal.model.Device; import org.openhab.binding.gardena.internal.util.UidUtils; -import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +49,6 @@ public class GardenaAccountHandler extends BaseBridgeHandler implements GardenaS private static final long REINITIALIZE_DELAY_SECONDS = 10; private GardenaDeviceDiscoveryService discoveryService; - private ServiceRegistration<?> discoveryServiceRegistration; private GardenaSmart gardenaSmart = new GardenaSmartImpl(); private GardenaConfig gardenaConfig; @@ -68,6 +67,10 @@ public void initialize() { initializeGardena(); } + public void setDiscoveryService(GardenaDeviceDiscoveryService discoveryService) { + this.discoveryService = discoveryService; + } + /** * Initializes the GardenaSmart account. */ @@ -77,7 +80,6 @@ private void initializeGardena() { try { String id = getThing().getUID().getId(); gardenaSmart.init(id, gardenaConfig, instance, scheduler); - registerDeviceDiscoveryService(); discoveryService.startScan(null); discoveryService.waitForScanFinishing(); updateStatus(ThingStatus.ONLINE); @@ -111,40 +113,11 @@ public void dispose() { private void disposeGardena() { logger.debug("Disposing Gardena account '{}'", getThing().getUID().getId()); - if (discoveryService != null) { - discoveryService.stopScan(); - unregisterDeviceDiscoveryService(); - } + discoveryService.stopScan(); gardenaSmart.dispose(); } - /** - * Registers the Gardena DeviceDiscoveryService. - */ - private void registerDeviceDiscoveryService() { - discoveryService = new GardenaDeviceDiscoveryService(this); - discoveryServiceRegistration = bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, - new Hashtable<>()); - discoveryService.activate(); - } - - /** - * Unregisters the Gardena DeviceDisoveryService. - */ - private void unregisterDeviceDiscoveryService() { - if (discoveryServiceRegistration != null) { - if (bundleContext != null) { - GardenaDeviceDiscoveryService service = (GardenaDeviceDiscoveryService) bundleContext - .getService(discoveryServiceRegistration.getReference()); - service.deactivate(); - } - discoveryServiceRegistration.unregister(); - discoveryServiceRegistration = null; - discoveryService = null; - } - } - /** * Returns the Gardena Smart Home implementation. */ @@ -152,6 +125,11 @@ public GardenaSmart getGardenaSmart() { return gardenaSmart; } + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(GardenaDeviceDiscoveryService.class); + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { if (RefreshType.REFRESH == command) { diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaDeviceConfig.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaDeviceConfig.java index 3bcc0cd7f65a6..b6bcbaafbb170 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaDeviceConfig.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java index e76c22bb61160..4a16a3930f0e1 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java index e9c3dd1ff6b89..b9418c3cbbb59 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Ability.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Ability.java index f3197fdfcccfd..d3f942ef7c3d3 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Ability.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Ability.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Device.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Device.java index 683f425099880..7da08bc8135a3 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Device.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Devices.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Devices.java index f738ec578119d..7cc7e076cf369 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Devices.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Devices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Error.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Error.java index 1ddc963a11042..515ff56833a99 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Error.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Error.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Errors.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Errors.java index e46b32a8dffca..d7b1c8276ab1e 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Errors.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Errors.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Location.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Location.java index d5e086bf5ccb4..5b22575fe08d2 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Location.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Location.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Locations.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Locations.java index 44547e791278a..445c9359267d4 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Locations.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Locations.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/NoResult.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/NoResult.java index 09a0bf0c69389..25204b0643802 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/NoResult.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/NoResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Property.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Property.java index fe5ad6f76c8cc..24f78d20a3896 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Property.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Property.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/PropertyValue.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/PropertyValue.java index cee27dfe10e2b..d32007cdbc83e 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/PropertyValue.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/PropertyValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Recurrence.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Recurrence.java index 4c87566d13eb0..0cf6fea986b2e 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Recurrence.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Recurrence.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/ScheduledEvent.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/ScheduledEvent.java index 7b242ebbcbed3..01badf5d3c387 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/ScheduledEvent.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/ScheduledEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Session.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Session.java index a3f9b6e15150c..5f4e41017118b 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Session.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Session.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionAttributes.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionAttributes.java index f524faaa80c52..e4a039c543498 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionAttributes.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionAttributes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -53,4 +53,4 @@ public String getProvider() { public void setProvider(String provider) { this.provider = provider; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionWrapper.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionWrapper.java index 06f1d78a8f36a..31ea53c06cbec 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionWrapper.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/SessionWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Setting.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Setting.java index dde0d9fed2d4e..ea4e23191460e 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Setting.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/Setting.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/Command.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/Command.java index 41f0ee0c0960f..14ea5cfb8f1a8 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/Command.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilFurtherNoticeCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilFurtherNoticeCommand.java index c665654489fe0..c770aa54f2485 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilFurtherNoticeCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilFurtherNoticeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilNextTimerCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilNextTimerCommand.java index 781105b31f4cb..2126f9e2b9e5a 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilNextTimerCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerParkUntilNextTimerCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartOverrideTimerCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartOverrideTimerCommand.java index a33495611e196..c0ae40697f434 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartOverrideTimerCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartOverrideTimerCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartResumeScheduleCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartResumeScheduleCommand.java index a8c89bb17a2e7..adb989eda532f 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartResumeScheduleCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/MowerStartResumeScheduleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureAmbientTemperatureCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureAmbientTemperatureCommand.java index 62ca569eb8726..0fb44315eeb5e 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureAmbientTemperatureCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureAmbientTemperatureCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureLightCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureLightCommand.java index ebf7fc1305f0e..41baf23eb9ccf 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureLightCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureLightCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilHumidityCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilHumidityCommand.java index a1ed863484f5c..13173843e1f9b 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilHumidityCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilHumidityCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilTemperatureCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilTemperatureCommand.java index 83b559e868767..075980bdedeb6 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilTemperatureCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SensorMeasureSoilTemperatureCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommand.java index c126aa1e9afb4..12746eafc2ea1 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommandWrapper.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommandWrapper.java index 80b5c6f4f0099..89ac8cec41a21 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommandWrapper.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/SettingCommandWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringCancelOverrideCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringCancelOverrideCommand.java index b3be03756a505..a41cced2673f3 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringCancelOverrideCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringCancelOverrideCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringManualOverrideCommand.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringManualOverrideCommand.java index d475d18aa3f1b..94542b7327d70 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringManualOverrideCommand.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/command/WateringManualOverrideCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/DateDeserializer.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/DateDeserializer.java index 3965bb2e95339..61cd9db246215 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/DateDeserializer.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/DateDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/PropertyValueDeserializer.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/PropertyValueDeserializer.java index 724a2f0313909..4c33f24b7f6d0 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/PropertyValueDeserializer.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/deser/PropertyValueDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/BaseProperty.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/BaseProperty.java index 56817e44e585c..7f0165e38fb2c 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/BaseProperty.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/BaseProperty.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/IrrigationControlWateringProperty.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/IrrigationControlWateringProperty.java index 795baf545ae9a..ffacb248b2108 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/IrrigationControlWateringProperty.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/IrrigationControlWateringProperty.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/PropertyWrapper.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/PropertyWrapper.java index 2ac8667d0c680..9e341d142d3ee 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/PropertyWrapper.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/PropertyWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/StringProperty.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/StringProperty.java index 71d8d1e33c67a..73300c6fd2024 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/StringProperty.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/model/property/StringProperty.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/DateUtils.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/DateUtils.java index 447f15b3444dc..07329adb3048b 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/DateUtils.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/DateUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/UidUtils.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/UidUtils.java index 6a38ffbb7970f..5c3469f87c857 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/UidUtils.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/util/UidUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gardena/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.gardena/src/main/resources/ESH-INF/thing/thing-types.xml index bb69825e30d4d..fba475b154284 100644 --- a/bundles/org.openhab.binding.gardena/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.gardena/src/main/resources/ESH-INF/thing/thing-types.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="account" /> </supported-bridge-type-refs> - <label>Gardena Smart Sileno mower</label> + <label>Gardena Smart Sileno Mower</label> <description>A Gardena Smart Sileno mower</description> <channel-groups> @@ -78,14 +78,14 @@ <channel-type id="mowerDurationProperty"> <item-type>Number</item-type> - <label>Mowing time</label> + <label>Mowing Time</label> <description>Mowing time in minutes</description> <state pattern="%d min" min="1" max="1440" step="1" /> </channel-type> <channel-type id="parkUntilFurtherNotice"> <item-type>Switch</item-type> - <label>Park And Pause All Timers</label> + <label>Park and Pause All Timers</label> <description>Park and pause all timers</description> </channel-type> @@ -250,7 +250,7 @@ <channel-type id="sourceForNextStart" advanced="true"> <item-type>String</item-type> - <label>Source For Next Start</label> + <label>Source for Next Start</label> <description>The source for the next start</description> <state readOnly="true"> <options> @@ -305,14 +305,14 @@ <channel-type id="firmwareUploadProgress" advanced="true"> <item-type>Number</item-type> - <label>Upload progress</label> + <label>Upload Progress</label> <description>Firmware upload in progress</description> <state readOnly="true" /> </channel-type> <channel-type id="firmwareAvailableVersion" advanced="true"> <item-type>String</item-type> - <label>Available version</label> + <label>Available Version</label> <description>Available firmware version</description> <state readOnly="true" /> </channel-type> @@ -586,7 +586,7 @@ </options> </parameter> <parameter name="turn_on_pressure" type="text"> - <label>Turn on pressure</label> + <label>Turn On Pressure</label> <options> <option value="2.0">2.0</option> <option value="2.2">2.2</option> @@ -703,7 +703,7 @@ <channel-type id="turnOnPressure"> <item-type>Number</item-type> - <label>Turn on pressure</label> + <label>Turn On Pressure</label> <description>Turn on pressure</description> <state readOnly="true" pattern="%d bar"> <options> diff --git a/bundles/org.openhab.binding.globalcache/NOTICE b/bundles/org.openhab.binding.globalcache/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.globalcache/NOTICE +++ b/bundles/org.openhab.binding.globalcache/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.globalcache/README.md b/bundles/org.openhab.binding.globalcache/README.md index 4004bc3e05228..742831088e7a3 100644 --- a/bundles/org.openhab.binding.globalcache/README.md +++ b/bundles/org.openhab.binding.globalcache/README.md @@ -1,74 +1,140 @@ # GlobalCache Binding -The [GlobalCache](http://www.globalcache.com) binding is used to enable communication -between openHAB and GlobalCache [GC-100](http://www.globalcache.com/products/gc-100/) and [iTach](http://www.globalcache.com/products/itach/) family of devices. -Global Cache devices enable the control and automation of infrared, serial, and contact closure devices through an IP network (wired or wireless). +The [GlobalCache](https://www.globalcache.com) binding enables communication +between openHAB and GlobalCache [GC-100](https://www.globalcache.com/products/gc-100/) and [iTach](https://www.globalcache.com/products/itach/) family of devices. +GlobalCache devices enable the control and automation of infrared, serial, and contact closure devices over a wired or wireless IP network. ## Overview The GlobalCache binding discovers GC-100 and iTach devices on the network, and creates an inbox entry for each discovered device. -Once added as a thing, the user can complete the configuration of the device, such as selecting a MAP file for IR and serial codes. +Once added as a thing, the user can complete the configuration of the device, such as adding the name of the MAP file that contains IR and/or serial codes. ## Devices Supported Devices are discovered dynamically. -There is a single thing created for each physical GC-100 or iTach device connected to the network. +There is a single thing created for each physical GC-100 or iTach device discovered on the network. Each thing has channels that correspond to the physical connectors on the device. Currently supported devices include: -- iTach WF2IR and IP2IR -- iTach WF2CC and IP2CC -- iTach WF2SL and IP2SL -- iTach Flex Ethernet -- iTach Flex Ethernet PoE -- iTach Flex WiFi -- GC-100-6 -- GC-100-12 -- ZMOTE Wi-Fi Universal Remote +| Device | Thing ID | +|-----------------------------------|-----------| +| iTach WF2IR and IP2IR | itachIR | +| iTach WF2SL and IP2SL | itachSL | +| iTach WF2CC and IP2CC | itachCC | +| iTach Flex Ethernet and Flex WiFi | itachFlex | +| GC-100-6 | gc100_06 | +| GC-100-12 | gc100_12 | +| ZMOTE WiFi Universal Remote | zmote | -## Device Discovery +## Thing Configuration -GlobalCache GC-100, iTach, and Zmote devices emit an **announcement beacon** every 10-20 seconds on multicast address 239.255.250.250:9131. -The GlobalCache binding will automatically detect those devices, then add them to the inbox. +The binding uses the MAP transformation service to convert commands into IR and/or serial codes. +If not already installed, the MAP transformation service is installed automatically when the binding is installed. -Background discovery is **enabled** by default. -To disable background discovery, add the following line to the *conf/services/runtime.cfg* file: +In the event that the device's IP address is changed, the thing configuration must be updated manually, as the device cannot auto-discover the change. -```text -discovery.globalcache:background=false -``` +### iTach IR and ZMOTE -Note that automatic device discovery **will not work** with GC-100's running firmware earlier than v3.0 as those versions do not emit announcement beacons on the multicast address. -GC-100's running firmware earlier than v3.0 must be configured manually, either through *Paper UI* or using a *.things* file. -See below. +The iTach IR (Infrared) and ZMOTE devices have the following configuration parameters. -## Thing Configuration +| Parameter | Parameter ID | Required/Optional | Description | +|--------------|--------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | +| MAP Filename | mapFilename | Required | The MAP file that contains mappings of commands to the IR codes. | -The iTach IR, iTach SL, GC-100, and Zmote devices require a MAP file in order to transform the openHAB command to an IR command or to a serial command. -In the thing configuration, enter the name of the MAP file containing the IR and/or serial codes (). -The MAP file should be placed in the *conf/transform* directory. -See example below. +### iTach SL + +The iTach SL (Serial) device has the following configuration parameters. +Note that you must use the iTach SL's web application to set the serial port +parameters for **baud rate**, **flow control**, and **parity** to match the configuration of the end device to which the iTach is connected. + +| Parameter | Parameter ID | Required/Optional | Description | +|----------------|---------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | +| MAP Filename | mapFilename | Required | The MAP file that contains mappings of commands to the serial codes. | +| Enable Two Way | enableTwoWay1 | Optional | Enable two-way communication with the device. By default, the binding only sends commands to the device. | +| EOM Delimiter | eomDelimiter1 | Optional | The End-of-Message delimiter used to identify the end of a message that the binding received from the device. | + +### iTach CC + +The iTach CC (Contact Closure) device has the following configuration parameters. -For iTach SL and GC-100 devices that support serial connections, you must use the GlobalCache device web application to set the serial port parameters for **baud rate**, **flow control**, and **parity**. -These settings must match the serial port settings of the AV device being controlled. +| Parameter | Parameter ID | Required/Optional | Description | +|--------------|--------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | -For iTach Flex devices, you must set the Active Cable configuration parameter to match how the Flex is configured. +### iTach Flex + +The iTach Flex device has the following configuration parameters. +Note that you must set the Active Cable configuration parameter to match how the Flex is configured. Available options are Infrared, Serial, and Relay/Sensor. The default is Infrared. -The device's IP address is set at time of discovery. -However, in the event that the device's IP address is changed, the device IP address must be changed in the thing's configuration. +When the iTach Fles is configured for serial operation, you must use the iTach Flex's web application to set the serial port +parameters for **baud rate**, **flow control**, and **parity** to match the configuration of the end device to which the iTach Flex is connected. + +| Parameter | Parameter ID | Required/Optional | Description | +|----------------|---------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | +| MAP Filename | mapFilename | Required | The MAP file that contains mappings of commands to the IR and/or serial codes. | +| Active Cable | activeCable | Required | Available options are Infrared (FLEX_INFRARED), Serial (FLEX_SERIAL) or Relay/Sensor (FLEX_RELAY). | +| Enable Two Way | enableTwoWay1 | Optional | Enable two-way communication with the device. By default, the binding only sends commands to the device. | +| EOM Delimiter | eomDelimiter1 | Optional | The End-of-Message delimiter used to identify the end of a message that the binding received from the device. | + +### GC-100-6 + +The GC-100-6 device has the following configuration parameters. +Note that you must use the GC-100-6's web application to set the serial port +parameters for **baud rate**, **flow control**, and **parity** to match the configuration of the end device to which the GC-100-6 is connected. + +| Parameter | Parameter ID | Required/Optional | Description | +|----------------|---------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | +| MAP Filename | mapFilename | Required | The MAP file that contains mappings of commands to the IR and serial codes. | +| Enable Two Way | enableTwoWay1 | Optional | Enable two-way communication with the device. By default, the binding only sends commands to the device. | +| EOM Delimiter | eomDelimiter1 | Optional | The End-of-Message delimiter used to identify the end of a message that the binding received from the device. | + +### GC-100-12 + +The GC-100-12 device has the following configuration parameters. +Note that you must use the GC-100-12's web application to set the serial port +parameters for **baud rate**, **flow control**, and **parity** to match the configuration of the end device to which the GC-100-12 is connected. + +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|---------------|-------------------|-------------| +| IP Address | ipAddress | Required | The device's IP address. | +| MAP Filename | mapFilename | Required | The MAP file that contains mappings of commands to the IR and/or serial codes. | +| Enable Two Way 1 | enableTwoWay1 | Optional | Enable two-way communication between the binding and the device on serial port #1. By default, the binding only sends commands to the device. | +| EOM Delimiter 1 | eomDelimiter1 | Optional | The End-of-Message delimiter used to identify the end of a message that the binding received from the device on serial port #1. | +| Enable Two Way 2 | enableTwoWay2 | Optional | Enable two-way communication between the binding and the device on serial port #2. By default, the binding only sends commands to the device. | +| EOM Delimiter 2 | eomDelimiter2 | Optional | The End-of-Message delimiter used to identify the end of a message that the binding received from the device on serial port #2. | ### Manual Thing Creation -Devices can be manually created in the *PaperUI* or *HABmin*, or by placing a *.things* file in the *conf/things* directory. +Devices can be created in the *Paper UI* or *HABmin*, or by placing a *.things* file in the *conf/things* directory. See example below. ### Binding Dependencies The GlobalCache binding uses the **transform** binding to map commands to IR and serial codes. See example below. +## Device Discovery + +GlobalCache GC-100, iTach, and Zmote devices emit an **announcement beacon** every 10-20 seconds on multicast address 239.255.250.250:9131. +The GlobalCache binding will automatically detect those devices, then add them to the inbox. + +Background discovery is **enabled** by default. +To disable background discovery, add the following line to the *conf/services/runtime.cfg* file: + +```text +discovery.globalcache:background=false +``` + +Note that automatic device discovery **will not work** with GC-100's running firmware earlier than v3.0 as those versions do not emit announcement beacons on the multicast address. +GC-100's running firmware earlier than v3.0 must be configured manually, either through *Paper UI* or using a *.things* file. +See below. + ## Channels and Channel Types There are four *channel types* used across the GC-100 and iTach family of devices. @@ -119,7 +185,7 @@ Here's an example of the hex code format: 0000 006E 0000 0024 0154 00AA 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003F 0015 0015 0015 0015 0015 0015 0015 0015 0015 003F 0015 003F 0015 003F 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 003F 0015 003F 0015 003F 0015 003F 0015 003F 0015 003F 0015 003F 0015 003F 0015 0015 0015 0015 0015 069B 0154 0055 0015 0EA9 ``` -The [Global Cache iConvert utility](http://www.globalcache.com/files/docs/gc_iconvert_relnotes.txt) can be used to convert between the two formats, if desired. +The [Global Cache iConvert utility](https://www.globalcache.com/files/docs/gc_iconvert_relnotes.txt) can be used to convert between the two formats, if desired. The iConvert utility is available on the Windows platform only. Global Cache also maintains an online [IR Control Tower database](https://irdb.globalcache.com/) of IR codes. There are numerous other sources of IR codes, such as iRule and RemoteCentral. diff --git a/bundles/org.openhab.binding.globalcache/pom.xml b/bundles/org.openhab.binding.globalcache/pom.xml index b6dc34a8736b9..c9f3021cddc93 100644 --- a/bundles/org.openhab.binding.globalcache/pom.xml +++ b/bundles/org.openhab.binding.globalcache/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.globalcache</artifactId> diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheBindingConstants.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheBindingConstants.java index 35a7599c871b9..8c09165d396f0 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheBindingConstants.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheHandlerFactory.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheHandlerFactory.java index 26a043db1185e..abec1634f637d 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheHandlerFactory.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/GlobalCacheHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/AbstractCommand.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/AbstractCommand.java index 151efc431c56b..08cbee2760595 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/AbstractCommand.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/AbstractCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetdevices.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetdevices.java index c75827f914993..b2378938f9a4b 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetdevices.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetdevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetserial.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetserial.java index ce44ce4039d70..bb386507227db 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetserial.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetserial.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetstate.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetstate.java index e5a301c63815b..31a5465ffd82c 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetstate.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetstate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetversion.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetversion.java index 49c0750f917f8..c280876da6037 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetversion.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandGetversion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandInterface.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandInterface.java index 0a549881e306b..5c66ed0a3b662 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandInterface.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendir.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendir.java index c86f01d03384c..b82fd72dd9dee 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendir.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendir.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendserial.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendserial.java index 0a99f11e397db..4c5975de9ff2b 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendserial.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSendserial.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetserial.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetserial.java index 5a868f1f38c91..a47ac45cad043 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetserial.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetserial.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetstate.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetstate.java index 58aef0bbe1191..9d2c6abbc2882 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetstate.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/CommandSetstate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/RequestMessage.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/RequestMessage.java index b63be35436ee9..535571f2d944a 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/RequestMessage.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/RequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/ResponseMessage.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/ResponseMessage.java index eb9a241ce9754..9bdb773a9cf3c 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/ResponseMessage.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/command/ResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/GlobalCacheDiscoveryService.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/GlobalCacheDiscoveryService.java index d8e61beaafd1e..ea575c7596fae 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/GlobalCacheDiscoveryService.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/GlobalCacheDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/MulticastListener.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/MulticastListener.java index bfc1df497d522..96ec00b0ebc13 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/MulticastListener.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/discovery/MulticastListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/handler/GlobalCacheHandler.java b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/handler/GlobalCacheHandler.java index 14e8456678823..e9fafe1b0ad90 100644 --- a/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/handler/GlobalCacheHandler.java +++ b/bundles/org.openhab.binding.globalcache/src/main/java/org/openhab/binding/globalcache/internal/handler/GlobalCacheHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -61,6 +61,8 @@ import org.openhab.binding.globalcache.internal.command.CommandSetstate; import org.openhab.binding.globalcache.internal.command.RequestMessage; import org.openhab.binding.globalcache.internal.command.ResponseMessage; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,6 +75,8 @@ public class GlobalCacheHandler extends BaseThingHandler { private Logger logger = LoggerFactory.getLogger(GlobalCacheHandler.class); + private final BundleContext bundleContext; + private static final String GLOBALCACHE_THREAD_POOL = "globalCacheHandler"; private InetAddress ifAddress; @@ -97,6 +101,7 @@ public GlobalCacheHandler(@NonNull Thing gcDevice, String ipv4Address) { commandProcessor = new CommandProcessor(); scheduledFuture = null; this.ipv4Address = ipv4Address; + this.bundleContext = FrameworkUtil.getBundle(GlobalCacheHandler.class).getBundleContext(); } @Override diff --git a/bundles/org.openhab.binding.gpstracker/.project b/bundles/org.openhab.binding.gpstracker/.project index ac5b04dafc52f..2f0cad55df7fb 100644 --- a/bundles/org.openhab.binding.gpstracker/.project +++ b/bundles/org.openhab.binding.gpstracker/.project @@ -20,4 +20,4 @@ <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures> -</projectDescription> \ No newline at end of file +</projectDescription> diff --git a/bundles/org.openhab.binding.gpstracker/NOTICE b/bundles/org.openhab.binding.gpstracker/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.gpstracker/NOTICE +++ b/bundles/org.openhab.binding.gpstracker/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.gpstracker/README.md b/bundles/org.openhab.binding.gpstracker/README.md index 458ee5ae1e38e..10ca81db52ad3 100644 --- a/bundles/org.openhab.binding.gpstracker/README.md +++ b/bundles/org.openhab.binding.gpstracker/README.md @@ -1,13 +1,15 @@ # GPSTracker Binding -This binding allows you to connect mobile GPS tracker applications to openHAB and process GPS location reports. Currently two applications are supported: +This binding allows you to connect mobile GPS tracker applications to openHAB and process GPS location reports. + +Currently two applications are supported: * [OwnTracks](https://owntracks.org/booklet/) - iOS, Android * [GPSLogger](https://gpslogger.app/) - Android GPS location reports are sent to openHAB using HTTP. Please be aware that this communication uses the public network so make sure your openHAB installation is [secured](https://www.openhab.org/docs/installation/security.html#encrypted-communication) (but accessible from public internet through myopenhab.org or using a reverse proxy) and you configured HTTP**S** access in tracking applications. -The easiest way to achieve this is to use the [openHAB Cloud Connector](https://www.openhab.org/addons/integrations/openhabcloud/) in conjunction with [myopenHAB.org](http://www.myopenhab.org/). +The easiest way to achieve this is to use the [openHAB Cloud Connector](https://www.openhab.org/addons/integrations/openhabcloud/) in conjunction with [myopenHAB.org](https://www.myopenhab.org/). The binding can process two message types received from trackers: diff --git a/bundles/org.openhab.binding.gpstracker/pom.xml b/bundles/org.openhab.binding.gpstracker/pom.xml index 325464d23811a..592029988255b 100644 --- a/bundles/org.openhab.binding.gpstracker/pom.xml +++ b/bundles/org.openhab.binding.gpstracker/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.gpstracker</artifactId> diff --git a/bundles/org.openhab.binding.gpstracker/src/main/feature/feature.xml b/bundles/org.openhab.binding.gpstracker/src/main/feature/feature.xml index f82016ea20f6e..a36535e11f1f7 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.gpstracker/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.gpstracker-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-gpstracker" description="GPSTracker Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerBindingConstants.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerBindingConstants.java index aa3132737e3b1..3c8e2cfc3d027 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerBindingConstants.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerHandlerFactory.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerHandlerFactory.java index 6b2c998a1a1a0..c95054e7c618e 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerHandlerFactory.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/GPSTrackerHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/config/ConfigHelper.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/config/ConfigHelper.java index f43d652c96c39..7aac7e187f5ff 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/config/ConfigHelper.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/config/ConfigHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/discovery/TrackerDiscoveryService.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/discovery/TrackerDiscoveryService.java index 7127a59938caa..6753c511d85fb 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/discovery/TrackerDiscoveryService.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/discovery/TrackerDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/handler/TrackerHandler.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/handler/TrackerHandler.java index a916ae691e195..58ffe7b603a42 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/handler/TrackerHandler.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/handler/TrackerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/LocationMessage.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/LocationMessage.java index cdddb96127cf4..663b9288e5fe9 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/LocationMessage.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/LocationMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/MessageUtil.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/MessageUtil.java index bdd64f144fb56..22c3b9c1df4e0 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/MessageUtil.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/MessageUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationBroker.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationBroker.java index 10d8dc735ee6f..9b952c981eb7d 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationBroker.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationBroker.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationHandler.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationHandler.java index 480e10a7b1370..c6b969f806e98 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationHandler.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/NotificationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/TransitionMessage.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/TransitionMessage.java index 760351d7b5430..bbcded91c203e 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/TransitionMessage.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/message/TransitionMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerProfileFactory.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerProfileFactory.java index 506e1466ae580..c95cc1d95b7a5 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerProfileFactory.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerTriggerSwitchProfile.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerTriggerSwitchProfile.java index f294d7a2152c0..1c996f7812dc6 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerTriggerSwitchProfile.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/profile/GPSTrackerTriggerSwitchProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/AbstractCallbackServlet.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/AbstractCallbackServlet.java index f1979441f67c8..e7dae2a8a4153 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/AbstractCallbackServlet.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/AbstractCallbackServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/TrackerRegistry.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/TrackerRegistry.java index cd445beecf8e4..5f425b84a5edc 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/TrackerRegistry.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/TrackerRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/gpslogger/GPSLoggerCallbackServlet.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/gpslogger/GPSLoggerCallbackServlet.java index 6dbff7925f042..f9d81464829d8 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/gpslogger/GPSLoggerCallbackServlet.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/gpslogger/GPSLoggerCallbackServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/owntracks/OwnTracksCallbackServlet.java b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/owntracks/OwnTracksCallbackServlet.java index 2a42856f4f18b..2a2286c500523 100644 --- a/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/owntracks/OwnTracksCallbackServlet.java +++ b/bundles/org.openhab.binding.gpstracker/src/main/java/org/openhab/binding/gpstracker/internal/provider/owntracks/OwnTracksCallbackServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/.project b/bundles/org.openhab.binding.groheondus/.project index bb051e9edf265..bbd21afdce10d 100644 --- a/bundles/org.openhab.binding.groheondus/.project +++ b/bundles/org.openhab.binding.groheondus/.project @@ -20,4 +20,4 @@ <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures> -</projectDescription> \ No newline at end of file +</projectDescription> diff --git a/bundles/org.openhab.binding.groheondus/NOTICE b/bundles/org.openhab.binding.groheondus/NOTICE index 57a8082382933..cb9af6b0ee993 100644 --- a/bundles/org.openhab.binding.groheondus/NOTICE +++ b/bundles/org.openhab.binding.groheondus/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.groheondus/README.md b/bundles/org.openhab.binding.groheondus/README.md index e4e3798f695a8..f8a886cbd127a 100644 --- a/bundles/org.openhab.binding.groheondus/README.md +++ b/bundles/org.openhab.binding.groheondus/README.md @@ -24,7 +24,7 @@ This binding does not require any configuration outside of things. ## Thing Configuration -There's only one thing and one bridge that needs to be configured together to get this binding to work, see the full example section for a self-explaining example. +There is only one thing and one bridge that needs to be configured together to get this binding to work, see the full example section for a self-explaining example. ### Account Bridge @@ -103,7 +103,7 @@ Number Humidity_Sense "Humidity [%.1f %unit%]" {channel="groheondus:sense:groheo Actually obtaining a `refresh token` from the GROHE ONDUS Api requires some manual steps. In order to more deeply understand what is happening during the process, you can read more information about the OAuth2/OIDC (OpenID Connect) login flow by searching for these terms in your favorite search engine. -Here's a short step-by-step guide on how to obtain a refresh token: +Here is a short step-by-step guide on how to obtain a refresh token: 1. Open a new tab in your Internet browser 2. Open the developer console of your browser (mostly possible by pressing F12) diff --git a/bundles/org.openhab.binding.groheondus/pom.xml b/bundles/org.openhab.binding.groheondus/pom.xml index 502d432ae1647..52a02e2a824d1 100644 --- a/bundles/org.openhab.binding.groheondus/pom.xml +++ b/bundles/org.openhab.binding.groheondus/pom.xml @@ -1,23 +1,39 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.groheondus</artifactId> <name>openHAB Add-ons :: Bundles :: GROHE ONDUS Binding</name> + <properties> + <dep.noembedding>commons-text,commons-lang3</dep.noembedding> + </properties> + <dependencies> <dependency> <groupId>org.grohe</groupId> <artifactId>ondus-api</artifactId> <version>0.0.11</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <version>1.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.8.1</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.groheondus/src/main/feature/feature.xml b/bundles/org.openhab.binding.groheondus/src/main/feature/feature.xml index 1aafe234ecacd..81aa944f71a05 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.groheondus/src/main/feature/feature.xml @@ -1,13 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.groheondus-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-groheondus" description="GROHE ONDUS Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature dependency="true">openhab.tp-jackson</feature> <bundle dependency="true">mvn:org.apache.commons/commons-text/1.6</bundle> <bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.8.1</bundle> - <bundle dependency="true">mvn:org.grohe/ondus-api/0.0.11</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.groheondus/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountServlet.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountServlet.java index 4e37a32b2e34a..58676e016da69 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountServlet.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -51,7 +51,7 @@ public AccountServlet(HttpService httpService, String bridgeId, GroheOndusAccoun try { httpService.registerServlet(servletUrl(), this, null, httpService.createDefaultHttpContext()); } catch (Exception e) { - logger.warn("Register servlet fails {}", e); + logger.warn("Register servlet fails", e); } } @@ -133,7 +133,7 @@ public void dispose() { try { httpService.unregister(servletUrl()); } catch (UnsupportedEncodingException e) { - logger.warn("Unregistration of servlet failed wth {}", e); + logger.warn("Unregistration of servlet failed", e); } } } diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountsServlet.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountsServlet.java index 0f45ab2e4dbf6..56a2a65c4016a 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountsServlet.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/AccountsServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -55,7 +55,7 @@ public AccountsServlet(@Reference HttpService httpService) { try { httpService.registerServlet(SERVLET_URL, this, null, httpService.createDefaultHttpContext()); } catch (ServletException | NamespaceException e) { - logger.warn("Register servlet fails {}", e); + logger.warn("Register servlet fails", e); } } diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusAccountConfiguration.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusAccountConfiguration.java index ebbb1ee573c09..f91e110537310 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusAccountConfiguration.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusAccountConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusApplianceConfiguration.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusApplianceConfiguration.java index 770d446bb4a8d..0aa554fe5a00a 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusApplianceConfiguration.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusApplianceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusBindingConstants.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusBindingConstants.java index 2ea7d33321116..3505c4dc78c84 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusBindingConstants.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/GroheOndusBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/discovery/GroheOndusDiscoveryService.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/discovery/GroheOndusDiscoveryService.java index 8a30210209da6..6915e8c0317d8 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/discovery/GroheOndusDiscoveryService.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/discovery/GroheOndusDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusAccountHandler.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusAccountHandler.java index 8de7fb1ce4594..7225ceb6f196b 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusAccountHandler.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusAccountHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -93,7 +93,7 @@ private void scheduleTokenRefresh() { try { setRefreshToken(ondusService.refreshAuthorization()); } catch (Exception e) { - logger.warn("Could not refresh authorization for GROHE ONDUS account, error {}", e); + logger.warn("Could not refresh authorization for GROHE ONDUS account", e); } }, between.getSeconds(), TimeUnit.SECONDS); } diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusBaseHandler.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusBaseHandler.java index 1203dc406c5e9..1db3ee535912d 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusBaseHandler.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusHandlerFactory.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusHandlerFactory.java index 35d995791b87a..cb98b63f458b3 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusHandlerFactory.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseGuardHandler.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseGuardHandler.java index 0f1f017d52bfe..451aa921f96ea 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseGuardHandler.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseGuardHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseHandler.java b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseHandler.java index f4a70a02c7ddd..498ac93aa7272 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseHandler.java +++ b/bundles/org.openhab.binding.groheondus/src/main/java/org/openhab/binding/groheondus/internal/handler/GroheOndusSenseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.groheondus/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.groheondus/src/main/resources/ESH-INF/thing/thing-types.xml index 062dc6efffc40..53173105d8cda 100644 --- a/bundles/org.openhab.binding.groheondus/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.groheondus/src/main/resources/ESH-INF/thing/thing-types.xml @@ -100,7 +100,7 @@ <channel-type id="name"> <item-type>String</item-type> - <label>Appliance name</label> + <label>Appliance Name</label> <description>The name of the appliance</description> </channel-type> <channel-type id="pressure"> @@ -116,7 +116,7 @@ </channel-type> <channel-type id="valve_open"> <item-type>Switch</item-type> - <label>Valve open</label> + <label>Valve Open</label> <description>Valve switch</description> </channel-type> <channel-type id="humidity"> @@ -133,13 +133,14 @@ </channel-type> <channel-type id="waterconsumption"> <item-type>Number</item-type> - <label>Water consumption</label> + <label>Water Consumption</label> <description>The amount of water consumed in the given time period.</description> <state readOnly="true" /> <config-description> <parameter name="timeframe" type="integer" min="1" max="90" step="1" required="true"> <label>Timeframe</label> <description>The timeframe in days to get the water consumption of</description> + <default>1</default> </parameter> </config-description> </channel-type> diff --git a/bundles/org.openhab.binding.harmonyhub/.classpath b/bundles/org.openhab.binding.harmonyhub/.classpath index a20af92700b49..336929d7931ac 100644 --- a/bundles/org.openhab.binding.harmonyhub/.classpath +++ b/bundles/org.openhab.binding.harmonyhub/.classpath @@ -28,5 +28,16 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> + <classpathentry kind="src" path="target/generated-sources/annotations"> + <attributes> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.harmonyhub/NOTICE b/bundles/org.openhab.binding.harmonyhub/NOTICE index e374be948c848..f26b23eaf999b 100644 --- a/bundles/org.openhab.binding.harmonyhub/NOTICE +++ b/bundles/org.openhab.binding.harmonyhub/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.harmonyhub/README.md b/bundles/org.openhab.binding.harmonyhub/README.md index 9089883698c88..d70d6fe6a09fc 100644 --- a/bundles/org.openhab.binding.harmonyhub/README.md +++ b/bundles/org.openhab.binding.harmonyhub/README.md @@ -1,11 +1,11 @@ # Logitech Harmony Hub Binding -The Harmony Hub binding is used to enable communication between openHAB2 and multiple Logitech Harmony Hub devices. +The Harmony Hub binding is used to enable communication between openHAB and multiple Logitech Harmony Hub devices. The API exposed by the Harmony Hub is relatively limited, but it does allow for reading the current activity as well as setting the activity and sending device commands. ## Overview -The Harmony binding represents a "Hub" as a bridge thing type and "Devices" as things connected to the bridge. +The Harmony binding represents a "Hub" as a bridge thing type and "Devices" as things connected to the bridge. ### Hub @@ -72,8 +72,8 @@ String HarmonyGreatRoomActivity "Current Activity [%s]" (gMain) { Hubs can also send a button press to a device associated with the current activity. A String item can be used to send any button name/label or a Player item can be used to send Play/Pause/FastForward/Rewind/SkipForward/SkipBackward. -This mimics the physical remote where buttons are mapped differently depending on which activity is running. -For example the play button may be sent to a DVD player when running a "Watch DVD" activity, or it may be sent to a AppleTV when running a "Watch Movie" activity. +This mimics the physical remote where buttons are mapped differently depending on which activity is running. +For example the play button may be sent to a DVD player when running a "Watch DVD" activity, or it may be sent to an Apple TV when running a "Watch Movie" activity. ```java diff --git a/bundles/org.openhab.binding.harmonyhub/pom.xml b/bundles/org.openhab.binding.harmonyhub/pom.xml index 211c2b9cf8934..eeec72535cf3c 100644 --- a/bundles/org.openhab.binding.harmonyhub/pom.xml +++ b/bundles/org.openhab.binding.harmonyhub/pom.xml @@ -1,24 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.harmonyhub</artifactId> <name>openHAB Add-ons :: Bundles :: HarmonyHub Binding</name> + <properties> + <bnd.importpackage>!com.martiansoftware.jsap.*,!org.kohsuke.*</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>com.github.digitaldan</groupId> <artifactId>harmony-client</artifactId> - <version>1.1.4</version> - <scope>provided</scope> + <version>1.1.5</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/feature/feature.xml b/bundles/org.openhab.binding.harmonyhub/src/main/feature/feature.xml index d0770d2beb655..010ee8b9b2bf1 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.harmonyhub/src/main/feature/feature.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.harmonyhub-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-harmonyhub" description="Harmony Hub Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:com.github.digitaldan/harmony-client/1.1.4</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.harmonyhub/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubBindingConstants.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubBindingConstants.java index 369d262d99237..8f3183385a0b1 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubBindingConstants.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubHandlerFactory.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubHandlerFactory.java index 216e7421fb4e8..4419fea862828 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubHandlerFactory.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/HarmonyHubHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,6 +26,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; @@ -35,15 +36,18 @@ import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; import org.eclipse.smarthome.core.thing.type.ChannelGroupType; +import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeProvider; import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; import org.openhab.binding.harmonyhub.internal.discovery.HarmonyDeviceDiscoveryService; import org.openhab.binding.harmonyhub.internal.handler.HarmonyDeviceHandler; import org.openhab.binding.harmonyhub.internal.handler.HarmonyHubHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; /** * The {@link HarmonyHubHandlerFactory} is responsible for creating things and thing @@ -53,9 +57,10 @@ * @author Wouter Born - Add null annotations */ @NonNullByDefault -@Component(service = { ThingHandlerFactory.class, - ChannelTypeProvider.class }, configurationPid = "binding.harmonyhub") -public class HarmonyHubHandlerFactory extends BaseThingHandlerFactory implements ChannelTypeProvider { +@Component(service = { ThingHandlerFactory.class, ChannelTypeProvider.class, + ChannelGroupTypeProvider.class }, configurationPid = "binding.harmonyhub") +public class HarmonyHubHandlerFactory extends BaseThingHandlerFactory + implements ChannelTypeProvider, ChannelGroupTypeProvider { private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream .concat(HarmonyHubHandler.SUPPORTED_THING_TYPES_UIDS.stream(), @@ -63,6 +68,7 @@ public class HarmonyHubHandlerFactory extends BaseThingHandlerFactory implements .collect(Collectors.toSet()); private final Map<ThingUID, @Nullable ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + private @NonNullByDefault({}) HttpClient httpClient; private final List<ChannelType> channelTypes = new CopyOnWriteArrayList<>(); private final List<ChannelGroupType> channelGroupTypes = new CopyOnWriteArrayList<>(); @@ -111,7 +117,7 @@ private synchronized void registerHarmonyDeviceDiscoveryService(HarmonyHubHandle } @Override - public @Nullable Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { + public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { return channelTypes; } @@ -137,10 +143,23 @@ private synchronized void registerHarmonyDeviceDiscoveryService(HarmonyHubHandle } @Override - public @Nullable Collection<ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { + public Collection<ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { return channelGroupTypes; } + @Reference + protected void setHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + + protected void unsetHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = null; + } + + public HttpClient getHttpClient() { + return this.httpClient; + } + public void addChannelType(ChannelType type) { channelTypes.add(type); } diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyDeviceConfig.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyDeviceConfig.java index a7def38b6b01a..b09ee3cb2ee41 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyDeviceConfig.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyHubConfig.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyHubConfig.java index a44679656f17e..8a5010d91ceb7 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyHubConfig.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/config/HarmonyHubConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyDeviceDiscoveryService.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyDeviceDiscoveryService.java index 75ce0ade2db91..891cddce141d5 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyHubDiscoveryService.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyHubDiscoveryService.java index 7e32c28c95efd..f9170f42c43d5 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyHubDiscoveryService.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/discovery/HarmonyHubDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; -import java.io.StringReader; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; @@ -29,11 +28,14 @@ import java.util.ArrayList; import java.util.Enumeration; import java.util.List; -import java.util.Properties; +import java.util.Map; import java.util.Set; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; @@ -245,39 +247,30 @@ private void run() { break; } logger.trace("READ {}", input); - Properties properties = readProperties(input); - - String friendlyName = properties.getProperty("friendlyName"); - if (!responses.contains(friendlyName)) { - responses.add(friendlyName); - hubDiscovered(properties); + // response format is key1:value1;key2:value2;key3:value3; + Map<String, String> properties = Stream.of(input.split(";")).map(line -> line.split(":", 2)) + .collect(Collectors.toMap(entry -> entry[0], entry -> entry[1])); + String friendlyName = properties.get("friendlyName"); + String hostName = properties.get("host_name"); + String ip = properties.get("ip"); + if (StringUtils.isNotBlank(friendlyName) && StringUtils.isNotBlank(hostName) + && StringUtils.isNotBlank(ip) && !responses.contains(hostName)) { + responses.add(hostName); + hubDiscovered(ip, friendlyName, hostName); } } - } catch (IOException e) { + } catch (IOException | IndexOutOfBoundsException e) { if (running) { logger.debug("Error connecting with found hub", e); } } } } - - private Properties readProperties(String input) throws IOException { - String propsString = input.replaceAll(";", "\n"); - propsString = propsString.replaceAll(":", "="); - Properties properties = new Properties(); - properties.load(new StringReader(propsString)); - return properties; - } - } - private void hubDiscovered(Properties properties) { - String ip = properties.getProperty("ip"); - String friendlyName = properties.getProperty("friendlyName"); - String thingId = properties.getProperty("host_name").replaceAll("[^A-Za-z0-9\\-_]", ""); - + private void hubDiscovered(String ip, String friendlyName, String hostName) { + String thingId = hostName.replaceAll("[^A-Za-z0-9\\-_]", ""); logger.trace("Adding HarmonyHub {} ({}) at host {}", friendlyName, thingId, ip); - ThingUID uid = new ThingUID(HARMONY_HUB_THING_TYPE, thingId); // @formatter:off thingDiscovered(DiscoveryResultBuilder.create(uid) diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java index 72ae185042a3c..913453fd26e62 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -85,14 +85,13 @@ public HarmonyDeviceHandler(Thing thing, HarmonyHubHandlerFactory factory) { public void handleCommand(ChannelUID channelUID, Command command) { logger.trace("Handling command '{}' for {}", command, channelUID); - Channel channel = getThing().getChannel(channelUID.getId()); - if (channel == null) { - logger.warn("No such channel: {}", channelUID); + if (command instanceof RefreshType) { + // nothing to refresh return; } - if (command instanceof RefreshType) { - // nothing to refresh + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.debug("Hub is offline, ignoring command {} for channel {}", command, channelUID); return; } diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java index 07938589fbc1a..df3088d537f52 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HarmonyHubHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -95,7 +95,7 @@ public class HarmonyHubHandler extends BaseBridgeHandler implements HarmonyClien public HarmonyHubHandler(Bridge bridge, HarmonyHubHandlerFactory factory) { super(bridge); this.factory = factory; - client = new HarmonyClient(); + client = new HarmonyClient(factory.getHttpClient()); client.addListener(this); } @@ -103,8 +103,8 @@ public HarmonyHubHandler(Bridge bridge, HarmonyHubHandlerFactory factory) { public void handleCommand(ChannelUID channelUID, Command command) { logger.trace("Handling command '{}' for {}", command, channelUID); - if (!client.isConnected()) { - logger.warn("Cannot send command '{}' on {} because HarmonyClient is not connected", command, channelUID); + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.debug("Hub is offline, ignoring command {} for channel {}", command, channelUID); return; } diff --git a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HubStatusListener.java b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HubStatusListener.java index d26c0b6de3b00..80dee05c6987a 100644 --- a/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HubStatusListener.java +++ b/bundles/org.openhab.binding.harmonyhub/src/main/java/org/openhab/binding/harmonyhub/internal/handler/HubStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdanywhere/NOTICE b/bundles/org.openhab.binding.hdanywhere/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.hdanywhere/NOTICE +++ b/bundles/org.openhab.binding.hdanywhere/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.hdanywhere/README.md b/bundles/org.openhab.binding.hdanywhere/README.md index 55b937286f022..8c425eeac55a0 100644 --- a/bundles/org.openhab.binding.hdanywhere/README.md +++ b/bundles/org.openhab.binding.hdanywhere/README.md @@ -1,6 +1,6 @@ # HDanywhere Binding -This binding integrates with [HDanywhere](http://www.hdanywhere.co.uk) HDMI matrices. +This binding integrates with [HDanywhere](https://www.hdanywhere.co.uk) HDMI matrices. HDanywhere is a manufacturer of multiroom/distributed audio/video equipment. This binding supports their V3 of the Multiroom+ HDMI matrix running firmware V1.2(20131222), as well as the newer MHUB series of matrices. diff --git a/bundles/org.openhab.binding.hdanywhere/pom.xml b/bundles/org.openhab.binding.hdanywhere/pom.xml index ce32ecb58a407..89599767f7ccb 100644 --- a/bundles/org.openhab.binding.hdanywhere/pom.xml +++ b/bundles/org.openhab.binding.hdanywhere/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.hdanywhere</artifactId> diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/feature/feature.xml b/bundles/org.openhab.binding.hdanywhere/src/main/feature/feature.xml index 18b0795a126cb..80c7125a05746 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.hdanywhere/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.hdanywhere-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-hdanywhere" description="HDAnywhere Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereBindingConstants.java b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereBindingConstants.java index 0977209b62b3d..5a3b84b0b20b1 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereBindingConstants.java +++ b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereHandlerFactory.java b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereHandlerFactory.java index 3668fcd4cbf9e..ef3ef9978e67c 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereHandlerFactory.java +++ b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/HDanywhereHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java index 5ae963fc6a304..b0b3ab66a0f96 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java +++ b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/Mhub4K431Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -158,7 +158,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { String response = HttpUtil.executeUrl(httpMethod, url, httpHeaders, stream, "application/x-www-form-urlencoded; charset=UTF-8", timeout); } catch (IOException e) { - logger.debug("Communication with device failed: {}", e); + logger.debug("Communication with device failed", e); updateStatus(ThingStatus.OFFLINE); } } diff --git a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/MultiroomPlusHandler.java b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/MultiroomPlusHandler.java index 45337275492b6..d15e0ce78846f 100644 --- a/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/MultiroomPlusHandler.java +++ b/bundles/org.openhab.binding.hdanywhere/src/main/java/org/openhab/binding/hdanywhere/internal/handler/MultiroomPlusHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -127,7 +127,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { try { HttpUtil.executeUrl(httpMethod, url, null, null, null, timeout); } catch (IOException e) { - logger.error("Communication with device failed: {}", e); + logger.error("Communication with device failed", e); } } } diff --git a/bundles/org.openhab.binding.hdpowerview/NOTICE b/bundles/org.openhab.binding.hdpowerview/NOTICE index aca8eebc15b0f..4839ea0985207 100644 --- a/bundles/org.openhab.binding.hdpowerview/NOTICE +++ b/bundles/org.openhab.binding.hdpowerview/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.hdpowerview/README.md b/bundles/org.openhab.binding.hdpowerview/README.md index 9fa4f012d25c0..3d337b08d2451 100644 --- a/bundles/org.openhab.binding.hdpowerview/README.md +++ b/bundles/org.openhab.binding.hdpowerview/README.md @@ -1,6 +1,6 @@ # Hunter Douglas PowerView Binding -This is an openHAB binding for the [Hunter Douglas PowerView Motorized Shades](http://www.hunterdouglas.com/operating-systems/powerview-motorization/support) via the PowerView Hub. +This is an openHAB binding for the [Hunter Douglas PowerView Motorized Shades](https://www.hunterdouglas.com/operating-systems/motorized/powerview-motorization/overview) via the PowerView Hub. PowerView shades have motorization control for their vertical position, as well as vane controls on the shade's slats. Make sure your Shades are visible in the dedicated PowerView app before attempting discovery. @@ -17,7 +17,7 @@ By using a Scene to control multiple shades at once, the shades will all begin m ## Discovery -The PowerView Hub is discovered via a NetBios query. +The PowerView Hub is discovered via a NetBIOS query. This is the same method used by the dedicated PowerView app. After the Hub is added, Shades and Scenes will be discovered by querying the Hub. diff --git a/bundles/org.openhab.binding.hdpowerview/noEmbedDependencies.profile b/bundles/org.openhab.binding.hdpowerview/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.hdpowerview/pom.xml b/bundles/org.openhab.binding.hdpowerview/pom.xml index 09a795405c83c..3b529813b02e7 100644 --- a/bundles/org.openhab.binding.hdpowerview/pom.xml +++ b/bundles/org.openhab.binding.hdpowerview/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.hdpowerview</artifactId> @@ -18,7 +17,7 @@ <groupId>org.samba.jcifs</groupId> <artifactId>jcifs</artifactId> <version>1.3.17</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/feature/feature.xml b/bundles/org.openhab.binding.hdpowerview/src/main/feature/feature.xml index 67468084c2bfa..39c632c82735f 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.hdpowerview/src/main/feature/feature.xml @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.hdpowerview-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-hdpowerview" description="HD PowerView Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true" start-level="80">mvn:org.samba.jcifs/jcifs/1.3.17</bundle> + <bundle dependency="true">mvn:org.samba.jcifs/jcifs/1.3.17</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.hdpowerview/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewBindingConstants.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewBindingConstants.java index a50354908b23a..c6129af9acf85 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewBindingConstants.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewHandlerFactory.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewHandlerFactory.java index 8d0fe1988e40a..364ce3ac558a0 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewHandlerFactory.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewWebTargets.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewWebTargets.java index 08a549c20f873..3bdd8556fb4f5 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewWebTargets.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/HDPowerViewWebTargets.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import java.io.IOException; +import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; @@ -55,7 +56,7 @@ public HDPowerViewWebTargets(Client client, String ipAddress) { gson = new Gson(); } - public Shades getShades() throws IOException { + public Shades getShades() throws JsonParseException, IOException { Response response = invoke(shades.request().buildGet(), shades); if (response != null) { String result = response.readEntity(String.class); @@ -88,18 +89,23 @@ public void activateScene(int sceneId) { invoke(target.request().buildGet(), sceneActivate); } - private Response invoke(Invocation invocation, WebTarget target) { + private Response invoke(Invocation invocation, WebTarget target) throws ProcessingException { Response response; synchronized (this) { response = invocation.invoke(); } - if (response.getStatus() != 200) { - logger.error("Bridge returned {} while invoking {} : {}", response.getStatus(), target.getUri(), + if (response.getStatus() == 423) { + // the hub seems to return a 423 error (resource locked) once per day around midnight + // this is probably some kind of regular re-initialization process, so suppress the error log + logger.debug("Bridge returned '423' while invoking {}", target.getUri()); + return null; + } else if (response.getStatus() != 200) { + logger.warn("Bridge returned '{}' while invoking {} : {}", response.getStatus(), target.getUri(), response.readEntity(String.class)); return null; } else if (!response.hasEntity()) { - logger.error("Bridge returned null response while invoking {}", target.getUri()); + logger.warn("Bridge returned null response while invoking {}", target.getUri()); return null; } diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePosition.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePosition.java index 8bbea22c9783d..fe24659dfb761 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePosition.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePosition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePositionKind.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePositionKind.java index de735f5ae9d40..bb8c320822d2f 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePositionKind.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/ShadePositionKind.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeIdPosition.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeIdPosition.java index 01acaf9c66b0e..8f5f9f0cd8c5f 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeIdPosition.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeIdPosition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeMove.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeMove.java index 7da487030fa77..f53671edd2480 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeMove.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/requests/ShadeMove.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Scenes.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Scenes.java index 3566a92553eb9..a1275fdaa5873 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Scenes.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Scenes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Shades.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Shades.java index 48b4f4ab50c63..ee81b646d72fc 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Shades.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/api/responses/Shades.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewHubConfiguration.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewHubConfiguration.java index eb4f36d6609e7..b5ce9c06609d5 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewHubConfiguration.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewHubConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewSceneConfiguration.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewSceneConfiguration.java index 84b3b78c19cc2..d3415b2ee6c9d 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewSceneConfiguration.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewSceneConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewShadeConfiguration.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewShadeConfiguration.java index 7537b58c031aa..5f1819a5ae66c 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewShadeConfiguration.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/config/HDPowerViewShadeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewHubDiscoveryService.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewHubDiscoveryService.java index ff1950e837ecd..c3153dacd5edb 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewHubDiscoveryService.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewHubDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewShadeDiscoveryService.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewShadeDiscoveryService.java index 86d899a5646a2..10fd399001fa2 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewShadeDiscoveryService.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/discovery/HDPowerViewShadeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -78,7 +78,7 @@ private Runnable createScanner() { try { shades = targets.getShades(); } catch (IOException e) { - logger.error("{}", e.getMessage(), e); + logger.warn("Unexpected error: {}", e.getMessage()); stopScan(); return; } diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/AbstractHubbedThingHandler.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/AbstractHubbedThingHandler.java index 9f9b584ed50b9..4991bd1cd6e8d 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/AbstractHubbedThingHandler.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/AbstractHubbedThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java index 714fa3ed592a1..fd5c0d0f918a5 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewHubHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,7 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; @@ -135,16 +136,15 @@ private synchronized void poll() { logger.debug("Polling for state"); pollShades(); pollScenes(); - } catch (IOException e) { - logger.debug("Could not connect to bridge", e); + } catch (JsonParseException e) { + logger.warn("Bridge returned a bad JSON response: {}", e.getMessage()); + } catch (ProcessingException | IOException e) { + logger.warn("Error connecting to bridge: {}", e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, e.getMessage()); - } catch (Exception e) { - logger.warn("Unexpected error connecting to bridge", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } - private void pollShades() throws IOException { + private void pollShades() throws JsonParseException, ProcessingException, IOException { Shades shades = webTargets.getShades(); updateStatus(ThingStatus.ONLINE); if (shades != null) { @@ -169,7 +169,7 @@ private void pollShades() throws IOException { } } - private void pollScenes() throws JsonParseException, IOException { + private void pollScenes() throws JsonParseException, ProcessingException, IOException { Scenes scenes = webTargets.getScenes(); if (scenes != null) { logger.debug("Received {} scenes", scenes.sceneIds.size()); diff --git a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java index d02a9e5d816e0..13789dc465212 100644 --- a/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java +++ b/bundles/org.openhab.binding.hdpowerview/src/main/java/org/openhab/binding/hdpowerview/internal/handler/HDPowerViewShadeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -51,7 +51,6 @@ public HDPowerViewShadeHandler(Thing thing) { @Override public void initialize() { updateStatus(ThingStatus.ONLINE); - getBridgeHandler().pollNow(); } @Override @@ -117,7 +116,7 @@ private void setPosition(ShadePosition position) { try { response = bridge.getWebTargets().moveShade(shadeId, position); } catch (IOException e) { - logger.error("{}", e.getMessage(), e); + logger.warn("Unexpected error: {}", e.getMessage()); return; } if (response != null) { diff --git a/bundles/org.openhab.binding.helios/NOTICE b/bundles/org.openhab.binding.helios/NOTICE index eb6b2effdd63c..2d8cb69d0626c 100644 --- a/bundles/org.openhab.binding.helios/NOTICE +++ b/bundles/org.openhab.binding.helios/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.helios/README.md b/bundles/org.openhab.binding.helios/README.md index a51e1456fdc55..d5213d1b586b6 100644 --- a/bundles/org.openhab.binding.helios/README.md +++ b/bundles/org.openhab.binding.helios/README.md @@ -1,6 +1,6 @@ # Helios Binding -This binding integrates the Heliop door/videophone system (http://www.2n.cz). +This binding integrates the Heliop door/videophone system (https://www.2n.cz). ## Supported Things @@ -42,12 +42,13 @@ In addition, devices running the v2.13 firmware support the following channels a | Channel Type ID | Item Type | Description | |-----------------|-----------|-------------------------------------------------------------------------------| -| audiolooptest | Switch | Initiate a audio loop test | +| audiolooptest | Switch | Initiate an audio loop test | | motion | Switch | Indicates if motion was detected by the videophone | | noise | Switch | Indicates if noise was detected by the videophone | | switchstate | Switch | Indicates the state of an internal switch in the videophone | -For most of the channels a "stamp" channel (of Type DateTime) (e.g. "keypressedstamp") is available and will be updated with the time stamp the relevant event happened on the device. For switchstate, there are as well the switchstateswitch and switchstateoriginator channels indicating the number of the switch that changed state (1 to 4, depending on the hardware configuration) and the source of the switch state change (keypad, DTMF signal,...) +For most of the channels a "stamp" channel (of Type DateTime) (e.g. "keypressedstamp") is available and will be updated with the time stamp the relevant event happened on the device. +For switchstate, there are as well the switchstateswitch and switchstateoriginator channels indicating the number of the switch that changed state (1 to 4, depending on the hardware configuration) and the source of the switch state change (keypad, DTMF signal,...) ## Full Example @@ -77,6 +78,6 @@ when Channel "helios:ipvario221:gate:keypressed" triggered then var actionName = receivedEvent.getEvent() - logInfo("org.openhab","Rule trigger " + actionName) + logInfo("org.openhab","Rule trigger " + actionName) end ``` diff --git a/bundles/org.openhab.binding.helios/noEmbedDependencies.profile b/bundles/org.openhab.binding.helios/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.helios/pom.xml b/bundles/org.openhab.binding.helios/pom.xml index d024f7b8c30e2..da5dc25d09050 100644 --- a/bundles/org.openhab.binding.helios/pom.xml +++ b/bundles/org.openhab.binding.helios/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.helios</artifactId> @@ -18,28 +17,31 @@ <groupId>org.apache.servicemix.specs</groupId> <artifactId>org.apache.servicemix.specs.jaxws-api-2.2</artifactId> <version>2.9.0</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> <version>1.1.3</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.ws.xmlschema</groupId> <artifactId>xmlschema-core</artifactId> <version>2.2.4</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-core</artifactId> - <version>3.1.9</version> - <scope>provided</scope> + <version>3.1.14</version> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.cxf.services.wsn</groupId> <artifactId>cxf-services-wsn-api</artifactId> - <version>3.1.9</version> - <scope>provided</scope> + <version>3.1.14</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.helios/src/main/feature/feature.xml b/bundles/org.openhab.binding.helios/src/main/feature/feature.xml index 9bb892d5f7db8..a5fc54d21faaa 100644 --- a/bundles/org.openhab.binding.helios/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.helios/src/main/feature/feature.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.helios-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-helios" description="Helios Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <bundle dependency="true">mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.4</bundle> <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0</bundle> <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.saaj-api-1.3/2.9.0</bundle> - <bundle dependency="true">mvn:org.apache.cxf/cxf-core/3.1.9</bundle> - <bundle dependency="true">mvn:org.apache.cxf.services.wsn/cxf-services-wsn-api/3.1.9</bundle> + <bundle dependency="true">mvn:org.apache.cxf/cxf-core/3.1.14</bundle> + <bundle dependency="true">mvn:org.apache.cxf.services.wsn/cxf-services-wsn-api/3.1.14</bundle> <bundle dependency="true">mvn:org.apache.felix/org.apache.felix.framework/6.0.2</bundle> <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.helios/${project.version}</bundle> diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosBindingConstants.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosBindingConstants.java index 05ce801f817c9..de2382477fe49 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosBindingConstants.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosHandlerFactory.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosHandlerFactory.java index ee24f3005eda6..26b180a13eedb 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosHandlerFactory.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/HeliosHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler221.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler221.java index a0ecb0b351ad2..df8460b936f59 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler221.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler221.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java index 66820cc55b5c8..8e48eafc5ecb8 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/handler/HeliosHandler27.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTError.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTError.java index c9ccdf5cb7ad0..b59dd97aec8f5 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTError.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTEvent.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTEvent.java index 8db84f4aca681..3da48ec59ab28 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTEvent.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTPort.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTPort.java index d0f8ce6b5024b..2aa412210880e 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTPort.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTPort.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSubscribeResponse.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSubscribeResponse.java index a14a15d2d8059..b7007de537756 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSubscribeResponse.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSubscribeResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSwitch.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSwitch.java index addadb824fc1f..7d0b6693168ee 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSwitch.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSystemInfo.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSystemInfo.java index 463119da90d53..316b699f415bd 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSystemInfo.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/rest/RESTSystemInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPActionHandler.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPActionHandler.java index e9ba43d9f5a66..7416629d0e906 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPActionHandler.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCallStateChanged.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCallStateChanged.java index 13b94b2d0dead..02484053f7d61 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCallStateChanged.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCallStateChanged.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCardEntered.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCardEntered.java index ab4c95e9cfd4e..9d3543d6a0048 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCardEntered.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCardEntered.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCodeEntered.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCodeEntered.java index d49a4c2ead2ac..eaf572cf63f4b 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCodeEntered.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPCodeEntered.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataField.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataField.java index 9a96a34e927bf..d588b9be9721e 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataField.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataFieldAdapter.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataFieldAdapter.java index decee1150d402..169b4179a11d9 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataFieldAdapter.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDataFieldAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDeviceState.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDeviceState.java index 468ceaaf44f40..4199e9296a776 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDeviceState.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPDeviceState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPEvent.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPEvent.java index 1c9e7924aea8a..6273ec14a7859 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPEvent.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPKeyPressed.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPKeyPressed.java index 67e6ccbd02f94..72b11ddd68e42 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPKeyPressed.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPKeyPressed.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPObjectFactory.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPObjectFactory.java index 2e9cc5098f1f4..84977eaf4cfdc 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPObjectFactory.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPObjectFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPSubscriptionActionHandler.java b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPSubscriptionActionHandler.java index c982258151698..392d1b3aa57ea 100644 --- a/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPSubscriptionActionHandler.java +++ b/bundles/org.openhab.binding.helios/src/main/java/org/openhab/binding/helios/internal/ws/soap/SOAPSubscriptionActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.helios/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.helios/src/main/resources/ESH-INF/thing/channel-types.xml index eccf1cd814dab..41fcd8356151d 100644 --- a/bundles/org.openhab.binding.helios/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.helios/src/main/resources/ESH-INF/thing/channel-types.xml @@ -7,13 +7,13 @@ <channel-type id="audiolooptest" advanced="true"> <item-type>Switch</item-type> - <label>Audio loop test</label> + <label>Audio Loop Test</label> <description>Audio loop test result</description> <state readOnly="true" /> </channel-type> <channel-type id="audioloopteststamp"> <item-type>DateTime</item-type> - <label>Audio loop test time</label> + <label>Audio Loop Test Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -42,7 +42,7 @@ </channel-type> <channel-type id="callstatestamp"> <item-type>DateTime</item-type> - <label>Call state time</label> + <label>Call State Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -59,7 +59,7 @@ </channel-type> <channel-type id="cardstamp"> <item-type>DateTime</item-type> - <label>Card detection time</label> + <label>Card Detection Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -76,7 +76,7 @@ </channel-type> <channel-type id="codestamp"> <item-type>DateTime</item-type> - <label>Code entered time</label> + <label>Code Entered Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -92,18 +92,18 @@ </channel-type> <channel-type id="devicestatestamp"> <item-type>DateTime</item-type> - <label>Device state time</label> + <label>Device State Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> <channel-type id="keypressed"> <kind>trigger</kind> - <label>Key pressed</label> + <label>Key Pressed</label> <description>The key pressed, 0, 1, …, 9, *, # for keypad buttons and %1..%54 for call buttons</description> </channel-type> <channel-type id="keypressedstamp"> <item-type>DateTime</item-type> - <label>Key press time</label> + <label>Key Press Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -114,7 +114,7 @@ </channel-type> <channel-type id="keyreleasedstamp"> <item-type>DateTime</item-type> - <label>Key released time</label> + <label>Key Released Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -126,7 +126,7 @@ </channel-type> <channel-type id="motionstamp"> <item-type>DateTime</item-type> - <label>Motion detection time</label> + <label>Motion Detection Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -138,7 +138,7 @@ </channel-type> <channel-type id="noisestamp"> <item-type>DateTime</item-type> - <label>Noise detection time</label> + <label>Noise Detection Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> @@ -167,7 +167,7 @@ </channel-type> <channel-type id="switchstatestamp"> <item-type>DateTime</item-type> - <label>Switch switch time</label> + <label>Switch Switch Time</label> <description>Event date and time in CCYY-MM-DDThh:mm:ss format</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.heos/.classpath b/bundles/org.openhab.binding.heos/.classpath index 39abf1c5e9102..a5d95095ccaaf 100644 --- a/bundles/org.openhab.binding.heos/.classpath +++ b/bundles/org.openhab.binding.heos/.classpath @@ -28,22 +28,5 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="src" path="target/generated-sources/annotations"> - <attributes> - <attribute name="optional" value="true"/> - <attribute name="maven.pomderived" value="true"/> - <attribute name="ignore_optional_problems" value="true"/> - <attribute name="m2e-apt" value="true"/> - </attributes> - </classpathentry> - <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> - <attributes> - <attribute name="optional" value="true"/> - <attribute name="maven.pomderived" value="true"/> - <attribute name="ignore_optional_problems" value="true"/> - <attribute name="m2e-apt" value="true"/> - <attribute name="test" value="true"/> - </attributes> - </classpathentry> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.heos/NOTICE b/bundles/org.openhab.binding.heos/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.heos/NOTICE +++ b/bundles/org.openhab.binding.heos/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.heos/pom.xml b/bundles/org.openhab.binding.heos/pom.xml index b5e8a2b858990..d4d51aa1343e4 100644 --- a/bundles/org.openhab.binding.heos/pom.xml +++ b/bundles/org.openhab.binding.heos/pom.xml @@ -1,25 +1,15 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.heos</artifactId> <name>openHAB Add-ons :: Bundles :: Heos Binding</name> - <dependencies> - <dependency> - <groupId>commons-net</groupId> - <artifactId>commons-net</artifactId> - <version>3.6</version> - <scope>provided</scope> - </dependency> - </dependencies> - </project> diff --git a/bundles/org.openhab.binding.heos/src/main/feature/feature.xml b/bundles/org.openhab.binding.heos/src/main/feature/feature.xml index 36f3dbea5269e..aa85ee085b7ce 100644 --- a/bundles/org.openhab.binding.heos/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.heos/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.heos-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-heos" description="Heos Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/HeosBindingConstants.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/HeosBindingConstants.java index 52aeb5d2b7106..1d12f48c483fe 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/HeosBindingConstants.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/HeosBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java index d05351896b0c3..f931c547f34cd 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,7 @@ package org.openhab.binding.heos.handler; import static org.openhab.binding.heos.HeosBindingConstants.*; -//import static org.openhab.binding.heos.internal.resources.HeosConstants.*; +import static org.openhab.binding.heos.internal.resources.HeosConstants.*; import java.util.ArrayList; import java.util.HashMap; @@ -124,7 +124,8 @@ private void scheduledStartUp() { updateStatus(ThingStatus.ONLINE); } else { logger.debug("Can't log in. Username or password not set."); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Can't log in. Username or password not set."); + updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING, + " Username or password not set or incorrect. Please Log-In to enable all HEOS features"); } }, 5, TimeUnit.SECONDS); } @@ -301,14 +302,12 @@ public void bridgeChangeEvent(String event, String result, String command) { if (SUCCESS.equals(result)) { if (!loggedIn) { loggedIn = true; - addFavorites(); addPlaylists(); } } } else if (USER_CHANGED.equals(command)) { if (!loggedIn) { loggedIn = true; - addFavorites(); addPlaylists(); } } @@ -322,13 +321,6 @@ public void addPlaylists() { } } - public void addFavorites() { - if (loggedIn) { - logger.debug("Adding HEOS Favorite Channels"); - updateThingChannels(channelManager.addFavoriteChannels(heos.getFavorites())); - } - } - /** * Create a channel for the childThing. Depending if it is a HEOS Group * or a player an identification prefix is added @@ -434,4 +426,8 @@ private void triggerPlayerDiscovery() { public boolean isLoggedin() { return loggedIn; } + + public boolean isBridgeConnected() { + return bridgeIsConnected; + } } diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosGroupHandler.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosGroupHandler.java index ed435420e3109..e3d1ab30ae099 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosGroupHandler.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosGroupHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosPlayerHandler.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosPlayerHandler.java index fc1406d08731a..ba702bbae14fa 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosPlayerHandler.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosPlayerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosThingBaseHandler.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosThingBaseHandler.java index 5fd233d2f22ff..b6d67caf9d2d3 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosThingBaseHandler.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/handler/HeosThingBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelHandlerFactory.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelHandlerFactory.java index c7da00e4a392d..bbca4678fed31 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelHandlerFactory.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelManager.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelManager.java index e0ec865790c75..7865af22af211 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelManager.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosChannelManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosHandlerFactory.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosHandlerFactory.java index b7691ad7513bd..8dd0df736e1cb 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosHandlerFactory.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/HeosHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosAudioSink.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosAudioSink.java index 1991e99402d0b..68f7f9c3f32b7 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosAudioSink.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosEventController.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosEventController.java index 55dae2a29ba58..b96af8f1cb69b 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosEventController.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosEventController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosFacade.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosFacade.java index 88d0c97d3a324..a1f851718a80c 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosFacade.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosFacade.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosSystem.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosSystem.java index 1de03127d311f..eccff3b48ac83 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosSystem.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/api/HeosSystem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosDiscoveryParticipant.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosDiscoveryParticipant.java index a48836074ec9c..2aa79027b0a59 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscovery.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscovery.java index 30112037d1d6e..adac78967d6f1 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscovery.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -63,6 +63,10 @@ public Set<ThingTypeUID> getSupportedThingTypes() { @Override protected void startScan() { + if (!bridge.isBridgeConnected()) { + logger.debug("Scan for Players not possible. HEOS Bridge is not connected"); + return; + } logger.debug("Start scan for HEOS Player"); Map<String, HeosPlayer> playerMap = new HashMap<>(); diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscoveryListener.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscoveryListener.java index d004abeccc4c9..096dcdabfb7f9 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscoveryListener.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/discovery/HeosPlayerDiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandler.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandler.java index 1fb4fe91dd103..1eeaa4028c496 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandler.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerAlbum.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerAlbum.java index cdff80d1c2f90..f588f6b94d5f4 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerAlbum.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerAlbum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerArtist.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerArtist.java index 95df027201218..4ba79984ab8ba 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerArtist.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerArtist.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerBuildGroup.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerBuildGroup.java index b6c826efd842d..b061c144f27e3 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerBuildGroup.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerBuildGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerControl.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerControl.java index b37c466305b85..96e9bb1996270 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerControl.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCover.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCover.java index 6c05d650ac270..1bd771c1f5ccd 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCover.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCover.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCurrentPosition.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCurrentPosition.java index d7c6909423d55..71fd942f8e07a 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCurrentPosition.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerCurrentPosition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerDuration.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerDuration.java index bb75f0b7c62e5..6bd33b9f67fcc 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerDuration.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerDuration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerFavoriteSelect.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerFavoriteSelect.java index 1609fe08f411a..4258290787d08 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerFavoriteSelect.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerFavoriteSelect.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerGrouping.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerGrouping.java index ce4cb2a7a46a6..2cae780c32e00 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerGrouping.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerGrouping.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerInputs.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerInputs.java index 52f404c3cccd0..2438029ae6ab6 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerInputs.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerInputs.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerMute.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerMute.java index 63433f2289830..e16894d8a1ad0 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerMute.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerMute.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayURL.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayURL.java index 8425685930cfc..9a983ede9fc9a 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayURL.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayURL.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayerSelect.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayerSelect.java index e8a8184a4c04d..7adef1740759f 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayerSelect.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlayerSelect.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlaylist.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlaylist.java index 1e1bfe9b6c5bb..83e647c7d632c 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlaylist.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerPlaylist.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRawCommand.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRawCommand.java index 22009e8f0181f..199801ab774ad 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRawCommand.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRawCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerReboot.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerReboot.java index 5e80bf732f96b..664b84dd65c28 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerReboot.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerReboot.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRepeatMode.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRepeatMode.java index 2fdb5ca8ce7e5..9aafa5e0c65fe 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRepeatMode.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerRepeatMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerShuffleMode.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerShuffleMode.java index 6aef033b70f09..2bbf8c2717331 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerShuffleMode.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerShuffleMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerStation.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerStation.java index b1e344bf969f1..622c85eb2e308 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerStation.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerStation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerTitle.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerTitle.java index 877eba53084dd..cfcd92df6c60f 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerTitle.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerTitle.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerType.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerType.java index 2c2da0de1241a..b3b11c7dbeac7 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerType.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerVolume.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerVolume.java index fb4b05c704e95..2387acf2ec6b9 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerVolume.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/handler/HeosChannelHandlerVolume.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosCommands.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosCommands.java index 380100a43803b..40cf2bb1ae053 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosCommands.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosCommands.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosConstants.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosConstants.java index 9f640b1a01982..14a508ab7b8ff 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosConstants.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerEvent.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerEvent.java index f2cd86cc9dcee..c50db9df2f9ec 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerEvent.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerPayload.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerPayload.java index 25cebeeeda2e1..e311c3608a5ef 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerPayload.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosDeserializerPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosEventListener.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosEventListener.java index 7a068315e30d9..aaade980bf9e0 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosEventListener.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosGroup.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosGroup.java index 56e050cd96a81..5edec9465e8cd 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosGroup.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosJsonParser.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosJsonParser.java index 985c1da57a3bf..be60dcfd33978 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosJsonParser.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosJsonParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosMediaObject.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosMediaObject.java index 9a211fe80ce81..6d3809eab99f4 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosMediaObject.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosMediaObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosPlayer.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosPlayer.java index a2cdcaa66b3b8..9cb8f3b37fad2 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosPlayer.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosPlayer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponse.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponse.java index 17d1086ce0c49..235e49dc998d2 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponse.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseDecoder.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseDecoder.java index 50dbf72dc4c12..61176c1ad3f74 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseDecoder.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseDecoder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseEvent.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseEvent.java index 4d525d3a60578..5cd37fcbdbe68 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseEvent.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponseEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponsePayload.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponsePayload.java index 5515b64ace7f3..83ec518224748 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponsePayload.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosResponsePayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSendCommand.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSendCommand.java index 8b07c81cef941..5693ed10968cb 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSendCommand.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSendCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosStringPropertyChangeListener.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosStringPropertyChangeListener.java index 99968ea52e6e4..66d184267744f 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosStringPropertyChangeListener.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosStringPropertyChangeListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSystemEventListener.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSystemEventListener.java index 471065b6d68a3..5c5b63c626ecd 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSystemEventListener.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/HeosSystemEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/Telnet.java b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/Telnet.java index 50b5ca9c6d0b5..0ac8ed803861f 100644 --- a/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/Telnet.java +++ b/bundles/org.openhab.binding.heos/src/main/java/org/openhab/binding/heos/internal/resources/Telnet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/Channels.xml b/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/Channels.xml index a5bdf2133e30e..a69173e84101c 100644 --- a/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/Channels.xml +++ b/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/Channels.xml @@ -36,14 +36,14 @@ </channel-type> <channel-type id="currentPosition" advanced="true"> <item-type>Number:Time</item-type> - <label>Track position</label> + <label>Track Position</label> <description>The current track position</description> <category>Time</category> <state readOnly="true" pattern="%.0f"></state> </channel-type> <channel-type id="duration" advanced="true"> <item-type>Number:Time</item-type> - <label>Track duration</label> + <label>Track Duration</label> <description>The overall duration of the track</description> <category>Time</category> <state readOnly="true" pattern="%.0f"></state> diff --git a/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/HeosGroup.xml b/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/HeosGroup.xml index c146b8a25d041..fbceb78309009 100644 --- a/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/HeosGroup.xml +++ b/bundles/org.openhab.binding.heos/src/main/resources/ESH-INF/thing/HeosGroup.xml @@ -31,7 +31,7 @@ </channels> <config-description> <parameter name="members" type="text" readOnly="false"> - <label>The group member player IDs</label> + <label>The Group Member Player IDs</label> <description>Shows the single player IDs of the members of this group</description> <required>true</required> </parameter> diff --git a/bundles/org.openhab.binding.homematic/NOTICE b/bundles/org.openhab.binding.homematic/NOTICE index 8bb2b3be3f1c3..4205fa3237046 100644 --- a/bundles/org.openhab.binding.homematic/NOTICE +++ b/bundles/org.openhab.binding.homematic/NOTICE @@ -10,5 +10,5 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.homematic/README.md b/bundles/org.openhab.binding.homematic/README.md index c87cfae59dc14..3fb26bb086ef6 100644 --- a/bundles/org.openhab.binding.homematic/README.md +++ b/bundles/org.openhab.binding.homematic/README.md @@ -1,6 +1,6 @@ # Homematic Binding -This is the binding for the [eQ-3 Homematic Solution](http://www.eq-3.de/). +This is the binding for the [eQ-3 Homematic Solution](https://eq-3.de/). This binding allows you to integrate, view, control and configure all Homematic devices in openHAB. ## Configuration of the CCU @@ -10,19 +10,19 @@ The CCU has to be configured to have "XML-RPC" set to "Full Access" or "Restrict Also the "Remote Homematic-Script API" has to be set to "Full Access" or "Restricted access". When the option "Restricted access" is used, some ports have to be added to the "Port opening" list. -´´´ +``` 2000; 2001; 2010; 8701; 9292; -´´´ +``` Also the IP of the device running openHAB has to be set to the list of "IP addresses for restricted access". Also under `Home page > Settings > Control panel` with the menu `Security` the option `Authentication` has to be disabled as the binding does not support the configuration of `username` and `password`for the XML-RPC API. -If this is not done the binding won't be able to connect to the CCU and the CCU Thing will stay uninitialized and sets a timeout exception: +If this is not done the binding will not be able to connect to the CCU and the CCU Thing will stay uninitialized and sets a timeout exception: ``` xxx-xx-xx xx:xx:xx.xxx [hingStatusInfoChangedEvent] - - 'homematic:bridge:xxx' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect Timeout @@ -34,15 +34,16 @@ All gateways which provides the Homematic BIN- or XML-RPC API: - CCU 1, 2 and 3 - [RaspberryMatic](https://github.com/jens-maus/RaspberryMatic) -- [Homegear](https://www.homegear.eu) (>= 0.8.0-1988) +- [Homegear](https://homegear.eu) (>= 0.8.0-1988) - [piVCCU](https://github.com/alexreinert/piVCCU) - [YAHM](https://github.com/leonsio/YAHM) -- [Windows BidCos service](http://www.eq-3.de/downloads.html?kat=download&id=125) +- [Windows BidCos service](https://eq-3.de/service/downloads.html?kat=download&id=125) (included in "LAN Usersoftware" download) - [OCCU](https://github.com/eq-3/occu) The Homematic IP Access Point **does not support** this API and and can't be used with this binding. Homematic IP support: + - CCU2 with at least firmware 2.17.15 - [RaspberryMatic](https://github.com/jens-maus/RaspberryMatic) with the [HM-MOD-RPI-PCB](https://www.elv.de/homematic-funkmodul-fuer-raspberry-pi-bausatz.html) or [RPI-RF-MOD](https://www.elv.de/homematic-funk-modulplatine-fuer-raspberry-pi-3-rpi-rf-mod-komplettbausatz.html) RF module - [piVCCU](https://github.com/alexreinert/piVCCU) @@ -63,6 +64,7 @@ And **FROM** the gateway to the binding: - BIN-RPC: 9126 CCU Autodiscovery: + * UDP 43439 **Note:** The binding tries to identify the gateway with XML-RPC and uses henceforth: @@ -89,6 +91,7 @@ With Homegear or a CCU, variables and scripts are supported too. ## Discovery Gateway discovery is available: + * CCU * RaspberryMatic >= 2.29.23.20171022 * Homegear >= 0.6.x @@ -104,11 +107,15 @@ The difference is, that variables, scripts and device names are not supported, e ### Automatic install mode during discovery -Besides discovering devices that are already known by the gateway, it may be desired to connect new devices to your system - which requires your gateway to be in install mode. Starting the binding's DiscoveryService will automatically put your gateway(s) in install mode for a specified period of time (see installModeDuration). +Besides discovering devices that are already known by the gateway, it may be desired to connect new devices to your system - which requires your gateway to be in install mode. +Starting the binding's DiscoveryService will automatically put your gateway(s) in install mode for a specified period of time (see installModeDuration). -**Note:** Enabling / disabling of install mode is also available via GATEWAY_EXTRAS. You may use this if you prefer. +**Note:** Enabling / disabling of install mode is also available via GATEWAY-EXTRAS. +You may use this if you prefer. -**Exception:** If a gateway is not ONLINE, the install mode will not be set automatically. _For instance during initialization of the binding its DiscoveryService is started and will discover devices that are already connected. However, the install mode is not automatically enabled in this situation because the gateway is in the status INITIALIZING._ +**Exception:** If a gateway is not ONLINE, the install mode will not be set automatically. +For instance during initialization of the binding its DiscoveryService is started and will discover devices that are already connected. +However, the install mode is not automatically enabled in this situation because the gateway is in the status INITIALIZING. ## Bridge Configuration @@ -118,15 +125,15 @@ There are several settings for a bridge: Network address of the Homematic gateway - **gatewayType** -Hint for the binding to identify the gateway type (auto|ccu|noccu) (default = auto). +Hint for the binding to identify the gateway type (auto|ccu|noccu) (default = "auto"). - **callbackHost** Callback network address of the system runtime, default is auto-discovery - **bindAddress** -The address the XML-/BINRPC server binds to, default is callbackHost +The address the XML-/BINRPC server binds to, default is value of "callbackHost" -- **callbackPort DEPRECATED, use binCallbackPort and xmlCallbackPort** +- **callbackPort** (DEPRECATED, use "binCallbackPort" resp. "xmlCallbackPort") Callback port of the binding's server, default is 9125 and counts up for each additional bridge - **xmlCallbackPort** @@ -135,13 +142,13 @@ Callback port of the binding's XML-RPC server, default is 9125 and counts up for - **binCallbackPort** Callback port of the binding's BIN-RPC server, default is 9126 and counts up for each additional bridge -- **aliveInterval DEPRECATED, not necessary anymore** +- **aliveInterval** (DEPRECATED, not necessary anymore) The interval in seconds to check if the communication with the Homematic gateway is still alive. If no message receives from the Homematic gateway, the RPC server restarts (default = 300) -- **reconnectInterval DEPRECATED, not necessary anymore** -The interval in seconds to force a reconnect to the Homematic gateway, disables aliveInterval! (0 = disabled, default = disabled). -If you have no sensors which sends messages in regular intervals and/or you have low communication, the aliveInterval may restart the connection to the Homematic gateway to often. -The reconnectInterval disables the aliveInterval and reconnects after a fixed period of time. +- **reconnectInterval** (DEPRECATED, not necessary anymore) +The interval in seconds to force a reconnect to the Homematic gateway, disables "aliveInterval"! (0 = disabled, default = disabled). +If you have no sensors which sends messages in regular intervals and/or you have low communication, the "aliveInterval" may restart the connection to the Homematic gateway to often. +The "reconnectInterval" disables the "aliveInterval" and reconnects after a fixed period of time. Think in hours when configuring (one hour = 3600) - **timeout** @@ -188,19 +195,19 @@ homematic:bridge:NAME ### Example -- minimum configuration +**Minimum configuration** ```java Bridge homematic:bridge:ccu [ gatewayAddress="..."] ``` -- with callback settings +**With callback settings** ```java Bridge homematic:bridge:ccu [ gatewayAddress="...", callbackHost="...", callbackPort=... ] ``` -- multiple bridges +**Multiple bridges** ```java Bridge homematic:bridge:lxccu [ gatewayAddress="..."] @@ -221,8 +228,8 @@ Bridge homematic:bridge:ccu [ gatewayAddress="..." ] ``` The first parameter after Thing is the device type, the second the serial number. -If you are using Homegear, you have to add the prefix ```HG-``` for each type. -The ```HG-``` prefix is only needed for Things, not for Items or channel configs. +If you are using Homegear, you have to add the prefix `HG-` for each type. +The `HG-` prefix is only needed for Things, not for Items or channel configs. This is necessary, because the Homegear devices supports more datapoints than Homematic devices. ```java @@ -230,7 +237,7 @@ This is necessary, because the Homegear devices supports more datapoints than Ho ``` As additional parameters you can define a name and a location for each thing. -The Name will be used to identify the Thing in the Paper UI lists, the Location will be used in the Control section of PaperUI to sort the things. +The `Name` will be used to identify the thing in the Paper UI lists, the `Location` will be used in the Control section of PaperUI to sort the things. ```java Thing HG-HM-LC-Dim1T-Pl-2 JEQ0999999 "Name" @ "Location" @@ -241,9 +248,9 @@ All channels have two configs: - **delay**: delays transmission of a command **to** the Homematic gateway, duplicate commands are filtered out - **receiveDelay**: delays a received event **from** the Homematic gateway, duplicate events are filtered out (OH 2.2) -The receiveDelay is handy for dimmers and rollershutters for example. +The `receiveDelay` is handy for dimmers and rollershutters for example. If you have a slider in a UI and you move this slider to a new position, it jumps around because the gateway sends multiple events with different positions until the final has been reached. -If you set the ```receiveDelay``` to some seconds, these events are filtered out and only the last position is distributed to the binding. +If you set the `receiveDelay` to some seconds, these events are filtered out and only the last position is distributed to the binding. The disadvantage is of course, that all events for this channel are delayed. ```java @@ -256,11 +263,13 @@ The disadvantage is of course, that all events for this channel are delayed. } ``` -The Type is the device type, channel number and lowercase channel name separated with a underscore. -Note that, for Homegear devices, in contrast to the specification of the Thing above no ```HG-``` prefix is needed for the specification of the Type of the Channel. +The `Type` is the device type, channel number and lowercase channel name separated with an underscore. +Note that, for Homegear devices, in contrast to the specification of the Rhing above no `HG-` prefix is needed for the specification of the Type of the Channel. The channel configs are optional. + Example without channel configs + ```java Thing HM-LC-Dim1T-Pl-2 JEQ0999999 "Name" @ "Location" { Channels: @@ -288,7 +297,7 @@ Switch RC_1 "Remote Control Button 1" { channel="homematic:HM-RC-19-B:ccu:KEQ0 Dimmer Light "Light [%d %%]" { channel="homematic:HM-LC-Dim1T-Pl-2:ccu:JEQ0555555:1#LEVEL" } ``` -**Note:** don't forget to add the ```HG-``` type prefix for Homegear devices +**Note:** don't forget to add the `HG-` type prefix for Homegear devices ## Virtual device and datapoints @@ -300,7 +309,8 @@ Virtual datapoints are generated by the binding and provides special functionali The GATEWAY-EXTRAS is a virtual device which contains a switch to reload all values from all devices and also a switch to put the gateway in the install mode to add new devices. If the gateway supports variables and scripts, you can handle them with this device too. The type is generated: GATEWAY-EXTRAS-[BRIDGE_ID]. -Example: bridgeId=ccu, type=GATEWAY-EXTRAS-CCU + +**Example:** bridgeId=ccu, type=GATEWAY-EXTRAS-CCU Address: fixed GWE00000000 ### RELOAD_ALL_FROM_GATEWAY @@ -309,7 +319,7 @@ A virtual datapoint (Switch) to reload all values for all devices, available in ### RELOAD_RSSI -A virtual datapoint (Switch) to reload all rssi values for all devices, available in channel 0 in GATEWAY-EXTRAS +A virtual datapoint (Switch) to reload all RSSI values for all devices, available in channel 0 in GATEWAY-EXTRAS ### RSSI @@ -341,7 +351,7 @@ A virtual datapoint (Enum) to configure the device deletion with DELETE_MODE, av ### ON_TIME_AUTOMATIC A virtual datapoint (Number) to automatically set the ON_TIME datapoint before the STATE or LEVEL datapoint is sent to the gateway, available for all devices which supports the ON_TIME datapoint. -This is usefull to automatically turn off the datapoint after the specified time. +This is useful to automatically turn off the datapoint after the specified time. ### DISPLAY_OPTIONS @@ -367,25 +377,25 @@ Assumed you mapped the virtual datapoint to a String item called Display_Options String Display_Options "Display_Options" { channel="homematic:HM-RC-19-B:ccu:KEQ0099999:18#DISPLAY_OPTIONS" } ``` -show message TEST: +show message "TEST": ```shell smarthome send Display_Options "TEST" ``` -show message TEXT, beep once and turn backlight on: +show message "TEXT", beep once and turn backlight on: ```shell smarthome send Display_Options "TEXT, TONE1, BACKLIGHT_ON" ``` -show message 15, beep once, turn backlight on and shows the celsius unit: +show message "15", beep once, turn backlight on and shows the celsius unit: ```shell smarthome send Display_Options "15, TONE1, BACKLIGHT_ON, CELSIUS" ``` -show message ALARM, beep three times, let the backlight blink fast and shows a bell symbol: +show message "ALARM", beep three times, let the backlight blink fast and shows a bell symbol: ```shell smarthome send Display_Options "ALARM, TONE3, BLINK_FAST, BELL" @@ -403,9 +413,11 @@ Adds multiple virtual datapoints to the HM-Dis-WM55 and HM-Dis-EP-WM55 devices t **Note:** The HM-Dis-EP-WM55 has only a black and white display and therefore does not support datapoints for colored lines. In addition, only lines 1-3 can be set. -Example: Display text at line 1,3 and 5 when the bottom button on the display is pressed +#### Example #### + +Display text at line 1,3 and 5 when the bottom button on the display is pressed -- Items +**Items** ```java String Display_line_1 "Line 1" { channel="homematic:HM-Dis-WM55:ccu:NEQ0123456:1#DISPLAY_LINE_1" } @@ -424,7 +436,7 @@ Switch Button_bottom "Button" { channel="homematic:HM-Dis-WM55:ccu:NEQ0123 Switch Display_submit "Submit" { channel="homematic:HM-Dis-WM55:ccu:NEQ0123456:1#DISPLAY_SUBMIT" } ``` -- Rule +**Rule** ```javascript rule "Display Test" @@ -450,12 +462,14 @@ end ### BUTTON A virtual datapoint (String) to simulate a key press, available on all channels that contains PRESS_ datapoints. + Available values: + * `SHORT_PRESS`: triggered on a short key press * `LONG_PRESS`: triggered on a key press longer than `LONG_PRESS_TIME` (variable configuration per key, default is 0.4 s) * `DOUBLE_PRESS`: triggered on a short key press but only if the latest `SHORT_PRESS` or `DOUBLE_PRESS` event is not older than 2.0 s (not related to `DBL_PRESS_TIME` configuration, which is more like a key lock because if it is other than `0.0` single presses are not notified anymore) -Example: to capture a short key press on the 19 button remote control in a rule +**Example:** to capture a short key press on the 19 button remote control in a rule ```javascript rule "example trigger rule" @@ -466,7 +480,6 @@ then end ``` - ## Troubleshooting **SHORT & LONG_PRESS events of push buttons do not occur on the event bus** @@ -486,10 +499,12 @@ If you can't disable security try to use key INSTALL_TEST which gets updated to **-1 Failure** A device may return this failure while fetching the datapoint values. -I've tested pretty much but i did not found the reason. The HM-ES-TX-WM device for example always returns this failure, it's impossible with the current CCU2 firmware (2.17.15) to fetch the values. -I've implemented two workarounds, if a device returns the failure, workaround one is executed, if the device still returns the failure, workaround two is executed. -This always works in my tests, but you may see a OFFLINE, ONLINE cycle for the device. -Fetching values is only done at startup or if you trigger a REFRESH. I hope this will be fixed in one of the next CCU firmwares. +I have tested pretty much but I did not find the reason. +The HM-ES-TX-WM device for example always returns this failure, it is impossible with the current CCU2 firmware (2.17.15) to fetch the values. +I have implemented two workarounds, if a device returns the failure, workaround one is executed, if the device still returns the failure, workaround two is executed. +This always works in my tests, but you may see an OFFLINE, ONLINE cycle for the device. +Fetching values is only done at startup or if you trigger a REFRESH. +I hope this will be fixed in one of the next CCU firmwares. With [Homegear](https://www.homegear.eu) everything works as expected. **No variables and scripts in GATEWAY-EXTRAS** @@ -499,10 +514,10 @@ Use the ```gatewayType=ccu``` config to force the binding to use the CCU impleme **Variables out of sync** -The CCU only sends a event if a datapoint of a device has changed. -There is (currently) no way to receive a event automatically when a variable has changed. +The CCU only sends an event if a datapoint of a device has changed. +There is (currently) no way to receive an event automatically when a variable has changed. To reload all variable values, send a REFRESH command to any variable. -e.g you have a item linked to a variable with the name Var_1 +e.g you have an item linked to a variable with the name Var_1 In the console: ```shell @@ -517,7 +532,8 @@ import org.eclipse.smarthome.core.types.RefreshType Var_1.sendCommand(RefreshType.REFRESH) ``` -**Note:** adding new and removing deleted variables from the GATEWAY-EXTRAS Thing is currently not supported. You have to delete the Thing, start a scan and add it again. +**Note:** adding new and removing deleted variables from the GATEWAY-EXTRAS Thing is currently not supported. +You have to delete the Thing, start a scan and add it again. ### Debugging and Tracing @@ -539,7 +555,7 @@ Set the logging back to normal log:set INFO org.openhab.binding.homematic ``` -To identify problems, i need a full startup TRACE log +To identify problems, a full startup TRACE log will be needed: ```shell stop org.openhab.binding.homematic diff --git a/bundles/org.openhab.binding.homematic/pom.xml b/bundles/org.openhab.binding.homematic/pom.xml index db1c77a41309a..5593e6760328a 100644 --- a/bundles/org.openhab.binding.homematic/pom.xml +++ b/bundles/org.openhab.binding.homematic/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.homematic</artifactId> diff --git a/bundles/org.openhab.binding.homematic/src/main/feature/feature.xml b/bundles/org.openhab.binding.homematic/src/main/feature/feature.xml index 1f1d68b7294b1..3ad5dd134c26e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.homematic/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.homematic-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-homematic" description="Homematic Binding" version="${project.version}"> <feature>openhab-transport-upnp</feature> diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/HomematicBindingConstants.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/HomematicBindingConstants.java index 8f863e0082228..870bec74486aa 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/HomematicBindingConstants.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/HomematicBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/HomematicConfig.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/HomematicConfig.java index dd36bcb07f043..10fb572ca5e58 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/HomematicConfig.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/common/HomematicConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/AbstractHomematicGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/AbstractHomematicGateway.java index dcde5649c8c77..b52e87a82a2ba 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/AbstractHomematicGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/AbstractHomematicGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/CcuGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/CcuGateway.java index c1dfd5785eb2b..f5068d8ae13ea 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/CcuGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/CcuGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/DefaultGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/DefaultGateway.java index adcbe1ad653a8..cf1ae7dc20752 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/DefaultGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/DefaultGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomegearGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomegearGateway.java index 25a549e6e2d9f..a31c78d56e423 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomegearGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomegearGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGateway.java index fff74c3a2f0c3..48934a45c5df3 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,7 +14,6 @@ import java.io.IOException; -import org.openhab.binding.homematic.internal.HomematicBindingConstants; import org.openhab.binding.homematic.internal.misc.HomematicClientException; import org.openhab.binding.homematic.internal.model.HmChannel; import org.openhab.binding.homematic.internal.model.HmDatapoint; diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayAdapter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayAdapter.java index 73313640d6f15..1fcf4e13c8556 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayAdapter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayFactory.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayFactory.java index 638f6eb9adc06..afb4f6be8dc18 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayFactory.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/HomematicGatewayFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/BinRpcClient.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/BinRpcClient.java index 866d107d2579b..474ddc45143f0 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/BinRpcClient.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/BinRpcClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/RpcClient.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/RpcClient.java index 4e7d6aa304996..8a5deeaad214d 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/RpcClient.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/RpcClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -176,7 +176,6 @@ public void addChannelDatapoints(HmChannel channel, HmParamsetType paramsetType) // The configuration channel only has a MASTER Paramset, so there is nothing to load return; } - RpcRequest<T> request = createRpcRequest("getParamsetDescription"); request.addArg(getRpcAddress(channel.getDevice().getAddress()) + getChannelSuffix(channel)); request.addArg(paramsetType.toString()); @@ -327,7 +326,7 @@ public void setDatapointValue(HmDatapoint dp, Object value, String rxMode) throw request = createRpcRequest("putParamset"); request.addArg(getRpcAddress(dp.getChannel().getDevice().getAddress()) + getChannelSuffix(dp.getChannel())); request.addArg(HmParamsetType.MASTER.toString()); - Map<String, Object> paramSet = new HashMap<String, Object>(); + Map<String, Object> paramSet = new HashMap<>(); paramSet.put(dp.getName(), value); request.addArg(paramSet); configureRxMode(request, rxMode); diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketHandler.java index 54e682b61f3a2..ca71cdd876d7c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketInfo.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketInfo.java index 90f3c5f316e06..58228060217a7 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketInfo.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/SocketInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/TransferMode.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/TransferMode.java index 295bd1a677da1..2716dd3b29f2a 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/TransferMode.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/TransferMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownParameterSetException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownParameterSetException.java index 5c505a903364e..f34b7488861eb 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownParameterSetException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownParameterSetException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownRpcFailureException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownRpcFailureException.java index 3179771fece50..1e6a850dd880d 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownRpcFailureException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/UnknownRpcFailureException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/XmlRpcClient.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/XmlRpcClient.java index d288ee4e10e13..4a4ec3b659e6a 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/XmlRpcClient.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/client/XmlRpcClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/BinRpcMessage.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/BinRpcMessage.java index 01d79122f4a3a..be99a87716bfb 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/BinRpcMessage.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/BinRpcMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -93,9 +93,8 @@ public BinRpcMessage(InputStream is, boolean methodHeader, String encoding) thro offset += currentLength; } if (offset != datasize) { - throw new EOFException( - "Only " + offset + " bytes received while reading message payload, expected " + datasize - + " bytes"); + throw new EOFException("Only " + offset + " bytes received while reading message payload, expected " + + datasize + " bytes"); } byte[] message = ArrayUtils.addAll(sig, payload); decodeMessage(message, methodHeader); @@ -137,7 +136,7 @@ public void setType(TYPE type) { private void generateResponseData() throws IOException { offset = 8 + (methodName != null ? methodName.length() + 8 : 0); - List<Object> values = new ArrayList<Object>(); + List<Object> values = new ArrayList<>(); while (offset < binRpcData.length) { values.add(readRpcValue()); } @@ -230,7 +229,7 @@ private Object readRpcValue() throws IOException { case 0x100: // Array int numElements = readInt(); - Collection<Object> array = new ArrayList<Object>(); + Collection<Object> array = new ArrayList<>(); while (numElements-- > 0) { array.add(readRpcValue()); } @@ -238,7 +237,7 @@ private Object readRpcValue() throws IOException { case 0x101: // Struct numElements = readInt(); - Map<String, Object> struct = new TreeMap<String, Object>(); + Map<String, Object> struct = new TreeMap<>(); while (numElements-- > 0) { String name = readString(); struct.put(name, readRpcValue()); diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcRequest.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcRequest.java index 25899aacac8a3..cb1bdfcb8db77 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcRequest.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcResponse.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcResponse.java index 8843ea681b410..0e5d17e924372 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcResponse.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcUtils.java index 227abf284553a..3d9f6928e97fa 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/RpcUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcRequest.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcRequest.java index 6f51194ddddda..665e442a29d67 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcRequest.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcResponse.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcResponse.java index f0d8a925f6257..b08c5f199542b 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcResponse.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/message/XmlRpcResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -73,14 +73,14 @@ public String toString() { * @author Gerhard Riegler */ private class XmlRpcHandler extends DefaultHandler { - private List<Object> result = new ArrayList<Object>(); - private LinkedList<List<Object>> currentDataObject = new LinkedList<List<Object>>(); + private List<Object> result = new ArrayList<>(); + private LinkedList<List<Object>> currentDataObject = new LinkedList<>(); private StringBuilder tagValue; private boolean isValueTag; @Override public void startDocument() throws SAXException { - currentDataObject.addLast(new ArrayList<Object>()); + currentDataObject.addLast(new ArrayList<>()); } @Override @@ -94,7 +94,7 @@ public void startElement(String uri, String localName, String qName, Attributes throws SAXException { String tag = qName.toLowerCase(); if (tag.equals("array") || tag.equals("struct")) { - currentDataObject.addLast(new ArrayList<Object>()); + currentDataObject.addLast(new ArrayList<>()); } isValueTag = tag.equals("value"); tagValue = new StringBuilder(); @@ -133,7 +133,7 @@ public void endElement(String uri, String localName, String qName) throws SAXExc break; case "struct": List<Object> mapData = currentDataObject.removeLast(); - Map<Object, Object> resultMap = new HashMap<Object, Object>(); + Map<Object, Object> resultMap = new HashMap<>(); for (int i = 0; i < mapData.size(); i += 2) { resultMap.put(mapData.get(i), mapData.get(i + 1)); diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuLoadDeviceNamesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuLoadDeviceNamesParser.java index 645b9f5882cf2..3d44a642c1b50 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuLoadDeviceNamesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuLoadDeviceNamesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuParamsetDescriptionParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuParamsetDescriptionParser.java index 49a067e715300..aa1bebd943698 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuParamsetDescriptionParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuParamsetDescriptionParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuValueParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuValueParser.java index b3ad6587274d5..0b511a2b90751 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuValueParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuValueParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuVariablesAndScriptsParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuVariablesAndScriptsParser.java index b00f2195d87f0..5cdb93d81b6e9 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuVariablesAndScriptsParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CcuVariablesAndScriptsParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CommonRpcParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CommonRpcParser.java index bc69c1a7a4162..7ab247af7de3c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CommonRpcParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/CommonRpcParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DeleteDevicesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DeleteDevicesParser.java index cac110e37804a..71bffbdcc8de1 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DeleteDevicesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DeleteDevicesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DisplayOptionsParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DisplayOptionsParser.java index c62abb4c03b29..e5e80b55c6356 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DisplayOptionsParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/DisplayOptionsParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/EventParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/EventParser.java index 23a58fc6a7106..ca2dca82bf07e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/EventParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/EventParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllScriptsParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllScriptsParser.java index eae2591e23bb3..108c2a17950bc 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllScriptsParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllScriptsParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllSystemVariablesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllSystemVariablesParser.java index 3410d35725bb7..366a25af3960b 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllSystemVariablesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetAllSystemVariablesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetDeviceDescriptionParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetDeviceDescriptionParser.java index 9f384f6a3a26e..e37ccd26606d1 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetDeviceDescriptionParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetDeviceDescriptionParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetDescriptionParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetDescriptionParser.java index 857912f3ebec5..7e84f7651e8d3 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetDescriptionParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetDescriptionParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetParser.java index 1e69a94b211ff..03810ea2fea68 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetParamsetParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetValueParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetValueParser.java index e5a803e1875a4..1cecb50b655ef 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetValueParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/GetValueParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/HomegearLoadDeviceNamesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/HomegearLoadDeviceNamesParser.java index 9bde9f026e9c2..598d9e1c2df6e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/HomegearLoadDeviceNamesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/HomegearLoadDeviceNamesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListBidcosInterfacesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListBidcosInterfacesParser.java index 036b98a3154a0..bcd0c411e80fa 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListBidcosInterfacesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListBidcosInterfacesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListDevicesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListDevicesParser.java index 0095f9cfba3a7..b08aa44c0b512 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListDevicesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/ListDevicesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/NewDevicesParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/NewDevicesParser.java index b694d42e3268b..d6a964542c70c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/NewDevicesParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/NewDevicesParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcParser.java index ba3d5d446abee..cd04e66fcb959 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcResponseParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcResponseParser.java index 11ff5b1188b3f..0d202f56450f6 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcResponseParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RpcResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RssiInfoParser.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RssiInfoParser.java index 7d8e94ac81f55..5571f186d3117 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RssiInfoParser.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/parser/RssiInfoParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcNetworkService.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcNetworkService.java index bf9335168f707..34d88ac18701c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcNetworkService.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcNetworkService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcResponseHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcResponseHandler.java index 6fd0ba4c529e7..79d7e0c28b5b5 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcResponseHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcResponseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcServer.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcServer.java index 9d99a26f77c6c..e88d492834f4b 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcServer.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/BinRpcServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcEventListener.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcEventListener.java index e03c6ab09bee6..724828e7db70e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcEventListener.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcResponseHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcResponseHandler.java index 21bd65487a05e..ba4dac17c7bb8 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcResponseHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcResponseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcServer.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcServer.java index 8f71898694287..e54dc019a4d32 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcServer.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/RpcServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/XmlRpcServer.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/XmlRpcServer.java index 79d693e036da0..1b2ebee4ec5d1 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/XmlRpcServer.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/server/XmlRpcServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/AbstractVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/AbstractVirtualDatapointHandler.java index e43a1c0fa0528..98de6118bd5a7 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/AbstractVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/AbstractVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/BatteryTypeVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/BatteryTypeVirtualDatapointHandler.java index df7ec42d50a86..a11eb02fc4f70 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/BatteryTypeVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/BatteryTypeVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonVirtualDatapointHandler.java index 9991945657643..b20308c48d025 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,6 @@ import org.apache.commons.lang.StringUtils; import org.eclipse.smarthome.core.thing.CommonTriggerEvents; -import org.eclipse.smarthome.core.thing.DefaultSystemChannelTypeProvider; import org.openhab.binding.homematic.internal.misc.MiscUtils; import org.openhab.binding.homematic.internal.model.HmChannel; import org.openhab.binding.homematic.internal.model.HmDatapoint; diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceModeVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceModeVirtualDatapointHandler.java index 9fa2d50e2df28..57022326c6645 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceModeVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceModeVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceVirtualDatapointHandler.java index 24e2ae3c78a7f..5c06d8f573dc9 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DeleteDeviceVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayOptionsVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayOptionsVirtualDatapointHandler.java index 5a10e1e79da2e..347f8eb4ca3e5 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayOptionsVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayOptionsVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayTextVirtualDatapoint.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayTextVirtualDatapoint.java index b1e55f6117ea7..3e5d2b7546218 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayTextVirtualDatapoint.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/DisplayTextVirtualDatapoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/FirmwareVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/FirmwareVirtualDatapointHandler.java index 82fa5371b9f7c..6ee0aa06ab6e3 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/FirmwareVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/FirmwareVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/HmwIoModuleVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/HmwIoModuleVirtualDatapointHandler.java index 45d2aeeb1144f..c2edfd4763d6a 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/HmwIoModuleVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/HmwIoModuleVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeDurationVirtualDatapoint.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeDurationVirtualDatapoint.java index f6065f97ce6cd..5d34150fece00 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeDurationVirtualDatapoint.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeDurationVirtualDatapoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeVirtualDatapoint.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeVirtualDatapoint.java index 13c10c855608f..9a1177f5838f0 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeVirtualDatapoint.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/InstallModeVirtualDatapoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/OnTimeAutomaticVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/OnTimeAutomaticVirtualDatapointHandler.java index 001ffe41b24ca..3dbee9142b654 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/OnTimeAutomaticVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/OnTimeAutomaticVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadAllFromGatewayVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadAllFromGatewayVirtualDatapointHandler.java index 5733429755e09..9e2312d46624e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadAllFromGatewayVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadAllFromGatewayVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadFromGatewayVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadFromGatewayVirtualDatapointHandler.java index 6dfd7e42b343c..8e83bd2cc0e68 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadFromGatewayVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadFromGatewayVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadRssiVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadRssiVirtualDatapointHandler.java index eccc035ac0b3c..abaee59bc7492 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadRssiVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/ReloadRssiVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/RssiVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/RssiVirtualDatapointHandler.java index 23642abb5970f..199823a2dab4d 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/RssiVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/RssiVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/SignalStrengthVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/SignalStrengthVirtualDatapointHandler.java index 12e32d349c76a..a5794be6b1bdf 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/SignalStrengthVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/SignalStrengthVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/StateContactVirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/StateContactVirtualDatapointHandler.java index 56468859da69a..1ed0e9febcfc3 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/StateContactVirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/StateContactVirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualDatapointHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualDatapointHandler.java index c3db3a07d2117..75c6b5c78958e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualDatapointHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualDatapointHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualGateway.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualGateway.java index b81396b11382e..7e0c65e103076 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualGateway.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/communicator/virtual/VirtualGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterException.java index 55cb64e0870c3..106f10ba35815 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterFactory.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterFactory.java index 58a6e15a0f506..97c93429a8e64 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterFactory.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -67,7 +67,7 @@ public static TypeConverter<?> createConverter(String itemType) throws Converter converter = converterCache.get(converterClass.getName()); if (converter == null) { try { - converter = converterClass.newInstance(); + converter = converterClass.getConstructor().newInstance(); converterCache.put(converterClass.getName(), converter); } catch (Exception e) { // ignore diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterTypeException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterTypeException.java index 9134462296a7c..d8160049ab523 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterTypeException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/ConverterTypeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/StateInvertInfo.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/StateInvertInfo.java index cba15a7228779..6bc11c4334cad 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/StateInvertInfo.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/StateInvertInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/TypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/TypeConverter.java index 983895fd8f152..75107b1ffba47 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/TypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/TypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/AbstractTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/AbstractTypeConverter.java index cea2c61e88976..69f2cba199882 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/AbstractTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/AbstractTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/DecimalTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/DecimalTypeConverter.java index debb4b33be793..b76625df4c0ba 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/DecimalTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/DecimalTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OnOffTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OnOffTypeConverter.java index d30dddb142097..d762db79dd928 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OnOffTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OnOffTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OpenClosedTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OpenClosedTypeConverter.java index 4e999d4d24992..fb7951f8a3e9b 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OpenClosedTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/OpenClosedTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/PercentTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/PercentTypeConverter.java index 9d8bccdc8c231..6330fa289a0bb 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/PercentTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/PercentTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java index 8b56586916611..716a57fae80ca 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/QuantityTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -28,7 +28,6 @@ import javax.measure.quantity.Temperature; import javax.measure.quantity.Volume; -import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.QuantityType; import org.eclipse.smarthome.core.library.unit.MetricPrefix; import org.eclipse.smarthome.core.library.unit.SIUnits; diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/StringTypeConverter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/StringTypeConverter.java index 2d72caeaad54f..761dcef2b0cbe 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/StringTypeConverter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/converter/type/StringTypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/CcuDiscoveryService.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/CcuDiscoveryService.java index 2e0ba1705cad3..4ecba6aee2e8c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/CcuDiscoveryService.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/CcuDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomegearDiscoveryParticipant.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomegearDiscoveryParticipant.java index 06ebecc08d0a0..2f62d9ff4b343 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomegearDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomegearDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java index 84d1660d3d205..f7c7f3de7595b 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,13 +18,18 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.openhab.binding.homematic.internal.common.HomematicConfig; import org.openhab.binding.homematic.internal.communicator.HomematicGateway; import org.openhab.binding.homematic.internal.handler.HomematicBridgeHandler; @@ -38,24 +43,38 @@ * * @author Gerhard Riegler - Initial contribution */ -public class HomematicDeviceDiscoveryService extends AbstractDiscoveryService { +public class HomematicDeviceDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, ThingHandlerService { private final Logger logger = LoggerFactory.getLogger(HomematicDeviceDiscoveryService.class); private static final int DISCOVER_TIMEOUT_SECONDS = 300; - private final HomematicBridgeHandler bridgeHandler; + private @NonNullByDefault({}) HomematicBridgeHandler bridgeHandler; private Future<?> loadDevicesFuture; private volatile boolean isInInstallMode = false; private volatile Object installModeSync = new Object(); private volatile int installModeDuration = HomematicConfig.DEFAULT_INSTALL_MODE_DURATION; - public HomematicDeviceDiscoveryService(HomematicBridgeHandler bridgeHandler) { + public HomematicDeviceDiscoveryService() { super(Collections.singleton(new ThingTypeUID(BINDING_ID, "-")), DISCOVER_TIMEOUT_SECONDS, false); - this.bridgeHandler = bridgeHandler; + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof HomematicBridgeHandler) { + this.bridgeHandler = (HomematicBridgeHandler) handler; + this.bridgeHandler.setDiscoveryService(this); + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return bridgeHandler; } /** * Called on component activation. */ + @Override public void activate() { super.activate(null); } diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpRequest.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpRequest.java index f6831192e11b2..de930904eea01 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpRequest.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpResponse.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpResponse.java index 3b6ccbd1c1e30..03fea63cddedf 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpResponse.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/discovery/eq3udp/Eq3UdpResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/GatewayNotAvailableException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/GatewayNotAvailableException.java index 214fb22a82625..87d2c121f2668 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/GatewayNotAvailableException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/GatewayNotAvailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicBridgeHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicBridgeHandler.java index ba6bc3f60e01f..02a2f99be72c5 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicBridgeHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,14 +16,14 @@ import static org.openhab.binding.homematic.internal.HomematicBindingConstants.CHANNEL_TYPE_DUTY_CYCLE_RATIO; import java.io.IOException; -import java.util.Hashtable; +import java.util.Collection; +import java.util.Collections; import java.util.Map; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Channel; @@ -33,6 +33,7 @@ import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.homematic.internal.common.HomematicConfig; @@ -47,7 +48,6 @@ import org.openhab.binding.homematic.internal.model.HmGatewayInfo; import org.openhab.binding.homematic.internal.type.HomematicTypeGenerator; import org.openhab.binding.homematic.internal.type.UidUtils; -import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,7 +74,6 @@ public class HomematicBridgeHandler extends BaseBridgeHandler implements Homemat private final HttpClient httpClient; private HomematicDeviceDiscoveryService discoveryService; - private ServiceRegistration<?> discoveryServiceRegistration; private final String ipv4Address; private boolean isInDutyCycle = false; @@ -96,10 +95,13 @@ public void initialize() { } } + public void setDiscoveryService(HomematicDeviceDiscoveryService discoveryService) { + this.discoveryService = discoveryService; + } + private void initializeInternal() { synchronized (initDisposeLock) { config = createHomematicConfig(); - registerDeviceDiscoveryService(); try { String id = getThing().getUID().getId(); @@ -177,7 +179,6 @@ private void disposeInternal() { logger.debug("Disposing bridge '{}'", getThing().getUID().getId()); if (discoveryService != null) { discoveryService.stopScan(); - unregisterDeviceDiscoveryService(); } if (gateway != null) { gateway.dispose(); @@ -188,36 +189,6 @@ private void disposeInternal() { } } - /** - * Registers the DeviceDiscoveryService. - */ - private void registerDeviceDiscoveryService() { - if (bundleContext != null) { - logger.trace("Registering HomematicDeviceDiscoveryService for bridge '{}'", getThing().getUID().getId()); - discoveryService = new HomematicDeviceDiscoveryService(this); - discoveryServiceRegistration = bundleContext.registerService(DiscoveryService.class.getName(), - discoveryService, new Hashtable<String, Object>()); - discoveryService.activate(); - } - } - - /** - * Unregisters the DeviceDisoveryService. - */ - private void unregisterDeviceDiscoveryService() { - if (discoveryServiceRegistration != null && bundleContext != null) { - HomematicDeviceDiscoveryService service = (HomematicDeviceDiscoveryService) bundleContext - .getService(discoveryServiceRegistration.getReference()); - if (service != null) { - service.deactivate(); - } - - discoveryServiceRegistration.unregister(); - discoveryServiceRegistration = null; - discoveryService = null; - } - } - /** * Sets the OFFLINE status for all things of this bridge that has been removed from the gateway. */ @@ -259,6 +230,11 @@ private HomematicConfig createHomematicConfig() { return homematicConfig; } + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(HomematicDeviceDiscoveryService.class); + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { if (RefreshType.REFRESH == command) { diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandler.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandler.java index 36f5e58a80c3c..8fbd02fcb2613 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandler.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -44,7 +44,6 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.State; -import org.openhab.binding.homematic.internal.HomematicBindingConstants; import org.openhab.binding.homematic.internal.common.HomematicConfig; import org.openhab.binding.homematic.internal.communicator.HomematicGateway; import org.openhab.binding.homematic.internal.converter.ConverterException; @@ -419,7 +418,7 @@ private void updateStatus(HmDevice device) throws GatewayNotAvailableException, ThingStatus newStatus = ThingStatus.ONLINE; ThingStatusDetail newDetail = ThingStatusDetail.NONE; - if (getBridge().getStatus() == ThingStatus.OFFLINE) { + if ((getBridge() != null) && (getBridge().getStatus() == ThingStatus.OFFLINE)) { newStatus = ThingStatus.OFFLINE; newDetail = ThingStatusDetail.BRIDGE_OFFLINE; } else if (device.isFirmwareUpdating()) { diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandlerFactory.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandlerFactory.java index cfbc9a7f3e536..383c0c029157c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandlerFactory.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/HomematicThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -34,6 +34,7 @@ */ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.homematic") public class HomematicThingHandlerFactory extends BaseThingHandlerFactory { + private HomematicTypeGenerator typeGenerator; private NetworkAddressService networkAddressService; private HttpClient httpClient; @@ -79,5 +80,4 @@ protected ThingHandler createHandler(Thing thing) { return new HomematicThingHandler(thing); } } - } diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/SimplePortPool.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/SimplePortPool.java index b9561ba49d2e1..410c31afd006c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/SimplePortPool.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/handler/SimplePortPool.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/DelayedExecuter.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/DelayedExecuter.java index eaf3ff3b39f9a..6ba6a58807154 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/DelayedExecuter.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/DelayedExecuter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicClientException.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicClientException.java index b5b7154cdd4c2..0f208d0bed596 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicClientException.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicClientException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicConstants.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicConstants.java index 00d562a158897..25f18ead58880 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicConstants.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/HomematicConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/MiscUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/MiscUtils.java index 164c0d00a3a66..ccc91f76cc130 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/MiscUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/misc/MiscUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmChannel.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmChannel.java index 5955e7cc33cc2..9dd6955104245 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmChannel.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapoint.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapoint.java index ea6f5b1097b91..e39dbde088cfb 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapoint.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointConfig.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointConfig.java index dd9461762f05b..100b22eacd8a8 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointConfig.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointInfo.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointInfo.java index 2f15ef655246c..d2f971b479d7d 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointInfo.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDatapointInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDevice.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDevice.java index 29844fc610bd7..e12b0dbf10f98 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDevice.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmGatewayInfo.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmGatewayInfo.java index b410010cc0ac8..780762e52ab00 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmGatewayInfo.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmGatewayInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmInterface.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmInterface.java index cb36f9c2afbc2..0f110504cc475 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmInterface.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmParamsetType.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmParamsetType.java index 351416615d1eb..d66479e84871f 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmParamsetType.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmParamsetType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmResult.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmResult.java index bf01387c3ced9..e2448ee81de34 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmResult.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmRssiInfo.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmRssiInfo.java index 959ec11a4c3a2..2df0935f75fd0 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmRssiInfo.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmRssiInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmValueType.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmValueType.java index a178c3122049d..8033442617a09 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmValueType.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmValueType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScript.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScript.java index e6ecd6aded6cd..01c37743a618c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScript.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScript.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataEntry.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataEntry.java index b0a1a117b6afa..cf9f22aa270e5 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataEntry.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataList.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataList.java index 494382f8b683e..eef4ccd7ce0d6 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataList.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptList.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptList.java index de9030d965ae4..c88b6a1b29f4e 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptList.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProvider.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProvider.java index 4a3851d816bfe..7369abf843852 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProvider.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,9 @@ */ package org.openhab.binding.homematic.internal.type; -import java.util.Locale; - import org.eclipse.smarthome.core.thing.type.ChannelGroupType; import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeProvider; import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; -import org.openhab.binding.homematic.type.HomematicThingTypeExcluder; /** * Extends the ChannelGroupTypeProvider to manually add a ChannelGroupType. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProviderImpl.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProviderImpl.java index c9a262f6b6492..68d968805a4f0 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProviderImpl.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelGroupTypeProviderImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProvider.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProvider.java index b797e4ca86d6b..d7c57e78daca5 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProvider.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,9 @@ */ package org.openhab.binding.homematic.internal.type; -import java.util.Locale; - import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.openhab.binding.homematic.type.HomematicThingTypeExcluder; /** * Extends the ChannelTypeProvider to manually add a ChannelType. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProviderImpl.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProviderImpl.java index c1a9b7fdaefaa..9351662264aff 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProviderImpl.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicChannelTypeProviderImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProvider.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProvider.java index 88cd2d86c23cc..9bd53bb063f2c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProvider.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,6 @@ import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.ConfigDescription; import org.eclipse.smarthome.config.core.ConfigDescriptionProvider; -import org.openhab.binding.homematic.type.HomematicThingTypeExcluder; /** * Extends the ConfigDescriptionProvider to manually add a ConfigDescription. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProviderImpl.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProviderImpl.java index 46d15c7d2260e..d1e265ea3bca2 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProviderImpl.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicConfigDescriptionProviderImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProvider.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProvider.java index 809624fe569a7..0034c6ba3dc67 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProvider.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,9 @@ */ package org.openhab.binding.homematic.internal.type; -import java.util.Locale; - import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.ThingTypeProvider; import org.eclipse.smarthome.core.thing.type.ThingType; -import org.openhab.binding.homematic.type.HomematicThingTypeExcluder; /** * Extends the ThingTypeProvider to manually add a ThingType. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProviderImpl.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProviderImpl.java index 1e8675995ac1b..d892849297b03 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProviderImpl.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicThingTypeProviderImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGenerator.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGenerator.java index 09baa89f409a0..d8c5c980207c1 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGenerator.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGenerator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGeneratorImpl.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGeneratorImpl.java index fbcc94248965e..4c8b38d998c76 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGeneratorImpl.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/HomematicTypeGeneratorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -76,10 +76,7 @@ public class HomematicTypeGeneratorImpl implements HomematicTypeGenerator { private HomematicChannelTypeProvider channelTypeProvider; private HomematicChannelGroupTypeProvider channelGroupTypeProvider; private HomematicConfigDescriptionProvider configDescriptionProvider; - private final Map<String, Set<String>> firmwaresByType = new HashMap<String, Set<String>>(); - - private static final String[] STATUS_DATAPOINT_NAMES = new String[] { DATAPOINT_NAME_UNREACH, - DATAPOINT_NAME_CONFIG_PENDING, DATAPOINT_NAME_DEVICE_IN_BOOTLOADER, DATAPOINT_NAME_UPDATE_PENDING }; + private final Map<String, Set<String>> firmwaresByType = new HashMap<>(); private static final String[] IGNORE_DATAPOINT_NAMES = new String[] { DATAPOINT_NAME_AES_KEY, VIRTUAL_DATAPOINT_NAME_RELOAD_FROM_GATEWAY }; @@ -145,9 +142,9 @@ public void generate(HmDevice device) { logger.debug("Generating ThingType for device '{}' with {} datapoints", device.getType(), device.getDatapointCount()); - List<ChannelGroupType> groupTypes = new ArrayList<ChannelGroupType>(); + List<ChannelGroupType> groupTypes = new ArrayList<>(); for (HmChannel channel : device.getChannels()) { - List<ChannelDefinition> channelDefinitions = new ArrayList<ChannelDefinition>(); + List<ChannelDefinition> channelDefinitions = new ArrayList<>(); // Omit thing channel definitions for reconfigurable channels; // those will be populated dynamically during thing initialization if (!channel.isReconfigurable()) { @@ -210,7 +207,7 @@ private void addFirmware(HmDevice device) { && !DEVICE_TYPE_VIRTUAL_WIRED.equals(device.getType())) { Set<String> firmwares = firmwaresByType.get(device.getType()); if (firmwares == null) { - firmwares = new HashSet<String>(); + firmwares = new HashSet<>(); firmwaresByType.put(device.getType(), firmwares); } firmwares.add(device.getFirmware()); @@ -224,11 +221,11 @@ private ThingType createThingType(HmDevice device, List<ChannelGroupType> groupT String label = MetadataUtils.getDeviceName(device); String description = String.format("%s (%s)", label, device.getType()); - List<String> supportedBridgeTypeUids = new ArrayList<String>(); + List<String> supportedBridgeTypeUids = new ArrayList<>(); supportedBridgeTypeUids.add(THING_TYPE_BRIDGE.toString()); ThingTypeUID thingTypeUID = UidUtils.generateThingTypeUID(device); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); properties.put(Thing.PROPERTY_VENDOR, PROPERTY_VENDOR_NAME); properties.put(Thing.PROPERTY_MODEL_ID, device.getType()); @@ -237,7 +234,7 @@ private ThingType createThingType(HmDevice device, List<ChannelGroupType> groupT generateConfigDescription(device, configDescriptionURI); } - List<ChannelGroupDefinition> groupDefinitions = new ArrayList<ChannelGroupDefinition>(); + List<ChannelGroupDefinition> groupDefinitions = new ArrayList<>(); for (ChannelGroupType groupType : groupTypes) { String id = StringUtils.substringAfterLast(groupType.getUID().getId(), "_"); groupDefinitions.add(new ChannelGroupDefinition(id, groupType.getUID())); @@ -283,7 +280,7 @@ public StateOption createOption(String value, String description) { BigDecimal step = MetadataUtils.createBigDecimal(dp.getStep()); if (step == null) { - step = MetadataUtils.createBigDecimal(dp.isFloatType() ? new Float(0.1) : 1L); + step = MetadataUtils.createBigDecimal(dp.isFloatType() ? new Float(0.1) : new Long(1L)); } state = new StateDescription(min, max, step, MetadataUtils.getStatePattern(dp), dp.isReadOnly(), options); @@ -314,8 +311,8 @@ public EventOption createOption(String value, String description) { } private void generateConfigDescription(HmDevice device, URI configDescriptionURI) { - List<ConfigDescriptionParameter> parms = new ArrayList<ConfigDescriptionParameter>(); - List<ConfigDescriptionParameterGroup> groups = new ArrayList<ConfigDescriptionParameterGroup>(); + List<ConfigDescriptionParameter> parms = new ArrayList<>(); + List<ConfigDescriptionParameterGroup> groups = new ArrayList<>(); for (HmChannel channel : device.getChannels()) { String groupName = "HMG_" + channel.getNumber(); @@ -346,7 +343,8 @@ public ParameterOption createOption(String value, String description) { if (dp.isNumberType()) { builder.withMinimum(MetadataUtils.createBigDecimal(dp.getMinValue())); builder.withMaximum(MetadataUtils.createBigDecimal(dp.getMaxValue())); - builder.withStepSize(MetadataUtils.createBigDecimal(dp.isFloatType() ? new Float(0.1) : 1L)); + builder.withStepSize( + MetadataUtils.createBigDecimal(dp.isFloatType() ? new Float(0.1) : new Long(1L))); builder.withUnitLabel(MetadataUtils.getUnit(dp)); } diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java index 45940748db527..69f5517be755c 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/MetadataUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -62,7 +62,7 @@ protected static void initialize() { private static void loadBundle(String filename) { descriptionsBundle = ResourceBundle.getBundle(filename, Locale.getDefault()); for (String key : descriptionsBundle.keySet()) { - descriptions.put(key, descriptionsBundle.getString(key)); + descriptions.put(key.toUpperCase(), descriptionsBundle.getString(key)); } ResourceBundle.clearCache(); descriptionsBundle = null; @@ -200,7 +200,7 @@ public static String getDescription(String... keys) { if (key.endsWith("|")) { key = key.substring(0, key.length() - 1); } - String description = descriptions.get(key); + String description = descriptions.get(key.toUpperCase()); if (description != null) { return description; } diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/UidUtils.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/UidUtils.java index a7989fcedd616..865608f09eeab 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/UidUtils.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/UidUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/generator/CcuMetadataExtractor.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/generator/CcuMetadataExtractor.java index bb436760bcdc9..4ac8afef4aec4 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/generator/CcuMetadataExtractor.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/type/generator/CcuMetadataExtractor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/type/HomematicThingTypeExcluder.java b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/type/HomematicThingTypeExcluder.java index daa0b2af15d93..66613e9c202b2 100644 --- a/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/type/HomematicThingTypeExcluder.java +++ b/bundles/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/type/HomematicThingTypeExcluder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.homematic/src/main/resources/ESH-INF/thing/bridge.xml index 6dcd39229c325..7d86ee2afd455 100644 --- a/bundles/org.openhab.binding.homematic/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.homematic/src/main/resources/ESH-INF/thing/bridge.xml @@ -57,60 +57,60 @@ <default>15</default> </parameter> <parameter name="discoveryTimeToLive" type="integer"> - <label>Discovery Time To Live</label> + <label>Discovery Time to Live</label> <description>The time to live for discovery results of a Homematic gateway in seconds. (default = -1 -> infinite)</description> <advanced>true</advanced> <default>-1</default> </parameter> <parameter name="socketMaxAlive" type="integer"> - <label>Socket maxAlive</label> + <label>Socket MaxAlive</label> <description>The maximum lifetime of a socket connection to and from a Homematic gateway in seconds (default = 900)</description> <advanced>true</advanced> <default>900</default> </parameter> <parameter name="rfPort" type="integer"> - <label>RF port</label> + <label>RF Port</label> <description>The port number of the RF daemon</description> <advanced>true</advanced> <default>2001</default> </parameter> <parameter name="wiredPort" type="integer"> - <label>Wired port</label> + <label>Wired Port</label> <description>The port number of the HS485 daemon</description> <advanced>true</advanced> <default>2000</default> </parameter> <parameter name="hmIpPort" type="integer"> - <label>HMIP port</label> + <label>HMIP Port</label> <description>The port number of the Homematic IP daemon</description> <advanced>true</advanced> <default>2010</default> </parameter> <parameter name="cuxdPort" type="integer"> - <label>CUxD port</label> + <label>CUxD Port</label> <description>The port number of the CUxD daemon</description> <advanced>true</advanced> <default>8701</default> </parameter> <parameter name="groupPort" type="integer"> - <label>Group port</label> + <label>Group Port</label> <description>The port number of the Group daemon</description> <advanced>true</advanced> <default>9292</default> </parameter> <parameter name="installModeDuration" type="integer" min="10" max="300" unit="s"> - <label>Install mode duration</label> + <label>Install Mode Duration</label> <description>Time in seconds that the controller will be in install mode when a device discovery is initiated</description> <default>60</default> </parameter> <parameter name="unpairOnDeletion" type="boolean"> - <label>Unpair Devices on Deletion</label> + <label>Unpair Devices On Deletion</label> <description>If set to true, devices are unpaired from the gateway when their corresponding things are removed. The option "factoryResetOnDeletion" also unpairs a device, so in order to avoid unpairing on deletion, both options need to be set to false!</description> <advanced>true</advanced> <default>false</default> </parameter> <parameter name="factoryResetOnDeletion" type="boolean"> - <label>Factory Reset Devices on Deletion</label> + <label>Factory Reset Devices On Deletion</label> <description>If set to true, devices are factory reset when their corresponding things are removed. Due to the factory reset, the device will also be unpaired from the gateway, even if "unpairOnDeletion" is set to false!</description> <advanced>true</advanced> <default>false</default> diff --git a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/batteries.properties b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/batteries.properties index 715b58693c8f3..46961a0789404 100644 --- a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/batteries.properties +++ b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/batteries.properties @@ -102,6 +102,7 @@ HmIP-SWO-B=3x AA/Mignon/LR06 HmIP-WGC=2x AA/Mignon/LR06 # MAX! +BC-RT-TRX-CyN=2x AA/Mignon/LR06 BC-RT-TRX-CyG=2x AA/Mignon/LR06 BC-RT-TRX-CyG-2=2x AA/Mignon/LR06 BC-RT-TRX-CyG-3=2x AA/Mignon/LR06 diff --git a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions.properties b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions.properties index 1f63ea5e1bc5c..4e82249291dc2 100644 --- a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions.properties +++ b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions.properties @@ -6,6 +6,7 @@ HM-WDS30-OT2-SM-2=Wireless Differential Temperature Sensor HM-Sen-MDIR-O-2=Wireless Motion Detector, outdoor # MAX! +BC-RT-TRX-CyN=MAX! Radiator thermostat basic BC-RT-TRX-CyG=MAX! Radiator thermostat BC-RT-TRX-CyG-2=MAX! Wall thermostat WT+ BC-RT-TRX-CyG-3=MAX! Radiator thermostat @@ -17,14 +18,20 @@ BC-SC-Rd-WM-2=MAX! Windows sensor # Homematic IP HmIP-HAP=Homematic IP Access Point +HmIP-RCV-50=Homematic IP virtual remote control HmIP-SWDO=Homematic IP Door-/window contact, optical HmIP-WTH=Homematic IP Wall thermostat with humidity sensor +HmIP-STH=Homematic IP Wall temperature and humidity sensor +HmIP-STHD=Homematic IP Wall temperature and humidity sensor with display HMIP-WRC2=Homematic IP Wall mount remote control 2 button HMIP-PS=Homematic IP Pluggable switch HMIP-PSM=Homematic IP Pluggable switch and meter HMIP-eTRV=Homematic IP Radiator thermostat HMIP-eTRV-2=Homematic IP Radiator thermostat +HMIP-eTRV-B=Homematic IP Radiator thermostat basic +HMIP-eTRV-C=Homematic IP Radiator thermostat compact HmIP-SMI=Homematic IP motion detector with brightness sensor +HmIP-SMO=Homematic IP motion detector with brightness sensor - outdoor HmIP-KRC4=Homematic IP Key Ring Remote Control - 4 buttons HmIP-RC8=Homematic IP Remote Control - 8 buttons HmIP-DRA=Homematic IP DIN-Rail Adapter for Multi IO Box @@ -50,6 +57,7 @@ HmIP-PCBS-BAT=Circuit board for battery operation HmIP-FROLL=Homematic IP Wireless Blind Actuator HmIP-BROLL=Homematic IP Wireless Blind Actuator for brand switches HmIP-BRC2=Homematic IP Wall-mount Remote Control for brand switches - 2 channels +HmIP-MOD-TM=Homematic IP Garage Door Module # virtual datapoints DELETE_DEVICE_MODE=Deletemode diff --git a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions_de.properties b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions_de.properties index e29a037776884..0a30d90cd5b7a 100644 --- a/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions_de.properties +++ b/bundles/org.openhab.binding.homematic/src/main/resources/homematic/extra-descriptions_de.properties @@ -6,6 +6,7 @@ HM-WDS30-OT2-SM-2=Funk-Temperaturdifferenzsensor HM-Sen-MDIR-O-2=Funk-Bewegungsmelder außen # MAX! +BC-RT-TRX-CyN=MAX! Heizkörperthermostat Basic BC-RT-TRX-CyG=MAX! Elektronischer Heizkörperthermostat BC-RT-TRX-CyG-2=MAX! Wandthermostat WT+ BC-RT-TRX-CyG-3=MAX! Heizkörperthermostat @@ -17,14 +18,20 @@ BC-SC-Rd-WM-2=MAX! Fensterkontakt # Homematic IP HmIP-HAP=Homematic IP Access Point +HmIP-RCV-50=Homematic IP virtuelle Fernbedienung HmIP-SWDO=Homematic IP Fenster- und Türkontakt, optisch HmIP-WTH=Homematic IP Wandthermostat mit Luftfeuchtigkeitssensor +HmIP-STH=Homematic IP Temperatur- und Luftfeuchtigkeitssensor - innen +HmIP-STHD=Homematic IP Temperatur- und Luftfeuchtigkeitssensor mit Display - innen HMIP-WRC2=Homematic IP Wandtaster, 2-fach HMIP-PS=Homematic IP Schaltsteckdose HMIP-PSM=Homematic IP Schalt-Mess-Steckdose HMIP-eTRV=Homematic IP Heizkörperthermostat HMIP-eTRV-2=Homematic IP Heizkörperthermostat +HMIP-eTRV-B=Homematic IP Heizkörperthermostat Basis +HMIP-eTRV-C=Homematic IP Heizkörperthermostat kompakt HmIP-SMI=Homematic IP Bewegungsmelder mit Dämmerungssensor +HmIP-SMO=Homematic IP Bewegungsmelder mit Dämmerungssensor außen HmIP-KRC4=Homematic IP Schlüsselbundfernbedienung - 4 Tasten HmIP-RC8=Homematic IP Fernbedienung - 8 Tasten HmIP-DRA=Homematic IP Hutschienenadapter für Multi IO Box diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/client/RpcClientTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/client/RpcClientTest.java index 577f14d4c7c46..55a18270345df 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/client/RpcClientTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/client/RpcClientTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,9 +12,7 @@ */ package org.openhab.binding.homematic.internal.communicator.client; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.openhab.binding.homematic.internal.HomematicBindingConstants.*; import static org.openhab.binding.homematic.test.util.DimmerHelper.*; @@ -31,6 +29,9 @@ import org.openhab.binding.homematic.internal.model.HmParamsetType; import org.openhab.binding.homematic.test.util.RpcClientMockImpl; +/** + * @author Florian Stolte - Initial contribution + */ public class RpcClientTest extends JavaTest { private RpcClientMockImpl rpcClient; diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonDatapointTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonDatapointTest.java index 845238751f499..55a144308f424 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonDatapointTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/communicator/virtual/ButtonDatapointTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/BaseConverterTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/BaseConverterTest.java index 98389e94d848a..07cbbf7f9b262 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/BaseConverterTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/BaseConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,9 @@ import org.openhab.binding.homematic.internal.model.HmParamsetType; import org.openhab.binding.homematic.internal.model.HmValueType; +/** + * @author Michael Reitler - Initial contribution + */ public class BaseConverterTest { protected final HmDatapoint floatDp = new HmDatapoint("floatDp", "", HmValueType.FLOAT, null, false, diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertFromBindingTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertFromBindingTest.java index 886867d09e9e9..2a9cead5fc0f5 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertFromBindingTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertFromBindingTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertToBindingTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertToBindingTest.java index ceff882d19d52..6b85b34665f8a 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertToBindingTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConvertToBindingTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConverterFactoryTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConverterFactoryTest.java index 211febc9b06b1..7bd75bf89a736 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConverterFactoryTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/converter/ConverterFactoryTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryServiceTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryServiceTest.java index ce66c6ad28903..1fb25ef28024f 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/discovery/HomematicDeviceDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,12 +14,8 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; import static org.openhab.binding.homematic.test.util.BridgeHelper.createHomematicBridge; import static org.openhab.binding.homematic.test.util.DimmerHelper.createDimmerHmDevice; @@ -34,7 +30,6 @@ import org.junit.Before; import org.junit.Test; import org.openhab.binding.homematic.internal.communicator.HomematicGateway; -import org.openhab.binding.homematic.internal.discovery.HomematicDeviceDiscoveryService; import org.openhab.binding.homematic.internal.handler.HomematicBridgeHandler; import org.openhab.binding.homematic.internal.model.HmDevice; import org.openhab.binding.homematic.internal.type.HomematicTypeGenerator; @@ -42,7 +37,7 @@ /** * Tests for {@link HomematicDeviceDiscoveryServiceTest}. - * + * * @author Florian Stolte - Initial Contribution * */ @@ -54,7 +49,8 @@ public class HomematicDeviceDiscoveryServiceTest extends JavaTest { @Before public void setup() throws IOException { this.homematicBridgeHandler = mockHomematicBridgeHandler(); - this.homematicDeviceDiscoveryService = new HomematicDeviceDiscoveryService(homematicBridgeHandler); + this.homematicDeviceDiscoveryService = new HomematicDeviceDiscoveryService(); + this.homematicDeviceDiscoveryService.setThingHandler(homematicBridgeHandler); } private HomematicBridgeHandler mockHomematicBridgeHandler() throws IOException { diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/handler/SimplePortPoolTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/handler/SimplePortPoolTest.java index 68cd1d9561b06..1c336fd4f03e4 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/handler/SimplePortPoolTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/handler/SimplePortPoolTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/type/UidUtilsTest.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/type/UidUtilsTest.java index cb18d4fb0df99..e6ddb1b54f038 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/type/UidUtilsTest.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/internal/type/UidUtilsTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/BridgeHelper.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/BridgeHelper.java index c0f6d3558222c..e8b4619fa1a8b 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/BridgeHelper.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/BridgeHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/DimmerHelper.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/DimmerHelper.java index 97653ce3a2436..a20dc637869fe 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/DimmerHelper.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/DimmerHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/RpcClientMockImpl.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/RpcClientMockImpl.java index b5c63517737a4..7120c6ee56839 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/RpcClientMockImpl.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/RpcClientMockImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,9 @@ import org.openhab.binding.homematic.internal.communicator.client.RpcClient; import org.openhab.binding.homematic.internal.communicator.message.RpcRequest; +/** + * @author Florian Stolte - Initial contribution + */ public class RpcClientMockImpl extends RpcClient<String> { public static final String GET_PARAMSET_DESCRIPTION_NAME = "getParamsetDescription"; diff --git a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/SimpleDiscoveryListener.java b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/SimpleDiscoveryListener.java index 18a5121dd5a73..40989ad5de667 100644 --- a/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/SimpleDiscoveryListener.java +++ b/bundles/org.openhab.binding.homematic/src/test/java/org/openhab/binding/homematic/test/util/SimpleDiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/NOTICE b/bundles/org.openhab.binding.hpprinter/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.hpprinter/NOTICE +++ b/bundles/org.openhab.binding.hpprinter/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.hpprinter/pom.xml b/bundles/org.openhab.binding.hpprinter/pom.xml index 454e854c38cab..819d3984b107b 100644 --- a/bundles/org.openhab.binding.hpprinter/pom.xml +++ b/bundles/org.openhab.binding.hpprinter/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.hpprinter</artifactId> diff --git a/bundles/org.openhab.binding.hpprinter/src/main/feature/feature.xml b/bundles/org.openhab.binding.hpprinter/src/main/feature/feature.xml index 1d270cadf47ad..9b2483a3f3ca8 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.hpprinter/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.hpprinter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-hpprinter" description="HP Printer Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterBindingConstants.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterBindingConstants.java index 2499edbf12414..ed8be8655afcb 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterBindingConstants.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterConfiguration.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterConfiguration.java index 49aed088d5a51..6638ddfcfaa85 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterConfiguration.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterDiscoveryParticipant.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterDiscoveryParticipant.java index 5ad542a54ab31..5f611bec4f330 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/HPPrinterDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPServerResult.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPServerResult.java index 1f5684985b1cd..891a474ba6917 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPServerResult.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPServerResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPStatus.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPStatus.java index 737928d0aabe5..54fbe38ac38a5 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPStatus.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPType.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPType.java index 5ed85d72e26b0..f43488a8ad311 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPType.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPUsage.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPUsage.java index 1a71aa41a5dc1..e73ceae103b37 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPUsage.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPUsage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPWebServerClient.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPWebServerClient.java index 39d0f653ad5a3..7b61aba0c6c01 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPWebServerClient.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/api/HPWebServerClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinder.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinder.java index dffa005763a67..e8d2fd66021dc 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinder.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinderEvent.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinderEvent.java index 5e9bf99693b37..356ca6ad96564 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinderEvent.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/binder/HPPrinterBinderEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandler.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandler.java index bdf3a8e7f9053..ccbea597b5db1 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandler.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandlerFactory.java b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandlerFactory.java index 99f35e3f2a062..3ca78bb11596f 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandlerFactory.java +++ b/bundles/org.openhab.binding.hpprinter/src/main/java/org/openhab/binding/hpprinter/internal/handler/HPPrinterHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/config/config.xml index 1842b34b13811..6e73abb62dd5b 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/config/config.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 - http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 + https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:hpprinter:config"> <parameter name="ipAddress" type="text" required="true"> @@ -25,4 +25,4 @@ </parameter> </config-description> -</config-description:config-descriptions> \ No newline at end of file +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-groups.xml b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-groups.xml index ae97b511a0c6e..fa2d768da05d6 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-groups.xml +++ b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-groups.xml @@ -1,22 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="hpprinter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Channel Groups --> <channel-group-type id="ink"> <label>Ink/Toner Levels</label> <channels> - <channel typeId="inkLevel" id="blackLevel"><label>Black Level</label></channel> + <channel typeId="inkLevel" id="blackLevel"> + <label>Black Level</label> + </channel> </channels> </channel-group-type> <channel-group-type id="usageInfo"> <label>Usage Information</label> <channels> - <channel typeId="totals" id="totalCount"><label>Total Pages</label></channel> + <channel typeId="totals" id="totalCount"> + <label>Total Pages</label> + </channel> </channels> </channel-group-type> @@ -27,4 +31,4 @@ </channels> </channel-group-type> -</thing:thing-descriptions> \ No newline at end of file +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-types.xml index 3f8abe1d988de..897115cb5e726 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/channel-types.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<thing:thing-descriptions bindingId="hpprinter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> +<thing:thing-descriptions bindingId="hpprinter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="inkLevel"> <item-type>Number:Dimensionless</item-type> <label>Ink Level</label> @@ -34,4 +34,4 @@ <description>Printer Status</description> <state readOnly="true"></state> </channel-type> -</thing:thing-descriptions> \ No newline at end of file +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/thing-printer.xml b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/thing-printer.xml index c72edef0bc042..fc414c14e0ce5 100644 --- a/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/thing-printer.xml +++ b/bundles/org.openhab.binding.hpprinter/src/main/resources/ESH-INF/thing/thing-printer.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="hpprinter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="printer"> @@ -19,4 +19,4 @@ </thing-type> -</thing:thing-descriptions> \ No newline at end of file +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hue/NOTICE b/bundles/org.openhab.binding.hue/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.hue/NOTICE +++ b/bundles/org.openhab.binding.hue/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.hue/README.md b/bundles/org.openhab.binding.hue/README.md index eb16abeeecb1d..bc2c6ac88a9e4 100644 --- a/bundles/org.openhab.binding.hue/README.md +++ b/bundles/org.openhab.binding.hue/README.md @@ -1,6 +1,6 @@ # Philips Hue Binding -This binding integrates the [Philips Hue Lighting system](http://www.meethue.com). +This binding integrates the [Philips Hue Lighting system](https://www.meethue.com). The integration happens through the Hue bridge, which acts as an IP gateway to the ZigBee devices. ![Philips Hue](doc/hue.jpg) @@ -47,8 +47,9 @@ The following matrix lists the capabilities (channels) for each type: | 0220 | X | X | | X | Beside bulbs and luminaires the Hue binding supports some ZigBee sensors. -Currently only Hue specific sensors are tested successfully (e.g. Hue Motion Sensor, Hue Dimmer Switch, Hue Tap). +Currently only Hue specific sensors are tested successfully (e.g. Hue Motion Sensor, Hue Dimmer Switch, Hue Tap, CLIP Sensor). The Hue Motion Sensor registers a `ZLLLightLevel` sensor (0106), a `ZLLPresence` sensor (0107) and a `ZLLTemperature` sensor (0302) in one device. +The Hue CLIP Sensor saves scene states with status or flag for HUE rules. They are presented by the following ZigBee Device ID and _Thing type_: | Device type | ZigBee Device ID | Thing type | @@ -58,9 +59,13 @@ They are presented by the following ZigBee Device ID and _Thing type_: | Temperature Sensor | 0x0302 | 0302 | | Non-Colour Controller | 0x0820 | 0820 | | Non-Colour Scene Controller | 0x0830 | 0830 | +| CLIP Generic Status Sensor | 0x0840 | 0840 | +| CLIP Generic Flag Sensor | 0x0850 | 0850 | The Hue Dimmer Switch has 4 buttons and registers as a Non-Colour Controller switch, while the Hue Tap (also 4 buttons) registers as a Non-Colour Scene Controller in accordance with the ZLL standard. +Also, Hue bridge support CLIP Generic Status Sensor and CLIP Generic Flag Sensor. These sensors save state for rules and calculate what actions to do. CLIP Sensor set or get by json through IP. + The type of a specific device can be found in the configuration section for things in the PaperUI. It is part of the unique thing id which could look like: @@ -152,7 +157,9 @@ The devices support some of the following channels: | daylight | Switch | This channel indicates whether the light level is below the daylight threshold or not. | 0106 | | presence | Switch | This channel indicates whether a motion is detected by the sensor or not. | 0107 | | temperature | Number:Temperature | This channel shows the current temperature measured by the sensor. | 0302 | -| last_updated | DateTime | This channel the date and time when the sensor was last updated. | 0820, 0830, 0106, 0107, 0302 | +| flag | Switch | This channel save flag state for a CLIP sensor. | 0850 | +| status | Number | This channel save status state for a CLIP sensor. | 0840 | +| last_updated | DateTime | This channel the date and time when the sensor was last updated. | 0820, 0830, 0840, 0850, 0106, 0107, 0302| | battery_level | Number | This channel shows the battery level. | 0820, 0106, 0107, 0302 | | battery_low | Switch | This channel indicates whether the battery is low or not. | 0820, 0106, 0107, 0302 | diff --git a/bundles/org.openhab.binding.hue/pom.xml b/bundles/org.openhab.binding.hue/pom.xml index a6de4e182525e..6677086bdf603 100644 --- a/bundles/org.openhab.binding.hue/pom.xml +++ b/bundles/org.openhab.binding.hue/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.hue</artifactId> diff --git a/bundles/org.openhab.binding.hue/src/main/feature/feature.xml b/bundles/org.openhab.binding.hue/src/main/feature/feature.xml index 2a4cc29f37ff8..4fa260af97a0c 100644 --- a/bundles/org.openhab.binding.hue/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.hue/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.hue-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-hue" description="Hue Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersion.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersion.java index 68ff14aaf9705..7efea2a71e6ac 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersion.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersionUtils.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersionUtils.java index 4324be9c45fe3..d82e1b9c66642 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersionUtils.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ApiVersionUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/BridgeConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/BridgeConfigUpdate.java index c0a758fad87d3..141f050c11e3d 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/BridgeConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/BridgeConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Command.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Command.java index ac5f785c0e28a..a31f81731ff6c 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Command.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Config.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Config.java index ec23b300aea72..8ecb909a756c7 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Config.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ConfigUpdate.java index 189c8203136ea..8173789ecddee 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateScheduleRequest.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateScheduleRequest.java index 4ed8dc48dfc64..03493d075656b 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateScheduleRequest.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateScheduleRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateUserRequest.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateUserRequest.java index 560c2070f1916..8e640b64318d6 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateUserRequest.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/CreateUserRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ErrorResponse.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ErrorResponse.java index 69be14e2f6a82..63dd34496c15d 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ErrorResponse.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ErrorResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullConfig.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullConfig.java index fdccec18f00db..8d1fdfd439f3b 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullConfig.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullGroup.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullGroup.java index 1782373e37f4e..222929e27fc7e 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullGroup.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullHueObject.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullHueObject.java index d66019a51a50d..2f5e07711b7b1 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullHueObject.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullHueObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullLight.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullLight.java index d80044c40281b..d0a48e63395a9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullLight.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullLight.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSchedule.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSchedule.java index b4f6b8016e526..ee68241afe562 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSchedule.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSchedule.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSensor.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSensor.java index b67c337d67c2c..800e47d451f7b 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSensor.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/FullSensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,6 +32,8 @@ public class FullSensor extends FullHueObject { public static final String STATE_LIGHT_LEVEL = "lightlevel"; public static final String STATE_DARK = "dark"; public static final String STATE_DAYLIGHT = "daylight"; + public static final String STATE_STATUS = "status"; + public static final String STATE_FLAG = "flag"; public static final String CONFIG_REACHABLE = "reachable"; public static final String CONFIG_BATTERY = "battery"; diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Group.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Group.java index 2e1a34a6f96b7..1e2103e5168f7 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Group.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Group.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HttpClient.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HttpClient.java index bc68fdfeb4df8..a7f7569607a56 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HttpClient.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HttpClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java index 96a19aa37827a..7802c2e216b31 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,6 +45,8 @@ public class HueBindingConstants { public static final ThingTypeUID THING_TYPE_DIMMER_SWITCH = new ThingTypeUID(BINDING_ID, "0820"); public static final ThingTypeUID THING_TYPE_TAP_SWITCH = new ThingTypeUID(BINDING_ID, "0830"); + public static final ThingTypeUID THING_TYPE_CLIP_GENERIC_STATUS = new ThingTypeUID(BINDING_ID, "0840"); + public static final ThingTypeUID THING_TYPE_CLIP_GENERIC_FLAG = new ThingTypeUID(BINDING_ID, "0850"); public static final ThingTypeUID THING_TYPE_PRESENCE_SENSOR = new ThingTypeUID(BINDING_ID, "0107"); public static final ThingTypeUID THING_TYPE_TEMPERATURE_SENSOR = new ThingTypeUID(BINDING_ID, "0302"); public static final ThingTypeUID THING_TYPE_LIGHT_LEVEL_SENSOR = new ThingTypeUID(BINDING_ID, "0106"); @@ -67,6 +69,8 @@ public class HueBindingConstants { public static final String CHANNEL_LIGHT_LEVEL = "light_level"; public static final String CHANNEL_DARK = "dark"; public static final String CHANNEL_DAYLIGHT = "daylight"; + public static final String CHANNEL_STATUS = "status"; + public static final String CHANNEL_FLAG = "flag"; // List all triggers public static final String EVENT_DIMMER_SWITCH = "dimmer_switch_event"; diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBridge.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBridge.java index e77622cae4916..048d9ca4cfbf9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBridge.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBridge.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -363,6 +363,24 @@ public CompletableFuture<Result> setLightState(FullLight light, StateUpdate upda scheduler); } + /** + * Changes the state of a clip sensor. + * + * @param sensor sensor + * @param update changes to the state + * @throws UnauthorizedException thrown if the user no longer exists + * @throws EntityNotAvailableException thrown if the specified sensor no longer exists + * @throws DeviceOffException thrown if the specified sensor is turned off + * @throws IOException if the bridge cannot be reached + */ + public CompletableFuture<Result> setSensorState(FullSensor sensor, StateUpdate update) { + requireAuthentication(); + + String body = update.toJson(); + return http.putAsync(getRelativeURL("sensors/" + enc(sensor.getId()) + "/state"), body, update.getMessageDelay(), + scheduler); + } + /** * Changes the config of a sensor. * diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueConfigStatusMessage.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueConfigStatusMessage.java index 6e46dea22a070..7ad0911e2f71e 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueConfigStatusMessage.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueConfigStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueObject.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueObject.java index d30ada399b5ae..7ae7aa494fc25 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueObject.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueThingHandlerFactory.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueThingHandlerFactory.java index ae4cd08acf682..ba78ea1e222a9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueThingHandlerFactory.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -41,6 +41,7 @@ import org.openhab.binding.hue.internal.handler.sensors.PresenceHandler; import org.openhab.binding.hue.internal.handler.sensors.TapSwitchHandler; import org.openhab.binding.hue.internal.handler.sensors.TemperatureHandler; +import org.openhab.binding.hue.internal.handler.sensors.ClipHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.annotations.Component; @@ -60,7 +61,7 @@ public class HueThingHandlerFactory extends BaseThingHandlerFactory { Stream.of(HueBridgeHandler.SUPPORTED_THING_TYPES.stream(), HueLightHandler.SUPPORTED_THING_TYPES.stream(), DimmerSwitchHandler.SUPPORTED_THING_TYPES.stream(), TapSwitchHandler.SUPPORTED_THING_TYPES.stream(), PresenceHandler.SUPPORTED_THING_TYPES.stream(), TemperatureHandler.SUPPORTED_THING_TYPES.stream(), - LightLevelHandler.SUPPORTED_THING_TYPES.stream()).flatMap(i -> i).collect(Collectors.toSet())); + LightLevelHandler.SUPPORTED_THING_TYPES.stream(), ClipHandler.SUPPORTED_THING_TYPES.stream()).flatMap(i -> i).collect(Collectors.toSet())); private final Map<ThingUID, @Nullable ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); @@ -76,7 +77,8 @@ public class HueThingHandlerFactory extends BaseThingHandlerFactory { || TapSwitchHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID) || PresenceHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID) || TemperatureHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID) - || LightLevelHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { + || LightLevelHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID) + || ClipHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID hueSensorUID = getSensorUID(thingTypeUID, thingUID, configuration, bridgeUID); return super.createThing(thingTypeUID, configuration, hueSensorUID, bridgeUID); } @@ -133,6 +135,8 @@ private ThingUID getThingUID(ThingTypeUID thingTypeUID, String id, @Nullable Thi return new TemperatureHandler(thing); } else if (LightLevelHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) { return new LightLevelHandler(thing); + } else if (ClipHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) { + return new ClipHandler(thing); } else { return null; } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/LightLevelConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/LightLevelConfigUpdate.java index cc3ca74463839..a6fa4f3cf83de 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/LightLevelConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/LightLevelConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/NewLightsResponse.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/NewLightsResponse.java index e49e1a56ff7bf..53e96f6fb1d03 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/NewLightsResponse.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/NewLightsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PortalDiscoveryResult.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PortalDiscoveryResult.java index 21c168ef13762..7385c08815e21 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PortalDiscoveryResult.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PortalDiscoveryResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PresenceConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PresenceConfigUpdate.java index 9a9dda1f013d3..7d76d104af4e9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PresenceConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/PresenceConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Schedule.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Schedule.java index 0a8ce848d114b..1961521caa3bc 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Schedule.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Schedule.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleCommand.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleCommand.java index 35fd3f5e26bc2..9c365091686e3 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleCommand.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleUpdate.java index 951c62f9e2a65..f5bd818e24644 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/ScheduleUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SearchForLightsRequest.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SearchForLightsRequest.java index 9bc285ef2b595..5449aeca9e0d9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SearchForLightsRequest.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SearchForLightsRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SensorConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SensorConfigUpdate.java index 60c2427fc0b11..18d82d90ba9d4 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SensorConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SensorConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SetAttributesRequest.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SetAttributesRequest.java index 19a411625e461..f1748b1b5bced 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SetAttributesRequest.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SetAttributesRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SoftwareUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SoftwareUpdate.java index 802ff204f13cd..6087d770ed221 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SoftwareUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SoftwareUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/State.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/State.java index 3180115c6d8d8..15282cbba34e9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/State.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/State.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/StateUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/StateUpdate.java index cd659e43d9fc2..c8be2d4d2a479 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/StateUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/StateUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -196,4 +196,27 @@ public StateUpdate setTransitionTime(long timeMillis) { return this; } + /** + * Turn sensor flag on or off. + * + * @param flag on if true, off otherwise + * @return this object for chaining calls + */ + + public StateUpdate setFlag(boolean flag) { + commands.add(new Command("flag", flag)); + return this; + } + + /** + * Set status of sensor. + * + * @param status status + * @return this object for chaining calls + */ + public StateUpdate setStatus(int status) { + commands.add(new Command("status", status)); + return this; + } + } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SuccessResponse.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SuccessResponse.java index d055d1a51b30a..56926fbca0beb 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SuccessResponse.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/SuccessResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/TemperatureConfigUpdate.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/TemperatureConfigUpdate.java index 4423d99be8b0d..93855b11da6df 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/TemperatureConfigUpdate.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/TemperatureConfigUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/User.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/User.java index bb19684b14aca..c6b476a7641bf 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/User.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/User.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Util.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Util.java index 93f1c63d54139..4da60a8775e85 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Util.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/Util.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/action/LightActions.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/action/LightActions.java index b871731870820..57fd8a12bbb0c 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/action/LightActions.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/action/LightActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/config/HueBridgeConfig.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/config/HueBridgeConfig.java index dc5c0c2c62904..59182703c9cba 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/config/HueBridgeConfig.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/config/HueBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/BridgeJsonParameters.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/BridgeJsonParameters.java index 4063dcad6d17f..f78ab8f1b92ac 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/BridgeJsonParameters.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/BridgeJsonParameters.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java index 227b4d4a169b9..8e1cbadaf365b 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeNupnpDiscovery.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeNupnpDiscovery.java index d36f5f4f61759..dbaaeb25f531d 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeNupnpDiscovery.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeNupnpDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -56,7 +56,7 @@ public class HueBridgeNupnpDiscovery extends AbstractDiscoveryService { protected static final String BRIDGE_INDICATOR = "fffe"; - private static final String DISCOVERY_URL = "https://www.meethue.com/api/nupnp"; + private static final String DISCOVERY_URL = "https://discovery.meethue.com/"; protected static final String LABEL_PATTERN = "Philips hue (IP)"; diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueLightDiscoveryService.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueLightDiscoveryService.java index 1aadba714876a..b2edab9984c61 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueLightDiscoveryService.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueLightDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,6 +45,7 @@ import org.openhab.binding.hue.internal.handler.sensors.PresenceHandler; import org.openhab.binding.hue.internal.handler.sensors.TapSwitchHandler; import org.openhab.binding.hue.internal.handler.sensors.TemperatureHandler; +import org.openhab.binding.hue.internal.handler.sensors.ClipHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,6 +60,7 @@ * @author Denis Dudnik - switched to internally integrated source of Jue library * @author Samuel Leisering - Added support for sensor API * @author Christoph Weitkamp - Added support for sensor API + * @author Meng Yiqi - Added support for CLIP sensor */ @NonNullByDefault public class HueLightDiscoveryService extends AbstractDiscoveryService @@ -66,7 +68,8 @@ public class HueLightDiscoveryService extends AbstractDiscoveryService public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.unmodifiableSet(Stream .of(HueLightHandler.SUPPORTED_THING_TYPES.stream(), DimmerSwitchHandler.SUPPORTED_THING_TYPES.stream(), TapSwitchHandler.SUPPORTED_THING_TYPES.stream(), PresenceHandler.SUPPORTED_THING_TYPES.stream(), - TemperatureHandler.SUPPORTED_THING_TYPES.stream(), LightLevelHandler.SUPPORTED_THING_TYPES.stream()) + TemperatureHandler.SUPPORTED_THING_TYPES.stream(), LightLevelHandler.SUPPORTED_THING_TYPES.stream(), + ClipHandler.SUPPORTED_THING_TYPES.stream()) .flatMap(i -> i).collect(Collectors.toSet())); private final Logger logger = LoggerFactory.getLogger(HueLightDiscoveryService.class); @@ -84,6 +87,8 @@ public class HueLightDiscoveryService extends AbstractDiscoveryService new SimpleEntry<>("color_temperature_light", "0220"), new SimpleEntry<>("zllswitch", "0820"), new SimpleEntry<>("zgpswitch", "0830"), + new SimpleEntry<>("clipgenericstatus", "0840"), + new SimpleEntry<>("clipgenericflag", "0850"), new SimpleEntry<>("zllpresence", "0107"), new SimpleEntry<>("zlltemperature", "0302"), new SimpleEntry<>("zlllightlevel", "0106") @@ -206,7 +211,6 @@ public void onLightStateChanged(@Nullable HueBridge bridge, FullLight light) { private @Nullable ThingTypeUID getThingTypeUID(FullHueObject hueObject) { String thingTypeId = TYPE_TO_ZIGBEE_ID_MAP .get(hueObject.getType().replaceAll(NORMALIZE_ID_REGEX, "_").toLowerCase()); - return thingTypeId != null ? new ThingTypeUID(BINDING_ID, thingTypeId) : null; } @@ -220,7 +224,6 @@ private void onSensorAddedInternal(FullSensor sensor) { ThingTypeUID thingTypeUID = getThingTypeUID(sensor); String modelId = sensor.getNormalizedModelID(); - if (thingUID != null && thingTypeUID != null) { ThingUID bridgeUID = hueBridgeHandler.getThing().getUID(); Map<String, Object> properties = new HashMap<>(); diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/ApiException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/ApiException.java index 608b7cc144174..fbb7c44a60f58 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/ApiException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/ApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/DeviceOffException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/DeviceOffException.java index 62f434cf5b8f7..fc6fd73437c27 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/DeviceOffException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/DeviceOffException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/EntityNotAvailableException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/EntityNotAvailableException.java index cd52ea5f77060..59de232750841 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/EntityNotAvailableException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/EntityNotAvailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/GroupTableFullException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/GroupTableFullException.java index 8a4647180353e..42de5aa4a3caa 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/GroupTableFullException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/GroupTableFullException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/InvalidCommandException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/InvalidCommandException.java index 88a85f3f3c216..3cb591dc9aa68 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/InvalidCommandException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/InvalidCommandException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/LinkButtonException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/LinkButtonException.java index aca5c52d31f9f..cbc60740b30b1 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/LinkButtonException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/LinkButtonException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/UnauthorizedException.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/UnauthorizedException.java index b3ecb41720b2b..440fd896513b0 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/UnauthorizedException.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/exceptions/UnauthorizedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueBridgeHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueBridgeHandler.java index e33c798a77dc9..655f2b8b6b7ed 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueBridgeHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -284,6 +284,24 @@ public void updateLightState(FullLight light, StateUpdate stateUpdate) { } } + @Override + public void updateSensorState(FullSensor sensor, StateUpdate stateUpdate) { + if (hueBridge != null) { + hueBridge.setSensorState(sensor, stateUpdate).thenAccept(result -> { + try { + hueBridge.handleErrors(result); + } catch (Exception e) { + handleStateUpdateException(sensor, stateUpdate, e); + } + }).exceptionally(e -> { + handleStateUpdateException(sensor, stateUpdate, e); + return null; + }); + } else { + logger.warn("No bridge connected or selected. Cannot set sensor state."); + } + } + @Override public void updateSensorConfig(FullSensor sensor, ConfigUpdate configUpdate) { if (hueBridge != null) { @@ -325,6 +343,20 @@ private void handleStateUpdateException(FullLight light, StateUpdate stateUpdate } } + private void handleStateUpdateException(FullSensor sensor, StateUpdate stateUpdate, Throwable e) { + if (e instanceof IOException) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } else if (e instanceof EntityNotAvailableException) { + logger.debug("Error while accessing sensor: {}", e.getMessage(), e); + notifySensorStatusListeners(sensor, STATE_GONE); + } else if (e instanceof ApiException) { + // This should not happen - if it does, it is most likely some bug that should be reported. + logger.warn("Error while accessing sensor: {}", e.getMessage(), e); + } else if (e instanceof IllegalStateException) { + logger.trace("Error while accessing sensor: {}", e.getMessage()); + } + } + private void handleConfigUpdateException(FullSensor sensor, ConfigUpdate configUpdate, Throwable e) { if (e instanceof IOException) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); @@ -765,8 +797,4 @@ public Collection<ConfigStatusMessage> getConfigStatus() { return configStatusMessages; } - - public long getSensorPollingInterval() { - return sensorPollingInterval; - } } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueClient.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueClient.java index 5e99717aeb8f8..6e2af114e41cb 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueClient.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -94,4 +94,12 @@ public interface HueClient { * @param configUpdate the config update */ void updateSensorConfig(FullSensor sensor, ConfigUpdate configUpdate); + + /** + * Updates the given sensor. + * + * @param sensor the sensor to be updated + * @param stateUpdate the state update + */ + void updateSensorState(FullSensor sensor, StateUpdate stateUpdate); } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueLightHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueLightHandler.java index 91220184f19ac..67251ed77e6da 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueLightHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueLightHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueSensorHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueSensorHandler.java index 5ce8c259e5c2e..520db00152ecc 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueSensorHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/HueSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,6 +42,7 @@ import org.openhab.binding.hue.internal.FullSensor; import org.openhab.binding.hue.internal.HueBridge; import org.openhab.binding.hue.internal.SensorConfigUpdate; +import org.openhab.binding.hue.internal.StateUpdate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,6 +59,7 @@ public abstract class HueSensorHandler extends BaseThingHandler implements Senso private final Logger logger = LoggerFactory.getLogger(HueSensorHandler.class); + private boolean configInitializedSuccessfully; private boolean propertiesInitializedSuccessfully; private @Nullable HueClient hueClient; @@ -148,7 +150,7 @@ public void dispose() { return null; } ThingHandler handler = bridge.getHandler(); - if (handler instanceof HueClient) { + if (handler instanceof HueBridgeHandler) { hueClient = (HueClient) handler; hueClient.registerSensorStatusListener(this); } else { @@ -160,7 +162,40 @@ public void dispose() { @Override public void handleCommand(ChannelUID channelUID, Command command) { - // no commands + handleCommand(channelUID.getId(), command); + } + + public void handleCommand(String channel, Command command) { + // updateSensorState + FullSensor sensor = getSensor(); + if (sensor == null) { + logger.debug("hue sensor not known on bridge. Cannot handle command."); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "@text/offline.conf-error-wrong-sensor-id"); + return; + } + + HueClient hueBridge = getHueClient(); + if (hueBridge == null) { + logger.warn("hue bridge handler not found. Cannot handle command without bridge."); + return; + } + + StateUpdate sensorState = new StateUpdate(); + switch (channel) { + case STATE_STATUS: + sensorState = sensorState.setStatus(((DecimalType) command).intValue()); + break; + case STATE_FLAG: + sensorState = sensorState.setFlag(OnOffType.ON.equals(command)); + break; + } + + if (sensorState != null) { + hueBridge.updateSensorState(sensor, sensorState); + } else { + logger.warn("Command sent to an unknown channel id: {}:{}", getThing().getUID(), channel); + } } @Override @@ -209,7 +244,7 @@ public void onSensorStateChanged(@Nullable HueBridge bridge, FullSensor sensor) } // update generic sensor config - Configuration config = editConfiguration(); + final Configuration config = !configInitializedSuccessfully ? editConfiguration() : getConfig(); if (sensor.getConfig().containsKey(CONFIG_ON)) { config.put(CONFIG_ON, sensor.getConfig().get(CONFIG_ON)); } @@ -229,6 +264,25 @@ public void onSensorStateChanged(@Nullable HueBridge bridge, FullSensor sensor) } } + Object status = sensor.getState().get(STATE_STATUS); + if (status != null) { + try { + DecimalType value = new DecimalType(String.valueOf(status)); + updateState(STATE_STATUS, value); + } catch (DateTimeParseException e) { + // do nothing + } + } + Object flag = sensor.getState().get(STATE_FLAG); + if (flag != null) { + try { + boolean value = Boolean.parseBoolean(String.valueOf(flag)); + updateState(CHANNEL_FLAG, value ? OnOffType.ON : OnOffType.OFF); + } catch (DateTimeParseException e) { + // do nothing + } + } + Object battery = sensor.getConfig().get(CONFIG_BATTERY); if (battery != null) { DecimalType batteryLevel = DecimalType.valueOf(String.valueOf(battery)); @@ -236,7 +290,10 @@ public void onSensorStateChanged(@Nullable HueBridge bridge, FullSensor sensor) updateState(CHANNEL_BATTERY_LOW, batteryLevel.intValue() <= 10 ? OnOffType.ON : OnOffType.OFF); } - updateConfiguration(config); + if (!configInitializedSuccessfully) { + updateConfiguration(config); + configInitializedSuccessfully = true; + } } @Override diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStateConverter.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStateConverter.java index b5d393cb7e3f8..9335088ecaaf9 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStateConverter.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStateConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStatusListener.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStatusListener.java index de5353729c80f..d82aadb455625 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStatusListener.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/LightStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/SensorStatusListener.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/SensorStatusListener.java index 85444c8514298..fdd9aa443bf60 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/SensorStatusListener.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/SensorStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/ClipHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/ClipHandler.java new file mode 100644 index 0000000000000..3d383509e8acb --- /dev/null +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/ClipHandler.java @@ -0,0 +1,52 @@ +/** + * 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.hue.internal.handler.sensors; + +import static org.openhab.binding.hue.internal.HueBindingConstants.*; + +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.openhab.binding.hue.internal.FullSensor; +import org.openhab.binding.hue.internal.HueBridge; +import org.openhab.binding.hue.internal.SensorConfigUpdate; +import org.openhab.binding.hue.internal.handler.HueSensorHandler; + +/** + * CLIP Sensor + * + * @author Meng Yiqi - Initial contribution + */ +@NonNullByDefault +public class ClipHandler extends HueSensorHandler { + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream.of(THING_TYPE_CLIP_GENERIC_STATUS, THING_TYPE_CLIP_GENERIC_FLAG).collect(Collectors.toSet()); + + public ClipHandler(Thing thing) { + super(thing); + } + + @Override + protected SensorConfigUpdate doConfigurationUpdate(Map<String, Object> configurationParameters) { + return new SensorConfigUpdate(); + } + + protected void doSensorStateChanged(@Nullable HueBridge bridge, FullSensor sensor, Configuration config) { + } +} diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/DimmerSwitchHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/DimmerSwitchHandler.java index 4afc3dac7a21e..260880fa71663 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/DimmerSwitchHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/DimmerSwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,7 +12,6 @@ */ package org.openhab.binding.hue.internal.handler.sensors; -import static org.openhab.binding.hue.internal.FullSensor.STATE_LAST_UPDATED; import static org.openhab.binding.hue.internal.HueBindingConstants.*; import java.time.Instant; @@ -25,20 +24,16 @@ import java.util.Collections; import java.util.Map; import java.util.Set; -import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.library.types.DecimalType; -import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.openhab.binding.hue.internal.FullSensor; import org.openhab.binding.hue.internal.HueBridge; import org.openhab.binding.hue.internal.SensorConfigUpdate; -import org.openhab.binding.hue.internal.handler.HueBridgeHandler; import org.openhab.binding.hue.internal.handler.HueSensorHandler; /** @@ -49,27 +44,13 @@ */ @NonNullByDefault public class DimmerSwitchHandler extends HueSensorHandler { - public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_DIMMER_SWITCH); - private long refreshIntervalInNanos = TimeUnit.MILLISECONDS.toNanos(1000); + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_DIMMER_SWITCH); public DimmerSwitchHandler(Thing thing) { super(thing); } - @Override - public void initialize() { - super.initialize(); - Bridge bridge = getBridge(); - if (bridge != null) { - ThingHandler bridgeHandler = bridge.getHandler(); - if (bridgeHandler instanceof HueBridgeHandler) { - refreshIntervalInNanos = TimeUnit.MILLISECONDS - .toNanos(((HueBridgeHandler) bridgeHandler).getSensorPollingInterval() * 2); - } - } - } - @Override protected SensorConfigUpdate doConfigurationUpdate(Map<String, Object> configurationParameters) { return new SensorConfigUpdate(); @@ -80,7 +61,7 @@ protected void doSensorStateChanged(@Nullable HueBridge bridge, FullSensor senso ZoneId zoneId = ZoneId.systemDefault(); ZonedDateTime now = ZonedDateTime.now(zoneId), timestamp = now; - Object lastUpdated = sensor.getState().get(STATE_LAST_UPDATED); + Object lastUpdated = sensor.getState().get(FullSensor.STATE_LAST_UPDATED); if (lastUpdated != null) { try { timestamp = ZonedDateTime.ofInstant( @@ -95,8 +76,9 @@ protected void doSensorStateChanged(@Nullable HueBridge bridge, FullSensor senso if (buttonState != null) { String value = String.valueOf(buttonState); updateState(CHANNEL_DIMMER_SWITCH, new DecimalType(value)); + // Avoid dispatching events if "lastupdated" is older than now minus 3 seconds (e.g. during restart) Instant then = timestamp.toInstant(); - Instant someSecondsEarlier = now.minusNanos(refreshIntervalInNanos).toInstant(); + Instant someSecondsEarlier = now.minusSeconds(3).toInstant(); if (then.isAfter(someSecondsEarlier) && then.isBefore(now.toInstant())) { triggerChannel(EVENT_DIMMER_SWITCH, value); } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/LightLevelHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/LightLevelHandler.java index 9696b061419f3..e07a549ac4cec 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/LightLevelHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/LightLevelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/PresenceHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/PresenceHandler.java index 08421cb6f4337..f8bf7354e061a 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/PresenceHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/PresenceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TapSwitchHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TapSwitchHandler.java index 680ad6a24b939..0df912e1cd5a8 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TapSwitchHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TapSwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,7 +12,6 @@ */ package org.openhab.binding.hue.internal.handler.sensors; -import static org.openhab.binding.hue.internal.FullSensor.STATE_LAST_UPDATED; import static org.openhab.binding.hue.internal.HueBindingConstants.*; import java.time.Instant; @@ -25,20 +24,16 @@ import java.util.Collections; import java.util.Map; import java.util.Set; -import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.library.types.DecimalType; -import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.openhab.binding.hue.internal.FullSensor; import org.openhab.binding.hue.internal.HueBridge; import org.openhab.binding.hue.internal.SensorConfigUpdate; -import org.openhab.binding.hue.internal.handler.HueBridgeHandler; import org.openhab.binding.hue.internal.handler.HueSensorHandler; /** @@ -48,27 +43,13 @@ */ @NonNullByDefault public class TapSwitchHandler extends HueSensorHandler { - public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_TAP_SWITCH); - private long refreshIntervalInNanos = TimeUnit.MILLISECONDS.toNanos(1000); + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_TAP_SWITCH); public TapSwitchHandler(Thing thing) { super(thing); } - @Override - public void initialize() { - super.initialize(); - Bridge bridge = getBridge(); - if (bridge != null) { - ThingHandler bridgeHandler = bridge.getHandler(); - if (bridgeHandler instanceof HueBridgeHandler) { - refreshIntervalInNanos = TimeUnit.MILLISECONDS - .toNanos(((HueBridgeHandler) bridgeHandler).getSensorPollingInterval() * 2); - } - } - } - @Override protected SensorConfigUpdate doConfigurationUpdate(Map<String, Object> configurationParameters) { return new SensorConfigUpdate(); @@ -79,7 +60,7 @@ protected void doSensorStateChanged(@Nullable HueBridge bridge, FullSensor senso ZoneId zoneId = ZoneId.systemDefault(); ZonedDateTime now = ZonedDateTime.now(zoneId), timestamp = now; - Object lastUpdated = sensor.getState().get(STATE_LAST_UPDATED); + Object lastUpdated = sensor.getState().get(FullSensor.STATE_LAST_UPDATED); if (lastUpdated != null) { try { timestamp = ZonedDateTime.ofInstant( @@ -94,8 +75,9 @@ protected void doSensorStateChanged(@Nullable HueBridge bridge, FullSensor senso if (buttonState != null) { String value = String.valueOf(buttonState); updateState(CHANNEL_TAP_SWITCH, new DecimalType(value)); + // Avoid dispatching events if "lastupdated" is older than now minus 3 seconds (e.g. during restart) Instant then = timestamp.toInstant(); - Instant someSecondsEarlier = now.minusNanos(refreshIntervalInNanos).toInstant(); + Instant someSecondsEarlier = now.minusSeconds(3).toInstant(); if (then.isAfter(someSecondsEarlier) && then.isBefore(now.toInstant())) { triggerChannel(EVENT_TAP_SWITCH, value); } diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TemperatureHandler.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TemperatureHandler.java index 3700f0ce1e88a..7b73e153dcc80 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TemperatureHandler.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/handler/sensors/TemperatureHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericFlagSensor.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericFlagSensor.xml new file mode 100644 index 0000000000000..d16cc4ef435cb --- /dev/null +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericFlagSensor.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="hue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- CLIP Generic Flag Sensor --> + <thing-type id="0850"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>CLIP Generic Flag Sensor</label> + <description>A generic sensor object for IP sensor use.</description> + + <channels> + <channel id="flag" typeId="flag" /> + <channel id="last_updated" typeId="last_updated" /> + </channels> + + <representation-property>uniqueId</representation-property> + + <config-description> + <parameter name="sensorId" type="text"> + <label>Sensor ID</label> + <description>The identifier that is used within the hue bridge.</description> + <required>true</required> + </parameter> + <parameter name="on" type="boolean"> + <label>Sensor Status</label> + <description>Enables or disables the sensor.</description> + </parameter> + </config-description> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericStatusSensor.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericStatusSensor.xml new file mode 100644 index 0000000000000..5d134b91e2bd4 --- /dev/null +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/CLIPGenericStatusSensor.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="hue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- CLIP Generic Status Sensor --> + <thing-type id="0840"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>CLIP Generic Status Sensor</label> + <description>A generic sensor object for IP sensor use.</description> + + <channels> + <channel id="status" typeId="status" /> + <channel id="last_updated" typeId="last_updated" /> + </channels> + + <representation-property>uniqueId</representation-property> + + <config-description> + <parameter name="sensorId" type="text"> + <label>Sensor ID</label> + <description>The identifier that is used within the hue bridge.</description> + <required>true</required> + </parameter> + <parameter name="on" type="boolean"> + <label>Sensor Status</label> + <description>Enables or disables the sensor.</description> + </parameter> + </config-description> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorLight.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorLight.xml index e88ea522c13f3..4e11fcb6b3137 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorLight.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorLight.xml @@ -27,7 +27,7 @@ <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0" step="100"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>400</default> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorTemperatureLight.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorTemperatureLight.xml index 94cda88e1492e..625294b8daa0c 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorTemperatureLight.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ColorTemperatureLight.xml @@ -28,7 +28,7 @@ <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0" step="100"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>400</default> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmableLight.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmableLight.xml index 32ea6def9fabe..9e06ea5256352 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmableLight.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmableLight.xml @@ -26,7 +26,7 @@ <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0" step="100"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>400</default> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmablePlug.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmablePlug.xml index abefbbaaf59f0..1678e02a05f36 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmablePlug.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/DimmablePlug.xml @@ -25,7 +25,7 @@ <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0" step="100"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>400</default> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ExtendedColorLight.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ExtendedColorLight.xml index ea9d5bdf1db93..943eb01508d42 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ExtendedColorLight.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/ExtendedColorLight.xml @@ -28,7 +28,7 @@ <required>true</required> </parameter> <parameter name="fadetime" type="integer" min="0" step="100"> - <label>Fade time</label> + <label>Fade Time</label> <description>Fade time in ms for changing values</description> <default>400</default> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/bridge.xml index 8425eba42d0e3..a291b3676a9b4 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/bridge.xml @@ -20,7 +20,7 @@ <description>Network address of the Hue bridge.</description> <required>true</required> </parameter> - <parameter name="port" type="integer" required="false" min="0" max="65335"> + <parameter name="port" type="integer" required="false" min="1" max="65535"> <label>Port</label> <description>Port of the Hue bridge.</description> </parameter> diff --git a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/channels.xml index 94f0fb2adcd2d..c284b4364350c 100644 --- a/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.hue/src/main/resources/ESH-INF/thing/channels.xml @@ -199,4 +199,18 @@ <description>The effect channel allows putting the bulb in a color looping mode.</description> <category>ColorLight</category> </channel-type> + + <!-- CLIP Sensor --> + <channel-type id="status"> + <item-type>Number</item-type> + <label>Status</label> + <description>Status of CLIP sensor.</description> + </channel-type> + + <channel-type id="flag"> + <item-type>Switch</item-type> + <label>Flag</label> + <description>Flag of CLIP sensor.</description> + </channel-type> + </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/ApiVersionTest.java b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/ApiVersionTest.java index 40c605238311a..416ff4734e945 100644 --- a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/ApiVersionTest.java +++ b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/ApiVersionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/LightStateConverterTest.java b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/LightStateConverterTest.java index d1a1f5e9050a8..c594b753e13ab 100644 --- a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/LightStateConverterTest.java +++ b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/LightStateConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightHandlerTest.java b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightHandlerTest.java index f19dd95dfdcf3..93762e189f4ef 100644 --- a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightHandlerTest.java +++ b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightState.java b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightState.java index 3effc1d936460..bea34cc26da18 100644 --- a/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightState.java +++ b/bundles/org.openhab.binding.hue/src/test/java/org/openhab/binding/hue/internal/handler/HueLightState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.azureiothub/.classpath b/bundles/org.openhab.binding.hydrawise/.classpath similarity index 100% rename from bundles/org.openhab.io.azureiothub/.classpath rename to bundles/org.openhab.binding.hydrawise/.classpath diff --git a/bundles/org.openhab.binding.hydrawise/.project b/bundles/org.openhab.binding.hydrawise/.project new file mode 100644 index 0000000000000..8ff109aed825d --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.hydrawise</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> diff --git a/bundles/org.openhab.binding.hydrawise/NOTICE b/bundles/org.openhab.binding.hydrawise/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.hydrawise/README.md b/bundles/org.openhab.binding.hydrawise/README.md new file mode 100644 index 0000000000000..dfa54679cf444 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/README.md @@ -0,0 +1,171 @@ +# Hydrawise Binding + +![API Key](doc/logo.png) + +The Hydrawise binding allows monitoring and control of [Hunter Industries's](https://www.hunterindustries.com/) line of [Hydrawise](https://www.hydrawise.com) internet connected irrigation systems. + +## Supported Things + +### Cloud Thing + +The Cloud Thing type is the primary way most users will control and monitor their irrigation system. +This allows full control over zones, sensors and weather forecasts. +Changes made through this Thing type will be reflected in the Hydrawise mobile and web applications as well as in their reporting modules. + +#### Cloud Thing Supported Channel Groups + +| channel group ID | +|---------------------------------------| +| [Zones](#Zone-Channel-Group) | +| [All Zones](#All-Zones-Channel-Group) | +| [Sensor](#Sensor-Channel-Group) | +| [Forecast](#Sensor-Channel-Group) | + +### Local Thing + +The Local Thing type uses an undocumented API that allows direct HTTP access to a irrigation controller on the user's network. +This provides a subset of features compared to the Cloud Thing type limited to basic zone control. +Controlling zones through the local API will not be reported back to the cloud service or the Hydrawise mobile/web applications, and reporting functionality will not reflect the locally controlled state. + +Use Cases + +* The Local thing can be useful when testing zones, as there is no delay when starting/stopping zones as compared to the cloud API which can take anywhere between 5-15 seconds. +* This is also useful if you wish to not use the cloud scheduling at all and use openHAB as the irrigation scheduling system. + +#### Local Thing Supported Channel Groups + +| channel group ID | +|---------------------------------------| +| [Zones](#Zone-Channel-Group) | +| [All Zones](#All-Zones-Channel-Group) | + +## Thing Configuration + +### Cloud Thing + +| Configuration Name | type | required | Comments | +|--------------------|---------|----------|------------------------------------------------------------------------------------| +| apiKey | String | True | | +| refresh | Integer | True | Defaults to a 30 seconds polling rate | +| controllerId | Integer | False | Optional id of the controller if you have more then one registered to your account | + +To obtain your API key, log into your [Hydrawsie Account](https://app.hydrawise.com/config/login) and click on your account icon, then account details: + +![Account](doc/settings.png) + +Then copy the API key shown here: + +![API Key](doc/apikey.png) + +### Local Thing + +| Configuration Name | type | required | Comments | +|--------------------|---------|----------|-----------------------------------------------------------------------------------------------------------------| +| host | String | True | IP or host name of the controller on your network | +| username | String | True | User name (usually admin) set on the touch panel of the controller | +| password | String | True | Password set on the touch panel of the controller. This can be found under the setting menu on the controller. | +| refresh | Integer | True | Defaults to a 30 seconds polling rate | + +## Channels + +### Channel Groups + +#### Zone Channel Group + +Up to 36 total zones are supported per Local or Cloud thing + +| channel group ID | Description | +|------------------|---------------------------| +| zone1 | Zone 1 channel group | +| zone2 | Zone 1 channel group | +| ... | Zone 3 - 35 channel group | +| zone36 | Zone 36 channel group | + +#### Sensor Channel Group + +Up to 4 total sensors are supported per Cloud Thing + +| channel group ID | Description | +|------------------|------------------------| +| sensor1 | Sensor 1 channel group | +| sensor2 | Sensor 2 channel group | +| sensor3 | Sensor 3 channel group | +| sensor4 | Sensor 4 channel group | + +#### Forecast Channel Group + +Up to 4 total weather forecasts are supported per Cloud Thing + +| channel group ID | Description | +|------------------|-----------------| +| forecast1 | Todays Forecast | +| forecast2 | Day 2 Forecast | +| forecast3 | Day 3 Forecast | +| forecast4 | Day 4 Forecast | + +#### All Zones Channel Group + +A single all zone group are supported per Cloud or Local Thing + +| channel group ID | Description | +|------------------|------------------------| +| allzones | commands for all zones | + + +### Channels + +| channel ID | type | Groups | description | Read Write | +|-----------------|--------------------|----------------|---------------------------------------------|------------| +| name | String | zone, sensor | Descriptive name | R | +| icon | String | zone | Icon URL | R | +| time | Number | zone | Zone start time in seconds | R | +| type | Number | zone | Zone type | R | +| runcustom | Number | zone, allzones | Run zone for custom number of seconds | W | +| run | Switch | zone, allzones | Run/Start zone | RW | +| nextrun | DateTime | zone | Next date and time this zone will run | R | +| timeleft | Number | zone | Amount of seconds left for the running zone | R | +| input | Number | sensor | Sensor input type | R | +| mode | Number | sensor | Sensor mode | R | +| timer | Number | sensor | Sensor timer | R | +| offtimer | Number | sensor | Sensor off time | R | +| offlevel | Number | sensor | Sensor off level | R | +| active | Switch | sensor | Is sensor active / triggered | R | +| temperaturehigh | Number:Temperature | forecast | Daily high temperature | R | +| temperaturelow | Number:Temperature | forecast | Daily low temperature | R | +| conditions | String | forecast | Daily conditions description | R | +| day | String | forecast | Day of week of forecast (Mon-Sun) | R | +| humidity | Number | forecast | Daily humidity percentage | R | +| wind | Number:Speed | forecast | Daily wind speed | R | + +## Full Example + +``` +Group SprinklerZones +Group SprinklerZone1 "1 Front Office Yard" (SprinklerZones) +String SprinklerZone1Name "1 Front Office Yard name" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#name"} +Switch SprinklerZone1Run "1 Front Office Yard Run" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#run"} +Switch SprinklerZone1RunLocal "1 Front Office Yard Run (local)" (SprinklerZone1) {channel="hydrawise:local:home:zone1#run"} +Number SprinklerZone1RunCustom "1 Front Office Yard Run Custom" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#runcustom"} +DateTime SprinklerZone1StartTime "1 Front Office Yard Start Time [%s]" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#nextruntime"} +Number SprinklerZone1TimeLeft "1 Front Office Yard Time Left" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#timeleft"} +String SprinklerZone1Icon "1 Front Office Yard Icon" (SprinklerZone1) {channel="hydrawise:cloud:home:zone1#icon"} + +Group SprinklerZone2 "2 Back Circle Lawn" (SprinklerZones) +String SprinklerZone2Name "2 Back Circle Lawn name" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#name"} +Switch SprinklerZone2Run "2 Back Circle Lawn Run" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#run"} +Switch SprinklerZone2RunLocal "2 Back Circle Lawn Run (local)" (SprinklerZone2) {channel="hydrawise:local:home:zone2#run"} +Number SprinklerZone2RunCustom "2 Back Circle Lawn Run Custom" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#runcustom"} +DateTime SprinklerZone2StartTime "2 Back Circle Lawn Start Time" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#nextruntime"} +Number SprinklerZone2TimeLeft "2 Back Circle Lawn Time Left" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#timeleft"} +String SprinklerZone2Icon "2 Back Circle Lawn Icon" (SprinklerZone2) {channel="hydrawise:cloud:home:zone2#icon"} + +Group SprinklerZone3 "3 Left of Drive Lawn" (SprinklerZones) +String SprinklerZone3Name "3 Left of Drive Lawn name" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#name"} +Switch SprinklerZone3Run "3 Left of Drive Lawn Run" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#run"} +Switch SprinklerZone3RunLocal "3 Left of Drive Lawn Run (local)" (SprinklerZone3) {channel="hydrawise:local:home:zone3#run"} +Number SprinklerZone3RunCustom "3 Left of Drive Lawn Run Custom" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#runcustom"} +DateTime SprinklerZone3StartTime "3 Left of Drive Lawn Start Time" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#nextruntime"} +Number SprinklerZone3TimeLeft "3 Left of Drive Lawn Time Left" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#timeleft"} +String SprinklerZone3Icon "3 Left of Drive Lawn Icon" (SprinklerZone3) {channel="hydrawise:cloud:home:zone3#icon"} +``` + diff --git a/bundles/org.openhab.binding.hydrawise/doc/apikey.png b/bundles/org.openhab.binding.hydrawise/doc/apikey.png new file mode 100644 index 0000000000000..8e2b420fdc2f3 Binary files /dev/null and b/bundles/org.openhab.binding.hydrawise/doc/apikey.png differ diff --git a/bundles/org.openhab.binding.hydrawise/doc/logo.png b/bundles/org.openhab.binding.hydrawise/doc/logo.png new file mode 100644 index 0000000000000..a7863c9450493 Binary files /dev/null and b/bundles/org.openhab.binding.hydrawise/doc/logo.png differ diff --git a/bundles/org.openhab.binding.hydrawise/doc/settings.png b/bundles/org.openhab.binding.hydrawise/doc/settings.png new file mode 100644 index 0000000000000..8337151e499ee Binary files /dev/null and b/bundles/org.openhab.binding.hydrawise/doc/settings.png differ diff --git a/bundles/org.openhab.binding.hydrawise/pom.xml b/bundles/org.openhab.binding.hydrawise/pom.xml new file mode 100644 index 0000000000000..6a5035eb0e68b --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/pom.xml @@ -0,0 +1,15 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.hydrawise</artifactId> + + <name>openHAB Add-ons :: Bundles :: Hydrawise Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.hydrawise/src/main/feature/feature.xml b/bundles/org.openhab.binding.hydrawise/src/main/feature/feature.xml new file mode 100644 index 0000000000000..5db2f38481787 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.hydrawise-${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-hydrawise" description="Hydrawise Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.hydrawise/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseBindingConstants.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseBindingConstants.java new file mode 100644 index 0000000000000..309002526901d --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseBindingConstants.java @@ -0,0 +1,70 @@ +/** + * 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.hydrawise.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link HydrawiseBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public class HydrawiseBindingConstants { + + private static final String BINDING_ID = "hydrawise"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_CLOUD = new ThingTypeUID(BINDING_ID, "cloud"); + public static final ThingTypeUID THING_TYPE_LOCAL = new ThingTypeUID(BINDING_ID, "local"); + + public static final String BASE_IMAGE_URL = "https://app.hydrawise.com/config/images/"; + + public static final String CHANNEL_GROUP_ALLZONES = "allzones"; + public static final String CHANNEL_ZONE_RUN_CUSTOM = "runcustom"; + public static final String CHANNEL_ZONE_RUN = "run"; + public static final String CHANNEL_ZONE_STOP = "stop"; + public static final String CHANNEL_ZONE_SUSPEND = "suspend"; + public static final String CHANNEL_ZONE_NAME = "name"; + public static final String CHANNEL_ZONE_ICON = "icon"; + public static final String CHANNEL_ZONE_LAST_WATER = "lastwater"; + public static final String CHANNEL_ZONE_TIME = "time"; + public static final String CHANNEL_ZONE_TYPE = "type"; + public static final String CHANNEL_ZONE_NEXT_RUN_TIME_TIME = "nextruntime"; + public static final String CHANNEL_ZONE_TIME_LEFT = "timeleft"; + public static final String CHANNEL_RUN_ALL_ZONES = "runall"; + public static final String CHANNEL_STOP_ALL_ZONES = "stopall"; + public static final String CHANNEL_SUSPEND_ALL_ZONES = "suspendall"; + public static final String CHANNEL_SENSOR_NAME = "name"; + public static final String CHANNEL_SENSOR_INPUT = "input"; + public static final String CHANNEL_SENSOR_MODE = "mode"; + public static final String CHANNEL_SENSOR_TIMER = "timer"; + public static final String CHANNEL_SENSOR_OFFTIMER = "offtimer"; + public static final String CHANNEL_SENSOR_OFFLEVEL = "offlevel"; + public static final String CHANNEL_SENSOR_ACTIVE = "active"; + public static final String CHANNEL_FORECAST_TEMPERATURE_HIGH = "temperaturehigh"; + public static final String CHANNEL_FORECAST_TEMPERATURE_LOW = "temperaturelow"; + public static final String CHANNEL_FORECAST_CONDITIONS = "conditions"; + public static final String CHANNEL_FORECAST_DAY = "day"; + public static final String CHANNEL_FORECAST_HUMIDITY = "humidity"; + public static final String CHANNEL_FORECAST_WIND = "wind"; + public static final String CHANNEL_FORECAST_ICON = "icon"; + public static final String PROPERTY_CONTROLLER_ID = "controller"; + public static final String PROPERTY_NAME = "name"; + public static final String PROPERTY_DESCRIPTION = "description"; + public static final String PROPERTY_LOCATION = "location"; + public static final String PROPERTY_ADDRESS = "address"; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudConfiguration.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudConfiguration.java new file mode 100644 index 0000000000000..722e01ec14e14 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudConfiguration.java @@ -0,0 +1,36 @@ +/** + * 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.hydrawise.internal; + +/** + * The {@link HydrawiseCloudConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Dan Cunningham - Initial contribution + */ +public class HydrawiseCloudConfiguration { + + /** + * Customer API key {@link https://app.hydrawise.com/config/account} + */ + public String apiKey; + + /** + * refresh interval in seconds. + */ + public Integer refresh; + + /** + * optional id of the controller to connect to + */ + public Integer controllerId; +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudHandler.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudHandler.java new file mode 100644 index 0000000000000..43a10e3c8e064 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseCloudHandler.java @@ -0,0 +1,244 @@ +/** + * 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.hydrawise.internal; + +import static org.openhab.binding.hydrawise.internal.HydrawiseBindingConstants.*; + +import java.util.List; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.measure.quantity.Speed; +import javax.measure.quantity.Temperature; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.Thing; +import org.openhab.binding.hydrawise.internal.api.HydrawiseAuthenticationException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseCloudApiClient; +import org.openhab.binding.hydrawise.internal.api.HydrawiseCommandException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException; +import org.openhab.binding.hydrawise.internal.api.model.Controller; +import org.openhab.binding.hydrawise.internal.api.model.CustomerDetailsResponse; +import org.openhab.binding.hydrawise.internal.api.model.Forecast; +import org.openhab.binding.hydrawise.internal.api.model.Relay; +import org.openhab.binding.hydrawise.internal.api.model.StatusScheduleResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link HydrawiseCloudHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public class HydrawiseCloudHandler extends HydrawiseHandler { + /** + * 74.2 F + */ + private static final Pattern TEMPERATURE_PATTERN = Pattern.compile("^(\\d{1,3}.?\\d?)\\s([C,F])"); + /** + * 9 mph + */ + private static final Pattern WIND_SPEED_PATTERN = Pattern.compile("^(\\d{1,3})\\s([a-z]{3})"); + private final Logger logger = LoggerFactory.getLogger(HydrawiseCloudHandler.class); + private HydrawiseCloudApiClient client; + private int controllerId; + + public HydrawiseCloudHandler(Thing thing, HttpClient httpClient) { + super(thing); + this.client = new HydrawiseCloudApiClient(httpClient); + } + + @Override + protected void configure() + throws NotConfiguredException, HydrawiseConnectionException, HydrawiseAuthenticationException { + HydrawiseCloudConfiguration configuration = getConfig().as(HydrawiseCloudConfiguration.class); + + this.refresh = Math.max(configuration.refresh, MIN_REFRESH_SECONDS); + + client.setApiKey(configuration.apiKey); + + CustomerDetailsResponse customerDetails = client.getCustomerDetails(); + + List<Controller> controllers = customerDetails.controllers; + if (controllers.isEmpty()) { + throw new NotConfiguredException("No controllers found on account"); + } + + Controller controller = null; + // try and use ID from user configuration + if (configuration.controllerId != null) { + controller = getController(configuration.controllerId.intValue(), controllers); + if (controller == null) { + throw new NotConfiguredException("No controller found for id " + configuration.controllerId); + } + } else { + // try and use ID from saved property + String controllerId = getThing().getProperties().get(PROPERTY_CONTROLLER_ID); + if (StringUtils.isNotBlank(controllerId)) { + try { + controller = getController(Integer.parseInt(controllerId), controllers); + + } catch (NumberFormatException e) { + logger.debug("Can not parse property vaue {}", controllerId); + } + } + // use current controller ID + if (controller == null) { + controller = getController(customerDetails.controllerId, controllers); + } + } + + if (controller == null) { + throw new NotConfiguredException("No controller found"); + } + + controllerId = controller.controllerId.intValue(); + updateControllerProperties(controller); + logger.debug("Controller id {}", controllerId); + } + + /** + * Poll the controller for updates. + */ + @Override + protected void pollController() throws HydrawiseConnectionException, HydrawiseAuthenticationException { + List<Controller> controllers = client.getCustomerDetails().controllers; + Controller controller = getController(controllerId, controllers); + if (controller != null && !controller.online) { + throw new HydrawiseConnectionException("Controller is offline"); + } + StatusScheduleResponse status = client.getStatusSchedule(controllerId); + updateSensors(status); + updateForecast(status); + updateZones(status); + } + + @Override + protected void sendRunCommand(int seconds, @Nullable Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + if (relay != null) { + client.runRelay(seconds, relay.relayId); + } + } + + @Override + protected void sendRunCommand(@Nullable Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + if (relay != null) { + client.runRelay(relay.relayId); + } + } + + @Override + protected void sendStopCommand(@Nullable Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + if (relay != null) { + client.stopRelay(relay.relayId); + } + + } + + @Override + protected void sendRunAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runAllRelays(controllerId); + } + + @Override + protected void sendRunAllCommand(int seconds) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runAllRelays(seconds, controllerId); + } + + @Override + protected void sendStopAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.stopAllRelays(controllerId); + } + + private void updateSensors(StatusScheduleResponse status) { + status.sensors.forEach(sensor -> { + String group = "sensor" + sensor.input; + updateGroupState(group, CHANNEL_SENSOR_ACTIVE, sensor.active > 0 ? OnOffType.ON : OnOffType.OFF); + updateGroupState(group, CHANNEL_SENSOR_MODE, new DecimalType(sensor.type)); + updateGroupState(group, CHANNEL_SENSOR_NAME, new StringType(sensor.name)); + updateGroupState(group, CHANNEL_SENSOR_OFFLEVEL, new DecimalType(sensor.offlevel)); + updateGroupState(group, CHANNEL_SENSOR_OFFTIMER, new DecimalType(sensor.offtimer)); + updateGroupState(group, CHANNEL_SENSOR_TIMER, new DecimalType(sensor.timer)); + }); + } + + private void updateForecast(StatusScheduleResponse status) { + int i = 1; + for (Forecast forecast : status.forecast) { + String group = "forecast" + (i++); + updateGroupState(group, CHANNEL_FORECAST_CONDITIONS, new StringType(forecast.conditions)); + updateGroupState(group, CHANNEL_FORECAST_DAY, new StringType(forecast.day)); + updateGroupState(group, CHANNEL_FORECAST_HUMIDITY, new DecimalType(forecast.humidity)); + updateTemperature(forecast.tempHi, group, CHANNEL_FORECAST_TEMPERATURE_HIGH); + updateTemperature(forecast.tempLo, group, CHANNEL_FORECAST_TEMPERATURE_LOW); + updateWindspeed(forecast.wind, group, CHANNEL_FORECAST_WIND); + } + } + + private void updateTemperature(String tempString, String group, String channel) { + Matcher matcher = TEMPERATURE_PATTERN.matcher(tempString); + if (matcher.matches()) { + try { + updateGroupState(group, channel, new QuantityType<Temperature>(Double.valueOf(matcher.group(1)), + "C".equals(matcher.group(2)) ? SIUnits.CELSIUS : ImperialUnits.FAHRENHEIT)); + } catch (NumberFormatException e) { + logger.debug("Could not parse temperature string {} ", tempString); + } + } + } + + private void updateWindspeed(String windString, String group, String channel) { + Matcher matcher = WIND_SPEED_PATTERN.matcher(windString); + if (matcher.matches()) { + try { + updateGroupState(group, channel, new QuantityType<Speed>(Integer.parseInt(matcher.group(1)), + "kph".equals(matcher.group(2)) ? SIUnits.KILOMETRE_PER_HOUR : ImperialUnits.MILES_PER_HOUR)); + } catch (NumberFormatException e) { + logger.debug("Could not parse wind string {} ", windString); + } + } + } + + private void updateControllerProperties(Controller controller) { + getThing().setProperty(PROPERTY_CONTROLLER_ID, String.valueOf(controller.controllerId)); + getThing().setProperty(PROPERTY_NAME, controller.name); + getThing().setProperty(PROPERTY_DESCRIPTION, controller.description); + getThing().setProperty(PROPERTY_LOCATION, controller.latitude + "," + controller.longitude); + getThing().setProperty(PROPERTY_ADDRESS, controller.address); + } + + private @Nullable Controller getController(int controllerId, List<Controller> controllers) { + Optional<@NonNull Controller> optionalController = controllers.stream() + .filter(c -> controllerId == c.controllerId.intValue()).findAny(); + return optionalController.isPresent() ? optionalController.get() : null; + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandler.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandler.java new file mode 100644 index 0000000000000..324cae403a68c --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandler.java @@ -0,0 +1,325 @@ +/** + * 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.hydrawise.internal; + +import static org.openhab.binding.hydrawise.internal.HydrawiseBindingConstants.*; + +import java.time.ZonedDateTime; +import java.time.temporal.ChronoUnit; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.hydrawise.internal.api.HydrawiseAuthenticationException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseCommandException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException; +import org.openhab.binding.hydrawise.internal.api.model.LocalScheduleResponse; +import org.openhab.binding.hydrawise.internal.api.model.Relay; +import org.openhab.binding.hydrawise.internal.api.model.Running; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link HydrawiseHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public abstract class HydrawiseHandler extends BaseThingHandler { + + private final Logger logger = LoggerFactory.getLogger(HydrawiseHandler.class); + private @Nullable ScheduledFuture<?> pollFuture; + private Map<String, State> stateMap = Collections.synchronizedMap(new HashMap<>()); + private Map<String, Relay> relayMap = Collections.synchronizedMap(new HashMap<>()); + + /** + * value observed being used by the Hydrawise clients as a max time value, + */ + private static long MAX_RUN_TIME = 157680000; + + /** + * Minimum amount of time we can poll for updates + */ + protected static final int MIN_REFRESH_SECONDS = 5; + + /** + * Minimum amount of time we can poll after a command + */ + protected static final int COMMAND_REFRESH_SECONDS = 5; + + /** + * Our poll rate + */ + protected int refresh; + + /** + * Future to poll for updated + */ + + public HydrawiseHandler(Thing thing) { + super(thing); + } + + @SuppressWarnings({ "null", "unused" }) // compiler does not like relayMap.get can return null + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.warn("Controller is NOT ONLINE and is not responding to commands"); + return; + } + + // remove our cached state for this, will be safely updated on next poll + stateMap.remove(channelUID.getAsString()); + + if (command instanceof RefreshType) { + // we already removed this from the cache + return; + } + + String group = channelUID.getGroupId(); + String channelId = channelUID.getIdWithoutGroup(); + boolean allCommand = CHANNEL_GROUP_ALLZONES.equals(group); + + Relay relay = relayMap.get(group); + if (!allCommand && relay == null) { + logger.debug("Zone not found {}", group); + return; + } + + try { + clearPolling(); + switch (channelId) { + case CHANNEL_ZONE_RUN_CUSTOM: + if (!(command instanceof DecimalType)) { + logger.warn("Invalid command type for run custom {}", command.getClass().getName()); + return; + } + if (allCommand) { + sendRunAllCommand(((DecimalType) command).intValue()); + } else { + sendRunCommand(((DecimalType) command).intValue(), relay); + } + break; + case CHANNEL_ZONE_RUN: + if (!(command instanceof OnOffType)) { + logger.warn("Invalid command type for run {}", command.getClass().getName()); + return; + } + if (allCommand) { + if (command == OnOffType.ON) { + sendRunAllCommand(); + } else { + sendStopAllCommand(); + } + } else { + if (command == OnOffType.ON) { + sendRunCommand(relay); + } else { + sendStopCommand(relay); + } + } + break; + } + initPolling(COMMAND_REFRESH_SECONDS); + } catch (HydrawiseCommandException | HydrawiseConnectionException e) { + logger.debug("Could not issue command", e); + initPolling(COMMAND_REFRESH_SECONDS); + } catch (HydrawiseAuthenticationException e) { + logger.debug("Credentials not valid"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Credentials not valid"); + configureInternal(); + } + } + + @Override + public void initialize() { + scheduler.schedule(this::configureInternal, 0, TimeUnit.SECONDS); + } + + @Override + public void dispose() { + logger.debug("Handler disposed."); + clearPolling(); + } + + @Override + public void channelLinked(ChannelUID channelUID) { + // clear our cached value so the new channel gets updated on the next poll + stateMap.remove(channelUID.getId()); + } + + protected abstract void configure() + throws NotConfiguredException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void pollController() throws HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendRunCommand(int seconds, Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendRunCommand(Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendStopCommand(Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendRunAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendRunAllCommand(int seconds) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected abstract void sendStopAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException; + + protected void updateZones(LocalScheduleResponse status) { + ZonedDateTime now = ZonedDateTime.now().truncatedTo(ChronoUnit.SECONDS); + status.relays.forEach(r -> { + String group = "zone" + r.getRelayNumber(); + relayMap.put(group, r); + logger.trace("Updateing Zone {} {} ", group, r.name); + updateGroupState(group, CHANNEL_ZONE_NAME, new StringType(r.name)); + updateGroupState(group, CHANNEL_ZONE_TYPE, new DecimalType(r.type)); + updateGroupState(group, CHANNEL_ZONE_TIME, + r.runTimeSeconds != null ? new DecimalType(r.runTimeSeconds) : UnDefType.UNDEF); + if (StringUtils.isNotBlank(r.icon)) { + updateGroupState(group, CHANNEL_ZONE_ICON, new StringType(BASE_IMAGE_URL + r.icon)); + } + if (r.time >= MAX_RUN_TIME) { + updateGroupState(group, CHANNEL_ZONE_NEXT_RUN_TIME_TIME, UnDefType.UNDEF); + } else { + updateGroupState(group, CHANNEL_ZONE_NEXT_RUN_TIME_TIME, + new DateTimeType(now.plusSeconds(r.time).truncatedTo(ChronoUnit.MINUTES))); + } + + Optional<Running> running = status.running.stream() + .filter(z -> Integer.parseInt(z.relayId) == r.relayId.intValue()).findAny(); + if (running.isPresent()) { + updateGroupState(group, CHANNEL_ZONE_RUN, OnOffType.ON); + updateGroupState(group, CHANNEL_ZONE_TIME_LEFT, new DecimalType(running.get().timeLeft)); + logger.debug("{} Time Left {}", r.name, running.get().timeLeft); + + } else { + updateGroupState(group, CHANNEL_ZONE_RUN, OnOffType.OFF); + updateGroupState(group, CHANNEL_ZONE_TIME_LEFT, new DecimalType(0)); + + } + + updateGroupState(CHANNEL_GROUP_ALLZONES, CHANNEL_ZONE_RUN, + status.running.size() > 0 ? OnOffType.ON : OnOffType.OFF); + }); + } + + protected void updateGroupState(String group, String channelID, State state) { + String channelName = group + "#" + channelID; + State oldState = stateMap.put(channelName, state); + if (!state.equals(oldState)) { + ChannelUID channelUID = new ChannelUID(this.getThing().getUID(), channelName); + logger.debug("updateState updating {} {}", channelUID, state); + updateState(channelUID, state); + } + } + + @SuppressWarnings("serial") + @NonNullByDefault + protected class NotConfiguredException extends Exception { + NotConfiguredException(String message) { + super(message); + } + } + + private boolean isFutureValid(@Nullable ScheduledFuture<?> future) { + return future != null && !future.isCancelled(); + } + + private void configureInternal() { + clearPolling(); + stateMap.clear(); + relayMap.clear(); + try { + configure(); + initPolling(0); + } catch (NotConfiguredException e) { + logger.debug("Configuration error {}", e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); + } catch (HydrawiseConnectionException e) { + logger.debug("Could not connect to service"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } catch (HydrawiseAuthenticationException e) { + logger.debug("Credentials not valid"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Credentials not valid"); + } + } + + /** + * Starts/Restarts polling with an initial delay. This allows changes in the poll cycle for when commands are sent + * and we need to poll sooner then the next refresh cycle. + */ + private synchronized void initPolling(int initalDelay) { + clearPolling(); + pollFuture = scheduler.scheduleWithFixedDelay(this::pollControllerInternal, initalDelay, refresh, + TimeUnit.SECONDS); + } + + /** + * Stops/clears this thing's polling future + */ + private void clearPolling() { + ScheduledFuture<?> localFuture = pollFuture; + if (isFutureValid(localFuture)) { + if (localFuture != null) { + localFuture.cancel(false); + } + } + } + + /** + * Poll the controller for updates. + */ + private void pollControllerInternal() { + try { + pollController(); + if (getThing().getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + } catch (HydrawiseConnectionException e) { + // poller will continue to run, set offline until next run + logger.debug("Exception polling", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } catch (HydrawiseAuthenticationException e) { + // if are creds are not valid, we need to try re authorizing again + logger.debug("Authorization exception during polling", e); + configureInternal(); + } + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandlerFactory.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandlerFactory.java new file mode 100644 index 0000000000000..cf459c0b9ddbb --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseHandlerFactory.java @@ -0,0 +1,76 @@ +/** + * 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.hydrawise.internal; + +import static org.openhab.binding.hydrawise.internal.HydrawiseBindingConstants.*; + +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link HydrawiseHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.hydrawise", service = ThingHandlerFactory.class) +public class HydrawiseHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream.of(THING_TYPE_CLOUD, THING_TYPE_LOCAL) + .collect(Collectors.toSet()); + + private @NonNullByDefault({}) HttpClient httpClient; + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (THING_TYPE_CLOUD.equals(thingTypeUID)) { + return new HydrawiseCloudHandler(thing, httpClient); + } + + if (THING_TYPE_LOCAL.equals(thingTypeUID)) { + return new HydrawiseLocalHandler(thing, httpClient); + } + + return null; + } + + @Reference + protected void setHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + + protected void unsetHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = null; + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalConfiguration.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalConfiguration.java new file mode 100644 index 0000000000000..338059702fa1a --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalConfiguration.java @@ -0,0 +1,39 @@ +/** + * 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.hydrawise.internal; + +/** + * The {@link HydrawiseLocalConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Dan Cunningham - Initial contribution + */ +public class HydrawiseLocalConfiguration { + + /** + * Host or IP for local controller + */ + public String host; + /** + * User name (admin) for local controller + */ + public String username; + /** + * Password for local controller + */ + public String password; + + /** + * refresh interval in seconds. + */ + public int refresh; +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalHandler.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalHandler.java new file mode 100644 index 0000000000000..7db82979ed286 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/HydrawiseLocalHandler.java @@ -0,0 +1,92 @@ +/** + * 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.hydrawise.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.thing.Thing; +import org.openhab.binding.hydrawise.internal.api.HydrawiseAuthenticationException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseCommandException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseConnectionException; +import org.openhab.binding.hydrawise.internal.api.HydrawiseLocalApiClient; +import org.openhab.binding.hydrawise.internal.api.model.Relay; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link HydrawiseLocalHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public class HydrawiseLocalHandler extends HydrawiseHandler { + private final Logger logger = LoggerFactory.getLogger(HydrawiseLocalHandler.class); + HydrawiseLocalApiClient client; + + public HydrawiseLocalHandler(Thing thing, HttpClient httpClient) { + super(thing); + client = new HydrawiseLocalApiClient(httpClient); + } + + @Override + protected void configure() throws HydrawiseConnectionException, HydrawiseAuthenticationException { + HydrawiseLocalConfiguration configuration = getConfig().as(HydrawiseLocalConfiguration.class); + this.refresh = Math.max(configuration.refresh, MIN_REFRESH_SECONDS); + logger.trace("Connecting to host {}", configuration.host); + client.setCredentials(configuration.host, configuration.username, configuration.password); + pollController(); + + } + + @Override + protected void pollController() throws HydrawiseConnectionException, HydrawiseAuthenticationException { + updateZones(client.getLocalSchedule()); + } + + @Override + protected void sendRunCommand(int seconds, Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runRelay(seconds, relay.relay); + } + + @Override + protected void sendRunCommand(Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runRelay(relay.relay); + } + + @Override + protected void sendStopCommand(Relay relay) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.stopRelay(relay.relay); + } + + @Override + protected void sendRunAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runAllRelays(); + } + + @Override + protected void sendRunAllCommand(int seconds) + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.runAllRelays(seconds); + } + + @Override + protected void sendStopAllCommand() + throws HydrawiseCommandException, HydrawiseConnectionException, HydrawiseAuthenticationException { + client.stopAllRelays(); + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseAuthenticationException.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseAuthenticationException.java new file mode 100644 index 0000000000000..886c93da4e752 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseAuthenticationException.java @@ -0,0 +1,23 @@ +/** + * 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.hydrawise.internal.api; + +/** + * Thrown when the Hydrawise cloud or local API returns back a "unauthorized" response to commands + * + * @author Dan Cunningham - Initial contribution + */ +@SuppressWarnings("serial") +public class HydrawiseAuthenticationException extends Exception { + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCloudApiClient.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCloudApiClient.java new file mode 100644 index 0000000000000..e17ebb6f2c1b6 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCloudApiClient.java @@ -0,0 +1,311 @@ +/** + * 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.hydrawise.internal.api; + +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.http.HttpMethod; +import org.openhab.binding.hydrawise.internal.api.model.CustomerDetailsResponse; +import org.openhab.binding.hydrawise.internal.api.model.Response; +import org.openhab.binding.hydrawise.internal.api.model.SetControllerResponse; +import org.openhab.binding.hydrawise.internal.api.model.SetZoneResponse; +import org.openhab.binding.hydrawise.internal.api.model.StatusScheduleResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * The {@link HydrawiseCloudApiClient} communicates with the cloud based Hydrawise API service + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public class HydrawiseCloudApiClient { + private final Logger logger = LoggerFactory.getLogger(HydrawiseCloudApiClient.class); + + private final Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .create(); + private static final String BASE_URL = "https://app.hydrawise.com/api/v1/"; + private static final String STATUS_SCHEDUE_URL = BASE_URL + + "statusschedule.php?api_key=%s&controller_id=%d&hours=168"; + private static final String CUSTOMER_DETAILS_URL = BASE_URL + "customerdetails.php?api_key=%s&type=controllers"; + private static final String SET_CONTROLLER_URL = BASE_URL + + "setcontroller.php?api_key=%s&controller_id=%d&json=true"; + private static final String SET_ZONE_URL = BASE_URL + "setzone.php?period_id=999"; + private static final int TIMEOUT_SECONDS = 30; + private final HttpClient httpClient; + private String apiKey; + + /** + * Initializes the API client with a HydraWise API key from a user's account and the HTTPClient to use + * + */ + public HydrawiseCloudApiClient(String apiKey, HttpClient httpClient) { + this.apiKey = apiKey; + this.httpClient = httpClient; + } + + /** + * Initializes the API client with a HTTPClient to use + * + */ + public HydrawiseCloudApiClient(HttpClient httpClient) { + this("", httpClient); + } + + /** + * Set a new API key to use for requests + * + * @param apiKey + */ + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + /** + * Retrieves the {@link StatusScheduleResponse} for a given controller + * + * @param controllerId + * @return + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + */ + public StatusScheduleResponse getStatusSchedule(int controllerId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException { + String json = doGet(String.format(STATUS_SCHEDUE_URL, apiKey, controllerId)); + StatusScheduleResponse response = gson.fromJson(json, StatusScheduleResponse.class); + throwExceptionIfResponseError(response); + return response; + } + + /*** + * Retrieves the {@link CustomerDetailsResponse} + * + * @return + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + */ + public CustomerDetailsResponse getCustomerDetails() + throws HydrawiseConnectionException, HydrawiseAuthenticationException { + String json = doGet(String.format(CUSTOMER_DETAILS_URL, apiKey)); + CustomerDetailsResponse response = gson.fromJson(json, CustomerDetailsResponse.class); + throwExceptionIfResponseError(response); + return response; + } + + /*** + * Sets the controller with supplied {@value id} as the current controller + * + * @param id + * @return SetControllerResponse + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public SetControllerResponse setController(int id) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + String json = doGet(String.format(SET_CONTROLLER_URL, apiKey, id)); + SetControllerResponse response = gson.fromJson(json, SetControllerResponse.class); + throwExceptionIfResponseError(response); + if (!response.message.equals("OK")) { + throw new HydrawiseCommandException(response.message); + } + return response; + } + + /*** + * Stops a given relay + * + * @param relayId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String stopRelay(int relayId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand( + new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("stop").relayId(relayId).toString()); + } + + /** + * Stops all relays on a given controller + * + * @param controllerId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String stopAllRelays(int controllerId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("stopall") + .controllerId(controllerId).toString()); + } + + /** + * Runs a relay for the default amount of time + * + * @param relayId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runRelay(int relayId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand( + new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("run").relayId(relayId).toString()); + } + + /** + * Runs a relay for the given amount of seconds + * + * @param seconds + * @param relayId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runRelay(int seconds, int relayId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("run").relayId(relayId) + .duration(seconds).toString()); + } + + /** + * Run all relays on a given controller for the default amount of time + * + * @param controllerId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runAllRelays(int controllerId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("runall") + .controllerId(controllerId).toString()); + } + + /*** + * Run all relays on a given controller for the amount of seconds + * + * @param seconds + * @param controllerId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runAllRelays(int seconds, int controllerId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("runall") + .controllerId(controllerId).duration(seconds).toString()); + } + + /** + * Suspends a given relay + * + * @param relayId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String suspendRelay(int relayId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand( + new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("suspend").relayId(relayId).toString()); + } + + /** + * Suspends a given relay for an amount of seconds + * + * @param seconds + * @param relayId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String suspendRelay(int seconds, int relayId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("suspend").relayId(relayId) + .duration(seconds).toString()); + } + + /** + * Suspend all relays on a given controller for an amount of seconds + * + * @param seconds + * @param controllerId + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String suspendAllRelays(int seconds, int controllerId) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(SET_ZONE_URL, apiKey).action("suspendall") + .controllerId(controllerId).duration(seconds).toString()); + } + + private String relayCommand(String url) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + String json = doGet(url); + SetZoneResponse response = gson.fromJson(json, SetZoneResponse.class); + throwExceptionIfResponseError(response); + if ("error".equals(response.messageType)) { + throw new HydrawiseCommandException(response.message); + } + return response.message; + } + + private String doGet(String url) throws HydrawiseConnectionException { + logger.trace("Getting {}", url); + ContentResponse response; + try { + response = httpClient.newRequest(url).method(HttpMethod.GET).timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) + .send(); + } catch (Exception e) { + throw new HydrawiseConnectionException(e); + } + if (response.getStatus() != 200) { + throw new HydrawiseConnectionException( + "Could not connect to Hydrawise API. Response code " + response.getStatus()); + } + String stringResponse = response.getContentAsString(); + logger.trace("Response: {}", stringResponse); + return stringResponse; + } + + private void throwExceptionIfResponseError(Response response) + throws HydrawiseConnectionException, HydrawiseAuthenticationException { + String error = response.errorMsg; + if (error != null) { + if (error.equalsIgnoreCase("unauthorized")) { + throw new HydrawiseAuthenticationException(); + } else { + throw new HydrawiseConnectionException(response.errorMsg); + } + } + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCommandException.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCommandException.java new file mode 100644 index 0000000000000..20fb8f258159f --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseCommandException.java @@ -0,0 +1,25 @@ +/** + * 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.hydrawise.internal.api; + +/** + * Thrown when command responses return a error message + * + * @author Dan Cunningham - Initial contribution + */ +@SuppressWarnings("serial") +public class HydrawiseCommandException extends Exception { + public HydrawiseCommandException(String message) { + super(message); + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseConnectionException.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseConnectionException.java new file mode 100644 index 0000000000000..284f25f8fa239 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseConnectionException.java @@ -0,0 +1,30 @@ +/** + * 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.hydrawise.internal.api; + +/** + * Thrown for connection issues to the Hydrawise controller + * + * @author Dan Cunningham - Initial contribution + */ +@SuppressWarnings("serial") +public class HydrawiseConnectionException extends Exception { + + public HydrawiseConnectionException(Exception e) { + super(e); + } + + public HydrawiseConnectionException(String message) { + super(message); + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseLocalApiClient.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseLocalApiClient.java new file mode 100644 index 0000000000000..d76467002fdf5 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseLocalApiClient.java @@ -0,0 +1,214 @@ +/** + * 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.hydrawise.internal.api; + +import java.net.URI; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.AuthenticationStore; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.util.BasicAuthentication; +import org.eclipse.jetty.http.HttpMethod; +import org.openhab.binding.hydrawise.internal.api.model.LocalScheduleResponse; +import org.openhab.binding.hydrawise.internal.api.model.SetZoneResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * The {@link HydrawiseLocalApiClient} communicates with a network local Hydrawise controller. + * + * @author Dan Cunningham - Initial contribution + */ +@NonNullByDefault +public class HydrawiseLocalApiClient { + private final Logger logger = LoggerFactory.getLogger(HydrawiseLocalApiClient.class); + + private final Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) + .create(); + + private static final String GET_LOCAL_DATA_URL = "%s/get_sched_json.php?hours=720"; + private static final String SET_LOCAL_DATA_URL = "%s/set_manual_data.php?period_id=998"; + + private static final int TIMEOUT_SECONDS = 30; + private HttpClient httpClient; + private String localSetURL = ""; + private String localGetURL = ""; + + public HydrawiseLocalApiClient(HttpClient httpClient) { + this.httpClient = httpClient; + } + + /** + * Initializes the {@link HydrawiseLocalApiClient} to talk with the network local Hydrawise API + * + * @param host + * @param username + * @param password + */ + public HydrawiseLocalApiClient(String host, String username, String password, HttpClient httpClient) { + this.httpClient = httpClient; + setCredentials(host, username, password); + } + + /** + * Sets the local credentials and controller host + * + * @param host + * @param username + * @param password + */ + public void setCredentials(String host, String username, String password) { + String url = "http://" + host; + localSetURL = String.format(SET_LOCAL_DATA_URL, url); + localGetURL = String.format(GET_LOCAL_DATA_URL, url); + AuthenticationStore auth = httpClient.getAuthenticationStore(); + URI uri = URI.create(url); + auth.addAuthenticationResult(new BasicAuthentication.BasicResult(uri, username, password)); + } + + /** + * Retrieves the {@link LocalScheduleResponse} for the controller + * + * @return the local schedule response + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + */ + public LocalScheduleResponse getLocalSchedule() + throws HydrawiseConnectionException, HydrawiseAuthenticationException { + String json = doGet(localGetURL); + LocalScheduleResponse response = gson.fromJson(json, LocalScheduleResponse.class); + return response; + } + + /** + * Stops a given relay + * + * @param number + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String stopRelay(int number) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("stop").relayNumber(number).toString()); + } + + /** + * Runs a given relay for the default amount of time + * + * @param number + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runRelay(int number) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("run").relayNumber(number).toString()); + } + + /** + * Runs a given relay for a specified numbers of seconds + * + * @param seconds + * @param number + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runRelay(int seconds, int number) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("run").relayNumber(number) + .duration(seconds).toString()); + } + + /** + * Stops all relays + * + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String stopAllRelays() + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("stopall").toString()); + } + + /** + * Run all relays for the default amount of time + * + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runAllRelays() + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("runall").toString()); + } + + /** + * Run all relays for a given amount of seconds + * + * @param seconds + * @return Response message + * @throws HydrawiseConnectionException + * @throws HydrawiseAuthenticationException + * @throws HydrawiseCommandException + */ + public String runAllRelays(int seconds) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + return relayCommand(new HydrawiseZoneCommandBuilder(localSetURL).action("runall").duration(seconds).toString()); + } + + private String relayCommand(String url) + throws HydrawiseConnectionException, HydrawiseAuthenticationException, HydrawiseCommandException { + String json = doGet(url); + SetZoneResponse response = gson.fromJson(json, SetZoneResponse.class); + if (response.messageType.equals("error")) { + throw new HydrawiseCommandException(response.message); + } + return response.message; + } + + private String doGet(String url) throws HydrawiseConnectionException, HydrawiseAuthenticationException { + logger.trace("Getting {}", url); + ContentResponse response; + try { + response = httpClient.newRequest(url).method(HttpMethod.GET).timeout(TIMEOUT_SECONDS, TimeUnit.SECONDS) + .send(); + } catch (InterruptedException | TimeoutException | ExecutionException e) { + throw new HydrawiseConnectionException(e); + } + if (response.getStatus() == 401) { + throw new HydrawiseAuthenticationException(); + } + if (response.getStatus() != 200) { + throw new HydrawiseConnectionException("Error from controller. Response code " + response.getStatus()); + } + String stringResponse = response.getContentAsString(); + logger.trace("Response: {}", stringResponse); + return stringResponse; + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseZoneCommandBuilder.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseZoneCommandBuilder.java new file mode 100644 index 0000000000000..666e7bdb4034d --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/HydrawiseZoneCommandBuilder.java @@ -0,0 +1,105 @@ +/** + * 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.hydrawise.internal.api; + +/** + * The {@link HydrawiseZoneCommandBuilder} class builds a command URL string to use when sending commands to the + * Hydrawise local controller or cloud based API server + * + * @author Dan Cunningham - Initial contribution + * + */ +class HydrawiseZoneCommandBuilder { + + private final StringBuilder builder; + + /** + * Construct a new {@link HydrawiseZoneCommandBuilder} class with a base URL + * + * @param baseURL + */ + public HydrawiseZoneCommandBuilder(String baseURL) { + builder = new StringBuilder(baseURL); + } + + /** + * Construct a new {@link HydrawiseZoneCommandBuilder} class with a base URL and API key. + * + * @param baseURL + * @param apiKey + */ + public HydrawiseZoneCommandBuilder(String baseURL, String apiKey) { + this(baseURL); + builder.append("&api_key=" + apiKey); + } + + /** + * Sets the action parameter + * + * @param action + * @return {@link HydrawiseZoneCommandBuilder} + */ + public HydrawiseZoneCommandBuilder action(String action) { + builder.append("&action=" + action); + return this; + } + + /** + * Sets the relayId parameter + * + * @param action + * @return {@link HydrawiseZoneCommandBuilder} + */ + public HydrawiseZoneCommandBuilder relayId(int relayId) { + builder.append("&relay_id=" + relayId); + return this; + } + + /** + * Sets the relay number parameter + * + * @param action + * @return {@link HydrawiseZoneCommandBuilder} + */ + public HydrawiseZoneCommandBuilder relayNumber(int number) { + builder.append("&relay=" + number); + return this; + } + + /** + * Sets the run duration parameter + * + * @param action + * @return {@link HydrawiseZoneCommandBuilder} + */ + public HydrawiseZoneCommandBuilder duration(int seconds) { + builder.append("&custom=" + seconds); + return this; + } + + /** + * Sets the controller Id parameter + * + * @param action + * @return {@link HydrawiseZoneCommandBuilder} + */ + public HydrawiseZoneCommandBuilder controllerId(int controllerId) { + builder.append("&controller_id=" + controllerId); + return this; + } + + @Override + public String toString() { + return builder.toString(); + } +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyActual.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyActual.java new file mode 100644 index 0000000000000..66741dc7e155f --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyActual.java @@ -0,0 +1,26 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link BocTopologyDesired} class models the actual BocTopology + * + * @author Dan Cunningham - Initial contribution + */ +public class BocTopologyActual { + + public List<Object> bocGateways; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyDesired.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyDesired.java new file mode 100644 index 0000000000000..8da2ce9a8759c --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/BocTopologyDesired.java @@ -0,0 +1,26 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link BocTopologyDesired} class models the desired BocTopology + * + * @author Dan Cunningham - Initial contribution + */ +public class BocTopologyDesired { + + public List<Object> bocGateways; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Controller.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Controller.java new file mode 100644 index 0000000000000..adeb0852df569 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Controller.java @@ -0,0 +1,66 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link Controller} class models a Hydrawise controller unit + * + * @author Dan Cunningham - Initial contribution + */ +public class Controller { + + public String name; + + public Integer lastContact; + + public String serialNumber; + + public Integer controllerId; + + public String swVersion; + + public String hardware; + + public Boolean isBoc; + + public String address; + + public String timezone; + + public Integer deviceId; + + public Object parentDeviceId; + + public String image; + + public String description; + + public Integer customerId; + + public Double latitude; + + public Double longitude; + + public String lastContactReadable; + + public String status; + + public String statusIcon; + + public Boolean online; + + public List<String> tags = null; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/CustomerDetailsResponse.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/CustomerDetailsResponse.java new file mode 100644 index 0000000000000..df247117e94c7 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/CustomerDetailsResponse.java @@ -0,0 +1,50 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link CustomerDetailsResponse} class models the CustomerDetails response message + * + * @author Dan Cunningham - Initial contribution + */ +public class CustomerDetailsResponse extends Response { + + public BocTopologyDesired bocTopologyDesired; + + public BocTopologyActual bocTopologyActual; + + public List<Controller> controllers; + + public String currentController; + + public Boolean isBoc; + + public Integer tandc; + + public Integer controllerId; + + public Integer customerId; + + public String sessionId; + + public String hardwareVersion; + + public Integer deviceId; + + public Integer tandcVersion; + + public Features features; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Features.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Features.java new file mode 100644 index 0000000000000..29dd6dd24c204 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Features.java @@ -0,0 +1,102 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link Features} class models an accounts features. + * + * @author Dan Cunningham - Initial contribution + */ +public class Features { + + public List<PlanArray> planArray = null; + + public Object id; + + public String planType2; + + public String planType2Key; + + public Object sku; + + public String discount; + + public String cost; + + public String costUs; + + public String costAu; + + public String costEu; + + public String costCa; + + public String costUk; + + public String active; + + public String controllerQty; + + public String rainfall; + + public String smsQty; + + public String scheduledReports; + + public String emailAlerts; + + public String defineSensor; + + public String addUser; + + public String contractor; + + public Object description; + + public String sensorPack; + + public String filelimit; + + public String filetypeall; + + public String planType; + + public String pushNotification; + + public String weatherQty; + + public String weatherFreeQty; + + public String reportingDays; + + public String weatherHourlyUpdates; + + public String freeEnthusiastPlans; + + public String visible; + + public Object contractorPurchasable; + + public Integer boc; + + public Object expiry; + + public Object start; + + public String customerplanId; + + public Integer smsUsed; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Forecast.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Forecast.java new file mode 100644 index 0000000000000..2767a9c88890f --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Forecast.java @@ -0,0 +1,40 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link Forecast} class models a daily weather forecast + * + * @author Dan Cunningham - Initial contribution + */ +public class Forecast { + + public String tempHi; + + public String tempLo; + + public String conditions; + + public String day; + + public Integer pop; + + public Integer humidity; + + public String wind; + + public String icon; + + public String iconLocal; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/LocalScheduleResponse.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/LocalScheduleResponse.java new file mode 100644 index 0000000000000..6e4a47b3d6512 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/LocalScheduleResponse.java @@ -0,0 +1,33 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.LinkedList; +import java.util.List; + +/** + * The {@link LocalScheduleResponse} class models the LocalSchedule response message + * + * @author Dan Cunningham - Initial contribution + */ +public class LocalScheduleResponse extends Response { + + public List<Running> running = new LinkedList<Running>(); + + public List<Relay> relays = new LinkedList<Relay>(); + + public String name; + + public Integer time; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/PlanArray.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/PlanArray.java new file mode 100644 index 0000000000000..4db5b2a06ba8f --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/PlanArray.java @@ -0,0 +1,92 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link PlanArray} class models am account plan. + * + * @author Dan Cunningham - Initial contribution + */ +public class PlanArray { + + public String id; + + public Object sku; + + public String discount; + + public String cost; + + public String costUs; + + public String costAu; + + public String costEu; + + public String costCa; + + public String costUk; + + public String active; + + public String controllerQty; + + public String rainfall; + + public String smsQty; + + public String scheduledReports; + + public String emailAlerts; + + public String defineSensor; + + public String addUser; + + public String contractor; + + public String description; + + public String sensorPack; + + public String filelimit; + + public String filetypeall; + + public String plan_type; + + public String pushNotification; + + public String weatherQty; + + public String weatherFreeQty; + + public String reportingDays; + + public String weatherHourlyUpdates; + + public String freeEnthusiastPlans; + + public String visible; + + public String contractorPurchasable; + + public String boc; + + public String expiry; + + public String start; + + public String customerplanId; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Relay.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Relay.java new file mode 100644 index 0000000000000..3d9668214c94c --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Relay.java @@ -0,0 +1,58 @@ +/** + * 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.hydrawise.internal.api.model; + +import com.google.gson.annotations.SerializedName; + +/** + * The {@link Relay} class models the Relay response message + * + * @author Dan Cunningham - Initial contribution + */ +public class Relay { + + public Integer relayId; + + public Integer relay; + + public String name; + + public String icon; + + public String lastwater; + + public Integer time; + + public Integer type; + + @SerializedName("run") + public String runTime; + + @SerializedName("run_seconds") + public Integer runTimeSeconds; + + public String nicetime; + + public String id; + + /** + * Returns back the actual relay number when multiple controllers are chained. + * + * @return + */ + public int getRelayNumber() { + int quotient = relay / 100; + return (relay - (quotient * 100)) + (quotient * 12); + } + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Response.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Response.java new file mode 100644 index 0000000000000..516958cde40c1 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Response.java @@ -0,0 +1,24 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link Response} class models Response messages + * + * @author Dan Cunningham - Initial contribution + */ +public class Response { + + public String errorMsg; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Running.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Running.java new file mode 100644 index 0000000000000..241e6b9223674 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Running.java @@ -0,0 +1,30 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link Running} class models a running relay + * + * @author Dan Cunningham - Initial contribution + */ +public class Running { + + public String relay; + + public String relayId; + + public Integer timeLeft; + + public String run; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Sensor.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Sensor.java new file mode 100644 index 0000000000000..a1273ad30fe38 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/Sensor.java @@ -0,0 +1,42 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.List; + +/** + * The {@link Sensor} class models a sensor + * + * @author Dan Cunningham - Initial contribution + */ +public class Sensor { + + public Integer input; + + public Integer type; + + public Integer mode; + + public Integer timer; + + public Integer offtimer; + + public String name; + + public Integer offlevel; + + public Integer active; + + public List<Object> relays = null; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetControllerResponse.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetControllerResponse.java new file mode 100644 index 0000000000000..340834a1e723e --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetControllerResponse.java @@ -0,0 +1,28 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link SetControllerResponse} class models the SetController response message + * + * @author Dan Cunningham - Initial contribution + */ +public class SetControllerResponse extends Response { + + public String name; + + public String controllerId; + + public String message; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetZoneResponse.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetZoneResponse.java new file mode 100644 index 0000000000000..126d6fa9d2fbc --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/SetZoneResponse.java @@ -0,0 +1,26 @@ +/** + * 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.hydrawise.internal.api.model; + +/** + * The {@link SetZoneResponse} class models the SetZone response message + * + * @author Dan Cunningham - Initial contribution + */ +public class SetZoneResponse extends Response { + + public String message; + + public String messageType; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/StatusScheduleResponse.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/StatusScheduleResponse.java new file mode 100644 index 0000000000000..dc716999981e5 --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/api/model/StatusScheduleResponse.java @@ -0,0 +1,61 @@ +/** + * 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.hydrawise.internal.api.model; + +import java.util.LinkedList; +import java.util.List; + +/** + * The {@link StatusScheduleResponse} class models the Status and Schedule response message + * + * @author Dan Cunningham - Initial contribution + */ +public class StatusScheduleResponse extends LocalScheduleResponse { + + public Integer controllerId; + + public Integer customerId; + + public Integer userId; + + public Integer nextpoll; + + public List<Sensor> sensors = new LinkedList<Sensor>(); + + public String message; + + public String obsRain; + + public String obsRainWeek; + + public String obsMaxtemp; + + public Integer obsRainUpgrade; + + public String obsRainText; + + public String obsCurrenttemp; + + public String wateringTime; + + public Integer waterSaving; + + public String lastContact; + + public List<Forecast> forecast = new LinkedList<Forecast>(); + + public String status; + + public String statusIcon; + +} diff --git a/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..4a509e0747c0e --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="hydrawise" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Hydrawise Binding</name> + <description>This is the binding for Hydrawise irrigation systems.</description> + <author>Dan Cunningham</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/channel-types.xml new file mode 100644 index 0000000000000..aeae5e87503bb --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/channel-types.xml @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="hydrawise" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-group-type id="zone"> + <label>Zone</label> + <description>Hydrawise zone</description> + <channels> + <channel id="name" typeId="name" /> + <channel id="icon" typeId="icon" /> + <channel id="time" typeId="time" /> + <channel id="type" typeId="type" /> + <channel id="runcustom" typeId="runcustom" /> + <channel id="run" typeId="run" /> + <channel id="nextruntime" typeId="nextruntime" /> + <channel id="timeleft" typeId="timeleft" /> + </channels> + </channel-group-type> + + <channel-group-type id="allzones"> + <label>All Zones</label> + <description>Commands that control all Hydrawise zones</description> + <channels> + <channel id="runcustom" typeId="runcustom" /> + <channel id="run" typeId="run" /> + </channels> + </channel-group-type> + + <channel-group-type id="sensor"> + <label>Sensor</label> + <description>Hydrawise sensor</description> + <channels> + <channel id="name" typeId="name" /> + <channel id="input" typeId="input" /> + <channel id="mode" typeId="mode" /> + <channel id="timer" typeId="timer" /> + <channel id="offtimer" typeId="offtimer" /> + <channel id="offlevel" typeId="offlevel" /> + <channel id="active" typeId="active" /> + </channels> + </channel-group-type> + + <channel-group-type id="forecast"> + <label>Weather Forecast</label> + <description>Hydrawise weather forecast</description> + <channels> + <channel id="temperaturehigh" typeId="temperaturehigh" /> + <channel id="temperaturelow" typeId="temperaturelow" /> + <channel id="conditions" typeId="conditions" /> + <channel id="day" typeId="day" /> + <channel id="humidity" typeId="humidity" /> + <channel id="wind" typeId="wind" /> + </channels> + </channel-group-type> + + <!-- Controller --> + <channel-type id="name"> + <item-type>String</item-type> + <label>Name</label> + <description>Name</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="icon"> + <item-type>String</item-type> + <label>Icon URL</label> + <description>Icon URL for this zone</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="time" advanced="true"> + <item-type>Number</item-type> + <label>Start Time</label> + <description>Zone start time in seconds</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="type" advanced="true"> + <item-type>Number</item-type> + <label>Type</label> + <description>Zone Type</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="nextruntime"> + <item-type>DateTime</item-type> + <label>Next Run Time</label> + <description>Next time this zone is scheduled to run</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="run"> + <item-type>Switch</item-type> + <label>Run Zones</label> + <description>Run or stop zones for the default time.</description> + </channel-type> + + <channel-type id="runcustom"> + <item-type>Number</item-type> + <label>Run Zones With Custom Duration </label> + <description>Run zones now for a custom duration of time in seconds</description> + </channel-type> + + <channel-type id="timeleft"> + <item-type>Number</item-type> + <label>Time Left Seconds</label> + <description>Time left that zone will run for</description> + <state readOnly="true"></state> + </channel-type> + + <!-- Sensor --> + + <channel-type id="input" advanced="true"> + <item-type>Number</item-type> + <label>Input</label> + <description>Sensor input</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="type" advanced="true"> + <item-type>Number</item-type> + <label>Type</label> + <description>Sensor type</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="mode" advanced="true"> + <item-type>Number</item-type> + <label>Mode</label> + <description>Sensor mode</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="timer" advanced="true"> + <item-type>Number</item-type> + <label>Timer</label> + <description>Sensor timer</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="offtimer" advanced="true"> + <item-type>Number</item-type> + <label>Off Timer</label> + <description>Sensor off timer</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="name" advanced="true"> + <item-type>String</item-type> + <label>Name</label> + <description>Sensor name</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="offlevel" advanced="true"> + <item-type>Number</item-type> + <label>Off Level</label> + <description>Sensor off level</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="active"> + <item-type>Switch</item-type> + <label>Active</label> + <description>Sensor active</description> + <state readOnly="true"></state> + </channel-type> + + <!-- Weather Forecast --> + <channel-type id="temperaturehigh"> + <item-type>Number:Temperature</item-type> + <label>High temperature</label> + <description>High temperature</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="temperaturelow"> + <item-type>Number:Temperature</item-type> + <label>Low Temperature</label> + <description>Low Temperature</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="conditions"> + <item-type>String</item-type> + <label>Conditions</label> + <description>Weather conditions</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="conditions"> + <item-type>String</item-type> + <label>Conditions</label> + <description>Weather conditions</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="day"> + <item-type>String</item-type> + <label>Day of Week</label> + <description>Day of week for the weather forecast</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="humidity"> + <item-type>Number</item-type> + <label>Humidity</label> + <description>Humidity percentage</description> + <category>Temperature</category> + <state readOnly="true" pattern="%d%%" /> + </channel-type> + + <channel-type id="wind"> + <item-type>Number:Speed</item-type> + <label>Wind Speed</label> + <description>Wind speed</description> + <category>Wind</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/things.xml b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/things.xml new file mode 100644 index 0000000000000..3b2e35fc485cf --- /dev/null +++ b/bundles/org.openhab.binding.hydrawise/src/main/resources/ESH-INF/thing/things.xml @@ -0,0 +1,388 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="hydrawise" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- Sample Thing Type --> + <thing-type id="cloud"> + <label>Hydrawise Cloud Thing</label> + <description>Hydrawise cloud connected irrigation system</description> + + <!-- Until we have https://github.com/eclipse/smarthome/issues/1118 fixed, we need to list all possible channel groups. + Once this is fixed we can dynamically add them to the thing and not list them here. --> + <channel-groups> + <channel-group id="sensor1" typeId="sensor"> + <label>Sensor 1</label> + <description>Sensor 1</description> + </channel-group> + <channel-group id="sensor2" typeId="sensor"> + <label>Sensor 2</label> + <description>Sensor 2</description> + </channel-group> + <channel-group id="sensor3" typeId="sensor"> + <label>Sensor 3</label> + <description>Sensor 3</description> + </channel-group> + <channel-group id="sensor4" typeId="sensor"> + <label>Sensor 4</label> + <description>Sensor 4</description> + </channel-group> + + <channel-group id="forecast1" typeId="forecast"> + <label>Today's Weather</label> + <description>Today's weather forecast</description> + </channel-group> + <channel-group id="forecast2" typeId="forecast"> + <label>Day 2 Weather</label> + <description>Day 2 weather forecast</description> + </channel-group> + <channel-group id="forecast3" typeId="forecast"> + <label>Day 3 Weather</label> + <description>Day 3 weather forecast</description> + </channel-group> + <channel-group id="forecast4" typeId="forecast"> + <label>Day 4 Weather</label> + <description>Day 4 weather forecast</description> + </channel-group> + + <channel-group id="allzones" typeId="allzones" /> + + <channel-group id="zone1" typeId="zone"> + <label>Zone 1</label> + <description>Sprinkler Zone 1</description> + </channel-group> + <channel-group id="zone2" typeId="zone"> + <label>Zone 2</label> + <description>Sprinkler Zone 2</description> + </channel-group> + <channel-group id="zone3" typeId="zone"> + <label>Zone 3</label> + <description>Sprinkler Zone 3</description> + </channel-group> + <channel-group id="zone4" typeId="zone"> + <label>Zone 4</label> + <description>Sprinkler Zone 4</description> + </channel-group> + <channel-group id="zone5" typeId="zone"> + <label>Zone 5</label> + <description>Sprinkler Zone 5</description> + </channel-group> + <channel-group id="zone6" typeId="zone"> + <label>Zone 6</label> + <description>Sprinkler Zone 6</description> + </channel-group> + <channel-group id="zone7" typeId="zone"> + <label>Zone 7</label> + <description>Sprinkler Zone 7</description> + </channel-group> + <channel-group id="zone8" typeId="zone"> + <label>Zone 8</label> + <description>Sprinkler Zone 8</description> + </channel-group> + <channel-group id="zone9" typeId="zone"> + <label>Zone 9</label> + <description>Sprinkler Zone 9</description> + </channel-group> + <channel-group id="zone10" typeId="zone"> + <label>Zone 10</label> + <description>Sprinkler Zone 10</description> + </channel-group> + <channel-group id="zone11" typeId="zone"> + <label>Zone 11</label> + <description>Sprinkler Zone 11</description> + </channel-group> + <channel-group id="zone12" typeId="zone"> + <label>Zone 12</label> + <description>Sprinkler Zone 12</description> + </channel-group> + <channel-group id="zone13" typeId="zone"> + <label>Zone 13</label> + <description>Sprinkler Zone 13</description> + </channel-group> + <channel-group id="zone14" typeId="zone"> + <label>Zone 14</label> + <description>Sprinkler Zone 14</description> + </channel-group> + <channel-group id="zone15" typeId="zone"> + <label>Zone 15</label> + <description>Sprinkler Zone 15</description> + </channel-group> + <channel-group id="zone16" typeId="zone"> + <label>Zone 16</label> + <description>Sprinkler Zone 16</description> + </channel-group> + <channel-group id="zone17" typeId="zone"> + <label>Zone 17</label> + <description>Sprinkler Zone 17</description> + </channel-group> + <channel-group id="zone18" typeId="zone"> + <label>Zone 18</label> + <description>Sprinkler Zone 18</description> + </channel-group> + <channel-group id="zone19" typeId="zone"> + <label>Zone 19</label> + <description>Sprinkler Zone 19</description> + </channel-group> + <channel-group id="zone20" typeId="zone"> + <label>Zone 20</label> + <description>Sprinkler Zone 20</description> + </channel-group> + <channel-group id="zone21" typeId="zone"> + <label>Zone 21</label> + <description>Sprinkler Zone 21</description> + </channel-group> + <channel-group id="zone22" typeId="zone"> + <label>Zone 22</label> + <description>Sprinkler Zone 22</description> + </channel-group> + <channel-group id="zone23" typeId="zone"> + <label>Zone 23</label> + <description>Sprinkler Zone 23</description> + </channel-group> + <channel-group id="zone24" typeId="zone"> + <label>Zone 24</label> + <description>Sprinkler Zone 24</description> + </channel-group> + <channel-group id="zone25" typeId="zone"> + <label>Zone 25</label> + <description>Sprinkler Zone 25</description> + </channel-group> + <channel-group id="zone26" typeId="zone"> + <label>Zone 26</label> + <description>Sprinkler Zone 26</description> + </channel-group> + <channel-group id="zone27" typeId="zone"> + <label>Zone 27</label> + <description>Sprinkler Zone 27</description> + </channel-group> + <channel-group id="zone28" typeId="zone"> + <label>Zone 28</label> + <description>Sprinkler Zone 28</description> + </channel-group> + <channel-group id="zone29" typeId="zone"> + <label>Zone 29</label> + <description>Sprinkler Zone 29</description> + </channel-group> + <channel-group id="zone30" typeId="zone"> + <label>Zone 30</label> + <description>Sprinkler Zone 30</description> + </channel-group> + <channel-group id="zone31" typeId="zone"> + <label>Zone 31</label> + <description>Sprinkler Zone 31</description> + </channel-group> + <channel-group id="zone32" typeId="zone"> + <label>Zone 32</label> + <description>Sprinkler Zone 32</description> + </channel-group> + <channel-group id="zone33" typeId="zone"> + <label>Zone 33</label> + <description>Sprinkler Zone 33</description> + </channel-group> + <channel-group id="zone34" typeId="zone"> + <label>Zone 34</label> + <description>Sprinkler Zone 34</description> + </channel-group> + <channel-group id="zone35" typeId="zone"> + <label>Zone 35</label> + <description>Sprinkler Zone 35</description> + </channel-group> + <channel-group id="zone36" typeId="zone"> + <label>Zone 36</label> + <description>Sprinkler Zone 36</description> + </channel-group> + </channel-groups> + <config-description> + <parameter name="apiKey" type="text" required="true"> + <label>API Key</label> + <description>API Key from https://app.hydrawise.com/config/account</description> + </parameter> + <parameter name="refresh" type="integer" required="true"> + <label>Refresh interval</label> + <description>Specifies the refresh interval in seconds</description> + <default>30</default> + </parameter> + <parameter name="controllerId" type="integer" required="false"> + <label>Optional Controller ID interval</label> + <description>Optional parameter to specify the Hydrawise controller ID if you have more then one associated with + your account. + </description> + </parameter> + </config-description> + </thing-type> + + <thing-type id="local"> + <label>Hydrawise Local Thing</label> + <description>Hydrawise local connected irrigation system</description> + <channel-groups> + <channel-group id="zone1" typeId="zone"> + <label>Zone 1</label> + <description>Sprinkler Zone 1</description> + </channel-group> + <channel-group id="zone2" typeId="zone"> + <label>Zone 2</label> + <description>Sprinkler Zone 2</description> + </channel-group> + <channel-group id="zone3" typeId="zone"> + <label>Zone 3</label> + <description>Sprinkler Zone 3</description> + </channel-group> + <channel-group id="zone4" typeId="zone"> + <label>Zone 4</label> + <description>Sprinkler Zone 4</description> + </channel-group> + <channel-group id="zone5" typeId="zone"> + <label>Zone 5</label> + <description>Sprinkler Zone 5</description> + </channel-group> + <channel-group id="zone6" typeId="zone"> + <label>Zone 6</label> + <description>Sprinkler Zone 6</description> + </channel-group> + <channel-group id="zone7" typeId="zone"> + <label>Zone 7</label> + <description>Sprinkler Zone 7</description> + </channel-group> + <channel-group id="zone8" typeId="zone"> + <label>Zone 8</label> + <description>Sprinkler Zone 8</description> + </channel-group> + <channel-group id="zone9" typeId="zone"> + <label>Zone 9</label> + <description>Sprinkler Zone 9</description> + </channel-group> + <channel-group id="zone10" typeId="zone"> + <label>Zone 10</label> + <description>Sprinkler Zone 10</description> + </channel-group> + <channel-group id="zone11" typeId="zone"> + <label>Zone 11</label> + <description>Sprinkler Zone 11</description> + </channel-group> + <channel-group id="zone12" typeId="zone"> + <label>Zone 12</label> + <description>Sprinkler Zone 12</description> + </channel-group> + <channel-group id="zone13" typeId="zone"> + <label>Zone 13</label> + <description>Sprinkler Zone 13</description> + </channel-group> + <channel-group id="zone14" typeId="zone"> + <label>Zone 14</label> + <description>Sprinkler Zone 14</description> + </channel-group> + <channel-group id="zone15" typeId="zone"> + <label>Zone 15</label> + <description>Sprinkler Zone 15</description> + </channel-group> + <channel-group id="zone16" typeId="zone"> + <label>Zone 16</label> + <description>Sprinkler Zone 16</description> + </channel-group> + <channel-group id="zone17" typeId="zone"> + <label>Zone 17</label> + <description>Sprinkler Zone 17</description> + </channel-group> + <channel-group id="zone18" typeId="zone"> + <label>Zone 18</label> + <description>Sprinkler Zone 18</description> + </channel-group> + <channel-group id="zone19" typeId="zone"> + <label>Zone 19</label> + <description>Sprinkler Zone 19</description> + </channel-group> + <channel-group id="zone20" typeId="zone"> + <label>Zone 20</label> + <description>Sprinkler Zone 20</description> + </channel-group> + <channel-group id="zone21" typeId="zone"> + <label>Zone 21</label> + <description>Sprinkler Zone 21</description> + </channel-group> + <channel-group id="zone22" typeId="zone"> + <label>Zone 22</label> + <description>Sprinkler Zone 22</description> + </channel-group> + <channel-group id="zone23" typeId="zone"> + <label>Zone 23</label> + <description>Sprinkler Zone 23</description> + </channel-group> + <channel-group id="zone24" typeId="zone"> + <label>Zone 24</label> + <description>Sprinkler Zone 24</description> + </channel-group> + <channel-group id="zone25" typeId="zone"> + <label>Zone 25</label> + <description>Sprinkler Zone 25</description> + </channel-group> + <channel-group id="zone26" typeId="zone"> + <label>Zone 26</label> + <description>Sprinkler Zone 26</description> + </channel-group> + <channel-group id="zone27" typeId="zone"> + <label>Zone 27</label> + <description>Sprinkler Zone 27</description> + </channel-group> + <channel-group id="zone28" typeId="zone"> + <label>Zone 28</label> + <description>Sprinkler Zone 28</description> + </channel-group> + <channel-group id="zone29" typeId="zone"> + <label>Zone 29</label> + <description>Sprinkler Zone 29</description> + </channel-group> + <channel-group id="zone30" typeId="zone"> + <label>Zone 30</label> + <description>Sprinkler Zone 30</description> + </channel-group> + <channel-group id="zone31" typeId="zone"> + <label>Zone 31</label> + <description>Sprinkler Zone 31</description> + </channel-group> + <channel-group id="zone32" typeId="zone"> + <label>Zone 32</label> + <description>Sprinkler Zone 32</description> + </channel-group> + <channel-group id="zone33" typeId="zone"> + <label>Zone 33</label> + <description>Sprinkler Zone 33</description> + </channel-group> + <channel-group id="zone34" typeId="zone"> + <label>Zone 34</label> + <description>Sprinkler Zone 34</description> + </channel-group> + <channel-group id="zone35" typeId="zone"> + <label>Zone 35</label> + <description>Sprinkler Zone 35</description> + </channel-group> + <channel-group id="zone36" typeId="zone"> + <label>Zone 36</label> + <description>Sprinkler Zone 36</description> + </channel-group> + </channel-groups> + <config-description> + <parameter name="host" type="text" required="true"> + <label>Host</label> + <description>Host or IP address of local controller</description> + </parameter> + <parameter name="username" type="text" required="true"> + <default>admin</default> + <label>User Name</label> + <description>User name for controller, usually "admin"</description> + </parameter> + <parameter name="password" type="text" required="true"> + <label>password</label> + <context>password</context> + <description>Password for local controller, found in the settings menu on the controller itself.</description> + </parameter> + <parameter name="refresh" type="integer" required="true"> + <label>Refresh interval</label> + <description>Specifies the refresh interval in seconds</description> + <default>30</default> + </parameter> + </config-description> + </thing-type> + + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.hyperion/NOTICE b/bundles/org.openhab.binding.hyperion/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.hyperion/NOTICE +++ b/bundles/org.openhab.binding.hyperion/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.hyperion/pom.xml b/bundles/org.openhab.binding.hyperion/pom.xml index cc54f65e78d0d..38364b8fc5edd 100644 --- a/bundles/org.openhab.binding.hyperion/pom.xml +++ b/bundles/org.openhab.binding.hyperion/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.hyperion</artifactId> diff --git a/bundles/org.openhab.binding.hyperion/src/main/feature/feature.xml b/bundles/org.openhab.binding.hyperion/src/main/feature/feature.xml index 87b6382a45da0..01863fd228f43 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.hyperion/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.hyperion-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-hyperion" description="Hyperion Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionBindingConstants.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionBindingConstants.java index 626a772b7c252..275169eb5cac4 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionBindingConstants.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionDiscoveryParticipant.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionDiscoveryParticipant.java index c1d08cf837568..6fe5cd33c6c2b 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionHandlerFactory.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionHandlerFactory.java index b95bbf45d1495..35fb791ba4f95 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionHandlerFactory.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionStateDescriptionProvider.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionStateDescriptionProvider.java index 2f64777901692..db93a93ccda4c 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/HyperionStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/connection/JsonTcpConnection.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/connection/JsonTcpConnection.java index f8edad2b68ad5..752481b3baaec 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/connection/JsonTcpConnection.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/connection/JsonTcpConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionHandler.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionHandler.java index 5624de7732bf3..8ceaf9081ba36 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionHandler.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java index 1fb9c127ef7cf..5975eb37967eb 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/handler/HyperionNgHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ColorCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ColorCommand.java index a9bb8d4fd501d..70946008609ea 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ColorCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ColorCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/CommandUnsuccessfulException.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/CommandUnsuccessfulException.java index 8efbc2ad86b6d..eedc8201e7d52 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/CommandUnsuccessfulException.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/CommandUnsuccessfulException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/EffectCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/EffectCommand.java index 345ced70b356b..67cc2634f4451 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/EffectCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/EffectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/HyperionCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/HyperionCommand.java index acafe97756612..d959a84e413b8 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/HyperionCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/HyperionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ServerInfoCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ServerInfoCommand.java index 2585b339f2246..9468ba5b6cf3e 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ServerInfoCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ServerInfoCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Adjustment.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Adjustment.java index 31e925b2267ab..bc970b0454001 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Adjustment.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Adjustment.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/AdjustmentCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/AdjustmentCommand.java index 45fb1fd4c6a33..72e71d074e013 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/AdjustmentCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/AdjustmentCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Component.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Component.java index 334b989f7a4ef..f450301d5f152 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Component.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Component.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentState.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentState.java index d77b6347b9e71..2abb71a289ca4 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentState.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentStateCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentStateCommand.java index 1f4a614cdf1d3..453aecb68ec86 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentStateCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/ComponentStateCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Hyperion.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Hyperion.java index b6df95d8a5f73..6e41b2c8bb4aa 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Hyperion.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Hyperion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgInfo.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgInfo.java index 359706cc72378..98938c69df064 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgInfo.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgResponse.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgResponse.java index 6282c9116ca57..cb1680a4519ab 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgResponse.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/NgResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Priority.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Priority.java index 2ec7c05721145..7a6eff92e06fd 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Priority.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Priority.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Session.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Session.java index e6a39c64a6f9b..1558cc05b62ad 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Session.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Session.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Value.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Value.java index ae97437768426..271fb065d8405 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Value.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/ng/Value.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveEffect.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveEffect.java index 5aa1a38a9e093..9b8743c81cc0d 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveEffect.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveEffect.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveLedColor.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveLedColor.java index edb4e4599e7a5..31b0b5acf391f 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveLedColor.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ActiveLedColor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearAllCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearAllCommand.java index b9d3cc9588b9e..5a7422581f089 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearAllCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearAllCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearCommand.java index 2e3d29ef4c14e..0b3b5950f25b2 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/ClearCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Correction.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Correction.java index af0dccd4296ba..d1810deaa00fd 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Correction.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Correction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Effect.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Effect.java index 3e7e62dd7732c..00b6ddbdae3e7 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Effect.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Effect.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/HyperionBuild.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/HyperionBuild.java index df68688fc4f67..e5650b5309c14 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/HyperionBuild.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/HyperionBuild.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Priority.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Priority.java index 6f9ee725f1363..d780c264def01 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Priority.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Priority.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Temperature.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Temperature.java index ff51c138d10cf..45d6b00aeb311 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Temperature.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Temperature.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Transform.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Transform.java index e4e46620c67a0..4464c7c7a45fc 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Transform.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/Transform.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/TransformCommand.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/TransformCommand.java index 275bca2daecb6..eaae1862fb728 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/TransformCommand.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/TransformCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Info.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Info.java index 7f73c20480ba1..01c36c183dff5 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Info.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Info.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Response.java b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Response.java index 1d89b751c587f..61926d8d82df7 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Response.java +++ b/bundles/org.openhab.binding.hyperion/src/main/java/org/openhab/binding/hyperion/internal/protocol/v1/V1Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.hyperion/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.hyperion/src/main/resources/ESH-INF/thing/thing-types.xml index eb8d1f9523d8e..bf7b1eceb89cf 100644 --- a/bundles/org.openhab.binding.hyperion/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.hyperion/src/main/resources/ESH-INF/thing/thing-types.xml @@ -16,7 +16,7 @@ <config-description> <parameter name="host" type="text" required="true"> - <label>Host address</label> + <label>Host Address</label> <context>network-address</context> <description>The host address of the Hyperion server JSON API.</description> </parameter> @@ -31,7 +31,7 @@ <default>50</default> </parameter> <parameter name="poll_frequency" type="integer" required="false" min="1"> - <label>Polling frequency</label> + <label>Polling Frequency</label> <description>How often (in seconds) to poll the Hyperion server for value changes.</description> <default>15</default> </parameter> @@ -60,7 +60,7 @@ <config-description> <parameter name="host" type="text" required="true"> - <label>Host address</label> + <label>Host Address</label> <context>network-address</context> <description>The host address of the Hyperion server JSON API.</description> </parameter> @@ -75,7 +75,7 @@ <default>50</default> </parameter> <parameter name="poll_frequency" type="integer" required="false" min="1"> - <label>Polling frequency</label> + <label>Polling Frequency</label> <description>How often (in seconds) to poll the Hyperion server for value changes.</description> <required>true</required> <default>3</default> @@ -109,7 +109,7 @@ <channel-type id="clear" advanced="true"> <item-type>String</item-type> - <label>Clear priority</label> + <label>Clear Priority</label> <description>Clears the given Hyperion priority</description> </channel-type> @@ -121,7 +121,7 @@ <channel-type id="blackborder" advanced="true"> <item-type>Switch</item-type> - <label>Black border</label> + <label>Black Border</label> <description>Shows the current state of the black border component and allows the black border component to be enabled or disabled</description> </channel-type> @@ -133,7 +133,7 @@ <channel-type id="kodichecker" advanced="true"> <item-type>Switch</item-type> - <label>Kodi checker</label> + <label>Kodi Checker</label> <description>Shows the current state of the Kodi checker component and allows the Kodi checker component to be enabled or disabled</description> </channel-type> @@ -145,13 +145,13 @@ <channel-type id="udplistener" advanced="true"> <item-type>Switch</item-type> - <label>UDP listener</label> + <label>UDP Listener</label> <description>Shows the current state of the UDP listener component and allows the UDP listener component to be enabled or disabled</description> </channel-type> <channel-type id="boblightserver" advanced="true"> <item-type>Switch</item-type> - <label>UDP listener</label> + <label>UDP Listener</label> <description>Shows the current state of the Boblight server component and allows the Boblight server component to be enabled or disabled</description> </channel-type> @@ -164,13 +164,13 @@ <channel-type id="v4l" advanced="true"> <item-type>Switch</item-type> - <label>V4L device</label> + <label>V4L Device</label> <description>Shows the current state of the v4l component and allows the v4l component to be enabled or disabled</description> </channel-type> <channel-type id="leddevice" advanced="true"> <item-type>Switch</item-type> - <label>LED device</label> + <label>LED Device</label> <description>Shows the current state of the LED component and allows the LED component to be enabled or disabled</description> </channel-type> diff --git a/bundles/org.openhab.binding.iaqualink/NOTICE b/bundles/org.openhab.binding.iaqualink/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.iaqualink/NOTICE +++ b/bundles/org.openhab.binding.iaqualink/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.iaqualink/README.md b/bundles/org.openhab.binding.iaqualink/README.md index 4c8d1840af897..e1a6ad3df101e 100644 --- a/bundles/org.openhab.binding.iaqualink/README.md +++ b/bundles/org.openhab.binding.iaqualink/README.md @@ -3,13 +3,13 @@ This binding supports: * Any iAquaLink based pool system -* Reading auxiliary, temperature, pump, chemistry and system values +* Reading auxiliary, temperature, pump, chemistry and system values * Controlling system, auxiliary, lighting, and temperature settings ## Binding Configuration -The binding requires the iAquaLink user name and password. -If you have more then one pool system registered to an account, you may optionally specify the pool serial ID/Number to use, otherwise the first pool controller will be used. +The binding requires the iAquaLink user name and password. +If you have more then one pool system registered to an account, you may optionally specify the pool serial ID/Number to use, otherwise the first pool controller will be used. ## Manual Thing Configuration @@ -21,12 +21,14 @@ Thing iaqualink:controller:pool [ userName="user@domain.com", password="somepass ## Channels -The following is a list of supported channels. +The following is a list of supported channels. Auxiliary and OneTouch channels will be dynamically added depending on what a system reports as being supported. -Auxiliary channels that are of a number type represent lighting modes (typically 0-15), Auxiliary channels that are dimmer types can set the light value in increments of 25 (0,25,50,750,100). The Auxiliary channel type will be dynamically assigned based on the controller configuration. +Auxiliary channels that are of a number type represent lighting modes (typically 0-15). +Auxiliary channels that are dimmer types can set the light value in increments of 25 (0,25,50,750,100). +The Auxiliary channel type will be dynamically assigned based on the controller configuration. -Heater status can be OFF (0), Enabled/ON (3), or Heating (1). +Heater status can be OFF (0), Enabled/ON (3), or Heating (1). | Channel Type ID | Item Type | |---------------------|----------------------------| @@ -60,11 +62,11 @@ Heater status can be OFF (0), Enabled/ON (3), or Heating (1). ### Color/Mood Auxiliary Channels String auxiliary channels can control a variety of lighting moods/colors depending on what type of lighting system is installed. -The following is a table of aux_n channel values (String) to lighting set descriptions values. +The following is a table of aux_n channel values (String) to lighting set descriptions values. The binding will automatically detect which color system is enabled and add the appropriate channel type with the following option labels. Colors can be set, but only On or Off is reported back as the current state of the channel. -| String Value | jandy Color | Jandy Led Water Colors | Pentair SAm/SAL | Hayward Universal | Pentair intelliBrite | +| String Value | jandy Color | Jandy LED Water Colors | Pentair SAm/SAL | Hayward Universal | Pentair intelliBrite | |--------------|----------------|------------------------|-----------------|-------------------|----------------------| | "off" | Off | Off | Off | Off | Off | | "on" | On | On | On | On | On | diff --git a/bundles/org.openhab.binding.iaqualink/pom.xml b/bundles/org.openhab.binding.iaqualink/pom.xml index 56f6ea628ae55..0c1f64c8859c7 100644 --- a/bundles/org.openhab.binding.iaqualink/pom.xml +++ b/bundles/org.openhab.binding.iaqualink/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.iaqualink</artifactId> diff --git a/bundles/org.openhab.binding.iaqualink/src/main/feature/feature.xml b/bundles/org.openhab.binding.iaqualink/src/main/feature/feature.xml index 486f375726f52..9636f132581f4 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.iaqualink/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.iaqualink-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-iaqualink" description="iAqualink Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkBindingConstants.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkBindingConstants.java index c69b528975486..6fab375071248 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkBindingConstants.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkHandlerFactory.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkHandlerFactory.java index ce6cd22a6112e..f94a596ebcbaf 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkHandlerFactory.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/IAqualinkHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/IAqualinkClient.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/IAqualinkClient.java index 8f7dd2dfeaf22..3c36fc27f2e21 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/IAqualinkClient.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/IAqualinkClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java index 4873f53397542..90fa4004abed9 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/AccountInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java index 61111dbbb640d..0b934938c5b63 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Auxiliary.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java index 7b3e4689ff620..82fbf8c5da275 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java index a0efff52ac45d..e8074d3a1a9b4 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/Home.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java index d1816f54e29e6..379a787d4534e 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/OneTouch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java index 6c7d5ad515758..9547da0c4fc08 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/api/model/SignIn.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/config/IAqualinkConfiguration.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/config/IAqualinkConfiguration.java index 45c4e55c873f8..0e3fcc32e4b34 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/config/IAqualinkConfiguration.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/config/IAqualinkConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/AuxiliaryType.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/AuxiliaryType.java index 9fd1e307a75f6..c264dce86528b 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/AuxiliaryType.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/AuxiliaryType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/HeaterState.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/HeaterState.java index b11a969ebbb50..f533008026ea1 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/HeaterState.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/HeaterState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/IAqualinkHandler.java b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/IAqualinkHandler.java index b2b05a1aa0fe8..c6cb34b79925f 100644 --- a/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/IAqualinkHandler.java +++ b/bundles/org.openhab.binding.iaqualink/src/main/java/org/openhab/binding/iaqualink/internal/handler/IAqualinkHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -60,6 +60,7 @@ import org.openhab.binding.iaqualink.internal.api.model.AccountInfo; import org.openhab.binding.iaqualink.internal.api.model.Auxiliary; import org.openhab.binding.iaqualink.internal.api.model.Device; +import org.openhab.binding.iaqualink.internal.api.model.Home; import org.openhab.binding.iaqualink.internal.api.model.OneTouch; import org.openhab.binding.iaqualink.internal.config.IAqualinkConfiguration; import org.slf4j.Logger; @@ -343,7 +344,15 @@ private boolean isFutureValid(@Nullable ScheduledFuture<?> future) { private void pollController() { ScheduledFuture<?> localFuture = pollFuture; try { - Map<String, String> map = client.getHome(serialNumber, sessionId).getSerializedMap(); + Home home = client.getHome(serialNumber, sessionId); + + if ("Error".equals(home.getResponse())) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "Service reports controller status as: " + home.getStatus()); + return; + } + + Map<String, String> map = home.getSerializedMap(); if (map != null) { temperatureUnit = "F".equalsIgnoreCase(map.get("temp_scale")) ? FAHRENHEIT : CELSIUS; map.forEach((k, v) -> { diff --git a/bundles/org.openhab.binding.icloud/NOTICE b/bundles/org.openhab.binding.icloud/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.icloud/NOTICE +++ b/bundles/org.openhab.binding.icloud/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.icloud/README.md b/bundles/org.openhab.binding.icloud/README.md index ec6e07fa5b1ad..c394a2b8980be 100644 --- a/bundles/org.openhab.binding.icloud/README.md +++ b/bundles/org.openhab.binding.icloud/README.md @@ -8,7 +8,7 @@ An Apple account is required. Two factor authentication is supported. Please note: Application specific passwords are not supported. -You'll need to provide the account password to the Binding. +You will need to provide the account password to the Binding. ## Discovery @@ -97,7 +97,7 @@ sitemap icloud label="iCloud" { Text item=iPhone_LocationLastUpdate Switch item=iPhone_FindMyPhone mappings=[ ON="Find!" ] Switch item=iPhone_Refresh mappings=[ REFRESH='Refresh now' ] - // Mapview for BasicUI and Applications (Android/iOS) + // Mapview for Basic UI and Applications (Android/iOS) Mapview item=iPhone_Location height=10 } } diff --git a/bundles/org.openhab.binding.icloud/pom.xml b/bundles/org.openhab.binding.icloud/pom.xml index d88d22ba95a2e..4a7ded24f5073 100644 --- a/bundles/org.openhab.binding.icloud/pom.xml +++ b/bundles/org.openhab.binding.icloud/pom.xml @@ -1,11 +1,10 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.icloud</artifactId> diff --git a/bundles/org.openhab.binding.icloud/src/main/feature/feature.xml b/bundles/org.openhab.binding.icloud/src/main/feature/feature.xml index 86cf167317d99..51c43d52c26c6 100644 --- a/bundles/org.openhab.binding.icloud/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.icloud/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.icloud-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-icloud" description="icloud Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudBindingConstants.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudBindingConstants.java index ff653e0e84645..486af00b86ad8 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudBindingConstants.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudConnection.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudConnection.java index 5bc94b65a484f..2957b7681c29f 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudConnection.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationListener.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationListener.java index d0ae48f91a7d4..69a35c55752db 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationListener.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationParser.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationParser.java index b6493b508c0ee..c38556a8642d9 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationParser.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudDeviceInformationParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudHandlerFactory.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudHandlerFactory.java index b285a1adc9825..613c9968d12a5 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudHandlerFactory.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudTlsCertificateProvider.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudTlsCertificateProvider.java index 28b5667785c8b..e20fb42ab18d2 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudTlsCertificateProvider.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/ICloudTlsCertificateProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudAccountThingConfiguration.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudAccountThingConfiguration.java index 3c249f33a2468..dde3cc93796f6 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudAccountThingConfiguration.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudAccountThingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudDeviceThingConfiguration.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudDeviceThingConfiguration.java index 0867e3be5e70d..3c29d39d9fa2f 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudDeviceThingConfiguration.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/configuration/ICloudDeviceThingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/discovery/ICloudDeviceDiscovery.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/discovery/ICloudDeviceDiscovery.java index 77c7a91a1f71a..437274529aa01 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/discovery/ICloudDeviceDiscovery.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/discovery/ICloudDeviceDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudAccountBridgeHandler.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudAccountBridgeHandler.java index 376884339f28b..d467cf83522c3 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudAccountBridgeHandler.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudAccountBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java index dd3d3475a9277..d884b73ee73b6 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudAccountDataRequest.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudAccountDataRequest.java index 2e839e6b7eed7..831afb425cb4b 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudAccountDataRequest.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudAccountDataRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudFindMyDeviceRequest.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudFindMyDeviceRequest.java index 9e117fbfa0bdf..64c097200d295 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudFindMyDeviceRequest.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/request/ICloudFindMyDeviceRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountDataResponse.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountDataResponse.java index ceb289e62c758..de893e0d49b98 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountDataResponse.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountDataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountUserInfo.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountUserInfo.java index 58195dfc76c21..f7a6f872c6d84 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountUserInfo.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudAccountUserInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceFeatures.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceFeatures.java index 5cf3a9c28da6f..410da9bef745d 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceFeatures.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceFeatures.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceInformation.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceInformation.java index 0dea769c90043..0b48aafe4c943 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceInformation.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceLocation.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceLocation.java index 616aa93b04f1f..33ae5e04268d0 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceLocation.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudDeviceLocation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContext.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContext.java index 41fc39d08402a..f279a99d6fc4b 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContext.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContextTimezone.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContextTimezone.java index ca46de9f0a464..49cb39b26ef88 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContextTimezone.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/json/response/ICloudServerContextTimezone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/utilities/ICloudTextTranslator.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/utilities/ICloudTextTranslator.java index e275958544763..4c970d3ecdf06 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/utilities/ICloudTextTranslator.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/utilities/ICloudTextTranslator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud.properties b/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud.properties index 314bad14634ee..43fc007e4b88e 100644 --- a/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud.properties +++ b/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud.properties @@ -31,4 +31,4 @@ icloud.device-thing.channel.location.label=Location icloud.device-thing.channel.location-accuracy=Location Accuracy icloud.device-thing.channel.location-last-update=Last Location Update -icloud.device-thing.property.device-name=Device name \ No newline at end of file +icloud.device-thing.property.device-name=Device name diff --git a/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud_fr.properties b/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud_fr.properties index 6e8d0899bba25..eec888a8a1dfc 100644 --- a/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud_fr.properties +++ b/bundles/org.openhab.binding.icloud/src/main/resources/ESH-INF/i18n/iCloud_fr.properties @@ -26,4 +26,4 @@ icloud.device-thing.channel.location.label=Localisation icloud.device-thing.channel.location-accuracy=Precision de localisation icloud.device-thing.channel.location-last-update=Dernière mise à jour de la localisation -icloud.device-thing.property.device-name=Nom de l'appareil \ No newline at end of file +icloud.device-thing.property.device-name=Nom de l'appareil diff --git a/bundles/org.openhab.binding.ihc/NOTICE b/bundles/org.openhab.binding.ihc/NOTICE index 33ad66d9455ac..807df74ba091e 100644 --- a/bundles/org.openhab.binding.ihc/NOTICE +++ b/bundles/org.openhab.binding.ihc/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.ihc/README.md b/bundles/org.openhab.binding.ihc/README.md index edf5042946c5a..5d352ec4039ea 100644 --- a/bundles/org.openhab.binding.ihc/README.md +++ b/bundles/org.openhab.binding.ihc/README.md @@ -67,7 +67,7 @@ Channel parameters: | direction | Text | no | ReadWrite | Direction of the channel (ReadWrite, WriteOnly, ReadOnly). | | commandToReact | String | no | | Command to react. If not defined, channel react to all commands. | | pulseWidth | Integer | no | | Pulse width in milliseconds. If defined, binding send pulse rather than command value to IHC controller. | -| inverted | Boolean | no | false | OpenHAB state is inverted compared to IHC output/input signal. | +| inverted | Boolean | no | false | openHAB state is inverted compared to IHC output/input signal. | | serialNumber | Integer | yes | | Serial number of RF device in decimal format. | | longPressTime | Integer | yes | 1000 | Long press time in milliseconds. | diff --git a/bundles/org.openhab.binding.ihc/noEmbedDependencies.profile b/bundles/org.openhab.binding.ihc/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.ihc/pom.xml b/bundles/org.openhab.binding.ihc/pom.xml index 606a5dc7c6645..482199b3d0c52 100644 --- a/bundles/org.openhab.binding.ihc/pom.xml +++ b/bundles/org.openhab.binding.ihc/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.ihc</artifactId> @@ -18,19 +17,19 @@ <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore-osgi</artifactId> <version>4.4.10</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient-osgi</artifactId> <version>4.5.8</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.ihc/src/main/feature/feature.xml b/bundles/org.openhab.binding.ihc/src/main/feature/feature.xml index 728aabad9a36a..f6264e77a53d3 100644 --- a/bundles/org.openhab.binding.ihc/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.ihc/src/main/feature/feature.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.ihc-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-ihc" description="IHC / ELKO Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true" start-level="80">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.10</bundle> - <bundle dependency="true" start-level="80">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.8</bundle> - <bundle dependency="true" start-level="80">mvn:commons-logging/commons-logging/1.2</bundle> + <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.10</bundle> + <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.8</bundle> + <bundle dependency="true">mvn:commons-logging/commons-logging/1.2</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ihc/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetector.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetector.java index 28c036d7ffd4c..cf079ef8bf981 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetector.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ChannelUtils.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ChannelUtils.java index ac1c685bcfbcf..1ea92ccd07fdc 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ChannelUtils.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ChannelUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/EnumDictionary.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/EnumDictionary.java index cf278c71bb30e..a419dd5378d89 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/EnumDictionary.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/EnumDictionary.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcBindingConstants.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcBindingConstants.java index 44d86fa1ca2ea..6568ff1173673 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcBindingConstants.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcHandlerFactory.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcHandlerFactory.java index bcbe99dfe694b..292f804f3cc7e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcHandlerFactory.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/IhcHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/SignalLevelConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/SignalLevelConverter.java index e5a591a92adf9..15d0865a82f74 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/SignalLevelConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/SignalLevelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/ChannelParams.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/ChannelParams.java index 59171aa15e9a3..d924dcd09b41b 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/ChannelParams.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/ChannelParams.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/IhcConfiguration.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/IhcConfiguration.java index 19df1660a7b5d..500452fc94362 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/IhcConfiguration.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/config/IhcConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/Converter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/Converter.java index fe0ff26796617..6bffb975625be 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/Converter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/Converter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterAdditionalInfo.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterAdditionalInfo.java index 7538786ac772e..41c73e4f8a947 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterAdditionalInfo.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterAdditionalInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterFactory.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterFactory.java index 37dda73406c4f..125be6121ccb6 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterFactory.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/ConverterFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverter.java index 17f14ea7d4bb1..24df819211ea1 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverter.java index a999e96117707..378233095f81c 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverter.java index f34dcb87e3510..196ed0af4883e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverter.java index 8eaad4e5f0f1f..f62ad4fe5ff27 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverter.java index b3c178d3c2dc8..fc73a40036bf4 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverter.java index 190cdd6837a85..ea5e604232c6b 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverter.java index 00cea5def897b..e4eedf59082de 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverter.java index 38c101674b4af..cba7c2893444e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverter.java index 7ee02116d1e11..503da6df2cdbe 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverter.java index 8c0f3bcad3f14..bb8382d45863b 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverter.java index d3a22e2ae6719..adef3aa882ee6 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverter.java index 10c07c44b9e7c..e11fe2e220643 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverter.java index f2ba4b2c43463..2b448e287505e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverter.java index ada3c98bc86ec..ac12714f9f9d6 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverter.java index 37f6d00525d95..a1f8ab5a6c534 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverter.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverter.java index 6b9108e8e5d3a..a735681978597 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverter.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/handler/IhcHandler.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/handler/IhcHandler.java index 6dfddababaa15..549c297953ab8 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/handler/IhcHandler.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/handler/IhcHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfileFactory.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfileFactory.java index 990c4e161fa4f..6fb7e452df94c 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfileFactory.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfiles.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfiles.java index 31bc4780cc938..0e7609b645f09 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfiles.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/IhcProfiles.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java index 5013b5743d155..c0e396de9b780 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/profiles/PushButtonToCommandProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcClient.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcClient.java index 10abfdca4a264..9f8d692856287 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcClient.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcEventListener.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcEventListener.java index a235edc74c82e..368325faa0073 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcEventListener.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/IhcEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSControllerState.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSControllerState.java index 108f7e0d53323..a4b374a7fccdc 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSControllerState.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSControllerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSDate.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSDate.java index fd3b1b84eedab..9202ca326af5a 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSDate.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSDate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSFile.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSFile.java index 71b4df944051b..cbe0406888952 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSFile.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSFile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSLoginResult.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSLoginResult.java index f3d0ac689f762..3163442dd82ea 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSLoginResult.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSLoginResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSNumberOfSegments.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSNumberOfSegments.java index 6bf4ef5f7f25b..fb4e1ef5fe930 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSNumberOfSegments.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSNumberOfSegments.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSProjectInfo.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSProjectInfo.java index 21f3ff2cd4cfa..2c8f74d7b5357 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSProjectInfo.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSProjectInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSRFDevice.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSRFDevice.java index 8d7a87fc59631..7a6a49c0b3118 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSRFDevice.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSRFDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSegmentationSize.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSegmentationSize.java index 5f3ce0faf7db7..fd1cc7673f25c 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSegmentationSize.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSegmentationSize.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSystemInfo.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSystemInfo.java index d3643af03803b..a5365726a862d 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSystemInfo.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSSystemInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSTimeManagerSettings.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSTimeManagerSettings.java index 10de79916c07b..31164005e6e42 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSTimeManagerSettings.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSTimeManagerSettings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUser.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUser.java index 41143c9399172..62dfe10f50166 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUser.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUserGroup.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUserGroup.java index f7f5ea949fea1..99acd941febc2 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUserGroup.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/WSUserGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/XPathUtils.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/XPathUtils.java index 0afc689e38cda..d0e18febe8228 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/XPathUtils.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/datatypes/XPathUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/ConversionException.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/ConversionException.java index 6c00d238c0e7d..7b303bccc309e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/ConversionException.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/ConversionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/IhcExecption.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/IhcExecption.java index d7b294766d830..c5f03ab366808 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/IhcExecption.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/exeptions/IhcExecption.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcConnectionPool.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcConnectionPool.java index a4b8e6f9c48dc..ce756d69a415d 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcConnectionPool.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcConnectionPool.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcHttpsClient.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcHttpsClient.java index 7d71c47859283..655aa225f428a 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcHttpsClient.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/http/IhcHttpsClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/IhcEnumValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/IhcEnumValue.java index fecfa630fe4e8..653717f6b9f97 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/IhcEnumValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/IhcEnumValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/ProjectFileUtils.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/ProjectFileUtils.java index c8f118a4f5608..5ca0c63eae8c0 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/ProjectFileUtils.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/projectfile/ProjectFileUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSBooleanValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSBooleanValue.java index 5bf4197ac10bc..9b9918f548d95 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSBooleanValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSBooleanValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSDateValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSDateValue.java index 871c558897e00..112f6aabf7b80 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSDateValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSDateValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSEnumValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSEnumValue.java index 0c507ff934f13..7aa86d353fb0c 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSEnumValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSEnumValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSFloatingPointValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSFloatingPointValue.java index c9b1d8336c178..8aadba5c7584f 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSFloatingPointValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSFloatingPointValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSIntegerValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSIntegerValue.java index b1a6157efd955..1ddcea90824c9 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSIntegerValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSIntegerValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSPhoneNumberValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSPhoneNumberValue.java index 5506510c14e54..d03a44d8220a9 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSPhoneNumberValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSPhoneNumberValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSResourceValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSResourceValue.java index 935c769f07d03..77851fcad7aed 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSResourceValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSResourceValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneDimmerValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneDimmerValue.java index 55f485940606b..91968fb391821 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneDimmerValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneDimmerValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneRelayValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneRelayValue.java index c68dc2d2e064a..8dc523f067396 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneRelayValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneRelayValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneShutterSimpleValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneShutterSimpleValue.java index 2d3bcc7389817..6520eff33719e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneShutterSimpleValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSSceneShutterSimpleValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimeValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimeValue.java index 0d90f538fe5ec..ddf52709ca043 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimeValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimeValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimerValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimerValue.java index 4da29232d9c9d..c39b3cd31bcd7 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimerValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSTimerValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSWeekdayValue.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSWeekdayValue.java index 23683a6732bfd..d9de7db984b32 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSWeekdayValue.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSWeekdayValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementService.java index 966bfec97e580..55a7e8933f6ab 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationService.java index 69643b228e3f5..6fd1e8f820162 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcBaseService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcBaseService.java index de1286b6cb720..ee0d75d95f9d7 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcBaseService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcBaseService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationService.java index 0658be4ba96fa..4d4765c404f36 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerService.java index 0a96818c2800c..d246758e62d8a 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionService.java index ff3e921e99dd5..a28ab9820bf7e 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeService.java b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeService.java index 37a69cf9fee19..13950f58df431 100644 --- a/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeService.java +++ b/bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.ihc/src/main/resources/ESH-INF/thing/channels.xml index 378c8de378bbb..ca88d89e1cedf 100644 --- a/bundles/org.openhab.binding.ihc/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.ihc/src/main/resources/ESH-INF/thing/channels.xml @@ -43,7 +43,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> @@ -93,7 +93,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> @@ -123,7 +123,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> @@ -157,7 +157,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> @@ -187,7 +187,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> @@ -217,7 +217,7 @@ </options> </parameter> <parameter name="commandToReact" type="text" required="false"> - <label>Command To React</label> + <label>Command to React</label> <description>Command to react. If not defined, channel react to all commands.</description> </parameter> <parameter name="pulseWidth" type="integer" required="false" min="0" max="4000" step="100" unit="ms"> diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetectorTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetectorTest.java index 7ad87f0e8afb6..ecc9cdaebcb87 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetectorTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ButtonPressDurationDetectorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/SignalLevelConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/SignalLevelConverterTest.java index 7d2fb57916fd4..bcdc0bd5a2b39 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/SignalLevelConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/SignalLevelConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverterTest.java index 193263def3331..96d802ae94db2 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSDateValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverterTest.java index fbf10f979a865..3c3e3223d38d4 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DateTimeTypeWSTimeValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverterTest.java index 3eec37b79ee47..5dad5c2fee9c2 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSBooleanValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverterTest.java index 381aebee276b3..98748589f4a71 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSEnumValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverterTest.java index 604bff701e5f1..063eadce608a0 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSFloatingPointValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverterTest.java index cebd0b8a3ee1b..907aa7bfa702e 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSIntegerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverterTest.java index bdfbd23fd9a0e..56b8aeebacba1 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSTimerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverterTest.java index 5d7df37fc5fbe..9825d0896b581 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/DecimalTypeWSWeekdayValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverterTest.java index d4d0cddaa3784..bb8a35f8d3a61 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSBooleanValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverterTest.java index 3a9c5383d2a62..905131628158f 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OnOffTypeWSIntegerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverterTest.java index fab31a00b38db..ea7949e4998a1 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSBooleanValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverterTest.java index 5ff2277271e96..7439d7dab2986 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/OpenClosedTypeWSIntegerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverterTest.java index 7327738dcb127..91637dd700a7d 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/PercentTypeWSIntegerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverterTest.java index d2c78ae542b6f..f3d4212d155f8 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/StringTypeWSEnumValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverterTest.java index e00e40cde9279..5b99a6e1994be 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSBooleanValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverterTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverterTest.java index 38ff8d8468594..fd2fd41b47e05 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverterTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/converters/UpDownTypeWSIntegerValueConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/IhcClientTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/IhcClientTest.java index 12aa35af2d5f0..28661f82c72e1 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/IhcClientTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/IhcClientTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/ResourceFileUtils.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/ResourceFileUtils.java index f76f26160be17..9b6b64de8ce1f 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/ResourceFileUtils.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/ResourceFileUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementServiceTest.java index f641662ae7a6e..eb86baaaeee0d 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAirlinkManagementServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationServiceTest.java index 88ff0e488f3bc..4c7144906ab3e 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcAuthenticationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationServiceTest.java index ae0e259047a67..061004e098aef 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcConfigurationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerServiceTest.java index 8629f2388b0fc..6baece6e59fb8 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcControllerServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionServiceTest.java index 3c2ac938782bb..8bdbb50a6df5c 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcResourceInteractionServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeServiceTest.java b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeServiceTest.java index 40b45d7a06a19..85f41d56ce110 100644 --- a/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeServiceTest.java +++ b/bundles/org.openhab.binding.ihc/src/test/java/org/openhab/binding/ihc/internal/ws/services/IhcTimeServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ControllerStateResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ControllerStateResponse.xml index 4d2a07dbfda77..63c851f51704c 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ControllerStateResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ControllerStateResponse.xml @@ -5,4 +5,4 @@ <ns1:state xsi:type="xsd:string">text.ctrl.state.ready</ns1:state> </ns1:getState1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/EmptyQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/EmptyQuery.xml index f93dc9fc4407e..a2a721d48a8bd 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/EmptyQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/EmptyQuery.xml @@ -2,4 +2,4 @@ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetDetectedDeviceListResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetDetectedDeviceListResponse.xml index 016ef6dcffcb9..ca65c823a9c8b 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetDetectedDeviceListResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetDetectedDeviceListResponse.xml @@ -17,4 +17,4 @@ </ns1:arrayItem> </ns1:getDetectedDeviceList1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectInfoResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectInfoResponse.xml index ea351c277b0c8..41e64f47d2656 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectInfoResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectInfoResponse.xml @@ -31,4 +31,4 @@ <ns1:installerName xsi:type="xsd:string"></ns1:installerName> </ns1:getProjectInfo1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectNumberOfSegmentsResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectNumberOfSegmentsResponse.xml index 2b126337b6cc9..2020f6ca56c72 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectNumberOfSegmentsResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectNumberOfSegmentsResponse.xml @@ -3,4 +3,4 @@ <SOAP-ENV:Body> <ns1:getIHCProjectNumberOfSegments1 xmlns:ns1="utcs" xsi:type="xsd:int">28</ns1:getIHCProjectNumberOfSegments1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentQuery.xml index fbd0d5bf92e51..f12552ccafcf7 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentQuery.xml @@ -5,4 +5,4 @@ <ns2:getIHCProjectSegment2 xmlns:ns2="utcs" xsi:type="xsd:int">1001</ns2:getIHCProjectSegment2> <ns3:getIHCProjectSegment3 xmlns:ns3="utcs" xsi:type="xsd:int">2002</ns3:getIHCProjectSegment3> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentResponse.xml index 2a2e71d0ab31a..0a9ce72efa50e 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentResponse.xml @@ -7,4 +7,4 @@ <ns1:data xsi:type="xsd:base64Binary">LvVF4VWSi0WqRKps7lGH6U....OBCl1gwKGbvYM1SDh</ns1:data> </ns1:getIHCProjectSegment4> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentationSizeResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentationSizeResponse.xml index 3e56de453416f..4c3c8137f586b 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentationSizeResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetProjectSegmentationSizeResponse.xml @@ -3,4 +3,4 @@ <SOAP-ENV:Body> <ns1:getIHCProjectSegmentationSize1 xmlns:ns1="utcs" xsi:type="xsd:int">7500</ns1:getIHCProjectSegmentationSize1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetSettingsResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetSettingsResponse.xml index 899f243662f2f..0ca5befb5869d 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetSettingsResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetSettingsResponse.xml @@ -27,4 +27,4 @@ </ns1:timeAndDateInUTC> </ns1:getSettings1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/GetSystemInfoResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/GetSystemInfoResponse.xml index 837677fff85c8..a5a14740dc879 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/GetSystemInfoResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/GetSystemInfoResponse.xml @@ -21,4 +21,4 @@ <ns1:applicationIsWithoutViewer xsi:type="xsd:boolean">false</ns1:applicationIsWithoutViewer> </ns1:getSystemInfo1> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedQuery.xml index 4bfbbb1adeb64..8308eba4226c7 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedQuery.xml @@ -7,4 +7,4 @@ <application>treeview</application> </authenticate1> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedResponse.xml index 14e06f2e08822..a16cf36366236 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/LoginFailedResponse.xml @@ -14,4 +14,4 @@ <ns1:loginFailedDueToAccountInvalid xsi:type="xsd:boolean">true</ns1:loginFailedDueToAccountInvalid> </ns1:authenticate2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ProjectFileContent.txt b/bundles/org.openhab.binding.ihc/src/test/resources/ProjectFileContent.txt index 6a2c0ff3e4b70..807a575fb7d51 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ProjectFileContent.txt +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ProjectFileContent.txt @@ -2,4 +2,4 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet augue t Sed hendrerit, est eu hendrerit condimentum, mi justo vehicula ipsum, at dignissim tortor mi quis velit. Aliquam in turpis quis mi dapibus efficitur sed vel metus. Donec ac nisl magna. Cras eget nulla in nunc mollis semper quis et ex. Nulla accumsan dui non mi interdum interdum a nec justo. Phasellus at dolor sit amet purus porta tristique eget in diam. Suspendisse laoreet vulputate nulla quis dictum. Sed laoreet elit sed ipsum ornare ornare. Vivamus in blandit enim, et luctus lacus. Aenean id laoreet diam. Pellentesque ipsum diam, fermentum nec ante ac, mattis tristique mi. Curabitur ultricies risus cursus iaculis ultrices. Nullam sed pharetra arcu. Sed sed dui congue, porttitor nisl vitae, viverra risus. -Proin at lorem non nunc ullamcorper cursus ut id purus. Proin ac enim non ex aliquam auctor non vel lorem. Aliquam aliquam enim eget tellus mollis dictum. Nulla rhoncus placerat ante vitae vestibulum. Donec facilisis justo vitae dolor ultrices semper. Vivamus mollis neque id felis feugiat, at consectetur ipsum posuere. Ut viverra ex ante, nec lobortis metus pellentesque id. Pellentesque cursus augue sit amet mi varius, sed ultricies ligula turpis duis. \ No newline at end of file +Proin at lorem non nunc ullamcorper cursus ut id purus. Proin ac enim non ex aliquam auctor non vel lorem. Aliquam aliquam enim eget tellus mollis dictum. Nulla rhoncus placerat ante vitae vestibulum. Donec facilisis justo vitae dolor ultrices semper. Vivamus mollis neque id felis feugiat, at consectetur ipsum posuere. Ut viverra ex ante, nec lobortis metus pellentesque id. Pellentesque cursus augue sit amet mi varius, sed ultricies ligula turpis duis. diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsQuery.xml index 0b0a48e071f60..cd6dd012b00e3 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsQuery.xml @@ -3,4 +3,4 @@ <soapenv:Body> <utcs:waitForResourceValueChanges1>1</utcs:waitForResourceValueChanges1> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsResponse.xml index b2a845938295d..b524ffb45410e 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueNotificationsResponse.xml @@ -119,4 +119,4 @@ </ns1:arrayItem> </ns1:waitForResourceValueChanges2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse11111.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse11111.xml index 137b8234d644f..e9f584595b940 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse11111.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse11111.xml @@ -13,4 +13,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse22222.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse22222.xml index 770b6a92626a0..a526e4304cad0 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse22222.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse22222.xml @@ -17,4 +17,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse33333.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse33333.xml index 40245b2d56b47..de9c10535fd47 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse33333.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse33333.xml @@ -17,4 +17,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse44444.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse44444.xml index 9c4aeaa8e1e9e..83e6816307f84 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse44444.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse44444.xml @@ -17,4 +17,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse55555.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse55555.xml index 8a8a7a7b63ea3..5af7067782e36 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse55555.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse55555.xml @@ -13,4 +13,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse66666.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse66666.xml index 4eaa2fd56acf7..99e70fdfb933f 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse66666.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse66666.xml @@ -13,4 +13,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse77777.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse77777.xml index 889a8e3979820..bc212cd6e794b 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse77777.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse77777.xml @@ -17,4 +17,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse88888.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse88888.xml index 9d9277f840be6..cffdbfbf0b0c3 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse88888.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryResponse88888.xml @@ -17,4 +17,4 @@ </ns1:value> </ns1:getRuntimeValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryTemplate.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryTemplate.xml index 6d23821b0635b..d0ba1f1d8c134 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryTemplate.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueQueryTemplate.xml @@ -3,4 +3,4 @@ <soapenv:Body> <ns1:getRuntimeValue1 xmlns:ns1="utcs">%s</ns1:getRuntimeValue1> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100001.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100001.xml index e1709ec9d45f3..82c5d0116495b 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100001.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100001.xml @@ -9,4 +9,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100011.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100011.xml index b56399d5289f8..3abe3e91c58b0 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100011.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate100011.xml @@ -9,4 +9,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate200002.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate200002.xml index d986f1b7ff3dc..48952d850b5ea 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate200002.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate200002.xml @@ -11,4 +11,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate300003.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate300003.xml index 2dc2eded489af..967d6e7b61ffa 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate300003.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate300003.xml @@ -11,4 +11,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate400004.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate400004.xml index c90d311b83150..045682b2e8392 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate400004.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate400004.xml @@ -11,4 +11,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate500005.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate500005.xml index db43bcb5ee637..63812de3136bb 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate500005.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate500005.xml @@ -9,4 +9,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate600006.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate600006.xml index f68c07e4ef537..5e46d91509511 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate600006.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate600006.xml @@ -9,4 +9,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate700007.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate700007.xml index 2041cbc4f468a..0f38bbb948aa8 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate700007.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate700007.xml @@ -11,4 +11,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate800008.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate800008.xml index 42de4075330a5..0399863e50fcd 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate800008.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdate800008.xml @@ -11,4 +11,4 @@ <isValueRuntime>true</isValueRuntime> </setResourceValue1> </soap:Body> -</soap:Envelope> \ No newline at end of file +</soap:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateFailureResult.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateFailureResult.xml index ca2b2715aba9b..c60a2043f1416 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateFailureResult.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateFailureResult.xml @@ -3,4 +3,4 @@ <SOAP-ENV:Body> <ns1:setResourceValue2 xmlns:ns1="utcs" xsi:type="xsd:boolean">false</ns1:setResourceValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateOkResult.xml b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateOkResult.xml index b7ffdbe5efb94..363f71e23be58 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateOkResult.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/ResourceValueUpdateOkResult.xml @@ -3,4 +3,4 @@ <SOAP-ENV:Body> <ns1:setResourceValue2 xmlns:ns1="utcs" xsi:type="xsd:boolean">true</ns1:setResourceValue2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginQuery.xml index fd30bfa2c2703..77404fa91e01a 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginQuery.xml @@ -7,4 +7,4 @@ <application>treeview</application> </authenticate1> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginResponse.xml index 7221eefaa8746..73177a61d1eb3 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/SuccesfulLoginResponse.xml @@ -64,4 +64,4 @@ <ns1:loginFailedDueToAccountInvalid xsi:type="xsd:boolean">false</ns1:loginFailedDueToAccountInvalid> </ns1:authenticate2> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeQuery.xml b/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeQuery.xml index 1e5e31b07a23a..f124252da7a46 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeQuery.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeQuery.xml @@ -6,4 +6,4 @@ </ns1:waitForControllerStateChange1> <ns2:waitForControllerStateChange2 xmlns:ns2="utcs" xsi:type="xsd:int">5</ns2:waitForControllerStateChange2> </soapenv:Body> -</soapenv:Envelope> \ No newline at end of file +</soapenv:Envelope> diff --git a/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeResponse.xml b/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeResponse.xml index 0a101cabd06ae..ada9531e9d7da 100644 --- a/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeResponse.xml +++ b/bundles/org.openhab.binding.ihc/src/test/resources/WaitForControllerStateChangeResponse.xml @@ -5,4 +5,4 @@ <ns1:state xsi:type="xsd:string">text.ctrl.state.ready</ns1:state> </ns1:waitForControllerStateChange3> </SOAP-ENV:Body> -</SOAP-ENV:Envelope> \ No newline at end of file +</SOAP-ENV:Envelope> diff --git a/bundles/org.openhab.binding.innogysmarthome/.classpath b/bundles/org.openhab.binding.innogysmarthome/.classpath index a5d95095ccaaf..66499b2691224 100644 --- a/bundles/org.openhab.binding.innogysmarthome/.classpath +++ b/bundles/org.openhab.binding.innogysmarthome/.classpath @@ -28,5 +28,16 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> + <classpathentry kind="src" path="target/generated-sources/annotations"> + <attributes> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.innogysmarthome/NOTICE b/bundles/org.openhab.binding.innogysmarthome/NOTICE index 3f37fa8d86877..efac929dd3b56 100644 --- a/bundles/org.openhab.binding.innogysmarthome/NOTICE +++ b/bundles/org.openhab.binding.innogysmarthome/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.innogysmarthome/README.md b/bundles/org.openhab.binding.innogysmarthome/README.md index a845424ac027b..35424b6df971b 100644 --- a/bundles/org.openhab.binding.innogysmarthome/README.md +++ b/bundles/org.openhab.binding.innogysmarthome/README.md @@ -1,7 +1,7 @@ # innogy SmartHome Binding -The binding integrates the [innogy SmartHome](http://innogy.com/smarthome) system into openHAB. -It uses the official API as provided by innogy as cloud service. +The binding integrates the [innogy SmartHome](https://innogy.com/smarthome) system into openHAB. +It uses the official API 1.1 as provided by innogy as cloud service. As all status updates and commands have to go through the API, a permanent internet connection is required. Currently there is no API for a direct communication with the innogy SmartHome Controller (SHC). @@ -11,42 +11,43 @@ Currently there is no API for a direct communication with the innogy SmartHome C The innogy SmartHome Controller (SHC) is the bridge, that provides the central communication with the devices. Without the SHC, you cannot communicate with the devices. +This binding supports both the SHC and the SHC2 (with support for Bluetooth devices). ### Devices The following table shows all supported and tested devices and their channels. The channels are described in detail in the next chapter. -| Device | Description | Supported channels | -| ------ | ----------- | ------------------ | -| BRC8 | Basic Remote Controller | button1 ... button8, button1_count ... button8_count, battery_low | -| ISC2 | In Wall Smart Controller | button1, button2, button1_count, button2_count | -| ISD2 | In Wall Smart Dimmer | button1, button2, button1_count, button2_count, dimmer | -| ISR2 | In Wall Smart Rollershutter | button1, button2, button1_count, button2_count, rollershutter | -| ISS2 | In Wall Smart Switch | button1, button2, button1_count, button2_count, switch | -| PSD | Pluggable Smart Dimmer | dimmer | -| PSS | Pluggable Smart Switch, indoor | switch | -| PSSO | Pluggable Smart Switch, outdoor | switch | -| RST | Radiator Mounted Smart Thermostat | set_temperature, temperature, frost_warning, humidity, mold_warning, operation_mode, window_reduction_active, battery_low | -| RST2 | Radiator Mounted Smart Thermostat (newer two battery version since 2018) | set_temperature, temperature, frost_warning, humidity, mold_warning, operation_mode, window_reduction_active, battery_low | -| | VariableActuator | switch | -| WDS | Window Door Sensor | contact, battery_low | -| WMD| Wall Mounted Motion Detector, indoor | motion_count, luminance, battery_low | -| WMDO | Wall Mounted Motion Detector, outdoor | motion_count, luminance, battery_low | -| WRT | Wall Mounted Room Thermostat | set_temperature, temperature, humidity, battery_low | -| WSC2 | Wall Mounted Smart Controller | button1, button2, button1_count, button2_count, battery_low | -| WSD | Wall Mounted Smoke Detector, old version | smoke, alarm, battery_low | -| WSD2 | Wall Mounted Smoke Detector, new version | smoke, alarm, battery_low | +| Device | Description | Supported channels | +|--------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------| +| BRC8 | Basic Remote Controller | button1 ... button8, button1_count ... button8_count, battery_low | +| ISC2 | In Wall Smart Controller | button1, button2, button1_count, button2_count | +| ISD2 | In Wall Smart Dimmer | button1, button2, button1_count, button2_count, dimmer | +| ISR2 | In Wall Smart Rollershutter | button1, button2, button1_count, button2_count, rollershutter | +| ISS2 | In Wall Smart Switch | button1, button2, button1_count, button2_count, switch | +| PSD | Pluggable Smart Dimmer | dimmer | +| PSS | Pluggable Smart Switch, indoor | switch | +| PSSO | Pluggable Smart Switch, outdoor | switch | +| BT-PSS | Bluetooth Pluggable Smart Switch, indoor | switch | +| RST | Radiator Mounted Smart Thermostat | set_temperature, temperature, frost_warning, humidity, mold_warning, operation_mode, window_reduction_active, battery_low | +| RST2 | Radiator Mounted Smart Thermostat (newer two battery version since 2018) | set_temperature, temperature, frost_warning, humidity, mold_warning, operation_mode, window_reduction_active, battery_low | +| | VariableActuator | switch | +| WDS | Window Door Sensor | contact, battery_low | +| WMD | Wall Mounted Motion Detector, indoor | motion_count, luminance, battery_low | +| WMDO | Wall Mounted Motion Detector, outdoor | motion_count, luminance, battery_low | +| WRT | Wall Mounted Room Thermostat | set_temperature, temperature, humidity, battery_low | +| WSC2 | Wall Mounted Smart Controller | button1, button2, button1_count, button2_count, battery_low | +| WSD | Wall Mounted Smoke Detector, old version | smoke, alarm, battery_low | +| WSD2 | Wall Mounted Smoke Detector, new version | smoke, alarm, battery_low | Powermeter devices -| Device | Description | Supported channels | -| ------ | ----------- | ------------------ | -| AnalogMeter | The Analog Meter from the innogy EnergyControl product | energy_consumption_month_kwh, absolute_energy_consumption, energy_consumption_month_euro, energy_consumption_day_euro, energy_consumption_day_kwh | -| GenerationMeter | The Generation Meter from the innogy PowerControlSolar product | energy_generation_month_kwh, total_energy_generation, energy_generation_month_euro, energy_generation_day_euro, energy_generation_day_kwh, power_generation_watt | -| SmartMeter | The Smart Meter from the innogy PowerControl product. | energy_consumption_month_kwh, absolute_energy_consumption, energy_consumption_month_euro, energy_consumption_day_euro, energy_consumption_day_kwh, power_consumption_watt | -| Two-Way-Meter | The Two-Way-Meter from the innogy PowerControlSolar product | energy_month_kwh, total_energy, energy_month_euro, energy_day_euro, energy_day_kwh, energy_feed_month_kwh, total_energy_fed, energy_feed_month_euro, energy_feed_day_euro, energy_feed_day_kwh, power_watt | - +| Device | Description | Supported channels | +|-----------------|----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| AnalogMeter | The Analog Meter from the innogy EnergyControl product | energy_consumption_month_kwh, absolute_energy_consumption, energy_consumption_month_euro, energy_consumption_day_euro, energy_consumption_day_kwh | +| GenerationMeter | The Generation Meter from the innogy PowerControlSolar product | energy_generation_month_kwh, total_energy_generation, energy_generation_month_euro, energy_generation_day_euro, energy_generation_day_kwh, power_generation_watt | +| SmartMeter | The Smart Meter from the innogy PowerControl product. | energy_consumption_month_kwh, absolute_energy_consumption, energy_consumption_month_euro, energy_consumption_day_euro, energy_consumption_day_kwh, power_consumption_watt | +| Two-Way-Meter | The Two-Way-Meter from the innogy PowerControlSolar product | energy_month_kwh, total_energy, energy_month_euro, energy_day_euro, energy_day_kwh, energy_feed_month_kwh, total_energy_fed, energy_feed_month_euro, energy_feed_day_euro, energy_feed_day_kwh, power_watt | ## Discovery @@ -60,40 +61,45 @@ However, only devices will appear that are added in the innogy SmartHome app bef ## Channels -| Channel Type ID | Item Type | Description | Available on thing | -| --------------- | ------------ | ------------ | ------------------ | -| alarm | Switch | Switches the alarm (ON/OFF) | WSD, WSD2 | -| battery_low | Switch | Indicates, if the battery is low (ON/OFF) | BRC8, RST, WDS, WMD, WMD0, WRT, WSC2, WSD, WSD2 | -| contact | Contact | Indicates the contact state (OPEN/CLOSED) | WDS | -| dimmer | Dimmer | Allows to dimm a light device | ISD2, PSD | -| frost_warning | Switch | active, if the measured temperature is too low (ON/OFF) | RST | -| humidity | Number | Relative humidity in percent | RST, WRT | -| button1 | - | trigger channel for rules, fires with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | -| button2 | - | trigger channel for rules, fires with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | -| button3 | - | trigger channel for rules, fires with each push | BRC8 | -| button4 | - | trigger channel for rules, fires with each push | BRC8 | -| button5 | - | trigger channel for rules, fires with each push | BRC8 | -| button6 | - | trigger channel for rules, fires with each push | BRC8 | -| button7 | - | trigger channel for rules, fires with each push | BRC8 | -| button8 | - | trigger channel for rules, fires with each push | BRC8 | -| button1_count | Number | number of button pushes for button 1, increased with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | -| button2_count | Number | number of button pushes for button 2, increased with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | -| button3_count | Number | number of button pushes for button 3, increased with each push | BRC8 | -| button4_count | Number | number of button pushes for button 4, increased with each push | BRC8 | -| button5_count | Number | number of button pushes for button 5, increased with each push | BRC8 | -| button6_count | Number | number of button pushes for button 6, increased with each push | BRC8 | -| button7_count | Number | number of button pushes for button 7, increased with each push | BRC8 | -| button8_count | Number | number of button pushes for button 8, increased with each push | BRC8 | -| luminance | Number | Indicates the measured luminance in percent | WMD, WMD0 | -| mold_warning | Switch | active, if the measured humidity is too low (ON/OFF) | RST | -| motion_count | Number | Number of detected motions, increases with each detected motion | WMD, WMDO | -| operation_mode | String | the mode of a thermostat (auto/manual) | RST | -| rollershutter | Rollershutter | Controls a roller shutter | ISR2 | -| set_temperature | Number | Sets the target temperature in °C | RST, WRT | -| smoke | Switch | Indicates, if smoke was detected (ON/OFF) | WSD, WSD2 | -| switch | Switch | A switch to turn the device or variable on/off (ON/OFF) | ISS2, PSS, PSSO, VariableActuator | -| temperature | Number | Holds the actual temperature in °C | RST, WRT | -| window_reduction_active | Switch | indicates if a linked window is open and temperature reduced (ON/OFF) | RST | +| Channel Type ID | Item Type | Description | Available on thing | +|-------------------------|---------------|-----------------------------------------------------------------------|-------------------------------------------------| +| alarm | Switch | Switches the alarm (ON/OFF) | WSD, WSD2 | +| battery_low | Switch | Indicates, if the battery is low (ON/OFF) | BRC8, RST, WDS, WMD, WMD0, WRT, WSC2, WSD, WSD2 | +| contact | Contact | Indicates the contact state (OPEN/CLOSED) | WDS | +| dimmer | Dimmer | Allows to dimm a light device | ISD2, PSD | +| frost_warning | Switch | active, if the measured temperature is too low (ON/OFF) | RST | +| humidity | Number | Relative humidity in percent | RST, WRT | +| button1 | - | trigger channel for rules, fires with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | +| button2 | - | trigger channel for rules, fires with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | +| button3 | - | trigger channel for rules, fires with each push | BRC8 | +| button4 | - | trigger channel for rules, fires with each push | BRC8 | +| button5 | - | trigger channel for rules, fires with each push | BRC8 | +| button6 | - | trigger channel for rules, fires with each push | BRC8 | +| button7 | - | trigger channel for rules, fires with each push | BRC8 | +| button8 | - | trigger channel for rules, fires with each push | BRC8 | +| button1_count | Number | number of button pushes for button 1, increased with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | +| button2_count | Number | number of button pushes for button 2, increased with each push | BRC8, ISC2, ISD2, ISR2, ISS2, WSC2 | +| button3_count | Number | number of button pushes for button 3, increased with each push | BRC8 | +| button4_count | Number | number of button pushes for button 4, increased with each push | BRC8 | +| button5_count | Number | number of button pushes for button 5, increased with each push | BRC8 | +| button6_count | Number | number of button pushes for button 6, increased with each push | BRC8 | +| button7_count | Number | number of button pushes for button 7, increased with each push | BRC8 | +| button8_count | Number | number of button pushes for button 8, increased with each push | BRC8 | +| luminance | Number | Indicates the measured luminance in percent | WMD, WMD0 | +| mold_warning | Switch | active, if the measured humidity is too low (ON/OFF) | RST | +| motion_count | Number | Number of detected motions, increases with each detected motion | WMD, WMDO | +| operation_mode | String | the mode of a thermostat (auto/manual) | RST | +| rollershutter* | Rollershutter | Controls a roller shutter | ISR2 | +| set_temperature | Number | Sets the target temperature in °C | RST, WRT | +| smoke | Switch | Indicates, if smoke was detected (ON/OFF) | WSD, WSD2 | +| switch | Switch | A switch to turn the device or variable on/off (ON/OFF) | ISS2, PSS, PSSO, VariableActuator | +| temperature | Number | Holds the actual temperature in °C | RST, WRT | +| window_reduction_active | Switch | indicates if a linked window is open and temperature reduced (ON/OFF) | RST | + +The `rollershutter` channel has a `boolean` parameter `invert`. +It is `false` by default. +This means `100` on innogy is `UP` and `0` is `DOWN`. +When `invert` is `true` than `0` on innogy is `UP` and `100` is `DOWN`. ## Thing configuration @@ -168,7 +174,7 @@ The device ID (e.g. e9a74941a3807b57332214f346fb1129) can be found in the Paper However, a full example .things configuration look like this: ``` -Bridge innogysmarthome:bridge:mybride "innogy SmartHome Controller" [ refreshtoken="<insert-your-refresh-token-here>" ] { +Bridge innogysmarthome:bridge:mybride "innogy SmartHome Controller" { Thing ISD2 myDimmer "Dimmer Kitchen" @ "Kitchen" [ id="<device-id>" ] Thing ISS2 myLightSwitch "Light Livingroom" @ "Livingroom" [ id="<device-id>" ] Thing PSS myTVSwitch "TV" @ "Livingroom" [ id="<device-id>" ] @@ -227,15 +233,15 @@ end ## Resolving certificate issues -If the bridge stays offline with the following status shown in the PaperUI, the reason could be an expired certificate: +If the bridge stays offline with the following status shown in the Paper UI, the reason could be an expired certificate: `OFFLINE - COMMUNICATION_ERROR sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target` -To solve this on a linux system, follow this steps: +To solve this on a Linux system, follow this steps: 1. Download the certificates (.cer-files) of https://home.innogy-smarthome.de and https://innogy.com including the "DigiCert Global Root G2" to your computer. -As this depends on the usen browser and operating system, please google on how to achieve this for your situation. -2. On your linux system, goto your Java Machine's certificate store, e.g. `/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/security`. +As this depends on the used browser and operating system, please use a web search engine to find out how to achieve this for your situation. +2. On your Linux system, goto your Java Machine's certificate store, e.g. `/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/lib/security`. The path should include a file called `cacerts` (this is the certificate store) and may differ depending on the system used. 3. Copy the .cer-files from step 1 into this directory. 4. Import each certificate with the command: `sudo keytool –importcert –alias “innogysmarthome†–keystore cacerts –file innogy.cer` diff --git a/bundles/org.openhab.binding.innogysmarthome/pom.xml b/bundles/org.openhab.binding.innogysmarthome/pom.xml index 289ff4e26c46a..06f3475bf4a61 100644 --- a/bundles/org.openhab.binding.innogysmarthome/pom.xml +++ b/bundles/org.openhab.binding.innogysmarthome/pom.xml @@ -1,55 +1,15 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.innogysmarthome</artifactId> <name>openHAB Add-ons :: Bundles :: innogy Smarthome Binding</name> - <dependencies> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpcore-osgi</artifactId> - <version>4.4.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient-osgi</artifactId> - <version>4.5.2</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>20.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.google.http-client.google-http-client-gson</artifactId> - <version>1.27.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.google.http-client</groupId> - <artifactId>google-http-client</artifactId> - <version>1.27.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>com.google.oauth-client</groupId> - <artifactId>google-oauth-client</artifactId> - <version>1.27.0</version> - <scope>provided</scope> - </dependency> - </dependencies> - </project> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/feature/feature.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/feature/feature.xml index 77b5edaceaced..cb68e28ecb55c 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/feature/feature.xml @@ -1,16 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.innogysmarthome-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> - <feature name="openhab-binding-innogysmarthome" description="innogy Smarthome Binding" version="${project.version}"> - <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.4</bundle> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle> - <bundle dependency="true">mvn:com.google.guava/guava/20.0</bundle> - <bundle dependency="true">mvn:commons-codec/commons-codec/1.10</bundle> - <bundle dependency="true">mvn:com.google.oauth-client/google-oauth-client/1.27.0</bundle> - <bundle dependency="true">mvn:com.google.http-client/google-http-client/1.27.0</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/com.google.http-client.google-http-client-gson/1.27.0</bundle> - <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.innogysmarthome/${project.version}</bundle> - </feature> + <feature name="openhab-binding-innogysmarthome" description="innogy Smarthome Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <feature>openhab-transport-http</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.innogysmarthome/${project.version}</bundle> + </feature> </features> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyBindingConstants.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyBindingConstants.java index c46b2936bbe85..716c2e11b004f 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyBindingConstants.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,21 +33,11 @@ public class InnogyBindingConstants { // brands and client ids public static final String BRAND_INNOGY_SMARTHOME = "innogy_smarthome"; - public static final String BRAND_SMARTHOME_AUSTRIA = "smarthome_austria"; - public static final String BRAND_START_SMARTHOME = "start_smarthome"; public static final String DEFAULT_BRAND = BRAND_INNOGY_SMARTHOME; public static final String CLIENT_ID_INNOGY_SMARTHOME = "24635748"; - public static final String CLIENT_ID_SMARTHOME_AUSTRIA = "24635749"; - public static final String CLIENT_ID_START_SMARTHOME = "24635750"; - public static final String CLIENT_SECRET_INNOGY_SMARTHOME = "no secret"; - public static final String CLIENT_SECRET_SMARTHOME_AUSTRIA = "no secret"; - public static final String CLIENT_SECRET_START_SMARTHOME = "no secret"; - public static final String REDIRECT_URL_INNOGY_SMARTHOME = "https://www.openhab.org/oauth/innogy/innogy-smarthome.html"; - public static final String REDIRECT_URL_SMARTHOME_AUSTRIA = "https://www.openhab.org/oauth/innogy/smarthome-austria.html"; - public static final String REDIRECT_URL_START_SMARTHOME = "https://www.openhab.org/oauth/innogy/start-smarthome.html"; // Bridge config parameters public static final String CONFIG_BRAND = "brand"; @@ -58,10 +48,10 @@ public class InnogyBindingConstants { public static final String CONFIG_WEBSOCKET_IDLE_TIMEOUT = "websocketidletimeout"; public static final long REINITIALIZE_DELAY_SECONDS = 30; - public static final long REINITIALIZE_DELAY_LONG_SECONDS = 120; + public static final long REINITIALIZE_RETRY_SECONDS = 60; // API URLs - public static final String API_VERSION = "1.0"; + public static final String API_VERSION = "1.1"; public static final String WEBSOCKET_API_URL_EVENTS = "wss://api.services-smarthome.de/API/" + API_VERSION + "/events?token={token}"; @@ -69,6 +59,7 @@ public class InnogyBindingConstants { public static final String PROPERTY_ID = "id"; public static final String PROPERTY_VERSION = "Version"; public static final String PROPERTY_LOCATION = "Location"; + public static final String PROPERTY_GEOLOCATION = "Geo Location"; public static final String PROPERTY_SOFTWARE_VERSION = "Software version"; public static final String PROPERTY_IP_ADDRESS = "IP address"; public static final String PROPERTY_REGISTRATION_TIME = "Registration Time"; @@ -76,11 +67,24 @@ public class InnogyBindingConstants { public static final String PROPERTY_TIME_OF_DISCOVERY = "Time of discovery"; public static final String PROPERTY_BATTERY_POWERED = "Battery powered"; public static final String PROPERTY_DEVICE_TYPE = "Device Type"; + public static final String PROPERTY_CONFIGURATION_STATE = "Configuration state"; + public static final String PROPERTY_SHC_TYPE = "Controller Type"; + public static final String PROPERTY_TIME_ZONE = "Time Zone"; + public static final String PROPERTY_CURRENT_UTC_OFFSET = "Current UTC offset (minutes)"; + public static final String PROPERTY_PROTOCOL_ID = "Protocol ID"; + public static final String PROPERTY_BACKEND_CONNECTION_MONITORED = "Backend connection monitored"; + public static final String PROPERTY_RFCOM_FAILURE_NOTIFICATION = "RFComm failure notification"; + public static final String PROPERTY_DISPLAY_CURRENT_TEMPERATURE = "Display current temperature"; + public static final String PROPERTY_UNDERLYING_DEVICE_IDS = "Underlying device IDs (thermostats)"; + public static final String PROPERTY_METER_ID = "Meter ID"; + public static final String PROPERTY_METER_FIRMWARE_VERSION = "Meter firmware version"; // List of main device types public static final String DEVICE_SHC = "SHC"; // smarthome controller - the bridge + public static final String DEVICE_SHCA = "SHCA"; // smarthome controller version 2 public static final String DEVICE_PSS = "PSS"; // pluggable smart switch public static final String DEVICE_PSSO = "PSSO"; // pluggable smart switch outdoor + public static final String DEVICE_BT_PSS = "BT-PSS"; // Bluetooth pluggable smart switch public static final String DEVICE_VARIABLE_ACTUATOR = "VariableActuator"; public static final String DEVICE_RST = "RST"; // radiator mounted smart thermostat public static final String DEVICE_RST2 = "RST2"; // radiator mounted smart thermostat (newer version) @@ -102,18 +106,18 @@ public class InnogyBindingConstants { public static final String DEVICE_SMART_METER = "SmartMeter"; public static final String DEVICE_TWO_WAY_METER = "TwoWayMeter"; - public static final Set<String> SUPPORTED_DEVICES = Collections - .unmodifiableSet(Stream - .of(DEVICE_SHC, DEVICE_PSS, DEVICE_PSSO, DEVICE_VARIABLE_ACTUATOR, DEVICE_RST, DEVICE_RST2, - DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2, DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO, - DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2, DEVICE_ISR2, DEVICE_PSD, - DEVICE_ANALOG_METER, DEVICE_GENERATION_METER, DEVICE_SMART_METER, DEVICE_TWO_WAY_METER) - .collect(Collectors.toSet())); + public static final Set<String> SUPPORTED_DEVICES = Collections.unmodifiableSet(Stream + .of(DEVICE_SHC, DEVICE_SHCA, DEVICE_PSS, DEVICE_PSSO, DEVICE_BT_PSS, DEVICE_VARIABLE_ACTUATOR, DEVICE_RST, + DEVICE_RST2, DEVICE_WRT, DEVICE_WDS, DEVICE_ISS2, DEVICE_WSD, DEVICE_WSD2, DEVICE_WMD, DEVICE_WMDO, + DEVICE_WSC2, DEVICE_BRC8, DEVICE_ISC2, DEVICE_ISD2, DEVICE_ISR2, DEVICE_PSD, DEVICE_ANALOG_METER, + DEVICE_GENERATION_METER, DEVICE_SMART_METER, DEVICE_TWO_WAY_METER) + .collect(Collectors.toSet())); // List of all Thing Type UIDs public static final ThingTypeUID THING_TYPE_BRIDGE = new ThingTypeUID(BINDING_ID, "bridge"); public static final ThingTypeUID THING_TYPE_PSS = new ThingTypeUID(BINDING_ID, DEVICE_PSS); public static final ThingTypeUID THING_TYPE_PSSO = new ThingTypeUID(BINDING_ID, DEVICE_PSSO); + public static final ThingTypeUID THING_TYPE_BT_PSS = new ThingTypeUID(BINDING_ID, DEVICE_BT_PSS); public static final ThingTypeUID THING_TYPE_VARIABLE_ACTUATOR = new ThingTypeUID(BINDING_ID, DEVICE_VARIABLE_ACTUATOR); public static final ThingTypeUID THING_TYPE_RST = new ThingTypeUID(BINDING_ID, DEVICE_RST); @@ -137,14 +141,12 @@ public class InnogyBindingConstants { public static final ThingTypeUID THING_TYPE_SMART_METER = new ThingTypeUID(BINDING_ID, DEVICE_SMART_METER); public static final ThingTypeUID THING_TYPE_TWO_WAY_METER = new ThingTypeUID(BINDING_ID, DEVICE_TWO_WAY_METER); - public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Collections - .unmodifiableSet(Stream - .of(THING_TYPE_PSS, THING_TYPE_PSSO, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST, THING_TYPE_RST2, - THING_TYPE_WRT, THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2, - THING_TYPE_WMD, THING_TYPE_WMDO, THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2, - THING_TYPE_ISD2, THING_TYPE_ISR2, THING_TYPE_PSD, THING_TYPE_ANALOG_METER, - THING_TYPE_GENERATION_METER, THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER) - .collect(Collectors.toSet())); + public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES = Collections.unmodifiableSet( + Stream.of(THING_TYPE_PSS, THING_TYPE_PSSO, THING_TYPE_BT_PSS, THING_TYPE_VARIABLE_ACTUATOR, THING_TYPE_RST, + THING_TYPE_RST2, THING_TYPE_WRT, THING_TYPE_WDS, THING_TYPE_ISS2, THING_TYPE_WSD, THING_TYPE_WSD2, + THING_TYPE_WMD, THING_TYPE_WMDO, THING_TYPE_WSC2, THING_TYPE_BRC8, THING_TYPE_ISC2, THING_TYPE_ISD2, + THING_TYPE_ISR2, THING_TYPE_PSD, THING_TYPE_ANALOG_METER, THING_TYPE_GENERATION_METER, + THING_TYPE_SMART_METER, THING_TYPE_TWO_WAY_METER).collect(Collectors.toSet())); // List of all Channel ids public static final String CHANNEL_SWITCH = "switch"; @@ -160,22 +162,8 @@ public class InnogyBindingConstants { public static final String CHANNEL_FROST_WARNING = "frost_warning"; public static final String CHANNEL_MOLD_WARNING = "mold_warning"; public static final String CHANNEL_WINDOW_REDUCTION_ACTIVE = "window_reduction_active"; - public static final String CHANNEL_BUTTON1 = "button1"; - public static final String CHANNEL_BUTTON2 = "button2"; - public static final String CHANNEL_BUTTON3 = "button3"; - public static final String CHANNEL_BUTTON4 = "button4"; - public static final String CHANNEL_BUTTON5 = "button5"; - public static final String CHANNEL_BUTTON6 = "button6"; - public static final String CHANNEL_BUTTON7 = "button7"; - public static final String CHANNEL_BUTTON8 = "button8"; - public static final String CHANNEL_BUTTON1_COUNT = "button1_count"; - public static final String CHANNEL_BUTTON2_COUNT = "button2_count"; - public static final String CHANNEL_BUTTON3_COUNT = "button3_count"; - public static final String CHANNEL_BUTTON4_COUNT = "button4_count"; - public static final String CHANNEL_BUTTON5_COUNT = "button5_count"; - public static final String CHANNEL_BUTTON6_COUNT = "button6_count"; - public static final String CHANNEL_BUTTON7_COUNT = "button7_count"; - public static final String CHANNEL_BUTTON8_COUNT = "button8_count"; + public static final String CHANNEL_BUTTON = "button"; + public static final String CHANNEL_BUTTON_COUNT = "button%d_count"; public static final String CHANNEL_DIMMER = "dimmer"; public static final String CHANNEL_ROLLERSHUTTER = "rollershutter"; public static final String CHANNEL_BATTERY_LOW = "battery_low"; @@ -202,5 +190,7 @@ public class InnogyBindingConstants { public static final String CHANNEL_ENERGY_FEED_DAY_EURO = "energy_feed_day_euro"; public static final String CHANNEL_ENERGY_FEED_DAY_KWH = "energy_feed_day_kwh"; public static final String CHANNEL_POWER_WATT = "power_watt"; - + public static final String CHANNEL_CPU = "cpu"; + public static final String CHANNEL_DISK = "disk"; + public static final String CHANNEL_MEMORY = "memory"; } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyHandlerFactory.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyHandlerFactory.java index 4a57a73950e34..778c300b4a066 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyHandlerFactory.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,27 +12,26 @@ */ package org.openhab.binding.innogysmarthome.internal; -import java.util.Collections; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthFactory; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; -import org.openhab.binding.innogysmarthome.internal.discovery.InnogyDeviceDiscoveryService; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; import org.openhab.binding.innogysmarthome.internal.handler.InnogyBridgeHandler; import org.openhab.binding.innogysmarthome.internal.handler.InnogyDeviceHandler; -import org.osgi.framework.ServiceRegistration; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,16 +40,27 @@ * handlers. * * @author Oliver Kuhl - Initial contribution + * @author Hilbrand Bouwkamp - Refactored to use openHAB http and oauth2 libraries */ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.innogysmarthome") +@NonNullByDefault public class InnogyHandlerFactory extends BaseThingHandlerFactory implements ThingHandlerFactory { - private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections - .unmodifiableSet(Stream.concat(InnogyBridgeHandler.SUPPORTED_THING_TYPES.stream(), - InnogyDeviceHandler.SUPPORTED_THING_TYPES.stream()).collect(Collectors.toSet())); + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream + .concat(InnogyBridgeHandler.SUPPORTED_THING_TYPES.stream(), + InnogyDeviceHandler.SUPPORTED_THING_TYPES.stream()) + .collect(Collectors.toSet()); private final Logger logger = LoggerFactory.getLogger(InnogyHandlerFactory.class); - private final Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + + private final OAuthFactory oAuthFactory; + private final HttpClient httpClient; + + @Activate + public InnogyHandlerFactory(@Reference OAuthFactory oAuthFactory, @Reference HttpClientFactory httpClientFactory) { + this.oAuthFactory = oAuthFactory; + httpClient = httpClientFactory.getCommonHttpClient(); + } @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { @@ -58,44 +68,14 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { } @Override - protected ThingHandler createHandler(Thing thing) { + protected @Nullable ThingHandler createHandler(Thing thing) { if (InnogyBridgeHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) { - InnogyBridgeHandler handler = new InnogyBridgeHandler((Bridge) thing); - registerDeviceDiscoveryService(handler); - return handler; + return new InnogyBridgeHandler((Bridge) thing, oAuthFactory, httpClient); } else if (InnogyDeviceHandler.SUPPORTED_THING_TYPES.contains(thing.getThingTypeUID())) { - InnogyDeviceHandler handler = new InnogyDeviceHandler(thing); - return handler; + return new InnogyDeviceHandler(thing); } else { logger.debug("Unsupported thing {}.", thing.getThingTypeUID()); return null; } } - - /** - * Registers the device discovery service. - * - * @param bridgeHandler - */ - private synchronized void registerDeviceDiscoveryService(InnogyBridgeHandler bridgeHandler) { - InnogyDeviceDiscoveryService discoveryService = new InnogyDeviceDiscoveryService(bridgeHandler); - this.discoveryServiceRegs.put(bridgeHandler.getThing().getUID(), - bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<>())); - } - - @Override - protected synchronized void removeHandler(ThingHandler thingHandler) { - if (thingHandler instanceof InnogyBridgeHandler) { - ServiceRegistration<?> serviceReg = this.discoveryServiceRegs.remove(thingHandler.getThing().getUID()); - if (serviceReg != null) { - // remove discovery service, if bridge handler is removed - InnogyDeviceDiscoveryService service = (InnogyDeviceDiscoveryService) bundleContext - .getService(serviceReg.getReference()); - serviceReg.unregister(); - if (service != null) { - service.deactivate(); - } - } - } - } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyWebSocket.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyWebSocket.java index 0709af7c3822c..09a87134adb43 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyWebSocket.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/InnogyWebSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,9 +13,9 @@ package org.openhab.binding.innogysmarthome.internal; import java.net.URI; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.StatusCode; @@ -26,6 +26,7 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket; import org.eclipse.jetty.websocket.client.WebSocketClient; import org.openhab.binding.innogysmarthome.internal.handler.InnogyBridgeHandler; +import org.openhab.binding.innogysmarthome.internal.listener.EventListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,17 +36,19 @@ * * @author Oliver Kuhl - Initial contribution */ +@NonNullByDefault @WebSocket public class InnogyWebSocket { - private Logger logger = LoggerFactory.getLogger(InnogyWebSocket.class); - private final CountDownLatch closeLatch; - private Session session; - private org.openhab.binding.innogysmarthome.internal.listener.EventListener eventListener; - private WebSocketClient client; + private final Logger logger = LoggerFactory.getLogger(InnogyWebSocket.class); + private final EventListener eventListener; private final URI webSocketURI; private final int maxIdleTimeout; + private @Nullable Session session; + private @Nullable WebSocketClient client; + private boolean closing; + /** * Constructs the {@link InnogyWebSocket}. * @@ -53,9 +56,8 @@ public class InnogyWebSocket { * @param webSocketURI the {@link URI} of the websocket endpoint * @param maxIdleTimeout */ - public InnogyWebSocket(InnogyBridgeHandler bridgeHandler, URI webSocketURI, int maxIdleTimeout) { - this.eventListener = bridgeHandler; - this.closeLatch = new CountDownLatch(1); + public InnogyWebSocket(EventListener eventListener, URI webSocketURI, int maxIdleTimeout) { + this.eventListener = eventListener; this.webSocketURI = webSocketURI; this.maxIdleTimeout = maxIdleTimeout; } @@ -66,8 +68,7 @@ public InnogyWebSocket(InnogyBridgeHandler bridgeHandler, URI webSocketURI, int * @throws Exception */ public synchronized void start() throws Exception { - SslContextFactory sslContextFactory = new SslContextFactory(); - // sslContextFactory.setTrustAll(true); // The magic + final SslContextFactory sslContextFactory = new SslContextFactory(); if (client == null || client.isStopped()) { client = new WebSocketClient(sslContextFactory); @@ -87,6 +88,7 @@ public synchronized void start() throws Exception { * Stops the {@link InnogyWebSocket}. */ public synchronized void stop() { + this.closing = true; if (isRunning()) { logger.debug("Closing session..."); session.close(); @@ -108,13 +110,13 @@ public synchronized boolean isRunning() { @OnWebSocketConnect public void onConnect(Session session) { + this.closing = false; logger.info("Connected to innogy Webservice."); logger.trace("innogy Websocket session: {}", session); } @OnWebSocketClose public void onClose(int statusCode, String reason) { - this.closeLatch.countDown(); if (statusCode == StatusCode.NORMAL) { logger.info("Connection to innogy Webservice was closed normally."); } else { @@ -124,27 +126,19 @@ public void onClose(int statusCode, String reason) { } } - /** - * Await the closing of the websocket. - * - * @param duration - * @param unit - * @return - * @throws InterruptedException - */ - public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedException { - logger.debug("innogy WebSocket awaitClose() - {}{}", duration, unit); - return this.closeLatch.await(duration, unit); - } - @OnWebSocketError public void onError(Throwable cause) { - logger.error("innogy WebSocket onError() - {}", cause.getMessage()); + logger.debug("innogy WebSocket onError() - {}", cause.getMessage()); + eventListener.onError(cause); } @OnWebSocketMessage public void onMessage(String msg) { logger.debug("innogy WebSocket onMessage() - {}", msg); - eventListener.onEvent(msg); + if (closing) { + logger.debug("innogy WebSocket onMessage() - ignored, WebSocket is closing..."); + } else { + eventListener.onEvent(msg); + } } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Constants.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Constants.java index 335e0319378a9..4e3b82b184b2c 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Constants.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Constants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,7 +26,7 @@ * */ @NonNullByDefault -public class Constants { +public final class Constants { // devices public static final Set<String> BATTERY_POWERED_DEVICES = Collections.unmodifiableSet( @@ -34,13 +34,13 @@ public class Constants { // API URLs public static final String API_HOST = "api.services-smarthome.de"; - public static final String API_VERSION = "1.0"; + public static final String API_VERSION = "1.1"; public static final String API_URL_BASE = "https://" + API_HOST + "/API/" + API_VERSION; public static final String API_URL_TOKEN = "https://" + API_HOST + "/AUTH/token"; public static final String API_URL_CHECK_CONNECTION = API_URL_BASE + "/desc/device/SHC.RWE/1.0/event/StateChanged"; public static final String API_URL_INITIALIZE = API_URL_BASE + "/initialize"; - public static final String API_URL_UNINITIALIZE = API_URL_BASE + "/uninitialize"; + public static final String API_URL_STATUS = API_URL_BASE + "/status"; public static final String API_URL_DEVICE = API_URL_BASE + "/device"; public static final String API_URL_DEVICE_ID = API_URL_DEVICE + "/{id}"; @@ -60,4 +60,8 @@ public class Constants { // others public static final String FORMAT_DATETIME = "dd.MM.yyyy HH:mm:ss"; + + private Constants() { + // Constants class + } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyClient.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyClient.java index e30ce2b7afca3..feb50b8e9cddd 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyClient.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,31 +15,47 @@ import static org.openhab.binding.innogysmarthome.internal.client.Constants.*; import java.io.IOException; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; - -import org.apache.commons.io.IOUtils; -import org.openhab.binding.innogysmarthome.internal.client.entity.Location; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; -import org.openhab.binding.innogysmarthome.internal.client.entity.Property; -import org.openhab.binding.innogysmarthome.internal.client.entity.SHCInfo; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.client.util.StringContentProvider; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.smarthome.core.auth.client.oauth2.AccessTokenResponse; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthClientService; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthException; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthResponseException; +import org.openhab.binding.innogysmarthome.internal.client.entity.StatusResponse; import org.openhab.binding.innogysmarthome.internal.client.entity.action.Action; -import org.openhab.binding.innogysmarthome.internal.client.entity.action.SetStateAction; +import org.openhab.binding.innogysmarthome.internal.client.entity.action.StateActionSetter; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; +import org.openhab.binding.innogysmarthome.internal.client.entity.capability.CapabilityState; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.DeviceState; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.Gateway; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.State; import org.openhab.binding.innogysmarthome.internal.client.entity.error.ErrorResponse; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.CapabilityLink; import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; -import org.openhab.binding.innogysmarthome.internal.client.entity.state.CapabilityState; -import org.openhab.binding.innogysmarthome.internal.client.entity.state.DeviceState; +import org.openhab.binding.innogysmarthome.internal.client.entity.location.Location; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; import org.openhab.binding.innogysmarthome.internal.client.exception.ApiException; -import org.openhab.binding.innogysmarthome.internal.client.exception.ConfigurationException; +import org.openhab.binding.innogysmarthome.internal.client.exception.AuthenticationException; import org.openhab.binding.innogysmarthome.internal.client.exception.ControllerOfflineException; import org.openhab.binding.innogysmarthome.internal.client.exception.InvalidActionTriggeredException; -import org.openhab.binding.innogysmarthome.internal.client.exception.InvalidAuthCodeException; import org.openhab.binding.innogysmarthome.internal.client.exception.RemoteAccessNotAllowedException; import org.openhab.binding.innogysmarthome.internal.client.exception.ServiceUnavailableException; import org.openhab.binding.innogysmarthome.internal.client.exception.SessionExistsException; @@ -47,27 +63,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.api.client.auth.oauth2.AuthorizationCodeTokenRequest; -import com.google.api.client.auth.oauth2.BearerToken; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.auth.oauth2.Credential.Builder; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.RefreshTokenRequest; -import com.google.api.client.auth.oauth2.TokenResponse; -import com.google.api.client.auth.oauth2.TokenResponseException; -import com.google.api.client.http.BasicAuthentication; -import com.google.api.client.http.GenericUrl; -import com.google.api.client.http.HttpHeaders; -import com.google.api.client.http.HttpRequest; -import com.google.api.client.http.HttpRequestFactory; -import com.google.api.client.http.HttpResponse; -import com.google.api.client.http.HttpStatusCodes; -import com.google.api.client.http.HttpTransport; -import com.google.api.client.http.javanet.NetHttpTransport; -import com.google.api.client.http.json.JsonHttpContent; -import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.JsonObjectParser; -import com.google.api.client.json.gson.GsonFactory; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; @@ -76,288 +71,172 @@ * The main client that handles the communication with the innogy SmartHome API service. * * @author Oliver Kuhl - Initial contribution + * @author Hilbrand Bouwkamp - Refactored to use openHAB http and oauth2 libraries * */ +@NonNullByDefault public class InnogyClient { + private static final String BEARER = "Bearer "; + private static final String CONTENT_TYPE = "application/json"; + private static final int HTTP_CLIENT_TIMEOUT_SECONDS = 10; + private final Logger logger = LoggerFactory.getLogger(InnogyClient.class); - private InnogyConfig config; /** * date format as used in json in API. Example: 2016-07-11T10:55:52.3863424Z */ private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; + private final Gson gson = new GsonBuilder().setDateFormat(DATE_FORMAT).create(); + private final OAuthClientService oAuthService; + private final HttpClient httpClient; + private @Nullable Gateway bridgeDetails; + private String configVersion = ""; - private HttpTransport httpTransport; - private JsonFactory jsonFactory; - private Builder credentialBuilder; - private HttpRequestFactory requestFactory; - private Device bridgeDetails; - private long currentConfigurationVersion; - private CredentialRefreshListener credentialRefreshListener; - private long apiCallCounter = 0; - - public InnogyClient(InnogyConfig config) { - this.config = config; + public InnogyClient(final OAuthClientService oAuthService, final HttpClient httpClient) { + this.oAuthService = oAuthService; + this.httpClient = httpClient; } /** * @return the bridgeInfo */ - public Device getBridgeDetails() { + public @Nullable Gateway getBridgeDetails() { return bridgeDetails; } /** - * Initializes the client and connects to the innogy SmartHome service via Client API. Based on the provided - * {@Link Configuration} while constructing {@Link InnogyClient}, the given oauth2 access and refresh tokens are - * used or - if not yet available - new tokens are fetched from the service using the provided auth code. - * - * Throws {@link ApiException}s or {@link IOException}s as described in {@link #getOAuth2Tokens()} and - * {@link #initializeSession()}. - * - * @throws IOException - * @throws ApiException - * @throws ConfigurationException - */ - public void initialize() throws IOException, ApiException, ConfigurationException { - initializeHttpClient(); - - if (!config.checkClientData()) { - throw new ConfigurationException("Invalid configuration: clientId and clientSecret must not be empty!"); - } - - if (!config.checkRefreshToken()) { - // tokens missing, so try to get them via oauth2 from innogy backend - getOAuth2Tokens(); - } - if (!config.checkAccessToken()) { - getAccessToken(); - } - - initializeSession(); - } - - /** - * Initializes the HTTP client - */ - private void initializeHttpClient() { - httpTransport = new NetHttpTransport(); - jsonFactory = new GsonFactory(); - - if (credentialRefreshListener == null) { - credentialRefreshListener = new InnogyCredentialRefreshListener(config); - } - - // prepare credentials & transport for oauth2 access - credentialBuilder = new Credential.Builder(BearerToken.authorizationHeaderAccessMethod()) - .setTransport(httpTransport).setJsonFactory(jsonFactory).addRefreshListener(credentialRefreshListener) - .setTokenServerUrl(new GenericUrl(API_URL_TOKEN)) - .setClientAuthentication(new BasicAuthentication(config.getClientId(), config.getClientSecret())); - Credential credential = new Credential(credentialBuilder) { - @Override - public void initialize(HttpRequest request) { - request.setInterceptor(this); - request.setUnsuccessfulResponseHandler(this); - request.setThrowExceptionOnExecuteError(false); - request.setParser(new JsonObjectParser(jsonFactory)); // TODO: maybe better remove this one and use GSON - // manually - setAccessToken(config.getAccessToken()); - setRefreshToken(config.getRefreshToken()); - } - }; - - requestFactory = httpTransport.createRequestFactory(credential); - } - - /** - * Logs into the innogy SmartHome service and initializes the session. + * Gets the status * * As the API returns the details of the SmartHome controller (SHC), the data is saved in {@link #bridgeDetails} and - * the {@link #currentConfigurationVersion} is set. + * the {@link #configVersion} is set. * * @throws SessionExistsException thrown, if a session already exists * @throws IOException * @throws ApiException */ - private void initializeSession() throws IOException, ApiException { - logger.debug("Initializing innogy SmartHome Session..."); - HttpResponse response = executeGet(API_URL_INITIALIZE); - - handleResponseErrors(response); + public void refreshStatus() throws IOException, ApiException, AuthenticationException { + logger.debug("Get innogy SmartHome status..."); + final StatusResponse status = executeGet(API_URL_STATUS, StatusResponse.class); - SHCInfo info = response.parseAs(SHCInfo.class); - bridgeDetails = info.deviceList.get(0); - currentConfigurationVersion = info.currentConfigurationVersion; + bridgeDetails = status.gateway; + configVersion = bridgeDetails.getConfigVersion(); - logger.debug("innogy SmartHome Session initialized. Configuration version is {}", - info.currentConfigurationVersion); + logger.debug("innogy SmartHome Status loaded. Configuration version is {}.", configVersion); } /** - * Uninitializes the session. - * - * @throws IOException - * @throws ApiException - */ - public void uninitializeSession() throws IOException, ApiException { - logger.debug("Uninitializing innogy SmartHome Session..."); - bridgeDetails = null; - - HttpResponse response = executeGet(API_URL_UNINITIALIZE); - - try { - handleResponseErrors(response); - } catch (SessionNotFoundException e) { - // Session not found - ignoring - } - } - - /** - * Fetches the oauth2 tokens from innogy SmartHome service and saves them in the {@Link Configuration}. The needed - * authcode must be set in the {@Link Configuration}. - * - * Throws an {@link RemoteAccessNotAllowedException}, if the authcode is missing. - * Throws an {@link ApiException} on an unexpected error with the API. - * Throws an {@link IOException} on any I/O error. + * Executes a HTTP GET request with default headers and returns data as object of type T. * + * @param url + * @param clazz type of data to return + * @return * @throws IOException + * @throws AuthenticationException * @throws ApiException - * @throws ConfigurationException thrown if the authcode is not set in the {@link InnogyConfig} */ - private void getOAuth2Tokens() throws IOException, ApiException, ConfigurationException { - if (!config.checkAuthCode()) { - throw new ConfigurationException("Invalid configuration: authcode must not be empty!"); - } - - try { - logger.debug("Trying to get access and refresh tokens"); - TokenResponse response = new AuthorizationCodeTokenRequest(httpTransport, jsonFactory, - new GenericUrl(API_URL_TOKEN), config.getAuthCode()).setRedirectUri(config.getRedirectUrl()) - .setClientAuthentication( - new BasicAuthentication(config.getClientId(), config.getClientSecret())) - .execute(); - logger.debug("Saving access and refresh tokens."); - logger.trace("Access token: {}", response.getAccessToken()); - logger.trace("Refresh token: {}", response.getRefreshToken()); - config.setAccessToken(response.getAccessToken()); - config.setRefreshToken(response.getRefreshToken()); - } catch (TokenResponseException e) { - throw new InvalidAuthCodeException("Error fetching access token: " + e.getDetails()); - } + private <T> T executeGet(final String url, final Class<T> clazz) + throws IOException, AuthenticationException, ApiException { + final ContentResponse response = request(httpClient.newRequest(url).method(HttpMethod.GET)); + return gson.fromJson(response.getContentAsString(), clazz); } /** - * Fetches the access token from innogy SmartHome service and saves it in the {@Link Configuration}. The needed - * refreshToken must be set in the {@Link Configuration}. - * - * Throws an {@link RemoteAccessNotAllowedException}, if the authcode is missing. - * Throws an {@link ApiException} on an unexpected error with the API. - * Throws an {@link IOException} on any I/O error. + * Executes a HTTP GET request with default headers and returns data as List of type T. * + * @param url + * @param clazz array type of data to return as list * @throws IOException + * @throws AuthenticationException * @throws ApiException - * @throws ConfigurationException thrown if the refreshToken is not set in the {@link InnogyConfig} */ - private void getAccessToken() throws IOException, ConfigurationException { - if (!config.checkRefreshToken()) { - throw new ConfigurationException("Invalid configuration: refreshToken must not be empty!"); - } - - logger.debug("Trying to get access token"); - TokenResponse response = new RefreshTokenRequest(httpTransport, jsonFactory, new GenericUrl(API_URL_TOKEN), - config.getRefreshToken()) - .setClientAuthentication( - new BasicAuthentication(config.getClientId(), config.getClientSecret())) - .execute(); - logger.debug("Saving access token."); - config.setAccessToken(response.getAccessToken()); + private <T> List<T> executeGetList(final String url, final Class<T[]> clazz) + throws IOException, AuthenticationException, ApiException { + return Arrays.asList(executeGet(url, clazz)); } /** - * Executes a HTTP GET request with default headers. + * Executes a HTTP POST request with the given {@link Action} as content. * * @param url + * @param action * @return * @throws IOException + * @throws AuthenticationException + * @throws ApiException */ - private HttpResponse executeGet(String url) throws IOException { - apiCallCounter++; - return requestFactory.buildGetRequest(new GenericUrl(url)).execute(); - } + private ContentResponse executePost(final String url, final Action action) + throws IOException, AuthenticationException, ApiException { + final String json = gson.toJson(action); + logger.debug("Action {} JSON: {}", action.getType(), json); - /** - * Executes a HTTP GET request with custom headers. - * - * @param url - * @param headers - * @return - * @throws IOException - */ - private HttpResponse executeGet(String url, HttpHeaders headers) throws IOException { - apiCallCounter++; - return requestFactory.buildGetRequest(new GenericUrl(url)).setHeaders(headers).execute(); + return request(httpClient.newRequest(url).method(HttpMethod.POST) + .content(new StringContentProvider(json), CONTENT_TYPE).accept(CONTENT_TYPE)); } - /** - * Executes a HTTP POST request with the given {@link Action} as content. - * - * @param url - * @param action - * @return - * @throws IOException - */ - private HttpResponse executePost(String url, Action action) throws IOException { - apiCallCounter++; - return executePost(url, new JsonHttpContent(jsonFactory, action)); + private ContentResponse request(final Request request) throws IOException, AuthenticationException, ApiException { + final ContentResponse response; + try { + final AccessTokenResponse accessTokenResponse = getAccessTokenResponse(); + + response = request.header(HttpHeader.ACCEPT, CONTENT_TYPE) + .header(HttpHeader.AUTHORIZATION, BEARER + accessTokenResponse.getAccessToken()) + .timeout(HTTP_CLIENT_TIMEOUT_SECONDS, TimeUnit.SECONDS).send(); + } catch (InterruptedException | TimeoutException | ExecutionException e) { + throw new IOException(e); + } + handleResponseErrors(response, request.getURI()); + return response; } - /** - * Executes a HTTP POST request with JSON formatted content. - * - * @param url - * @param content - * @return - * @throws IOException - */ - private HttpResponse executePost(String url, JsonHttpContent content) throws IOException { - apiCallCounter++; - return requestFactory.buildPostRequest(new GenericUrl(url), content) - .setHeaders(new HttpHeaders().setAccept("application/json")).execute(); + public AccessTokenResponse getAccessTokenResponse() throws AuthenticationException, IOException { + final AccessTokenResponse accessTokenResponse; + try { + accessTokenResponse = oAuthService.getAccessTokenResponse(); + } catch (OAuthException | OAuthResponseException e) { + throw new AuthenticationException("Error fetching access token: " + e.getMessage()); + } + if (accessTokenResponse == null || StringUtils.isBlank(accessTokenResponse.getAccessToken())) { + throw new AuthenticationException("No innogy accesstoken. Is this thing authorized?"); + } + return accessTokenResponse; } /** - * Handles errors from the {@link HttpResponse} and throws the following errors: + * Handles errors from the {@link ContentResponse} and throws the following errors: * * @param response + * @param uri uri of api call made * @throws SessionExistsException * @throws SessionNotFoundException * @throws ControllerOfflineException thrown, if the innogy SmartHome controller (SHC) is offline. * @throws IOException * @throws ApiException + * @throws AuthenticationException */ - private void handleResponseErrors(HttpResponse response) throws IOException, ApiException { + private void handleResponseErrors(final ContentResponse response, final URI uri) + throws IOException, ApiException, AuthenticationException { String content = ""; - switch (response.getStatusCode()) { - case HttpStatusCodes.STATUS_CODE_OK: - logger.debug("[{}] Statuscode is OK.", apiCallCounter); + switch (response.getStatus()) { + case HttpStatus.OK_200: + logger.debug("Statuscode is OK: [{}]", uri); return; - case HttpStatusCodes.STATUS_CODE_SERVICE_UNAVAILABLE: + case HttpStatus.SERVICE_UNAVAILABLE_503: logger.debug("innogy service is unavailabe (503)."); throw new ServiceUnavailableException("innogy service is unavailabe (503)."); default: - logger.debug("[{}] Statuscode is NOT OK: {}", apiCallCounter, response.getStatusCode()); + logger.debug("Statuscode {} is NOT OK: [{}]", response.getStatus(), uri); try { - content = IOUtils.toString(response.getContent()); + content = response.getContentAsString(); logger.trace("Response error content: {}", content); - ErrorResponse error = gson.fromJson(content, ErrorResponse.class); + final ErrorResponse error = gson.fromJson(content, ErrorResponse.class); if (error == null) { - logger.debug("Error without JSON message, code: {} / message: {}", response.getStatusCode(), - response.getStatusMessage()); - throw new ApiException("Error code: " + response.getStatusCode()); + logger.debug("Error without JSON message, code: {} / message: {}", response.getStatus(), + response.getReason()); + throw new ApiException("Error code: " + response.getStatus()); } switch (error.getCode()) { @@ -376,16 +255,15 @@ private void handleResponseErrors(HttpResponse response) throws IOException, Api throw new RemoteAccessNotAllowedException( "Remote access not allowed. Access is allowed only from the SHC device network."); case ErrorResponse.ERR_INVALID_ACTION_TRIGGERED: - logger.error("Invalid action triggered. Message: {}", error.getMessages()); + logger.debug("Invalid action triggered. Message: {}", error.getMessages()); throw new InvalidActionTriggeredException(error.getDescription()); default: logger.debug("Unknown error: {}", error.toString()); throw new ApiException("Unknown error: " + error.toString()); } - } catch (JsonSyntaxException e) { + } catch (final JsonSyntaxException e) { throw new ApiException("Invalid JSON syntax in error response: " + content); } - } } @@ -397,15 +275,9 @@ private void handleResponseErrors(HttpResponse response) throws IOException, Api * @throws IOException * @throws ApiException */ - public void setSwitchActuatorState(String capabilityId, boolean state) throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_SWITCHACTUATOR, state); - - String json = gson.toJson(action); - logger.debug("Action toggle JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setSwitchActuatorState(final String capabilityId, final boolean state) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, new StateActionSetter(capabilityId, Capability.TYPE_SWITCHACTUATOR, state)); } /** @@ -416,15 +288,9 @@ public void setSwitchActuatorState(String capabilityId, boolean state) throws IO * @throws IOException * @throws ApiException */ - public void setDimmerActuatorState(String capabilityId, int dimLevel) throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_DIMMERACTUATOR, dimLevel); - - String json = gson.toJson(action); - logger.debug("Action dimm JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setDimmerActuatorState(final String capabilityId, final int dimLevel) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, new StateActionSetter(capabilityId, Capability.TYPE_DIMMERACTUATOR, dimLevel)); } /** @@ -435,16 +301,10 @@ public void setDimmerActuatorState(String capabilityId, int dimLevel) throws IOE * @throws IOException * @throws ApiException */ - public void setRollerShutterActuatorState(String capabilityId, int rollerShutterLevel) - throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_ROLLERSHUTTERACTUATOR, rollerShutterLevel); - - String json = gson.toJson(action); - logger.debug("Action rollershutter JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setRollerShutterActuatorState(final String capabilityId, final int rollerShutterLevel) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, + new StateActionSetter(capabilityId, Capability.TYPE_ROLLERSHUTTERACTUATOR, rollerShutterLevel)); } /** @@ -455,15 +315,9 @@ public void setRollerShutterActuatorState(String capabilityId, int rollerShutter * @throws IOException * @throws ApiException */ - public void setVariableActuatorState(String capabilityId, boolean state) throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_VARIABLEACTUATOR, state); - - String json = gson.toJson(action); - logger.debug("Action toggle JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setVariableActuatorState(final String capabilityId, final boolean state) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, new StateActionSetter(capabilityId, Capability.TYPE_VARIABLEACTUATOR, state)); } /** @@ -474,16 +328,10 @@ public void setVariableActuatorState(String capabilityId, boolean state) throws * @throws IOException * @throws ApiException */ - public void setPointTemperatureState(String capabilityId, double pointTemperature) - throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_THERMOSTATACTUATOR, pointTemperature); - - String json = gson.toJson(action); - logger.debug("Action toggle JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setPointTemperatureState(final String capabilityId, final double pointTemperature) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, + new StateActionSetter(capabilityId, Capability.TYPE_THERMOSTATACTUATOR, pointTemperature)); } /** @@ -494,16 +342,12 @@ public void setPointTemperatureState(String capabilityId, double pointTemperatur * @throws IOException * @throws ApiException */ - public void setOperationMode(String capabilityId, boolean autoMode) throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_THERMOSTATACTUATOR, - autoMode ? "Auto" : "Manu"); - - String json = gson.toJson(action); - logger.debug("Action toggle JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); + public void setOperationMode(final String capabilityId, final boolean autoMode) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, + new StateActionSetter(capabilityId, Capability.TYPE_THERMOSTATACTUATOR, + autoMode ? CapabilityState.STATE_VALUE_OPERATION_MODE_AUTO + : CapabilityState.STATE_VALUE_OPERATION_MODE_MANUAL)); } /** @@ -514,35 +358,9 @@ public void setOperationMode(String capabilityId, boolean autoMode) throws IOExc * @throws IOException * @throws ApiException */ - public void setAlarmActuatorState(String capabilityId, boolean alarmState) throws IOException, ApiException { - Action action = new SetStateAction(capabilityId, Capability.TYPE_ALARMACTUATOR, alarmState); - - String json = gson.toJson(action); - logger.debug("Action toggle JSON: {}", json); - - HttpResponse response = executePost(API_URL_ACTION, action); - - handleResponseErrors(response); - } - - /** - * Disposes the client including disconnecting a maybe remaining session. - */ - public void dispose() { - try { - uninitializeSession(); - if (httpTransport != null) { - httpTransport.shutdown(); - httpTransport = null; - } - jsonFactory = null; - requestFactory = null; - credentialBuilder = null; - } catch (IOException | ApiException e) { - logger.debug("Error disposing resources: {}", e.getMessage()); - logger.trace("Trace:", e); - } - + public void setAlarmActuatorState(final String capabilityId, final boolean alarmState) + throws IOException, ApiException, AuthenticationException { + executePost(API_URL_ACTION, new StateActionSetter(capabilityId, Capability.TYPE_ALARMACTUATOR, alarmState)); } /** @@ -552,14 +370,9 @@ public void dispose() { * @throws IOException * @throws ApiException */ - public List<Device> getDevices() throws IOException, ApiException { + public List<Device> getDevices() throws IOException, ApiException, AuthenticationException { logger.debug("Loading innogy devices..."); - HttpResponse response = executeGet(API_URL_DEVICE); - - handleResponseErrors(response); - - Device[] deviceList = response.parseAs(Device[].class); - return Arrays.asList(deviceList); + return executeGetList(API_URL_DEVICE, Device[].class); } /** @@ -570,13 +383,9 @@ public List<Device> getDevices() throws IOException, ApiException { * @throws IOException * @throws ApiException */ - public Device getDeviceById(String deviceId) throws IOException, ApiException { + public Device getDeviceById(final String deviceId) throws IOException, ApiException, AuthenticationException { logger.debug("Loading device with id {}...", deviceId); - HttpResponse response = executeGet(API_URL_DEVICE_ID.replace("{id}", deviceId)); - - handleResponseErrors(response); - - return response.parseAs(Device.class); + return executeGet(API_URL_DEVICE_ID.replace("{id}", deviceId), Device.class); } /** @@ -587,41 +396,41 @@ public Device getDeviceById(String deviceId) throws IOException, ApiException { * @throws IOException * @throws ApiException */ - public List<Device> getFullDevices() throws IOException, ApiException { + public List<Device> getFullDevices() throws IOException, ApiException, AuthenticationException { // LOCATIONS - List<Location> locationList = getLocations(); - Map<String, Location> locationMap = new HashMap<>(); - for (Location l : locationList) { + final List<Location> locationList = getLocations(); + final Map<String, Location> locationMap = new HashMap<>(); + for (final Location l : locationList) { locationMap.put(l.getId(), l); } // CAPABILITIES - List<Capability> capabilityList = getCapabilities(); - Map<String, Capability> capabilityMap = new HashMap<>(); - for (Capability c : capabilityList) { + final List<Capability> capabilityList = getCapabilities(); + final Map<String, Capability> capabilityMap = new HashMap<>(); + for (final Capability c : capabilityList) { capabilityMap.put(c.getId(), c); } // CAPABILITY STATES - List<CapabilityState> capabilityStateList = getCapabilityStates(); - Map<String, CapabilityState> capabilityStateMap = new HashMap<>(); - for (CapabilityState cs : capabilityStateList) { + final List<CapabilityState> capabilityStateList = getCapabilityStates(); + final Map<String, CapabilityState> capabilityStateMap = new HashMap<>(); + for (final CapabilityState cs : capabilityStateList) { capabilityStateMap.put(cs.getId(), cs); } // DEVICE STATES - List<DeviceState> deviceStateList = getDeviceStates(); - Map<String, DeviceState> deviceStateMap = new HashMap<>(); - for (DeviceState es : deviceStateList) { + final List<DeviceState> deviceStateList = getDeviceStates(); + final Map<String, DeviceState> deviceStateMap = new HashMap<>(); + for (final DeviceState es : deviceStateList) { deviceStateMap.put(es.getId(), es); } // MESSAGES - List<Message> messageList = getMessages(); - Map<String, List<Message>> deviceMessageMap = new HashMap<>(); - for (Message m : messageList) { + final List<Message> messageList = getMessages(); + final Map<String, List<Message>> deviceMessageMap = new HashMap<>(); + for (final Message m : messageList) { if (m.getDeviceLinkList() != null && !m.getDeviceLinkList().isEmpty()) { - String deviceId = m.getDeviceLinkList().get(0).getValue().replace("/device/", ""); + final String deviceId = m.getDeviceLinkList().get(0).replace("/device/", ""); List<Message> ml; if (deviceMessageMap.containsKey(deviceId)) { ml = deviceMessageMap.get(deviceId); @@ -634,21 +443,23 @@ public List<Device> getFullDevices() throws IOException, ApiException { } // DEVICES - List<Device> deviceList = getDevices(); - for (Device d : deviceList) { + final List<Device> deviceList = getDevices(); + for (final Device d : deviceList) { if (BATTERY_POWERED_DEVICES.contains(d.getType())) { d.setIsBatteryPowered(true); } // location d.setLocation(locationMap.get(d.getLocationId())); - HashMap<String, Capability> deviceCapabilityMap = new HashMap<>(); + final HashMap<String, Capability> deviceCapabilityMap = new HashMap<>(); // capabilities and their states - for (CapabilityLink cl : d.getCapabilityLinkList()) { - Capability c = capabilityMap.get(cl.getId()); - c.setCapabilityState(capabilityStateMap.get(c.getId())); - deviceCapabilityMap.put(c.getId(), c); + for (final String cl : d.getCapabilityLinkList()) { + final Capability c = capabilityMap.get(Link.getId(cl)); + final String capabilityId = c.getId(); + final CapabilityState capabilityState = capabilityStateMap.get(capabilityId); + c.setCapabilityState(capabilityState); + deviceCapabilityMap.put(capabilityId, c); } d.setCapabilityMap(deviceCapabilityMap); @@ -658,10 +469,11 @@ public List<Device> getFullDevices() throws IOException, ApiException { // messages if (deviceMessageMap.containsKey(d.getId())) { d.setMessageList(deviceMessageMap.get(d.getId())); - for (Message m : d.getMessageList()) { + for (final Message m : d.getMessageList()) { switch (m.getType()) { case Message.TYPE_DEVICE_LOW_BATTERY: d.setLowBattery(true); + d.setLowBatteryMessageId(m.getId()); break; } } @@ -680,43 +492,44 @@ public List<Device> getFullDevices() throws IOException, ApiException { * @throws IOException * @throws ApiException */ - public Device getFullDeviceById(String deviceId) throws IOException, ApiException { + public Device getFullDeviceById(final String deviceId) throws IOException, ApiException, AuthenticationException { // LOCATIONS - List<Location> locationList = getLocations(); - Map<String, Location> locationMap = new HashMap<>(); - for (Location l : locationList) { + final List<Location> locationList = getLocations(); + final Map<String, Location> locationMap = new HashMap<>(); + for (final Location l : locationList) { locationMap.put(l.getId(), l); } // CAPABILITIES FOR DEVICE - List<Capability> capabilityList = getCapabilitiesForDevice(deviceId); - Map<String, Capability> capabilityMap = new HashMap<>(); - for (Capability c : capabilityList) { + final List<Capability> capabilityList = getCapabilitiesForDevice(deviceId); + final Map<String, Capability> capabilityMap = new HashMap<>(); + for (final Capability c : capabilityList) { capabilityMap.put(c.getId(), c); } // CAPABILITY STATES - List<CapabilityState> capabilityStateList = getCapabilityStates(); - Map<String, CapabilityState> capabilityStateMap = new HashMap<>(); - for (CapabilityState cs : capabilityStateList) { + final List<CapabilityState> capabilityStateList = getCapabilityStates(); + final Map<String, CapabilityState> capabilityStateMap = new HashMap<>(); + for (final CapabilityState cs : capabilityStateList) { capabilityStateMap.put(cs.getId(), cs); } // DEVICE STATE - List<Property> deviceStateList = getDeviceStatesByDeviceId(deviceId); - DeviceState deviceState = new DeviceState(); + final State state = getDeviceStateByDeviceId(deviceId); + final DeviceState deviceState = new DeviceState(); deviceState.setId(deviceId); - deviceState.setStateList(deviceStateList); + deviceState.setState(state); // MESSAGES - List<Message> messageList = getMessages(); + final List<Message> messageList = getMessages(); + final List<Message> ml = new ArrayList<>(); + final String deviceIdPath = "/device/" + deviceId; - List<Message> ml = new ArrayList<>(); - - for (Message m : messageList) { + for (final Message m : messageList) { + logger.trace("Message Type {} with ID {}", m.getType(), m.getId()); if (m.getDeviceLinkList() != null && !m.getDeviceLinkList().isEmpty()) { - for (Link li : m.getDeviceLinkList()) { - if (li.getValue().equals("/device/" + deviceId)) { + for (final String li : m.getDeviceLinkList()) { + if (deviceIdPath.equals(li)) { ml.add(m); } } @@ -724,7 +537,7 @@ public Device getFullDeviceById(String deviceId) throws IOException, ApiExceptio } // DEVICE - Device d = getDeviceById(deviceId); + final Device d = getDeviceById(deviceId); if (BATTERY_POWERED_DEVICES.contains(d.getType())) { d.setIsBatteryPowered(true); d.setLowBattery(false); @@ -734,10 +547,10 @@ public Device getFullDeviceById(String deviceId) throws IOException, ApiExceptio d.setLocation(locationMap.get(d.getLocationId())); // capabilities and their states - HashMap<String, Capability> deviceCapabilityMap = new HashMap<>(); - for (CapabilityLink cl : d.getCapabilityLinkList()) { + final HashMap<String, Capability> deviceCapabilityMap = new HashMap<>(); + for (final String cl : d.getCapabilityLinkList()) { - Capability c = capabilityMap.get(cl.getId()); + final Capability c = capabilityMap.get(Link.getId(cl)); c.setCapabilityState(capabilityStateMap.get(c.getId())); deviceCapabilityMap.put(c.getId(), c); @@ -748,12 +561,13 @@ public Device getFullDeviceById(String deviceId) throws IOException, ApiExceptio d.setDeviceState(deviceState); // messages - if (ml.size() > 0) { + if (!ml.isEmpty()) { d.setMessageList(ml); - for (Message m : d.getMessageList()) { + for (final Message m : d.getMessageList()) { switch (m.getType()) { case Message.TYPE_DEVICE_LOW_BATTERY: d.setLowBattery(true); + d.setLowBatteryMessageId(m.getId()); break; } } @@ -769,36 +583,23 @@ public Device getFullDeviceById(String deviceId) throws IOException, ApiExceptio * @throws IOException * @throws ApiException */ - public List<DeviceState> getDeviceStates() throws IOException, ApiException { + public List<DeviceState> getDeviceStates() throws IOException, ApiException, AuthenticationException { logger.debug("Loading device states..."); - - HttpResponse response = executeGet(API_URL_DEVICE_STATES); - - handleResponseErrors(response); - - DeviceState[] deviceStateArray = response.parseAs(DeviceState[].class); - return Arrays.asList(deviceStateArray); + return executeGetList(API_URL_DEVICE_STATES, DeviceState[].class); } /** - * Loads the device states for the given deviceId. + * Loads the device state for the given deviceId. * * @param deviceId * @return * @throws IOException * @throws ApiException */ - public List<Property> getDeviceStatesByDeviceId(String deviceId) throws IOException, ApiException { + public State getDeviceStateByDeviceId(final String deviceId) + throws IOException, ApiException, AuthenticationException { logger.debug("Loading device states for device id {}...", deviceId); - - HttpResponse response = executeGet(API_URL_DEVICE_ID_STATE.replace("{id}", deviceId)); - - handleResponseErrors(response); - - Property[] propertyArray = response.parseAs(Property[].class); - List<Property> propertyList = Arrays.asList(propertyArray); - - return propertyList; + return executeGet(API_URL_DEVICE_ID_STATE.replace("{id}", deviceId), State.class); } /** @@ -808,17 +609,9 @@ public List<Property> getDeviceStatesByDeviceId(String deviceId) throws IOExcept * @throws IOException * @throws ApiException */ - public List<Location> getLocations() throws IOException, ApiException { + public List<Location> getLocations() throws IOException, ApiException, AuthenticationException { logger.debug("Loading locations..."); - - HttpResponse response = executeGet(API_URL_LOCATION); - - handleResponseErrors(response); - - Location[] locationArray = response.parseAs(Location[].class); - List<Location> locationList = Arrays.asList(locationArray); - - return locationList; + return executeGetList(API_URL_LOCATION, Location[].class); } /** @@ -829,16 +622,10 @@ public List<Location> getLocations() throws IOException, ApiException { * @throws IOException * @throws ApiException */ - public List<Capability> getCapabilitiesForDevice(String deviceId) throws IOException, ApiException { + public List<Capability> getCapabilitiesForDevice(final String deviceId) + throws IOException, ApiException, AuthenticationException { logger.debug("Loading capabilities for device {}...", deviceId); - - HttpResponse response = executeGet(API_URL_DEVICE_CAPABILITIES.replace("{id}", deviceId)); - - handleResponseErrors(response); - - Capability[] capabilityArray = response.parseAs(Capability[].class); - List<Capability> capabilityList = Arrays.asList(capabilityArray); - return capabilityList; + return executeGetList(API_URL_DEVICE_CAPABILITIES.replace("{id}", deviceId), Capability[].class); } /** @@ -848,16 +635,9 @@ public List<Capability> getCapabilitiesForDevice(String deviceId) throws IOExcep * @throws IOException * @throws ApiException */ - public List<Capability> getCapabilities() throws IOException, ApiException { + public List<Capability> getCapabilities() throws IOException, ApiException, AuthenticationException { logger.debug("Loading capabilities..."); - - HttpResponse response = executeGet(API_URL_CAPABILITY); - - handleResponseErrors(response); - - Capability[] capabilityArray = response.parseAs(Capability[].class); - List<Capability> capabilityList = Arrays.asList(capabilityArray); - return capabilityList; + return executeGetList(API_URL_CAPABILITY, Capability[].class); } /** @@ -867,16 +647,9 @@ public List<Capability> getCapabilities() throws IOException, ApiException { * @throws IOException * @throws ApiException */ - public List<CapabilityState> getCapabilityStates() throws IOException, ApiException { + public List<CapabilityState> getCapabilityStates() throws IOException, ApiException, AuthenticationException { logger.debug("Loading capability states..."); - - HttpResponse response = executeGet(API_URL_CAPABILITY_STATES); - - handleResponseErrors(response); - - CapabilityState[] capabilityStatesArray = response.parseAs(CapabilityState[].class); - List<CapabilityState> capabilityStatesList = Arrays.asList(capabilityStatesArray); - return capabilityStatesList; + return executeGetList(API_URL_CAPABILITY_STATES, CapabilityState[].class); } /** @@ -886,31 +659,22 @@ public List<CapabilityState> getCapabilityStates() throws IOException, ApiExcept * @throws IOException * @throws ApiException */ - public List<Message> getMessages() throws IOException, ApiException { + public List<Message> getMessages() throws IOException, ApiException, AuthenticationException { logger.debug("Loading messages..."); - - HttpResponse response = executeGet(API_URL_MESSAGE); - - handleResponseErrors(response); - - Message[] messageArray = response.parseAs(Message[].class); - List<Message> messageList = Arrays.asList(messageArray); - return messageList; + return executeGetList(API_URL_MESSAGE, Message[].class); } /** - * Returns the {@link InnogyConfig}. Be aware that - * - * @return the Configuration + * @return the configVersion */ - public InnogyConfig getConfig() { - return config; + public String getConfigVersion() { + return configVersion; } /** - * @param credentialRefreshListener the credentialRefreshListener to set + * @param configVersion the configVersion to set */ - public void setCredentialRefreshListener(CredentialRefreshListener credentialRefreshListener) { - this.credentialRefreshListener = credentialRefreshListener; + public void setConfigVersion(final String configVersion) { + this.configVersion = configVersion; } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyConfig.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyConfig.java deleted file mode 100644 index c9b4307bc3b26..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyConfig.java +++ /dev/null @@ -1,209 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client; - -import org.apache.commons.lang.StringUtils; - -/** - * The {@link InnogyConfig} contains all configurations for the innogy SmartHome library. - * - * @author Oliver Kuhl - Initial contribution - * - */ -public class InnogyConfig { - private String authCode = null; - private String accessToken = null; - private String refreshToken = null; - private String clientId = null; - private String clientSecret = null; - private String redirectUrl = null; - - /** - * Creates a new {@link InnogyConfig} and set the given clientId, clientSecret, redirectUrl and refreshToken. - * - * @param clientId - * @param clientSecret - * @param redirectUrl - * @param refreshToken - */ - public InnogyConfig(String clientId, String clientSecret, String redirectUrl, String refreshToken) { - this(clientId, clientSecret, redirectUrl, null, null, refreshToken); - } - - /** - * Creates a new {@link InnogyConfig} and set the given clientId, clientSecret, redirectUrl, authCode, accessToken - * and refreshToken. - * - * @param clientId - * @param clientSecret - * @param redirectUrl - * @param authCode - * @param accessToken - * @param refreshToken - */ - public InnogyConfig(String clientId, String clientSecret, String redirectUrl, String authCode, String accessToken, - String refreshToken) { - this.clientId = clientId; - this.clientSecret = clientSecret; - this.redirectUrl = redirectUrl; - this.authCode = authCode; - this.accessToken = accessToken; - this.refreshToken = refreshToken; - } - - /** - * Creates an empty {@link InnogyConfig}. - */ - public InnogyConfig() { - } - - /** - * Checks, if the {@link InnogyConfig} has the necessary {@link #clientId} and {@link #clientSecret} set. - * - * @return true if everything seems fine or false, if one of those are missing. - */ - public boolean checkClientData() { - return !(StringUtils.isEmpty(clientId) || StringUtils.isEmpty(clientSecret) - || StringUtils.isEmpty(redirectUrl)); - } - - /** - * Checks, if the {@link InnogyConfig} includes the refresh token. - * - * @return - */ - public boolean checkRefreshToken() { - return !StringUtils.isEmpty(refreshToken); - } - - /** - * Checks, if the {@link InnogyConfig} includes the access token. - * - * @return - */ - public boolean checkAccessToken() { - return !StringUtils.isEmpty(accessToken); - } - - /** - * Checks, if the authCode is set. - * - * @return - */ - public boolean checkAuthCode() { - return !StringUtils.isBlank(authCode); - } - - /** - * @return the authCode - */ - public String getAuthCode() { - return authCode; - } - - /** - * @param authCode the authCode to set - */ - public void setAuthCode(String authCode) { - this.authCode = authCode; - } - - /** - * @return the accessToken - */ - public String getAccessToken() { - return accessToken; - } - - /** - * @param accessToken the accessToken to set - */ - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - /** - * @return the refreshToken - */ - public String getRefreshToken() { - return refreshToken; - } - - /** - * @param refreshToken the refreshToken to set - */ - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - /** - * @return the clientId - */ - public String getClientId() { - return clientId; - } - - /** - * @param clientId the clientId to set - */ - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * @return the clientSecret - */ - public String getClientSecret() { - return clientSecret; - } - - /** - * @param clientSecret the clientSecret to set - */ - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - /** - * @return the redirectUrl - */ - public String getRedirectUrl() { - return redirectUrl; - } - - /** - * @param redirectUrl the redirectUrl - */ - public void setRedirectUrl(String redirectUrl) { - this.redirectUrl = redirectUrl; - } - - @Override - public String toString() { - String simplifiedAccessToken = ""; - String simplifiedRefreshToken = ""; - - if (!StringUtils.isEmpty(accessToken)) { - simplifiedAccessToken = accessToken.substring(0, 10) + "..." - + accessToken.substring(accessToken.length() - 10); - } - if (!StringUtils.isEmpty(refreshToken)) { - simplifiedRefreshToken = refreshToken.substring(0, 5) + "..." - + refreshToken.substring(refreshToken.length() - 5); - } - - return "Config [clientId=" + clientId + ", clientSecret=" + clientSecret + ", redirectUrl=" + redirectUrl - + ", authCode=" + authCode + ", accessToken=" + simplifiedAccessToken + ", refreshToken=" - + simplifiedRefreshToken + "]"; - } -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyCredentialRefreshListener.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyCredentialRefreshListener.java deleted file mode 100644 index 498344d0dccf1..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/InnogyCredentialRefreshListener.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client; - -import java.io.IOException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.TokenErrorResponse; -import com.google.api.client.auth.oauth2.TokenResponse; - -/** - * The {@link InnogyCredentialRefreshListener} is injected in the google oauth library and called, when the access - * tokens timed out. It is used to update the {@link InnogyConfig}, to keep the valid tokens up to date. - * - * @author Oliver Kuhl - Initial contribution - * - */ -public class InnogyCredentialRefreshListener implements CredentialRefreshListener { - - private final Logger logger = LoggerFactory.getLogger(InnogyCredentialRefreshListener.class); - private InnogyConfig config; - - public InnogyCredentialRefreshListener(InnogyConfig config) { - this.config = config; - } - - @Override - public void onTokenResponse(Credential credential, TokenResponse tokenResponse) throws IOException { - config.setAccessToken(credential.getAccessToken()); - logger.debug("innogy access token saved (onTokenResponse): {}", credential.getAccessToken()); - } - - @Override - public void onTokenErrorResponse(Credential credential, TokenErrorResponse tokenErrorResponse) throws IOException { - config.setAccessToken(credential.getAccessToken()); - logger.debug("innogy access token saved (onTokenErrorResponse): {}", credential.getAccessToken()); - } - -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Util.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Util.java index 35d2bd99f01d3..c516e58ac1c7e 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Util.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/Util.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,27 +15,22 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Utility class with commonly used methods. * * @author Oliver Kuhl - Initial contribution * */ -public class Util { +@NonNullByDefault +public final class Util { - public static ZonedDateTime convertZuluTimeStringToDate(String timeString) { - DateTimeFormatter fmt = DateTimeFormatter.ISO_INSTANT; - return ZonedDateTime.parse(timeString, DateTimeFormatter.ISO_OFFSET_DATE_TIME); + private Util() { + // Util class. } - /** - * Compares two strings. - * - * @param string1 - * @param string2 - * @return true, if both strings are equal and not null - */ - public static boolean equalsIfPresent(String string1, String string2) { - return string1 == null ? false : string1.equals(string2); + public static ZonedDateTime convertZuluTimeStringToDate(String timeString) { + return ZonedDateTime.parse(timeString, DateTimeFormatter.ISO_OFFSET_DATE_TIME); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/ConfigPropertyList.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/ConfigPropertyList.java deleted file mode 100644 index 3259645598693..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/ConfigPropertyList.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity; - -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.FormatStyle; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.openhab.binding.innogysmarthome.internal.client.Util; -import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; - -import com.google.api.client.util.Key; - -/** - * Defines a list of configuration properties. It will be extended by the {@link Device}, that holds a list of config - * properties. - * - * @author Oliver Kuhl - Initial contribution - */ -public abstract class ConfigPropertyList extends PropertyList { - - /** config property names */ - protected static final String CONFIG_PROPERTY_NAME = "Name"; - protected static final String CONFIG_PROPERTY_PROTOCOL_ID = "ProtocolId"; - protected static final String CONFIG_PROPERTY_TIME_OF_ACCEPTANCE = "TimeOfAcceptance"; - protected static final String CONFIG_PROPERTY_TIME_OF_DISCOVERY = "TimeOfDiscovery"; - protected static final String CONFIG_PROPERTY_HARDWARE_VERSION = "HardwareVersion"; - protected static final String CONFIG_PROPERTY_SOFTWARE_VERSION = "SoftwareVersion"; - protected static final String CONFIG_PROPERTY_FIRMWARE_VERSION = "FirmwareVersion"; - protected static final String CONFIG_PROPERTY_HOSTNAME = "HostName"; - protected static final String CONFIG_PROPERTY_ACTIVITY_LOG_ENABLED = "ActivityLogEnabled"; - protected static final String CONFIG_PROPERTY_CONFIGURATION_STATE = "ConfigurationState"; - protected static final String CONFIG_PROPERTY_GEOLOCATION = "GeoLocation"; - protected static final String CONFIG_PROPERTY_TIMEZONE = "TimeZone"; - protected static final String CONFIG_PROPERTY_CURRENT_UTC_OFFSET = "CurrentUTCOffset"; - protected static final String CONFIG_PROPERTY_IP_ADDRESS = "IPAddress"; - protected static final String CONFIG_PROPERTY_MAC_ADDRESS = "MACAddress"; - protected static final String CONFIG_PROPERTY_SHC_TYPE = "ShcType"; - protected static final String CONFIG_PROPERTY_BACKEND_CONNECTION_MONITORED = "BackendConnectionMonitored"; - protected static final String CONFIG_PROPERTY_RFCOM_FAILURE_NOTIFICATION = "RFCommFailureNotification"; - protected static final String CONFIG_PROPERTY_POSTCODE = "PostCode"; - protected static final String CONFIG_PROPERTY_CITY = "City"; - protected static final String CONFIG_PROPERTY_STREET = "Street"; - protected static final String CONFIG_PROPERTY_HOUSENUMBER = "HouseNumber"; - protected static final String CONFIG_PROPERTY_COUNTRY = "Country"; - protected static final String CONFIG_PROPERTY_HOUSEHOLD_TYPE = "HouseholdType"; - protected static final String CONFIG_PROPERTY_NUMBER_OF_PERSONS = "NumberOfPersons"; - protected static final String CONFIG_PROPERTY_NUMBER_OF_FLOORS = "NumberOfFloors"; - protected static final String CONFIG_PROPERTY_LIVINGAREA = "LivingArea"; - protected static final String CONFIG_PROPERTY_REGISTRATION_TIME = "RegistrationTime"; - protected static final String CONFIG_PROPERTY_DISPLAY_CURRENT_TEMPERATURE = "DisplayCurrentTemperature"; - protected static final String CONFIG_PROPERTY_UNDERLYING_DEVICE_IDS = "UnderlyingDeviceIds"; - protected static final String CONFIG_PROPERTY_METER_ID = "MeterId"; - protected static final String CONFIG_PROPERTY_METER_FIRMWARE_VERSION = "MeterFirmwareVersion"; - protected static final String CONFIG_PROPERTY_DEVICE_TYPE = "DeviceType"; - - protected static final String PROTOCOL_ID_COSIP = "Cosip"; - protected static final String PROTOCOL_ID_VIRTUAL = "Virtual"; - protected static final String PROTOCOL_ID_WMBUS = "wMBus"; - - /** - * This represents a container of all configuration properties. - * - * Optional. - */ - @Key("Config") - protected List<Property> configList; - protected HashMap<String, Property> configMap; - - /** - * @return the configList - */ - public List<Property> getConfigList() { - return configList; - } - - /** - * @param configList the configList to set - */ - public void setConfigList(List<Property> configList) { - this.configList = configList; - } - - /** - * Returns true, if config properties are available. - * - * @return - */ - public boolean hasConfigProperties() { - return (configList != null && !configList.isEmpty()); - } - - /* - * (non-Javadoc) - * - * @see in.ollie.innogysmarthome.entity.PropertyList#getPropertyMap() - */ - @Override - protected Map<String, Property> getPropertyMap() { - if (configMap == null) { - configMap = PropertyList.getHashMap(configList); - } - - return configMap; - } - - /* - * (non-Javadoc) - * - * @see in.ollie.innogysmarthome.entity.PropertyList#getPropertyList() - */ - @Override - protected List<Property> getPropertyList() { - if (configList == null) { - configList = new ArrayList<>(); - } - - return configList; - } - - /** - * @return - */ - public Map<String, Property> getConfigMap() { - return getPropertyMap(); - } - - /** - * Returns the name of the {@link Device}. - * - * @return - */ - public String getName() { - return getPropertyValueAsString(CONFIG_PROPERTY_NAME); - } - - public String getProtocolId() { - return getPropertyValueAsString(CONFIG_PROPERTY_PROTOCOL_ID); - } - - /** - * Returns the time, when the {@link Device} was added to the SHC configuration. - * - * @return - */ - public ZonedDateTime getTimeOfAcceptance() { - String time = getPropertyValueAsString(CONFIG_PROPERTY_TIME_OF_ACCEPTANCE); - if (time == null) { - return null; - } - return Util.convertZuluTimeStringToDate(time); - } - - /** - * Returns the time, when the {@link Device} was discovered by the SHC. - * - * @return - */ - public ZonedDateTime getTimeOfDiscovery() { - String time = getPropertyValueAsString(CONFIG_PROPERTY_TIME_OF_DISCOVERY); - if (time == null) { - return null; - } - return Util.convertZuluTimeStringToDate(time); - } - - public String getHardwareVersion() { - return getPropertyValueAsString(CONFIG_PROPERTY_HARDWARE_VERSION); - } - - public String getSoftwareVersion() { - return getPropertyValueAsString(CONFIG_PROPERTY_SOFTWARE_VERSION); - } - - public String getFirmwareVersion() { - return getPropertyValueAsString(CONFIG_PROPERTY_FIRMWARE_VERSION); - } - - public String getHostName() { - return getPropertyValueAsString(CONFIG_PROPERTY_HOSTNAME); - } - - public Boolean getActivityLogEnabled() { - return getPropertyValueAsBoolean(CONFIG_PROPERTY_ACTIVITY_LOG_ENABLED); - } - - public String getConfigurationState() { - return getPropertyValueAsString(CONFIG_PROPERTY_CONFIGURATION_STATE); - } - - public String getGeoLocation() { - return getPropertyValueAsString(CONFIG_PROPERTY_GEOLOCATION); - } - - public String getTimeZone() { - return getPropertyValueAsString(CONFIG_PROPERTY_TIMEZONE); - } - - public Integer getCurrentUTCOffset() { - return getPropertyValueAsInteger(CONFIG_PROPERTY_CURRENT_UTC_OFFSET); - } - - public String getIpAddress() { - return getPropertyValueAsString(CONFIG_PROPERTY_IP_ADDRESS); - } - - public String getMacAddress() { - return getPropertyValueAsString(CONFIG_PROPERTY_MAC_ADDRESS); - } - - public String getSHCType() { - return getPropertyValueAsString(CONFIG_PROPERTY_SHC_TYPE); - } - - public Boolean getBackendConnectionMonitored() { - return getPropertyValueAsBoolean(CONFIG_PROPERTY_BACKEND_CONNECTION_MONITORED); - } - - public Boolean getRFCommFailureNotification() { - return getPropertyValueAsBoolean(CONFIG_PROPERTY_RFCOM_FAILURE_NOTIFICATION); - } - - public String getPostCode() { - return getPropertyValueAsString(CONFIG_PROPERTY_POSTCODE); - } - - public String getCity() { - return getPropertyValueAsString(CONFIG_PROPERTY_CITY); - } - - public String getStreet() { - return getPropertyValueAsString(CONFIG_PROPERTY_STREET); - } - - public String getHouseNumber() { - return getPropertyValueAsString(CONFIG_PROPERTY_HOUSENUMBER); - } - - public String getCountry() { - return getPropertyValueAsString(CONFIG_PROPERTY_COUNTRY); - } - - public String getHouseHoldType() { - return getPropertyValueAsString(CONFIG_PROPERTY_HOUSEHOLD_TYPE); - } - - public Integer getNumberOfPersons() { - return getPropertyValueAsInteger(CONFIG_PROPERTY_NUMBER_OF_PERSONS); - } - - public Integer getNumberOfFloors() { - return getPropertyValueAsInteger(CONFIG_PROPERTY_NUMBER_OF_FLOORS); - } - - public Integer getLivingArea() { - return getPropertyValueAsInteger(CONFIG_PROPERTY_LIVINGAREA); - } - - public ZonedDateTime getRegistrationTime() { - return Util.convertZuluTimeStringToDate(getPropertyValueAsString(CONFIG_PROPERTY_REGISTRATION_TIME)); - } - - public String getRegistrationTimeFormattedString() { - return Util.convertZuluTimeStringToDate(getPropertyValueAsString(CONFIG_PROPERTY_REGISTRATION_TIME)) - .format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)); - } - - public String getDisplayCurrentTemperature() { - return getPropertyValueAsString(CONFIG_PROPERTY_DISPLAY_CURRENT_TEMPERATURE); - } - - public String getUnderLyingDeviceIds() { - return getPropertyValueAsString(CONFIG_PROPERTY_UNDERLYING_DEVICE_IDS); - } - - public String getMeterId() { - return getPropertyValueAsString(CONFIG_PROPERTY_METER_ID); - } - - public String getMeterFirmwareVersion() { - return getPropertyValueAsString(CONFIG_PROPERTY_METER_FIRMWARE_VERSION); - } - - public String getDeviceType() { - return getPropertyValueAsString(CONFIG_PROPERTY_DEVICE_TYPE); - } -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Constant.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Constant.java index c7bb27765aa4c..b4de2f400e9e0 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Constant.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Constant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,8 +12,6 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity; -import com.google.api.client.util.Key; - /** * The {@link Constant} entity is used for {@link Action}s. * @@ -22,7 +20,6 @@ */ public class Constant { - @Key("value") public Object value; public Constant(Object value) { diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Location.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Location.java deleted file mode 100644 index af88df8d7958b..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Location.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity; - -import java.util.List; - -import com.google.api.client.util.Key; - -/** - * Defines a {@link Location} structure. - * - * @author Oliver Kuhl - Initial contribution - */ -public class Location extends ConfigPropertyList { - private static final String CONFIG_PROPERTY_TYPE = "Type"; - - /** - * Identifier of the location – must be unique. - */ - @Key("id") - private String id; - - /** - * Reference to the description of the message. - * Optional. - */ - @Key("desc") - private String desc; - - /** - * Container for tagging the location, e.g. if the location is on a certain floor in the house. - * Optional. - */ - @Key("Tags") - private List<Property> tagsList; - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the desc - */ - public String getDesc() { - return desc; - } - - /** - * @param desc the desc to set - */ - public void setDesc(String desc) { - this.desc = desc; - } - - /** - * @return the tagsList - */ - public List<Property> getTagsList() { - return tagsList; - } - - /** - * @param tagsList the tagsList to set - */ - public void setTagsList(List<Property> tagsList) { - this.tagsList = tagsList; - } - - @Override - public String getName() { - return getPropertyValueAsString(CONFIG_PROPERTY_NAME); - } - - public String getType() { - return getPropertyValueAsString(CONFIG_PROPERTY_TYPE); - } -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Property.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Property.java index d05a4971be2e5..407f0cfa6370b 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Property.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Property.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,8 +12,6 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity; -import com.google.api.client.util.Key; - /** * Defines a {@link Property}, that is a basic key/value structure used for several data types in the innogy API. * @@ -21,13 +19,10 @@ */ public class Property { - @Key("name") private String name; - @Key("value") private Object value; - @Key("lastchanged") private String lastchanged; public Property() { diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/PropertyList.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/PropertyList.java deleted file mode 100644 index 222e2a97f1a84..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/PropertyList.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provides a list of {@link Property}s and commonly used methods. - * - * @author Oliver Kuhl - Initial contribution - */ -public abstract class PropertyList { - - /** - * Returns a {@link Map} of the {@link Property}s. Must be overwritten! - * - * @return {@link Map} of {@link Property}s - */ - protected abstract Map<String, Property> getPropertyMap(); - - /** - * Returns a {@link List} of the {@link Property}s. Must be overwritten! - * - * @return {@link List} of {@link Property}s - */ - protected abstract List<Property> getPropertyList(); - - /** - * Adds a {@link Property} to the {@link #PropertyList()} and corresponding {@link #getPropertyMap()}. Make sure - * the element is new first - this is not checked! - * - * @param p - */ - private void addProperty(Property p) { - getPropertyList().add(p); - getPropertyMap().put(p.getName(), p); - } - - /** - * Returns the value of the {@link Property} with the given name. - * - * @param propertyName - * @return - */ - protected Object getPropertyValue(String propertyName) { - return getPropertyMap().get(propertyName); - } - - /** - * Returns the value of the {@link Property} with the given name as {@link String}. - * - * @param propertyName - * @return - */ - protected String getPropertyValueAsString(String propertyName) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - Object value = p.getValue(); - if (value instanceof String) { - return (String) value; - } - } - return null; - } - - /** - * Sets the value of the {@link Property} with the given name to the stringState. - * - * @param propertyName String the name of the {@link Property} - * @param stringValue String the new value to set - */ - protected void setPropertyValueAsString(String propertyName, String stringValue) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - p.setValue(stringValue); - } else { - addProperty(new Property(propertyName, stringValue)); - } - } - - /** - * Returns the value of the {@link Property} with the given name as {@link Boolean}. - * - * @param propertyName - * @return - */ - protected Boolean getPropertyValueAsBoolean(String propertyName) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - Object value = p.getValue(); - if (value instanceof Boolean) { - return (Boolean) value; - } - } - return null; - } - - /** - * Sets the value of the {@link Property} with the given name to the booleanState. - * - * @param propertyName String the name of the {@link Property} - * @param booleanValue boolean the new value to set - */ - protected void setPropertyValueAsBoolean(String propertyName, boolean booleanValue) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - p.setValue(booleanValue); - } else { - addProperty(new Property(propertyName, booleanValue)); - } - } - - /** - * Returns the value of the {@link Property} with the given name as {@link Double}. - * - * @param propertyName - * @return - */ - protected Double getPropertyValueAsDouble(String propertyName) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - Object value = p.getValue(); - // return (Double) value; - return Double.parseDouble(value.toString()); - } - return null; - } - - /** - * Sets the value of the {@link Property} with the given name to the doubleState. - * - * @param propertyName String the name of the {@link Property} - * @param doubleValue double the new value to set - */ - protected void setPropertyValueAsDouble(String propertyName, double doubleValue) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - p.setValue(doubleValue); - } else { - addProperty(new Property(propertyName, doubleValue)); - } - } - - /** - * Returns the value of the {@link Property} with the given name as {@link Integer}. - * - * @param propertyName - * @return - */ - protected Integer getPropertyValueAsInteger(String propertyName) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - Object value = p.getValue(); - if (value instanceof Integer) { - return (Integer) value; - } else if (value instanceof Double) { - Double doubleValue = (Double) value; - return doubleValue.intValue(); - } else if (value instanceof String) { - return Integer.parseInt(value.toString()); - } - } - return null; - } - - /** - * Sets the value of the {@link Property} with the given name to the intState. - * - * @param propertyName String the name of the {@link Property} - * @param intValue int the new value to set - */ - protected void setPropertyValueAsInteger(String propertyName, int intValue) { - Property p = getPropertyMap().get(propertyName); - if (p != null) { - p.setValue(intValue); - } else { - addProperty(new Property(propertyName, intValue)); - } - } - - /** - * Returns a {@link HashMap} with the name as key and {@link Property} as value. - * - * @param propertyList - * @return - */ - public static HashMap<String, Property> getHashMap(List<Property> propertyList) { - HashMap<String, Property> map = new HashMap<>(); - for (Property p : propertyList) { - map.put(p.getName(), p); - } - return map; - } - -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/SHCInfo.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/SHCInfo.java deleted file mode 100644 index 6eff21d714a1b..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/SHCInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity; - -import java.util.List; - -import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; - -import com.google.api.client.util.Key; - -/** - * Special data structure, which is returned on session initialization by the innogy API. - * - * @author Oliver Kuhl - Initial contribution - */ -public class SHCInfo { - - @Key("CurrentConfigurationVersion") - public long currentConfigurationVersion; - - @Key("Data") - public List<Device> deviceList; -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/CapabilityLink.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/StatusResponse.java similarity index 59% rename from bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/CapabilityLink.java rename to bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/StatusResponse.java index cd2c623997190..d98c640a2c5b6 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/CapabilityLink.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/StatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,20 +10,18 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.innogysmarthome.internal.client.entity.link; +package org.openhab.binding.innogysmarthome.internal.client.entity; -import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.Gateway; /** - * Defines a {@link Link} to a {@link Capability} + * Defines the structure of the status response * * @author Oliver Kuhl - Initial contribution */ -public class CapabilityLink extends Link { - public static final String LINK_BASE = "/capability/"; - - @Override - public String getId() { - return getValue().replace(LINK_BASE, ""); - } +public class StatusResponse { + /** + * The innogy SmartHome gateway. Can be null in case there is no registered for the current logged in user. + */ + public Gateway gateway; } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/Action.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/Action.java index 48768e95cedf4..bda0602feef25 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/Action.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/Action.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,13 +12,8 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity.action; -import java.util.List; - import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; -import com.google.api.client.util.Key; -import com.google.gson.annotations.SerializedName; - /** * Implements the Action structure needed to send JSON actions to the innogy backend. They are used to e.g. switch the * state of a device. @@ -27,23 +22,41 @@ */ public class Action { - public static final String ACTION_TYPE_SETSTATE = "device/SHC.RWE/1.0/action/SetState"; + public static final String ACTION_TYPE_SETSTATE = "SetState"; + private static final String NAMESPACE_CORE_RWE = "core.RWE"; - @Key("type") + /** + * Specifies the type of the action. + */ private String type; - @Key("Link") - @SerializedName("Link") - private Link capabilityLink; + /** + * Link to the entity supposed to execute the action. + */ + private String target; + + /** + * The product (context) that should handle (execute) the action. Defaults to {@link Action#NAMESPACE_CORE_RWE}. + */ + private String namespace = NAMESPACE_CORE_RWE; - @Key("Data") - @SerializedName("Data") - private List<ActionParameter> parameterList; + /** + * Dictionary of functions required for the intended execution of the action. + */ + private ActionParams params; + /** + * Default constructor, used by serialization. + */ public Action() { // used by serialization } + /** + * Sets the type of the action. Usual action type is {@link Action#ACTION_TYPE_SETSTATE}. + * + * @param type + */ public Action(String type) { this.type = type; } @@ -63,40 +76,54 @@ public void setType(String type) { } /** - * @return the capabilityLink + * @return the link to the target capability + */ + public String getTarget() { + return target; + } + + /** + * @param target the link to the target capability to set + */ + public void setTarget(String target) { + this.target = target; + } + + /** + * @return the namespace */ - public Link getCapabilityLink() { - return capabilityLink; + public String getNamespace() { + return namespace; } /** - * @param capabilityLink the capabilityLink to set + * @param namespace the namespace to set */ - public void setCapabilityLink(Link capabilityLink) { - this.capabilityLink = capabilityLink; + public void setNamespace(String namespace) { + this.namespace = namespace; } /** - * Sets the capability link to the given capability id. + * Sets the link target to the given capability id. * * @param capabilityId String with the 32 character long id */ - public void setCapabilityLink(String capabilityId) { - setCapabilityLink(new Link("/capability/" + capabilityId)); + public void setTargetCapabilityById(String capabilityId) { + setTarget(Link.LINK_TYPE_CAPABILITY + capabilityId); } /** - * @return the parameterList + * @return the params */ - public List<ActionParameter> getParameterList() { - return parameterList; + public ActionParams getParams() { + return params; } /** - * @param parameterList the parameterList to set + * @param params the params to set */ - public void setParameterList(List<ActionParameter> parameterList) { - this.parameterList = parameterList; + public void setParams(ActionParams params) { + this.params = params; } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParams.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParams.java new file mode 100644 index 0000000000000..7d415a32ca320 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParams.java @@ -0,0 +1,119 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +/** + * Defines the {@link ActionParams} data structure needed to pass parameters within an {@link Action} to the innogy + * SmartHome backend. + * + * @author Oliver Kuhl - Initial contribution + */ +public class ActionParams { + + private BooleanActionParam onState; + + private BooleanActionParam value; + + private DoubleActionParam pointTemperature; + + private IntegerActionParam dimLevel; + + private IntegerActionParam shutterLevel; + + private StringActionParam operationMode; + + /** + * @return the onState + */ + public BooleanActionParam getOnState() { + return onState; + } + + /** + * @param state the state to set + */ + public void setOnState(BooleanActionParam state) { + this.onState = state; + } + + /** + * @return the onState + */ + public BooleanActionParam getValue() { + return value; + } + + /** + * @param state the state to set + */ + public void setValue(BooleanActionParam state) { + this.value = state; + } + + /** + * @return the pointTemperature + */ + public DoubleActionParam getPointTemperature() { + return pointTemperature; + } + + /** + * @param pointTemperature the pointTemperature to set + */ + public void setPointTemperature(DoubleActionParam pointTemperature) { + this.pointTemperature = pointTemperature; + } + + /** + * @return the dimLevel + */ + public IntegerActionParam getDimLevel() { + return dimLevel; + } + + /** + * @param dimLevel the dimLevel to set + */ + public void setDimLevel(IntegerActionParam dimLevel) { + this.dimLevel = dimLevel; + } + + /** + * @return the shutterLevel + */ + public IntegerActionParam getShutterLevel() { + return shutterLevel; + } + + /** + * @param shutterLevel the shutterLevel to set + */ + public void setShutterLevel(IntegerActionParam shutterLevel) { + this.shutterLevel = shutterLevel; + } + + /** + * @return the operationMode + */ + public StringActionParam getOperationMode() { + return operationMode; + } + + /** + * @param operationMode the operationMode to set + */ + public void setOperationMode(StringActionParam operationMode) { + this.operationMode = operationMode; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/BooleanActionParam.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/BooleanActionParam.java new file mode 100644 index 0000000000000..193bba3788567 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/BooleanActionParam.java @@ -0,0 +1,62 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +/** + * Defines the structure of a {@link BooleanActionParam}. + * + * @author Oliver Kuhl - Initial contribution + */ +public class BooleanActionParam { + + private String type; + + private boolean value; + + /** + * @param type + * @param value + */ + BooleanActionParam(String type, boolean value) { + this.type = type; + this.value = value; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the value + */ + public boolean isValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(boolean value) { + this.value = value; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/DoubleActionParam.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/DoubleActionParam.java new file mode 100644 index 0000000000000..27c9176e0ea48 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/DoubleActionParam.java @@ -0,0 +1,63 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +/** + * Defines the structure of a {@link DoubleActionParam}. + * + * @author Oliver Kuhl - Initial contribution + */ +public class DoubleActionParam { + + private String type; + + private double value; + + /** + * @param type + * @param value + */ + DoubleActionParam(String type, double value) { + this.type = type; + this.value = value; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the value + */ + public double isValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(double value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/IntegerActionParam.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/IntegerActionParam.java new file mode 100644 index 0000000000000..28d58a4db7870 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/IntegerActionParam.java @@ -0,0 +1,63 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +/** + * Defines the structure of a {@link IntegerActionParam}. + * + * @author Oliver Kuhl - Initial contribution + */ +public class IntegerActionParam { + + private String type; + + private int value; + + /** + * @param type + * @param value + */ + IntegerActionParam(String type, int value) { + this.type = type; + this.value = value; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the value + */ + public int isValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(int value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/SetStateAction.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/SetStateAction.java deleted file mode 100644 index c21e365390d16..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/SetStateAction.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity.action; - -import java.util.ArrayList; -import java.util.List; - -import org.openhab.binding.innogysmarthome.internal.client.entity.Constant; -import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; - -/** - * Special {@link Action} needed to set a state of a device. - * - * @author Oliver Kuhl - Initial contribution - */ -public class SetStateAction extends Action { - - public static final String ACTION_PARAMETER_SWITCHACTUATOR_ONSTATE = "OnState"; - public static final String ACTION_PARAMETER_VARIABLEACTUATOR_VALUE = "Value"; - public static final String ACTION_PARAMETER_THERMOSTATACTUATOR_POINTTEMPERATURE = "PointTemperature"; - public static final String ACTION_PARAMETER_THERMOSTATACTUATOR_OPERATIONMODE = "OperationMode"; - public static final String ACTION_PARAMETER_ALARMACTUATOR_ONSTATE = "OnState"; - public static final String ACTION_PARAMETER_DIMMERACTUATOR_VALUE = "DimLevel"; - public static final String ACTION_PARAMETER_ROLLERSHUTTERACTUATOR_VALUE = "ShutterLevel"; - - /** - * Constructs a new {@link SetStateAction}. - * - * @param capabilityId String of the 32 character capability id - * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_SWITCHACTUATOR} or - * {@link Capability#TYPE_VARIABLEACTUATOR} - * @param state the new state as boolean (true=on, false=off) - */ - public SetStateAction(String capabilityId, String capabilityType, boolean state) { - super(ACTION_TYPE_SETSTATE); - setCapabilityLink(capabilityId); - - List<ActionParameter> parameterList = new ArrayList<>(); - - if (capabilityType.equals(Capability.TYPE_SWITCHACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_SWITCHACTUATOR_ONSTATE, "/entity/Constant", - new Constant(state))); - } else if (capabilityType.equals(Capability.TYPE_VARIABLEACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_VARIABLEACTUATOR_VALUE, "/entity/Constant", - new Constant(state))); - } else if (capabilityType.equals(Capability.TYPE_ALARMACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_ALARMACTUATOR_ONSTATE, "/entity/Constant", - new Constant(state))); - } - setParameterList(parameterList); - } - - /** - * Constructs a new {@link SetStateAction}. - * - * @param capabilityId String of the 32 character capability id - * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_THERMOSTATACTUATOR} - * @param newValue the new double value - */ - public SetStateAction(String capabilityId, String capabilityType, double newValue) { - super(ACTION_TYPE_SETSTATE); - setCapabilityLink(capabilityId); - - List<ActionParameter> parameterList = new ArrayList<>(); - - if (capabilityType.equals(Capability.TYPE_THERMOSTATACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_THERMOSTATACTUATOR_POINTTEMPERATURE, - "/entity/Constant", new Constant(newValue))); - } - setParameterList(parameterList); - } - - /** - * Constructs a new {@link SetStateAction}. - * - * @param capabilityId String of the 32 character capability id - * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_DIMMERACTUATOR} - * @param newValue the new int value - */ - public SetStateAction(String capabilityId, String capabilityType, int newValue) { - super(ACTION_TYPE_SETSTATE); - setCapabilityLink(capabilityId); - - List<ActionParameter> parameterList = new ArrayList<>(); - - if (capabilityType.equals(Capability.TYPE_DIMMERACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_DIMMERACTUATOR_VALUE, "/entity/Constant", - new Constant(newValue))); - } else if (capabilityType.equals(Capability.TYPE_ROLLERSHUTTERACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_ROLLERSHUTTERACTUATOR_VALUE, "/entity/Constant", - new Constant(newValue))); - } - - setParameterList(parameterList); - } - - /** - * Constructs a new {@link SetStateAction}. - * - * @param capabilityId String of the 32 character capability id - * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_THERMOSTATACTUATOR} - * @param newValue the new string value - */ - public SetStateAction(String capabilityId, String capabilityType, String newValue) { - super(ACTION_TYPE_SETSTATE); - setCapabilityLink(capabilityId); - - List<ActionParameter> parameterList = new ArrayList<>(); - - if (capabilityType.equals(Capability.TYPE_THERMOSTATACTUATOR)) { - parameterList.add(new ActionParameter(ACTION_PARAMETER_THERMOSTATACTUATOR_OPERATIONMODE, "/entity/Constant", - new Constant(newValue))); - } - setParameterList(parameterList); - } - -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StateActionSetter.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StateActionSetter.java new file mode 100644 index 0000000000000..e8f81afc5b27f --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StateActionSetter.java @@ -0,0 +1,106 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; + +/** + * Special {@link Action} needed to set a state of a device. + * + * @author Oliver Kuhl - Initial contribution + */ +public class StateActionSetter extends Action { + + private static final String CONSTANT = "Constant"; + + /** + * Constructs a new {@link StateActionSetter}. + * + * @param capabilityId String of the 32 character capability id + * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_SWITCHACTUATOR} or + * {@link Capability#TYPE_VARIABLEACTUATOR} + * @param state the new state as boolean (true=on, false=off) + */ + public StateActionSetter(String capabilityId, String capabilityType, boolean state) { + setType(ACTION_TYPE_SETSTATE); + setTargetCapabilityById(capabilityId); + final ActionParams params = new ActionParams(); + + if (Capability.TYPE_SWITCHACTUATOR.equals(capabilityType)) { + params.setOnState(new BooleanActionParam(CONSTANT, state)); + } else if (Capability.TYPE_VARIABLEACTUATOR.equals(capabilityType)) { + params.setValue(new BooleanActionParam(CONSTANT, state)); + } else if (Capability.TYPE_ALARMACTUATOR.equals(capabilityType)) { + params.setOnState(new BooleanActionParam(CONSTANT, state)); + } + setParams(params); + } + + /** + * Constructs a new {@link StateActionSetter}. + * + * @param capabilityId String of the 32 character capability id + * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_THERMOSTATACTUATOR} + * @param newValue the new double value + */ + public StateActionSetter(String capabilityId, String capabilityType, double newValue) { + setType(ACTION_TYPE_SETSTATE); + setTargetCapabilityById(capabilityId); + final ActionParams params = new ActionParams(); + + if (Capability.TYPE_THERMOSTATACTUATOR.equals(capabilityType)) { + params.setPointTemperature(new DoubleActionParam(CONSTANT, newValue)); + } + setParams(params); + } + + /** + * Constructs a new {@link StateActionSetter}. + * + * @param capabilityId String of the 32 character capability id + * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_DIMMERACTUATOR} + * @param newValue the new int value + */ + public StateActionSetter(String capabilityId, String capabilityType, int newValue) { + setType(ACTION_TYPE_SETSTATE); + setTargetCapabilityById(capabilityId); + final ActionParams params = new ActionParams(); + + if (Capability.TYPE_DIMMERACTUATOR.equals(capabilityType)) { + params.setDimLevel(new IntegerActionParam(CONSTANT, newValue)); + } else if (Capability.TYPE_ROLLERSHUTTERACTUATOR.equals(capabilityType)) { + params.setShutterLevel(new IntegerActionParam(CONSTANT, newValue)); + } + + setParams(params); + } + + /** + * Constructs a new {@link StateActionSetter}. + * + * @param capabilityId String of the 32 character capability id + * @param capabilityType the type of the {@link Capability}, {@link Capability#TYPE_THERMOSTATACTUATOR} + * @param newValue the new string value + */ + public StateActionSetter(String capabilityId, String capabilityType, String newValue) { + setType(ACTION_TYPE_SETSTATE); + setTargetCapabilityById(capabilityId); + final ActionParams params = new ActionParams(); + + if (Capability.TYPE_THERMOSTATACTUATOR.equals(capabilityType)) { + params.setOperationMode(new StringActionParam(CONSTANT, newValue)); + } + setParams(params); + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StringActionParam.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StringActionParam.java new file mode 100644 index 0000000000000..4667006178c28 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/StringActionParam.java @@ -0,0 +1,63 @@ +/** + * 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.innogysmarthome.internal.client.entity.action; + +/** + * Defines the structure of a {@link StringActionParam}. + * + * @author Oliver Kuhl - Initial contribution + */ +public class StringActionParam { + + private String type; + + private String value; + + /** + * @param type + * @param value + */ + StringActionParam(String type, String value) { + this.type = type; + this.value = value; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the value + */ + public String isValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/Capability.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/Capability.java index a0e65782b70f5..adeae06a1bb29 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/Capability.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/Capability.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,24 +12,13 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity.capability; -import java.util.List; - -import org.openhab.binding.innogysmarthome.internal.client.entity.ConfigPropertyList; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; -import org.openhab.binding.innogysmarthome.internal.client.entity.state.CapabilityState; - -import com.google.api.client.util.Key; - /** * Defines the structure of a {@link Capability}. A capability is a specific functionality of a device like a * temperature sensor. * * @author Oliver Kuhl - Initial contribution */ -public class Capability extends ConfigPropertyList { - - private static final String CONFIG_PROPERTY_ACTIVITY_LOG_ACTIVE = "ActivityLogActive"; - private static final String CONFIG_PROPERTY_PUSH_BUTTONS = "PushButtons"; +public class Capability { /** capability types */ public static final String TYPE_SWITCHACTUATOR = "SwitchActuator"; @@ -56,29 +45,22 @@ public class Capability extends ConfigPropertyList { /** * Unique id for the Capability. */ - @Key("id") private String id; /** * Type of the capability – must be unique per device, since the device links to the capability via the type. */ - @Key("type") private String type; /** - * Link to the metadata of that specific capability. The link should be complete and can be followed without further - * additions. In the instance of a capability, the Link will point to the actual instance of the underlying device. - * - * Optional. + * Contains the link to the parent device, which offers the capability. */ - @Key("desc") - private String desc; + private String device; /** - * Contain the link to the parent device, which offers the capability. + * This represents a container of all configuration properties. */ - @Key("Device") - private List<Link> deviceLink; + private CapabilityConfig config; private CapabilityState capabilityState; @@ -111,31 +93,31 @@ public void setType(String type) { } /** - * @return the desc + * @return */ - public String getDesc() { - return desc; + public String getDeviceLink() { + return device; } /** - * @param desc the desc to set + * @param deviceLink */ - public void setDesc(String desc) { - this.desc = desc; + public void setDeviceLink(String deviceLink) { + this.device = deviceLink; } /** - * @return + * @return the config */ - public List<Link> getDeviceLink() { - return deviceLink; + public CapabilityConfig getConfig() { + return config; } /** - * @param deviceLink + * @param config the config to set */ - public void setDeviceLink(List<Link> deviceLink) { - this.deviceLink = deviceLink; + public void setConfig(CapabilityConfig config) { + this.config = config; } /** @@ -161,7 +143,7 @@ public void setCapabilityState(CapabilityState capabilityState) { * @return */ public boolean hasState() { - return capabilityState != null; + return (capabilityState != null) && (capabilityState.getState() != null); } /** @@ -169,9 +151,8 @@ public boolean hasState() { * * @return */ - @Override public String getName() { - return getPropertyValueAsString(CONFIG_PROPERTY_NAME); + return getConfig().getName(); } /** @@ -180,7 +161,7 @@ public String getName() { * @return boolean or null, if the {@link Capability} does not have this property. */ public boolean getActivityLogActive() { - return getPropertyValueAsBoolean(CONFIG_PROPERTY_ACTIVITY_LOG_ACTIVE); + return getConfig().getActivityLogActive(); } /** @@ -189,7 +170,7 @@ public boolean getActivityLogActive() { * @return int or null, if the {@link Capability} does not have this property. */ public int getPushButtons() { - return getPropertyValueAsInteger(CONFIG_PROPERTY_PUSH_BUTTONS); + return getConfig().getPushButtons(); } /** @@ -198,7 +179,7 @@ public int getPushButtons() { * @return */ public boolean isTypeVariableActuator() { - return getType().equals(TYPE_VARIABLEACTUATOR); + return TYPE_VARIABLEACTUATOR.equals(getType()); } /** @@ -207,7 +188,7 @@ public boolean isTypeVariableActuator() { * @return */ public boolean isTypeSwitchActuator() { - return getType().equals(TYPE_SWITCHACTUATOR); + return TYPE_SWITCHACTUATOR.equals(getType()); } /** @@ -216,7 +197,7 @@ public boolean isTypeSwitchActuator() { * @return */ public boolean isTypeThermostatActuator() { - return getType().equals(TYPE_THERMOSTATACTUATOR); + return TYPE_THERMOSTATACTUATOR.equals(getType()); } /** @@ -225,7 +206,7 @@ public boolean isTypeThermostatActuator() { * @return */ public boolean isTypeTemperatureSensor() { - return getType().equals(TYPE_TEMPERATURESENSOR); + return TYPE_TEMPERATURESENSOR.equals(getType()); } /** @@ -234,7 +215,7 @@ public boolean isTypeTemperatureSensor() { * @return */ public boolean isTypeHumiditySensor() { - return getType().equals(TYPE_HUMIDITYSENSOR); + return TYPE_HUMIDITYSENSOR.equals(getType()); } /** @@ -243,7 +224,7 @@ public boolean isTypeHumiditySensor() { * @return */ public boolean isTypeWindowDoorSensor() { - return getType().equals(TYPE_WINDOWDOORSENSOR); + return TYPE_WINDOWDOORSENSOR.equals(getType()); } /** @@ -252,7 +233,7 @@ public boolean isTypeWindowDoorSensor() { * @return */ public boolean isTypeSmokeDetectorSensor() { - return getType().equals(TYPE_SMOKEDETECTORSENSOR); + return TYPE_SMOKEDETECTORSENSOR.equals(getType()); } /** @@ -261,7 +242,7 @@ public boolean isTypeSmokeDetectorSensor() { * @return */ public boolean isTypeAlarmActuator() { - return getType().equals(TYPE_ALARMACTUATOR); + return TYPE_ALARMACTUATOR.equals(getType()); } /** @@ -270,7 +251,7 @@ public boolean isTypeAlarmActuator() { * @return */ public boolean isTypeMotionDetectionSensor() { - return getType().equals(TYPE_MOTIONDETECTIONSENSOR); + return TYPE_MOTIONDETECTIONSENSOR.equals(getType()); } /** @@ -279,7 +260,7 @@ public boolean isTypeMotionDetectionSensor() { * @return */ public boolean isTypeLuminanceSensor() { - return getType().equals(TYPE_LUMINANCESENSOR); + return TYPE_LUMINANCESENSOR.equals(getType()); } /** @@ -288,7 +269,7 @@ public boolean isTypeLuminanceSensor() { * @return */ public boolean isTypePushButtonSensor() { - return getType().equals(TYPE_PUSHBUTTONSENSOR); + return TYPE_PUSHBUTTONSENSOR.equals(getType()); } /** @@ -297,7 +278,7 @@ public boolean isTypePushButtonSensor() { * @return */ public boolean isTypeDimmerActuator() { - return getType().equals(TYPE_DIMMERACTUATOR); + return TYPE_DIMMERACTUATOR.equals(getType()); } /** @@ -306,7 +287,7 @@ public boolean isTypeDimmerActuator() { * @return */ public boolean isTypeRollerShutterActuator() { - return getType().equals(TYPE_ROLLERSHUTTERACTUATOR); + return TYPE_ROLLERSHUTTERACTUATOR.equals(getType()); } /** @@ -315,7 +296,7 @@ public boolean isTypeRollerShutterActuator() { * @return */ public boolean isTypeEnergyConsumptionSensor() { - return getType().equals(TYPE_ENERGYCONSUMPTIONSENSOR); + return TYPE_ENERGYCONSUMPTIONSENSOR.equals(getType()); } /** @@ -324,7 +305,7 @@ public boolean isTypeEnergyConsumptionSensor() { * @return */ public boolean isTypePowerConsumptionSensor() { - return getType().equals(TYPE_POWERCONSUMPTIONSENSOR); + return TYPE_POWERCONSUMPTIONSENSOR.equals(getType()); } /** @@ -333,7 +314,7 @@ public boolean isTypePowerConsumptionSensor() { * @return */ public boolean isTypeGenerationMeterEnergySensor() { - return getType().equals(TYPE_GENERATIONMETERENERGYSENSOR); + return TYPE_GENERATIONMETERENERGYSENSOR.equals(getType()); } /** @@ -342,7 +323,7 @@ public boolean isTypeGenerationMeterEnergySensor() { * @return */ public boolean isTypeGenerationMeterPowerConsumptionSensor() { - return getType().equals(TYPE_GENERATIONMETERPOWERCONSUMPTIONSENSOR); + return TYPE_GENERATIONMETERPOWERCONSUMPTIONSENSOR.equals(getType()); } /** @@ -351,7 +332,7 @@ public boolean isTypeGenerationMeterPowerConsumptionSensor() { * @return */ public boolean isTypeTwoWayMeterEnergyConsumptionSensor() { - return getType().equals(TYPE_TWOWAYMETERENERGYCONSUMPTIONSENSOR); + return TYPE_TWOWAYMETERENERGYCONSUMPTIONSENSOR.equals(getType()); } /** @@ -360,7 +341,7 @@ public boolean isTypeTwoWayMeterEnergyConsumptionSensor() { * @return */ public boolean isTypeTwoWayMeterEnergyFeedSensor() { - return getType().equals(TYPE_TWOWAYMETERENERGYFEEDSENSOR); + return TYPE_TWOWAYMETERENERGYFEEDSENSOR.equals(getType()); } /** @@ -369,6 +350,6 @@ public boolean isTypeTwoWayMeterEnergyFeedSensor() { * @return */ public boolean isTypeTwoWayMeterPowerConsumptionSensor() { - return getType().equals(TYPE_TWOWAYMETERPOWERCONSUMPTIONSENSOR); + return TYPE_TWOWAYMETERPOWERCONSUMPTIONSENSOR.equals(getType()); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityConfig.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityConfig.java new file mode 100644 index 0000000000000..5ec8893586112 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityConfig.java @@ -0,0 +1,639 @@ +/** + * 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.innogysmarthome.internal.client.entity.capability; + +/** + * Holds the Capability configuration. + * + * @author Oliver Kuhl - Initial contribution + * + */ +public class CapabilityConfig { + + /** + * Name of the capability + */ + private String name; + + /** + * Specifies if the activity logging is enabled + */ + private Boolean activityLogActive; + + /** + * Specifies if the activity logging is enabled + */ + private Integer pushButtons; + + /** + * The valve index + */ + private Integer valveIndex; + + /** + * The valve type + */ + private String valveType; + + /** + * The valve control mode: Heating or Cooling + */ + private String controlMode; + + /** + * Dimmer: Programmed on the device as maximum/minimum and not used for UI representation + */ + private Integer technicalMaxValue; + + /** + * Dimmer: Programmed on the device as maximum/minimum and not used for UI representation + */ + private Integer technicalMinValue; + + /** + * Rollershutter: How long it takes for the shutter to open completely when it's completely closed (in tenth of + * second) + */ + private Integer timeFullUp; + + /** + * Rollershutter: How long it takes for the shutter to close completely when it's completely open (in tenth of + * second) + */ + private Integer timeFullDown; + + /** + * Rollershutter: Flag indicating the ISR is in the calibration mode or not. + */ + private Boolean isCalibrating; + + /** + * Switchactuator: + * "different types of current sensing behavior the ISS can have: + * Enabled - Factory default value, current sensing is enabled; (default) + * DisabledNormal - Current sensing disabled, uses output 1; + * DisabledReversed - Current sensing disabled, uses output 2" + */ + private String sensingBehavior; + + /** + * Thermostatactuator: The max temperature + */ + private Double maxTemperature; + + /** + * Thermostatactuator: The min temperature + */ + private Double minTemperature; + + /** + * Thermostatactuator: Indicating whether the device is locked + */ + private Boolean childLock; + + /** + * Thermostatactuator: The window open temperature + */ + private Double windowOpenTemperature; + + /** + * Thermostatactuator: default PointTemperature + */ + private String vRCCSetPoint; + + /** + * Temperaturesensor: Indicating whether the device has freeze protection activated + */ + private Boolean isFreezeProtectionActivated; + + /** + * Temperaturesensor: The freeze protection temperature, default 6 °C + */ + private Double freezeProtection; + + /** + * Temperaturesensor: default Temperature + */ + private String vRCCTemperature; + + /** + * HumiditySensor: Indicating whether the device has mold protection activated + */ + private Boolean isMoldProtectionActivated; + + /** + * HumiditySensor: The humidity mold protection + */ + private Double humidityMoldProtection; + + /** + * HumiditySensor: default Humidity + */ + private String vRCCHumidity; + + /** + * SirenActuator: Alarm Sound Id + */ + private String alarmSoundId; + + /** + * SirenActuator: Notification Sound Id + */ + private String notificationSoundId; + + /** + * SirenActuator: Feedback Sound Id + */ + private String feedbackSoundId; + + /** + * RoomSetPoint/RoomTemperature/RoomHumidity: List of capability ids, which are linked to the VRCC + */ + private String underlyingCapabilityIds; + + /** + * WindowsDoorSensor: Time before the changed status is sent after the window/door is opened (in seconds) + */ + private Integer eventFilterTime; + + /** + * Medion ThermostatActuator: Specifies the temperature threshold that will denote a window open event. 0 = window + * reduction disabled 1-12 = 1/12 °C, 2/12 °C,…, 12/12 °C + */ + private Integer windowOpenThreshold; + + /** + * Medion ThermostatActuator: Duration in minutes for how long after the threshold was overstepped the valve will be + * closed (target temperature = OFF). After the set time, the temperature will jump back to the previous set target + * temperature. + */ + private Integer windowOpenTimer; + + /** + * Medion MotionDetectionSensor sensitivityControl + */ + private Integer sensitivityControl; + + /** + * Medion WindowDoorShockSensor: shockDetectorThreshold + */ + private Integer shockDetectorThreshold; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(final String name) { + this.name = name; + } + + /** + * @return the activityLogActive + */ + public Boolean getActivityLogActive() { + return activityLogActive; + } + + /** + * @param activityLogActive the activityLogActive to set + */ + public void setActivityLogActive(final Boolean activityLogActive) { + this.activityLogActive = activityLogActive; + } + + /** + * @return the pushButtons + */ + public Integer getPushButtons() { + return pushButtons; + } + + /** + * @param pushButtons the pushButtons to set + */ + public void setPushButtons(final Integer pushButtons) { + this.pushButtons = pushButtons; + } + + /** + * @return the valveIndex + */ + public Integer getValveIndex() { + return valveIndex; + } + + /** + * @param valveIndex the valveIndex to set + */ + public void setValveIndex(final Integer valveIndex) { + this.valveIndex = valveIndex; + } + + /** + * @return the valveType + */ + public String getValveType() { + return valveType; + } + + /** + * @param valveType the valveType to set + */ + public void setValveType(final String valveType) { + this.valveType = valveType; + } + + /** + * @return the controlMode + */ + public String getControlMode() { + return controlMode; + } + + /** + * @param controlMode the controlMode to set + */ + public void setControlMode(final String controlMode) { + this.controlMode = controlMode; + } + + /** + * @return the technicalMaxValue + */ + public Integer getTechnicalMaxValue() { + return technicalMaxValue; + } + + /** + * @param technicalMaxValue the technicalMaxValue to set + */ + public void setTechnicalMaxValue(final Integer technicalMaxValue) { + this.technicalMaxValue = technicalMaxValue; + } + + /** + * @return the technicalMinValue + */ + public Integer getTechnicalMinValue() { + return technicalMinValue; + } + + /** + * @param technicalMinValue the technicalMinValue to set + */ + public void setTechnicalMinValue(final Integer technicalMinValue) { + this.technicalMinValue = technicalMinValue; + } + + /** + * @return the timeFullUp + */ + public Integer getTimeFullUp() { + return timeFullUp; + } + + /** + * @param timeFullUp the timeFullUp to set + */ + public void setTimeFullUp(final Integer timeFullUp) { + this.timeFullUp = timeFullUp; + } + + /** + * @return the timeFullDown + */ + public Integer getTimeFullDown() { + return timeFullDown; + } + + /** + * @param timeFullDown the timeFullDown to set + */ + public void setTimeFullDown(final Integer timeFullDown) { + this.timeFullDown = timeFullDown; + } + + /** + * @return the isCalibrating + */ + public Boolean getIsCalibrating() { + return isCalibrating; + } + + /** + * @param isCalibrating the isCalibrating to set + */ + public void setIsCalibrating(final Boolean isCalibrating) { + this.isCalibrating = isCalibrating; + } + + /** + * @return the sensingBehavior + */ + public String getSensingBehavior() { + return sensingBehavior; + } + + /** + * @param sensingBehavior the sensingBehavior to set + */ + public void setSensingBehavior(final String sensingBehavior) { + this.sensingBehavior = sensingBehavior; + } + + /** + * @return the maxTemperature + */ + public Double getMaxTemperature() { + return maxTemperature; + } + + /** + * @param maxTemperature the maxTemperature to set + */ + public void setMaxTemperature(final Double maxTemperature) { + this.maxTemperature = maxTemperature; + } + + /** + * @return the minTemperature + */ + public Double getMinTemperature() { + return minTemperature; + } + + /** + * @param minTemperature the minTemperature to set + */ + public void setMinTemperature(final Double minTemperature) { + this.minTemperature = minTemperature; + } + + /** + * @return the childLock + */ + public Boolean getChildLock() { + return childLock; + } + + /** + * @param childLock the childLock to set + */ + public void setChildLock(final Boolean childLock) { + this.childLock = childLock; + } + + /** + * @return the windowOpenTemperature + */ + public Double getWindowOpenTemperature() { + return windowOpenTemperature; + } + + /** + * @param windowOpenTemperature the windowOpenTemperature to set + */ + public void setWindowOpenTemperature(final Double windowOpenTemperature) { + this.windowOpenTemperature = windowOpenTemperature; + } + + /** + * @return the vRCCSetPoint + */ + public String getvRCCSetPoint() { + return vRCCSetPoint; + } + + /** + * @param vRCCSetPoint the vRCCSetPoint to set + */ + public void setvRCCSetPoint(final String vRCCSetPoint) { + this.vRCCSetPoint = vRCCSetPoint; + } + + /** + * @return the isFreezeProtectionActivated + */ + public Boolean getIsFreezeProtectionActivated() { + return isFreezeProtectionActivated; + } + + /** + * @param isFreezeProtectionActivated the isFreezeProtectionActivated to set + */ + public void setIsFreezeProtectionActivated(final Boolean isFreezeProtectionActivated) { + this.isFreezeProtectionActivated = isFreezeProtectionActivated; + } + + /** + * @return the freezeProtection + */ + public Double getFreezeProtection() { + return freezeProtection; + } + + /** + * @param freezeProtection the freezeProtection to set + */ + public void setFreezeProtection(final Double freezeProtection) { + this.freezeProtection = freezeProtection; + } + + /** + * @return the vRCCTemperature + */ + public String getvRCCTemperature() { + return vRCCTemperature; + } + + /** + * @param vRCCTemperature the vRCCTemperature to set + */ + public void setvRCCTemperature(final String vRCCTemperature) { + this.vRCCTemperature = vRCCTemperature; + } + + /** + * @return the isMoldProtectionActivated + */ + public Boolean getIsMoldProtectionActivated() { + return isMoldProtectionActivated; + } + + /** + * @param isMoldProtectionActivated the isMoldProtectionActivated to set + */ + public void setIsMoldProtectionActivated(final Boolean isMoldProtectionActivated) { + this.isMoldProtectionActivated = isMoldProtectionActivated; + } + + /** + * @return the humidityMoldProtection + */ + public Double getHumidityMoldProtection() { + return humidityMoldProtection; + } + + /** + * @param humidityMoldProtection the humidityMoldProtection to set + */ + public void setHumidityMoldProtection(final Double humidityMoldProtection) { + this.humidityMoldProtection = humidityMoldProtection; + } + + /** + * @return the vRCCHumidity + */ + public String getvRCCHumidity() { + return vRCCHumidity; + } + + /** + * @param vRCCHumidity the vRCCHumidity to set + */ + public void setvRCCHumidity(final String vRCCHumidity) { + this.vRCCHumidity = vRCCHumidity; + } + + /** + * @return the alarmSoundId + */ + public String getAlarmSoundId() { + return alarmSoundId; + } + + /** + * @param alarmSoundId the alarmSoundId to set + */ + public void setAlarmSoundId(final String alarmSoundId) { + this.alarmSoundId = alarmSoundId; + } + + /** + * @return the notificationSoundId + */ + public String getNotificationSoundId() { + return notificationSoundId; + } + + /** + * @param notificationSoundId the notificationSoundId to set + */ + public void setNotificationSoundId(final String notificationSoundId) { + this.notificationSoundId = notificationSoundId; + } + + /** + * @return the feedbackSoundId + */ + public String getFeedbackSoundId() { + return feedbackSoundId; + } + + /** + * @param feedbackSoundId the feedbackSoundId to set + */ + public void setFeedbackSoundId(final String feedbackSoundId) { + this.feedbackSoundId = feedbackSoundId; + } + + /** + * @return the underlyingCapabilityIds + */ + public String getUnderlyingCapabilityIds() { + return underlyingCapabilityIds; + } + + /** + * @param underlyingCapabilityIds the underlyingCapabilityIds to set + */ + public void setUnderlyingCapabilityIds(final String underlyingCapabilityIds) { + this.underlyingCapabilityIds = underlyingCapabilityIds; + } + + /** + * @return the eventFilterTime + */ + public Integer getEventFilterTime() { + return eventFilterTime; + } + + /** + * @param eventFilterTime the eventFilterTime to set + */ + public void setEventFilterTime(final Integer eventFilterTime) { + this.eventFilterTime = eventFilterTime; + } + + /** + * @return the windowOpenThreshold + */ + public Integer getWindowOpenThreshold() { + return windowOpenThreshold; + } + + /** + * @param windowOpenThreshold the windowOpenThreshold to set + */ + public void setWindowOpenThreshold(final Integer windowOpenThreshold) { + this.windowOpenThreshold = windowOpenThreshold; + } + + /** + * @return the windowOpenTimer + */ + public Integer getWindowOpenTimer() { + return windowOpenTimer; + } + + /** + * @param windowOpenTimer the windowOpenTimer to set + */ + public void setWindowOpenTimer(final Integer windowOpenTimer) { + this.windowOpenTimer = windowOpenTimer; + } + + /** + * @return the sensitivityControl + */ + public Integer getSensitivityControl() { + return sensitivityControl; + } + + /** + * @param sensitivityControl the sensitivityControl to set + */ + public void setSensitivityControl(final Integer sensitivityControl) { + this.sensitivityControl = sensitivityControl; + } + + /** + * @return the shockDetectorThreshold + */ + public Integer getShockDetectorThreshold() { + return shockDetectorThreshold; + } + + /** + * @param shockDetectorThreshold the shockDetectorThreshold to set + */ + public void setShockDetectorThreshold(final Integer shockDetectorThreshold) { + this.shockDetectorThreshold = shockDetectorThreshold; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityState.java new file mode 100644 index 0000000000000..9c280a234f62f --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/CapabilityState.java @@ -0,0 +1,407 @@ +/** + * 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.innogysmarthome.internal.client.entity.capability; + +/** + * Defines the {@link CapabilityState}, that holds the state of a {@link Capability}, e.g. a temperature. + * + * @author Oliver Kuhl - Initial contribution + */ +public class CapabilityState { + + public static final String STATE_VALUE_OPERATION_MODE_AUTO = "Auto"; + public static final String STATE_VALUE_OPERATION_MODE_MANUAL = "Manu"; + + /** + * id of the {@link Capability} + */ + private String id; + + /** + * class containing all states + */ + private State state; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(final String id) { + this.id = id; + } + + /** + * @return the state + */ + public State getState() { + return state; + } + + /** + * @param state the state to set + */ + public void setState(final State state) { + this.state = state; + } + + public Boolean getVariableActuatorState() { + return getState().getValueState().getValue(); + } + + public void setVariableActuatorState(final Boolean on) { + getState().getValueState().setValue(on); + } + + public Boolean getSwitchActuatorState() { + return getState().getOnState().getValue(); + } + + public void setSwitchActuatorState(final Boolean on) { + getState().getOnState().setValue(on); + } + + public Double getTemperatureSensorTemperatureState() { + return getState().getTemperatureState().getValue(); + } + + public void setTemperatureSensorTemperatureState(final Double temperature) { + getState().getTemperatureState().setValue(temperature); + } + + public Boolean getTemperatureSensorFrostWarningState() { + return getState().getFrostWarningState().getValue(); + } + + public void setTemperatureSensorFrostWarningState(final Boolean frostWarning) { + getState().getFrostWarningState().setValue(frostWarning); + } + + public Double getThermostatActuatorPointTemperatureState() { + return getState().getPointTemperatureState().getValue(); + } + + public void setThermostatActuatorPointTemperatureState(final Double pointTemperature) { + getState().getPointTemperatureState().setValue(pointTemperature); + } + + public String getThermostatActuatorOperationModeState() { + return getState().getOperationModeState().getValue(); + } + + public void setThermostatActuatorOperationModeState(final String operationMode) { + getState().getOperationModeState() + .setValue(STATE_VALUE_OPERATION_MODE_MANUAL.equals(operationMode) ? STATE_VALUE_OPERATION_MODE_MANUAL + : STATE_VALUE_OPERATION_MODE_AUTO); + } + + public Boolean getThermostatActuatorWindowReductionActiveState() { + return getState().getWindowReductionActiveState().getValue(); + } + + public void setThermostatActuatorWindowReductionActiveState(final Boolean windowReductionActive) { + getState().getWindowReductionActiveState().setValue(windowReductionActive); + } + + public Double getHumiditySensorHumidityState() { + return getState().getHumidityState().getValue(); + } + + public void setHumiditySensorHumidityState(final Double humidity) { + getState().getHumidityState().setValue(humidity); + } + + public Boolean getHumiditySensorMoldWarningState() { + return getState().getMoldWarningState().getValue(); + } + + public void setHumiditySensorMoldWarningState(final Boolean moldWarning) { + getState().getMoldWarningState().setValue(moldWarning); + } + + public Boolean getWindowDoorSensorState() { + return getState().getIsOpenState().getValue(); + } + + public void setWindowDoorSensorState(final Boolean open) { + getState().getIsOpenState().setValue(open); + } + + public Boolean getSmokeDetectorSensorState() { + return getState().getIsSmokeAlarmState().getValue(); + } + + public void setSmokeDetectorSensorState(final Boolean on) { + getState().getIsSmokeAlarmState().setValue(on); + } + + public Boolean getAlarmActuatorState() { + return getState().getOnState().getValue(); + } + + public void setAlarmActuatorState(final Boolean on) { + getState().getOnState().setValue(on); + } + + public Integer getMotionDetectionSensorState() { + return getState().getMotionDetectedCountState().getValue(); + } + + public void setMotionDetectionSensorState(final Integer numberOfMotions) { + getState().getMotionDetectedCountState().setValue(numberOfMotions); + } + + public Double getLuminanceSensorState() { + return getState().getLuminanceState().getValue(); + } + + public void setLuminanceSensorState(final Double luminance) { + getState().getLuminanceState().setValue(luminance); + } + + public Integer getPushButtonSensorCounterState() { + return getState().getLastKeyPressCounterState().getValue(); + } + + public void setPushButtonSensorCounterState(final Integer numberOfPresses) { + getState().getLastKeyPressCounterState().setValue(numberOfPresses); + } + + public Integer getPushButtonSensorButtonIndexState() { + return getState().getLastPressedButtonIndex().getValue(); + } + + public void setPushButtonSensorButtonIndexState(final Integer buttonIndex) { + getState().getLastPressedButtonIndex().setValue(buttonIndex); + } + + public String getPushButtonSensorButtonIndexType() { + return getState().getLastKeyPressType().getValue(); + } + + public void setPushButtonSensorButtonIndexType(String lastKeyPressType) { + getState().getLastKeyPressType().setValue(lastKeyPressType); + } + + public Integer getDimmerActuatorState() { + return getState().getDimLevelState().getValue(); + } + + public void setDimmerActuatorState(final Integer DimLevel) { + getState().getDimLevelState().setValue(DimLevel); + } + + public Integer getRollerShutterActuatorState() { + return getState().getShutterLevelState().getValue(); + } + + public void setRollerShutterActuatorState(final Integer rollerShutterLevel) { + getState().getShutterLevelState().setValue(rollerShutterLevel); + } + + // ENERGY CONSUMPTION SENSOR + public Double getEnergyConsumptionSensorEnergyConsumptionMonthKWhState() { + return getState().getEnergyConsumptionMonthKWhState().getValue(); + } + + public void setEnergyConsumptionSensorEnergyConsumptionMonthKWhState(final Double state) { + getState().getEnergyConsumptionMonthKWhState().setValue(state); + } + + public Double getEnergyConsumptionSensorAbsoluteEnergyConsumptionState() { + return getState().getAbsoluteEnergyConsumptionState().getValue(); + } + + public void setEnergyConsumptionSensorAbsoluteEnergyConsumptionState(final Double state) { + getState().getAbsoluteEnergyConsumptionState().setValue(state); + } + + public Double getEnergyConsumptionSensorEnergyConsumptionMonthEuroState() { + return getState().getEnergyConsumptionMonthEuroState().getValue(); + } + + public void setEnergyConsumptionSensorEnergyConsumptionMonthEuroState(final Double state) { + getState().getEnergyConsumptionMonthEuroState().setValue(state); + } + + public Double getEnergyConsumptionSensorEnergyConsumptionDayEuroState() { + return getState().getEnergyConsumptionDayEuroState().getValue(); + } + + public void setEnergyConsumptionSensorEnergyConsumptionDayEuroState(final Double state) { + getState().getEnergyConsumptionDayEuroState().setValue(state); + } + + public Double getEnergyConsumptionSensorEnergyConsumptionDayKWhState() { + return getState().getEnergyConsumptionDayKWhState().getValue(); + } + + public void setEnergyConsumptionSensorEnergyConsumptionDayKWhState(final Double state) { + getState().getEnergyConsumptionDayKWhState().setValue(state); + } + + // POWER CONSUMPTION SENSOR + public Double getPowerConsumptionSensorPowerConsumptionWattState() { + return getState().getPowerConsumptionWattState().getValue(); + } + + public void setPowerConsumptionSensorPowerConsumptionWattState(final Double state) { + getState().getPowerConsumptionWattState().setValue(state); + } + + // GENERATION METER ENGERY SENSOR + public Double getGenerationMeterEnergySensorEnergyPerMonthInKWhState() { + return getState().getEnergyPerMonthInKWhState().getValue(); + } + + public void setGenerationMeterEnergySensorEnergyPerMonthInKWhState(final Double state) { + getState().getEnergyPerMonthInKWhState().setValue(state); + } + + public Double getGenerationMeterEnergySensorTotalEnergyState() { + return getState().getTotalEnergyState().getValue(); + } + + public void setGenerationMeterEnergySensorTotalEnergyState(final Double state) { + getState().getTotalEnergyState().setValue(state); + } + + public Double getGenerationMeterEnergySensorEnergyPerMonthInEuroState() { + return getState().getEnergyPerMonthInEuroState().getValue(); + } + + public void setGenerationMeterEnergySensorEnergyPerMonthInEuroState(final Double state) { + getState().getEnergyPerMonthInEuroState().setValue(state); + } + + public Double getGenerationMeterEnergySensorEnergyPerDayInEuroState() { + return getState().getEnergyPerDayInEuroState().getValue(); + } + + public void setGenerationMeterEnergySensorEnergyPerDayInEuroState(final Double state) { + getState().getEnergyPerDayInEuroState().setValue(state); + } + + public Double getGenerationMeterEnergySensorEnergyPerDayInKWhState() { + return getState().getEnergyPerDayInKWhState().getValue(); + } + + public void setGenerationMeterEnergySensorEnergyPerDayInKWhState(final Double state) { + getState().getEnergyPerDayInKWhState().setValue(state); + } + + // GENERATION METER POWER CONSUMPTION SENSOR + public Double getGenerationMeterPowerConsumptionSensorPowerInWattState() { + return getState().getPowerInWattState().getValue(); + } + + public void setGenerationMeterPowerConsumptionSensorPowerInWattState(final Double state) { + getState().getPowerInWattState().setValue(state); + } + + // TWO WAY METER ENERGY CONSUMPTION SENSOR + public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState() { + return getState().getEnergyPerMonthInKWhState().getValue(); + } + + public void setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState(final Double state) { + getState().getEnergyPerMonthInKWhState().setValue(state); + } + + public Double getTwoWayMeterEnergyConsumptionSensorTotalEnergyState() { + return getState().getTotalEnergyState().getValue(); + } + + public void setTwoWayMeterEnergyConsumptionSensorTotalEnergyState(final Double state) { + getState().getTotalEnergyState().setValue(state); + } + + public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState() { + return getState().getEnergyPerMonthInEuroState().getValue(); + } + + public void setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState(final Double state) { + getState().getEnergyPerMonthInEuroState().setValue(state); + } + + public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState() { + return getState().getEnergyPerDayInEuroState().getValue(); + } + + public void setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState(final Double state) { + getState().getEnergyPerDayInEuroState().setValue(state); + } + + public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState() { + return getState().getEnergyPerDayInKWhState().getValue(); + } + + public void setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState(final Double state) { + getState().getEnergyPerDayInKWhState().setValue(state); + } + + // TWO WAY METER ENERGY FEED SENSOR + public Double getTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState() { + return getState().getEnergyPerMonthInKWhState().getValue(); + } + + public void setTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState(final Double state) { + getState().getEnergyPerMonthInKWhState().setValue(state); + } + + public Double getTwoWayMeterEnergyFeedSensorTotalEnergyState() { + return getState().getTotalEnergyState().getValue(); + } + + public void setTwoWayMeterEnergyFeedSensorTotalEnergyState(final Double state) { + getState().getTotalEnergyState().setValue(state); + } + + public Double getTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState() { + return getState().getEnergyPerMonthInEuroState().getValue(); + } + + public void setTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState(final Double state) { + getState().getEnergyPerMonthInEuroState().setValue(state); + } + + public Double getTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState() { + return getState().getEnergyPerDayInEuroState().getValue(); + } + + public void setTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState(final Double state) { + getState().getEnergyPerDayInEuroState().setValue(state); + } + + public Double getTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState() { + return getState().getEnergyPerDayInKWhState().getValue(); + } + + public void setTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState(final Double state) { + getState().getEnergyPerDayInKWhState().setValue(state); + } + + // TWO WAY METER POWER CONSUMPTION SENSOR + public Double getTwoWayMeterPowerConsumptionSensorPowerInWattState() { + return getState().getPowerInWattState().getValue(); + } + + public void setTwoWayMeterPowerConsumptionSensorPowerInWattState(final Double state) { + getState().getPowerInWattState().setValue(state); + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/State.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/State.java new file mode 100644 index 0000000000000..b89f096095e4b --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/capability/State.java @@ -0,0 +1,757 @@ +/** + * 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.innogysmarthome.internal.client.entity.capability; + +import org.openhab.binding.innogysmarthome.internal.client.entity.state.BooleanState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.DateTimeState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.DoubleState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.IntegerState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.StringState; + +import com.google.gson.annotations.SerializedName; + +/** + * Holds the Capability state. + * + * @author Oliver Kuhl - Initial contribution + * + */ +public class State { + + @SerializedName("absoluteEnergyConsumption") + private DoubleState absoluteEnergyConsumptionState; + + @SerializedName("activeChannel") + private StringState activeChannelState; + + @SerializedName("dimLevel") + private IntegerState dimLevelState; + + @SerializedName("energyConsumptionDayEuro") + private DoubleState energyConsumptionDayEuroState; + + @SerializedName("energyConsumptionDayKWh") + private DoubleState energyConsumptionDayKWhState; + + @SerializedName("energyConsumptionMonthEuro") + private DoubleState energyConsumptionMonthEuroState; + + @SerializedName("energyConsumptionMonthKWh") + private DoubleState energyConsumptionMonthKWhState; + + @SerializedName("energyPerDayInEuro") + private DoubleState energyPerDayInEuroState; + + @SerializedName("energyPerDayInKWh") + private DoubleState energyPerDayInKWhState; + + @SerializedName("energyPerMonthInEuro") + private DoubleState energyPerMonthInEuroState; + + @SerializedName("energyPerMonthInKWh") + private DoubleState energyPerMonthInKWhState; + + @SerializedName("frostWarning") + private BooleanState frostWarningState; + + @SerializedName("humidity") + private DoubleState humidityState; + + @SerializedName("isDay") + private BooleanState isDayState; + + @SerializedName("isOn") + private BooleanState isOnState; + + @SerializedName("isOpen") + private BooleanState isOpenState; + + @SerializedName("isSmokeAlarm") + private BooleanState isSmokeAlarmState; + + @SerializedName("lastKeyPressCounter") + private IntegerState lastKeyPressCounterState; + + @SerializedName("lastPressedButtonIndex") + private IntegerState lastPressedButtonIndex; + + private StringState lastPressedButtonIndexState; + + @SerializedName("luminance") + private DoubleState luminanceState; + + @SerializedName("moldWarning") + private BooleanState moldWarningState; + + @SerializedName("motionDetectedCount") + private IntegerState motionDetectedCountState; + + @SerializedName("nextSunrise") + private DateTimeState nextSunrise; + + @SerializedName("nextSunset") + private DateTimeState nextSunsetState; + + @SerializedName("nextTimeEvent") + private DateTimeState nextTimeEventState; + + @SerializedName("onState") + private BooleanState onState; + + @SerializedName("operationMode") + private StringState operationModeState; + + @SerializedName("pointTemperature") + private DoubleState pointTemperatureState; + + @SerializedName("powerConsumptionWatt") + private DoubleState powerConsumptionWattState; + + @SerializedName("powerInWatt") + private DoubleState powerInWattState; + + @SerializedName("shutterLevel") + private IntegerState shutterLevelState; + + @SerializedName("supplyValueInCubicMetterPerDay") + private DoubleState supplyValueInCubicMetterPerDayState; + + @SerializedName("supplyValueInCubicMetterPerMonth") + private DoubleState supplyValueInCubicMetterPerMonthState; + + @SerializedName("supplyValueInCurrencyPerDay") + private DoubleState supplyValueInCurrencyPerDayState; + + @SerializedName("supplyValueInCurrencyPerMonth") + private DoubleState supplyValueInCurrencyPerMonthState; + + @SerializedName("supplyValueInLitrePerDay") + private DoubleState supplyValueInLitrePerDayState; + + @SerializedName("supplyValueInLitrePerMonth") + private DoubleState supplyValueInLitrePerMonthState; + + @SerializedName("temperature") + private DoubleState temperatureState; + + @SerializedName("totalEnergy") + private DoubleState totalEnergyState; + + @SerializedName("value") + private BooleanState valueState; + + @SerializedName("valvePosition") + private BooleanState valvePositionState; + + @SerializedName("windowReductionActive") + private BooleanState windowReductionActiveState; + + /** + * @return the absoluteEnergyConsumptionState + */ + public DoubleState getAbsoluteEnergyConsumptionState() { + return absoluteEnergyConsumptionState; + } + + /** + * @param state the absoluteEnergyConsumptionState to set + */ + public void setAbsoluteEnergyConsumptionState(DoubleState state) { + this.absoluteEnergyConsumptionState = state; + } + + /** + * @return the activeChannelState + */ + public StringState getActiveChannelState() { + return activeChannelState; + } + + /** + * @param state the activeChannelState to set + */ + public void setActiveChannelState(StringState state) { + this.activeChannelState = state; + } + + /** + * @return the dimLevelState + */ + public IntegerState getDimLevelState() { + return dimLevelState; + } + + /** + * @param state the dimLevelState to set + */ + public void setDimLevelState(IntegerState state) { + this.dimLevelState = state; + } + + /** + * @return the energyConsumptionDayEuroState + */ + public DoubleState getEnergyConsumptionDayEuroState() { + return energyConsumptionDayEuroState; + } + + /** + * @param state the energyConsumptionDayEuroState to set + */ + public void setEnergyConsumptionDayEuroState(DoubleState state) { + this.energyConsumptionDayEuroState = state; + } + + /** + * @return the energyConsumptionDayKWhState + */ + public DoubleState getEnergyConsumptionDayKWhState() { + return energyConsumptionDayKWhState; + } + + /** + * @param state the energyConsumptionDayKWhState to set + */ + public void setEnergyConsumptionDayKWhState(DoubleState state) { + this.energyConsumptionDayKWhState = state; + } + + /** + * @return the energyConsumptionMonthEuroState + */ + public DoubleState getEnergyConsumptionMonthEuroState() { + return energyConsumptionMonthEuroState; + } + + /** + * @param state the energyConsumptionMonthEuroState to set + */ + public void setEnergyConsumptionMonthEuroState(DoubleState state) { + this.energyConsumptionMonthEuroState = state; + } + + /** + * @return the energyConsumptionMonthKWhState + */ + public DoubleState getEnergyConsumptionMonthKWhState() { + return energyConsumptionMonthKWhState; + } + + /** + * @param state the energyConsumptionMonthKWhState to set + */ + public void setEnergyConsumptionMonthKWhState(DoubleState state) { + this.energyConsumptionMonthKWhState = state; + } + + /** + * @return the energyPerDayInEuroState + */ + public DoubleState getEnergyPerDayInEuroState() { + return energyPerDayInEuroState; + } + + /** + * @param state the energyPerDayInEuroState to set + */ + public void setEnergyPerDayInEuroState(DoubleState state) { + this.energyPerDayInEuroState = state; + } + + /** + * @return the energyPerDayInKWhState + */ + public DoubleState getEnergyPerDayInKWhState() { + return energyPerDayInKWhState; + } + + /** + * @param state the energyPerDayInKWhState to set + */ + public void setEnergyPerDayInKWhState(DoubleState state) { + this.energyPerDayInKWhState = state; + } + + /** + * @return the energyPerMonthInEuroState + */ + public DoubleState getEnergyPerMonthInEuroState() { + return energyPerMonthInEuroState; + } + + /** + * @param state the energyPerMonthInEuroState to set + */ + public void setEnergyPerMonthInEuroState(DoubleState state) { + this.energyPerMonthInEuroState = state; + } + + /** + * @return the energyPerMonthInKWhState + */ + public DoubleState getEnergyPerMonthInKWhState() { + return energyPerMonthInKWhState; + } + + /** + * @param state the energyPerMonthInKWhState to set + */ + public void setEnergyPerMonthInKWhState(DoubleState state) { + this.energyPerMonthInKWhState = state; + } + + /** + * @return the frostWarningState + */ + public BooleanState getFrostWarningState() { + return frostWarningState; + } + + /** + * @param state the frostWarningState to set + */ + public void setFrostWarningState(BooleanState state) { + this.frostWarningState = state; + } + + /** + * @return the humidityState + */ + public DoubleState getHumidityState() { + return humidityState; + } + + /** + * @param state the humidityState to set + */ + public void setHumidityState(DoubleState state) { + this.humidityState = state; + } + + /** + * @return the isDayState + */ + public BooleanState getIsDayState() { + return isDayState; + } + + /** + * @param state the isDayState to set + */ + public void setIsDayState(BooleanState state) { + this.isDayState = state; + } + + /** + * @return the isOnState + */ + public BooleanState getIsOnState() { + return isOnState; + } + + /** + * @param state the isOnState to set + */ + public void setIsOnState(BooleanState state) { + this.isOnState = state; + } + + /** + * @return the isOpenState + */ + public BooleanState getIsOpenState() { + return isOpenState; + } + + /** + * @param state the isOpenState to set + */ + public void setIsOpenState(BooleanState state) { + this.isOpenState = state; + } + + /** + * @return the isSmokeAlarmState + */ + public BooleanState getIsSmokeAlarmState() { + return isSmokeAlarmState; + } + + /** + * @param state the isSmokeAlarmState to set + */ + public void setIsSmokeAlarmState(BooleanState state) { + this.isSmokeAlarmState = state; + } + + /** + * @return the lastKeyPressCounterState + */ + public IntegerState getLastKeyPressCounterState() { + return lastKeyPressCounterState; + } + + /** + * @param state the lastKeyPressCounterState to set + */ + public void setLastKeyPressCounterState(IntegerState state) { + this.lastKeyPressCounterState = state; + } + + /** + * @return the lastPressedButtonIndex + */ + public IntegerState getLastPressedButtonIndex() { + return lastPressedButtonIndex; + } + + /** + * @param state the lastPressedButtonIndex to set + */ + public void setLastPressedButtonIndex(IntegerState state) { + this.lastPressedButtonIndex = state; + } + + public StringState getLastKeyPressType() { + if (lastPressedButtonIndexState == null) { + lastPressedButtonIndexState = new StringState(); + } + return lastPressedButtonIndexState; + } + + public void setLastKeyPressType(StringState lastPressedButtonIndexState) { + this.lastPressedButtonIndexState = lastPressedButtonIndexState; + } + + /** + * @return the luminanceState + */ + public DoubleState getLuminanceState() { + return luminanceState; + } + + /** + * @param state the luminanceState to set + */ + public void setLuminanceState(DoubleState state) { + this.luminanceState = state; + } + + /** + * @return the moldWarningState + */ + public BooleanState getMoldWarningState() { + return moldWarningState; + } + + /** + * @param state the moldWarningState to set + */ + public void setMoldWarningState(BooleanState state) { + this.moldWarningState = state; + } + + /** + * @return the motionDetectedCountState + */ + public IntegerState getMotionDetectedCountState() { + return motionDetectedCountState; + } + + /** + * @param state the motionDetectedCountState to set + */ + public void setMotionDetectedCountState(IntegerState state) { + this.motionDetectedCountState = state; + } + + /** + * @return the nextSunrise + */ + public DateTimeState getNextSunrise() { + return nextSunrise; + } + + /** + * @param state the nextSunrise to set + */ + public void setNextSunrise(DateTimeState state) { + this.nextSunrise = state; + } + + /** + * @return the nextSunsetState + */ + public DateTimeState getNextSunsetState() { + return nextSunsetState; + } + + /** + * @param state the nextSunsetState to set + */ + public void setNextSunsetState(DateTimeState state) { + this.nextSunsetState = state; + } + + /** + * @return the nextTimeEventState + */ + public DateTimeState getNextTimeEventState() { + return nextTimeEventState; + } + + /** + * @param state the nextTimeEventState to set + */ + public void setNextTimeEventState(DateTimeState state) { + this.nextTimeEventState = state; + } + + /** + * @return the onState + */ + public BooleanState getOnState() { + return onState; + } + + /** + * @param state the onState to set + */ + public void setOnState(BooleanState state) { + this.onState = state; + } + + /** + * @return the operationModeState + */ + public StringState getOperationModeState() { + return operationModeState; + } + + /** + * @param state the operationModeState to set + */ + public void setOperationModeState(StringState state) { + this.operationModeState = state; + } + + /** + * @return the pointTemperatureState + */ + public DoubleState getPointTemperatureState() { + return pointTemperatureState; + } + + /** + * @param state the pointTemperatureState to set + */ + public void setPointTemperatureState(DoubleState state) { + this.pointTemperatureState = state; + } + + /** + * @return the powerConsumptionWattState + */ + public DoubleState getPowerConsumptionWattState() { + return powerConsumptionWattState; + } + + /** + * @param state the powerConsumptionWattState to set + */ + public void setPowerConsumptionWattState(DoubleState state) { + this.powerConsumptionWattState = state; + } + + /** + * @return the powerInWattState + */ + public DoubleState getPowerInWattState() { + return powerInWattState; + } + + /** + * @param state the powerInWattState to set + */ + public void setPowerInWattState(DoubleState state) { + this.powerInWattState = state; + } + + /** + * @return the shutterLevelState + */ + public IntegerState getShutterLevelState() { + return shutterLevelState; + } + + /** + * @param state the shutterLevelState to set + */ + public void setShutterLevelState(IntegerState state) { + this.shutterLevelState = state; + } + + /** + * @return the supplyValueInCubicMetterPerDayState + */ + public DoubleState getSupplyValueInCubicMetterPerDayState() { + return supplyValueInCubicMetterPerDayState; + } + + /** + * @param state the supplyValueInCubicMetterPerDayState to set + */ + public void setSupplyValueInCubicMetterPerDayState(DoubleState state) { + this.supplyValueInCubicMetterPerDayState = state; + } + + /** + * @return the supplyValueInCubicMetterPerMonthState + */ + public DoubleState getSupplyValueInCubicMetterPerMonthState() { + return supplyValueInCubicMetterPerMonthState; + } + + /** + * @param state the supplyValueInCubicMetterPerMonthState to set + */ + public void setSupplyValueInCubicMetterPerMonthState(DoubleState state) { + this.supplyValueInCubicMetterPerMonthState = state; + } + + /** + * @return the supplyValueInCurrencyPerDayState + */ + public DoubleState getSupplyValueInCurrencyPerDayState() { + return supplyValueInCurrencyPerDayState; + } + + /** + * @param state the supplyValueInCurrencyPerDayState to set + */ + public void setSupplyValueInCurrencyPerDayState(DoubleState state) { + this.supplyValueInCurrencyPerDayState = state; + } + + /** + * @return the supplyValueInCurrencyPerMonthState + */ + public DoubleState getSupplyValueInCurrencyPerMonthState() { + return supplyValueInCurrencyPerMonthState; + } + + /** + * @param state the supplyValueInCurrencyPerMonthState to set + */ + public void setSupplyValueInCurrencyPerMonthState(DoubleState state) { + this.supplyValueInCurrencyPerMonthState = state; + } + + /** + * @return the supplyValueInLitrePerDayState + */ + public DoubleState getSupplyValueInLitrePerDayState() { + return supplyValueInLitrePerDayState; + } + + /** + * @param state the supplyValueInLitrePerDayState to set + */ + public void setSupplyValueInLitrePerDayState(DoubleState state) { + this.supplyValueInLitrePerDayState = state; + } + + /** + * @return the supplyValueInLitrePerMonthState + */ + public DoubleState getSupplyValueInLitrePerMonthState() { + return supplyValueInLitrePerMonthState; + } + + /** + * @param state the supplyValueInLitrePerMonthState to set + */ + public void setSupplyValueInLitrePerMonthState(DoubleState state) { + this.supplyValueInLitrePerMonthState = state; + } + + /** + * @return the temperatureState + */ + public DoubleState getTemperatureState() { + return temperatureState; + } + + /** + * @param state the temperatureState to set + */ + public void setTemperatureState(DoubleState state) { + this.temperatureState = state; + } + + /** + * @return the totalEnergyState + */ + public DoubleState getTotalEnergyState() { + return totalEnergyState; + } + + /** + * @param state the totalEnergyState to set + */ + public void setTotalEnergyState(DoubleState state) { + this.totalEnergyState = state; + } + + /** + * @return the valueState + */ + public BooleanState getValueState() { + return valueState; + } + + /** + * @param state the valueState to set + */ + public void setValueState(BooleanState state) { + this.valueState = state; + } + + /** + * @return the valvePositionState + */ + public BooleanState getValvePositionState() { + return valvePositionState; + } + + /** + * @param state the valvePositionState to set + */ + public void setValvePositionState(BooleanState state) { + this.valvePositionState = state; + } + + /** + * @return the windowReductionActiveState + */ + public BooleanState getWindowReductionActiveState() { + return windowReductionActiveState; + } + + /** + * @param state the windowReductionActiveState to set + */ + public void setWindowReductionActiveState(BooleanState state) { + this.windowReductionActiveState = state; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Device.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Device.java index d713414a690f4..a01ae503f44f0 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Device.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,28 +12,25 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity.device; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import org.openhab.binding.innogysmarthome.internal.client.entity.ConfigPropertyList; -import org.openhab.binding.innogysmarthome.internal.client.entity.Location; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; -import org.openhab.binding.innogysmarthome.internal.client.entity.Property; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.CapabilityLink; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; -import org.openhab.binding.innogysmarthome.internal.client.entity.state.DeviceState; +import org.openhab.binding.innogysmarthome.internal.client.entity.location.Location; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; -import com.google.api.client.util.Key; +import com.google.gson.annotations.SerializedName; /** * Defines the structure of a {@link Device}. * * @author Oliver Kuhl - Initial contribution */ -public class Device extends ConfigPropertyList { +public class Device { public static final String DEVICE_TYPE_SHC = "SHC"; + public static final String DEVICE_TYPE_SHCA = "SHCA"; public static final String DEVICE_TYPE_ANALOG_METER = "AnalogMeter"; public static final String DEVICE_TYPE_BRC8 = "BRC8"; public static final String DEVICE_TYPE_GENERATION_METER = "GenerationMeter"; @@ -59,16 +56,20 @@ public class Device extends ConfigPropertyList { public static final String DEVICE_MANUFACTURER_RWE = "RWE"; public static final String DEVICE_MANUFACTURER_INNOGY = "innogy"; + protected static final String PROTOCOL_ID_COSIP = "Cosip"; + protected static final String PROTOCOL_ID_VIRTUAL = "Virtual"; + protected static final String PROTOCOL_ID_WMBUS = "wMBus"; + + public static final List<String> EMPTY_CAPABILITY_LINK_LIST = new ArrayList<String>(); + /** * Unique id for the device, always available in model. */ - @Key("id") private String id; /** * Identifier of the manufacturer, always available in model */ - @Key("manufacturer") private String manufacturer; /** @@ -78,7 +79,6 @@ public class Device extends ConfigPropertyList { * be increased to indicate that there are new or changed attributes * of the device. Always available in model. */ - @Key("version") private String version; /** @@ -88,65 +88,61 @@ public class Device extends ConfigPropertyList { * core.RWE, which supports all RWE hardware devices (also referred to as core devices). * Always available in model. */ - @Key("product") private String product; /** * Device number or id like SGTIN given by the manufacturer. Optional. */ - @Key("serialnumber") private String serialnumber; - /** - * Link to the metadata of that specific device. The link should be complete and can be followed without further - * additions. The triple of device type, manufacturer and version define the unique path to the metadata. - * - * Optional. - */ - @Key("desc") - private String desc; - /** * Specifies the type of the device, which is defined by the manufacturer. The triple of device type, manufacturer * and the version must be unique. * Always available in model. */ - @Key("type") private String type; - private DeviceState deviceState; + private DeviceConfig config; /** - * The tag container can contain any number of properties for grouping of the devices in the client, e.g. category - * of device like “security relatedâ€. The tags can be freely chosen by the client and will not be considered by the - * system for any business logic. + * Contains a list of the device capabilities. * * Optional. */ - @Key("Tags") - private List<Property> tagList; + @SerializedName("capabilities") + private List<String> capabilityLinkList; + + private HashMap<String, Capability> capabilityMap; + + private DeviceState deviceState; /** - * Contains a list of the device capabilities. + * The tag container can contain any number of properties for grouping of the devices in the client, e.g. category + * of device like “security relatedâ€. The tags can be freely chosen by the client and will not be considered by the + * system for any business logic. * * Optional. */ - @Key("Capabilities") - private List<CapabilityLink> capabilityLinkList; - - private HashMap<String, Capability> capabilityMap; + // @Key("tags") + // private List<Property> tagList; /** * The location contains the link to the location of the device. Optional. */ - @Key("Location") - private List<Link> locationLinkList; + @SerializedName("location") + private String locationLink; - private Location location; + private transient Location location; private List<Message> messageList; private boolean lowBattery; + /** + * Stores the message id, that contains the low battery state. This is needed to identify the device, when the + * message + * with that id is deleted (thus low battery state is false again). + */ + private String lowBatteryMessageId; /** * Stores, if the {@link Device} is battery powered. @@ -233,40 +229,36 @@ public boolean hasSerialNumber() { } /** - * Returns a relative link to the description. - * - * @return the desc + * @return the type */ - public String getDescription() { - return desc; + public String getType() { + return type; } /** - * Sets the description. - * - * @param desc the desc to set + * @param type the type to set */ - public void setDescription(String desc) { - this.desc = desc; + public void setType(String type) { + this.type = type; } /** - * @return the type + * @return the config */ - public String getType() { - return type; + public DeviceConfig getConfig() { + return config; } /** - * @param type the type to set + * @param config the config to set */ - public void setType(String type) { - this.type = type; + public void setConfig(DeviceConfig config) { + this.config = config; } /** * Returns the {@link DeviceState}. Only available, if device has a state. Better check with - * {@link Device#hasState()} first! + * {@link Device#hasDeviceState()} first! * * @return the entityState or null */ @@ -286,35 +278,25 @@ public void setDeviceState(DeviceState deviceState) { * * @return */ - public boolean hasState() { + public boolean hasDeviceState() { return deviceState != null; } - /** - * @return the tagList - */ - public List<Property> getTagList() { - return tagList; - } - - /** - * @param tagList the tagList to set - */ - public void setTagList(List<Property> tagList) { - this.tagList = tagList; - } - /** * @return the capabilityList */ - public List<CapabilityLink> getCapabilityLinkList() { - return capabilityLinkList; + public List<String> getCapabilityLinkList() { + if (capabilityLinkList != null) { + return capabilityLinkList; + } else { + return EMPTY_CAPABILITY_LINK_LIST; + } } /** * @param capabilityList the capabilityList to set */ - public void setCapabilityList(List<CapabilityLink> capabilityList) { + public void setCapabilityList(List<String> capabilityList) { this.capabilityLinkList = capabilityList; } @@ -325,6 +307,9 @@ public void setCapabilityMap(HashMap<String, Capability> capabilityMap) { this.capabilityMap = capabilityMap; } + /** + * @return the capabilityMap + */ public HashMap<String, Capability> getCapabilityMap() { return this.capabilityMap; } @@ -340,25 +325,27 @@ public Capability getCapabilityWithId(String id) { } /** - * @return the locationList + * @return the locationLink */ - public List<Link> getLocationLinkList() { - return locationLinkList; + public String getLocationLink() { + return locationLink; } /** * @param locationList the locationList to set */ - public void setLocationList(List<Link> locationList) { - this.locationLinkList = locationList; + public void setLocation(String locationLink) { + this.locationLink = locationLink; } + /** + * Returns the id of the {@link Location} + * + * @return + */ public String getLocationId() { - if (locationLinkList != null) { - Link locationLink = locationLinkList.get(0); - if (locationLink != null) { - return locationLink.getValue().replace("/location/", ""); - } + if (locationLink != null) { + return locationLink.replace("/location/", ""); } return null; } @@ -402,9 +389,9 @@ public List<Message> getMessageList() { public void setMessageList(List<Message> messageList) { this.messageList = messageList; - for (Message m : messageList) { - setLowBattery(m.getType().equals(Message.TYPE_DEVICE_LOW_BATTERY)); - setReachable(!m.getType().equals(Message.TYPE_DEVICE_UNREACHABLE)); + for (final Message m : messageList) { + setLowBattery(Message.TYPE_DEVICE_LOW_BATTERY.equals(m.getType())); + setReachable(!Message.TYPE_DEVICE_UNREACHABLE.equals(m.getType())); } } @@ -414,7 +401,9 @@ public void setMessageList(List<Message> messageList) { * @param isReachable */ public void setReachable(boolean isReachable) { - getDeviceState().setReachable(isReachable); + if (getDeviceState().hasIsReachableState()) { + getDeviceState().setReachable(isReachable); + } } /** @@ -423,7 +412,7 @@ public void setReachable(boolean isReachable) { * @return */ public boolean isReachable() { - return getDeviceState().isReachable(); + return getDeviceState().getState().getIsReachable().getValue(); } /** @@ -444,6 +433,14 @@ public boolean hasLowBattery() { return lowBattery; } + public String getLowBatteryMessageId() { + return this.lowBatteryMessageId; + } + + public void setLowBatteryMessageId(String messageId) { + this.lowBatteryMessageId = messageId; + } + /** * Returns true, if the {@link Device} is battery powered. * @@ -478,7 +475,7 @@ public boolean hasMessages() { * @return */ public boolean isController() { - return DEVICE_TYPE_SHC.equals(type); + return DEVICE_TYPE_SHC.equals(type) || DEVICE_TYPE_SHCA.equals(type); } /** @@ -505,7 +502,7 @@ public boolean isInnogyDevice() { * @return */ public boolean isVirtualDevice() { - return PROTOCOL_ID_VIRTUAL.equals(getProtocolId()); + return PROTOCOL_ID_VIRTUAL.equals(getConfig().getProtocolId()); } /** @@ -514,7 +511,8 @@ public boolean isVirtualDevice() { * @return */ public boolean isRadioDevice() { - return PROTOCOL_ID_COSIP.equals(getProtocolId()) || PROTOCOL_ID_WMBUS.equals(getProtocolId()); + return PROTOCOL_ID_COSIP.equals(getConfig().getProtocolId()) + || PROTOCOL_ID_WMBUS.equals(getConfig().getProtocolId()); } /** @@ -523,7 +521,7 @@ public boolean isRadioDevice() { * @return */ public boolean isCoSipDevice() { - return PROTOCOL_ID_COSIP.equals(getProtocolId()); + return PROTOCOL_ID_COSIP.equals(getConfig().getProtocolId()); } /** @@ -532,14 +530,14 @@ public boolean isCoSipDevice() { * @return */ public boolean isWMBusDevice() { - return PROTOCOL_ID_WMBUS.equals(getProtocolId()); + return PROTOCOL_ID_WMBUS.equals(getConfig().getProtocolId()); } @Override public String toString() { - String string = "Device [" + "id=" + getId() + " manufacturer=" + getManufacturer() + " version=" + getVersion() - + " product=" + getProduct() + " serialnumber=" + getSerialnumber() + " type=" + getType() + " name=" - + getName() + "]"; + final String string = "Device [" + "id=" + getId() + " manufacturer=" + getManufacturer() + " version=" + + getVersion() + " product=" + getProduct() + " serialnumber=" + getSerialnumber() + " type=" + + getType() + " name=" + getConfig().getName() + "]"; return string; } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceConfig.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceConfig.java new file mode 100644 index 0000000000000..b8828c2ba016d --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceConfig.java @@ -0,0 +1,412 @@ +/** + * 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.innogysmarthome.internal.client.entity.device; + +import java.time.ZonedDateTime; + +import org.openhab.binding.innogysmarthome.internal.client.Util; + +import com.google.gson.annotations.SerializedName; + +/** + * Holds the configuration of the Device. + * + * @author Oliver Kuhl - Initial contribution + * + */ +public class DeviceConfig { + private String name; + + private String protocolId; + + private String timeOfAcceptance; + + private String timeOfDiscovery; + + private String hardwareVersion; + + private String softwareVersion; + + private String firmwareVersion; + + private String hostName; + + private boolean activityLogEnabled; + + private String configurationState; + + @SerializedName("IPAddress") + private String ipAddress; + + @SerializedName("MACAddress") + private String macAddress; + + private String registrationTime; + + private String timeZone; + + private String shcType; + + private String geoLocation; + + private Double currentUTCOffset; + + private Boolean backendConnectionMonitored; + + @SerializedName("RFCommFailureNotification") + private Boolean rfCommFailureNotification; + + private String displayCurrentTemperature; + + private String underlyingDeviceIds; + + private String meterId; + + private String meterFirmwareVersion; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the protocolId + */ + public String getProtocolId() { + return protocolId; + } + + /** + * @param protocolId the protocolId to set + */ + public void setProtocolId(String protocolId) { + this.protocolId = protocolId; + } + + /** + * Returns the time, when the {@link Device} was added to the SHC configuration. + * + * @return + */ + public ZonedDateTime getTimeOfAcceptance() { + if (timeOfAcceptance == null) { + return null; + } + return Util.convertZuluTimeStringToDate(timeOfAcceptance); + } + + /** + * @param timeOfAcceptance the timeOfAcceptance to set + */ + public void setTimeOfAcceptance(String timeOfAcceptance) { + this.timeOfAcceptance = timeOfAcceptance; + } + + /** + * Returns the time, when the {@link Device} was discovered by the SHC. + * + * @return + */ + public ZonedDateTime getTimeOfDiscovery() { + if (timeOfDiscovery == null) { + return null; + } + return Util.convertZuluTimeStringToDate(timeOfDiscovery); + } + + /** + * @param timeOfDiscovery the timeOfDiscovery to set + */ + public void setTimeOfDiscovery(String timeOfDiscovery) { + this.timeOfDiscovery = timeOfDiscovery; + } + + /** + * @return the hardwareVersion + */ + public String getHardwareVersion() { + return hardwareVersion; + } + + /** + * @param hardwareVersion the hardwareVersion to set + */ + public void setHardwareVersion(String hardwareVersion) { + this.hardwareVersion = hardwareVersion; + } + + /** + * @return the softwareVersion + */ + public String getSoftwareVersion() { + return softwareVersion; + } + + /** + * @param softwareVersion the softwareVersion to set + */ + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + /** + * @return the firmwareVersion + */ + public String getFirmwareVersion() { + return firmwareVersion; + } + + /** + * @param firmwareVersion the firmwareVersion to set + */ + public void setFirmwareVersion(String firmwareVersion) { + this.firmwareVersion = firmwareVersion; + } + + /** + * @return the hostName + */ + public String getHostName() { + return hostName; + } + + /** + * @param hostName the hostName to set + */ + public void setHostName(String hostName) { + this.hostName = hostName; + } + + /** + * @return the activityLogEnabled + */ + public boolean isActivityLogEnabled() { + return activityLogEnabled; + } + + /** + * @param activityLogEnabled the activityLogEnabled to set + */ + public void setActivityLogEnabled(boolean activityLogEnabled) { + this.activityLogEnabled = activityLogEnabled; + } + + /** + * @return the configurationState + */ + public String getConfigurationState() { + return configurationState; + } + + /** + * @param configurationState the configurationState to set + */ + public void setConfigurationState(String configurationState) { + this.configurationState = configurationState; + } + + /** + * @return the iPAddress + */ + public String getIPAddress() { + return ipAddress; + } + + /** + * @param ipAddress the ipAddress to set + */ + public void setIPAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + /** + * @return the mACAddress + */ + public String getMACAddress() { + return macAddress; + } + + /** + * @param mACAddress the mACAddress to set + */ + public void setMACAddress(String mACAddress) { + this.macAddress = mACAddress; + } + + /** + * @return the registrationTime + */ + public ZonedDateTime getRegistrationTime() { + if (registrationTime == null) { + return null; + } + return Util.convertZuluTimeStringToDate(registrationTime); + } + + /** + * @param registrationTime the registrationTime to set + */ + public void setRegistrationTime(String registrationTime) { + this.registrationTime = registrationTime; + } + + /** + * @return the timeZone + */ + public String getTimeZone() { + return timeZone; + } + + /** + * @param timeZone the timeZone to set + */ + public void setTimeZone(String timeZone) { + this.timeZone = timeZone; + } + + /** + * @return the shcType + */ + public String getShcType() { + return shcType; + } + + /** + * @param shcType the shcType to set + */ + public void setShcType(String shcType) { + this.shcType = shcType; + } + + /** + * @return the geoLocation + */ + public String getGeoLocation() { + return geoLocation; + } + + /** + * @param geoLocation the geoLocation to set + */ + public void setGeoLocation(String geoLocation) { + this.geoLocation = geoLocation; + } + + /** + * @return the currentUTCOffset + */ + public Double getCurrentUTCOffset() { + return currentUTCOffset; + } + + /** + * @param currentUTCOffset the currentUTCOffset to set + */ + public void setCurrentUTCOffset(Double currentUTCOffset) { + this.currentUTCOffset = currentUTCOffset; + } + + /** + * @return the backendConnectionMonitored + */ + public Boolean getBackendConnectionMonitored() { + return backendConnectionMonitored; + } + + /** + * @param backendConnectionMonitored the backendConnectionMonitored to set + */ + public void setBackendConnectionMonitored(Boolean backendConnectionMonitored) { + this.backendConnectionMonitored = backendConnectionMonitored; + } + + /** + * @return the rFCommFailureNotification + */ + public Boolean getRFCommFailureNotification() { + return rfCommFailureNotification; + } + + /** + * @param rFCommFailureNotification the rFCommFailureNotification to set + */ + public void setRFCommFailureNotification(Boolean rFCommFailureNotification) { + rfCommFailureNotification = rFCommFailureNotification; + } + + /** + * @return the displayCurrentTemperature + */ + public String getDisplayCurrentTemperature() { + return displayCurrentTemperature; + } + + /** + * @param displayCurrentTemperature the displayCurrentTemperature to set + */ + public void setDisplayCurrentTemperature(String displayCurrentTemperature) { + this.displayCurrentTemperature = displayCurrentTemperature; + } + + /** + * @return the underlyingDeviceIds + */ + public String getUnderlyingDeviceIds() { + return underlyingDeviceIds; + } + + /** + * @param underlyingDeviceIds the underlyingDeviceIds to set + */ + public void setUnderlyingDeviceIds(String underlyingDeviceIds) { + this.underlyingDeviceIds = underlyingDeviceIds; + } + + /** + * @return the meterId + */ + public String getMeterId() { + return meterId; + } + + /** + * @param meterId the meterId to set + */ + public void setMeterId(String meterId) { + this.meterId = meterId; + } + + /** + * @return the meterFirmwareVersion + */ + public String getMeterFirmwareVersion() { + return meterFirmwareVersion; + } + + /** + * @param meterFirmwareVersion the meterFirmwareVersion to set + */ + public void setMeterFirmwareVersion(String meterFirmwareVersion) { + this.meterFirmwareVersion = meterFirmwareVersion; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceState.java new file mode 100644 index 0000000000000..bdae2afc75fc7 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/DeviceState.java @@ -0,0 +1,171 @@ +/** + * 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.innogysmarthome.internal.client.entity.device; + +import java.util.HashMap; + +import org.openhab.binding.innogysmarthome.internal.client.entity.Property; + +/** + * Defines the {@link DeviceState}, e.g. if the device is reachable. + * + * @author Oliver Kuhl - Initial contribution + */ +public class DeviceState { + + protected static final String DEVICE_INCLUSION_STATE_INCLUDED = "Included"; + protected static final String DEVICE_INCLUSION_STATE_PENDING = "InclusionPending"; + protected static final String DEVICE_UPDATE_STATE_UPTODATE = "UpToDate"; + + protected static final String PROTOCOL_ID_WMBUS = "wMBus"; + protected static final String PROTOCOL_ID_VIRTUAL = "Virtual"; + protected static final String PROTOCOL_ID_COSIP = "Cosip"; + + private String id; + + private State state; + + private HashMap<String, Property> stateMap; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the state + */ + public State getState() { + return state; + } + + /** + * @param state the state to set + */ + public void setState(State state) { + this.state = state; + } + + /** + * Returns true if the device is reachable, false otherwise. + * + * @return true or false for "reachable" {@link Device}s, else null. + */ + public Boolean isReachable() { + return getState().getIsReachable().getValue(); + } + + /** + * Returns if the {@link State} "isReachable" is available for the current {@link Device}. + * + * @return + */ + public Boolean hasIsReachableState() { + return getState().getIsReachable() != null; + } + + /** + * Sets if the {@link Device} is reachable. + * + * @param isReachable + */ + public void setReachable(boolean isReachable) { + getState().getIsReachable().setValue(isReachable); + } + + /** + * Returns the configuration state of the device. + * + * @return the configuration state + */ + public String getDeviceConfigurationState() { + return getState().getDeviceConfigurationState().getValue(); + } + + /** + * Returns the device inclusion state. + * + * @return the device inclusion state + */ + public String getDeviceInclusionState() { + return getState().getDeviceInclusionState().getValue(); + } + + /** + * Returns true, if the device is included. + * + * @return true, if the {@link Device} is "Included" + */ + public boolean deviceIsIncluded() { + return DEVICE_INCLUSION_STATE_INCLUDED.equals(getState().getDeviceInclusionState().getValue()); + } + + /** + * @return the stateMap + */ + public HashMap<String, Property> getStateMap() { + return stateMap; + } + + /** + * @param stateMap the stateMap to set + */ + public void setStateMap(HashMap<String, Property> stateMap) { + this.stateMap = stateMap; + } + + /** + * Returns true, if the device inclusion state is "InclusionPending". + * + * @return true, if the inclusion state is "InclusionPending" + */ + public Boolean deviceInclusionIsPending() { + return DEVICE_INCLUSION_STATE_PENDING.equals(getDeviceInclusionState()); + } + + /** + * Return the update state of the {@link Device}. + * + * @return the update state + */ + public String getDeviceUpdateState() { + return getState().getUpdateState().getValue(); + } + + /** + * Returns true if the {@link Device} is up to date. + * + * @return true, if the deviceUpdateState is "UpToDate" + */ + public Boolean deviceIsUpToDate() { + return DEVICE_UPDATE_STATE_UPTODATE.equals(getDeviceUpdateState()); + } + + /** + * Returns the firmware version of the {@link Device}. + * + * @return the firmware version + */ + public String getFirmwareVersion() { + return getState().getFirmwareVersion().getValue(); + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Gateway.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Gateway.java new file mode 100644 index 0000000000000..ea7ca89f6bbc1 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/Gateway.java @@ -0,0 +1,116 @@ +/** + * 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.innogysmarthome.internal.client.entity.device; + +/** + * Defines the {@link Gateway} structure. + * + * @author Oliver Kuhl - Initial contribution + */ +public class Gateway { + + /** + * Serial number of the gateway + */ + private String serialNumber; + + /** + * Connected status + */ + private Boolean connected; + + /** + * Version of the app + */ + private String appVersion; + + /** + * Version of the operating system + */ + private String osVersion; + + /** + * Version of the configuration. Changes each time the configuration was changed via the innogy client app. + */ + private String configVersion; + + /** + * @return the serial number + */ + public String getSerialNumber() { + return serialNumber; + } + + /** + * @param serialNumber the serial number to set + */ + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + /** + * @return if the gateway is connected + */ + public Boolean getConnected() { + return connected; + } + + /** + * @param connected the connected state to set, true if connected + */ + public void setConnected(Boolean connected) { + this.connected = connected; + } + + /** + * @return the app version + */ + public String getAppVersion() { + return appVersion; + } + + /** + * @param appVersion the app version to set + */ + public void setAppVersion(String appVersion) { + this.appVersion = appVersion; + } + + /** + * @return the os version + */ + public String getOsVersion() { + return osVersion; + } + + /** + * @param osVersion the os version to set + */ + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + /** + * @return the configuration version + */ + public String getConfigVersion() { + return configVersion; + } + + /** + * @param configVersion the config version to set + */ + public void setConfigVersion(String configVersion) { + this.configVersion = configVersion; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/State.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/State.java new file mode 100644 index 0000000000000..2b1c55f04dafd --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/device/State.java @@ -0,0 +1,458 @@ +/** + * 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.innogysmarthome.internal.client.entity.device; + +import org.openhab.binding.innogysmarthome.internal.client.entity.state.BooleanState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.DateTimeState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.DoubleState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.IntegerState; +import org.openhab.binding.innogysmarthome.internal.client.entity.state.StringState; + +import com.google.gson.annotations.SerializedName; + +/** + * Holds the state of the Device. + * + * @author Oliver Kuhl - Initial contribution + * + */ +public class State { + /** Standard device states */ + @SerializedName("deviceInclusionState") + private StringState deviceInclusionState; + + @SerializedName("deviceConfigurationState") + private StringState deviceConfigurationState; + + private BooleanState isReachable; + + private StringState updateState; + + private StringState firmwareVersion; + + @SerializedName("WHRating") + private DoubleState wHRating; + + /** SHC device states */ + // Removed updateAvailable because it is different between version 1 and 2 devices and not used anyway + // Related to openhab-addons #6613 + // private StringState updateAvailable + + private DateTimeState lastReboot; + + private IntegerState memoryLoad; + + @SerializedName("CPULoad") + private IntegerState cpuLoad; + + @SerializedName("LBDongleAttached") + private BooleanState lBDongleAttached; + + @SerializedName("MBusDongleAttached") + private BooleanState mBusDongleAttached; + + private IntegerState configVersion; + + @SerializedName("OSState") + private StringState oSState; + + private IntegerState wifiSignalStrength; + + private StringState ethIpAddress; + + private StringState wifiIpAddress; + + private StringState ethMacAddress; + + private StringState wifiMacAddress; + + private StringState inUseAdapter; + + private BooleanState innogyLayerAttached; + + private BooleanState discoveryActive; + + private StringState operationStatus; + + private DoubleState currentUtcOffset; + + private DoubleState cpuUsage; + + private DoubleState diskUsage; + + private DoubleState memoryUsage; + + /** + * @return the deviceInclusionState + */ + public StringState getDeviceInclusionState() { + return deviceInclusionState; + } + + /** + * @param deviceInclusionState the deviceInclusionState to set + */ + public void setDeviceInclusionState(StringState deviceInclusionState) { + this.deviceInclusionState = deviceInclusionState; + } + + /** + * @return the deviceConfigurationState + */ + public StringState getDeviceConfigurationState() { + return deviceConfigurationState; + } + + /** + * @param deviceConfigurationState the deviceConfigurationState to set + */ + public void setDeviceConfigurationState(StringState deviceConfigurationState) { + this.deviceConfigurationState = deviceConfigurationState; + } + + /** + * @return the isReachable + */ + public BooleanState getIsReachable() { + return isReachable; + } + + /** + * @param isReachable the isReachable to set + */ + public void setIsReachable(BooleanState isReachable) { + this.isReachable = isReachable; + } + + /** + * @return the updateState + */ + public StringState getUpdateState() { + return updateState; + } + + /** + * @param updateState the updateState to set + */ + public void setUpdateState(StringState updateState) { + this.updateState = updateState; + } + + /** + * @return the firmwareVersion + */ + public StringState getFirmwareVersion() { + return firmwareVersion; + } + + /** + * @param firmwareVersion the firmwareVersion to set + */ + public void setFirmwareVersion(StringState firmwareVersion) { + this.firmwareVersion = firmwareVersion; + } + + /** + * @return the wHRating + */ + public DoubleState getWHRating() { + return wHRating; + } + + /** + * @param wHRating the wHRating to set + */ + public void setWHRating(DoubleState wHRating) { + this.wHRating = wHRating; + } + + /** + * @return the lastReboot + */ + public DateTimeState getLastReboot() { + return lastReboot; + } + + /** + * @param lastReboot the lastReboot to set + */ + public void setLastReboot(DateTimeState lastReboot) { + this.lastReboot = lastReboot; + } + + /** + * @return the memoryLoad + */ + public IntegerState getMemoryLoad() { + return memoryLoad; + } + + /** + * @param memoryLoad the memoryLoad to set + */ + public void setMemoryLoad(IntegerState memoryLoad) { + this.memoryLoad = memoryLoad; + } + + /** + * @return the cPULoad + */ + public IntegerState getCPULoad() { + return cpuLoad; + } + + /** + * @param cpuLoad the cPULoad to set + */ + public void setCPULoad(IntegerState cpuLoad) { + this.cpuLoad = cpuLoad; + } + + /** + * @return the lBDongleAttached + */ + public BooleanState getLBDongleAttached() { + return lBDongleAttached; + } + + /** + * @param lBDongleAttached the lBDongleAttached to set + */ + public void setLBDongleAttached(BooleanState lBDongleAttached) { + this.lBDongleAttached = lBDongleAttached; + } + + /** + * @return the mBusDongleAttached + */ + public BooleanState getMBusDongleAttached() { + return mBusDongleAttached; + } + + /** + * @param mBusDongleAttached the mBusDongleAttached to set + */ + public void setMBusDongleAttached(BooleanState mBusDongleAttached) { + this.mBusDongleAttached = mBusDongleAttached; + } + + /** + * @return the configVersion + */ + public IntegerState getConfigVersion() { + return configVersion; + } + + /** + * @param configVersion the configVersion to set + */ + public void setConfigVersion(IntegerState configVersion) { + this.configVersion = configVersion; + } + + /** + * @return the oSState + */ + public StringState getOSState() { + return oSState; + } + + /** + * @param oSState the oSState to set + */ + public void setOSState(StringState oSState) { + this.oSState = oSState; + } + + /** + * @return the wifiSignalStrength + */ + public IntegerState getWifiSignalStrength() { + return wifiSignalStrength; + } + + /** + * @param wifiSignalStrength the wifiSignalStrength to set + */ + public void setWifiSignalStrength(IntegerState wifiSignalStrength) { + this.wifiSignalStrength = wifiSignalStrength; + } + + /** + * @return the ethIpAddress + */ + public StringState getEthIpAddress() { + return ethIpAddress; + } + + /** + * @param ethIpAddress the ethIpAddress to set + */ + public void setEthIpAddress(StringState ethIpAddress) { + this.ethIpAddress = ethIpAddress; + } + + /** + * @return the wifiIpAddress + */ + public StringState getWifiIpAddress() { + return wifiIpAddress; + } + + /** + * @param wifiIpAddress the wifiIpAddress to set + */ + public void setWifiIpAddress(StringState wifiIpAddress) { + this.wifiIpAddress = wifiIpAddress; + } + + /** + * @return the ethMacAddress + */ + public StringState getEthMacAddress() { + return ethMacAddress; + } + + /** + * @param ethMacAddress the ethMacAddress to set + */ + public void setEthMacAddress(StringState ethMacAddress) { + this.ethMacAddress = ethMacAddress; + } + + /** + * @return the wifiMacAddress + */ + public StringState getWifiMacAddress() { + return wifiMacAddress; + } + + /** + * @param wifiMacAddress the wifiMacAddress to set + */ + public void setWifiMacAddress(StringState wifiMacAddress) { + this.wifiMacAddress = wifiMacAddress; + } + + /** + * @return the inUseAdapter + */ + public StringState getInUseAdapter() { + return inUseAdapter; + } + + /** + * @param inUseAdapter the inUseAdapter to set + */ + public void setInUseAdapter(StringState inUseAdapter) { + this.inUseAdapter = inUseAdapter; + } + + /** + * @return the innogyLayerAttached + */ + public BooleanState getInnogyLayerAttached() { + return innogyLayerAttached; + } + + /** + * @param innogyLayerAttached the innogyLayerAttached to set + */ + public void setInnogyLayerAttached(BooleanState innogyLayerAttached) { + this.innogyLayerAttached = innogyLayerAttached; + } + + /** + * @return the discoveryActive + */ + public BooleanState getDiscoveryActive() { + return discoveryActive; + } + + /** + * @param discoveryActive the discoveryActive to set + */ + public void setDiscoveryActive(BooleanState discoveryActive) { + this.discoveryActive = discoveryActive; + } + + /** + * @return the operationStatus + */ + public StringState getOperationStatus() { + return operationStatus; + } + + /** + * @param operationStatus the operationStatus to set + */ + public void setOperationStatus(StringState operationStatus) { + this.operationStatus = operationStatus; + } + + /** + * @return the currentUtcOffset + */ + public DoubleState getCurrentUtcOffset() { + return currentUtcOffset; + } + + /** + * @param currentUtcOffset the currentUtcOffset to set + */ + public void setCurrentUtcOffset(DoubleState currentUtcOffset) { + this.currentUtcOffset = currentUtcOffset; + } + + /** + * @return the cpuUsage + */ + public DoubleState getCpuUsage() { + return cpuUsage; + } + + /** + * @param cpuUsage the cpuUsage to set + */ + public void setCpuUsage(DoubleState cpuUsage) { + this.cpuUsage = cpuUsage; + } + + /** + * @return the diskUsage + */ + public DoubleState getDiskUsage() { + return diskUsage; + } + + /** + * @param diskUsage the diskUsage to set + */ + public void setDiskUsage(DoubleState diskUsage) { + this.diskUsage = diskUsage; + } + + /** + * @return the memoryUsage + */ + public DoubleState getMemoryUsage() { + return memoryUsage; + } + + /** + * @param memoryUsage the memoryUsage to set + */ + public void setMemoryUsage(DoubleState memoryUsage) { + this.memoryUsage = memoryUsage; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/error/ErrorResponse.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/error/ErrorResponse.java index c46bbb2dea356..e159e82a62988 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/error/ErrorResponse.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/error/ErrorResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,12 +14,10 @@ import java.util.List; -import org.openhab.binding.innogysmarthome.internal.client.InnogyConfig; - import com.google.gson.annotations.SerializedName; /** - * The {@link InnogyConfig} contains all configurations for the innogy SmartHome library. + * Error response object from the innogy SmartHome api. * * @author Oliver Kuhl - Initial contribution * @@ -60,6 +58,7 @@ public class ErrorResponse { // Products public static final int ERR_PREMIUM_SERVICE_CANNOT_BE_ENABLED_DIRECTLY = 3500; + public static final int ERR_CANNOT_REMOVE_A_PRODUCT_THAT_WAS_PAID = 3501; // Actions public static final int ERR_INVALID_ACTION_TRIGGERED = 4000; @@ -75,6 +74,12 @@ public class ErrorResponse { public static final int ERR_ONE_SHC_ALREADY_REGISTERED = 5004; public static final int ERR_USER_HAS_NO_REGISTERED_SHC = 5005; public static final int ERR_CONTROLLER_OFFLINE = 5006; + public static final int ERR_REGISTRATION_FAILURE = 5009; + + // Smart codes + public static final int ERR_SMARTCODE_REQUEST_NOT_ALLOWED = 6000; + public static final int ERR_SMARTCODE_CANNOT_BE_REDEEMED = 6001; + public static final int ERR_RESTRICTED_ACCESS = 6002; @SerializedName("errorcode") private int code; diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/BaseEvent.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/BaseEvent.java new file mode 100644 index 0000000000000..d4b82c0cb6de1 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/BaseEvent.java @@ -0,0 +1,153 @@ +/** + * 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.innogysmarthome.internal.client.entity.event; + +import java.util.Collections; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class BaseEvent { + + public static final String TYPE_STATE_CHANGED = "StateChanged";// "device/SHC.RWE/1.0/event/StateChanged"; + public static final String TYPE_NEW_MESSAGE_RECEIVED = "NewMessageReceived"; // "device/SHC.RWE/1.0/event/NewMessageReceived"; + public static final String TYPE_MESSAGE_CREATED = "MessageCreated"; + public static final String TYPE_MESSAGE_DELETED = "MessageDeleted"; // "device/SHC.RWE/1.0/event/MessageDeleted"; + public static final String TYPE_DISCONNECT = "Disconnect"; // "/event/Disconnect"; + public static final String TYPE_CONFIGURATION_CHANGED = "ConfigurationChanged"; // "device/SHC.RWE/1.0/event/ConfigChanged"; + public static final String TYPE_CONTROLLER_CONNECTIVITY_CHANGED = "/event/ControllerConnectivityChanged"; // "device/SHC.RWE/1.0/event/ControllerConnectivityChanged"; + public static final String TYPE_BUTTON_PRESSED = "ButtonPressed"; + + public static final Set<String> SUPPORTED_EVENT_TYPES = Collections + .unmodifiableSet(Stream.of(TYPE_STATE_CHANGED, TYPE_NEW_MESSAGE_RECEIVED, TYPE_MESSAGE_CREATED, + TYPE_MESSAGE_DELETED, TYPE_DISCONNECT, TYPE_CONFIGURATION_CHANGED, + TYPE_CONTROLLER_CONNECTIVITY_CHANGED, TYPE_BUTTON_PRESSED).collect(Collectors.toSet())); + + /** + * The event sequence number – the gateway keeps track and adds a sequence number to each event for the client to + * identify order and missing events + */ + private Integer sequenceNumber; + + /** + * Specifies the type of the event. The type must be the full path to uniquely reference the event definition. + * Always available. + */ + private String type; + + /** + * Date and time when the event occurred in the system. Always available. + */ + private String timestamp; + + /** + * @return the sequenceNumber + */ + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * @return the timestamp + */ + public String getTimestamp() { + return timestamp; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param sequenceNumber the sequenceNumber to set + */ + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * @param timestamp the timestamp to set + */ + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * Returns true, if the {@link Event} is a ConfigChanged event. + * + * @return + */ + public boolean isConfigChangedEvent() { + return TYPE_CONFIGURATION_CHANGED.equals(getType()); + } + + /** + * Returns true, if the {@link Event} is a ControllerConnectivityChanged event. + * + * @return + */ + public boolean isControllerConnectivityChangedEvent() { + return TYPE_CONTROLLER_CONNECTIVITY_CHANGED.equals(getType()); + } + + /** + * Returns true, if the {@link Event} is a Disconnect event. + * + * @return + */ + public boolean isDisconnectedEvent() { + return TYPE_DISCONNECT.equals(getType()); + } + + /** + * Returns true, if the {@link Event} is a MessageDeletedEvent. + * + * @return + */ + public boolean isMessageDeletedEvent() { + return TYPE_MESSAGE_DELETED.equals(getType()); + } + + /** + * Returns true, if the {@link Event} is a NewMessageReceivedEvent. + * + * @return + */ + public boolean isNewMessageReceivedEvent() { + return TYPE_NEW_MESSAGE_RECEIVED.equals(getType()); + } + + /** + * Returns true, if the {@link Event} is a StateChangedEvent. + * + * @return + */ + public boolean isStateChangedEvent() { + return TYPE_STATE_CHANGED.equals(getType()); + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/Event.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/Event.java index c37e4394521ee..a5adaea44ac2b 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/Event.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/Event.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,75 +12,40 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity.event; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; import org.openhab.binding.innogysmarthome.internal.client.entity.Property; -import org.openhab.binding.innogysmarthome.internal.client.entity.PropertyList; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; - -import com.google.api.client.util.Key; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.annotations.SerializedName; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; /** * Defines the {@link Event}, which is sent by the innogy websocket to inform the clients about changes. * * @author Oliver Kuhl - Initial contribution */ -public class Event extends PropertyList { - - public static final String TYPE_STATE_CHANGED = "device/SHC.RWE/1.0/event/StateChanged"; - public static final String TYPE_NEW_MESSAGE_RECEIVED = "device/SHC.RWE/1.0/event/NewMessageReceived"; - public static final String TYPE_MESSAGE_DELETED = "device/SHC.RWE/1.0/event/MessageDeleted"; - public static final String TYPE_DISCONNECT = "/event/Disconnect"; - public static final String TYPE_CONFIG_CHANGED = "device/SHC.RWE/1.0/event/ConfigChanged"; - public static final String TYPE_CONTROLLER_CONNECTIVITY_CHANGED = "device/SHC.RWE/1.0/event/ControllerConnectivityChanged"; +public class Event extends BaseEvent { public static final String EVENT_PROPERTY_CONFIGURATION_VERSION = "ConfigurationVersion"; public static final String EVENT_PROPERTY_IS_CONNECTED = "IsConnected"; /** - * Specifies the type of the event. The type must be the full path to uniquely reference the event definition. - * Always available. - */ - @Key("type") - private String type; - - /** - * Date and time when the event occurred in the system. Always available. + * Reference to the associated entity (instance or metadata) for the given event. Always available. */ - @Key("timestamp") - private String timestamp; + private String source; /** - * Link to the metadata to the event definition. - * Optional. + * The product (context) that generated the event. */ - @Key("desc") - private String desc; - - /** - * Reference to the associated entity (instance or metadata) for the given event. Always available. - */ - @Key("link") - private Link link; + private String namespace; /** * This container includes only properties, e.g. for the changed state properties. If there is other data than * properties to be transported, the data container will be used. * Optional. */ - @Key("Properties") - @SerializedName("Properties") - private List<Property> propertyList; + private EventProperties properties; protected HashMap<String, Property> propertyMap; @@ -89,135 +54,62 @@ public class Event extends PropertyList { * the DeviceFound events contains the entire Device entity rather than selected properties. * Optional. */ - @Key("Data") - @SerializedName("Data") - private List<JsonObject> dataList; - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } + private EventData data; /** - * @return the timestamp + * @return the link to the source */ - public String getTimestamp() { - return timestamp; + public String getSource() { + return source; } /** - * @param timestamp the timestamp to set + * @param source the link to the source to set */ - public void setTimestamp(String timestamp) { - this.timestamp = timestamp; + public void setSource(String source) { + this.source = source; } /** - * @return the desc + * @return the namespace */ - protected String getDesc() { - return desc; + public String getNamespace() { + return namespace; } /** - * @param desc the desc to set + * @param namespace the namespace to set */ - public void setDesc(String desc) { - this.desc = desc; + public void setNamespace(String namespace) { + this.namespace = namespace; } /** - * @return the link + * @return the properties */ - public Link getLink() { - return link; - } - - /** - * @param link the link to set - */ - public void setLink(Link link) { - this.link = link; - } - - /** - * @return the propertyList - */ - @Override - public List<Property> getPropertyList() { - return propertyList; + public EventProperties getProperties() { + return properties; } /** * @param propertyList the propertyList to set */ - public void setPropertyList(List<Property> propertyList) { - this.propertyList = propertyList; - } - - /* - * (non-Javadoc) - * - * @see in.ollie.innogysmarthome.entity.PropertyList#getPropertyMap() - */ - @Override - protected Map<String, Property> getPropertyMap() { - if (propertyMap == null) { - propertyMap = PropertyList.getHashMap(propertyList); - } - - return propertyMap; + public void setProperties(EventProperties properties) { + this.properties = properties; } /** * @return the dataList */ - public List<JsonObject> getDataList() { - return dataList; - } - - public List<Message> getDataListAsMessage() { - List<Message> messageList = new ArrayList<>(); - List<JsonObject> objectList = getDataList(); - for (JsonObject o : objectList) { - Message m = new Message(); - m.setId(o.get("id").getAsString()); - m.setType(o.get("type").getAsString()); - m.setRead(o.get("read").getAsBoolean()); - m.setMessageClass(o.get("class").getAsString()); - m.setDesc(o.get("desc").getAsString()); - m.setTimestamp(o.get("timestamp").getAsString()); - if (o.has("Devices")) { - List<Link> deviceLinkList = new ArrayList<>(); - JsonArray deviceArr = o.get("Devices").getAsJsonArray(); - - for (JsonElement deviceObject : deviceArr) { - deviceLinkList.add(new Link(deviceObject.getAsJsonObject().get("value").getAsString())); - } - m.setDeviceLinkList(deviceLinkList); - } - // TODO: add datapropertylist - // m.setDataPropertyList(dataPropertyList); - m.setProductLink(new Link(o.get("Product").getAsJsonObject().get("value").getAsString())); - messageList.add(m); - } - return messageList; + public EventData getData() { + return data; } /** * @param dataList the dataList to set */ - public void setDataList(List<JsonObject> dataList) { - this.dataList = dataList; + public void setData(EventData data) { + this.data = data; } /** @@ -225,12 +117,11 @@ public void setDataList(List<JsonObject> dataList) { * * @return String the id of the link or null */ - public String getLinkId() { - String linkType = getLinkType(); - if (linkType != null && !linkType.equals(Link.LINK_TYPE_UNKNOWN) && !linkType.equals(Link.LINK_TYPE_SHC)) { - String linkValue = getLink().getValue(); - if (linkValue != null) { - return linkValue.replace(linkType, ""); + public String getSourceId() { + final String linkType = getSourceLinkType(); + if (linkType != null && !Link.LINK_TYPE_UNKNOWN.equals(linkType) && !Link.LINK_TYPE_SHC.equals(linkType)) { + if (source != null) { + return source.replace(linkType, ""); } } return null; @@ -241,75 +132,20 @@ public String getLinkId() { * * @return */ - public String getLinkType() { - Link link = getLink(); - if (link != null) { - return link.getLinkType(); + public String getSourceLinkType() { + if (source != null) { + return Link.getLinkType(source); } return null; } - /** - * Returns true, if the {@link Event} is a StateChangedEvent. - * - * @return - */ - public boolean isStateChangedEvent() { - return getType().equals(TYPE_STATE_CHANGED); - } - - /** - * Returns true, if the {@link Event} is a NewMessageReceivedEvent. - * - * @return - */ - public boolean isNewMessageReceivedEvent() { - return getType().equals(TYPE_NEW_MESSAGE_RECEIVED); - } - - /** - * Returns true, if the {@link Event} is a MessageDeletedEvent. - * - * @return - */ - public boolean isMessageDeletedEvent() { - return getType().equals(TYPE_MESSAGE_DELETED); - } - - /** - * Returns true, if the {@link Event} is a Disconnect event. - * - * @return - */ - public boolean isDisconnectedEvent() { - return getType().equals(TYPE_DISCONNECT); - } - - /** - * Returns true, if the {@link Event} is a ConfigChanged event. - * - * @return - */ - public boolean isConfigChangedEvent() { - return getType().equals(TYPE_CONFIG_CHANGED); - } - - /** - * Returns true, if the {@link Event} is a ControllerConnectivityChanged event. - * - * @return - */ - public boolean isControllerConnectivityChangedEvent() { - return getType().equals(TYPE_CONTROLLER_CONNECTIVITY_CHANGED); - } - /** * Returns true, if the {@link Link} points to a {@link Capability}. * * @return */ public Boolean isLinkedtoCapability() { - return getLink() == null ? false : getLink().isTypeCapability(); + return source == null ? false : Link.isTypeCapability(source); } /** @@ -318,7 +154,7 @@ public Boolean isLinkedtoCapability() { * @return */ public Boolean isLinkedtoDevice() { - return getLink() == null ? false : getLink().isTypeDevice(); + return source == null ? false : Link.isTypeDevice(source); } /** @@ -327,7 +163,7 @@ public Boolean isLinkedtoDevice() { * @return */ public Boolean isLinkedtoMessage() { - return getLink() == null ? false : getLink().isTypeMessage(); + return source == null ? false : Link.isTypeMessage(source); } /** @@ -336,7 +172,7 @@ public Boolean isLinkedtoMessage() { * @return */ public Boolean isLinkedtoSHC() { - return getLink() == null ? false : getLink().isTypeSHC(); + return source == null ? false : Link.isTypeSHC(source); } /** @@ -345,7 +181,7 @@ public Boolean isLinkedtoSHC() { * @return */ public Integer getConfigurationVersion() { - return getPropertyValueAsInteger(EVENT_PROPERTY_CONFIGURATION_VERSION); + return getData().getConfigVersion(); } /** @@ -358,6 +194,6 @@ public Boolean getIsConnected() { if (!isControllerConnectivityChangedEvent()) { return null; } - return getPropertyValueAsBoolean(EVENT_PROPERTY_IS_CONNECTED); + return getProperties().getIsConnected(); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/EntityState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventData.java similarity index 60% rename from bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/EntityState.java rename to bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventData.java index 38fe1eae15d4f..b8496353a9056 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/EntityState.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,30 +10,35 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.innogysmarthome.internal.client.entity.state; - -import com.google.api.client.util.Key; +package org.openhab.binding.innogysmarthome.internal.client.entity.event; /** - * The general structure of the state of an entity. - * * @author Oliver Kuhl - Initial contribution + * */ -public class EntityState extends StatePropertyList { +public class EventData { + private Integer configVersion; - @Key("Id") private String id; /** - * @return the id + * @return the configVersion */ - public String getId() { - return id; + public Integer getConfigVersion() { + return configVersion; } /** - * @param id the id to set + * @param configVersion the configVersion to set */ + public void setConfigVersion(Integer configVersion) { + this.configVersion = configVersion; + } + + public String getId() { + return id; + } + public void setId(String id) { this.id = id; } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventProperties.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventProperties.java new file mode 100644 index 0000000000000..0c4e36374ad74 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/EventProperties.java @@ -0,0 +1,583 @@ +/** + * 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.innogysmarthome.internal.client.entity.event; + +import com.google.gson.annotations.SerializedName; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class EventProperties { + /** SHC Properties **/ + private Integer configVersion; + + private Boolean isConnected; + + /** Writable capability properties **/ + private Integer dimLevel; + + private Boolean onState; + + private String operationMode; + + private Double pointTemperature; + + private Integer shutterLevel; + + private Boolean value; + + /** readable capability properties **/ + private Double absoluteEnergyConsumption; + + private Double energyConsumptionDayEuro; + + private Double energyConsumptionDayKWh; + + private Double energyConsumptionMonthEuro; + + private Double energyConsumptionMonthKWh; + + private Double energyPerDayInEuro; + + private Double energyPerDayInKWh; + + private Double energyPerMonthInEuro; + + private Double energyPerMonthInKWh; + + private Boolean frostWarning; + + private Double humidity; + + private Boolean isOpen; + + private Boolean isSmokeAlarm; + + private Integer lastKeyPressCounter; + + private Integer lastPressedButtonIndex; + + /** + * Key press type + */ + @SerializedName("type") + private String lastKeyPressType; + + private Double luminance; + + private Boolean moldWarning; + + private Integer motionDetectedCount; + + private Double powerConsumptionWatt; + + private Double powerInWatt; + + private Double temperature; + + private Double totalEnergy; + + private Boolean windowReductionActive; + + private Double cpuUsage; + + private Double diskUsage; + + private Double memoryUsage; + + /** + * @return the configurationVersion + */ + public Integer getConfigVersion() { + return configVersion; + } + + /** + * @param configVersion the configurationVersion to set + */ + public void setConfigVersion(final Integer configVersion) { + this.configVersion = configVersion; + } + + /** + * @return the isConnected + */ + public Boolean getIsConnected() { + return isConnected; + } + + /** + * @param isConnected the isConnected to set + */ + public void setIsConnected(final Boolean isConnected) { + this.isConnected = isConnected; + } + + /** + * @return the dimLevel + */ + public Integer getDimLevel() { + return dimLevel; + } + + /** + * @param dimLevel the dimLevel to set + */ + public void setDimLevel(final Integer dimLevel) { + this.dimLevel = dimLevel; + } + + /** + * @return the onState + */ + public Boolean getOnState() { + return onState; + } + + /** + * @param onState the onState to set + */ + public void setOnState(final Boolean onState) { + this.onState = onState; + } + + /** + * @return the operationMode + */ + public String getOperationMode() { + return operationMode; + } + + /** + * @param operationMode the operationMode to set + */ + public void setOperationMode(final String operationMode) { + this.operationMode = operationMode; + } + + /** + * @return the pointTemperature + */ + public Double getPointTemperature() { + return pointTemperature; + } + + /** + * @param pointTemperature the pointTemperature to set + */ + public void setPointTemperature(final Double pointTemperature) { + this.pointTemperature = pointTemperature; + } + + /** + * @return the shutterLevel + */ + public Integer getShutterLevel() { + return shutterLevel; + } + + /** + * @param shutterLevel the shutterLevel to set + */ + public void setShutterLevel(final Integer shutterLevel) { + this.shutterLevel = shutterLevel; + } + + /** + * @return the value + */ + public Boolean getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(final Boolean value) { + this.value = value; + } + + /** + * @return the absoluteEnergyConsumption + */ + public Double getAbsoluteEnergyConsumption() { + return absoluteEnergyConsumption; + } + + /** + * @param absoluteEnergyConsumption the absoluteEnergyConsumption to set + */ + public void setAbsoluteEnergyConsumption(final Double absoluteEnergyConsumption) { + this.absoluteEnergyConsumption = absoluteEnergyConsumption; + } + + /** + * @return the energyConsumptionDayEuro + */ + public Double getEnergyConsumptionDayEuro() { + return energyConsumptionDayEuro; + } + + /** + * @param energyConsumptionDayEuro the energyConsumptionDayEuro to set + */ + public void setEnergyConsumptionDayEuro(final Double energyConsumptionDayEuro) { + this.energyConsumptionDayEuro = energyConsumptionDayEuro; + } + + /** + * @return the energyConsumptionDayKWh + */ + public Double getEnergyConsumptionDayKWh() { + return energyConsumptionDayKWh; + } + + /** + * @param energyConsumptionDayKWh the energyConsumptionDayKWh to set + */ + public void setEnergyConsumptionDayKWh(final Double energyConsumptionDayKWh) { + this.energyConsumptionDayKWh = energyConsumptionDayKWh; + } + + /** + * @return the energyConsumptionMonthEuro + */ + public Double getEnergyConsumptionMonthEuro() { + return energyConsumptionMonthEuro; + } + + /** + * @param energyConsumptionMonthEuro the energyConsumptionMonthEuro to set + */ + public void setEnergyConsumptionMonthEuro(final Double energyConsumptionMonthEuro) { + this.energyConsumptionMonthEuro = energyConsumptionMonthEuro; + } + + /** + * @return the energyConsumptionMonthKWh + */ + public Double getEnergyConsumptionMonthKWh() { + return energyConsumptionMonthKWh; + } + + /** + * @param energyConsumptionMonthKWh the energyConsumptionMonthKWh to set + */ + public void setEnergyConsumptionMonthKWh(final Double energyConsumptionMonthKWh) { + this.energyConsumptionMonthKWh = energyConsumptionMonthKWh; + } + + /** + * @return the energyPerDayInEuro + */ + public Double getEnergyPerDayInEuro() { + return energyPerDayInEuro; + } + + /** + * @param energyPerDayInEuro the energyPerDayInEuro to set + */ + public void setEnergyPerDayInEuro(final Double energyPerDayInEuro) { + this.energyPerDayInEuro = energyPerDayInEuro; + } + + /** + * @return the energyPerDayInKWh + */ + public Double getEnergyPerDayInKWh() { + return energyPerDayInKWh; + } + + /** + * @param energyPerDayInKWh the energyPerDayInKWh to set + */ + public void setEnergyPerDayInKWh(final Double energyPerDayInKWh) { + this.energyPerDayInKWh = energyPerDayInKWh; + } + + /** + * @return the energyPerMonthInEuro + */ + public Double getEnergyPerMonthInEuro() { + return energyPerMonthInEuro; + } + + /** + * @param energyPerMonthInEuro the energyPerMonthInEuro to set + */ + public void setEnergyPerMonthInEuro(final Double energyPerMonthInEuro) { + this.energyPerMonthInEuro = energyPerMonthInEuro; + } + + /** + * @return the energyPerMonthInKWh + */ + public Double getEnergyPerMonthInKWh() { + return energyPerMonthInKWh; + } + + /** + * @param energyPerMonthInKWh the energyPerMonthInKWh to set + */ + public void setEnergyPerMonthInKWh(final Double energyPerMonthInKWh) { + this.energyPerMonthInKWh = energyPerMonthInKWh; + } + + /** + * @return the frostWarning + */ + public Boolean getFrostWarning() { + return frostWarning; + } + + /** + * @param frostWarning the frostWarning to set + */ + public void setFrostWarning(final Boolean frostWarning) { + this.frostWarning = frostWarning; + } + + /** + * @return the humidity + */ + public Double getHumidity() { + return humidity; + } + + /** + * @param humidity the humidity to set + */ + public void setHumidity(final Double humidity) { + this.humidity = humidity; + } + + /** + * @return the isOpen + */ + public Boolean getIsOpen() { + return isOpen; + } + + /** + * @param isOpen the isOpen to set + */ + public void setIsOpen(final Boolean isOpen) { + this.isOpen = isOpen; + } + + /** + * @return the isSmokeAlarm + */ + public Boolean getIsSmokeAlarm() { + return isSmokeAlarm; + } + + /** + * @param isSmokeAlarm the isSmokeAlarm to set + */ + public void setIsSmokeAlarm(final Boolean isSmokeAlarm) { + this.isSmokeAlarm = isSmokeAlarm; + } + + /** + * @return the lastKeyPressCounter + */ + public Integer getLastKeyPressCounter() { + return lastKeyPressCounter; + } + + /** + * @param lastKeyPressCounter the lastKeyPressCounter to set + */ + public void setLastKeyPressCounter(final Integer lastKeyPressCounter) { + this.lastKeyPressCounter = lastKeyPressCounter; + } + + /** + * @return the lastPressedButtonIndex + */ + public Integer getLastPressedButtonIndex() { + return lastPressedButtonIndex; + } + + /** + * @param lastPressedButtonIndex the lastPressedButtonIndex to set + */ + public void setLastPressedButtonIndex(final Integer lastPressedButtonIndex) { + this.lastPressedButtonIndex = lastPressedButtonIndex; + } + + public String getLastKeyPressType() { + return lastKeyPressType; + } + + public void setLastKeyPressType(final String lastKeyPressType) { + this.lastKeyPressType = lastKeyPressType; + } + + /** + * @return the luminance + */ + public Double getLuminance() { + return luminance; + } + + /** + * @param luminance the luminance to set + */ + public void setLuminance(final Double luminance) { + this.luminance = luminance; + } + + /** + * @return the moldWarning + */ + public Boolean getMoldWarning() { + return moldWarning; + } + + /** + * @param moldWarning the moldWarning to set + */ + public void setMoldWarning(final Boolean moldWarning) { + this.moldWarning = moldWarning; + } + + /** + * @return the motionDetectedCount + */ + public Integer getMotionDetectedCount() { + return motionDetectedCount; + } + + /** + * @param motionDetectedCount the motionDetectedCount to set + */ + public void setMotionDetectedCount(final Integer motionDetectedCount) { + this.motionDetectedCount = motionDetectedCount; + } + + /** + * @return the powerConsumptionWatt + */ + public Double getPowerConsumptionWatt() { + return powerConsumptionWatt; + } + + /** + * @param powerConsumptionWatt the powerConsumptionWatt to set + */ + public void setPowerConsumptionWatt(final Double powerConsumptionWatt) { + this.powerConsumptionWatt = powerConsumptionWatt; + } + + /** + * @return the powerInWatt + */ + public Double getPowerInWatt() { + return powerInWatt; + } + + /** + * @param powerInWatt the powerInWatt to set + */ + public void setPowerInWatt(final Double powerInWatt) { + this.powerInWatt = powerInWatt; + } + + /** + * @return the temperature + */ + public Double getTemperature() { + return temperature; + } + + /** + * @param temperature the temperature to set + */ + public void setTemperature(final Double temperature) { + this.temperature = temperature; + } + + /** + * @return the totalEnergy + */ + public Double getTotalEnergy() { + return totalEnergy; + } + + /** + * @param totalEnergy the totalEnergy to set + */ + public void setTotalEnergy(final Double totalEnergy) { + this.totalEnergy = totalEnergy; + } + + /** + * @return the windowReductionActive + */ + public Boolean getWindowReductionActive() { + return windowReductionActive; + } + + /** + * @param windowReductionActive the windowReductionActive to set + */ + public void setWindowReductionActive(final Boolean windowReductionActive) { + this.windowReductionActive = windowReductionActive; + } + + /** + * @param cpuUsage the cpuUsage to set + */ + public void setCpuUsage(final Double cpuUsage) { + this.cpuUsage = cpuUsage; + } + + /** + * @return the cpuUsage + */ + public Double getCpuUsage() { + return cpuUsage; + } + + /** + * @param diskUsage the diskUsage to set + */ + public void setDiskUsage(final Double diskUsage) { + this.diskUsage = diskUsage; + } + + /** + * @return the diskUsage + */ + public Double getDiskUsage() { + return diskUsage; + } + + /** + * @param memoryUsage the memoryUsage to set + */ + public void setMemoryUsage(final Double memoryUsage) { + this.memoryUsage = memoryUsage; + } + + /** + * @return the memoryUsage + */ + public Double getMemoryUsage() { + return memoryUsage; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageEvent.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageEvent.java new file mode 100644 index 0000000000000..805c7dc44af38 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageEvent.java @@ -0,0 +1,155 @@ +/** + * 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.innogysmarthome.internal.client.entity.event; + +import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; +import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; + +/** + * Defines the {@link Event}, which is sent by the innogy websocket to inform the clients about changes. + * + * @author Oliver Kuhl - Initial contribution + */ +public class MessageEvent extends BaseEvent { + + public static final String EVENT_PROPERTY_CONFIGURATION_VERSION = "ConfigurationVersion"; + public static final String EVENT_PROPERTY_IS_CONNECTED = "IsConnected"; + + /** + * Reference to the associated entity (instance or metadata) for the given event. Always available. + */ + private String source; + + /** + * The product (context) that generated the event. + */ + private String namespace; + + /** + * Data for the event, The data container can contain any type of entity dependent on the event type. For example, + * the DeviceFound events contains the entire Device entity rather than selected properties. + * Optional. + */ + private Message data; + + /** + * @return the link to the source + */ + public String getSource() { + return source; + } + + /** + * @param source the link to the source to set + */ + public void setSource(String source) { + this.source = source; + } + + /** + * @return the namespace + */ + public String getNamespace() { + return namespace; + } + + /** + * @param namespace the namespace to set + */ + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + /** + * @return the dataList + */ + public Message getData() { + return data; + } + + /** + * @param message the message to set + */ + public void setData(Message data) { + this.data = data; + } + + public Message getMessage() { + return data; + } + + /** + * Returns the id of the link or null, if there is no link or the link does not have an id. + * + * @return String the id of the link or null + */ + public String getSourceId() { + final String linkType = getSourceLinkType(); + if (linkType != null && !Link.LINK_TYPE_UNKNOWN.equals(linkType) && !Link.LINK_TYPE_SHC.equals(linkType)) { + if (source != null) { + return source.replace(linkType, ""); + } + } + return null; + } + + /** + * Returns the Type of the {@link Link} in the {@link Event}. + * + * @return + */ + public String getSourceLinkType() { + if (source != null) { + return Link.getLinkType(source); + } + return null; + } + + /** + * Returns true, if the {@link Link} points to a {@link Capability}. + * + * @return + */ + public Boolean isLinkedtoCapability() { + return source == null ? false : Link.isTypeCapability(source); + } + + /** + * Returns true, if the {@link Link} points to a {@link Device}. + * + * @return + */ + public Boolean isLinkedtoDevice() { + return source == null ? false : Link.isTypeDevice(source); + } + + /** + * Returns true, if the {@link Link} points to a {@link Message}. + * + * @return + */ + public Boolean isLinkedtoMessage() { + return source == null ? false : Link.isTypeMessage(source); + } + + /** + * Returns true, if the {@link Link} points to the SHC {@link Device}. + * + * @return + */ + public Boolean isLinkedtoSHC() { + return source == null ? false : Link.isTypeSHC(source); + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/Link.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/Link.java index e890177d45aab..a762440d968a3 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/Link.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/link/Link.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,11 +12,9 @@ */ package org.openhab.binding.innogysmarthome.internal.client.entity.link; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; - -import com.google.api.client.util.Key; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; /** * Defines the data structure for a {@link Link}. This is the basic component used to link different data types in the @@ -32,45 +30,20 @@ public class Link { public static final String LINK_TYPE_SHC = "/desc/device/SHC.RWE/"; public static final String LINK_TYPE_UNKNOWN = "unknown"; - @Key("value") - private String value; - - public Link(String value) { - this.value = value; - } - - public Link() { - } - - /** - * @return the value - */ - public String getValue() { - return value; - } - - /** - * @param value the value to set - */ - public void setValue(String value) { - this.value = value; - } - /** * Returns the Type of the {@link Link}. * * @return {@link #LINK_TYPE_CAPABILITY},{@link #LINK_TYPE_DEVICE}, {@link #LINK_TYPE_MESSAGE}, * {@link #LINK_TYPE_SHC} or {@link #LINK_TYPE_UNKNOWN} */ - public String getLinkType() { - String linkValue = getValue(); - if (linkValue.startsWith(LINK_TYPE_CAPABILITY)) { + public static String getLinkType(String link) { + if (link.startsWith(LINK_TYPE_CAPABILITY)) { return LINK_TYPE_CAPABILITY; - } else if (linkValue.startsWith(LINK_TYPE_DEVICE)) { + } else if (link.startsWith(LINK_TYPE_DEVICE)) { return LINK_TYPE_DEVICE; - } else if (linkValue.startsWith(LINK_TYPE_MESSAGE)) { + } else if (link.startsWith(LINK_TYPE_MESSAGE)) { return LINK_TYPE_MESSAGE; - } else if (linkValue.startsWith(LINK_TYPE_SHC)) { + } else if (link.startsWith(LINK_TYPE_SHC)) { return LINK_TYPE_SHC; } else { return LINK_TYPE_UNKNOWN; @@ -82,11 +55,11 @@ public String getLinkType() { * * @return String the id of the link or null */ - public String getId() { - if (this.value != null) { - String linkType = getLinkType(); - if (linkType != null && !linkType.equals(Link.LINK_TYPE_UNKNOWN) && !linkType.equals(Link.LINK_TYPE_SHC)) { - return this.value.replace(linkType, ""); + public static String getId(String link) { + if (link != null) { + final String linkType = getLinkType(link); + if (linkType != null && !Link.LINK_TYPE_UNKNOWN.equals(linkType) && !Link.LINK_TYPE_SHC.equals(linkType)) { + return link.replace(linkType, ""); } } return null; @@ -97,8 +70,8 @@ public String getId() { * * @return */ - public boolean isTypeCapability() { - return getLinkType().equals(LINK_TYPE_CAPABILITY); + public static boolean isTypeCapability(String link) { + return LINK_TYPE_CAPABILITY.equals(Link.getLinkType(link)); } /** @@ -106,8 +79,8 @@ public boolean isTypeCapability() { * * @return */ - public boolean isTypeDevice() { - return getLinkType().equals(LINK_TYPE_DEVICE); + public static boolean isTypeDevice(String link) { + return LINK_TYPE_DEVICE.equals(Link.getLinkType(link)); } /** @@ -115,8 +88,8 @@ public boolean isTypeDevice() { * * @return */ - public boolean isTypeMessage() { - return getLinkType().equals(LINK_TYPE_MESSAGE); + public static boolean isTypeMessage(String link) { + return LINK_TYPE_MESSAGE.equals(Link.getLinkType(link)); } /** @@ -124,8 +97,8 @@ public boolean isTypeMessage() { * * @return */ - public boolean isTypeSHC() { - return getLinkType().equals(LINK_TYPE_SHC); + public static boolean isTypeSHC(String link) { + return LINK_TYPE_SHC.equals(Link.getLinkType(link)); } /** @@ -133,7 +106,7 @@ public boolean isTypeSHC() { * * @return */ - public boolean isTypeUnknown() { - return getLinkType().equals(LINK_TYPE_UNKNOWN); + public static boolean isTypeUnknown(String link) { + return LINK_TYPE_UNKNOWN.equals(Link.getLinkType(link)); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/Location.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/Location.java new file mode 100644 index 0000000000000..3d299b3de4f30 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/Location.java @@ -0,0 +1,73 @@ +/** + * 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.innogysmarthome.internal.client.entity.location; + +/** + * Defines a {@link Location} structure. + * + * @author Oliver Kuhl - Initial contribution + */ +public class Location { + + /** + * Identifier of the location – must be unique. + */ + private String id; + + /** + * Configuration properties of the {@link Location}. + */ + private LocationConfig config; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the config + */ + public LocationConfig getConfig() { + return config; + } + + /** + * @param config the config to set + */ + public void setConfig(LocationConfig config) { + this.config = config; + } + + /** + * @return the location name + */ + public String getName() { + return getConfig().getName(); + } + + /** + * @return the location type + */ + public String getType() { + return getConfig().getType(); + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParameter.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/LocationConfig.java similarity index 53% rename from bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParameter.java rename to bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/LocationConfig.java index cfcdb8f78e22d..3f915a6d2b6d7 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/action/ActionParameter.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/location/LocationConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,35 +10,24 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.innogysmarthome.internal.client.entity.action; - -import org.openhab.binding.innogysmarthome.internal.client.entity.Constant; - -import com.google.api.client.util.Key; +package org.openhab.binding.innogysmarthome.internal.client.entity.location; /** - * Defines the {@link ActionParameter} data structure needed to pass parameters within an {@link Action} to the innogy - * SmartHome backend. + * Defines the structure of the configuration of a {@link Location}. * * @author Oliver Kuhl - Initial contribution */ -public class ActionParameter { - - @Key("name") +public class LocationConfig { + /** + * Name of the {@link Location} + */ private String name; - @Key("type") + /** + * Type of the {@link Location} + */ private String type; - @Key("Constant") - private Constant constant; - - public ActionParameter(String name, String type, Constant constant) { - this.name = name; - this.type = type; - this.constant = constant; - } - /** * @return the name */ @@ -66,19 +55,4 @@ public String getType() { public void setType(String type) { this.type = type; } - - /** - * @return the constant - */ - public Constant getConstant() { - return constant; - } - - /** - * @param constant the constant to set - */ - public void setConstant(Constant constant) { - this.constant = constant; - } - } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Message.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/Message.java similarity index 73% rename from bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Message.java rename to bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/Message.java index 6f72b481835b5..372dd349e64b4 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/Message.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,14 +10,10 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.openhab.binding.innogysmarthome.internal.client.entity; +package org.openhab.binding.innogysmarthome.internal.client.entity.message; import java.util.List; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; - -import com.google.api.client.util.Key; - /** * Defines the structure of a {@link Message}. Messages are part of the innogy system and besides other things are used * to raise battery warnings. @@ -79,80 +75,47 @@ public class Message { /** * Identifier of the message – must be unique. */ - @Key("id") private String id; /** * Specifies the type of the message. */ - @Key("type") private String type; /** - * Defines whether it is an alert or a message, default is message. + * Defines whether the message has been viewed by a user. */ - @Key("class") - private String messageClass; + private boolean isRead; /** - * Reference to the description of the message. - * - * Optional. + * Defines whether it is an alert or a message, default is message. */ - @Key("desc") - private String desc; - + private String messageClass; /** * Timestamp when the message was created. * * Optional. */ - @Key("timestamp") private String timestamp; - /** - * Defines whether the message has been viewed by a user. - */ - @Key("read") - private boolean isRead; - - /** - * Reference to the underlying product, which the message relates to. - */ - @Key("Product") - private Link productLink; - /** * Reference to the underlying devices, which the message relates to. * * Optional. */ - @Key("Devices") - private List<Link> deviceLinkList; - - /** - * Reference to the underlying capabilities, which the message relates to. - * - * Optional. - */ - @Key("Capabilities") - private List<Link> capabilityLinkList; + private List<String> deviceLinkList; /** * Container for all parameters of the message. The parameters are contained in Property entities. * * Optional. */ - @Key("Data") - private List<Property> dataPropertyList; + private MessageProperties properties; /** - * Container for tagging the message, e.g. if the message should only be visible to certain roles. - * - * Optional. + * The product (context) that generated the message. */ - @Key("Tags") - private List<Property> tagsPropertyList; + private String namespace; /** * @return the id @@ -196,20 +159,6 @@ public void setMessageClass(String messageClass) { this.messageClass = messageClass; } - /** - * @return the desc - */ - public String getDesc() { - return desc; - } - - /** - * @param desc the desc to set - */ - public void setDesc(String desc) { - this.desc = desc; - } - /** * @return the timestamp */ @@ -238,73 +187,63 @@ public void setRead(boolean isRead) { this.isRead = isRead; } - /** - * @return the productLink - */ - public Link getProductLink() { - return productLink; - } - - /** - * @param productLink the productLink to set - */ - public void setProductLink(Link productLink) { - this.productLink = productLink; - } - /** * @return the deviceLinkList */ - public List<Link> getDeviceLinkList() { + public List<String> getDeviceLinkList() { return deviceLinkList; } /** * @param deviceLinkList the deviceLinkList to set */ - public void setDeviceLinkList(List<Link> deviceLinkList) { + public void setDeviceLinkList(List<String> deviceLinkList) { this.deviceLinkList = deviceLinkList; } /** - * @return the capabilityLinkList + * @return the dataPropertyList */ - public List<Link> getCapabilityLinkList() { - return capabilityLinkList; + public MessageProperties getProperties() { + return properties; } /** - * @param capabilityLinkList the capabilityLinkList to set + * @param dataPropertyList the dataPropertyList to set */ - public void setCapabilityLinkList(List<Link> capabilityLinkList) { - this.capabilityLinkList = capabilityLinkList; + public void setProperties(MessageProperties properties) { + this.properties = properties; } /** - * @return the dataPropertyList + * @return the namespace */ - public List<Property> getDataPropertyList() { - return dataPropertyList; + public String getNamespace() { + return namespace; } /** - * @param dataPropertyList the dataPropertyList to set + * @param namespace the namespace to set */ - public void setDataPropertyList(List<Property> dataPropertyList) { - this.dataPropertyList = dataPropertyList; + public void setNamespace(String namespace) { + this.namespace = namespace; } /** - * @return the tagsPropertyList + * Returns true, if the message is of type "DeviceUnreachable". + * + * @return */ - public List<Property> getTagsPropertyList() { - return tagsPropertyList; + public boolean isTypeDeviceUnreachable() { + return TYPE_DEVICE_UNREACHABLE.equals(type); } /** - * @param tagsPropertyList the tagsPropertyList to set + * Returns true, if the message is of type "DeviceLowBattery". + * + * @return */ - public void setTagsPropertyList(List<Property> tagsPropertyList) { - this.tagsPropertyList = tagsPropertyList; + public boolean isTypeDeviceLowBattery() { + return TYPE_DEVICE_LOW_BATTERY.equals(type); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/MessageProperties.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/MessageProperties.java new file mode 100644 index 0000000000000..ae6a06cc1a6d1 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/message/MessageProperties.java @@ -0,0 +1,79 @@ +/** + * 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.innogysmarthome.internal.client.entity.message; + +import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class MessageProperties { + /** + * Name of the referenced {@link Device} + */ + private String deviceName; + + /** + * Serialnumber of the referenced {@link Device} + */ + private String serialNumber; + + /** + * Locationname of the referenced {@link Device} + */ + private String locationName; + + /** + * @return the deviceName + */ + public String getDeviceName() { + return deviceName; + } + + /** + * @param deviceName the deviceName to set + */ + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + /** + * @return the serialNumber + */ + public String getSerialNumber() { + return serialNumber; + } + + /** + * @param serialNumber the serialNumber to set + */ + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + /** + * @return the locationName + */ + public String getLocationName() { + return locationName; + } + + /** + * @param locationName the locationName to set + */ + public void setLocationName(String locationName) { + this.locationName = locationName; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BaseState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BaseState.java new file mode 100644 index 0000000000000..7f262f6c5410e --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BaseState.java @@ -0,0 +1,35 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public abstract class BaseState { + private String lastChanged; + + /** + * @return the lastChanged + */ + public String getLastChanged() { + return lastChanged; + } + + /** + * @param lastChanged the lastChanged to set + */ + public void setLastChanged(String lastChanged) { + this.lastChanged = lastChanged; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BooleanState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BooleanState.java new file mode 100644 index 0000000000000..b6e43852688a5 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/BooleanState.java @@ -0,0 +1,35 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class BooleanState extends BaseState { + private Boolean value; + + /** + * @return the value + */ + public Boolean getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(Boolean value) { + this.value = value; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/CapabilityState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/CapabilityState.java deleted file mode 100644 index 305e182c78807..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/CapabilityState.java +++ /dev/null @@ -1,415 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity.state; - -import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; - -/** - * Defines the {@link CapabilityState}, that holds the state of a {@link Capability}, e.g. a temperature. - * - * @author Oliver Kuhl - Initial contribution - */ -public class CapabilityState extends EntityState { - public static final String STATE_NAME_VARIABLE_ACTUATOR = "Value"; - public static final String STATE_NAME_SWITCH_ACTUATOR = "OnState"; - public static final String STATE_NAME_TEMPERATURE_SENSOR_TEMPERATURE = "Temperature"; - public static final String STATE_NAME_TEMPERATURE_SENSOR_FROST_WARNING = "FrostWarning"; - public static final String STATE_NAME_THERMOSTAT_ACTUATOR_POINT_TEMPERATURE = "PointTemperature"; - public static final String STATE_NAME_THERMOSTAT_ACTUATOR_OPERATION_MODE = "OperationMode"; - public static final String STATE_NAME_THERMOSTAT_ACTUATOR_WINDOW_REDUCTION_ACTIVE = "WindowReductionActive"; - public static final String STATE_NAME_HUMIDITY_SENSOR_HUMIDITY = "Humidity"; - public static final String STATE_NAME_HUMIDITY_SENSOR_MOLD_WARNING = "MoldWarning"; - public static final String STATE_NAME_WINDOW_DOOR_SENSOR = "IsOpen"; - public static final String STATE_NAME_SMOKE_DETECTOR_SENSOR = "IsSmokeAlarm"; - public static final String STATE_NAME_ALARM_ACTUATOR = "OnState"; - public static final String STATE_NAME_MOTION_DETECTION_SENSOR = "MotionDetectedCount"; - public static final String STATE_NAME_LUMINANCE_SENSOR = "Luminance"; - public static final String STATE_NAME_PUSH_BUTTON_SENSOR_COUNTER = "LastKeyPressCounter"; - public static final String STATE_NAME_PUSH_BUTTON_SENSOR_BUTTON_INDEX = "LastPressedButtonIndex"; - public static final String STATE_NAME_DIMMER_ACTUATOR = "DimLevel"; - public static final String STATE_NAME_ROLLERSHUTTER_ACTUATOR = "ShutterLevel"; - - // ENERGY CONSUMPTION SENSOR - public static final String STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_KWH = "EnergyConsumptionMonthKWh"; - public static final String STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ABSOLUTE_ENERGY_CONSUMPTION = "AbsoluteEnergyConsumption"; - public static final String STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_EURO = "EnergyConsumptionMonthEuro"; - public static final String STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_EURO = "EnergyConsumptionDayEuro"; - public static final String STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_KWH = "EnergyConsumptionDayKWh"; - // POWER CONSUMPTION SENSOR - public static final String STATE_NAME_POWER_CONSUMPTION_SENSOR_POWER_CONSUMPTION_WATT = "PowerConsumptionWatt"; - // GENERATION METER ENERGY SENSOR - public static final String STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_KWH = "EnergyPerMonthInKWh"; - public static final String STATE_NAME_GENERATION_METER_ENERGY_SENSOR_TOTAL_ENERGY = "TotalEnergy"; - public static final String STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_EURO = "EnergyPerMonthInEuro"; - public static final String STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_EURO = "EnergyPerDayInEuro"; - public static final String STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_KWH = "EnergyPerDayInKWh"; - // GENERATION METER POWER CONSUMPTION SENSOR - public static final String STATE_NAME_GENERATION_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT = "PowerInWatt"; - // TWO WAY METER ENERGY CONSUMPTION SENSOR - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_KWH = "EnergyPerMonthInKWh"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_TOTAL_ENERGY = "TotalEnergy"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_EURO = "EnergyPerMonthInEuro"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_EURO = "EnergyPerDayInEuro"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_KWH = "EnergyPerDayInKWh"; - // TWO WAY METER ENERGY FEED SENSOR - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_KWH = "EnergyPerMonthInKWh"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_TOTAL_ENERGY = "TotalEnergy"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_EURO = "EnergyPerMonthInEuro"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_EURO = "EnergyPerDayInEuro"; - public static final String STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_KWH = "EnergyPerDayInKWh"; - // TWO WAY METER POWER CONSUMPTION SENSOR - public static final String STATE_NAME_TWO_WAY_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT = "PowerInWatt"; - - public static final String STATE_VALUE_OPERATION_MODE_AUTO = "Auto"; - public static final String STATE_VALUE_OPERATION_MODE_MANUAL = "Manu"; - - public Boolean getVariableActuatorState() { - return getPropertyValueAsBoolean(STATE_NAME_VARIABLE_ACTUATOR); - } - - public void setVariableActuatorState(boolean on) { - setPropertyValueAsBoolean(STATE_NAME_VARIABLE_ACTUATOR, on); - } - - public Boolean getSwitchActuatorState() { - return getPropertyValueAsBoolean(STATE_NAME_SWITCH_ACTUATOR); - } - - public void setSwitchActuatorState(boolean on) { - setPropertyValueAsBoolean(STATE_NAME_SWITCH_ACTUATOR, on); - } - - public Double getTemperatureSensorTemperatureState() { - return getPropertyValueAsDouble(STATE_NAME_TEMPERATURE_SENSOR_TEMPERATURE); - } - - public void setTemperatureSensorTemperatureState(double temperature) { - setPropertyValueAsDouble(STATE_NAME_TEMPERATURE_SENSOR_TEMPERATURE, temperature); - } - - public Boolean getTemperatureSensorFrostWarningState() { - return getPropertyValueAsBoolean(STATE_NAME_TEMPERATURE_SENSOR_FROST_WARNING); - } - - public void setTemperatureSensorFrostWarningState(boolean frostWarning) { - setPropertyValueAsBoolean(STATE_NAME_TEMPERATURE_SENSOR_FROST_WARNING, frostWarning); - } - - public Double getThermostatActuatorPointTemperatureState() { - return getPropertyValueAsDouble(STATE_NAME_THERMOSTAT_ACTUATOR_POINT_TEMPERATURE); - } - - public void setThermostatActuatorPointTemperatureState(double pointTemperature) { - setPropertyValueAsDouble(STATE_NAME_THERMOSTAT_ACTUATOR_POINT_TEMPERATURE, pointTemperature); - } - - public String getThermostatActuatorOperationModeState() { - return getPropertyValueAsString(STATE_NAME_THERMOSTAT_ACTUATOR_OPERATION_MODE); - } - - public void setThermostatActuatorOperationModeState(String operationMode) { - if (operationMode.equals(STATE_VALUE_OPERATION_MODE_MANUAL)) { - setPropertyValueAsString(STATE_NAME_THERMOSTAT_ACTUATOR_OPERATION_MODE, STATE_VALUE_OPERATION_MODE_MANUAL); - } else { - setPropertyValueAsString(STATE_NAME_THERMOSTAT_ACTUATOR_OPERATION_MODE, STATE_VALUE_OPERATION_MODE_AUTO); - } - } - - public Boolean getThermostatActuatorWindowReductionActiveState() { - return getPropertyValueAsBoolean(STATE_NAME_THERMOSTAT_ACTUATOR_WINDOW_REDUCTION_ACTIVE); - } - - public void setThermostatActuatorWindowReductionActiveState(boolean windowReductionActive) { - setPropertyValueAsBoolean(STATE_NAME_THERMOSTAT_ACTUATOR_WINDOW_REDUCTION_ACTIVE, windowReductionActive); - } - - public Double getHumiditySensorHumidityState() { - return getPropertyValueAsDouble(STATE_NAME_HUMIDITY_SENSOR_HUMIDITY); - } - - public void setHumiditySensorHumidityState(double humidity) { - setPropertyValueAsDouble(STATE_NAME_HUMIDITY_SENSOR_HUMIDITY, humidity); - } - - public Boolean getHumiditySensorMoldWarningState() { - return getPropertyValueAsBoolean(STATE_NAME_HUMIDITY_SENSOR_MOLD_WARNING); - } - - public void setHumiditySensorMoldWarningState(boolean moldWarning) { - setPropertyValueAsBoolean(STATE_NAME_HUMIDITY_SENSOR_MOLD_WARNING, moldWarning); - } - - public Boolean getWindowDoorSensorState() { - return getPropertyValueAsBoolean(STATE_NAME_WINDOW_DOOR_SENSOR); - } - - public void setWindowDoorSensorState(boolean open) { - setPropertyValueAsBoolean(STATE_NAME_WINDOW_DOOR_SENSOR, open); - } - - public Boolean getSmokeDetectorSensorState() { - return getPropertyValueAsBoolean(STATE_NAME_SMOKE_DETECTOR_SENSOR); - } - - public void setSmokeDetectorSensorState(boolean on) { - setPropertyValueAsBoolean(STATE_NAME_SMOKE_DETECTOR_SENSOR, on); - } - - public Boolean getAlarmActuatorState() { - return getPropertyValueAsBoolean(STATE_NAME_ALARM_ACTUATOR); - } - - public void setAlarmActuatorState(boolean on) { - setPropertyValueAsBoolean(STATE_NAME_ALARM_ACTUATOR, on); - } - - public Double getMotionDetectionSensorState() { - return getPropertyValueAsDouble(STATE_NAME_MOTION_DETECTION_SENSOR); - } - - public void setMotionDetectionSensorState(double numberOfMotions) { - setPropertyValueAsDouble(STATE_NAME_MOTION_DETECTION_SENSOR, numberOfMotions); - } - - public Double getLuminanceSensorState() { - return getPropertyValueAsDouble(STATE_NAME_LUMINANCE_SENSOR); - } - - public void setLuminanceSensorState(double luminance) { - setPropertyValueAsDouble(STATE_NAME_LUMINANCE_SENSOR, luminance); - } - - public Double getPushButtonSensorCounterState() { - return getPropertyValueAsDouble(STATE_NAME_PUSH_BUTTON_SENSOR_COUNTER); - } - - public void setPushButtonSensorCounterState(double numberOfPresses) { - setPropertyValueAsDouble(STATE_NAME_PUSH_BUTTON_SENSOR_COUNTER, numberOfPresses); - } - - public Double getPushButtonSensorButtonIndexState() { - return getPropertyValueAsDouble(STATE_NAME_PUSH_BUTTON_SENSOR_BUTTON_INDEX); - } - - public void setPushButtonSensorButtonIndexState(double buttonIndex) { - setPropertyValueAsDouble(STATE_NAME_PUSH_BUTTON_SENSOR_BUTTON_INDEX, buttonIndex); - } - - public Double getDimmerActuatorState() { - return getPropertyValueAsDouble(STATE_NAME_DIMMER_ACTUATOR); - } - - public void setDimmerActuatorState(double DimLevel) { - setPropertyValueAsDouble(STATE_NAME_DIMMER_ACTUATOR, DimLevel); - } - - public Double getRollerShutterActuatorState() { - return getPropertyValueAsDouble(STATE_NAME_ROLLERSHUTTER_ACTUATOR); - } - - public void setRollerShutterActuatorState(double rollerShutterLevel) { - setPropertyValueAsDouble(STATE_NAME_ROLLERSHUTTER_ACTUATOR, rollerShutterLevel); - } - - // ENERGY CONSUMPTION SENSOR - public Double getEnergyConsumptionSensorEnergyConsumptionMonthKWhState() { - return getPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_KWH); - } - - public void setEnergyConsumptionSensorEnergyConsumptionMonthKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_KWH, state); - } - - public Double getEnergyConsumptionSensorAbsoluteEnergyConsumptionState() { - return getPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ABSOLUTE_ENERGY_CONSUMPTION); - } - - public void setEnergyConsumptionSensorAbsoluteEnergyConsumptionState(double state) { - setPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ABSOLUTE_ENERGY_CONSUMPTION, state); - } - - public Double getEnergyConsumptionSensorEnergyConsumptionMonthEuroState() { - return getPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_EURO); - } - - public void setEnergyConsumptionSensorEnergyConsumptionMonthEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_EURO, state); - } - - public Double getEnergyConsumptionSensorEnergyConsumptionDayEuroState() { - return getPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_EURO); - } - - public void setEnergyConsumptionSensorEnergyConsumptionDayEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_EURO, state); - } - - public Double getEnergyConsumptionSensorEnergyConsumptionDayKWhState() { - return getPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_KWH); - } - - public void setEnergyConsumptionSensorEnergyConsumptionDayKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_KWH, state); - } - - // POWER CONSUMPTION SENSOR - public Double getPowerConsumptionSensorPowerConsumptionWattState() { - return getPropertyValueAsDouble(STATE_NAME_POWER_CONSUMPTION_SENSOR_POWER_CONSUMPTION_WATT); - } - - public void setPowerConsumptionSensorPowerConsumptionWattState(double state) { - setPropertyValueAsDouble(STATE_NAME_POWER_CONSUMPTION_SENSOR_POWER_CONSUMPTION_WATT, state); - } - - // GENERATION METER ENGERY SENSOR - public Double getGenerationMeterEnergySensorEnergyPerMonthInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_KWH); - } - - public void setGenerationMeterEnergySensorEnergyPerMonthInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_KWH, state); - } - - public Double getGenerationMeterEnergySensorTotalEnergyState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_TOTAL_ENERGY); - } - - public void setGenerationMeterEnergySensorTotalEnergyState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_TOTAL_ENERGY, state); - } - - public Double getGenerationMeterEnergySensorEnergyPerMonthInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_EURO); - } - - public void setGenerationMeterEnergySensorEnergyPerMonthInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_EURO, state); - } - - public Double getGenerationMeterEnergySensorEnergyPerDayInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_EURO); - } - - public void setGenerationMeterEnergySensorEnergyPerDayInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_EURO, state); - } - - public Double getGenerationMeterEnergySensorEnergyPerDayInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_KWH); - } - - public void setGenerationMeterEnergySensorEnergyPerDayInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_KWH, state); - } - - // GENERATION METER POWER CONSUMPTION SENSOR - public Double getGenerationMeterPowerConsumptionSensorPowerInWattState() { - return getPropertyValueAsDouble(STATE_NAME_GENERATION_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT); - } - - public void setGenerationMeterPowerConsumptionSensorPowerInWattState(double state) { - setPropertyValueAsDouble(STATE_NAME_GENERATION_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT, state); - } - - // TWO WAY METER ENERGY CONSUMPTION SENSOR - public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_KWH); - } - - public void setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_KWH, state); - } - - public Double getTwoWayMeterEnergyConsumptionSensorTotalEnergyState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_TOTAL_ENERGY); - } - - public void setTwoWayMeterEnergyConsumptionSensorTotalEnergyState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_TOTAL_ENERGY, state); - } - - public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_EURO); - } - - public void setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_EURO, state); - } - - public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_EURO); - } - - public void setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_EURO, state); - } - - public Double getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_KWH); - } - - public void setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_KWH, state); - } - - // TWO WAY METER ENERGY FEED SENSOR - public Double getTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_KWH); - } - - public void setTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_KWH, state); - } - - public Double getTwoWayMeterEnergyFeedSensorTotalEnergyState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_TOTAL_ENERGY); - } - - public void setTwoWayMeterEnergyFeedSensorTotalEnergyState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_TOTAL_ENERGY, state); - } - - public Double getTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_EURO); - } - - public void setTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_EURO, state); - } - - public Double getTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_EURO); - } - - public void setTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_EURO, state); - } - - public Double getTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_KWH); - } - - public void setTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_KWH, state); - } - - // TWO WAY METER POWER CONSUMPTION SENSOR - public Double getTwoWayMeterPowerConsumptionSensorPowerInWattState() { - return getPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT); - } - - public void setTwoWayMeterPowerConsumptionSensorPowerInWattState(double state) { - setPropertyValueAsDouble(STATE_NAME_TWO_WAY_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT, state); - } - -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DateTimeState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DateTimeState.java new file mode 100644 index 0000000000000..0a5801d68c500 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DateTimeState.java @@ -0,0 +1,35 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class DateTimeState extends BaseState { + private String value; + + /** + * @return the value + */ + public String getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DeviceState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DeviceState.java deleted file mode 100644 index d4a52e69a7535..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DeviceState.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity.state; - -import org.openhab.binding.innogysmarthome.internal.client.Util; -import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; - -/** - * Defines the {@link DeviceState}, e.g. if the device is reachable. - * - * @author Oliver Kuhl - Initial contribution - */ -public class DeviceState extends EntityState { - - /** - * Returns true if the device is reachable, false otherwise. - * - * @return true or false for "reachable" {@link Device}s, else null. - */ - public Boolean isReachable() { - return getPropertyValueAsBoolean(STATE_NAME_ISREACHABLE); - } - - /** - * Sets if the {@link Device} is reachable. - * - * @param isReachable - */ - public void setReachable(boolean isReachable) { - setPropertyValueAsBoolean(STATE_NAME_ISREACHABLE, isReachable); - } - - /** - * Returns the configuration state of the device. - * - * @return the configuration state - */ - public String getDeviceConfigurationState() { - return getPropertyValueAsString(STATE_NAME_DEVICECONFIGURATIONSTATE); - } - - /** - * Returns the device inclusion state. - * - * @return the device inclusion state - */ - public String getDeviceInclusionState() { - return getPropertyValueAsString(STATE_NAME_DEVICEINCLUSIONSTATE); - } - - /** - * Returns true, if the device is included. - * - * @return true, if the {@link Device} is "Included" - */ - public boolean deviceIsIncluded() { - return Util.equalsIfPresent(getDeviceInclusionState(), DEVICE_INCLUSION_STATE_INCLUDED); - } - - /** - * Returns true, if the device inclusion state is "InclusionPending". - * - * @return true, if the inclusion state is "InclusionPending" - */ - public Boolean deviceInclusionIsPending() { - return Util.equalsIfPresent(getDeviceInclusionState(), DEVICE_INCLUSION_STATE_PENDING); - } - - /** - * Return the update state of the {@link Device}. - * - * @return the update state - */ - public String getDeviceUpdateState() { - return getPropertyValueAsString(STATE_NAME_UPDATESTATE); - } - - /** - * Returns true if the {@link Device} is up to date. - * - * @return true, if the deviceUpdateState is "UpToDate" - */ - public Boolean deviceIsUpToDate() { - return Util.equalsIfPresent(getDeviceUpdateState(), DEVICE_UPDATE_STATE_UPTODATE); - } - - /** - * Returns the firmware version of the {@link Device}. - * - * @return the firmware version - */ - public String getFirmwareVersion() { - return getPropertyValueAsString(STATE_NAME_FIRMWAREVERSION); - } -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DoubleState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DoubleState.java new file mode 100644 index 0000000000000..ccb7e69486588 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/DoubleState.java @@ -0,0 +1,36 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class DoubleState extends BaseState { + private Double value; + + /** + * @return the value + */ + public Double getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(Double value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/IntegerState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/IntegerState.java new file mode 100644 index 0000000000000..b0a4984a7b8af --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/IntegerState.java @@ -0,0 +1,36 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class IntegerState extends BaseState { + private Integer value; + + /** + * @return the value + */ + public Integer getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(Integer value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StatePropertyList.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StatePropertyList.java deleted file mode 100644 index 3a0baca704c7c..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StatePropertyList.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.entity.state; - -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.openhab.binding.innogysmarthome.internal.client.Util; -import org.openhab.binding.innogysmarthome.internal.client.entity.Property; -import org.openhab.binding.innogysmarthome.internal.client.entity.PropertyList; - -import com.google.api.client.util.DateTime; -import com.google.api.client.util.Key; - -/** - * The {@link StatePropertyList} holds a list of state properties. - * - * @author Oliver Kuhl - Initial contribution - */ -public abstract class StatePropertyList extends PropertyList { - - /** state property field names */ - protected static final String STATE_PROPERTY_KEY_NAME = "name"; - protected static final String STATE_PROPERTY_KEY_VALUE = "value"; - protected static final String STATE_PROPERTY_KEY_LASTCHANGED = "lastchanged"; - - /** state name list */ - protected static final String STATE_NAME_ISREACHABLE = "IsReachable"; - protected static final String STATE_NAME_DEVICECONFIGURATIONSTATE = "DeviceConfigurationState"; - protected static final String STATE_NAME_DEVICEINCLUSIONSTATE = "DeviceInclusionState"; - protected static final String STATE_NAME_UPDATESTATE = "UpdateState"; - protected static final String STATE_NAME_FIRMWAREVERSION = "FirmwareVersion"; - - /** state name list - SHC specials */ - protected static final String STATE_NAME_UPDATEAVAILABLE = "UpdateAvailable"; - protected static final String STATE_NAME_LASTREBOOT = "LastReboot"; - protected static final String STATE_NAME_MBUSDONGLEATTACHED = "MBusDongleAttached"; - protected static final String STATE_NAME_LBDONGLEATTACHED = "LBDongleAttached"; - protected static final String STATE_NAME_CONFIGVERSION = "ConfigVersion"; - protected static final String STATE_NAME_OSSTATE = "OSState"; - protected static final String STATE_NAME_MEMORYLOAD = "MemoryLoad"; - protected static final String STATE_NAME_CPULOAD = "CPULoad"; - - protected static final String DEVICE_INCLUSION_STATE_INCLUDED = "Included"; - protected static final String DEVICE_INCLUSION_STATE_PENDING = "InclusionPending"; - - protected static final String DEVICE_UPDATE_STATE_UPTODATE = "UpToDate"; - - /** - * This represents a container of all configuration properties. - * - * Optional. - */ - @Key("State") - protected List<Property> stateList; - - protected HashMap<String, Property> stateMap; - - /** - * @return the stateList - */ - public List<Property> getStateList() { - return stateList; - } - - /** - * @param stateList the stateList to set - */ - public void setStateList(List<Property> stateList) { - this.stateList = stateList; - } - - /* - * (non-Javadoc) - * - * @see org.openhab.binding.innogysmarthome.internal.client.entity.PropertyList#getPropertyMap() - */ - @Override - protected Map<String, Property> getPropertyMap() { - if (stateMap == null) { - stateMap = PropertyList.getHashMap(stateList); - } - - return stateMap; - } - - /* - * (non-Javadoc) - * - * @see org.openhab.binding.innogysmarthome.internal.client.entity.PropertyList#getPropertyList() - */ - @Override - protected List<Property> getPropertyList() { - if (stateList == null) { - stateList = new ArrayList<>(); - } - - return stateList; - } - - /** - * @return - */ - public Map<String, Property> getStateMap() { - return getPropertyMap(); - } - - /** - * Returns the name of the state. - * - * @return - */ - public String getName() { - return getPropertyValueAsString(STATE_PROPERTY_KEY_NAME); - } - - /** - * Returns the value of the state. - * - * @return - */ - public Object getValue() { - return getPropertyValue(STATE_PROPERTY_KEY_VALUE); - } - - /** - * Returns the {@link DateTime}, when the last state change occurred. - * - * @return - */ - public ZonedDateTime getLastChanged() { - String time = getPropertyValueAsString(STATE_PROPERTY_KEY_LASTCHANGED); - if (time == null) { - return null; - } - return Util.convertZuluTimeStringToDate(time); - } - - /** - * Returns the String of the available Update or an empty {@link String} if none. - * - * @return - */ - public String getUpdateAvailable() { - return getPropertyValueAsString(STATE_NAME_UPDATEAVAILABLE); - } - - /** - * Return the {@link DateTime} of the last reboot. - * - * @return - */ - public ZonedDateTime getLastReboot() { - String time = getPropertyValueAsString(STATE_NAME_LASTREBOOT); - if (time == null) { - return null; - } - return Util.convertZuluTimeStringToDate(time); - } - - /** - * Returns the config version of the smarthome setup. - * - * The config version changes everytime, the configuration on the controller is changed and saved. - * - * @return - */ - public Integer getConfigVersion() { - return getPropertyValueAsInteger(STATE_NAME_CONFIGVERSION); - } -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StringState.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StringState.java new file mode 100644 index 0000000000000..6c4c334cc924c --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/entity/state/StringState.java @@ -0,0 +1,36 @@ +/** + * 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.innogysmarthome.internal.client.entity.state; + +/** + * @author Oliver Kuhl - Initial contribution + * + */ +public class StringState extends BaseState { + private String value; + + /** + * @return the value + */ + public String getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ApiException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ApiException.java index 2c0b636658a19..2d3f8f44c9b69 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ApiException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,19 +12,22 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, when the innogy SmartHome Client API returns an unknown error. * * @author Oliver Kuhl - Initial contribution */ -@SuppressWarnings("serial") +@NonNullByDefault public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + public ApiException() { } public ApiException(String message) { super(message); } - } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ConfigurationException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/AuthenticationException.java similarity index 50% rename from bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ConfigurationException.java rename to bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/AuthenticationException.java index 05d9d849695a8..9d7104bf2f5e4 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ConfigurationException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/AuthenticationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,19 +12,23 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** - * Thrown, if the {@Link Configuration} is not complete + * Thrown, if an authentication error is given. * - * @author Oliver Kuhl - Initial contribution + * @author Hilbrand Bouwkamp - Initial contribution * */ -@SuppressWarnings("serial") -public class ConfigurationException extends Exception { +@NonNullByDefault +public class AuthenticationException extends Exception { + + private static final long serialVersionUID = 1L; - public ConfigurationException() { + public AuthenticationException() { } - public ConfigurationException(String message) { + public AuthenticationException(String message) { super(message); } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ControllerOfflineException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ControllerOfflineException.java index a86fe674858f6..0360f61418887 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ControllerOfflineException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ControllerOfflineException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,15 +14,19 @@ import java.io.IOException; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, if the innogy SmartHome controller (SHC) is offline. * * @author Oliver Kuhl - Initial contribution * */ -@SuppressWarnings("serial") +@NonNullByDefault public class ControllerOfflineException extends IOException { + private static final long serialVersionUID = 1L; + public ControllerOfflineException() { } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidActionTriggeredException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidActionTriggeredException.java index b561b75eb9d1a..8882af10d3026 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidActionTriggeredException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidActionTriggeredException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,14 +12,19 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, if an action was called with invalid parameters. * * @author Oliver Kuhl - Initial contribution * */ -@SuppressWarnings("serial") +@NonNullByDefault public class InvalidActionTriggeredException extends ApiException { + + private static final long serialVersionUID = 1L; + public InvalidActionTriggeredException() { } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidAuthCodeException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidAuthCodeException.java deleted file mode 100644 index 471cf179bdc51..0000000000000 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/InvalidAuthCodeException.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.innogysmarthome.internal.client.exception; - -/** - * Thrown, if an error occurs fetching the access tokens. - * - * @author Oliver Kuhl - Initial contribution - * - */ -@SuppressWarnings("serial") -public class InvalidAuthCodeException extends ApiException { - - public InvalidAuthCodeException() { - } - - public InvalidAuthCodeException(String message) { - super(message); - } - -} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/RemoteAccessNotAllowedException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/RemoteAccessNotAllowedException.java index ca745d5e96c3d..6f4294f1cbe83 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/RemoteAccessNotAllowedException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/RemoteAccessNotAllowedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,15 +12,19 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, when the authorization fails with a "remote access not allowed" error. * * @author Oliver Kuhl - Initial contribution * */ -@SuppressWarnings("serial") +@NonNullByDefault public class RemoteAccessNotAllowedException extends ApiException { + private static final long serialVersionUID = 1L; + public RemoteAccessNotAllowedException() { } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ServiceUnavailableException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ServiceUnavailableException.java index f644dc7235912..32f3ed4a0b58a 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ServiceUnavailableException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/ServiceUnavailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,15 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, if the innogy service is unavailable (HTTP response 503). * * @author Oliver Kuhl - Initial contribution * */ +@NonNullByDefault public class ServiceUnavailableException extends ApiException { private static final long serialVersionUID = -9148687420729079329L; diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionExistsException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionExistsException.java index b7fb1ef7aad68..eff7e5c1bc3e8 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionExistsException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionExistsException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,15 +12,19 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, when a session already exists while initializing a new session. * * @author Oliver Kuhl - Initial contribution * */ -@SuppressWarnings("serial") +@NonNullByDefault public class SessionExistsException extends ApiException { + private static final long serialVersionUID = 1L; + public SessionExistsException() { } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionNotFoundException.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionNotFoundException.java index cd491f6cc6c08..2498d7e43968e 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionNotFoundException.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/client/exception/SessionNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,20 @@ */ package org.openhab.binding.innogysmarthome.internal.client.exception; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * Thrown, if the session is not initialized or disconnected. * * @author Oliver Kuhl - Initial contribution * */ -@SuppressWarnings("serial") +@NonNullByDefault public class SessionNotFoundException extends ApiException { + private static final long serialVersionUID = 1L; + public SessionNotFoundException() { - super(); } public SessionNotFoundException(String message) { diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyBridgeDiscoveryParticipant.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyBridgeDiscoveryParticipant.java index 847a61e2dcbfd..392488498df22 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyBridgeDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyBridgeDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,6 +19,8 @@ import javax.jmdns.ServiceInfo; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; import org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant; @@ -34,7 +36,8 @@ * * @author Oliver Kuhl - Initial contribution */ -@Component(immediate = true) +@Component(service = MDNSDiscoveryParticipant.class, configurationPid = "mdnsdiscovery.innogysmarthome") +@NonNullByDefault public class InnogyBridgeDiscoveryParticipant implements MDNSDiscoveryParticipant { private final Logger logger = LoggerFactory.getLogger(InnogyBridgeDiscoveryParticipant.class); @@ -50,7 +53,7 @@ public String getServiceType() { } @Override - public DiscoveryResult createResult(ServiceInfo service) { + public @Nullable DiscoveryResult createResult(ServiceInfo service) { ThingUID uid = getThingUID(service); if (uid != null) { DiscoveryResult result = DiscoveryResultBuilder.create(uid) @@ -61,7 +64,7 @@ public DiscoveryResult createResult(ServiceInfo service) { } @Override - public ThingUID getThingUID(ServiceInfo service) { + public @Nullable ThingUID getThingUID(@Nullable ServiceInfo service) { if (service != null) { String serviceName = service.getName(); if (serviceName.startsWith("SMARTHOME")) { @@ -70,7 +73,6 @@ public ThingUID getThingUID(ServiceInfo service) { return new ThingUID(THING_TYPE_BRIDGE, serviceName); } } - return null; } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyDeviceDiscoveryService.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyDeviceDiscoveryService.java index ab07e0c326329..c7a0b5156f0ea 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/discovery/InnogyDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,18 +14,21 @@ import static org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants.*; -import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; -import org.eclipse.smarthome.core.thing.binding.BridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; import org.openhab.binding.innogysmarthome.internal.handler.InnogyBridgeHandler; import org.openhab.binding.innogysmarthome.internal.handler.InnogyDeviceHandler; @@ -38,20 +41,21 @@ * * @author Oliver Kuhl - Initial contribution */ -public class InnogyDeviceDiscoveryService extends AbstractDiscoveryService { +@NonNullByDefault +public class InnogyDeviceDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, ThingHandlerService { + + private static final int SEARCH_TIME_SECONDS = 60; - private static final int SEARCH_TIME = 60; private final Logger logger = LoggerFactory.getLogger(InnogyDeviceDiscoveryService.class); - private InnogyBridgeHandler bridgeHandler; + + private @Nullable InnogyBridgeHandler bridgeHandler; /** - * Construct an {@link InnogyDeviceDiscoveryService} with the given {@link BridgeHandler}. - * - * @param bridgeHandler + * Construct an {@link InnogyDeviceDiscoveryService}. */ - public InnogyDeviceDiscoveryService(InnogyBridgeHandler bridgeHandler) { - super(SEARCH_TIME); - this.bridgeHandler = bridgeHandler; + public InnogyDeviceDiscoveryService() { + super(SEARCH_TIME_SECONDS); } /** @@ -73,10 +77,8 @@ public Set<ThingTypeUID> getSupportedThingTypes() { @Override protected void startScan() { logger.debug("SCAN for new innogy devices started..."); - - Collection<Device> devices = bridgeHandler.loadDevices(); - if (devices != null) { - for (Device d : devices) { + if (bridgeHandler != null) { + for (final Device d : bridgeHandler.loadDevices()) { onDeviceAdded(d); } } @@ -89,34 +91,36 @@ protected synchronized void stopScan() { } public void onDeviceAdded(Device device) { - ThingUID thingUID = getThingUID(device); - ThingTypeUID thingTypeUID = getThingTypeUID(device); - if (thingUID != null && thingTypeUID != null) { - - ThingUID bridgeUID = bridgeHandler.getThing().getUID(); + if (bridgeHandler == null) { + return; + } + final ThingUID bridgeUID = bridgeHandler.getThing().getUID(); + final ThingUID thingUID = getThingUID(bridgeUID, device); + final ThingTypeUID thingTypeUID = getThingTypeUID(device); - String name = device.getName(); + if (thingUID != null && thingTypeUID != null) { + String name = device.getConfig().getName(); if (name.isEmpty()) { name = device.getSerialnumber(); } - Map<String, Object> properties = new HashMap<>(); + final Map<String, Object> properties = new HashMap<>(); properties.put(PROPERTY_ID, device.getId()); - String label; + final String label; if (device.hasLocation()) { label = device.getType() + ": " + name + " (" + device.getLocation().getName() + ")"; } else { label = device.getType() + ": " + name; } - DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withThingType(thingTypeUID) + final DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withThingType(thingTypeUID) .withProperties(properties).withBridge(bridgeUID).withLabel(label).build(); thingDiscovered(discoveryResult); } else { logger.debug("Discovered unsupported device of type '{}' and name '{}' with id {}", device.getType(), - device.getName(), device.getId()); + device.getConfig().getName(), device.getId()); } } @@ -126,14 +130,12 @@ public void onDeviceAdded(Device device) { * @param device * @return */ - private ThingUID getThingUID(Device device) { - ThingUID bridgeUID = bridgeHandler.getThing().getUID(); - ThingTypeUID thingTypeUID = getThingTypeUID(device); + private @Nullable ThingUID getThingUID(ThingUID bridgeUID, Device device) { + final ThingTypeUID thingTypeUID = getThingTypeUID(device); if (thingTypeUID != null && getSupportedThingTypes().contains(thingTypeUID)) { return new ThingUID(thingTypeUID, bridgeUID, device.getId()); } - return null; } @@ -143,8 +145,20 @@ private ThingUID getThingUID(Device device) { * @param device * @return */ - private ThingTypeUID getThingTypeUID(Device device) { - String thingTypeId = device.getType(); + private @Nullable ThingTypeUID getThingTypeUID(Device device) { + final String thingTypeId = device.getType(); return thingTypeId != null ? new ThingTypeUID(BINDING_ID, thingTypeId) : null; } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof InnogyBridgeHandler) { + bridgeHandler = (InnogyBridgeHandler) handler; + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return bridgeHandler; + } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeConfiguration.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeConfiguration.java new file mode 100644 index 0000000000000..dd95903b35457 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeConfiguration.java @@ -0,0 +1,33 @@ +/** + * 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.innogysmarthome.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants; + +/** + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class InnogyBridgeConfiguration { + + public String brand = InnogyBindingConstants.DEFAULT_BRAND; + public String authcode = ""; + public int websocketidletimeout = 900; + + public String clientId = InnogyBindingConstants.CLIENT_ID_INNOGY_SMARTHOME; + public String clientSecret = InnogyBindingConstants.CLIENT_SECRET_INNOGY_SMARTHOME; + public String redirectUrl = InnogyBindingConstants.REDIRECT_URL_INNOGY_SMARTHOME; + +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeHandler.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeHandler.java index 263dd965131c8..e1e2cbdf64efb 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeHandler.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,24 +13,36 @@ package org.openhab.binding.innogysmarthome.internal.handler; import static org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants.*; +import static org.openhab.binding.innogysmarthome.internal.client.Constants.API_URL_TOKEN; import java.io.IOException; -import java.math.BigDecimal; import java.net.SocketTimeoutException; import java.net.URI; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.exception.ExceptionUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.auth.client.oauth2.AccessTokenRefreshListener; +import org.eclipse.smarthome.core.auth.client.oauth2.AccessTokenResponse; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthClientService; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthException; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthFactory; +import org.eclipse.smarthome.core.auth.client.oauth2.OAuthResponseException; +import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; @@ -38,33 +50,31 @@ import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; -import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants; import org.openhab.binding.innogysmarthome.internal.InnogyWebSocket; import org.openhab.binding.innogysmarthome.internal.client.InnogyClient; -import org.openhab.binding.innogysmarthome.internal.client.InnogyConfig; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; +import org.openhab.binding.innogysmarthome.internal.client.entity.device.DeviceConfig; +import org.openhab.binding.innogysmarthome.internal.client.entity.event.BaseEvent; import org.openhab.binding.innogysmarthome.internal.client.entity.event.Event; +import org.openhab.binding.innogysmarthome.internal.client.entity.event.MessageEvent; import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; import org.openhab.binding.innogysmarthome.internal.client.exception.ApiException; -import org.openhab.binding.innogysmarthome.internal.client.exception.ConfigurationException; +import org.openhab.binding.innogysmarthome.internal.client.exception.AuthenticationException; import org.openhab.binding.innogysmarthome.internal.client.exception.ControllerOfflineException; import org.openhab.binding.innogysmarthome.internal.client.exception.InvalidActionTriggeredException; -import org.openhab.binding.innogysmarthome.internal.client.exception.InvalidAuthCodeException; import org.openhab.binding.innogysmarthome.internal.client.exception.RemoteAccessNotAllowedException; import org.openhab.binding.innogysmarthome.internal.client.exception.SessionExistsException; +import org.openhab.binding.innogysmarthome.internal.discovery.InnogyDeviceDiscoveryService; import org.openhab.binding.innogysmarthome.internal.listener.DeviceStatusListener; import org.openhab.binding.innogysmarthome.internal.listener.EventListener; import org.openhab.binding.innogysmarthome.internal.manager.DeviceStructureManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.api.client.auth.oauth2.Credential; -import com.google.api.client.auth.oauth2.CredentialRefreshListener; -import com.google.api.client.auth.oauth2.TokenErrorResponse; -import com.google.api.client.auth.oauth2.TokenResponse; import com.google.gson.Gson; /** @@ -78,288 +88,286 @@ * to the innogy SmartHome webservice via the {@link InnogyClient}. * * @author Oliver Kuhl - Initial contribution + * @author Hilbrand Bouwkamp - Refactored to use openHAB http and oauth2 libraries */ -public class InnogyBridgeHandler extends BaseBridgeHandler implements CredentialRefreshListener, EventListener { +@NonNullByDefault +public class InnogyBridgeHandler extends BaseBridgeHandler + implements AccessTokenRefreshListener, EventListener, DeviceStatusListener { public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE); - private final Logger logger = LoggerFactory.getLogger(InnogyBridgeHandler.class); - private InnogyConfig innogyConfig; - private InnogyClient client; - private InnogyWebSocket webSocket; - private DeviceStructureManager deviceStructMan; - private Gson gson = new Gson(); - private Set<DeviceStatusListener> deviceStatusListeners = new CopyOnWriteArraySet<>(); + private static final long WEBSOCKET_TIMEOUT_RETRY_SECONDS = 5; - private ScheduledFuture<?> reinitJob; + private final Logger logger = LoggerFactory.getLogger(InnogyBridgeHandler.class); + private final Gson gson = new Gson(); + private final Object lock = new Object(); + private final Set<DeviceStatusListener> deviceStatusListeners = new CopyOnWriteArraySet<>(); + private final OAuthFactory oAuthFactory; + private final HttpClient httpClient; + + private @Nullable InnogyClient client; + private @Nullable InnogyWebSocket webSocket; + private @Nullable DeviceStructureManager deviceStructMan; + private @Nullable String bridgeId; + private @Nullable ScheduledFuture<?> reinitJob; + private @NonNullByDefault({}) InnogyBridgeConfiguration bridgeConfiguration; + private @Nullable OAuthClientService oAuthService; /** - * The {@link Initializer} class implements the initialization process of the bridge including starting the - * {@link DeviceStructureManager} (who loads all the {@link Device}s and states) and the {@link InnogyWebSocket}. - * - * @author Oliver Kuhl - Initial contribution + * Constructs a new {@link InnogyBridgeHandler}. * + * @param bridge Bridge thing to be used by this handler + * @param oAuthFactory Factory class to get OAuth2 service + * @param httpClient httpclient instance */ - private class Initializer implements Runnable { - - @Override - public void run() { - client = new InnogyClient(innogyConfig); - client.setCredentialRefreshListener(InnogyBridgeHandler.this); - try { - logger.debug("Initializing innogy SmartHome client..."); - client.initialize(); - } catch (Exception e) { - if (!handleClientException(e)) { - logger.error("Error initializing innogy SmartHome client.", e); - return; - } - } - - if (StringUtils.isNotBlank(client.getConfig().getRefreshToken())) { - getThing().getConfiguration().put(CONFIG_REFRESH_TOKEN, client.getConfig().getRefreshToken()); - if (StringUtils.isNotBlank(client.getConfig().getAccessToken())) { - getThing().getConfiguration().put(CONFIG_ACCESS_TOKEN, client.getConfig().getAccessToken()); - } - Configuration configuration = editConfiguration(); - configuration.put(CONFIG_AUTH_CODE, ""); - updateConfiguration(configuration); - innogyConfig.setAuthCode(""); - } - - deviceStructMan = new DeviceStructureManager(client); - try { - deviceStructMan.start(); - } catch (Exception e) { - if (!handleClientException(e)) { - logger.error("Error starting device structure manager.", e); - return; - } - } + public InnogyBridgeHandler(final Bridge bridge, final OAuthFactory oAuthFactory, final HttpClient httpClient) { + super(bridge); + this.oAuthFactory = oAuthFactory; + this.httpClient = httpClient; + } - updateStatus(ThingStatus.ONLINE); - setBridgeProperties(deviceStructMan.getBridgeDevice()); + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + // not needed + } - onEventRunnerStopped(); - } + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(InnogyDeviceDiscoveryService.class); + } - private void setBridgeProperties(Device bridgeDevice) { - Map<String, String> properties = editProperties(); - properties.put(Thing.PROPERTY_VENDOR, bridgeDevice.getManufacturer()); - properties.put(Thing.PROPERTY_SERIAL_NUMBER, bridgeDevice.getSerialnumber()); - properties.put(PROPERTY_ID, bridgeDevice.getId()); - properties.put(Thing.PROPERTY_FIRMWARE_VERSION, bridgeDevice.getFirmwareVersion()); - properties.put(Thing.PROPERTY_HARDWARE_VERSION, bridgeDevice.getHardwareVersion()); - properties.put(PROPERTY_SOFTWARE_VERSION, bridgeDevice.getSoftwareVersion()); - properties.put(PROPERTY_IP_ADDRESS, bridgeDevice.getIpAddress()); - properties.put(Thing.PROPERTY_MAC_ADDRESS, bridgeDevice.getMacAddress()); - properties.put(PROPERTY_REGISTRATION_TIME, bridgeDevice.getRegistrationTimeFormattedString()); - updateProperties(properties); + @Override + public void initialize() { + logger.debug("Initializing innogy SmartHome BridgeHandler..."); + final InnogyBridgeConfiguration bridgeConfiguration = getConfigAs(InnogyBridgeConfiguration.class); + if (checkConfig(bridgeConfiguration)) { + this.bridgeConfiguration = bridgeConfiguration; + scheduler.execute(this::initializeClient); } } /** - * Runnable to run the websocket for receiving permanent update {@link Event}s from the innogy API. + * Checks bridge configuration. If configuration is valid returns true. * - * @author Oliver Kuhl - Initial contribution + * @return true if the configuration if valid */ - private class WebSocketRunner implements Runnable { - - private InnogyBridgeHandler bridgeHandler; - - /** - * Constructs the {@link WebSocketRunner} with the given {@link InnogyBridgeHandler}. - * - * @param bridgeHandler - */ - public WebSocketRunner(InnogyBridgeHandler bridgeHandler) { - this.bridgeHandler = bridgeHandler; + private boolean checkConfig(final InnogyBridgeConfiguration bridgeConfiguration) { + if (BRAND_INNOGY_SMARTHOME.equals(bridgeConfiguration.brand)) { + return true; + } else { + logger.debug("Invalid brand '{}'. Make sure to select a brand in the SHC thing configuration!", + bridgeConfiguration.brand); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Invalid brand '" + + bridgeConfiguration.brand + "'. Make sure to select a brand in the SHC thing configuration!"); + return false; } + } - @Override - public void run() { - String webSocketUrl = WEBSOCKET_API_URL_EVENTS.replace("{token}", - (String) getConfig().get(CONFIG_ACCESS_TOKEN)); - logger.debug("WebSocket URL: {}...{}", webSocketUrl.substring(0, 70), - webSocketUrl.substring(webSocketUrl.length() - 10)); - - try { - if (webSocket != null && webSocket.isRunning()) { - webSocket.stop(); - webSocket = null; - } - - BigDecimal idleTimeout = (BigDecimal) getConfig().get(CONFIG_WEBSOCKET_IDLE_TIMEOUT); - webSocket = new InnogyWebSocket(bridgeHandler, URI.create(webSocketUrl), idleTimeout.intValue() * 1000); - logger.debug("Starting innogy websocket."); - webSocket.start(); - } catch (Exception e) { - if (!handleClientException(e)) { - logger.error("Error starting websocket.", e); - return; - } - } + /** + * Initializes the services and InnogyClient. + */ + private void initializeClient() { + final OAuthClientService oAuthService = oAuthFactory.createOAuthClientService(thing.getUID().getAsString(), + API_URL_TOKEN, API_URL_TOKEN, bridgeConfiguration.clientId, bridgeConfiguration.clientSecret, null, + true); + this.oAuthService = oAuthService; + + if (checkOnAuthCode()) { + final InnogyClient localClient = new InnogyClient(oAuthService, httpClient); + client = localClient; + deviceStructMan = new DeviceStructureManager(localClient); + oAuthService.addAccessTokenRefreshListener(this); + registerDeviceStatusListener(InnogyBridgeHandler.this); + scheduleRestartClient(0); } } /** - * Constructs a new {@link InnogyBridgeHandler}. + * Fetches the OAuth2 tokens from innogy SmartHome service if the auth code is set in the configuration and if + * successful removes the auth code. Returns true if the auth code was not set or if the authcode was successfully + * used to get a new refresh and access token. * - * @param bridge + * @return true if success */ - public InnogyBridgeHandler(Bridge bridge) { - super(bridge); + private boolean checkOnAuthCode() { + if (StringUtils.isNotBlank(bridgeConfiguration.authcode)) { + logger.debug("Trying to get access and refresh tokens"); + try { + oAuthService.getAccessTokenResponseByAuthorizationCode(bridgeConfiguration.authcode, + bridgeConfiguration.redirectUrl); + final Configuration configuration = editConfiguration(); + configuration.put(CONFIG_AUTH_CODE, ""); + updateConfiguration(configuration); + } catch (IOException | OAuthException | OAuthResponseException e) { + logger.debug("Error fetching access tokens. Invalid authcode! Please generate a new one. Detail: {}", + e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Cannot connect to innogy SmartHome service. Please set auth-code!"); + return false; + } + } + return true; } - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - // not needed + /** + * Initializes the client and connects to the innogy SmartHome service via Client API. Based on the provided + * {@Link Configuration} while constructing {@Link InnogyClient}, the given oauth2 access and refresh tokens are + * used or - if not yet available - new tokens are fetched from the service using the provided auth code. + */ + private void startClient() { + try { + logger.debug("Initializing innogy SmartHome client..."); + final InnogyClient localClient = this.client; + if (localClient != null) { + localClient.refreshStatus(); + } + } catch (AuthenticationException | ApiException | IOException e) { + if (handleClientException(e)) { + // If exception could not be handled properly it's no use to continue so we won't continue start + logger.debug("Error initializing innogy SmartHome client.", e); + return; + } + } + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } + try { + deviceStructMan.refreshDevices(); + } catch (IOException | ApiException | AuthenticationException e) { + if (handleClientException(e)) { + // If exception could not be handled properly it's no use to continue so we won't continue start + logger.debug("Error starting device structure manager.", e); + return; + } + } + setBridgeProperties(deviceStructMan.getBridgeDevice()); + bridgeId = deviceStructMan.getBridgeDevice().getId(); + startWebsocket(); + cancelReinitJob(); } - @Override - public void initialize() { - logger.debug("Initializing innogy SmartHome BridgeHandler..."); + /** + * Start the websocket connection for receiving permanent update {@link Event}s from the innogy API. + */ + private void startWebsocket() { + try { + final AccessTokenResponse accessTokenResponse = client.getAccessTokenResponse(); + final String webSocketUrl = WEBSOCKET_API_URL_EVENTS.replace("{token}", + accessTokenResponse.getAccessToken()); - // Start an extra thread to readout the configuration and check the connection, because it takes sometimes more - // than 5000 milliseconds and the handler will suspend (ThingStatus.UNINITIALIZED). - InnogyConfig config = loadAndCheckConfig(); + logger.debug("WebSocket URL: {}...{}", webSocketUrl.substring(0, 70), + webSocketUrl.substring(webSocketUrl.length() - 10)); + InnogyWebSocket localWebSocket = this.webSocket; - if (config != null) { - logger.debug("innogy config: {}", config.toString()); - scheduler.execute(new Initializer()); + if (localWebSocket != null && localWebSocket.isRunning()) { + localWebSocket.stop(); + this.webSocket = null; + } + localWebSocket = new InnogyWebSocket(this, URI.create(webSocketUrl), + bridgeConfiguration.websocketidletimeout * 1000); + logger.debug("Starting innogy websocket."); + this.webSocket = localWebSocket; + localWebSocket.start(); + updateStatus(ThingStatus.ONLINE); + } catch (final Exception e) { // Catch Exception because websocket start throws Exception + logger.warn("Error starting websocket.", e); + handleClientException(e); } } + @Override + public void onAccessTokenResponse(final AccessTokenResponse credential) { + scheduleRestartClient(REINITIALIZE_DELAY_SECONDS); + } + /** * Schedules a re-initialization in the given future. * * @param seconds */ - private void scheduleReinitialize(long seconds) { - if (reinitJob != null && !reinitJob.isDone()) { + private synchronized void scheduleRestartClient(final long seconds) { + final ScheduledFuture<?> localReinitJob = reinitJob; + + if (localReinitJob != null && !localReinitJob.isDone()) { logger.debug("Scheduling reinitialize in {} seconds - ignored: already triggered in {} seconds.", seconds, - reinitJob.getDelay(TimeUnit.SECONDS)); + localReinitJob.getDelay(TimeUnit.SECONDS)); return; } logger.debug("Scheduling reinitialize in {} seconds.", seconds); - reinitJob = scheduler.schedule(() -> initialize(), seconds, TimeUnit.SECONDS); + reinitJob = scheduler.scheduleWithFixedDelay(this::startClient, seconds, REINITIALIZE_RETRY_SECONDS, + TimeUnit.SECONDS); } - /** - * Schedules a re-initialization using the default {@link InnogyBindingConstants#REINITIALIZE_DELAY_SECONDS}. - */ - private void scheduleReinitialize() { - scheduleReinitialize(REINITIALIZE_DELAY_SECONDS); + private void setBridgeProperties(final Device bridgeDevice) { + final DeviceConfig config = bridgeDevice.getConfig(); + + logger.debug("Setting Bridge Device Properties for Bridge of type '{}' with ID '{}'", config.getName(), + bridgeDevice.getId()); + final Map<String, String> properties = editProperties(); + + setPropertyIfPresent(Thing.PROPERTY_VENDOR, bridgeDevice.getManufacturer(), properties); + setPropertyIfPresent(Thing.PROPERTY_SERIAL_NUMBER, bridgeDevice.getSerialnumber(), properties); + setPropertyIfPresent(PROPERTY_ID, bridgeDevice.getId(), properties); + setPropertyIfPresent(Thing.PROPERTY_FIRMWARE_VERSION, config.getFirmwareVersion(), properties); + setPropertyIfPresent(Thing.PROPERTY_HARDWARE_VERSION, config.getHardwareVersion(), properties); + setPropertyIfPresent(PROPERTY_SOFTWARE_VERSION, config.getSoftwareVersion(), properties); + setPropertyIfPresent(PROPERTY_IP_ADDRESS, config.getIPAddress(), properties); + setPropertyIfPresent(Thing.PROPERTY_MAC_ADDRESS, config.getMACAddress(), properties); + if (config.getRegistrationTime() != null) { + properties.put(PROPERTY_REGISTRATION_TIME, + config.getRegistrationTime().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); + } + setPropertyIfPresent(PROPERTY_CONFIGURATION_STATE, config.getConfigurationState(), properties); + setPropertyIfPresent(PROPERTY_SHC_TYPE, bridgeDevice.getType(), properties); + setPropertyIfPresent(PROPERTY_TIME_ZONE, config.getTimeZone(), properties); + setPropertyIfPresent(PROPERTY_PROTOCOL_ID, config.getProtocolId(), properties); + setPropertyIfPresent(PROPERTY_GEOLOCATION, config.getGeoLocation(), properties); + setPropertyIfPresent(PROPERTY_CURRENT_UTC_OFFSET, config.getCurrentUTCOffset(), properties); + setPropertyIfPresent(PROPERTY_BACKEND_CONNECTION_MONITORED, config.getBackendConnectionMonitored(), properties); + setPropertyIfPresent(PROPERTY_RFCOM_FAILURE_NOTIFICATION, config.getRFCommFailureNotification(), properties); + updateProperties(properties); } - /** - * Loads the {@link Configuration} of the bridge thing, creates an new - * {@link InnogyConfig}, checks and returns it. - * - * @return the {@link InnogyConfig} for the {@link InnogyClient}. - */ - private InnogyConfig loadAndCheckConfig() { - Configuration thingConfig = super.getConfig(); - - if (innogyConfig == null) { - innogyConfig = new InnogyConfig(); - } - - // load and check connection and authorization data - String brand; - if (StringUtils.isNotBlank((String) thingConfig.get(CONFIG_BRAND))) { - brand = thingConfig.get(CONFIG_BRAND).toString(); - } else { - brand = DEFAULT_BRAND; - } - switch (brand) { - case BRAND_INNOGY_SMARTHOME: - innogyConfig.setClientId(CLIENT_ID_INNOGY_SMARTHOME); - innogyConfig.setClientSecret(CLIENT_SECRET_INNOGY_SMARTHOME); - innogyConfig.setRedirectUrl(REDIRECT_URL_INNOGY_SMARTHOME); - break; - case BRAND_SMARTHOME_AUSTRIA: - innogyConfig.setClientId(CLIENT_ID_SMARTHOME_AUSTRIA); - innogyConfig.setClientSecret(CLIENT_SECRET_SMARTHOME_AUSTRIA); - innogyConfig.setRedirectUrl(REDIRECT_URL_SMARTHOME_AUSTRIA); - break; - case BRAND_START_SMARTHOME: - innogyConfig.setClientId(CLIENT_ID_START_SMARTHOME); - innogyConfig.setClientSecret(CLIENT_SECRET_START_SMARTHOME); - innogyConfig.setRedirectUrl(REDIRECT_URL_START_SMARTHOME); - break; - default: - logger.debug("Invalid brand '{}'. Make sure to select a brand in the SHC thing configuration!", brand); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "Invalid brand '" + brand + "'. Make sure to select a brand in the SHC thing configuration!"); - dispose(); - break; - } - - if (StringUtils.isNotBlank((String) thingConfig.get(CONFIG_ACCESS_TOKEN))) { - innogyConfig.setAccessToken(thingConfig.get(CONFIG_ACCESS_TOKEN).toString()); - } - if (StringUtils.isNotBlank((String) thingConfig.get(CONFIG_REFRESH_TOKEN))) { - innogyConfig.setRefreshToken(thingConfig.get(CONFIG_REFRESH_TOKEN).toString()); - } - - if (innogyConfig.checkRefreshToken()) { - return innogyConfig; - } else { - if (StringUtils.isNotBlank((String) thingConfig.get(CONFIG_AUTH_CODE))) { - innogyConfig.setAuthCode(thingConfig.get(CONFIG_AUTH_CODE).toString()); - return innogyConfig; - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "Cannot connect to innogy SmartHome service. Please set auth-code!"); - return null; - } + private void setPropertyIfPresent(final String key, final @Nullable Object data, + final Map<String, String> properties) { + if (data != null) { + properties.put(key, data instanceof String ? (String) data : data.toString()); } } - /* - * (non-Javadoc) - * - * @see org.eclipse.smarthome.core.thing.binding.BaseThingHandler#dispose() - */ @Override public void dispose() { logger.debug("Disposing innogy SmartHome bridge handler '{}'", getThing().getUID().getId()); - if (reinitJob != null) { - reinitJob.cancel(true); - reinitJob = null; - } - + unregisterDeviceStatusListener(this); + cancelReinitJob(); if (webSocket != null) { webSocket.stop(); webSocket = null; } - - if (client != null) { - try { - client.dispose(); - } catch (Exception e) { - logger.trace("Error disposing client: {}", e.getMessage()); - } - client = null; - } - + client = null; deviceStructMan = null; super.dispose(); logger.debug("innogy SmartHome bridge handler shut down."); } + private synchronized void cancelReinitJob() { + ScheduledFuture<?> reinitJob = this.reinitJob; + + if (reinitJob != null) { + reinitJob.cancel(true); + this.reinitJob = null; + } + } + /** * Registers a {@link DeviceStatusListener}. * * @param deviceStatusListener * @return true, if successful */ - public boolean registerDeviceStatusListener(DeviceStatusListener deviceStatusListener) { - if (deviceStatusListener == null) { - throw new IllegalArgumentException("It's not allowed to pass a null deviceStatusListener."); - } + public boolean registerDeviceStatusListener(final DeviceStatusListener deviceStatusListener) { return deviceStatusListeners.add(deviceStatusListener); } @@ -369,10 +377,7 @@ public boolean registerDeviceStatusListener(DeviceStatusListener deviceStatusLis * @param deviceStatusListener * @return true, if successful */ - public boolean unregisterDeviceStatusListener(DeviceStatusListener deviceStatusListener) { - if (deviceStatusListener == null) { - throw new IllegalArgumentException("It's not allowed to pass a null deviceStatusListener."); - } + public boolean unregisterDeviceStatusListener(final DeviceStatusListener deviceStatusListener) { return deviceStatusListeners.remove(deviceStatusListener); } @@ -382,15 +387,14 @@ public boolean unregisterDeviceStatusListener(DeviceStatusListener deviceStatusL * @return a Collection of {@link Device}s */ public Collection<Device> loadDevices() { - Collection<Device> devices = null; - if (deviceStructMan != null) { - try { - devices = deviceStructMan.getDeviceList(); - } catch (Exception e) { - logger.error("Error loading devices from device structure manager.", e); - } - } + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + final Collection<Device> devices; + if (deviceStructMan == null) { + devices = Collections.emptyList(); + } else { + devices = deviceStructMan.getDeviceList(); + } return devices; } @@ -400,7 +404,7 @@ public Collection<Device> loadDevices() { * @param deviceId * @return {@link Device} or null, if it does not exist or no {@link DeviceStructureManager} is available */ - public Device getDeviceById(String deviceId) { + public @Nullable Device getDeviceById(final String deviceId) { if (deviceStructMan != null) { return deviceStructMan.getDeviceById(deviceId); } @@ -413,7 +417,8 @@ public Device getDeviceById(String deviceId) { * @param deviceId * @return the {@link Device} or null, if it does not exist or no {@link DeviceStructureManager} is available */ - public Device refreshDevice(String deviceId) { + public @Nullable Device refreshDevice(final String deviceId) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; if (deviceStructMan == null) { return null; } @@ -422,102 +427,131 @@ public Device refreshDevice(String deviceId) { try { deviceStructMan.refreshDevice(deviceId); device = deviceStructMan.getDeviceById(deviceId); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } return device; } - // CredentialRefreshListener implementation - - /* - * (non-Javadoc) - * - * @see - * com.google.api.client.auth.oauth2.CredentialRefreshListener#onTokenResponse(com.google.api.client.auth.oauth2. - * Credential, com.google.api.client.auth.oauth2.TokenResponse) - */ @Override - public void onTokenResponse(Credential credential, TokenResponse tokenResponse) throws IOException { - String accessToken = credential.getAccessToken(); - innogyConfig.setAccessToken(accessToken); - getThing().getConfiguration().put(CONFIG_ACCESS_TOKEN, accessToken); - logger.debug("Access token for innogy expired. New access token saved."); - logger.debug("innogy access token saved (onTokenResponse): {}...{}", accessToken.substring(0, 10), - accessToken.substring(accessToken.length() - 10)); + public void onDeviceStateChanged(final Device device) { + synchronized (this.lock) { + if (!bridgeId.equals(device.getId())) { + logger.trace("DeviceId {} not relevant for this handler (responsible for id {})", device.getId(), + bridgeId); + return; + } + + logger.debug("onDeviceStateChanged called with device {}/{}", device.getConfig().getName(), device.getId()); + + // DEVICE STATES + if (device.hasDeviceState()) { + final Double cpuUsage = device.getDeviceState().getState().getCpuUsage().getValue(); + if (cpuUsage != null) { + logger.debug("-> CPU usage state: {}", cpuUsage); + updateState(CHANNEL_CPU, new DecimalType(cpuUsage)); + } + final Double diskUsage = device.getDeviceState().getState().getDiskUsage().getValue(); + if (diskUsage != null) { + logger.debug("-> Disk usage state: {}", diskUsage); + updateState(CHANNEL_DISK, new DecimalType(diskUsage)); + } + final Double memoryUsage = device.getDeviceState().getState().getMemoryUsage().getValue(); + if (memoryUsage != null) { + logger.debug("-> Memory usage state: {}", memoryUsage); + updateState(CHANNEL_MEMORY, new DecimalType(memoryUsage)); + } + + } + + } - // restart WebSocket - onEventRunnerStopped(); } - /* - * (non-Javadoc) - * - * @see com.google.api.client.auth.oauth2.CredentialRefreshListener#onTokenErrorResponse(com.google.api.client.auth. - * oauth2.Credential, com.google.api.client.auth.oauth2.TokenErrorResponse) - */ @Override - public void onTokenErrorResponse(Credential credential, TokenErrorResponse tokenErrorResponse) throws IOException { - String accessToken = ""; - innogyConfig.setAccessToken(accessToken); - getThing().getConfiguration().put(CONFIG_ACCESS_TOKEN, accessToken); - logger.debug("innogy access token removed (onTokenErrorResponse): {}...{}", accessToken.substring(0, 10), - accessToken.substring(accessToken.length() - 10)); + public void onDeviceStateChanged(final Device device, final Event event) { + synchronized (this.lock) { + if (!bridgeId.equals(device.getId())) { + logger.trace("DeviceId {} not relevant for this handler (responsible for id {})", device.getId(), + bridgeId); + return; + } + + logger.trace("DeviceId {} relevant for this handler.", device.getId()); - // restart binding - scheduleReinitialize(); + if (event.isLinkedtoDevice() && Device.DEVICE_TYPE_SHCA.equals(device.getType())) { + device.getDeviceState().getState().getCpuUsage().setValue(event.getProperties().getCpuUsage()); + device.getDeviceState().getState().getDiskUsage().setValue(event.getProperties().getDiskUsage()); + device.getDeviceState().getState().getMemoryUsage().setValue(event.getProperties().getMemoryUsage()); + onDeviceStateChanged(device); + } + } } - /* - * (non-Javadoc) - * - * @see org.openhab.binding.innogysmarthome.handler.EventListener#onEvent(java.lang.String) - */ @Override - public void onEvent(String msg) { + public void onEvent(final String msg) { logger.trace("onEvent called. Msg: {}", msg); try { - Event[] eventArray = gson.fromJson(msg, Event[].class); - for (Event event : eventArray) { - logger.debug("Event found: Type:{} Capability:{}", event.getType(), - event.getLink() != null ? event.getLink().getValue() : "(no link)"); + final BaseEvent be = gson.fromJson(msg, BaseEvent.class); + logger.debug("Event no {} found. Type: {}", be.getSequenceNumber(), be.getType()); + if (!BaseEvent.SUPPORTED_EVENT_TYPES.contains(be.getType())) { + logger.debug("Event type {} not supported. Skipping...", be.getType()); + } else { + final Event event = gson.fromJson(msg, Event.class); + switch (event.getType()) { - case Event.TYPE_STATE_CHANGED: + case BaseEvent.TYPE_STATE_CHANGED: + case BaseEvent.TYPE_BUTTON_PRESSED: handleStateChangedEvent(event); break; - case Event.TYPE_DISCONNECT: - logger.info("Websocket disconnected. Reason: {}", event.getPropertyList().get(0).getValue()); - scheduleReinitialize(0); + case BaseEvent.TYPE_DISCONNECT: + logger.debug("Websocket disconnected."); + scheduleRestartClient(0); break; - case Event.TYPE_CONFIG_CHANGED: - logger.info("Configuration changed to version {}. Restarting innogy binding...", - event.getConfigurationVersion()); - dispose(); - scheduleReinitialize(0); + case BaseEvent.TYPE_CONFIGURATION_CHANGED: + if (client.getConfigVersion().equals(event.getConfigurationVersion().toString())) { + logger.debug( + "Ignored configuration changed event with version '{}' as current version is '{}' the same.", + event.getConfigurationVersion(), client.getConfigVersion()); + } else { + logger.info("Configuration changed from version {} to {}. Restarting innogy binding...", + client.getConfigVersion(), event.getConfigurationVersion()); + scheduleRestartClient(0); + } break; - case Event.TYPE_CONTROLLER_CONNECTIVITY_CHANGED: + case BaseEvent.TYPE_CONTROLLER_CONNECTIVITY_CHANGED: handleControllerConnectivityChangedEvent(event); break; - case Event.TYPE_NEW_MESSAGE_RECEIVED: - handleNewMessageReceivedEvent(event); + case BaseEvent.TYPE_NEW_MESSAGE_RECEIVED: + case BaseEvent.TYPE_MESSAGE_CREATED: + final MessageEvent messageEvent = gson.fromJson(msg, MessageEvent.class); + handleNewMessageReceivedEvent(messageEvent); break; - case Event.TYPE_MESSAGE_DELETED: + case BaseEvent.TYPE_MESSAGE_DELETED: handleMessageDeletedEvent(event); break; default: - logger.debug("Unknown eventtype {}.", event.getType()); + logger.debug("Unsupported eventtype {}.", event.getType()); break; } } - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException | RuntimeException e) { logger.debug("Error with Event: {}", e.getMessage(), e); + handleClientException(e); + } + } + + @Override + public void onError(final Throwable cause) { + if (cause instanceof Exception) { + handleClientException((Exception) cause); } } @@ -528,38 +562,44 @@ public void onEvent(String msg) { * @param event * @throws ApiException * @throws IOException + * @throws AuthenticationException */ - public void handleStateChangedEvent(Event event) throws ApiException, IOException { + public void handleStateChangedEvent(final Event event) throws ApiException, IOException, AuthenticationException { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; if (deviceStructMan == null) { - scheduleReinitialize(); return; } // CAPABILITY if (event.isLinkedtoCapability()) { - Device device = deviceStructMan.getDeviceByCapabilityLink(event.getLink().getValue()); + logger.trace("Event is linked to capability"); + final Device device = deviceStructMan.getDeviceByCapabilityId(event.getSourceId()); if (device != null) { - for (DeviceStatusListener deviceStatusListener : deviceStatusListeners) { + for (final DeviceStatusListener deviceStatusListener : deviceStatusListeners) { deviceStatusListener.onDeviceStateChanged(device, event); } } else { - logger.debug("Unknown/unsupported device for capability {}.", event.getLink().getValue()); + logger.debug("Unknown/unsupported device for capability {}.", event.getSource()); } // DEVICE } else if (event.isLinkedtoDevice()) { - deviceStructMan.refreshDevice(event.getLinkId()); - Device device = deviceStructMan.getDeviceById(event.getLinkId()); + logger.trace("Event is linked to device"); + + if (!event.getSourceId().equals(deviceStructMan.getBridgeDevice().getId())) { + deviceStructMan.refreshDevice(event.getSourceId()); + } + final Device device = deviceStructMan.getDeviceById(event.getSourceId()); if (device != null) { - for (DeviceStatusListener deviceStatusListener : deviceStatusListeners) { + for (final DeviceStatusListener deviceStatusListener : deviceStatusListeners) { deviceStatusListener.onDeviceStateChanged(device, event); } } else { - logger.debug("Unknown/unsupported device {}.", event.getLinkId()); + logger.debug("Unknown/unsupported device {}.", event.getSourceId()); } } else { - logger.debug("link type {} not supported (yet?)", event.getLinkType()); + logger.debug("link type {} not supported (yet?)", event.getSourceLinkType()); } } @@ -570,18 +610,22 @@ public void handleStateChangedEvent(Event event) throws ApiException, IOExceptio * @param event * @throws ApiException * @throws IOException + * @throws AuthenticationException */ - public void handleControllerConnectivityChangedEvent(Event event) throws ApiException, IOException { - Boolean connected = event.getIsConnected(); + public void handleControllerConnectivityChangedEvent(final Event event) + throws ApiException, IOException, AuthenticationException { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } + final Boolean connected = event.getIsConnected(); if (connected != null) { logger.debug("SmartHome Controller connectivity changed to {}.", connected ? "online" : "offline"); if (connected) { - deviceStructMan = new DeviceStructureManager(client); - deviceStructMan.start(); + deviceStructMan.refreshDevices(); updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE); - deviceStructMan = null; } } else { logger.warn("isConnected property missing in event! (returned null)"); @@ -594,29 +638,33 @@ public void handleControllerConnectivityChangedEvent(Event event) throws ApiExce * @param event * @throws ApiException * @throws IOException + * @throws AuthenticationException */ - public void handleNewMessageReceivedEvent(Event event) throws ApiException, IOException { + public void handleNewMessageReceivedEvent(final MessageEvent event) + throws ApiException, IOException, AuthenticationException { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; if (deviceStructMan == null) { - scheduleReinitialize(); - } - - List<Message> messageList = event.getDataListAsMessage(); - for (Message m : messageList) { - if (Message.TYPE_DEVICE_LOW_BATTERY.equals(m.getType())) { - for (Link dl : m.getDeviceLinkList()) { - deviceStructMan.refreshDevice(dl.getId()); - Device device = deviceStructMan.getDeviceById(dl.getId()); - if (device != null) { - for (DeviceStatusListener deviceStatusListener : deviceStatusListeners) { - deviceStatusListener.onDeviceStateChanged(device); - } - } else { - logger.debug("Unknown/unsupported device {}.", event.getLinkId()); + return; + } + final Message message = event.getMessage(); + if (logger.isTraceEnabled()) { + logger.trace("Message: {}", gson.toJson(message)); + logger.trace("Messagetype: {}", message.getType()); + } + if (Message.TYPE_DEVICE_LOW_BATTERY.equals(message.getType())) { + for (final String link : message.getDeviceLinkList()) { + deviceStructMan.refreshDevice(Link.getId(link)); + final Device device = deviceStructMan.getDeviceById(Link.getId(link)); + if (device != null) { + for (final DeviceStatusListener deviceStatusListener : deviceStatusListeners) { + deviceStatusListener.onDeviceStateChanged(device); } + } else { + logger.debug("Unknown/unsupported device {}.", event.getSourceId()); } - } else { - logger.debug("Message received event not yet implemented for Messagetype {}.", m.getType()); } + } else { + logger.debug("Message received event not yet implemented for Messagetype {}.", message.getType()); } } @@ -629,51 +677,31 @@ public void handleNewMessageReceivedEvent(Event event) throws ApiException, IOEx * @param event * @throws ApiException * @throws IOException + * @throws AuthenticationException */ - public void handleMessageDeletedEvent(Event event) throws ApiException, IOException { - if (deviceStructMan != null) { - if (Link.LINK_TYPE_MESSAGE.equals(event.getLinkType())) { - Device device = deviceStructMan.getDeviceWithMessageId(event.getLinkId()); - if (device != null) { - deviceStructMan.refreshDevice(device.getId()); - device = deviceStructMan.getDeviceById(device.getId()); - for (DeviceStatusListener deviceStatusListener : deviceStatusListeners) { - deviceStatusListener.onDeviceStateChanged(device); - } - } else { - logger.debug("Unknown/unsupported device {}.", event.getLinkId()); - } + public void handleMessageDeletedEvent(final Event event) throws ApiException, IOException, AuthenticationException { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } + final String messageId = event.getData().getId(); + + logger.debug("handleMessageDeletedEvent with messageId '{}'", messageId); + Device device = deviceStructMan.getDeviceWithMessageId(messageId); + if (device != null) { + deviceStructMan.refreshDevice(device.getId()); + device = deviceStructMan.getDeviceById(device.getId()); + for (final DeviceStatusListener deviceStatusListener : deviceStatusListeners) { + deviceStatusListener.onDeviceStateChanged(device); } } else { - scheduleReinitialize(); + logger.debug("No device found with message id {}.", messageId); } } - /** - * This method is called, when the eventRunner stops and must be restarted after the given delay in seconds. - * - * @param delay long in seconds - */ - public void onEventRunnerStopped(long delay) { - logger.trace("onEventRunnerStopped called"); - scheduler.schedule(new WebSocketRunner(this), delay, TimeUnit.SECONDS); - } - - /** - * This method is called, whenever the eventRunner stops and must be restarted immediately. - */ - public void onEventRunnerStopped() { - onEventRunnerStopped(0); - } - - /* - * (non-Javadoc) - * - * @see org.openhab.binding.innogysmarthome.internal.listener.EventListener#onEventRunnerStoppedAbnormally() - */ @Override public void connectionClosed() { - scheduleReinitialize(REINITIALIZE_DELAY_SECONDS); + scheduleRestartClient(REINITIALIZE_DELAY_SECONDS); } /** @@ -683,22 +711,31 @@ public void connectionClosed() { * @param deviceId * @param state */ - public void commandSwitchDevice(String deviceId, boolean state) { + public void commandSwitchDevice(final String deviceId, final boolean state) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - // TODO: ADD DEVICES // VariableActuator - String deviceType = deviceStructMan.getDeviceById(deviceId).getType(); - if (deviceType.equals(DEVICE_VARIABLE_ACTUATOR)) { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_VARIABLEACTUATOR); + final String deviceType = deviceStructMan.getDeviceById(deviceId).getType(); + if (DEVICE_VARIABLE_ACTUATOR.equals(deviceType)) { + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_VARIABLEACTUATOR); + if (capabilityId == null) { + return; + } client.setVariableActuatorState(capabilityId, state); // PSS / PSSO / ISS2 - } else if (deviceType.equals(DEVICE_PSS) || deviceType.equals(DEVICE_PSSO) - || deviceType.equals(DEVICE_ISS2)) { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_SWITCHACTUATOR); + } else if (DEVICE_PSS.equals(deviceType) || DEVICE_PSSO.equals(deviceType) + || DEVICE_ISS2.equals(deviceType)) { + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_SWITCHACTUATOR); + if (capabilityId == null) { + return; + } client.setSwitchActuatorState(capabilityId, state); } - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -710,11 +747,18 @@ public void commandSwitchDevice(String deviceId, boolean state) { * @param deviceId * @param pointTemperature */ - public void commandUpdatePointTemperature(String deviceId, double pointTemperature) { + public void commandUpdatePointTemperature(final String deviceId, final double pointTemperature) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_THERMOSTATACTUATOR); + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_THERMOSTATACTUATOR); + if (capabilityId == null) { + return; + } client.setPointTemperatureState(capabilityId, pointTemperature); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -726,11 +770,18 @@ public void commandUpdatePointTemperature(String deviceId, double pointTemperatu * @param deviceId * @param alarmState */ - public void commandSwitchAlarm(String deviceId, boolean alarmState) { + public void commandSwitchAlarm(final String deviceId, final boolean alarmState) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_ALARMACTUATOR); + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_ALARMACTUATOR); + if (capabilityId == null) { + return; + } client.setAlarmActuatorState(capabilityId, alarmState); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -742,11 +793,18 @@ public void commandSwitchAlarm(String deviceId, boolean alarmState) { * @param deviceId * @param autoMode true activates the automatic mode, false the manual mode. */ - public void commandSetOperationMode(String deviceId, boolean autoMode) { + public void commandSetOperationMode(final String deviceId, final boolean autoMode) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_THERMOSTATACTUATOR); + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_THERMOSTATACTUATOR); + if (capabilityId == null) { + return; + } client.setOperationMode(capabilityId, autoMode); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -758,11 +816,18 @@ public void commandSetOperationMode(String deviceId, boolean autoMode) { * @param deviceId * @param dimLevel */ - public void commandSetDimmLevel(String deviceId, int dimLevel) { + public void commandSetDimmLevel(final String deviceId, final int dimLevel) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_DIMMERACTUATOR); + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_DIMMERACTUATOR); + if (capabilityId == null) { + return; + } client.setDimmerActuatorState(capabilityId, dimLevel); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -774,11 +839,19 @@ public void commandSetDimmLevel(String deviceId, int dimLevel) { * @param deviceId * @param rollerSchutterLevel */ - public void commandSetRollerShutterLevel(String deviceId, int rollerSchutterLevel) { + public void commandSetRollerShutterLevel(final String deviceId, final int rollerSchutterLevel) { + final DeviceStructureManager deviceStructMan = this.deviceStructMan; + if (deviceStructMan == null) { + return; + } try { - String capabilityId = deviceStructMan.getCapabilityId(deviceId, Capability.TYPE_ROLLERSHUTTERACTUATOR); + final String capabilityId = deviceStructMan.getCapabilityId(deviceId, + Capability.TYPE_ROLLERSHUTTERACTUATOR); + if (capabilityId == null) { + return; + } client.setRollerShutterActuatorState(capabilityId, rollerSchutterLevel); - } catch (Exception e) { + } catch (IOException | ApiException | AuthenticationException e) { handleClientException(e); } } @@ -791,97 +864,64 @@ public void commandSetRollerShutterLevel(String deviceId, int rollerSchutterLeve * @param e the Exception * @return boolean true, if binding should continue. */ - private boolean handleClientException(Exception e) { - - // Session exists + private boolean handleClientException(final Exception e) { + long reinitialize = REINITIALIZE_DELAY_SECONDS; if (e instanceof SessionExistsException) { logger.debug("Session already exists. Continuing..."); - return true; - } - - // Remote access not allowed (usually by IP address change) - if (e instanceof RemoteAccessNotAllowedException) { + reinitialize = -1; + } else if (e instanceof InvalidActionTriggeredException) { + logger.debug("Error triggering action: {}", e.getMessage()); + reinitialize = -1; + } else if (e instanceof RemoteAccessNotAllowedException) { + // Remote access not allowed (usually by IP address change) logger.debug("Remote access not allowed. Dropping access token and reinitializing binding..."); - innogyConfig.setAccessToken(""); - getThing().getConfiguration().put(CONFIG_ACCESS_TOKEN, ""); - scheduleReinitialize(0); - } - - // Controller offline - if (e instanceof ControllerOfflineException) { + refreshAccessToken(); + reinitialize = 0; + } else if (e instanceof ControllerOfflineException) { logger.debug("innogy SmartHome Controller is offline."); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, e.getMessage()); - dispose(); - scheduleReinitialize(); - return false; - } - - // Configuration error - if (e instanceof ConfigurationException) { - logger.debug("Configuration error: {}", e.getMessage()); + } else if (e instanceof AuthenticationException) { + logger.debug("OAuthenticaton error, refreshing tokens: {}", e.getMessage()); + refreshAccessToken(); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); - dispose(); - return false; - } - - // invalid auth code - if (e instanceof InvalidAuthCodeException) { - logger.debug("Error fetching access tokens. Invalid authcode! Please generate a new one. Detail: {}", - e.getMessage()); - org.eclipse.smarthome.config.core.Configuration configuration = editConfiguration(); - configuration.put(CONFIG_AUTH_CODE, ""); - updateConfiguration(configuration); - innogyConfig.setAuthCode(""); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "Invalid authcode. Please generate a new one!"); - dispose(); - return false; - } - - if (e instanceof InvalidActionTriggeredException) { - logger.debug("Error triggering action: {}", e.getMessage()); - return true; - } - - // io error - if (e instanceof IOException) { + } else if (e instanceof IOException) { logger.debug("IO error: {}", e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - dispose(); - scheduleReinitialize(REINITIALIZE_DELAY_LONG_SECONDS); - return false; - } - - // unexpected API error - if (e instanceof ApiException) { - logger.debug("Unexcepted API error: {}", e.getMessage()); + } else if (e instanceof ApiException) { + logger.warn("Unexcepted API error: {}", e.getMessage(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - dispose(); - scheduleReinitialize(REINITIALIZE_DELAY_LONG_SECONDS); - return false; - } - - // java.net.SocketTimeoutException - if (e instanceof SocketTimeoutException) { + } else if (e instanceof TimeoutException) { + logger.debug("WebSocket timeout: {}", e.getMessage()); + reinitialize = WEBSOCKET_TIMEOUT_RETRY_SECONDS; + } else if (e instanceof SocketTimeoutException) { logger.debug("Socket timeout: {}", e.getMessage()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - dispose(); - scheduleReinitialize(); - return false; - } - - // ExecutionException - if (e instanceof ExecutionException) { + } else if (e instanceof InterruptedException) { + reinitialize = -1; + Thread.currentThread().interrupt(); + } else if (e instanceof ExecutionException) { logger.debug("ExecutionException: {}", ExceptionUtils.getRootCauseMessage(e)); - dispose(); - scheduleReinitialize(); - return false; + updateStatus(ThingStatus.OFFLINE); + } else { + logger.debug("Unknown exception", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, e.getMessage()); + } + if (reinitialize >= 0) { + scheduleRestartClient(reinitialize); + return true; } - - // unknown - logger.debug("Unknown exception", e); - dispose(); - scheduleReinitialize(); return false; } + + private void refreshAccessToken() { + try { + final OAuthClientService localOAuthService = this.oAuthService; + + if (localOAuthService != null) { + oAuthService.refreshToken(); + } + } catch (IOException | OAuthResponseException | OAuthException e) { + logger.debug("Could not refresh tokens", e); + } + } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyDeviceHandler.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyDeviceHandler.java index 56d8d878aee4b..8557c5f752f88 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyDeviceHandler.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/handler/InnogyDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,8 +18,11 @@ import java.time.format.FormatStyle; import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.OpenClosedType; @@ -39,11 +42,10 @@ import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.openhab.binding.innogysmarthome.internal.client.entity.Property; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; +import org.openhab.binding.innogysmarthome.internal.client.entity.capability.CapabilityState; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; import org.openhab.binding.innogysmarthome.internal.client.entity.event.Event; -import org.openhab.binding.innogysmarthome.internal.client.entity.state.CapabilityState; import org.openhab.binding.innogysmarthome.internal.listener.DeviceStatusListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,29 +56,35 @@ * * @author Oliver Kuhl - Initial contribution */ +@NonNullByDefault public class InnogyDeviceHandler extends BaseThingHandler implements DeviceStatusListener { public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = SUPPORTED_DEVICE_THING_TYPES; - private final Logger logger = LoggerFactory.getLogger(InnogyDeviceHandler.class); - private String deviceId; - private InnogyBridgeHandler bridgeHandler; + private static final String DEBUG = "DEBUG"; + private static final String LONG_PRESS = "LongPress"; + private static final String SHORT_PRESS = "ShortPress"; + + private final Logger logger = LoggerFactory.getLogger(InnogyDeviceHandler.class); private final Object lock = new Object(); + private String deviceId = ""; + private @Nullable InnogyBridgeHandler bridgeHandler; + /** * Constructs a new {@link InnogyDeviceHandler} for the given {@link Thing}. * * @param thing */ - public InnogyDeviceHandler(Thing thing) { + public InnogyDeviceHandler(final Thing thing) { super(thing); } @Override - public void handleCommand(ChannelUID channelUID, Command command) { + public void handleCommand(final ChannelUID channelUID, final Command command) { logger.debug("handleCommand called for channel '{}' of type '{}' with command '{}'", channelUID, getThing().getThingTypeUID().getId(), command); - InnogyBridgeHandler innogyBridgeHandler = getInnogyBridgeHandler(); + final InnogyBridgeHandler innogyBridgeHandler = getInnogyBridgeHandler(); if (innogyBridgeHandler == null) { logger.warn("BridgeHandler not found. Cannot handle command without bridge."); return; @@ -87,24 +95,38 @@ public void handleCommand(ChannelUID channelUID, Command command) { } if (command instanceof RefreshType) { - Device device = innogyBridgeHandler.getDeviceById(deviceId); + final Device device = innogyBridgeHandler.getDeviceById(deviceId); if (device != null) { onDeviceStateChanged(device); } return; } - // TODO: add devices // SWITCH - if (channelUID.getId().equals(CHANNEL_SWITCH)) { + if (CHANNEL_SWITCH.equals(channelUID.getId())) { + // DEBUGGING HELPER + // ---------------- + final Device device = innogyBridgeHandler.getDeviceById(deviceId); + if (DEBUG.equals(device.getConfig().getName())) { + logger.debug("DEBUG SWITCH ACTIVATED!"); + if (OnOffType.ON.equals(command)) { + innogyBridgeHandler.onEvent( + "{\"sequenceNumber\": -1,\"type\": \"MessageCreated\",\"desc\": \"/desc/event/MessageCreated\",\"namespace\": \"core.RWE\",\"timestamp\": \"2019-07-07T18:41:47.2970000Z\",\"source\": \"/desc/device/SHC.RWE/1.0\",\"data\": {\"id\": \"6e5ce2290cd247208f95a5b53736958b\",\"type\": \"DeviceLowBattery\",\"read\": false,\"class\": \"Alert\",\"timestamp\": \"2019-07-07T18:41:47.232Z\",\"devices\": [\"/device/fe51785319854f36a621d0b4f8ea0e25\"],\"properties\": {\"deviceName\": \"Heizkörperthermostat\",\"serialNumber\": \"914110165056\",\"locationName\": \"Bad\"},\"namespace\": \"core.RWE\"}}"); + } else { + innogyBridgeHandler.onEvent( + "{\"sequenceNumber\": -1,\"type\": \"MessageDeleted\",\"desc\": \"/desc/event/MessageDeleted\",\"namespace\": \"core.RWE\",\"timestamp\": \"2019-07-07T19:15:39.2100000Z\",\"data\": { \"id\": \"6e5ce2290cd247208f95a5b53736958b\" }}"); + } + return; + } + // ---------------- if (command instanceof OnOffType) { innogyBridgeHandler.commandSwitchDevice(deviceId, OnOffType.ON.equals(command)); } // DIMMER - } else if (channelUID.getId().equals(CHANNEL_DIMMER)) { + } else if (CHANNEL_DIMMER.equals(channelUID.getId())) { if (command instanceof DecimalType) { - DecimalType dimLevel = (DecimalType) command; + final DecimalType dimLevel = (DecimalType) command; innogyBridgeHandler.commandSetDimmLevel(deviceId, dimLevel.intValue()); } else if (command instanceof OnOffType) { if (OnOffType.ON.equals(command)) { @@ -115,9 +137,9 @@ public void handleCommand(ChannelUID channelUID, Command command) { } // ROLLERSHUTTER - } else if (channelUID.getId().equals(CHANNEL_ROLLERSHUTTER)) { + } else if (CHANNEL_ROLLERSHUTTER.equals(channelUID.getId())) { if (command instanceof DecimalType) { - DecimalType rollerShutterLevel = (DecimalType) command; + final DecimalType rollerShutterLevel = (DecimalType) command; innogyBridgeHandler.commandSetRollerShutterLevel(deviceId, invertValueIfConfigured(CHANNEL_ROLLERSHUTTER, rollerShutterLevel.intValue())); } else if (command instanceof OnOffType) { @@ -139,29 +161,30 @@ public void handleCommand(ChannelUID channelUID, Command command) { } // SET_TEMPERATURE - } else if (channelUID.getId().equals(CHANNEL_SET_TEMPERATURE)) { + } else if (CHANNEL_SET_TEMPERATURE.equals(channelUID.getId())) { if (command instanceof DecimalType) { - DecimalType pointTemperature = (DecimalType) command; + final DecimalType pointTemperature = (DecimalType) command; innogyBridgeHandler.commandUpdatePointTemperature(deviceId, pointTemperature.doubleValue()); } // OPERATION_MODE - } else if (channelUID.getId().equals(CHANNEL_OPERATION_MODE)) { + } else if (CHANNEL_OPERATION_MODE.equals(channelUID.getId())) { if (command instanceof StringType) { - StringType autoModeCommand = (StringType) command; + final String autoModeCommand = command.toString(); - if (autoModeCommand.toString().equals("Auto")) { + if (CapabilityState.STATE_VALUE_OPERATION_MODE_AUTO.equals(autoModeCommand)) { innogyBridgeHandler.commandSetOperationMode(deviceId, true); - } else if (autoModeCommand.toString().equals("Manu")) { + } else if (CapabilityState.STATE_VALUE_OPERATION_MODE_MANUAL.equals(autoModeCommand)) { innogyBridgeHandler.commandSetOperationMode(deviceId, false); } else { logger.warn("Could not set operationmode. Invalid value '{}'! Only '{}' or '{}' allowed.", - autoModeCommand.toString(), "Auto", "Manu"); + autoModeCommand, CapabilityState.STATE_VALUE_OPERATION_MODE_AUTO, + CapabilityState.STATE_VALUE_OPERATION_MODE_MANUAL); } } // ALARM - } else if (channelUID.getId().equals(CHANNEL_ALARM)) { + } else if (CHANNEL_ALARM.equals(channelUID.getId())) { if (command instanceof OnOffType) { innogyBridgeHandler.commandSwitchAlarm(deviceId, OnOffType.ON.equals(command)); } @@ -174,11 +197,18 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void initialize() { logger.debug("Initializing innogy SmartHome device handler."); - initializeThing((getBridge() == null) ? null : getBridge().getStatus()); + initializeThing(getBridge() == null ? null : getBridge().getStatus()); + } + + @Override + public void dispose() { + if (bridgeHandler != null) { + bridgeHandler.unregisterDeviceStatusListener(this); + } } @Override - public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + public void bridgeStatusChanged(final ThingStatusInfo bridgeStatusInfo) { logger.debug("bridgeStatusChanged {}", bridgeStatusInfo); initializeThing(bridgeStatusInfo.getStatus()); } @@ -188,7 +218,7 @@ public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { * * @param bridgeStatus */ - private void initializeThing(ThingStatus bridgeStatus) { + private void initializeThing(@Nullable final ThingStatus bridgeStatus) { logger.debug("initializeThing thing {} bridge status {}", getThing().getUID(), bridgeStatus); final String configDeviceId = (String) getConfig().get(PROPERTY_ID); if (configDeviceId != null) { @@ -197,8 +227,12 @@ private void initializeThing(ThingStatus bridgeStatus) { // the bridge if (getInnogyBridgeHandler() != null) { if (bridgeStatus == ThingStatus.ONLINE) { - updateStatus(ThingStatus.ONLINE); - initializeProperties(); + if (initializeProperties()) { + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE, + "Device not found in innogy config. Was it removed?"); + } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); } @@ -213,12 +247,13 @@ private void initializeThing(ThingStatus bridgeStatus) { /** * Initializes all properties of the {@link Device}, like vendor, serialnumber etc. */ - private void initializeProperties() { + private boolean initializeProperties() { synchronized (this.lock) { - Device device = getDevice(); + final Device device = getDevice(); if (device != null) { - Map<String, String> properties = editProperties(); + final Map<String, String> properties = editProperties(); properties.put(PROPERTY_ID, device.getId()); + properties.put(PROPERTY_PROTOCOL_ID, device.getConfig().getProtocolId()); if (device.hasSerialNumber()) { properties.put(Thing.PROPERTY_SERIAL_NUMBER, device.getSerialnumber()); } @@ -239,17 +274,39 @@ private void initializeProperties() { } else if (device.isRadioDevice()) { properties.put(PROPERTY_DEVICE_TYPE, "Radio"); } - properties.put(PROPERTY_TIME_OF_ACCEPTANCE, - device.getTimeOfAcceptance().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); - properties.put(PROPERTY_TIME_OF_DISCOVERY, - device.getTimeOfDiscovery().format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); + // Thermostat + if (Device.DEVICE_TYPE_RST.equals(device.getType()) + || Device.DEVICE_TYPE_WRT.equals(device.getType())) { + properties.put(PROPERTY_DISPLAY_CURRENT_TEMPERATURE, + device.getConfig().getDisplayCurrentTemperature()); + } + + // Meter + if (Device.DEVICE_TYPE_ANALOG_METER.equals(device.getType()) + || Device.DEVICE_TYPE_GENERATION_METER.equals(device.getType()) + || Device.DEVICE_TYPE_SMARTMETER.equals(device.getType()) + || Device.DEVICE_TYPE_TWO_WAY_METER.equals(device.getType())) { + properties.put(PROPERTY_METER_ID, device.getConfig().getMeterId()); + properties.put(PROPERTY_METER_FIRMWARE_VERSION, device.getConfig().getMeterFirmwareVersion()); + } + + if (device.getConfig().getTimeOfAcceptance() != null) { + properties.put(PROPERTY_TIME_OF_ACCEPTANCE, device.getConfig().getTimeOfAcceptance() + .format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); + } + if (device.getConfig().getTimeOfDiscovery() != null) { + properties.put(PROPERTY_TIME_OF_DISCOVERY, device.getConfig().getTimeOfDiscovery() + .format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); + } + updateProperties(properties); - // TODO: check device state first! E.g. there is no state, when device is still in configuration state. onDeviceStateChanged(device); + return true; } else { logger.warn("initializeProperties: device is null"); + return false; } } } @@ -260,7 +317,7 @@ private void initializeProperties() { * * @return the {@link Device} or null, if not found or no {@link InnogyBridgeHandler} is available */ - private Device getDevice() { + private @Nullable Device getDevice() { if (getInnogyBridgeHandler() != null) { return getInnogyBridgeHandler().getDeviceById(deviceId); } @@ -272,14 +329,14 @@ private Device getDevice() { * * @return the {@link InnogyBridgeHandler} or null */ - private InnogyBridgeHandler getInnogyBridgeHandler() { + private @Nullable InnogyBridgeHandler getInnogyBridgeHandler() { synchronized (this.lock) { if (this.bridgeHandler == null) { - Bridge bridge = getBridge(); + final Bridge bridge = getBridge(); if (bridge == null) { return null; } - ThingHandler handler = bridge.getHandler(); + final ThingHandler handler = bridge.getHandler(); if (handler instanceof InnogyBridgeHandler) { this.bridgeHandler = (InnogyBridgeHandler) handler; this.bridgeHandler.registerDeviceStatusListener(this); @@ -292,7 +349,7 @@ private InnogyBridgeHandler getInnogyBridgeHandler() { } @Override - public void onDeviceStateChanged(Device device) { + public void onDeviceStateChanged(final Device device) { synchronized (this.lock) { if (!deviceId.equals(device.getId())) { logger.trace("DeviceId {} not relevant for this handler (responsible for id {})", device.getId(), @@ -300,17 +357,21 @@ public void onDeviceStateChanged(Device device) { return; } - logger.debug("onDeviceStateChanged called with device {}/{}", device.getName(), device.getId()); + logger.debug("onDeviceStateChanged called with device {}/{}", device.getConfig().getName(), device.getId()); // DEVICE STATES - if (device.hasState()) { - Boolean reachable = device.getDeviceState().isReachable(); - boolean included = device.getDeviceState().deviceIsIncluded(); + if (device.hasDeviceState()) { + Boolean reachable = null; + if (device.getDeviceState().hasIsReachableState()) { + reachable = device.getDeviceState().isReachable(); + } + if (reachable != null && !reachable) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Device not reachable."); return; - } else if (reachable != null && reachable) { - if (included) { + } else if ((reachable != null && reachable) + || Device.DEVICE_TYPE_VARIABLE_ACTUATOR.equals(device.getType())) { + if (device.getDeviceState().deviceIsIncluded()) { updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.ONLINE, ThingStatusDetail.CONFIGURATION_PENDING, @@ -329,17 +390,19 @@ public void onDeviceStateChanged(Device device) { } // CAPABILITY STATES - for (Capability c : device.getCapabilityMap().values()) { + for (final Entry<String, Capability> entry : device.getCapabilityMap().entrySet()) { + final Capability c = entry.getValue(); + logger.debug("->capability:{} ({}/{})", c.getId(), c.getType(), c.getName()); if (c.getCapabilityState() == null) { - logger.debug("Capability not available for device {} ({})", device.getName(), device.getType()); + logger.debug("Capability not available for device {} ({})", device.getConfig().getName(), + device.getType()); continue; } - // TODO: ADD DEVICES switch (c.getType()) { case Capability.TYPE_VARIABLEACTUATOR: - Boolean variableActuatorState = c.getCapabilityState().getVariableActuatorState(); + final Boolean variableActuatorState = c.getCapabilityState().getVariableActuatorState(); if (variableActuatorState != null) { updateState(CHANNEL_SWITCH, variableActuatorState ? OnOffType.ON : OnOffType.OFF); } else { @@ -348,7 +411,7 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_SWITCHACTUATOR: - Boolean switchActuatorState = c.getCapabilityState().getSwitchActuatorState(); + final Boolean switchActuatorState = c.getCapabilityState().getSwitchActuatorState(); if (switchActuatorState != null) { updateState(CHANNEL_SWITCH, switchActuatorState ? OnOffType.ON : OnOffType.OFF); } else { @@ -357,15 +420,9 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_DIMMERACTUATOR: - Double dimmerActuatorState = c.getCapabilityState().getDimmerActuatorState(); - if (dimmerActuatorState != null) { - int dimLevel = dimmerActuatorState.intValue(); - logger.debug("Dimlevel state {} -> type {}", dimmerActuatorState, dimLevel); - if (dimLevel > 0) { - updateState(CHANNEL_DIMMER, OnOffType.ON); - } else { - updateState(CHANNEL_DIMMER, OnOffType.OFF); - } + final Integer dimLevel = c.getCapabilityState().getDimmerActuatorState(); + if (dimLevel != null) { + logger.debug("Dimlevel state {}", dimLevel); updateState(CHANNEL_DIMMER, new PercentType(dimLevel)); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -373,17 +430,10 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_ROLLERSHUTTERACTUATOR: - Double rollerShutterActuatorState = c.getCapabilityState().getRollerShutterActuatorState(); - if (rollerShutterActuatorState != null) { - int rollerShutterLevel = invertValueIfConfigured(CHANNEL_ROLLERSHUTTER, - rollerShutterActuatorState.intValue()); - logger.debug("RollerShutterlevel state {} -> type {}", rollerShutterActuatorState, - rollerShutterLevel); - if (rollerShutterLevel > 0) { - updateState(CHANNEL_ROLLERSHUTTER, OnOffType.ON); - } else { - updateState(CHANNEL_ROLLERSHUTTER, OnOffType.OFF); - } + Integer rollerShutterLevel = c.getCapabilityState().getRollerShutterActuatorState(); + if (rollerShutterLevel != null) { + rollerShutterLevel = invertValueIfConfigured(CHANNEL_ROLLERSHUTTER, rollerShutterLevel); + logger.debug("RollerShutterlevel state {}", rollerShutterLevel); updateState(CHANNEL_ROLLERSHUTTER, new PercentType(rollerShutterLevel)); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -392,18 +442,18 @@ public void onDeviceStateChanged(Device device) { break; case Capability.TYPE_TEMPERATURESENSOR: // temperature - Double temperatureSensorState = c.getCapabilityState().getTemperatureSensorTemperatureState(); + final Double temperatureSensorState = c.getCapabilityState() + .getTemperatureSensorTemperatureState(); if (temperatureSensorState != null) { logger.debug("-> Temperature sensor state: {}", temperatureSensorState); - DecimalType temp = new DecimalType(temperatureSensorState); - updateState(CHANNEL_TEMPERATURE, temp); + updateState(CHANNEL_TEMPERATURE, new DecimalType(temperatureSensorState)); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), c.getCapabilityState().getId(), c.getId()); } // frost warning - Boolean temperatureSensorFrostWarningState = c.getCapabilityState() + final Boolean temperatureSensorFrostWarningState = c.getCapabilityState() .getTemperatureSensorFrostWarningState(); if (temperatureSensorFrostWarningState != null) { updateState(CHANNEL_FROST_WARNING, @@ -416,13 +466,14 @@ public void onDeviceStateChanged(Device device) { break; case Capability.TYPE_THERMOSTATACTUATOR: // point temperature - Double thermostatActuatorPointTemperatureState = c.getCapabilityState() + final Double thermostatActuatorPointTemperatureState = c.getCapabilityState() .getThermostatActuatorPointTemperatureState(); if (thermostatActuatorPointTemperatureState != null) { - DecimalType pointTemp = new DecimalType(thermostatActuatorPointTemperatureState); + final DecimalType pointTemp = new DecimalType(thermostatActuatorPointTemperatureState); logger.debug( "Update CHANNEL_SET_TEMPERATURE: state:{}->decType:{} (DeviceName {}, Capab-ID:{})", - thermostatActuatorPointTemperatureState, pointTemp, device.getName(), c.getId()); + thermostatActuatorPointTemperatureState, pointTemp, device.getConfig().getName(), + c.getId()); updateState(CHANNEL_SET_TEMPERATURE, pointTemp); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -430,10 +481,10 @@ public void onDeviceStateChanged(Device device) { } // operation mode - String thermostatActuatorOperationModeState = c.getCapabilityState() + final String thermostatActuatorOperationModeState = c.getCapabilityState() .getThermostatActuatorOperationModeState(); if (thermostatActuatorOperationModeState != null) { - StringType operationMode = new StringType(thermostatActuatorOperationModeState); + final StringType operationMode = new StringType(thermostatActuatorOperationModeState); updateState(CHANNEL_OPERATION_MODE, operationMode); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -441,7 +492,7 @@ public void onDeviceStateChanged(Device device) { } // window reduction active - Boolean thermostatActuatorWindowReductionActiveState = c.getCapabilityState() + final Boolean thermostatActuatorWindowReductionActiveState = c.getCapabilityState() .getThermostatActuatorWindowReductionActiveState(); if (thermostatActuatorWindowReductionActiveState != null) { updateState(CHANNEL_WINDOW_REDUCTION_ACTIVE, @@ -453,9 +504,9 @@ public void onDeviceStateChanged(Device device) { break; case Capability.TYPE_HUMIDITYSENSOR: // humidity - Double humidityState = c.getCapabilityState().getHumiditySensorHumidityState(); + final Double humidityState = c.getCapabilityState().getHumiditySensorHumidityState(); if (humidityState != null) { - DecimalType humidity = new DecimalType(humidityState); + final DecimalType humidity = new DecimalType(humidityState); updateState(CHANNEL_HUMIDITY, humidity); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -463,7 +514,7 @@ public void onDeviceStateChanged(Device device) { } // mold warning - Boolean humiditySensorMoldWarningState = c.getCapabilityState() + final Boolean humiditySensorMoldWarningState = c.getCapabilityState() .getHumiditySensorMoldWarningState(); if (humiditySensorMoldWarningState != null) { updateState(CHANNEL_MOLD_WARNING, @@ -474,7 +525,7 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_WINDOWDOORSENSOR: - Boolean contactState = c.getCapabilityState().getWindowDoorSensorState(); + final Boolean contactState = c.getCapabilityState().getWindowDoorSensorState(); if (contactState != null) { updateState(CHANNEL_CONTACT, contactState ? OpenClosedType.OPEN : OpenClosedType.CLOSED); } else { @@ -483,7 +534,7 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_SMOKEDETECTORSENSOR: - Boolean smokeState = c.getCapabilityState().getSmokeDetectorSensorState(); + final Boolean smokeState = c.getCapabilityState().getSmokeDetectorSensorState(); if (smokeState != null) { updateState(CHANNEL_SMOKE, smokeState ? OnOffType.ON : OnOffType.OFF); } else { @@ -492,7 +543,7 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_ALARMACTUATOR: - Boolean alarmState = c.getCapabilityState().getAlarmActuatorState(); + final Boolean alarmState = c.getCapabilityState().getAlarmActuatorState(); if (alarmState != null) { updateState(CHANNEL_ALARM, alarmState ? OnOffType.ON : OnOffType.OFF); } else { @@ -501,9 +552,9 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_MOTIONDETECTIONSENSOR: - Double motionState = c.getCapabilityState().getMotionDetectionSensorState(); + final Integer motionState = c.getCapabilityState().getMotionDetectionSensorState(); if (motionState != null) { - DecimalType motionCount = new DecimalType(motionState); + final DecimalType motionCount = new DecimalType(motionState); logger.debug("Motion state {} -> count {}", motionState, motionCount); updateState(CHANNEL_MOTION_COUNT, motionCount); } else { @@ -512,9 +563,9 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_LUMINANCESENSOR: - Double luminanceState = c.getCapabilityState().getLuminanceSensorState(); + final Double luminanceState = c.getCapabilityState().getLuminanceSensorState(); if (luminanceState != null) { - DecimalType luminance = new DecimalType(luminanceState); + final DecimalType luminance = new DecimalType(luminanceState); updateState(CHANNEL_LUMINANCE, luminance); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -522,37 +573,32 @@ public void onDeviceStateChanged(Device device) { } break; case Capability.TYPE_PUSHBUTTONSENSOR: - Double pushCountState = c.getCapabilityState().getPushButtonSensorCounterState(); - Double buttonIndexState = c.getCapabilityState().getPushButtonSensorButtonIndexState(); + final Integer pushCountState = c.getCapabilityState().getPushButtonSensorCounterState(); + final Integer buttonIndexState = c.getCapabilityState().getPushButtonSensorButtonIndexState(); logger.debug("Pushbutton index {} count {}", buttonIndexState, pushCountState); if (pushCountState != null) { - DecimalType pushCount = new DecimalType(pushCountState); - if (buttonIndexState.equals(0.0)) { - triggerChannel(CHANNEL_BUTTON1, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON1_COUNT, pushCount); - } else if (buttonIndexState.equals(1.0)) { - triggerChannel(CHANNEL_BUTTON2, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON2_COUNT, pushCount); - } else if (buttonIndexState.equals(2.0)) { - triggerChannel(CHANNEL_BUTTON3, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON3_COUNT, pushCount); - } else if (buttonIndexState.equals(3.0)) { - triggerChannel(CHANNEL_BUTTON4, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON4_COUNT, pushCount); - } else if (buttonIndexState.equals(4.0)) { - triggerChannel(CHANNEL_BUTTON5, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON5_COUNT, pushCount); - } else if (buttonIndexState.equals(5.0)) { - triggerChannel(CHANNEL_BUTTON6, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON6_COUNT, pushCount); - } else if (buttonIndexState.equals(6.0)) { - triggerChannel(CHANNEL_BUTTON7, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON7_COUNT, pushCount); - } else if (buttonIndexState.equals(7.0)) { - triggerChannel(CHANNEL_BUTTON8, CommonTriggerEvents.PRESSED); - updateState(CHANNEL_BUTTON8_COUNT, pushCount); + final DecimalType pushCount = new DecimalType(pushCountState); + // prevent error when buttonIndexState is null + if (buttonIndexState != null) { + if (buttonIndexState >= 0 && buttonIndexState <= 7) { + final int channelIndex = buttonIndexState + 1; + final String type = c.getCapabilityState().getPushButtonSensorButtonIndexType(); + final String triggerEvent = SHORT_PRESS.equals(type) + ? CommonTriggerEvents.SHORT_PRESSED + : (LONG_PRESS.equals(type) ? CommonTriggerEvents.LONG_PRESSED + : CommonTriggerEvents.PRESSED); + + triggerChannel(CHANNEL_BUTTON + channelIndex, triggerEvent); + updateState(String.format(CHANNEL_BUTTON_COUNT, channelIndex), pushCount); + } else { + logger.debug("Button index {} not supported.", buttonIndexState); + } + // Button handled so remove state to avoid re-trigger. + c.getCapabilityState().setPushButtonSensorButtonIndexState(null); + c.getCapabilityState().setPushButtonSensorButtonIndexType(null); } else { - logger.debug("Button index {} not supported.", buttonIndexState); + logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), + c.getCapabilityState().getId(), c.getId()); } } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", c.getType(), @@ -600,6 +646,9 @@ public void onDeviceStateChanged(Device device) { updateStateForEnergyChannel(CHANNEL_ENERGY_MONTH_EURO, c.getCapabilityState().getTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState(), c); + updateStateForEnergyChannel(CHANNEL_ENERGY_DAY_EURO, + c.getCapabilityState().getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState(), + c); updateStateForEnergyChannel(CHANNEL_ENERGY_DAY_KWH, c.getCapabilityState().getTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState(), c); @@ -626,6 +675,7 @@ public void onDeviceStateChanged(Device device) { } } } + } /** @@ -635,9 +685,10 @@ public void onDeviceStateChanged(Device device) { * @param state * @param capability */ - private void updateStateForEnergyChannel(String channelId, Double state, Capability capability) { + private void updateStateForEnergyChannel(final String channelId, @Nullable final Double state, + final Capability capability) { if (state != null) { - DecimalType newValue = new DecimalType(state); + final DecimalType newValue = new DecimalType(state); updateState(channelId, newValue); } else { logger.debug("State for {} is STILL NULL!! cstate-id: {}, c-id: {}", capability.getType(), @@ -646,11 +697,10 @@ private void updateStateForEnergyChannel(String channelId, Double state, Capabil } @Override - public void onDeviceStateChanged(Device device, Event event) { + public void onDeviceStateChanged(final Device changedDevice, final Event event) { synchronized (this.lock) { + Device device = changedDevice; if (!deviceId.equals(device.getId())) { - logger.trace("DeviceId {} not relevant for this handler (responsible for id {})", device.getId(), - deviceId); return; } @@ -658,327 +708,240 @@ public void onDeviceStateChanged(Device device, Event event) { if (event.isLinkedtoCapability()) { boolean deviceChanged = false; - String linkId = event.getLinkId(); - for (Property p : event.getPropertyList()) { - logger.debug("State changed {} to {}.", p.getName(), p.getValue()); - HashMap<String, Capability> capabilityMap = device.getCapabilityMap(); - Capability capability = capabilityMap.get(linkId); - logger.trace("Loaded Capability {}, {} with id {}, device {} from device id {}", - capability.getType(), capability.getName(), capability.getId(), - capability.getDeviceLink().get(0).getValue(), device.getId()); - - CapabilityState capabilityState; - if (capability.hasState()) { - capabilityState = capability.getCapabilityState(); - } else { - logger.debug("Capability {} has no state (yet?) - refreshing device.", capability.getName()); - device = getInnogyBridgeHandler().refreshDevice(deviceId); + final String linkedCapabilityId = event.getSourceId(); - capabilityMap = device.getCapabilityMap(); - capability = capabilityMap.get(linkId); - if (capability.hasState()) { - capabilityState = capability.getCapabilityState(); - } else { - continue; - } - } + HashMap<String, Capability> capabilityMap = device.getCapabilityMap(); + Capability capability = capabilityMap.get(linkedCapabilityId); + logger.trace("Loaded Capability {}, {} with id {}, device {} from device id {}", capability.getType(), + capability.getName(), capability.getId(), capability.getDeviceLink(), device.getId()); + + CapabilityState capabilityState; + if (capability.hasState()) { + capabilityState = capability.getCapabilityState(); - // TODO: ADD DEVICES // VariableActuator if (capability.isTypeVariableActuator()) { - capabilityState.setVariableActuatorState((boolean) p.getValue()); + capabilityState.setVariableActuatorState(event.getProperties().getValue()); deviceChanged = true; // SwitchActuator } else if (capability.isTypeSwitchActuator()) { - capabilityState.setSwitchActuatorState((boolean) p.getValue()); + capabilityState.setSwitchActuatorState(event.getProperties().getOnState()); deviceChanged = true; // DimmerActuator } else if (capability.isTypeDimmerActuator()) { - capabilityState.setDimmerActuatorState((double) p.getValue()); + capabilityState.setDimmerActuatorState(event.getProperties().getDimLevel()); deviceChanged = true; // RollerShutterActuator } else if (capability.isTypeRollerShutterActuator()) { - capabilityState.setRollerShutterActuatorState((double) p.getValue()); + capabilityState.setRollerShutterActuatorState(event.getProperties().getShutterLevel()); deviceChanged = true; // TemperatureSensor } else if (capability.isTypeTemperatureSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_TEMPERATURE_SENSOR_TEMPERATURE)) { - capabilityState.setTemperatureSensorTemperatureState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals(CapabilityState.STATE_NAME_TEMPERATURE_SENSOR_FROST_WARNING)) { - capabilityState.setTemperatureSensorFrostWarningState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); + // when values are changed, they come with separate events + // values should only updated when they are not null + final Double tmpTemperatureState = event.getProperties().getTemperature(); + final Boolean tmpFrostWarningState = event.getProperties().getFrostWarning(); + if (tmpTemperatureState != null) { + capabilityState.setTemperatureSensorTemperatureState(tmpTemperatureState); + } + if (tmpFrostWarningState != null) { + capabilityState.setTemperatureSensorFrostWarningState(tmpFrostWarningState); } + deviceChanged = true; // ThermostatActuator } else if (capability.isTypeThermostatActuator()) { - // point temperature - if (p.getName().equals(CapabilityState.STATE_NAME_THERMOSTAT_ACTUATOR_POINT_TEMPERATURE)) { - capabilityState.setThermostatActuatorPointTemperatureState((double) p.getValue()); - deviceChanged = true; - logger.debug("ThermostatActuator PointTemperature State: {}", - capabilityState.getThermostatActuatorPointTemperatureState()); - logger.debug("ThermostatActuator PointTemperature State from device: {}", - device.getCapabilityMap().get(linkId).getCapabilityState() - .getThermostatActuatorPointTemperatureState()); - - // operation mode - } else if (p.getName().equals(CapabilityState.STATE_NAME_THERMOSTAT_ACTUATOR_OPERATION_MODE)) { - capabilityState.setThermostatActuatorOperationModeState((String) p.getValue()); - deviceChanged = true; - logger.debug("ThermostatActuator OperationMode State: {}", - capabilityState.getThermostatActuatorOperationModeState()); + // when values are changed, they come with separate events + // values should only updated when they are not null - // window reduction active - } else if (p.getName() - .equals(CapabilityState.STATE_NAME_THERMOSTAT_ACTUATOR_WINDOW_REDUCTION_ACTIVE)) { - capabilityState.setThermostatActuatorWindowReductionActiveState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); + final Double tmpPointTemperatureState = event.getProperties().getPointTemperature(); + final String tmpOperationModeState = event.getProperties().getOperationMode(); + final Boolean tmpWindowReductionActiveState = event.getProperties().getWindowReductionActive(); + + if (tmpPointTemperatureState != null) { + capabilityState.setThermostatActuatorPointTemperatureState(tmpPointTemperatureState); + } + if (tmpOperationModeState != null) { + capabilityState.setThermostatActuatorOperationModeState(tmpOperationModeState); } + if (tmpWindowReductionActiveState != null) { + capabilityState + .setThermostatActuatorWindowReductionActiveState(tmpWindowReductionActiveState); + } + deviceChanged = true; // HumiditySensor } else if (capability.isTypeHumiditySensor()) { - // humidity - if (p.getName().equals(CapabilityState.STATE_NAME_HUMIDITY_SENSOR_HUMIDITY)) { - capabilityState.setHumiditySensorHumidityState((double) p.getValue()); - deviceChanged = true; - - // mold warning - } else if (p.getName().equals(CapabilityState.STATE_NAME_HUMIDITY_SENSOR_MOLD_WARNING)) { - capabilityState.setHumiditySensorMoldWarningState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); + // when values are changed, they come with separate events + // values should only updated when they are not null + final Double tmpHumidityState = event.getProperties().getHumidity(); + final Boolean tmpMoldWarningState = event.getProperties().getMoldWarning(); + if (tmpHumidityState != null) { + capabilityState.setHumiditySensorHumidityState(tmpHumidityState); } + if (tmpMoldWarningState != null) { + capabilityState.setHumiditySensorMoldWarningState(tmpMoldWarningState); + } + deviceChanged = true; // WindowDoorSensor } else if (capability.isTypeWindowDoorSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_WINDOW_DOOR_SENSOR)) { - capabilityState.setWindowDoorSensorState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); - } + capabilityState.setWindowDoorSensorState(event.getProperties().getIsOpen()); + deviceChanged = true; // SmokeDetectorSensor } else if (capability.isTypeSmokeDetectorSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_SMOKE_DETECTOR_SENSOR)) { - capabilityState.setSmokeDetectorSensorState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); - } + capabilityState.setSmokeDetectorSensorState(event.getProperties().getIsSmokeAlarm()); + deviceChanged = true; // AlarmActuator } else if (capability.isTypeAlarmActuator()) { - if (p.getName().equals(CapabilityState.STATE_NAME_ALARM_ACTUATOR)) { - capabilityState.setAlarmActuatorState((boolean) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); - } + capabilityState.setAlarmActuatorState(event.getProperties().getOnState()); + deviceChanged = true; // MotionDetectionSensor } else if (capability.isTypeMotionDetectionSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_MOTION_DETECTION_SENSOR)) { - capabilityState.setMotionDetectionSensorState((double) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); - } + capabilityState.setMotionDetectionSensorState(event.getProperties().getMotionDetectedCount()); + deviceChanged = true; // LuminanceSensor } else if (capability.isTypeLuminanceSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_LUMINANCE_SENSOR)) { - capabilityState.setLuminanceSensorState((double) p.getValue()); - deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); - } + capabilityState.setLuminanceSensorState(event.getProperties().getLuminance()); + deviceChanged = true; // PushButtonSensor } else if (capability.isTypePushButtonSensor()) { - if (p.getName().equals(CapabilityState.STATE_NAME_PUSH_BUTTON_SENSOR_BUTTON_INDEX)) { - capabilityState.setPushButtonSensorButtonIndexState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals(CapabilityState.STATE_NAME_PUSH_BUTTON_SENSOR_COUNTER)) { - capabilityState.setPushButtonSensorCounterState((double) p.getValue()); + // Some devices send both StateChanged and ButtonPressed. But only one should be handled. + // If ButtonPressed is send lastPressedButtonIndex is not set in StateChanged so ignore + // StateChanged. + // type is also not always present if null will be interpreted as a normal key press. + final Integer tmpButtonIndex = event.getProperties().getLastPressedButtonIndex(); + + if (tmpButtonIndex != null) { + capabilityState.setPushButtonSensorButtonIndexState(tmpButtonIndex); + capabilityState + .setPushButtonSensorButtonIndexType(event.getProperties().getLastKeyPressType()); + + final Integer tmpLastKeyPressCounter = event.getProperties().getLastKeyPressCounter(); + + if (tmpLastKeyPressCounter != null) { + capabilityState.setPushButtonSensorCounterState(tmpLastKeyPressCounter); + } deviceChanged = true; - } else { - logger.debug("Capability-property {} not yet supported.", p.getName()); } // EnergyConsumptionSensor } else if (capability.isTypeEnergyConsumptionSensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_KWH)) { - capabilityState - .setEnergyConsumptionSensorEnergyConsumptionMonthKWhState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ABSOLUTE_ENERGY_CONSUMPTION)) { - capabilityState - .setEnergyConsumptionSensorAbsoluteEnergyConsumptionState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_MONTH_EURO)) { - capabilityState - .setEnergyConsumptionSensorEnergyConsumptionMonthEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_EURO)) { - capabilityState - .setEnergyConsumptionSensorEnergyConsumptionDayEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_ENERGY_CONSUMPTION_SENSOR_ENERGY_CONSUMPTION_DAY_KWH)) { - capabilityState - .setEnergyConsumptionSensorEnergyConsumptionDayKWhState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setEnergyConsumptionSensorEnergyConsumptionMonthKWhState( + event.getProperties().getEnergyConsumptionMonthKWh()); + capabilityState.setEnergyConsumptionSensorAbsoluteEnergyConsumptionState( + event.getProperties().getAbsoluteEnergyConsumption()); + capabilityState.setEnergyConsumptionSensorEnergyConsumptionMonthEuroState( + event.getProperties().getEnergyConsumptionMonthEuro()); + capabilityState.setEnergyConsumptionSensorEnergyConsumptionDayEuroState( + event.getProperties().getEnergyConsumptionDayEuro()); + capabilityState.setEnergyConsumptionSensorEnergyConsumptionDayKWhState( + event.getProperties().getEnergyConsumptionDayKWh()); + deviceChanged = true; // PowerConsumptionSensor } else if (capability.isTypePowerConsumptionSensor()) { - if (p.getName() - .equals(CapabilityState.STATE_NAME_POWER_CONSUMPTION_SENSOR_POWER_CONSUMPTION_WATT)) { - capabilityState.setPowerConsumptionSensorPowerConsumptionWattState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setPowerConsumptionSensorPowerConsumptionWattState( + event.getProperties().getPowerConsumptionWatt()); + deviceChanged = true; // GenerationMeterEnergySensor } else if (capability.isTypeGenerationMeterEnergySensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_KWH)) { - capabilityState - .setGenerationMeterEnergySensorEnergyPerMonthInKWhState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName() - .equals(CapabilityState.STATE_NAME_GENERATION_METER_ENERGY_SENSOR_TOTAL_ENERGY)) { - capabilityState.setGenerationMeterEnergySensorTotalEnergyState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_MONTH_IN_EURO)) { - capabilityState - .setGenerationMeterEnergySensorEnergyPerMonthInEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_EURO)) { - capabilityState - .setGenerationMeterEnergySensorEnergyPerDayInEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_GENERATION_METER_ENERGY_SENSOR_ENERGY_PER_DAY_IN_KWH)) { - capabilityState.setGenerationMeterEnergySensorEnergyPerDayInKWhState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setGenerationMeterEnergySensorEnergyPerMonthInKWhState( + event.getProperties().getEnergyPerMonthInKWh()); + capabilityState + .setGenerationMeterEnergySensorTotalEnergyState(event.getProperties().getTotalEnergy()); + capabilityState.setGenerationMeterEnergySensorEnergyPerMonthInEuroState( + event.getProperties().getEnergyPerMonthInEuro()); + capabilityState.setGenerationMeterEnergySensorEnergyPerDayInEuroState( + event.getProperties().getEnergyPerDayInEuro()); + capabilityState.setGenerationMeterEnergySensorEnergyPerDayInKWhState( + event.getProperties().getEnergyPerDayInKWh()); + deviceChanged = true; // GenerationMeterPowerConsumptionSensor } else if (capability.isTypeGenerationMeterPowerConsumptionSensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_GENERATION_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT)) { - capabilityState - .setGenerationMeterPowerConsumptionSensorPowerInWattState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setGenerationMeterPowerConsumptionSensorPowerInWattState( + event.getProperties().getPowerInWatt()); + deviceChanged = true; // TwoWayMeterEnergyConsumptionSensor } else if (capability.isTypeTwoWayMeterEnergyConsumptionSensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_KWH)) { - capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState( - (double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_TOTAL_ENERGY)) { - capabilityState - .setTwoWayMeterEnergyConsumptionSensorTotalEnergyState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_MONTH_IN_EURO)) { - capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState( - (double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_EURO)) { - capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState( - (double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_CONSUMPTION_SENSOR_ENERGY_PER_DAY_IN_KWH)) { - capabilityState - .setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInKWhState( + event.getProperties().getEnergyPerMonthInKWh()); + capabilityState.setTwoWayMeterEnergyConsumptionSensorTotalEnergyState( + event.getProperties().getTotalEnergy()); + capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerMonthInEuroState( + event.getProperties().getEnergyPerMonthInEuro()); + capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInEuroState( + event.getProperties().getEnergyPerDayInEuro()); + capabilityState.setTwoWayMeterEnergyConsumptionSensorEnergyPerDayInKWhState( + event.getProperties().getEnergyPerDayInKWh()); + deviceChanged = true; // TwoWayMeterEnergyFeedSensor } else if (capability.isTypeTwoWayMeterEnergyFeedSensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_KWH)) { - capabilityState - .setTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName() - .equals(CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_TOTAL_ENERGY)) { - capabilityState.setTwoWayMeterEnergyFeedSensorTotalEnergyState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_MONTH_IN_EURO)) { - capabilityState - .setTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_EURO)) { - capabilityState - .setTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState((double) p.getValue()); - deviceChanged = true; - } else if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_ENERGY_FEED_SENSOR_ENERGY_PER_DAY_IN_KWH)) { - capabilityState.setTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setTwoWayMeterEnergyFeedSensorEnergyPerMonthInKWhState( + event.getProperties().getEnergyPerMonthInKWh()); + capabilityState + .setTwoWayMeterEnergyFeedSensorTotalEnergyState(event.getProperties().getTotalEnergy()); + capabilityState.setTwoWayMeterEnergyFeedSensorEnergyPerMonthInEuroState( + event.getProperties().getEnergyPerMonthInEuro()); + capabilityState.setTwoWayMeterEnergyFeedSensorEnergyPerDayInEuroState( + event.getProperties().getEnergyPerDayInEuro()); + capabilityState.setTwoWayMeterEnergyFeedSensorEnergyPerDayInKWhState( + event.getProperties().getEnergyPerDayInKWh()); + deviceChanged = true; // TwoWayMeterPowerConsumptionSensor } else if (capability.isTypeTwoWayMeterPowerConsumptionSensor()) { - if (p.getName().equals( - CapabilityState.STATE_NAME_TWO_WAY_METER_POWER_CONSUMPTION_SENSOR_POWER_IN_WATT)) { - capabilityState.setTwoWayMeterPowerConsumptionSensorPowerInWattState((double) p.getValue()); - deviceChanged = true; - } + capabilityState.setTwoWayMeterPowerConsumptionSensorPowerInWattState( + event.getProperties().getPowerInWatt()); + deviceChanged = true; + } else { logger.debug("Unsupported capability type {}.", capability.getType()); - continue; } - } + } else { // capability.hasState() + logger.debug("Capability {} has no state (yet?) - refreshing device.", capability.getName()); + final InnogyBridgeHandler innogyBridgeHandler = getInnogyBridgeHandler(); - if (deviceChanged) { + if (innogyBridgeHandler != null) { + device = innogyBridgeHandler.refreshDevice(deviceId); + } + if (device != null) { + capabilityMap = device.getCapabilityMap(); + capability = capabilityMap.get(linkedCapabilityId); + if (capability.hasState()) { + capabilityState = capability.getCapabilityState(); + deviceChanged = true; + } + } + } + if (deviceChanged && device != null) { onDeviceStateChanged(device); } } else if (event.isLinkedtoDevice()) { - if (device.hasState()) { - Map<String, Property> stateMap = device.getDeviceState().getStateMap(); - for (Property p : event.getPropertyList()) { - logger.debug("State changed {} to {}.", p.getName(), p.getValue()); - - stateMap.get(p.getName()).setValue(p.getValue()); - stateMap.get(p.getName()).setLastchanged((p.getLastchanged())); - } + if (device.hasDeviceState()) { onDeviceStateChanged(device); } else { - logger.debug("Device {}/{} has no state.", device.getName(), device.getId()); + logger.debug("Device {}/{} has no state.", device.getConfig().getName(), device.getId()); return; } } } + } /** @@ -987,18 +950,18 @@ public void onDeviceStateChanged(Device device, Event event) { * @param value * @return the value or the inverted value */ - private int invertValueIfConfigured(String channelId, int value) { + private int invertValueIfConfigured(final String channelId, final int value) { if (!CHANNEL_ROLLERSHUTTER.equals(channelId)) { logger.debug("Channel {} cannot be inverted.", channelId); return value; } + final Channel channel = getThing().getChannel(channelId); - Channel channel = getThing().getChannel(channelId); if (channel == null) { logger.debug("Channel {} was null! Value not inverted.", channelId); return value; } - - return 100 - value; + final Boolean invert = (Boolean) channel.getConfiguration().get("invert"); + return invert != null && invert ? value : (100 - value); } } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/DeviceStatusListener.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/DeviceStatusListener.java index c9aa22c6218f3..f9ceb9617dfed 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/DeviceStatusListener.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/DeviceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.innogysmarthome.internal.listener; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; import org.openhab.binding.innogysmarthome.internal.client.entity.event.Event; @@ -20,6 +21,7 @@ * * @author Oliver Kuhl - Initial contribution */ +@NonNullByDefault public interface DeviceStatusListener { /** diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/EventListener.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/EventListener.java index 954a63cd7aa86..c7c3363227845 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/EventListener.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/listener/EventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.innogysmarthome.internal.listener; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.innogysmarthome.internal.InnogyWebSocket; /** @@ -20,6 +21,7 @@ * * @author Oliver Kuhl - Initial contribution */ +@NonNullByDefault public interface EventListener { /** @@ -27,10 +29,17 @@ public interface EventListener { * * @param msg */ - public void onEvent(String msg); + void onEvent(String msg); + + /** + * This method is called when the innogy websocket services throws an onError. + * + * @param cause + */ + void onError(Throwable cause); /** * This method is called, when the evenRunner stops abnormally (statuscode <> 1000). */ - public void connectionClosed(); + void connectionClosed(); } diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java index b35be01d2b679..8cb1641b2e64a 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/java/org/openhab/binding/innogysmarthome/internal/manager/DeviceStructureManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,15 +18,19 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.innogysmarthome.internal.InnogyBindingConstants; import org.openhab.binding.innogysmarthome.internal.client.InnogyClient; -import org.openhab.binding.innogysmarthome.internal.client.entity.Message; -import org.openhab.binding.innogysmarthome.internal.client.entity.Property; import org.openhab.binding.innogysmarthome.internal.client.entity.capability.Capability; +import org.openhab.binding.innogysmarthome.internal.client.entity.capability.State; import org.openhab.binding.innogysmarthome.internal.client.entity.device.Device; -import org.openhab.binding.innogysmarthome.internal.client.entity.link.CapabilityLink; +import org.openhab.binding.innogysmarthome.internal.client.entity.link.Link; +import org.openhab.binding.innogysmarthome.internal.client.entity.message.Message; import org.openhab.binding.innogysmarthome.internal.client.exception.ApiException; +import org.openhab.binding.innogysmarthome.internal.client.exception.AuthenticationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,14 +41,15 @@ * @author Oliver Kuhl - Initial contribution * */ +@NonNullByDefault public class DeviceStructureManager { private final Logger logger = LoggerFactory.getLogger(DeviceStructureManager.class); private final InnogyClient client; private final Map<String, Device> deviceMap; - private final Map<String, Device> capabilityToDeviceMap; - private String bridgeDeviceId; + private final Map<String, Device> capabilityIdToDeviceMap; + private String bridgeDeviceId = ""; /** * Constructs the {@link DeviceStructureManager}. @@ -54,20 +59,7 @@ public class DeviceStructureManager { public DeviceStructureManager(InnogyClient client) { this.client = client; deviceMap = Collections.synchronizedMap(new HashMap<>()); - capabilityToDeviceMap = Collections.synchronizedMap(new HashMap<>()); - } - - /** - * Starts the {@link DeviceStructureManager} by building the device structure. - * - * @throws IOException - * @throws ApiException - */ - public synchronized void start() throws IOException, ApiException { - logger.debug("Starting device structure manager."); - - refreshDevices(); - logger.debug("Devices loaded. Device structure manager ready."); + capabilityIdToDeviceMap = new ConcurrentHashMap<>(); } /** @@ -85,8 +77,11 @@ public Map<String, Device> getDeviceMap() { * * @throws IOException * @throws ApiException + * @throws AuthenticationException */ - private void refreshDevices() throws IOException, ApiException { + public void refreshDevices() throws IOException, ApiException, AuthenticationException { + deviceMap.clear(); + capabilityIdToDeviceMap.clear(); List<Device> devices = client.getFullDevices(); for (Device d : devices) { handleRefreshedDevice(d); @@ -99,8 +94,10 @@ private void refreshDevices() throws IOException, ApiException { * @param deviceId * @throws IOException * @throws ApiException + * @throws AuthenticationException */ - public void refreshDevice(String deviceId) throws IOException, ApiException { + public void refreshDevice(String deviceId) throws IOException, ApiException, AuthenticationException { + logger.trace("Refreshing Device with id '{}'", deviceId); Device d = client.getFullDeviceById(deviceId); handleRefreshedDevice(d); } @@ -115,7 +112,7 @@ private void handleRefreshedDevice(Device d) { if (InnogyBindingConstants.SUPPORTED_DEVICES.contains(d.getType())) { addDeviceToStructure(d); } else { - logger.debug("Device {}:'{}' by {} ({}) ignored - UNSUPPORTED.", d.getType(), d.getName(), + logger.debug("Device {}:'{}' by {} ({}) ignored - UNSUPPORTED.", d.getType(), d.getConfig().getName(), d.getManufacturer(), d.getId()); logger.debug("===================================="); return; @@ -127,25 +124,22 @@ private void handleRefreshedDevice(Device d) { if (logger.isDebugEnabled()) { try { - logger.debug("Device {}:'{}' by {} ({}) loaded.", d.getType(), d.getName(), d.getManufacturer(), - d.getId()); + logger.debug("Device {}:'{}@{}' by {} ({}) loaded.", d.getType(), d.getConfig().getName(), + d.getLocation() != null ? d.getLocation().getName() : "<none>", d.getManufacturer(), d.getId()); for (Capability c : d.getCapabilityMap().values()) { logger.debug("> CAP: {}/{} ({})", c.getType(), c.getName(), c.getId()); if (d.isRadioDevice() && !d.isReachable()) { logger.debug(">> CAP-State: unknown (device NOT REACHABLE)."); } else { - if (c.getCapabilityState() != null) { - for (Property p : c.getCapabilityState().getStateMap().values()) { - logger.debug(">> CAP-State: {} -> {} ({})", p.getName(), p.getValue(), - p.getLastchanged()); - } + if (c.hasState()) { + final State state = c.getCapabilityState().getState(); } else { logger.debug(">> CAP-State: unknown (NULL)"); } } } - } catch (Exception e) { - logger.error("EX: ", e); + } catch (RuntimeException e) { + logger.debug("Error during logging: ", e); } logger.debug("===================================="); } @@ -161,8 +155,8 @@ public void addDeviceToStructure(Device device) { getDeviceMap().put(device.getId(), device); } - for (CapabilityLink cl : device.getCapabilityLinkList()) { - capabilityToDeviceMap.put(cl.getValue(), device); + for (String cl : device.getCapabilityLinkList()) { + capabilityIdToDeviceMap.put(Link.getId(cl), device); } } @@ -180,11 +174,11 @@ public Device getDeviceById(String id) { /** * Returns the {@link Device}, that provides the given capability. * - * @param capabilityLink + * @param capabilityId * @return {@link Device} or null */ - public Device getDeviceByCapabilityLink(String capabilityLink) { - return capabilityToDeviceMap.get(capabilityLink); + public Device getDeviceByCapabilityId(String capabilityId) { + return capabilityIdToDeviceMap.get(capabilityId); } /** @@ -211,7 +205,8 @@ public Collection<Device> getDeviceList() { * @param messageId the id of the {@link Message} * @return the {@link Device} or null if none found */ - public Device getDeviceWithMessageId(String messageId) { + public @Nullable Device getDeviceWithMessageId(String messageId) { + logger.trace("Getting Device with MessageId '{}'", messageId); for (Device d : getDeviceMap().values()) { if (d.hasMessages()) { for (Message m : d.getMessageList()) { @@ -231,7 +226,7 @@ public Device getDeviceWithMessageId(String messageId) { * @param capabilityType * @return the id of the found {@link Capability} or null */ - public String getCapabilityId(String deviceId, String capabilityType) { + public @Nullable String getCapabilityId(String deviceId, String capabilityType) { Device device = getDeviceMap().get(deviceId); for (Capability c : device.getCapabilityMap().values()) { if (c.getType().equals(capabilityType)) { diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/config/config.xml index 171a65909d1fe..144312b14ba18 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/config/config.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/i18n/innogysmarthome_de_DE.properties b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/i18n/innogysmarthome_de_DE.properties index 8f94b5fed3253..d19b4c3c1bac1 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/i18n/innogysmarthome_de_DE.properties +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/i18n/innogysmarthome_de_DE.properties @@ -10,7 +10,7 @@ thing-type.config.innogysmarthome.bridge.connection.description = Parameter zur thing-type.config.innogysmarthome.bridge.brand.label = Marke thing-type.config.innogysmarthome.bridge.brand.description = Wähle die Marke Deiner innogy SmartHome Lösung. thing-type.config.innogysmarthome.bridge.authcode.label = Autorisierungscode -thing-type.config.innogysmarthome.bridge.authcode.description = Der Autorisierungscode ist ein einmaliger Code, um die notwendigen Zugangscodes vom innogy SmartHome Dienst zu erhalten. <b> Bitte gehe je nach Marke zum...</b><ul> <li><b>innogy SmartHome Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635748&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Finnogy-smarthome.html&scope&lang=de-DE</li><li><b>SmartHome Austria Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635749&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Fsmarthome-austria.html&scope&lang=de-DE</li><li><b>Start SmartHome Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635750&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Fstart-smarthome.html&scope&lang=de-DE</li></ul><b>... um einen Autorisierungscode zu erstellen und kopiere ihn hier hinein.</b>. Nach der einmaligen Autorisierung verfällt der Code und wird nicht mehr benötigt. +thing-type.config.innogysmarthome.bridge.authcode.description = Der Autorisierungscode ist ein einmaliger Code, um die notwendigen Zugangscodes vom innogy SmartHome Dienst zu erhalten. <b> Bitte gehe je nach Marke zum...</b><ul> <li><b>innogy SmartHome Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635748&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Finnogy-smarthome.html&scope&lang=de-DE</li></ul><b>... um einen Autorisierungscode zu erstellen und kopiere ihn hier hinein.</b>. Nach der einmaligen Autorisierung verfällt der Code und wird nicht mehr benötigt. thing-type.config.innogysmarthome.bridge.websocketidletimeout.label = WebSocket idle timeout in Sekunden thing-type.config.innogysmarthome.bridge.websocketidletimeout.description = Der WebSocket hält die Verbindung zum innogy Webservice und wartet auf Statusaktualisierungen. Wenn für die angegebene Dauer keine Daten über den WebSocket empfangen werden, wird die Verbindung neu aufgebaut. 0 deaktiviert den idle timeout. Standard ist 900 Sekunden (15 Minuten). thing-type.config.innogysmarthome.bridge.refreshtoken.label = Refresh-Token @@ -85,7 +85,7 @@ channel-type.innogysmarthome.TemperatureSensor_FrostWarning.description = Warnt channel-type.innogysmarthome.HumiditySensor_Humidity.label = Luftfeuchtigkeit channel-type.innogysmarthome.HumiditySensor_Humidity.description = Aktuell gemessene Luftfeuchtigkeit channel-type.innogysmarthome.HumiditySensor_MoldWarning.label = Schimmelwarnung -channel-type.innogysmarthome.HumiditySensor_MoldWarning.description = Warnt bei Üœberschreiten einer maximalen Feuchtigkeit (wie in innogy App konfiguriert) +channel-type.innogysmarthome.HumiditySensor_MoldWarning.description = Warnt bei überschreiten einer maximalen Feuchtigkeit (wie in innogy App konfiguriert) channel-type.innogysmarthome.WindowDoorSensor.label = Tür/Fensterstatus channel-type.innogysmarthome.WindowDoorSensor.description = Zeigt den offen/geschlossen Status diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/AnalogMeter.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/AnalogMeter.xml index 782f5d39b030b..d659e095c9e10 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/AnalogMeter.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/AnalogMeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BRC8.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BRC8.xml index 0bc8baf1a14d2..d1acede5b2180 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BRC8.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BRC8.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BT-PSS.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BT-PSS.xml new file mode 100644 index 0000000000000..0500ab1cb0a33 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/BT-PSS.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="BT-PSS"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>Bluetooth Pluggable Smart Switch (BT-PSS)</label> + <description>A pluggable switch that can be switched on and off and which can measure the current energy consumption.</description> + + <channels> + <channel id="switch" typeId="SwitchActuator" /> + </channels> + + <config-description-ref uri="thing-type:innogysmarthome:config" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/GenerationMeter.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/GenerationMeter.xml index ac8c814c332e4..74bd748b61ddc 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/GenerationMeter.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/GenerationMeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISC2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISC2.xml index ec388a6d2fd6d..1ce17b688ab80 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISC2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISC2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>In wall Smart Controller (ISC2)</label> + <label>In Wall Smart Controller (ISC2)</label> <description>A smart controller with two push buttons.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISD2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISD2.xml index 9a99faec9a222..fa9b48aaff94f 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISD2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISD2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>In wall Smart Dimmer (ISD2)</label> + <label>In Wall Smart Dimmer (ISD2)</label> <description>An in wall dimmer with push buttons.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISR2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISR2.xml index 5055644709ea1..01c963b4e0dc4 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISR2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISR2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>In wall Smart Roller Shutter (ISR2)</label> + <label>In Wall Smart Roller Shutter (ISR2)</label> <description>An in wall rollershutter with two push buttons.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISS2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISS2.xml index f0576b6be2146..a9d8e89332896 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISS2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/ISS2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>In wall Smart Switch (ISS2)</label> + <label>In Wall Smart Switch (ISS2)</label> <description>An in wall switch with push buttons that can be switched on and off.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSD.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSD.xml index c7c0e6cdacbae..03648aa246a0c 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSD.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSD.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSS.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSS.xml index 5040bea876d15..3f40d98831443 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSS.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSS.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSSO.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSSO.xml index 0359bc5410fac..c0ef4ffeab2c9 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSSO.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/PSSO.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST.xml index 1a71a1e59af25..8dc8752923701 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Radiator mounted Smart Thermostat (RST)</label> + <label>Radiator Mounted Smart Thermostat (RST)</label> <description>A thermostat, that supports setting the temperature and measuring the current temperature and humidity.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST2.xml index aeda2b3f3447f..d8ec5c6c2a999 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/RST2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Radiator mounted Smart Thermostat (RST2)</label> + <label>Radiator Mounted Smart Thermostat (RST2)</label> <description>A thermostat, that supports setting the temperature and measuring the current temperature and humidity (2 battery version since 2018)</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/SmartMeter.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/SmartMeter.xml index 939bb97303f26..5e607bb0dabbc 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/SmartMeter.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/SmartMeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/TwoWayMeter.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/TwoWayMeter.xml index f4da8719a43f5..bd167f304515d 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/TwoWayMeter.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/TwoWayMeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/VariableActuator.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/VariableActuator.xml index c143775a4bd50..f5152fa264238 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/VariableActuator.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/VariableActuator.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WDS.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WDS.xml index 279440a223ae8..5ef1eb6064cd2 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WDS.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WDS.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Door/Window Sensor (WDS)</label> + <label>Wall Mounted Door/Window Sensor (WDS)</label> <description>A window/door sensor, that provides the open/close state.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMD.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMD.xml index d3186bcaeb1dc..e474dce0c7d2a 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMD.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMD.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Motion Detector Indoor (WMD)</label> + <label>Wall Mounted Motion Detector Indoor (WMD)</label> <description>A battery powered motion detector, that also measures luminance.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMDO.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMDO.xml index fe29ffb1391b8..ef368a6ff1270 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMDO.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WMDO.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Motion Detector Outdoor (WMDO)</label> + <label>Wall Mounted Motion Detector Outdoor (WMDO)</label> <description>A battery powered motion detector for outdoors, that also measures luminance.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WRT.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WRT.xml index b81f928a07919..f7ac43e764717 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WRT.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WRT.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Room Thermostat (WRT)</label> + <label>Wall Mounted Room Thermostat (WRT)</label> <description>A wall thermostat, that supports setting the temperature and measuring the current temperature and humidity.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSC2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSC2.xml index 0be238be9b6cd..907522315e425 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSC2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSC2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Smart Controller (WSC2)</label> + <label>Wall Mounted Smart Controller (WSC2)</label> <description>A battery powered smart controller with two push buttons.</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD.xml index e148bf2d7d8f6..c367e4610f817 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Smoke Detector (WSD)</label> + <label>Wall Mounted Smoke Detector (WSD)</label> <description>A battery powered smoke detector sensor with integrated alarm (first version).</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD2.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD2.xml index 1aab028c707bd..84993ca6888ce 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD2.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/WSD2.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -8,7 +9,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Wall mounted Smoke Detector (WSD2)</label> + <label>Wall Mounted Smoke Detector (WSD2)</label> <description>A battery powered smoke detector sensor with integrated alarm (2nd version with long-life battery).</description> <channels> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/bridge.xml index bd46fe1df44ab..937ec36ea60dc 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -7,13 +8,19 @@ <label>innogy SmartHome Controller</label> <description>The innogy SmartHome Controller (SHC) is the bridge for the innogy SmartHome System.</description> + <channels> + <channel id="cpu" typeId="CPUUsage" /> + <channel id="disk" typeId="DiskUsage" /> + <channel id="memory" typeId="MemoryUsage" /> + </channels> + <config-description> <parameter-group name="connection"> <label>Connection</label> <description>Parameters for connecting to innogy SmartHome Controller (SHC)</description> </parameter-group> <parameter-group name="advanced"> - <label>Advanced configuration</label> + <label>Advanced Configuration</label> <description>Advanced parameters, for special tweaking only.</description> <advanced>true</advanced> </parameter-group> @@ -24,45 +31,27 @@ <default>innogy_smarthome</default> <options> <option value="innogy_smarthome">innogy SmartHome</option> - <option value="smarthome_austria">SmartHome Austria</option> - <option value="start_smarthome">Start SmartHome</option> </options> </parameter> <parameter name="authcode" type="text" groupName="connection"> - <label>Authorization code</label> + <label>Authorization Code</label> <description><![CDATA[ The auth-code is a one-time code needed to retrieve the necessary access-codes from innogy SmartHome Service. <b>Please go - depending on your brand - to...</b> - <ul> + <ul> <li><b>innogy SmartHome Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635748&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Finnogy-smarthome.html&scope&lang=de-DE</li> - <li><b>SmartHome Austria Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635749&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Fsmarthome-austria.html&scope&lang=de-DE</li> - <li><b>Start SmartHome Portal</b>: https://api.services-smarthome.de/AUTH/authorize?response_type=code&client_id=24635750&redirect_uri=https%3A%2F%2Fwww.openhab.org%2Foauth%2Finnogy%2Fstart-smarthome.html&scope&lang=de-DE</li> - </ul> + </ul> <b>... to generate an auth-code and paste it here</b>. After initial authorization, this code is not needed anymore.]]></description> </parameter> <parameter name="websocketidletimeout" type="integer" min="0" max="3600" unit="s" groupName="advanced"> <required>false</required> <unitLabel>seconds</unitLabel> - <label>WebSocket idle timeout in seconds</label> + <label>WebSocket Idle Timeout in Seconds</label> <description>The WebSocket is the connection to the innogy service that listens to status updates. If no data is received over the websocket connection for the given time, the websocket will reconnect. 0 will disable the idle timeout. Default is 900 seconds (15 minutes).</description> <default>900</default> <advanced>true</advanced> </parameter> - <parameter name="refreshtoken" type="text" groupName="advanced" readOnly="true"> - <label>Refresh token</label> - <description>The refresh token is used to create a valid access token. It is automatically - pulled from innogy SmartHome backend with the initial auth-code.</description> - <advanced>true</advanced> - <context>password</context> - </parameter> - <parameter name="accesstoken" type="text" groupName="advanced" readOnly="true"> - <label>Access token</label> - <description>The access token is used to access the innogy SmartHome backend. Is is automatically - pulled from innogy SmartHome backend.</description> - <advanced>true</advanced> - <context>password</context> - </parameter> </config-description> </bridge-type> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/channels.xml index 5c936aecf48ff..8b05d61ccc22a 100644 --- a/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.innogysmarthome/src/main/resources/ESH-INF/thing/channels.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="innogysmarthome" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="innogysmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -22,9 +23,15 @@ <!-- RollerShutter Channel --> <channel-type id="RollerShutterActuator"> <item-type>Rollershutter</item-type> - <label>Blinds position</label> + <label>Blinds Position</label> <description>Controls the blinds</description> <category>Blinds</category> + <config-description> + <parameter name="invert" type="boolean"> + <label>Invert Position</label> + <description>When invert is true than 0 on innogy is UP and 100 is DOWN</description> + </parameter> + </config-description> </channel-type> <!-- BooleanSwitch Channel --> @@ -58,7 +65,7 @@ </channel-type> <channel-type id="ThermostatActuator_WindowReductionActive" advanced="true"> <item-type>Switch</item-type> - <label>Window reduction active</label> + <label>Window Reduction Active</label> <description>Thermostat temperature reduced, if window is open.</description> <category>Temperature</category> <state readOnly="true" /> @@ -127,7 +134,7 @@ <!-- MotionDetectionSensor Channel --> <channel-type id="MotionDetectionSensor"> <item-type>Number</item-type> - <label>Motion count</label> + <label>Motion Count</label> <description>The count of detected motions</description> <category>Count</category> <state readOnly="true"></state> @@ -145,7 +152,7 @@ <!-- PushButtonCounter Channel --> <channel-type id="PushButtonCounter" advanced="true"> <item-type>Number</item-type> - <label>Button pushed count</label> + <label>Button Pushed Count</label> <description>The count of button pushes.</description> <category>Count</category> <state readOnly="true"></state> @@ -163,7 +170,7 @@ <!-- AbsoluteEnergyConsumption --> <channel-type id="AbsoluteEnergyConsumption"> <item-type>Number</item-type> - <label>Total consumption</label> + <label>Total Consumption</label> <description>The absolute Energy consumption</description> <category>Energy</category> <state readOnly="true"></state> @@ -172,7 +179,7 @@ <!-- EnergyConsumptionMonthEuro --> <channel-type id="EnergyConsumptionMonthEuro" advanced="true"> <item-type>Number</item-type> - <label>Consumption costs (month)</label> + <label>Consumption Costs (month)</label> <description>The energy consumption per month in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -181,7 +188,7 @@ <!-- EnergyConsumptionDayEuro --> <channel-type id="EnergyConsumptionDayEuro" advanced="true"> <item-type>Number</item-type> - <label>Consumption costs (day)</label> + <label>Consumption Costs (day)</label> <description>The energy consumption per day in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -217,7 +224,7 @@ <!-- TotalEnergyGeneration --> <channel-type id="TotalEnergyGeneration"> <item-type>Number</item-type> - <label>Total generation</label> + <label>Total Generation</label> <description>The total Energy generation</description> <category>Energy</category> <state readOnly="true"></state> @@ -226,7 +233,7 @@ <!-- EnergyGenerationMonthEuro --> <channel-type id="EnergyGenerationMonthEuro" advanced="true"> <item-type>Number</item-type> - <label>Generation value (month)</label> + <label>Generation Value (month)</label> <description>The energy generation per month in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -235,7 +242,7 @@ <!-- EnergyGenerationDayEuro --> <channel-type id="EnergyGenerationDayEuro" advanced="true"> <item-type>Number</item-type> - <label>Generation value (day)</label> + <label>Generation Value (day)</label> <description>The energy generation per day in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -253,7 +260,7 @@ <!-- PowerGenerationWatt --> <channel-type id="PowerGenerationWatt"> <item-type>Number</item-type> - <label>Current Power generation</label> + <label>Current Power Generation</label> <description>The current power generation in Watt</description> <category>Energy</category> <state readOnly="true"></state> @@ -262,7 +269,7 @@ <!-- TotalEnergyConsumption --> <channel-type id="TotalEnergyConsumption"> <item-type>Number</item-type> - <label>Total consumption</label> + <label>Total Consumption</label> <description>The total Energy consumption</description> <category>Energy</category> <state readOnly="true"></state> @@ -280,7 +287,7 @@ <!-- TotalEnergyFeed --> <channel-type id="TotalEnergyFed"> <item-type>Number</item-type> - <label>Total fed</label> + <label>Total Fed</label> <description>The total Energy fed</description> <category>Energy</category> <state readOnly="true"></state> @@ -289,7 +296,7 @@ <!-- EnergyFeedMonthEuro --> <channel-type id="EnergyFeedMonthEuro" advanced="true"> <item-type>Number</item-type> - <label>Feed income (month)</label> + <label>Feed Income (month)</label> <description>The energy feed per month in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -298,7 +305,7 @@ <!-- EnergyFeedDayEuro --> <channel-type id="EnergyFeedDayEuro" advanced="true"> <item-type>Number</item-type> - <label>Feed income (day)</label> + <label>Feed Income (day)</label> <description>The energy feed per day in Euro</description> <category>Energy</category> <state readOnly="true"></state> @@ -313,4 +320,31 @@ <state readOnly="true"></state> </channel-type> + <!-- CPUUsage --> + <channel-type id="CPUUsage"> + <item-type>Number</item-type> + <label>CPU Usage</label> + <description>The CPU usage of SHC-A, updated every 5 minutes</description> + <category>System</category> + <state readOnly="true"></state> + </channel-type> + + <!-- DiskUsage --> + <channel-type id="DiskUsage"> + <item-type>Number</item-type> + <label>Disk Usage</label> + <description>The disk usage of SHC-A, updated every 5 minutes</description> + <category>System</category> + <state readOnly="true"></state> + </channel-type> + + <!-- MemoryUsage --> + <channel-type id="MemoryUsage"> + <item-type>Number</item-type> + <label>Memory Usage</label> + <description>The memory usage of SHC-A, updated every 5 minutes</description> + <category>System</category> + <state readOnly="true"></state> + </channel-type> + </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHC2state.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHC2state.json new file mode 100644 index 0000000000000..673855eda6390 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHC2state.json @@ -0,0 +1,84 @@ +{ + "configVersion": { + "value": 38, + "lastChanged": "2019-07-13T08:34:35.627766Z" + }, + "cpuUsage": { + "value": 0.80912222750515084, + "lastChanged": "2019-07-22T19:35:06.080964Z" + }, + "currentUtcOffset": { + "value": 120, + "lastChanged": "1970-01-01T00:00:00Z" + }, + "deviceConfigurationState": { + "value": "Complete", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "deviceInclusionState": { + "value": "Included", + "lastChanged": "2019-02-07T19:47:50.2148Z" + }, + "discoveryActive": { + "value": false, + "lastChanged": "2019-07-13T07:19:47.187338Z" + }, + "diskUsage": { + "value": 57.358010125846029, + "lastChanged": "2019-07-22T19:35:06.081238Z" + }, + "ethIpAddress": { + "value": "192.168.0.42", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "ethMacAddress": { + "value": "94:c6:91:a1:93:b2", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "inUseAdapter": { + "value": "eth", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "innogyLayerAttached": { + "value": true, + "lastChanged": "1970-01-01T00:00:00Z" + }, + "isReachable": { + "lastChanged": "1970-01-01T00:00:00Z" + }, + "lastReboot": { + "value": "2019-07-11T22:15:02Z", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "lbDongleAttached": { + "value": false, + "lastChanged": "1970-01-01T00:00:00Z" + }, + "memoryUsage": { + "value": 29.485105729836945, + "lastChanged": "2019-07-22T19:35:06.081461Z" + }, + "operationStatus": { + "value": "active", + "lastChanged": "2019-07-11T22:15:35.284088Z" + }, + "updateAvailable": { + "lastChanged": "1970-01-01T00:00:00Z" + }, + "wMBusDongleAttached": { + "value": false, + "lastChanged": "1970-01-01T00:00:00Z" + }, + "wifiIpAddress": { + "value": "", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "wifiMacAddress": { + "value": "40:9f:38:3d:b5:7d", + "lastChanged": "1970-01-01T00:00:00Z" + }, + "wifiSignalStrength": { + "value": 0, + "lastChanged": "1970-01-01T00:00:00Z" + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHCstate.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHCstate.json new file mode 100644 index 0000000000000..4636e109bee1a --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/SHCstate.json @@ -0,0 +1,34 @@ +{ + "updateAvailable": { + "value": "", + "lastChanged": "2019-06-20T00:15:32.766Z" + }, + "lastReboot": { + "value": "2019-06-20T00:14:10.477Z", + "lastChanged": "2019-06-20T00:15:32.767Z" + }, + "MBusDongleAttached": { + "value": false, + "lastChanged": "2019-06-20T00:15:32.875Z" + }, + "LBDongleAttached": { + "value": false, + "lastChanged": "2019-06-20T00:15:32.876Z" + }, + "configVersion": { + "value": 294, + "lastChanged": "2019-07-16T16:30:14.498Z" + }, + "OSState": { + "value": "Normal", + "lastChanged": "2019-06-20T01:15:32.961Z" + }, + "memoryLoad": { + "value": 63, + "lastChanged": "2019-07-22T19:47:43.737Z" + }, + "CPULoad": { + "value": 12, + "lastChanged": "2019-07-22T19:47:43.737Z" + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/debug.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/debug.json new file mode 100644 index 0000000000000..af15df93e5dc3 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/device/debug.json @@ -0,0 +1,15 @@ +{ + "sequenceNumber": -1, + "type": "StateChanged", + "desc": "/desc/event/StateChanged", + "namespace": "core.RWE", + "timestamp": "2019-06-29T21:16:05.1550000Z", + "source": "/device/72e753b09fd44a118997bc615351cabd", + "properties": { + "isReachable": false, + "deviceConfigurationState": "Complete", + "deviceInclusionState": "Included", + "updateState": "UpToDate", + "firmwareVersion": "1.6" + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageCreatedEventBatteryLow.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageCreatedEventBatteryLow.json new file mode 100644 index 0000000000000..5871d2108637a --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageCreatedEventBatteryLow.json @@ -0,0 +1,46 @@ +{ + "sequenceNumber": -1, + "type": "MessageCreated", + "desc": "/desc/event/MessageCreated", + "namespace": "core.RWE", + "timestamp": "2019-07-07T18:44:07.6280000Z", + "source": "/desc/device/SHC.RWE/1.0", + "data": { + "id": "c5c3128810524820b6071b00e80dfd23", + "type": "DeviceLowBattery", + "read": false, + "class": "Alert", + "timestamp": "2019-07-07T18:44:07.583Z", + "devices": ["/device/1b77a62c18c9423f871251704faec45f"], + "properties": { + "deviceName": "Fernbedienung", + "serialNumber": "914140024103", + "locationName": "Arbeitszimmer" + }, + "namespace": "core.RWE" + } +} + +{ + "sequenceNumber": -1, + "type": "MessageCreated", + "desc": "/desc/event/MessageCreated", + "namespace": "core.RWE", + "timestamp": "2019-07-07T18:41:47.2970000Z", + "source": "/desc/device/SHC.RWE/1.0", + "data": { + "id": "6e5ce2290cd247208f95a5b53736958b", + "type": "DeviceLowBattery", + "read": false, + "class": "Alert", + "timestamp": "2019-07-07T18:41:47.232Z", + "devices": ["/device/fe51785319854f36a621d0b4f8ea0e25"], + "properties": { + "deviceName": "Heizkörperthermostat", + "serialNumber": "914110165056", + "locationName": "Bad" + }, + "namespace": "core.RWE" + } +} + diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageDeletedEvent.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageDeletedEvent.json new file mode 100644 index 0000000000000..bbfb544524246 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/event/MessageDeletedEvent.json @@ -0,0 +1,8 @@ +{ + "sequenceNumber": -1, + "type": "MessageDeleted", + "desc": "/desc/event/MessageDeleted", + "namespace": "core.RWE", + "timestamp": "2019-07-07T19:15:39.2100000Z", + "data": { "id": "6e5ce2290cd247208f95a5b53736958b" } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventCapabilityChanged.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventCapabilityChanged.json new file mode 100644 index 0000000000000..447ac9475063e --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventCapabilityChanged.json @@ -0,0 +1,11 @@ +{ + "sequenceNumber": -1, + "type": "StateChanged", + "desc": "/desc/event/StateChanged", + "namespace": "core.RWE", + "timestamp": "2019-03-10T17:34:56.2400000Z", + "source": "/capability/3f268584b95c40df93b67d6c64957846", + "properties": { + "onState": true + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventStateChangedDevice.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventStateChangedDevice.json new file mode 100644 index 0000000000000..b0c4fd7208d4b --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventStateChangedDevice.json @@ -0,0 +1,11 @@ +{ + "sequenceNumber": -1, + "type": "StateChanged", + "desc": "/desc/event/StateChanged", + "namespace": "core.RWE", + "timestamp": "2019-03-10T20:49:25.4940000Z", + "source": "/device/b487e440f3e743649477fbbb64f8d55a", + "properties": { + "deviceInclusionState": "Included" + } +} diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventUserDataChanged.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventUserDataChanged.json new file mode 100644 index 0000000000000..8dc5979dc0d35 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/eventUserDataChanged.json @@ -0,0 +1,15 @@ +{ + "sequenceNumber": 0, + "type": "/event/UserDataChanged", + "timestamp": "2019-02-25T20:18:20.5600109Z", + "data": [ + { + "key": "StatesId", + "partition": "HomepageDeviceVisibility" + }, + { + "key": "UserData", + "partition": "Version" + } + ] +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/getdevices.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/getdevices.json new file mode 100644 index 0000000000000..e59f80853c192 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/getdevices.json @@ -0,0 +1,632 @@ +[ + { + "id": "b0f441a410f8465fbede93a7363a4339", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914100007996", + "type": "SHC", + "config": { + "name": "Smart Home Controller", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-07-11T10:55:52.3863424Z", + "timeOfDiscovery": "2016-07-11T10:55:52.3863424Z", + "hardwareVersion": "00.02", + "softwareVersion": "2.1.0.66", + "firmwareVersion": "1.913", + "hostName": "SMARTHOME06", + "activityLogEnabled": true, + "configurationState": "Complete", + "geoLocation": "50.8301066,6.901272800000015", + "timeZone": "W. Europe Standard Time", + "currentUTCOffset": 60.0, + "IPAddress": "192.168.0.125", + "MACAddress": "00-1a-22-00-46-ae", + "shcType": "0", + "backendConnectionMonitored": true, + "RFCommFailureNotification": false, + "postCode": "50321", + "city": "Brühl", + "street": "Hermannstraße", + "houseNumber": "13", + "country": "Deutschland", + "householdType": "House", + "numberOfPersons": 0.0, + "numberOfFloors": 0.0, + "livingArea": 0.0, + "registrationTime": "2016-07-11T10:55:52.3863424Z" + }, + "capabilities": [ + "/capability/d43d0a536110445fa040f06d25d25254", + "/capability/edfd5fa4d18e4c4994935bf5905a262e" + ] + }, + { + "id": "970da72e3d5847ac941b889e5e6e8b3a", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "", + "type": "NotificationSender", + "config": { + "name": "Notification Sender", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-07-11T10:55:52.3863424Z", + "timeOfDiscovery": "2016-07-11T10:55:52.3863424Z" + }, + "capabilities": [ + "/capability/fab663ad6dba4e0b92888bfb17dc3c1e", + "/capability/84e766ad0f99445f99c810c47547cbb6", + "/capability/098c77c87e5c42db9d39b616dcf6203d" + ] + }, + { + "id": "155f38e4ee2047c0b2246133b1de96a0", + "manufacturer": "RWE", + "version": "2.0", + "product": "VariableActuator.RWE", + "serialNumber": "155f38e4ee2047c0b2246133b1de96a0", + "type": "VariableActuator", + "config": { + "name": "Zuhause", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-07-11T10:59:57.844Z", + "timeOfDiscovery": "2016-07-11T10:56:19.262Z" + }, + "tags": { + "internalStateId": "HomeAway" + }, + "capabilities": [ + "/capability/2d7e58bca7fc40148e77cb4df6daef90" + ] + }, + { + "id": "b19d0f5794ee4a2b8ecadbf2ea470c31", + "manufacturer": "RWE", + "version": "2.0", + "product": "VariableActuator.RWE", + "serialNumber": "b19d0f5794ee4a2b8ecadbf2ea470c31", + "type": "VariableActuator", + "config": { + "name": "Urlaub", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-07-11T11:00:02.191Z", + "timeOfDiscovery": "2016-07-11T11:00:00.039Z" + }, + "tags": { + "internalStateId": "Vacation" + }, + "capabilities": [ + "/capability/aeda6003eb124b19be5ff644ca59fe40" + ] + }, + { + "id": "32214feb11a74949b573346f1a380729", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914130092370", + "type": "WSC2", + "config": { + "name": "Wandsender Test", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-07-11T11:22:18.087Z", + "timeOfDiscovery": "2016-07-11T11:20:49.192Z" + }, + "tags": { + "typeCategory": "TCSwitchIdTag", + "type": "TTwoButtonSwitchIdTag" + }, + "capabilities": [ + "/capability/2dca5b6a3e5a419d8f6f4a8f05ed8310" + ], + "location": "/location/bd67af2ca266487bb97b7d08b3468c2f" + }, + { + "id": "d68abf56664c4607a2e01d66be1fb727", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914120076611", + "type": "PSS", + "config": { + "name": "Fernseher", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-08-21T13:28:58.508Z", + "timeOfDiscovery": "2016-08-21T13:28:34.606Z" + }, + "tags": { + "typeCategory": "TCEntertainmentId", + "type": "TTVId" + }, + "capabilities": [ + "/capability/3f268584b95c40df93b67d6c64957846" + ], + "location": "/location/30858fcbea3f4833b4e7b3143ea872f7" + }, + { + "id": "18b546218e90484796e3d8e0786d0256", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914130043917", + "type": "WSC2", + "config": { + "name": "Wandsender Bett", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-09-04T11:32:50.85Z", + "timeOfDiscovery": "2016-09-04T11:32:26.982Z" + }, + "tags": { + "typeCategory": "TCSwitchIdTag", + "type": "TTwoButtonSwitchIdTag" + }, + "capabilities": [ + "/capability/4110238f56cb4cb7ba211b0d8c9b6557" + ], + "location": "/location/30858fcbea3f4833b4e7b3143ea872f7" + }, + { + "id": "e9b272c83d9a488abccb0d404771b6c6", + "manufacturer": "RWE", + "version": "1.1", + "product": "core.RWE", + "serialNumber": "914110059496", + "type": "RST", + "config": { + "name": "Heizkörperthermostat", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-09-29T18:27:38.094Z", + "timeOfDiscovery": "2016-09-29T18:27:11.102Z", + "displayCurrentTemperature": "TargetTemperature" + }, + "tags": { + "typeCategory": "TCHeatingId", + "type": "TRadiatorThermostateIdTag" + }, + "capabilities": [ + "/capability/4afde71507ba4144bb81fbdc82a5fe7e", + "/capability/a29a7a77fc05484780eae1f8b47e62b3", + "/capability/a4e1d52096c54a2ebd018e9a1338f392" + ], + "location": "/location/b09e4978ce8c4be9ad4afcdf6cc09005" + }, + { + "id": "07332bf0dd0e42508c66c846e1e1a8ad", + "manufacturer": "RWE", + "version": "2.0", + "product": "SunriseSunsetSensor.RWE", + "serialNumber": "07332bf0dd0e42508c66c846e1e1a8ad", + "type": "SunriseSunsetSensor", + "config": { + "name": "Sunrise Sunset Sensor", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-09-29T21:51:39.553Z", + "timeOfDiscovery": "2016-09-29T21:51:33.965Z" + }, + "capabilities": [ + "/capability/64bf06b56b5e4fc49292985c6bb48bea" + ] + }, + { + "id": "6de7890d580649aeafd66043b2102a12", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430037295", + "type": "WDS", + "config": { + "name": "Balkon", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-11-20T21:19:41.098Z", + "timeOfDiscovery": "2016-11-20T21:19:25.775Z" + }, + "tags": { + "typeCategory": "TCDoorId", + "type": "TBalconyDoorId" + }, + "capabilities": [ + "/capability/3655816c7413451db58b9c07e473540b" + ], + "location": "/location/e397695c607846379c76068beac379af" + }, + { + "id": "0f16337ac685415986a274376b601450", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914150006603", + "type": "WMD", + "config": { + "name": "Bewegungsmelder", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-11-04T22:13:28.403Z", + "timeOfDiscovery": "2016-11-04T22:12:54.536Z" + }, + "tags": { + "typeCategory": "TCMotionIdTag", + "type": "TMotionDetectorIdTag" + }, + "capabilities": [ + "/capability/5d41af178a664418ad8ee10b5d906d98", + "/capability/2684a9d13ac9410b94eae134ed39826f" + ], + "location": "/location/26f2f33fbe7a4e6abddfc1512a65e4e0" + }, + { + "id": "baed452016404d1f8c7d6bf5525fc224", + "manufacturer": "RWE", + "version": "1.1", + "product": "core.RWE", + "serialNumber": "914210002474", + "type": "ISS2", + "config": { + "name": "Deckenleuchte", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-11-04T23:33:57.461Z", + "timeOfDiscovery": "2016-11-04T23:33:25.954Z" + }, + "tags": { + "typeCategory": "TCLightId", + "type": "TCeilingLightId" + }, + "capabilities": [ + "/capability/7efeaa246c704713beda52abdd741d45", + "/capability/fb8a5e34c3c54ef998579d44bb57b198" + ], + "location": "/location/26f2f33fbe7a4e6abddfc1512a65e4e0" + }, + { + "id": "76e68e066e874b9da3403223cbf4b048", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "IRW0020883", + "type": "WSD", + "config": { + "name": "Rauchmelder", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-11-20T21:34:39.905Z", + "timeOfDiscovery": "2016-11-20T21:34:34.388Z" + }, + "tags": { + "typeCategory": "TSmokeDetectorIdTag", + "type": "TOpticalSmokeDetectorIdTag" + }, + "capabilities": [ + "/capability/aa25dfc37fee4b11978a7c6f76fd2c19", + "/capability/56ba36531e4a485ea68a12539fb4cf5e" + ], + "location": "/location/e397695c607846379c76068beac379af" + }, + { + "id": "fd6830f0066f4283b5fc7ba1c8f43071", + "manufacturer": "RWE", + "version": "1.1", + "product": "core.RWE", + "serialNumber": "914210010378", + "type": "ISS2", + "config": { + "name": "Balkon", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-07T07:37:21.649Z", + "timeOfDiscovery": "2016-12-07T07:36:46.033Z" + }, + "tags": { + "typeCategory": "TCLightId", + "type": "TOutsideLightId" + }, + "capabilities": [ + "/capability/3f2bb031cc1c447aa849e930c7bd4c02", + "/capability/5af9f6896e114051b9e3423cf0aa7f20" + ], + "location": "/location/e397695c607846379c76068beac379af" + }, + { + "id": "a8282a7de8ff4b19958051814f8d8ad6", + "manufacturer": "RWE", + "version": "1.1", + "product": "core.RWE", + "serialNumber": "914110012419", + "type": "RST", + "config": { + "name": "Heizkörperthermostat", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-07T21:36:41.022Z", + "timeOfDiscovery": "2016-12-07T21:36:16.215Z", + "displayCurrentTemperature": "TargetTemperature" + }, + "tags": { + "typeCategory": "TCHeatingId", + "type": "TRadiatorThermostateIdTag" + }, + "capabilities": [ + "/capability/00a711783dbc4ea0960f923af5c45ad5", + "/capability/c8baa78d382649b3995c1eb504469ff4", + "/capability/2594a0af3293424e82e19ca64bc84f01" + ], + "location": "/location/fb7593aa398a47508f2072d593cd1bfa" + }, + { + "id": "728baded2f4445a6926e7512cd03e6d3", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "fb7593aa398a47508f2072d593cd1bfa", + "type": "VRCC", + "config": { + "name": "Raumklima", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-12-07T21:36:41.372Z", + "timeOfDiscovery": "2016-12-07T21:36:41.372Z", + "underlyingDeviceIds": "a8282a7de8ff4b19958051814f8d8ad6" + }, + "capabilities": [ + "/capability/37a02890ab9f44bb97b403fb01326a46", + "/capability/27afb854c4074ecbace3857380ef2a95", + "/capability/b636bed0634044428e29c4a768425798" + ], + "location": "/location/fb7593aa398a47508f2072d593cd1bfa" + }, + { + "id": "4337389c9c4a416dbeacd826f85edc2a", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430017792", + "type": "WDS", + "config": { + "name": "Dachfenster", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-07T21:41:08.229Z", + "timeOfDiscovery": "2016-12-07T21:40:44.48Z" + }, + "tags": { + "typeCategory": "TCWindowId", + "type": "TRoofWindowId" + }, + "capabilities": [ + "/capability/e60a20b2287d4aa690aaffae6d08aa20" + ], + "location": "/location/fb7593aa398a47508f2072d593cd1bfa" + }, + { + "id": "452b3515364d45c49285b99484acde28", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "b09e4978ce8c4be9ad4afcdf6cc09005", + "type": "VRCC", + "config": { + "name": "Raumklima", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-12-07T21:48:09.505Z", + "timeOfDiscovery": "2016-12-07T21:48:09.505Z", + "underlyingDeviceIds": "e9b272c83d9a488abccb0d404771b6c6" + }, + "capabilities": [ + "/capability/a50fba7718ef4fc4be89869e1ce129be", + "/capability/67b3bf1bf0da46ca8833debba71a375d", + "/capability/1f9a66910ee24b3085e53aeda7e5a4cd" + ], + "location": "/location/b09e4978ce8c4be9ad4afcdf6cc09005" + }, + { + "id": "72e753b09fd44a118997bc615351cabd", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914120073945", + "type": "PSS", + "config": { + "name": "Fernseher", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T19:47:03.674Z", + "timeOfDiscovery": "2016-12-14T19:46:46.387Z" + }, + "tags": { + "typeCategory": "TCEntertainmentId", + "type": "TTVId" + }, + "capabilities": [ + "/capability/43e345ee14e94996a04972267b5d0489" + ], + "location": "/location/fb7593aa398a47508f2072d593cd1bfa" + }, + { + "id": "cb8f20e7dfa34f76956e4c797dc4c96a", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914130043726", + "type": "WSC2", + "config": { + "name": "Wandsender", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T20:06:16.502Z", + "timeOfDiscovery": "2016-12-14T20:06:03.372Z" + }, + "tags": { + "typeCategory": "TCSwitchIdTag", + "type": "TTwoButtonSwitchIdTag" + }, + "capabilities": [ + "/capability/41468ab7824b443ea493f12bd87653e0" + ], + "location": "/location/fb7593aa398a47508f2072d593cd1bfa" + }, + { + "id": "4e79eb7a18cf4a3a94d6b26c6ebdb8cb", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430016160", + "type": "WDS", + "config": { + "name": "Dachfenster", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T20:14:56.433Z", + "timeOfDiscovery": "2016-12-14T20:14:34.906Z" + }, + "tags": { + "typeCategory": "TCWindowId", + "type": "TRoofWindowId" + }, + "capabilities": [ + "/capability/3bb24f7906c043d2ae77bb2ec9f7d2fe" + ], + "location": "/location/24442676b2ea406ea671df22068cc02c" + }, + { + "id": "fe51785319854f36a621d0b4f8ea0e25", + "manufacturer": "RWE", + "version": "1.1", + "product": "core.RWE", + "serialNumber": "914110165056", + "type": "RST", + "config": { + "name": "Heizkörperthermostat", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T20:22:41.463Z", + "timeOfDiscovery": "2016-12-14T20:21:49.681Z", + "displayCurrentTemperature": "TargetTemperature" + }, + "tags": { + "typeCategory": "TCHeatingId", + "type": "TRadiatorThermostateIdTag" + }, + "capabilities": [ + "/capability/5a0f2df3f7064cdbb71c2d6340c985ad", + "/capability/8ff9ea5c3233434ba87426e0a23b245e", + "/capability/7b98d33e5a15404686b2cbc99f725d01" + ], + "location": "/location/24442676b2ea406ea671df22068cc02c" + }, + { + "id": "9756c6b4dcb14fa391e1748d35e286fb", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "24442676b2ea406ea671df22068cc02c", + "type": "VRCC", + "config": { + "name": "Raumklima", + "protocolId": "Virtual", + "timeOfAcceptance": "2016-12-14T20:22:41.776Z", + "timeOfDiscovery": "2016-12-14T20:22:41.777Z", + "underlyingDeviceIds": "fe51785319854f36a621d0b4f8ea0e25" + }, + "capabilities": [ + "/capability/f8d4593186694df4a86c325fc914596b", + "/capability/0949f28423864bebb6f0ab64a99fa8a1", + "/capability/6db429654212467a8661c1dea714c942" + ], + "location": "/location/24442676b2ea406ea671df22068cc02c" + }, + { + "id": "9fdeb547d2ca4dd0b28631985d525131", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430019747", + "type": "WDS", + "config": { + "name": "Dachfenster", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T20:27:14.769Z", + "timeOfDiscovery": "2016-12-14T20:27:07.685Z" + }, + "tags": { + "typeCategory": "TCWindowId", + "type": "TRoofWindowId" + }, + "capabilities": [ + "/capability/8f0e726da08e438fa2a7b8d479ffb37d" + ], + "location": "/location/30858fcbea3f4833b4e7b3143ea872f7" + }, + { + "id": "e28b3b1d02db474aaf1fd910ce67e67e", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430037338", + "type": "WDS", + "config": { + "name": "Dachfenster", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-14T20:29:34.071Z", + "timeOfDiscovery": "2016-12-14T20:29:08.665Z" + }, + "tags": { + "typeCategory": "TCWindowId", + "type": "TRoofWindowId" + }, + "capabilities": [ + "/capability/a665756005e849c6abb8061d4a848eb8" + ], + "location": "/location/b09e4978ce8c4be9ad4afcdf6cc09005" + }, + { + "id": "5b1fe837a6fa4e6587fab1b260adc288", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "914220020108", + "type": "ISD2", + "config": { + "name": "Deckenleuchte", + "protocolId": "Cosip", + "timeOfAcceptance": "2016-12-28T18:46:59.916Z", + "timeOfDiscovery": "2016-12-28T18:46:39.096Z" + }, + "tags": { + "typeCategory": "TCLightId", + "type": "TCeilingLightId" + }, + "capabilities": [ + "/capability/0fbb96bde9e24517b5d37d9932b4e24e", + "/capability/9a97159073f94470bcb30e4706c0a441" + ], + "location": "/location/26f2f33fbe7a4e6abddfc1512a65e4e0" + }, + { + "id": "f78e30ef7098480cbfa096d363085825", + "manufacturer": "RWE", + "version": "1.0", + "product": "core.RWE", + "serialNumber": "921430037314", + "type": "WDS", + "config": { + "name": "Dachfenster", + "protocolId": "Cosip", + "timeOfAcceptance": "2017-05-13T10:16:54.232Z", + "timeOfDiscovery": "2017-05-13T10:16:35.025Z" + }, + "tags": { + "typeCategory": "TCWindowId", + "type": "TRoofWindowId" + }, + "capabilities": [ + "/capability/7bc3e21536e64f2d847a09d00b1f28ce" + ], + "location": "/location/d4a54173ba104bec9734e822e303f4a2" + }, + { + "id": "949a1b6b254b49e0a1ba593ce7e88f36", + "manufacturer": "RWE", + "version": "2.0", + "product": "VariableActuator.RWE", + "serialNumber": "949a1b6b254b49e0a1ba593ce7e88f36", + "type": "VariableActuator", + "config": { + "name": "Sex", + "protocolId": "Virtual", + "timeOfAcceptance": "2017-08-28T20:01:49.095Z", + "timeOfDiscovery": "2017-08-20T13:39:53.963Z" + }, + "capabilities": [ + "/capability/a38daa9e72084ca9950c1f353aeb8ef3" + ] + } +] diff --git a/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/message_configChanged.json b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/message_configChanged.json new file mode 100644 index 0000000000000..3eddae6649fd9 --- /dev/null +++ b/bundles/org.openhab.binding.innogysmarthome/src/test/resources/org/openhab/binding/innogysmarthome/internal/client/entity/message_configChanged.json @@ -0,0 +1,45 @@ +{ + "sequenceNumber": -1, + "type": "ConfigurationChanged", + "desc": "/desc/event/ConfigurationChanged", + "namespace": "core.RWE", + "timestamp": "2019-02-25T19:53:17.1960000Z", + "source": "/desc/device/SHC.RWE/1.0", + "data": { + "devices": [ + { + "id": "0ba965875d37416a935b6552cd6929d9", + "manufacturer": "RWE", + "version": "2.0", + "product": "VariableActuator.RWE", + "serialNumber": "0ba965875d37416a935b6552cd6929d9", + "type": "VariableActuator", + "config": { + "name": "Test", + "protocolId": "Virtual", + "timeOfAcceptance": "2019-02-25T19:53:16.183Z", + "timeOfDiscovery": "2019-01-30T01:59:52.451Z" + }, + "capabilities": [ + "/capability/692d923c583346e2a358db8e32b3c505" + ] + } + ], + "locations": [], + "capabilities": [ + { + "id": "692d923c583346e2a358db8e32b3c505", + "type": "BooleanStateActuator", + "device": "/device/0ba965875d37416a935b6552cd6929d9", + "config": { + "name": "Boolean State Actuator", + "activityLogActive": true + } + } + ], + "interactions": [], + "homeSetups": [], + "deleted": [], + "configVersion": 246 + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.ipp/NOTICE b/bundles/org.openhab.binding.ipp/NOTICE index 5d11530621c2a..39142ca77f781 100644 --- a/bundles/org.openhab.binding.ipp/NOTICE +++ b/bundles/org.openhab.binding.ipp/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.ipp/pom.xml b/bundles/org.openhab.binding.ipp/pom.xml index e2eb11d1f912f..a026a967d4faf 100644 --- a/bundles/org.openhab.binding.ipp/pom.xml +++ b/bundles/org.openhab.binding.ipp/pom.xml @@ -1,24 +1,56 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.ipp</artifactId> <name>openHAB Add-ons :: Bundles :: IPP Binding</name> + <properties> + <bnd.importpackage>!org.simpleframework.xml.*,!org.cups4j,!net.sf.ehcache.*,!net.spy.*</bnd.importpackage> + </properties> + <dependencies> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>org.cups4j.cups4j</artifactId> + <groupId>org.cups4j</groupId> + <artifactId>cups4j</artifactId> <version>0.7.6</version> - <scope>provided</scope> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.simpleframework</groupId> + <artifactId>simple-xml</artifactId> + <version>2.7.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>xmlpull</groupId> + <artifactId>xmlpull</artifactId> + <version>1.1.3.1</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-osgi</artifactId> + <version>4.4.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-osgi</artifactId> + <version>4.5.3</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.ipp/src/main/feature/feature.xml b/bundles/org.openhab.binding.ipp/src/main/feature/feature.xml index f61734a2a0a26..d6f3bf93935e1 100644 --- a/bundles/org.openhab.binding.ipp/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.ipp/src/main/feature/feature.xml @@ -1,13 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.ipp-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-ipp" description="IPP Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-mdns</feature> - <bundle dependency="true">mvn:org.openhab.osgiify/org.cups4j.cups4j/0.7.6</bundle> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.4</bundle> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.ipp/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppBindingConstants.java b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppBindingConstants.java index ca741002c5be8..a973fb64f0e66 100644 --- a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppBindingConstants.java +++ b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppHandlerFactory.java b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppHandlerFactory.java index e14d4585a3a15..6ccc80b4ad9b8 100644 --- a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppHandlerFactory.java +++ b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/IppHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/discovery/IppPrinterDiscoveryParticipant.java b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/discovery/IppPrinterDiscoveryParticipant.java index 718f202b63179..6780df16a04b8 100644 --- a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/discovery/IppPrinterDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/discovery/IppPrinterDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/handler/IppPrinterHandler.java b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/handler/IppPrinterHandler.java index 45d2d67efa4df..33c514054bae4 100644 --- a/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/handler/IppPrinterHandler.java +++ b/bundles/org.openhab.binding.ipp/src/main/java/org/openhab/binding/ipp/internal/handler/IppPrinterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ipp/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.ipp/src/main/resources/ESH-INF/thing/thing-types.xml index 0c78f7e7cef41..f0661f3d59492 100644 --- a/bundles/org.openhab.binding.ipp/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.ipp/src/main/resources/ESH-INF/thing/thing-types.xml @@ -22,7 +22,7 @@ <description>The URL of the printer</description> </parameter> <parameter name="refresh" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds</description> <default>60</default> </parameter> @@ -31,19 +31,19 @@ <channel-type id="jobs" advanced="true"> <item-type>Number</item-type> - <label>total jobs</label> + <label>Total Jobs</label> <description>Total number of print jobs on the printer</description> <state readOnly="true"></state> </channel-type> <channel-type id="waitingJobs"> <item-type>Number</item-type> - <label>waiting jobs</label> + <label>Waiting Jobs</label> <description>Number of waiting print jobs on the printer</description> <state readOnly="true"></state> </channel-type> <channel-type id="doneJobs" advanced="true"> <item-type>Number</item-type> - <label>done jobs</label> + <label>Done Jobs</label> <description>Number of completed print jobs on the printer</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.irtrans/NOTICE b/bundles/org.openhab.binding.irtrans/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.irtrans/NOTICE +++ b/bundles/org.openhab.binding.irtrans/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.irtrans/README.md b/bundles/org.openhab.binding.irtrans/README.md index 31dfe226548c9..23948c1da21ab 100644 --- a/bundles/org.openhab.binding.irtrans/README.md +++ b/bundles/org.openhab.binding.irtrans/README.md @@ -31,8 +31,8 @@ The *ethernet* Thing supports the following Channel Types: | Channel Type ID | Item Type | Description | |-----------------|-----------|-------------------------------------------------------------------------------------| -| blaster | String | Send (filtered) infrared commands over the specified blaster led of the transceiver | -| receiver | String | Receive (filtered) infrared commands on the receiver led of the transceiver | +| blaster | String | Send (filtered) infrared commands over the specified blaster LED of the transceiver | +| receiver | String | Receive (filtered) infrared commands on the receiver LED of the transceiver | The *blaster* Channel Type requires a *led* configuration parameter to specify on which infrared commands will be emitted, *remote* the remote or manufacturer name which's commands will be allowed, as defined in the IRtrans server database that is flashed into the transceiver (can be '*' for 'any' remote), and *command* the name of the command will be allowed, as defined in the IRtrans server database that is flashed into the transceiver (can be '*' for 'any' command). @@ -57,6 +57,8 @@ Type blaster : samsung [led="E", remote="samsung", command="*"] ``` In the above example, the first channel will be updated when any IR command from any type of device is received. The second channel will only be updated if a "power" infrared command from the remote/device type "telenet" is received. The third channel can be used to feed any type of infrared command to a Samsung television by means of the "E" emitter of the IRtrans device. +The led can be "E"-External, "I"-Internal, "B"-Both, and a numeric for a selected led. +Depending on the number of remotes, the bufferSize must be adjusted. E.g. for 7 remotes and 47 commands a bufferSize of 2048 is needed. ``` Bridge irtrans:ethernet:technicalfacilities [ ipAddress="192.168.0.58", portNumber=21000, bufferSize=1024, responseTimeOut=100, pingTimeOut=2000, reconnectInterval=10 ] @@ -69,7 +71,7 @@ Type blaster : appletv [led="3", remote="appletv", command="*"] } ``` -In the above channel a single IRtrans transceiver has 3 output leds in use, 2 to drive 2 DTV SetTopBoxes, and a third one to drive an Apple TV device. +In the above channel a single IRtrans transceiver has 3 output LEDs in use, 2 to drive 2 DTV SetTopBoxes, and a third one to drive an Apple TV device. demo.items: diff --git a/bundles/org.openhab.binding.irtrans/pom.xml b/bundles/org.openhab.binding.irtrans/pom.xml index 55a30423a8c0a..5945529841a12 100644 --- a/bundles/org.openhab.binding.irtrans/pom.xml +++ b/bundles/org.openhab.binding.irtrans/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.irtrans</artifactId> diff --git a/bundles/org.openhab.binding.irtrans/src/main/feature/feature.xml b/bundles/org.openhab.binding.irtrans/src/main/feature/feature.xml index ca9949621b006..babf7b7bf1a41 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.irtrans/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.irtrans-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-irtrans" description="IRTrans Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransBindingConstants.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransBindingConstants.java index 0ac6dee392d63..f34ce2dac1fe5 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransBindingConstants.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransHandlerFactory.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransHandlerFactory.java index fff555c3139a0..02e4c2c9b91bb 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransHandlerFactory.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IRtransHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IrCommand.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IrCommand.java index f4969a24ced4c..022c831cee623 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IrCommand.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/IrCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/BlasterHandler.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/BlasterHandler.java index 4ab6b6389586c..082cdc2670cfd 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/BlasterHandler.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/BlasterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java index 63c37cf7c7c91..ebfabed7d71c9 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/EthernetBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/TransceiverStatusListener.java b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/TransceiverStatusListener.java index 28aca5d50495a..ba36ac4ab1e85 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/TransceiverStatusListener.java +++ b/bundles/org.openhab.binding.irtrans/src/main/java/org/openhab/binding/irtrans/internal/handler/TransceiverStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.irtrans/src/main/resources/ESH-INF/thing/ethernetbridge.xml b/bundles/org.openhab.binding.irtrans/src/main/resources/ESH-INF/thing/ethernetbridge.xml index 5613d9a16a89d..f1bc118ae4ec2 100644 --- a/bundles/org.openhab.binding.irtrans/src/main/resources/ESH-INF/thing/ethernetbridge.xml +++ b/bundles/org.openhab.binding.irtrans/src/main/resources/ESH-INF/thing/ethernetbridge.xml @@ -10,31 +10,31 @@ <config-description> <parameter name="ipAddress" type="text" required="true"> - <label>Network address</label> + <label>Network Address</label> <description>Network address of the ethernet transceiver</description> <context>network-address</context> </parameter> <parameter name="portNumber" type="integer" required="true"> - <label>Port number</label> + <label>Port Number</label> <description>TCP port number of the transceiver service</description> </parameter> <parameter name="bufferSize" type="integer" required="false"> - <label>Buffer size</label> + <label>Buffer Size</label> <description>Buffer size used by the TCP socket when sending and receiving commands to the transceiver</description> <default>1024</default> </parameter> <parameter name="responseTimeOut" type="integer" required="false"> - <label>Response time out</label> + <label>Response Time Out</label> <description>Specifies the time milliseconds to wait for a response from the transceiver when sending a command.</description> <default>100</default> </parameter> <parameter name="pingTimeOut" type="integer" required="false"> - <label>Ping time out</label> + <label>Ping Time Out</label> <description>Specifies the time milliseconds to wait for a response from the transceiver when pinging the device</description> <default>1000</default> </parameter> <parameter name="reconnectInterval" type="integer" required="false"> - <label>Reconnect interval</label> + <label>Reconnect Interval</label> <description>Specifies the time seconds to wait before reconnecting to a transceiver after a communication failure</description> <default>10</default> </parameter> diff --git a/bundles/org.openhab.binding.jeelink/NOTICE b/bundles/org.openhab.binding.jeelink/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.jeelink/NOTICE +++ b/bundles/org.openhab.binding.jeelink/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.jeelink/pom.xml b/bundles/org.openhab.binding.jeelink/pom.xml index ea920cc309342..29c517a40a6e0 100644 --- a/bundles/org.openhab.binding.jeelink/pom.xml +++ b/bundles/org.openhab.binding.jeelink/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.jeelink</artifactId> diff --git a/bundles/org.openhab.binding.jeelink/src/main/feature/feature.xml b/bundles/org.openhab.binding.jeelink/src/main/feature/feature.xml index 67d3161329de1..2af682e8814fe 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.jeelink/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.jeelink-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-jeelink" description="Jeelink Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/IgnoringConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/IgnoringConverter.java index 6573840220d27..80585eb6c5dc0 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/IgnoringConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/IgnoringConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkBindingConstants.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkBindingConstants.java index 8bc66854628dd..91cfb6dd28e06 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkBindingConstants.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandler.java index a7436612b9804..6175ea2d52424 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandlerFactory.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandlerFactory.java index de2639ef9bc33..93703fca23613 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandlerFactory.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkReadingConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkReadingConverter.java index 6202e2f8bc04a..a3ad230bc8788 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkReadingConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkReadingConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkSensorHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkSensorHandler.java index 9cf46175588cc..a6b37980035fd 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkSensorHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/JeeLinkSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/Reading.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/Reading.java index a43927658f906..9ca7720ee9f79 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/Reading.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/Reading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingHandler.java index e4e20ad49c300..68ccb4fce3213 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingPublisher.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingPublisher.java index b5c059a1f7cb7..c6aeadffbebc1 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingPublisher.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ReadingPublisher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingAveragePublisher.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingAveragePublisher.java index 9c917aa3d389d..b35befa4c12a4 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingAveragePublisher.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingAveragePublisher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingReadingAverage.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingReadingAverage.java index 9553c9c8a56a5..8d49130c6e7af 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingReadingAverage.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/RollingReadingAverage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/SensorDefinition.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/SensorDefinition.java index 970e0f58d30dc..818868f62146d 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/SensorDefinition.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/SensorDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkConfig.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkConfig.java index f8a6a6ed074a0..c8ae3894bc8d9 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkConfig.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkSensorConfig.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkSensorConfig.java index 59c502ccfbfd1..67c1f79da2807 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkSensorConfig.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/JeeLinkSensorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/LaCrosseTemperatureSensorConfig.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/LaCrosseTemperatureSensorConfig.java index 92eaf84a590d9..c3377b0a8c8c7 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/LaCrosseTemperatureSensorConfig.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/LaCrosseTemperatureSensorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/Pca301SensorConfig.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/Pca301SensorConfig.java index 31de5b25a4ef6..ba1bc0c906833 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/Pca301SensorConfig.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/config/Pca301SensorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/AbstractJeeLinkConnection.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/AbstractJeeLinkConnection.java index c0c06a90dab18..2f262376033cb 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/AbstractJeeLinkConnection.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/AbstractJeeLinkConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/ConnectionListener.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/ConnectionListener.java index d119b1fd191e3..5f8bb42b66d99 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/ConnectionListener.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/ConnectionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkConnection.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkConnection.java index e741dc5d5d5dc..7bcd2e9592ebe 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkConnection.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkSerialConnection.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkSerialConnection.java index cbd393731f4f4..b889338bece9a 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkSerialConnection.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkSerialConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkTcpConnection.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkTcpConnection.java index e8803e6627cee..89ba3a46a71f6 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkTcpConnection.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/connection/JeeLinkTcpConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/discovery/SensorDiscoveryService.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/discovery/SensorDiscoveryService.java index 116f90db6e3e0..af00b89f2bd19 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/discovery/SensorDiscoveryService.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/discovery/SensorDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReading.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReading.java index ff84b471c0f6e..e934a901cd2fb 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReading.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReadingConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReadingConverter.java index c5151ec996248..e4be25bd847e4 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReadingConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kReadingConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kRollingReadingAverage.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kRollingReadingAverage.java index 0ca443e0f3e2f..e9d6606a09485 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kRollingReadingAverage.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kRollingReadingAverage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorDefinition.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorDefinition.java index 7124fdaef3c19..15fcf7692b2c0 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorDefinition.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorHandler.java index fcaf43890844b..0a843c2346d7e 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/ec3k/Ec3kSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/BoundsCheckingPublisher.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/BoundsCheckingPublisher.java index 01f8fbc738fa4..d4250e3bd5916 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/BoundsCheckingPublisher.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/BoundsCheckingPublisher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/DifferenceCheckingPublisher.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/DifferenceCheckingPublisher.java index 5695937f5047d..698627d71672b 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/DifferenceCheckingPublisher.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/DifferenceCheckingPublisher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseRollingReadingAverage.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseRollingReadingAverage.java index b9ea929cdc239..32195d8585cb4 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseRollingReadingAverage.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseRollingReadingAverage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseSensorDefinition.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseSensorDefinition.java index 79c527ecd1c51..051928fc43fdd 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseSensorDefinition.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseSensorDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReading.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReading.java index 9ebfd07e86ca3..740f783b2b729 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReading.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReadingConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReadingConverter.java index cf3a31c3de797..ab83cdfb9b51d 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReadingConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureReadingConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureSensorHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureSensorHandler.java index 5592749c564bd..ddf379ca84abc 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureSensorHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/LaCrosseTemperatureSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22Reading.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22Reading.java index d45b6a1016b71..71d3ca8f44b34 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22Reading.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22Reading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22ReadingConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22ReadingConverter.java index 804f1aa81fb1e..181b1ac22d224 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22ReadingConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22ReadingConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorDefinition.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorDefinition.java index 9ee496799eb93..c4259d3be8fa2 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorDefinition.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorHandler.java index 546accf479a37..7ccdf64de972e 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/lacrosse/Tx22SensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301Reading.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301Reading.java index dbc6ffb7d094f..71891916a2f55 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301Reading.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301Reading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301ReadingConverter.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301ReadingConverter.java index 9938d8957bd1b..1ac232215ae9c 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301ReadingConverter.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301ReadingConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorDefinition.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorDefinition.java index 286ed11ebfce7..74401af8aeb2e 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorDefinition.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorHandler.java b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorHandler.java index a45f7c0e5d017..a130b722ce5e0 100644 --- a/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorHandler.java +++ b/bundles/org.openhab.binding.jeelink/src/main/java/org/openhab/binding/jeelink/internal/pca301/Pca301SensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.keba/NOTICE b/bundles/org.openhab.binding.keba/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.keba/NOTICE +++ b/bundles/org.openhab.binding.keba/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.keba/README.md b/bundles/org.openhab.binding.keba/README.md index bfd64b9a21879..2c1c5bae994b5 100644 --- a/bundles/org.openhab.binding.keba/README.md +++ b/bundles/org.openhab.binding.keba/README.md @@ -1,6 +1,6 @@ # Keba Binding -This binding integrates the [Keba KeContact EV Charging Stations](http://www.keba.com). +This binding integrates the [Keba KeContact EV Charging Stations](https://www.keba.com). ## Supported Things diff --git a/bundles/org.openhab.binding.keba/pom.xml b/bundles/org.openhab.binding.keba/pom.xml index f2b0a4da1a21a..cf254e821a944 100644 --- a/bundles/org.openhab.binding.keba/pom.xml +++ b/bundles/org.openhab.binding.keba/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.keba</artifactId> diff --git a/bundles/org.openhab.binding.keba/src/main/feature/feature.xml b/bundles/org.openhab.binding.keba/src/main/feature/feature.xml index 4862ccc3a2067..be67517836124 100644 --- a/bundles/org.openhab.binding.keba/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.keba/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.keba-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-keba" description="Keba Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaBindingConstants.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaBindingConstants.java index 1b27fe8399ec2..601e09054b730 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaBindingConstants.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaHandlerFactory.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaHandlerFactory.java index cbd04a81acd19..cf017a695e105 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaHandlerFactory.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/KebaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactHandler.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactHandler.java index aa4e1d2a1601a..28d7b6d55f46a 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactHandler.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java index c944621206a52..f3241bb7371f0 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -236,7 +236,7 @@ protected ByteBuffer send(String message, KeContactHandler handler) { boolean error = false; for (KeContactHandler handler : handlers) { - if (datagramChannels.get(handler).equals(theChannel)) { + if (theChannel.equals(datagramChannels.get(handler))) { theHandler = handler; break; } diff --git a/bundles/org.openhab.binding.keba/src/main/resources/ESH-INF/thing/kecontact.xml b/bundles/org.openhab.binding.keba/src/main/resources/ESH-INF/thing/kecontact.xml index a1ea6c3fb5da6..17786a3238f97 100644 --- a/bundles/org.openhab.binding.keba/src/main/resources/ESH-INF/thing/kecontact.xml +++ b/bundles/org.openhab.binding.keba/src/main/resources/ESH-INF/thing/kecontact.xml @@ -63,7 +63,7 @@ <description>Network address of the wallbox</description> </parameter> <parameter name="refreshInterval" type="integer" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> <default>15</default> </parameter> @@ -218,13 +218,13 @@ <state readOnly="false"></state> </channel-type> <channel-type id="authreq" advanced="true"> - <item-type>Number</item-type> + <item-type>Switch</item-type> <label>Authentication Required</label> <description>Authentication required</description> <state readOnly="true"></state> </channel-type> <channel-type id="authon" advanced="true"> - <item-type>Number</item-type> + <item-type>Switch</item-type> <label>Authentication Enabled</label> <description>Authentication enabled</description> <state readOnly="true"></state> @@ -237,7 +237,7 @@ </channel-type> <channel-type id="sessionrfidclass" advanced="true"> <item-type>String</item-type> - <label>RFID Tag class</label> + <label>RFID Tag Class</label> <description>RFID Tag class used for the last charging session</description> <state readOnly="true"></state> </channel-type> @@ -249,7 +249,7 @@ </channel-type> <channel-type id="setenergylimit"> <item-type>Number</item-type> - <label>Energy limit</label> + <label>Energy Limit</label> <description>An energy limit for an already running or the next charging session.</description> <state pattern="%d Wh" readOnly="false"></state> </channel-type> diff --git a/bundles/org.openhab.binding.km200/NOTICE b/bundles/org.openhab.binding.km200/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.km200/NOTICE +++ b/bundles/org.openhab.binding.km200/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.km200/README.md b/bundles/org.openhab.binding.km200/README.md index f5219a354862d..7ccb8bed0f667 100644 --- a/bundles/org.openhab.binding.km200/README.md +++ b/bundles/org.openhab.binding.km200/README.md @@ -3,23 +3,23 @@ The KM200 Binding is communicating with a [Buderus Logamatic web KM200 / KM100 / KM50](https://www.buderus.de/de/produkte/catalogue/alle-produkte/7719_gateway-logamatic-web-km200-km100-km50). It is possible to receive and send parameters like string or float values. -**Important**: If the communication is not working and you see in the logfile errors like "illegal key size" then you have to change the [Java Cryptography Extension to the Unlimited Strength Jurisdiction](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html). +**Important**: If the communication is not working and you see in the logfile errors like "illegal key size" then you have to change the [Java Cryptography Extension to the Unlimited Strength Jurisdiction](https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html). ## Supported Things This binding supports 11 different things types -| Thing | Paper UI Only | Description | -| ------------------ | ------------ |----------------------------------------------------------- | -| `appliance` | | The appliance (The heater inside of this heating system). | -| `dhwCircuit` | | A hot water circuit. | -| `gateway` | | The gateway. (The connected KM200/100/50 device). | +| Thing | Paper UI Only | Description | +| ---------------- | ------------- |---------------------------------------------------------- | +| `appliance` | | The appliance (The heater inside of this heating system). | +| `dhwCircuit` | | A hot water circuit. | +| `gateway` | | The gateway. (The connected KM200/100/50 device). | | `heatingCircuit` | | A heating circuit. | | `heatSource` | | The heat source. | | `holidayMode` | | The holiday modes configuration. | -| `sensor` | | The sensors. | +| `sensor` | | The sensors. | | `solarCircuit` | | A solar circuit. | -| `system` | | The system without sensors and appliance. | +| `system` | | The system without sensors and appliance. | | `notification` | | The notifications. | | `switchProgram` | X | A switch program. | diff --git a/bundles/org.openhab.binding.km200/pom.xml b/bundles/org.openhab.binding.km200/pom.xml index 410cf7ab576e4..be449fb5c333d 100644 --- a/bundles/org.openhab.binding.km200/pom.xml +++ b/bundles/org.openhab.binding.km200/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.km200</artifactId> diff --git a/bundles/org.openhab.binding.km200/src/main/feature/feature.xml b/bundles/org.openhab.binding.km200/src/main/feature/feature.xml index 7e53eff71c628..31c128009bdb6 100644 --- a/bundles/org.openhab.binding.km200/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.km200/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.km200-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-km200" description="KM200 Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200BindingConstants.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200BindingConstants.java index 75ec724baa28e..5fe4a90ab2201 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200BindingConstants.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200BindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ChannelTypeProvider.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ChannelTypeProvider.java index a1f31cc9f63cc..4f1d6e88d99e8 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ChannelTypeProvider.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ChannelTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Comm.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Comm.java index 8debaeb8cc3dd..20b192880f5fb 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Comm.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Comm.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Cryption.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Cryption.java index 9dfe5e178d82e..c29a552205809 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Cryption.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Cryption.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -93,7 +93,7 @@ public String decodeMessage(byte[] encoded) { byte[] decryptedDataWOZP = removeZeroPadding(decryptedData); return (new String(decryptedDataWOZP, remoteDevice.getCharSet())); } catch (UnsupportedEncodingException | GeneralSecurityException e) { - logger.debug("Exception on encoding: {}", e); + logger.debug("Exception on encoding", e); return null; } } @@ -117,7 +117,7 @@ public byte[] encodeMessage(String data) { logger.info("Base64encoding not possible: {}", e.getMessage()); } } catch (UnsupportedEncodingException | GeneralSecurityException e) { - logger.error("Exception on encoding: {}", e); + logger.error("Exception on encoding", e); } return null; } diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java index be557bff24bdf..f6d4848dc21fa 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200HandlerFactory.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200HandlerFactory.java index 9dad5e9d5ad86..4d8bb1aa04510 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200HandlerFactory.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200HandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ServiceObject.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ServiceObject.java index b5467ef1722a3..1c8d0653aab27 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ServiceObject.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ServiceObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ThingType.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ThingType.java index ef09d20ba0659..79ef8e881b6e9 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ThingType.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200ThingType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Utils.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Utils.java index 84161a6ad7718..abc725173c54c 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Utils.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/KM200Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryParticipant.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryParticipant.java index 19351e4411ebc..726d42b42d59e 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryService.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryService.java index 8e9451f38f4b4..45a54322d0c86 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryService.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/discovery/KM200GatewayDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200DataHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200DataHandler.java index 762f7df72c91a..1a4e400907df6 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200DataHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200DataHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ErrorServiceHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ErrorServiceHandler.java index 5bda61c77756f..43062460989f4 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ErrorServiceHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ErrorServiceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayHandler.java index 557cad0b2a4ed..9fd46e393e4fe 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -368,7 +368,7 @@ && getDevice().getServiceObject(service).getVirtual() == 1) { try { updateState(tmpChannel.getUID(), state); } catch (IllegalStateException e) { - logger.error("Could not get updated item state, Error: {}", e); + logger.error("Could not get updated item state", e); } } } @@ -422,7 +422,7 @@ private void updateChildren(Map<Channel, JsonObject> sendMap, KM200GatewayHandle try { gatewayHandler.updateState(actChannel.getUID(), state); } catch (IllegalStateException e) { - logger.error("Could not get updated item state, Error: {}", e); + logger.error("Could not get updated item state", e); } } } @@ -527,7 +527,7 @@ public void run() { try { gatewayHandler.updateState(channel.getUID(), state); } catch (IllegalStateException e) { - logger.error("Could not get updated item state, Error: {}", e); + logger.error("Could not get updated item state", e); } } } diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayStatusListener.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayStatusListener.java index 983afe3bf3b0c..637665acafa1e 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayStatusListener.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200GatewayStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ServiceHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ServiceHandler.java index 3ab6c8a895e99..e179a85bd161f 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ServiceHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ServiceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200SwitchProgramServiceHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200SwitchProgramServiceHandler.java index c78d8ac316682..4899eb5c875d8 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200SwitchProgramServiceHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200SwitchProgramServiceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java index a35bfcc558fc4..9614ae84a486d 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200ThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200VirtualServiceHandler.java b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200VirtualServiceHandler.java index 6686428c6f61d..7cac4934175f5 100644 --- a/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200VirtualServiceHandler.java +++ b/bundles/org.openhab.binding.km200/src/main/java/org/openhab/binding/km200/internal/handler/KM200VirtualServiceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/device.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/device.xml index 2f69078389423..c68a4d2b06278 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/device.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/device.xml @@ -30,7 +30,7 @@ <default>100</default> </parameter> <parameter name="maxNbrRepeats" type="integer" required="true"> - <label>Maximum Number Of Repeats</label> + <label>Maximum Number of Repeats</label> <description>Maximum number of repeats in case of a communication error (like HTTP 500 error)</description> <default>10</default> </parameter> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/dhwCircuit.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/dhwCircuit.xml index 837238a08a785..60dfb1941c3e8 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/dhwCircuit.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/dhwCircuit.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Hot water circuit</label> + <label>Hot Water Circuit</label> <description>This thing is representing a hot water circuit.</description> <properties> <property name="root">#dhwCircuits</property> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatSource.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatSource.xml index e63a50ebc3fa1..b6d706ca1d5cf 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatSource.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatSource.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Heat source</label> + <label>Heat Source</label> <description>This thing is representing the heat source.</description> <properties> <property name="root">#heatSources</property> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatingCircuit.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatingCircuit.xml index efa68688c70d2..0b7230b35de7c 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatingCircuit.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/heatingCircuit.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Heating circuit</label> + <label>Heating Circuit</label> <description>This thing is representing a heating circuit.</description> <properties> <property name="root">#heatingCircuits</property> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/holidayMode.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/holidayMode.xml index b1662f0dd6417..be7dfd404a6f9 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/holidayMode.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/holidayMode.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Holiday mode</label> + <label>Holiday Mode</label> <description>This thing is representing the holiday modes configuration.</description> <properties> <property name="root">#system#holidayModes</property> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/solarCircuit.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/solarCircuit.xml index 44f9803f40097..05df815cd2b0d 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/solarCircuit.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/solarCircuit.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Solar circuit</label> + <label>Solar Circuit</label> <description>This thing is representing a solar circuit.</description> <properties> <property name="root">#solarCircuits</property> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/switchProgram.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/switchProgram.xml index 8937b23fa9bce..9257318ddfcd5 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/switchProgram.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/switchProgram.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>Switch program</label> + <label>Switch Program</label> <description>This thing is representing a switch program.</description> <properties> <property name="root" /> diff --git a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/systemStates.xml b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/systemStates.xml index 6ac912b939ff4..f9a7965eca61a 100644 --- a/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/systemStates.xml +++ b/bundles/org.openhab.binding.km200/src/main/resources/ESH-INF/thing/systemStates.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="km200" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="systemStates" listed="false"> <supported-bridge-type-refs> <bridge-type-ref id="kmdevice" /> </supported-bridge-type-refs> - <label>System states</label> + <label>System States</label> <description>This thing is representing the systems states.</description> <properties> <property name="root">#systemStates</property> diff --git a/bundles/org.openhab.binding.knx/NOTICE b/bundles/org.openhab.binding.knx/NOTICE index c42f2e9cacc24..9da145223c82a 100644 --- a/bundles/org.openhab.binding.knx/NOTICE +++ b/bundles/org.openhab.binding.knx/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.knx/README.md b/bundles/org.openhab.binding.knx/README.md index fd2ec6128d57a..8b4cba730bde1 100644 --- a/bundles/org.openhab.binding.knx/README.md +++ b/bundles/org.openhab.binding.knx/README.md @@ -1,13 +1,19 @@ # KNX Binding -The openHAB KNX binding allows to connect to [KNX Home Automation](http://www.knx.org/) installations. Switching lights on and off, activating your roller shutters or changing room temperatures are only some examples. +The openHAB KNX binding allows to connect to [KNX Home Automation](https://www.knx.org/) installations. +Switching lights on and off, activating your roller shutters or changing room temperatures are only some examples. -To access your KNX bus you either need a gateway device which is connected to the KNX bus and allows computers to access the bus communication. This can be either an Ethernet (as a Router or a Tunnel type) or a serial gateway. The KNX binding then can communicate directly with this gateway. Alternatively a PC running [KNXD](https://github.com/knxd/knxd) (free open source component sofware) can be put in between which then acts as a broker allowing multiple client to connect to the same gateway. Since the protocol is identical, the KNX binding can also communicate with it transparently. +To access your KNX bus you either need a gateway device which is connected to the KNX bus and allows computers to access the bus communication. +This can be either an Ethernet (as a Router or a Tunnel type) or a serial gateway. +The KNX binding then can communicate directly with this gateway. +Alternatively a PC running [KNXD](https://github.com/knxd/knxd) (free open source component sofware) can be put in between which then acts as a broker allowing multiple client to connect to the same gateway. +Since the protocol is identical, the KNX binding can also communicate with it transparently. ## Supported Things -The KNX binding supports two types of bridges, and one type of things to access the KNX bus. There is an *ip* bridge to connect to KNX IP Gateways, and a *serial* bridge for connection over a serial port to a host-attached gateway. +The KNX binding supports two types of bridges, and one type of things to access the KNX bus. +There is an *ip* bridge to connect to KNX IP Gateways, and a *serial* bridge for connection over a serial port to a host-attached gateway. ## Binding Configuration @@ -24,7 +30,7 @@ The IP Gateway is the most commonly used way to connect to the KNX bus. At its b | Name | Required | Description | Default value | |---------------------|--------------|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------| | type | Yes | The IP connection type for connecting to the KNX bus (`TUNNEL` or `ROUTER`) | - | -| ipAddress | for `TUNNEL` | Network address of the KNX/IP gateway. If type `ROUTER` is set, the IPv4 Multicast Address can be set. | for `TUNNEL`: \<nothing\>, for `ROUTER`: 224.0.23.12 | +| ipAddress | for `TUNNEL` | Network address of the KNX/IP gateway. If type `ROUTER` is set, the IPv4 Multicast Address can be set. | for `TUNNEL`: \<nothing\>, for `ROUTER`: 224.0.23.12 | | portNumber | for `TUNNEL` | Port number of the KNX/IP gateway | 3671 | | localIp | No | Network address of the local host to be used to set up the connection to the KNX/IP gateway | the system-wide configured primary interface address | | localSourceAddr | No | The (virtual) individual address for identification of this KNX/IP gateway within the KNX bus <br/><br/>Note: Use a free adress, not the one of the interface. Or leave it at `0.0.0` and let openHAB decide which address to use. | 0.0.0 | @@ -51,7 +57,11 @@ The *serial* bridge accepts the following configuration parameters: ### *device* Things -*basic* Things are wrappers around an arbitrary group addresses on the KNX bus. They have no specific function in the KNX binding, except that if the *address* is defined the binding will actively poll the Individual Address on the KNX bus to detect that the KNX actuator is reachable. Under normal real world circumstances, either all devices on a bus are reachable, or the entire bus is down. When *fetch* is set to true, the binding will read-out the memory of the KNX actuator in order to detect configuration data and so forth. This is however an experimental feature very prone to the actual on the KNX bus. +*basic* Things are wrappers around an arbitrary group addresses on the KNX bus. +They have no specific function in the KNX binding, except that if the *address* is defined the binding will actively poll the Individual Address on the KNX bus to detect that the KNX actuator is reachable. +Under normal real world circumstances, either all devices on a bus are reachable, or the entire bus is down. +When *fetch* is set to true, the binding will read-out the memory of the KNX actuator in order to detect configuration data and so forth. +This is however an experimental feature very prone to the actual on the KNX bus. | Name | Required | Description | Default value | |--------------|----------|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| @@ -60,11 +70,14 @@ The *serial* bridge accepts the following configuration parameters: | pingInterval | N | Interval (in seconds) to contact the device and set the thing status based on the result (requires the address) | 600 | | readInterval | N | Interval (in seconds) to actively request reading of values from the bus (0 if they should only be read once at startup) | 0 | -Different kinds of channels are defined and can be used to group together Group Addresses. All channel types share two configuration parameters: *read*, an optional parameter to indicate if the 'readable' group addresses of that Channel should be read at startup (default: false), and *interval*, an optional parameter that defines an interval between attempts to read the status group address on the bus, in seconds. When defined and set to 0, the interval is ignored (default: 0) +Different kinds of channels are defined and can be used to group together Group Addresses. +All channel types share two configuration parameters: *read*, an optional parameter to indicate if the 'readable' group addresses of that Channel should be read at startup (default: false), and *interval*, an optional parameter that defines an interval between attempts to read the status group address on the bus, in seconds. +When defined and set to 0, the interval is ignored (default: 0) #### Standard Channel Types -Standard channels are used most of the time. They are used in the common case where the physical state is owned by a decive within the KNX bus, e.g. by a switch actuator who "knows" whether the light is turned on or of or by a temperature sensor which reports the room temperature regularly. +Standard channels are used most of the time. +They are used in the common case where the physical state is owned by a decive within the KNX bus, e.g. by a switch actuator who "knows" whether the light is turned on or of or by a temperature sensor which reports the room temperature regularly. Note: After changing the DPT of already existing Channels, openHAB needs to be restarted for the changes to become effective. @@ -118,7 +131,9 @@ Note: After changing the DPT of already existing Channels, openHAB needs to be r #### Control Channel Types -In contrast to the standard channels above, the control channel types are used for cases where the KNX bus does not own the physical state of a device. This could be the case if e.g. a lamp from another binding should be controlled by a KNX wall switch. If from the KNX bus a `GroupValueRead` telegram is sent to a *-control Channel, the bridge responds with a `GroupValueResponse` telegram to the KNX bus. +In contrast to the standard channels above, the control channel types are used for cases where the KNX bus does not own the physical state of a device. +This could be the case if e.g. a lamp from another binding should be controlled by a KNX wall switch. +If from the KNX bus a `GroupValueRead` telegram is sent to a *-control Channel, the bridge responds with a `GroupValueResponse` telegram to the KNX bus. ##### Channel Type "switch-control" @@ -185,9 +200,14 @@ The `dpt` element is optional. If ommitted, the corresponding default value will ## Examples -The following two templates are sufficient for almost all purposes. Only add parameters to the Bridge and Thing configuration if you know exactly what functionality it is needed for. + +The following two templates are sufficient for almost all purposes. +Only add parameters to the Bridge and Thing configuration if you know exactly what functionality it is needed for. + ### Type ROUTER mode configuration Template + knx.things: + ```xtend Bridge knx:ip:bridge [ type="ROUTER", @@ -200,8 +220,11 @@ Bridge knx:ip:bridge [ } } ``` + ### Type TUNNEL mode configuration Template + knx.things: + ```xtend Bridge knx:ip:bridge [ type="TUNNEL", @@ -215,7 +238,9 @@ Bridge knx:ip:bridge [ } } ``` + ### Full Example + ```xtend //TUNNEL Bridge knx:ip:bridge [ @@ -290,7 +315,6 @@ sitemap knx label="KNX Demo Sitemap" { ### Control Example - control.things: ```xtend diff --git a/bundles/org.openhab.binding.knx/pom.xml b/bundles/org.openhab.binding.knx/pom.xml index 1c122758d11b9..3263065fe103d 100644 --- a/bundles/org.openhab.binding.knx/pom.xml +++ b/bundles/org.openhab.binding.knx/pom.xml @@ -1,24 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.knx</artifactId> <name>openHAB Add-ons :: Bundles :: KNX Binding</name> + <properties> + <bnd.importpackage>javax.microedition.io.*;resolution:="optional",javax.usb.*;resolution:="optional",org.usb4java.*;resolution:="optional"</bnd.importpackage> + </properties> + <dependencies> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.github.calimero.calimero-core</artifactId> + <groupId>com.github.calimero</groupId> + <artifactId>calimero-core</artifactId> <version>2.4</version> - <scope>provided</scope> + <scope>compile</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> @@ -27,10 +30,10 @@ </exclusions> </dependency> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.github.calimero.calimero-device</artifactId> + <groupId>com.github.calimero</groupId> + <artifactId>calimero-device</artifactId> <version>2.4</version> - <scope>provided</scope> + <scope>compile</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> @@ -39,10 +42,10 @@ </exclusions> </dependency> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.github.calimero.calimero-rxtx</artifactId> + <groupId>com.github.calimero</groupId> + <artifactId>calimero-rxtx</artifactId> <version>2.4</version> - <scope>provided</scope> + <scope>compile</scope> <exclusions> <exclusion> <groupId>org.slf4j</groupId> diff --git a/bundles/org.openhab.binding.knx/src/main/feature/feature.xml b/bundles/org.openhab.binding.knx/src/main/feature/feature.xml index a38f9be53b9e0..e004818d86b39 100644 --- a/bundles/org.openhab.binding.knx/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.knx/src/main/feature/feature.xml @@ -1,13 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.knx-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-knx" description="KNX Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-serial</feature> - <bundle dependency="true">mvn:org.openhab.osgiify/com.github.calimero.calimero-core/2.4</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/com.github.calimero.calimero-device/2.4</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/com.github.calimero.calimero-rxtx/2.4</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.knx/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXBindingConstants.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXBindingConstants.java index 8670a5aab92eb..8ade2ed862250 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXBindingConstants.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXTypeMapper.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXTypeMapper.java index f3daea59ad27d..378cb3e7b4a62 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXTypeMapper.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/KNXTypeMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/AbstractSpec.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/AbstractSpec.java index e361404f10ad6..318b887908aa8 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/AbstractSpec.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/AbstractSpec.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ChannelConfiguration.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ChannelConfiguration.java index fc040c0eac3f9..8c8a6d48b6c70 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ChannelConfiguration.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/GroupAddressConfiguration.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/GroupAddressConfiguration.java index 6bcdfd7235128..61e59356bd04b 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/GroupAddressConfiguration.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/GroupAddressConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelType.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelType.java index 81e40b2b82e6b..169258249476f 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelType.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelTypes.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelTypes.java index ec0117ab1373d..c74db5674bb1c 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelTypes.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/KNXChannelTypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ListenSpecImpl.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ListenSpecImpl.java index 9790e003d5d6a..d5743438171b9 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ListenSpecImpl.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ListenSpecImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadRequestSpecImpl.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadRequestSpecImpl.java index a3d14cbffa72c..12ff69ad25b3e 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadRequestSpecImpl.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadRequestSpecImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadResponseSpecImpl.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadResponseSpecImpl.java index 3f7fbb0111a77..70c599ebeef26 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadResponseSpecImpl.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/ReadResponseSpecImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeColor.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeColor.java index e2e0e1e311d71..5c367796972a5 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeColor.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeColor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeContact.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeContact.java index dcfaa2c8aab1b..b36926522a605 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeContact.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeContact.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDateTime.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDateTime.java index 23330897ce162..0dcb7ea605711 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDateTime.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDateTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDimmer.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDimmer.java index 6b6c5be8f483c..0e4392b6fe079 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDimmer.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeDimmer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeNumber.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeNumber.java index b88ca4215a20d..1ee1eae73c070 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeNumber.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeNumber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeRollershutter.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeRollershutter.java index 387d95485e161..fcb26012ff0ff 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeRollershutter.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeRollershutter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeString.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeString.java index b47df5adf1e7d..ad7267a753b8f 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeString.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeString.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeSwitch.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeSwitch.java index 88832e6e4d707..1e97dee1cb813 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeSwitch.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/TypeSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/WriteSpecImpl.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/WriteSpecImpl.java index 6f7191ae75e5f..07b3fd97f1373 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/WriteSpecImpl.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/channel/WriteSpecImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java index 2d5828ad88a1c..435cbfd15f810 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/BusMessageListener.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/BusMessageListener.java index 04730e9cd75cc..d9543ff09508f 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/BusMessageListener.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/BusMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/CustomKNXNetworkLinkIP.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/CustomKNXNetworkLinkIP.java index 6a9b2f99f4fbb..87a4debc28cc3 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/CustomKNXNetworkLinkIP.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/CustomKNXNetworkLinkIP.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClient.java index 15030843e2c66..976df0823382e 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClientImpl.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClientImpl.java index 7e9d117d492ee..e0cf6b499ae23 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClientImpl.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInfoClientImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInspector.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInspector.java index 726c28606d7cd..8a80ed03e20bb 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInspector.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/DeviceInspector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/IPClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/IPClient.java index d6b8885620afa..26c9b22aab979 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/IPClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/IPClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/InboundSpec.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/InboundSpec.java index 048be8f19e670..4de85a22626f1 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/InboundSpec.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/InboundSpec.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/KNXClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/KNXClient.java index ac9896dfe3967..845509a95b114 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/KNXClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/KNXClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/NoOpClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/NoOpClient.java index 670416128d105..26794830bfd11 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/NoOpClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/NoOpClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/OutboundSpec.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/OutboundSpec.java index 127be391ea166..57876eb902a0c 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/OutboundSpec.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/OutboundSpec.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/ReadDatapoint.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/ReadDatapoint.java index cefe149fdf1cb..9334132fc4b1e 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/ReadDatapoint.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/ReadDatapoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/SerialClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/SerialClient.java index 7757305b7255a..924b458b4686c 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/SerialClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/SerialClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/StatusUpdateCallback.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/StatusUpdateCallback.java index c183451abd72b..df8c4046c4843 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/StatusUpdateCallback.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/StatusUpdateCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/BridgeConfiguration.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/BridgeConfiguration.java index 164fd6abbe5c9..36166cae57980 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/BridgeConfiguration.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/BridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/DeviceConfig.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/DeviceConfig.java index edf91424ab668..d7a0003ec131f 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/DeviceConfig.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/DeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/IPBridgeConfiguration.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/IPBridgeConfiguration.java index a31106793b13e..ed36e5faf1ad9 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/IPBridgeConfiguration.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/IPBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/SerialBridgeConfiguration.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/SerialBridgeConfiguration.java index 0536aa480fe4e..0ce69d146b1d7 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/SerialBridgeConfiguration.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/config/SerialBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java index f07b6065d2021..c8893eca1f08d 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/factory/KNXHandlerFactory.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/factory/KNXHandlerFactory.java index a9d61858d0147..8ed3b027470e4 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/factory/KNXHandlerFactory.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/factory/KNXHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/AbstractKNXThingHandler.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/AbstractKNXThingHandler.java index 73440fcd961d2..2221842f715c4 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/AbstractKNXThingHandler.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/AbstractKNXThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceConstants.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceConstants.java index fb74d07b0a4e7..f9873503fbe95 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceConstants.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceThingHandler.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceThingHandler.java index 94ac30ef21668..ba6b0abea116a 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceThingHandler.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/DeviceThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Firmware.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Firmware.java index 1b5e461cd7e96..705a2d333da8b 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Firmware.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Firmware.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/GroupAddressListener.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/GroupAddressListener.java index d706f43d90d70..590165206cf42 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/GroupAddressListener.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/GroupAddressListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/IPBridgeThingHandler.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/IPBridgeThingHandler.java index 8a1a0cad56c44..04514512b9a42 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/IPBridgeThingHandler.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/IPBridgeThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/KNXBridgeBaseThingHandler.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/KNXBridgeBaseThingHandler.java index d725c312ecbf8..42c0d681f3950 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/KNXBridgeBaseThingHandler.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/KNXBridgeBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Manufacturer.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Manufacturer.java index 5a219219621a2..00c83716e6593 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Manufacturer.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/Manufacturer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/SerialBridgeThingHandler.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/SerialBridgeThingHandler.java index a8a8156e90949..19292521319ea 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/SerialBridgeThingHandler.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/handler/SerialBridgeThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/profiles/KNXProfileAdvisor.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/profiles/KNXProfileAdvisor.java index 4bb91b546a7b5..4cc49ea40bb1a 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/profiles/KNXProfileAdvisor.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/profiles/KNXProfileAdvisor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/main/resources/ESH-INF/config/channelConfig.xml b/bundles/org.openhab.binding.knx/src/main/resources/ESH-INF/config/channelConfig.xml index 0b1d94163da33..94f4a2aaffaa2 100644 --- a/bundles/org.openhab.binding.knx/src/main/resources/ESH-INF/config/channelConfig.xml +++ b/bundles/org.openhab.binding.knx/src/main/resources/ESH-INF/config/channelConfig.xml @@ -48,7 +48,7 @@ <!-- Color --> <config-description uri="channel-type:knx:color"> <parameter name="hsb" type="text"> - <label>Color value</label> + <label>Color Value</label> <description>The group address(es) in Group Address Notation for the color value</description> <required>false</required> </parameter> @@ -70,7 +70,7 @@ </config-description> <config-description uri="channel-type:knx:color-control"> <parameter name="hsb" type="text"> - <label>Color value</label> + <label>Color Value</label> <description>The group address(es) in Group Address Notation for the color value</description> <required>false</required> </parameter> diff --git a/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/channel/KNXChannelTypeTest.java b/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/channel/KNXChannelTypeTest.java index 0a1307cde850e..3de771c22bb9b 100644 --- a/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/channel/KNXChannelTypeTest.java +++ b/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/channel/KNXChannelTypeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapperTest.java b/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapperTest.java index 289086ac47aa8..c69fff45f0b5a 100644 --- a/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapperTest.java +++ b/bundles/org.openhab.binding.knx/src/test/java/org/openhab/binding/knx/internal/dpt/KNXCoreTypeMapperTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/NOTICE b/bundles/org.openhab.binding.kodi/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.kodi/NOTICE +++ b/bundles/org.openhab.binding.kodi/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.kodi/README.md b/bundles/org.openhab.binding.kodi/README.md index e9eaaf2894d0b..5cf912208ef5f 100644 --- a/bundles/org.openhab.binding.kodi/README.md +++ b/bundles/org.openhab.binding.kodi/README.md @@ -4,13 +4,13 @@ Kodi runs on Linux, OS X, BSD, Windows, iOS, and Android. It allows users to play and view most videos, music, podcasts, and other digital media files from local and network storage media and the internet. -The Kodi Binding integrated Kodi media center support with openHAB, allowing both controlling the player as well as retrieving player status data like the currently played movie title. +The Kodi Binding integrates Kodi media center support with openHAB, allowing both controlling the player as well as retrieving player status data like the currently played movie title. The Kodi binding is the successor to the openHAB 1.x xbmc binding. ## Preparation -In order to allow control of Kodi by this binding, you need to enable the Kodi application remote control feature. +In order to allow Kodi to be controlled through this binding, you need to enable the Kodi application remote control feature. Please enable "Allow remote control from applications on this/other systems" in the Kodi settings menu under: * Settings âž” Services âž” Control âž” @@ -26,7 +26,7 @@ To make use of the auto-discovery feature, you additionally need to enable "Allo This binding provides only one thing type: The Kodi media center. Create one Kodi thing per Kodi instance available in your home automation system. -All Kodi devices are registered as an audio sink in the ESH/openHAB2 framework. +All Kodi devices are registered as an audio sink in openHAB. ## Discovery @@ -87,12 +87,12 @@ The Kodi thing supports the following channels: | mediatype | String | The media type of the current file. Valid return values are: `unknown`, `channel`, `episode`, `movie`, `musicvideo`, `picture`, `radio`, `song`, `video` | | mediaid | Number | The media_id in database of Kodi | | mediafile | String | Full path and file name of the current file | -| uniqueid-imdb | String | IMDB link ID of currently playing media **Advanced** | -| uniqueid-tmdb | String | TheMovieDB link ID of currently playing media **Advanced** | -| uniqueid-douban | String | Douban link ID of currently playing media **Advanced** | -| uniqueid-imdbtvshow | String | IMDB link ID of the season of currently playing tv episode **Advanced** | -| uniqueid-tmdbtvshow | String | IMDB link ID of the season of currently playing tv episode **Advanced** | -| uniqueid-tmdbepisode | String | IMDB link ID of single episode of currently playing tv episode **Advanced** | +| uniqueid-imdb | String | IMDB link ID of currently playing media **(Advanced)** | +| uniqueid-tmdb | String | TheMovieDB link ID of currently playing media **(Advanced)** | +| uniqueid-douban | String | Douban link ID of currently playing media **(Advanced)** | +| uniqueid-imdbtvshow | String | IMDB link ID of the season of currently playing tv episode **(Advanced)** | +| uniqueid-tmdbtvshow | String | IMDB link ID of the season of currently playing tv episode **(Advanced)** | +| uniqueid-tmdbepisode | String | IMDB link ID of single episode of currently playing tv episode **(Advanced)** | | season | Number | Season number if currently playing tv episode | | episode | Number | Episode number if currently playing tv episode | | genreList | String | A comma-separated list of genres of the current file | @@ -104,21 +104,21 @@ The Kodi thing supports the following channels: | subtitle-language | String | Display subtitle language of currently playing media | | subtitle-name | String | Display subtitle title of currently playing media | | audio-index | Number | Audio stream index of currently playing media | -| audio-codec | String | Audio codec of currently playing media **Advanced** | -| audio-language | String | Display language of currently playing audio stream **Advanced** | -| audio-name | String | Display title of currently playing audio stream **Advanced** | -| audio-channels | Number | Display channels of currently playing audio stream **Advanced** | -| video-codec | String | Video codec of currently playing media **Advanced** | -| video-index | Number | Index of currently playing multi stream video **Advanced** | -| video-height | Number | Height of currently playing video **Advanced** | -| video-weight | Number | Width of currently playing video **Advanced** | +| audio-codec | String | Audio codec of currently playing media **(Advanced)** | +| audio-language | String | Display language of currently playing audio stream **(Advanced)** | +| audio-name | String | Display title of currently playing audio stream **(Advanced)** | +| audio-channels | Number | Display channels of currently playing audio stream **(Advanced)** | +| video-codec | String | Video codec of currently playing media **(Advanced)** | +| video-index | Number | Index of currently playing multi stream video **(Advanced)** | +| video-height | Number | Height of currently playing video **(Advanced)** | +| video-weight | Number | Width of currently playing video **(Advanced)** | | currenttime | Number:Time | Current time of currently playing media | | currenttimepercentage | Number:Dimensionless | Current time of currently playing media | | duration | Number:Time | Length of currently playing media | -| rating | Number | rating of currently playing media **Advanced** | -| mpaa | String | MPAA rating of currently playing media **Advanced** | -| userrating | Number | personal rating of currently playing media **Advanced** | -| profile | String | Current profile **Advanced** | +| rating | Number | rating of currently playing media **(Advanced)** | +| mpaa | String | MPAA rating of currently playing media **(Advanced)** | +| userrating | Number | personal rating of currently playing media **(Advanced)** | +| profile | String | Current profile **(Advanced)** | Kodi things are extensible by channels of type `shownotification`, so that different notification pop-ups can be configured for different use cases. @@ -133,13 +133,13 @@ You have to adjust this configuration to use the `pvr-open-tv` and `pvr-open-rad You can optionally configure an user-defined PVR channel group. The PVR channels from Kodi will be populated during runtime into the state options of the `pvr-open-tv` and `pvr-open-radio` channels. -**shownotification** The `shownotification` channel type has three configuration parameters through which it can be customised: +**shownotification** The `shownotification` channel type has three configuration parameters through which it can be customized: -| Parameter | Type | Default | Description | -|-----------------|-----------------|----------|------------------------------------------------------------| -| title | Text | openHAB | Title of the notification | -| displayTime | Integer | 5000 | Time in ms the notification is shown | -| icon | Text | | Icon to use (e.g. "alarm"), which must be available as png | +| Parameter | Type | Default | Description | +|-------------|---------|---------|------------------------------------------------------------------------| +| title | Text | openHAB | Title of the notification | +| displayTime | Integer | 5000 | Time the notification is shown (in ms) | +| icon | Text | | Icon to use (e.g. "alarm"). One of the openHAB icons (as listed [here](https://www.openhab.org/docs/configuration/iconsets/classic/)). | ## Audio Support @@ -159,6 +159,14 @@ Thing kodi:kodi:myKodi "Kodi" @ "Living Room" [ipAddress="192.168.1.100", port=9 Type pvr-open-tv : pvr-open-tv [ group="All channels" ] + Type shownotification : error-notification [ + title="openHAB - Error", + icon="error" + ] + Type shownotification : weather-notification [ + title="openHAB - Weather", + icon="sun_clouds" + ] } ``` @@ -181,6 +189,8 @@ String myKodi_pvropentv "Play PVR TV channel" { channel="kodi: String myKodi_pvropenradio "Play PVR Radio channel" { channel="kodi:kodi:myKodi:pvr-open-radio" } String myKodi_pvrchannel "PVR channel [%s]" { channel="kodi:kodi:myKodi:pvr-channel" } String myKodi_notification "Notification" { channel="kodi:kodi:myKodi:shownotification" } +String myKodi_error-notification "Error Notification" { channel="kodi:kodi:myKodi:error-notification" } +String myKodi_weather-notification "Weather Notification" { channel="kodi:kodi:myKodi:weather-notification" } String myKodi_input "Input" { channel="kodi:kodi:myKodi:input" } String myKodi_inputtext "Inputtext" { channel="kodi:kodi:myKodi:inputtext" } String myKodi_systemcommand "Systemcommand" { channel="kodi:kodi:myKodi:systemcommand" } diff --git a/bundles/org.openhab.binding.kodi/pom.xml b/bundles/org.openhab.binding.kodi/pom.xml index 3d5bcfee4c317..6cdf522dea423 100644 --- a/bundles/org.openhab.binding.kodi/pom.xml +++ b/bundles/org.openhab.binding.kodi/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.kodi</artifactId> diff --git a/bundles/org.openhab.binding.kodi/src/main/feature/feature.xml b/bundles/org.openhab.binding.kodi/src/main/feature/feature.xml index c7c592477ff17..a483c6b1c465c 100644 --- a/bundles/org.openhab.binding.kodi/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.kodi/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.kodi-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-kodi" description="Kodi Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiAudioSink.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiAudioSink.java index b994f23fd24c9..ab8bea095028f 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiAudioSink.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiBindingConstants.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiBindingConstants.java index b70b02bd99a94..f546aeefaa04a 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiBindingConstants.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiDynamicStateDescriptionProvider.java index c1aa97e4f859f..b2457864d23aa 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiEventListener.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiEventListener.java index a2f904797fff5..deaa0dd1887d9 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiEventListener.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiHandlerFactory.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiHandlerFactory.java index 3263227560108..b52ce0ccfa6fe 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiHandlerFactory.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiPlayerState.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiPlayerState.java index 87c4630321c39..31b9d2390c0f2 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiPlayerState.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/KodiPlayerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiChannelConfig.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiChannelConfig.java index f2b023cbfa2aa..f31faea5ed503 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiChannelConfig.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiConfig.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiConfig.java index e291a5e49dd49..0200f0f425abf 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiConfig.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/config/KodiConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/discovery/KodiUpnpDiscoveryParticipant.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/discovery/KodiUpnpDiscoveryParticipant.java index d3ba84d557142..3a3a55d45bd3a 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/discovery/KodiUpnpDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/discovery/KodiUpnpDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java index e7c23e8b44753..2f9d63f4bbc55 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -89,6 +89,8 @@ public class KodiHandler extends BaseThingHandler implements KodiEventListener { private final KodiConnection connection; private final KodiDynamicStateDescriptionProvider stateDescriptionProvider; + private final ChannelUID profileChannelUID; + private ScheduledFuture<?> connectionCheckerFuture; private ScheduledFuture<?> statusUpdaterFuture; @@ -98,6 +100,8 @@ public KodiHandler(Thing thing, KodiDynamicStateDescriptionProvider stateDescrip connection = new KodiConnection(this, webSocketClient, callbackUrl); this.stateDescriptionProvider = stateDescriptionProvider; + + profileChannelUID = new ChannelUID(getThing().getUID(), CHANNEL_PROFILE); } @Override @@ -297,7 +301,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { break; case CHANNEL_CURRENTTIME: if (command instanceof QuantityType) { - connection.setTime(((QuantityType) command).intValue()); + connection.setTime(((QuantityType<?>) command).intValue()); } break; case CHANNEL_CURRENTTIMEPERCENTAGE: @@ -615,7 +619,7 @@ public void initialize() { updateFavoriteChannelStateDescription(); updatePVRChannelStateDescription(PVR_TV, CHANNEL_PVR_OPEN_TV); updatePVRChannelStateDescription(PVR_RADIO, CHANNEL_PVR_OPEN_RADIO); - updateProfileStateDescription(CHANNEL_PROFILE); + updateProfileStateDescription(); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "No connection established"); @@ -656,13 +660,13 @@ private void updatePVRChannelStateDescription(final String pvrChannelType, final } } - private void updateProfileStateDescription(final String channelId) { - if (isLinked(channelId)) { + private void updateProfileStateDescription() { + if (isLinked(profileChannelUID)) { List<StateOption> options = new ArrayList<>(); for (KodiProfile profile : connection.getProfiles()) { options.add(new StateOption(profile.getLabel(), profile.getLabel())); } - stateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), channelId), options); + stateDescriptionProvider.setStateOptions(profileChannelUID, options); } } @@ -699,7 +703,9 @@ public void updateConnectionState(boolean connected) { updateStatus(ThingStatus.ONLINE); scheduler.schedule(() -> connection.getSystemProperties(), 1, TimeUnit.SECONDS); scheduler.schedule(() -> connection.updateVolume(), 1, TimeUnit.SECONDS); - scheduler.schedule(() -> connection.updateCurrentProfile(), 1, TimeUnit.SECONDS); + if (isLinked(profileChannelUID)) { + scheduler.schedule(() -> connection.updateCurrentProfile(), 1, TimeUnit.SECONDS); + } try { String version = connection.getVersion(); thing.setProperty(PROPERTY_VERSION, version); @@ -807,7 +813,7 @@ public void updateRating(double rating) { @Override public void updateUserRating(double rating) { - updateState(CHANNEL_RATING, new DecimalType(rating)); + updateState(CHANNEL_USERRATING, new DecimalType(rating)); } @Override @@ -961,7 +967,7 @@ public void updateDuration(long duration) { @Override public void updateCurrentProfile(String profile) { - updateState(CHANNEL_PROFILE, new StringType(profile)); + updateState(profileChannelUID, new StringType(profile)); } @Override diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiAudioStream.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiAudioStream.java index 3fc95f8f1e3be..3f6ec24086f74 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiAudioStream.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiBaseItem.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiBaseItem.java index 03ccd06afcce3..96a5c1f214b47 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiBaseItem.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiBaseItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiDuration.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiDuration.java index 798ca883bf3b7..e61005f2ca973 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiDuration.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiDuration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiFavorite.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiFavorite.java index c7a4d7f210105..0c23e1f21ee47 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiFavorite.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiFavorite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannel.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannel.java index 926ecc51739eb..8605e81ae7df4 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannel.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannelGroup.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannelGroup.java index 4a1b81feb2b20..8da55bb378612 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannelGroup.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiPVRChannelGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiProfile.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiProfile.java index 8e1f4b7084c47..42b5e15e96bb0 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiProfile.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSubtitle.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSubtitle.java index 5f3a95e63d9b8..9b5a6e78e8475 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSubtitle.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSubtitle.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSystemProperties.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSystemProperties.java index bff7496d71f24..1c2a7a59e0422 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSystemProperties.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiSystemProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiUniqueID.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiUniqueID.java index 534736b3b9c2a..7f16cf2d392b5 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiUniqueID.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiUniqueID.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiVideoStream.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiVideoStream.java index ed97477f2f631..c6f81494411d0 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiVideoStream.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/model/KodiVideoStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocket.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocket.java index 86c2d94ca1791..e1c071151a3b9 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocket.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocketEventListener.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocketEventListener.java index bb1ea6550e77c..bb6e8661ab8ad 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocketEventListener.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiClientSocketEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiConnection.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiConnection.java index 9255f772dee28..e8e6216c66efd 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiConnection.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/protocol/KodiConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,8 +80,6 @@ public class KodiConnection implements KodiClientSocketEventListener { private static final String PROPERTY_CURRENTAUDIOSTREAM = "currentaudiostream"; private static final String PROPERTY_SUBTITLES = "subtitles"; private static final String PROPERTY_AUDIOSTREAMS = "audiostreams"; - private static final String PROPERTY_VIDEOSTREAMS = "videostreams"; - private static final String PROPERTY_STREAMDETAILS = "streamdetails"; private static final String PROPERTY_CANHIBERNATE = "canhibernate"; private static final String PROPERTY_CANREBOOT = "canreboot"; private static final String PROPERTY_CANSHUTDOWN = "canshutdown"; @@ -1115,7 +1113,10 @@ public void updateCurrentProfile() { JsonElement response = socket.callMethod("Profiles.GetCurrentProfile"); try { - listener.updateCurrentProfile(gson.fromJson(response, KodiProfile.class).getLabel()); + final KodiProfile profile = gson.fromJson(response, KodiProfile.class); + if (profile != null) { + listener.updateCurrentProfile(profile.getLabel()); + } } catch (JsonSyntaxException e) { logger.debug("Json syntax exception occurred: {}", e.getMessage(), e); } diff --git a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCache.java b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCache.java index 8927251e14122..fa8cbddcbb3ae 100644 --- a/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCache.java +++ b/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -277,7 +277,7 @@ File getUniqueFile(String key) { String getFileExtension(String fileName) { int extensionPos = fileName.lastIndexOf(EXTENSION_SEPARATOR); int lastSeparatorPos = Math.max(fileName.lastIndexOf(UNIX_SEPARATOR), fileName.lastIndexOf(WINDOWS_SEPARATOR)); - return lastSeparatorPos > extensionPos ? null : fileName.substring(extensionPos + 1); + return lastSeparatorPos > extensionPos ? null : fileName.substring(extensionPos + 1).replaceFirst("\\?.*$", ""); } /** @@ -293,7 +293,7 @@ String getUniqueFileName(String key) { byte[] md5Hash = md.digest(bytesOfKey); BigInteger bigInt = new BigInteger(1, md5Hash); String fileNameHash = bigInt.toString(16); - // Now we need to zero pad it if you actually want the full 32 chars + // We need to zero pad it if you actually want the full 32 chars while (fileNameHash.length() < 32) { fileNameHash = "0" + fileNameHash; } diff --git a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/config/config.xml index 4001816b2dc13..d77aa238aa714 100644 --- a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/config/config.xml @@ -22,13 +22,13 @@ <description>The IP or host name of the Kodi</description> <context>network-address</context> </parameter> - <parameter name="port" type="integer" required="true" min="1" max="65335" groupName="network"> - <label>Web socket service port</label> + <parameter name="port" type="integer" required="true" min="1" max="65535" groupName="network"> + <label>Web Socket Service Port</label> <description>Port for the web socket service</description> <default>9090</default> </parameter> - <parameter name="httpPort" type="integer" required="true" min="1" max="65335" groupName="network"> - <label>HTTP service port</label> + <parameter name="httpPort" type="integer" required="true" min="1" max="65535" groupName="network"> + <label>HTTP Service Port</label> <description>Port for the HTTP service.</description> <default>8080</default> <advanced>true</advanced> @@ -65,9 +65,26 @@ <config-description uri="channel-type:kodi:pvr-channel"> <parameter name="group" type="text" required="true"> - <label>PVR channel group</label> + <label>PVR Channel Group</label> <description>The PVR channel group name used to identify the channel id.</description> <default>All channels</default> </parameter> </config-description> + + <config-description uri="channel-type:kodi:shownotification"> + <parameter name="title" type="text" required="false"> + <label>Notification Title</label> + <description>Title to show for the notification.</description> + <default>openHAB</default> + </parameter> + <parameter name="displayTime" type="integer" required="false" min="100" unit="ms"> + <label>Display Time</label> + <description>Time the notification is displayed.</description> + <default>5000</default> + </parameter> + <parameter name="icon" type="text" required="false"> + <label>Icon</label> + <description>Icon name to show with the notification.</description> + </parameter> + </config-description> </config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/i18n/kodi_de.properties b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/i18n/kodi_de.properties index 89c6c96c3fa28..9820d4bd8b189 100644 --- a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/i18n/kodi_de.properties +++ b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/i18n/kodi_de.properties @@ -105,3 +105,10 @@ channel-type.kodi.duration.description = Zeigt die Dauer des aktuellen St # channel types config channel-type.config.kodi.pvr-channel.group.label = PVR Kanal Gruppe channel-type.config.kodi.pvr-channel.group.description = Gruppe der verwendbaren PVR Kanäle. + +channel-type.config.kodi.shownotification.title.label = Titel +channel-type.config.kodi.shownotification.title.description = Titel der Nachricht. +channel-type.config.kodi.shownotification.displayTime.label = Anzeigezeit +channel-type.config.kodi.shownotification.displayTime.description = Anzeigezeit der Nachricht. +channel-type.config.kodi.shownotification.icon.label = Icon +channel-type.config.kodi.shownotification.icon.description = Icon der Nachricht. diff --git a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/thing/thing-types.xml index b368244ecd616..7266484f0afa4 100644 --- a/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.kodi/src/main/resources/ESH-INF/thing/thing-types.xml @@ -34,7 +34,7 @@ <channel id="fanart" typeId="fanart" /> <channel id="playfavorite" typeId="playfavorite" /> <channel id="playnotification" typeId="playnotification" /> - <channel id="profile" typeId="profile" /> + <channel id="profile" typeId="profile" /> <channel id="audio-name" typeId="name"> <label>Audio Name</label> </channel> @@ -45,7 +45,7 @@ <label>Audio Index</label> </channel> <channel id="audio-language" typeId="language"> - <label>Audio language</label> + <label>Audio Language</label> </channel> <channel id="audio-codec" typeId="codec"> <label>Audio Codec</label> @@ -133,19 +133,19 @@ </channel-type> <channel-type id="playfavorite"> <item-type>String</item-type> - <label>Play or open a Favorite</label> + <label>Play or Open a Favorite</label> <description>Play or open the given favorite by sending a command with the favorite's title</description> </channel-type> <channel-type id="pvr-open-tv" advanced="true"> <item-type>String</item-type> - <label>Play PVR tv</label> + <label>Play PVR TV</label> <description>Play the given PVR TV channel by sending a command with the channel's name</description> <state pattern="%s" /> <config-description-ref uri="channel-type:kodi:pvr-channel" /> </channel-type> <channel-type id="pvr-open-radio" advanced="true"> <item-type>String</item-type> - <label>Play PVR radio</label> + <label>Play PVR Radio</label> <description>Play the given PVR Radio channel by sending a command with the channel's name</description> <state pattern="%s" /> <config-description-ref uri="channel-type:kodi:pvr-channel" /> @@ -154,23 +154,7 @@ <item-type>String</item-type> <label>Show Notification</label> <description>Shows a notification on the UI</description> - <config-description> - <parameter name="title" type="text" required="false"> - <label>Notification Title</label> - <description>Title to show for the notification</description> - <default>openHAB</default> - </parameter> - <parameter name="displayTime" type="integer" required="false" min="100"> - <label>Display Time</label> - <description>Time the notification is displayed in milliseconds.</description> - <default>5000</default> - <unitLabel>ms</unitLabel> - </parameter> - <parameter name="icon" type="text" required="false"> - <label>Icon</label> - <description>Icon name to show with the notification</description> - </parameter> - </config-description> + <config-description-ref uri="channel-type:kodi:shownotification" /> </channel-type> <channel-type id="playnotification" advanced="true"> <item-type>String</item-type> @@ -179,7 +163,7 @@ </channel-type> <channel-type id="input" advanced="true"> <item-type>String</item-type> - <label>Send a key</label> + <label>Send a Key</label> <description>Sends a key stroke to Kodi to navigate in the UI</description> <state> <options> @@ -200,12 +184,12 @@ </channel-type> <channel-type id="inputtext" advanced="true"> <item-type>String</item-type> - <label>Sends text as input</label> + <label>Sends Text as Input</label> <description>Sends a generic input (unicode) text to Kodi</description> </channel-type> <channel-type id="inputaction" advanced="true"> <item-type>String</item-type> - <label>Execute an action</label> + <label>Execute an Action</label> <description>Sends a predefined action to Kodi to control the UI and/or perform other tasks</description> <state> <options> @@ -413,7 +397,7 @@ </channel-type> <channel-type id="systemcommand" advanced="true"> <item-type>String</item-type> - <label>Send system command</label> + <label>Send System Command</label> <description>Sends a system command to Kodi. This allows to shutdown/suspend/hibernate/reboot/quit Kodi</description> <state> <options> @@ -429,7 +413,7 @@ <!-- Kodi variables --> <channel-type id="pvr-channel" advanced="true"> <item-type>String</item-type> - <label>PVR channel title</label> + <label>PVR Channel Title</label> <description>Title of the current PVR channel</description> <state readOnly="true" pattern="%s"></state> </channel-type> @@ -483,7 +467,7 @@ </channel-type> <channel-type id="currenttimepercentage" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Current Time in percent</label> + <label>Current Time in Percent</label> <description>Current time of currently playing media</description> <state readOnly="true" min="0" max="100" pattern="%d %unit%" /> </channel-type> @@ -556,7 +540,7 @@ <item-type>Number</item-type> <label>Rating</label> <description>Rating</description> - <state readOnly="true" pattern="%d" /> + <state readOnly="true" pattern="%.1f" /> </channel-type> <channel-type id="mpaa" advanced="true"> <item-type>String</item-type> diff --git a/bundles/org.openhab.binding.kodi/src/test/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCacheTest.java b/bundles/org.openhab.binding.kodi/src/test/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCacheTest.java index 6c83de13e6ba2..cddb1e5c0d4b2 100644 --- a/bundles/org.openhab.binding.kodi/src/test/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCacheTest.java +++ b/bundles/org.openhab.binding.kodi/src/test/java/org/openhab/binding/kodi/internal/utils/ByteArrayFileCacheTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -76,10 +76,12 @@ public void testGetFileExtension() { assertThat(subject.getFileExtension(".hidden"), is(equalTo("hidden"))); assertThat(subject.getFileExtension("C:\\Program Files (x86)\\java\\bin\\javaw.exe"), is(equalTo("exe"))); assertThat(subject.getFileExtension("https://www.youtube.com/watch?v=qYrpPrLY868"), is(nullValue())); + assertThat(subject.getFileExtension( + "a52fc16cca77ab2bf6abe51e463ce501.jpg?response-content-type=image%2Fjpeg&test=1"), is("jpg")); } @Test - public void testGetUniqueFileName() { + public void testGetUniqueFileNameIsUnique() { String mp3UniqueFileName = subject.getUniqueFileName(MP3_FILE_NAME); assertThat(mp3UniqueFileName, is(equalTo(subject.getUniqueFileName(MP3_FILE_NAME)))); diff --git a/bundles/org.openhab.binding.konnected/NOTICE b/bundles/org.openhab.binding.konnected/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.konnected/NOTICE +++ b/bundles/org.openhab.binding.konnected/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.konnected/README.md b/bundles/org.openhab.binding.konnected/README.md index ad81b0399f2fa..121403f1c7b84 100644 --- a/bundles/org.openhab.binding.konnected/README.md +++ b/bundles/org.openhab.binding.konnected/README.md @@ -18,7 +18,7 @@ The binding will then create things for each module discovered which can be adde The binding attempts to discover The Konnected Alarm Panels via the UPnP service. The auto-discovery service of the binding will detect the ip address and port of the Konnected Alarm Panel. -The binding will attempt to obtain the ip address of your openHAB server as configured in the OSGI framework. +The binding will attempt to obtain the ip address of your openHAB server as configured in the OSGi framework. However, if it is unable to determine the ip address it will also attempt to use the network address service to obtain the ip address and port. In addition you can also turn off discovery which when this setting is synced to the module will cause the device to no longer respond to UPnP requests as documented. https://help.konnected.io/support/solutions/articles/32000023968-disabling-device-discovery @@ -55,7 +55,7 @@ These parameters will tell the module to pulse the actuator for certain time per A momentary switch actuates a switch for a specified time (in milliseconds) and then reverts it back to the off state. This is commonly used with a relay module to actuate a garage door opener, or with a door bell to send a momentary trigger to sound the door bell. A beep/blink switch is like a momentary switch that repeats either a specified number of times or indefinitely. -This is commonly used with a a piezo buzzer to make a "beep beep" sound when a door is opened, or to make a repeating beep pattern for an alarm or audible warning. +This is commonly used with a piezo buzzer to make a "beep beep" sound when a door is opened, or to make a repeating beep pattern for an alarm or audible warning. It can also be used to blink lights. DSB1820 temperature probes. diff --git a/bundles/org.openhab.binding.konnected/pom.xml b/bundles/org.openhab.binding.konnected/pom.xml index eb2aea20e61b9..8d87f5e2dd914 100644 --- a/bundles/org.openhab.binding.konnected/pom.xml +++ b/bundles/org.openhab.binding.konnected/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.konnected</artifactId> diff --git a/bundles/org.openhab.binding.konnected/src/main/feature/feature.xml b/bundles/org.openhab.binding.konnected/src/main/feature/feature.xml index 2697c1f590c83..ce6d9a129ff7f 100644 --- a/bundles/org.openhab.binding.konnected/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.konnected/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.konnected-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-konnected" description="Konnected Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedBindingConstants.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedBindingConstants.java index 90d771421a67b..7c85e78bbbb26 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedBindingConstants.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedConfiguration.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedConfiguration.java index b568ff1999ab8..45359f2aa28e5 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedConfiguration.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHTTPUtils.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHTTPUtils.java index a6462d901a3f5..f8bb67a340674 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHTTPUtils.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHTTPUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHandlerFactory.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHandlerFactory.java index 7b4cdc2d7da1c..0a2c2fbe30af8 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHandlerFactory.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHttpRetryExceeded.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHttpRetryExceeded.java index f1ede107940c3..552cf77f24a35 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHttpRetryExceeded.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/KonnectedHttpRetryExceeded.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/discovery/KonnectedUPnPServer.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/discovery/KonnectedUPnPServer.java index c6b9bb24a5368..c74ff5ab94e9a 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/discovery/KonnectedUPnPServer.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/discovery/KonnectedUPnPServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModuleGson.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModuleGson.java index 2e59cb08d1152..4abcbd6d951b7 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModuleGson.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModuleGson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModulePayload.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModulePayload.java index b95783fe7f0c4..85f52ad7b206c 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModulePayload.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/gson/KonnectedModulePayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/handler/KonnectedHandler.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/handler/KonnectedHandler.java index eaa72c2dd54b9..6f1be0343b7f5 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/handler/KonnectedHandler.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/handler/KonnectedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedHTTPServlet.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedHTTPServlet.java index 966cfc52a2cb3..09e7f83d5a480 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedHTTPServlet.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedHTTPServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedWebHookFail.java b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedWebHookFail.java index 733b5214378e9..f2059db3a6967 100644 --- a/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedWebHookFail.java +++ b/bundles/org.openhab.binding.konnected/src/main/java/org/openhab/binding/konnected/internal/servlet/KonnectedWebHookFail.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/config/config.xml index 94a6bfacca459..5451820b401a2 100644 --- a/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/config/config.xml @@ -10,13 +10,13 @@ <description /> </parameter-group> <parameter name="blink" type="boolean"> - <label>blink</label> + <label>Blink</label> <description> When set to false the Led on the device won't blink during transmission.</description> <default>true</default> <advanced>true</advanced> </parameter> <parameter name="discovery" type="boolean"> - <label>discovery</label> + <label>Discovery</label> <description>If set to false the device will not respond to discovery requests via UPnP. Make sure you have statically assigned an IP address to the module before turning this setting off. See https://help.konnected.io/support/solutions/articles/32000023968-disabling-device-discovery</description> <default>true</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/thing/thing-types.xml index 53407d6da7ace..8ea88a9992c89 100644 --- a/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.konnected/src/main/resources/ESH-INF/thing/thing-types.xml @@ -13,7 +13,7 @@ <description>Zone 6 Sensor</description> </channel> <channel id="Out" typeId="actuator"> - <label>The Out Pin</label> + <label>The out Pin</label> </channel> </channels> <config-description-ref uri="thing-type:konnected:module" /> diff --git a/bundles/org.openhab.binding.kostalinverter/NOTICE b/bundles/org.openhab.binding.kostalinverter/NOTICE index 0c13fa7419c02..0ca708bef198a 100644 --- a/bundles/org.openhab.binding.kostalinverter/NOTICE +++ b/bundles/org.openhab.binding.kostalinverter/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.kostalinverter/README.md b/bundles/org.openhab.binding.kostalinverter/README.md index 9ef47dba72684..8d01c6ab51f2b 100644 --- a/bundles/org.openhab.binding.kostalinverter/README.md +++ b/bundles/org.openhab.binding.kostalinverter/README.md @@ -155,7 +155,9 @@ All third generation inverters require to define 3 mandatory configuration param | refreshInternalInSeconds | Defines how often the device is polled for new values | Integer | Seconds | 30 | 30 | If you are using the hostname instead of the IP address, please make sure your DNS is configuration correctly! -The refresh interval should be chosen wisely. To small interval may led to high workload for the inverter. From my testing I recommend a interval of 30 seconds. +The refresh interval should be chosen wisely. +To small interval may led to high workload for the inverter. +It is recommended to use an interval of 30 seconds. Full sample of thing configuration: diff --git a/bundles/org.openhab.binding.kostalinverter/pom.xml b/bundles/org.openhab.binding.kostalinverter/pom.xml index 11901e244af55..f2384cfbbdf98 100644 --- a/bundles/org.openhab.binding.kostalinverter/pom.xml +++ b/bundles/org.openhab.binding.kostalinverter/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.kostalinverter</artifactId> @@ -18,7 +17,7 @@ <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.8.3</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/feature/feature.xml b/bundles/org.openhab.binding.kostalinverter/src/main/feature/feature.xml index 3f0f939c68cc1..de27f2842de5d 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/feature/feature.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.kostalinverter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-kostalinverter" description="Kostal Inverter Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:org.jsoup/jsoup/1.8.3</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.kostalinverter/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/KostalInverterFactory.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/KostalInverterFactory.java index b1c9abb1ebf40..0706235229006 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/KostalInverterFactory.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/KostalInverterFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/ChannelConfig.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/ChannelConfig.java index 3630c3dab8bab..1265c900e6175 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/ChannelConfig.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/ChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/SourceConfig.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/SourceConfig.java index d81ad9430deb9..baac41c012708 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/SourceConfig.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/SourceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/WebscrapeHandler.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/WebscrapeHandler.java index 8c497f67abfec..37fcfb8864240 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/WebscrapeHandler.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/firstgeneration/WebscrapeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationBindingConstants.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationBindingConstants.java index 6acf5deb2bdf9..f797cfc5a27c4 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationBindingConstants.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelDatatypes.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelDatatypes.java index 51b57e88df851..fbec9a00430d0 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelDatatypes.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelDatatypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelMappingToWebApi.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelMappingToWebApi.java index 790ab493e6aa7..dd4579570074b 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelMappingToWebApi.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationChannelMappingToWebApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationConfiguration.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationConfiguration.java index 7a50d3eb8fd4d..2c9de7f80c876 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationConfiguration.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationEncryptionHelper.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationEncryptionHelper.java index ffc7fcf19620f..63ab7feb3658d 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationEncryptionHelper.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationEncryptionHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHandler.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHandler.java index 047a1868930f7..caf13463817af 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHandler.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHttpHelper.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHttpHelper.java index aa41a7886d4b7..f8ef554bef911 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHttpHelper.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHttpHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationInverterTypes.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationInverterTypes.java index 5f122c357ae26..985e191b70010 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationInverterTypes.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationInverterTypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationMappingInverterToChannel.java b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationMappingInverterToChannel.java index dd445b956a86e..a9d4bbf768eab 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationMappingInverterToChannel.java +++ b/bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationMappingInverterToChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/config/ThirdGeneration.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/config/ThirdGeneration.xml index 9692a695be144..33e55d0be29d0 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/config/ThirdGeneration.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/config/ThirdGeneration.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https: <config-description uri="thing-type:kostalplenticorepikoiq_config"> <parameter name="url" type="text" required="true"> <context>network-address</context> - <label>IP address / Hostname</label> + <label>IP Address / Hostname</label> <description>Enter the IP address or the hostname of the inverter. Note that DNS resolution must work properly to identify the inverter by its name</description> </parameter> <parameter name="refreshInternalInSeconds" type="integer" required="true" unit="s"> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/Channels.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/Channels.xml index 790b358734fc9..b55b96c61e8dc 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/Channels.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/Channels.xml @@ -10,7 +10,7 @@ </channel-type> <channel-type id="device-local-dc-power"> <item-type>Number:Energy</item-type> - <label>DC power</label> + <label>DC Power</label> <description>Current DC power of the inverter</description> <category>Energy</category> <state readOnly="true" pattern="%.2f %unit%" /> @@ -135,7 +135,7 @@ </channel-type> <channel-type id="device-local-ac-current-power"> <item-type>Number:Energy</item-type> - <label>AC power</label> + <label>AC Power</label> <description>Current AC power of the inverter</description> <category>Energy</category> <state readOnly="true" pattern="%.2f %unit%" /> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PIKOIQ85.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PIKOIQ85.xml index a08fdc3d3d29d..52732f0d11ba3 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PIKOIQ85.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PIKOIQ85.xml @@ -71,4 +71,4 @@ <config-description-ref uri="thing-type:kostalplenticorepikoiq_config" /> </thing-type> </thing:thing-descriptions> - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHBATTERY.xml index 69a1a28a307fd..33e4199b8365d 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS100WITHBATTERY"> - <label>KOSTAL PLENTICORE plus 10.0 (with Battery)</label> + <label>KOSTAL PLENTICORE Plus 10.0 (with Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 10.0 solar inverter (with battery attached on PV string 3)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHOUTBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHOUTBATTERY.xml index 0ea29cfef9113..e4fabd5dbf4ef 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHOUTBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS100WITHOUTBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS100WITHOUTBATTERY"> - <label>KOSTAL PLENTICORE plus 10.0 (no battery)</label> + <label>KOSTAL PLENTICORE Plus 10.0 (no Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 10.0 solar inverter (no battery attached)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHBATTERY.xml index bb824755354ca..b3171753a6edc 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS42WITHBATTERY"> - <label>KOSTAL PLENTICORE plus 4.2 (with Battery)</label> + <label>KOSTAL PLENTICORE Plus 4.2 (with Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 4.2 solar inverter (with battery attached on PV string 3)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHOUTBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHOUTBATTERY.xml index ad0d293beed6f..8c3042bd83f61 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHOUTBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS42WITHOUTBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS42WITHOUTBATTERY"> - <label>KOSTAL PLENTICORE plus 4.2 (no battery)</label> + <label>KOSTAL PLENTICORE Plus 4.2 (no Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 4.2 solar inverter (no battery attached)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHBATTERY.xml index 65d8708441e07..4ded8b0ce1282 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS55WITHBATTERY"> - <label>KOSTAL PLENTICORE plus 5.5 (with Battery)</label> + <label>KOSTAL PLENTICORE Plus 5.5 (with Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 5.5 solar inverter (with battery attached on PV string 3)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHOUTBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHOUTBATTERY.xml index e7ab8f956a260..052e795a3466d 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHOUTBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS55WITHOUTBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS55WITHOUTBATTERY"> - <label>KOSTAL PLENTICORE plus 5.5 (no battery)</label> + <label>KOSTAL PLENTICORE Plus 5.5 (no Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 5.5 solar inverter (no battery attached)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHBATTERY.xml index 66382c3915788..c96783309b61d 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS70WITHBATTERY"> - <label>KOSTAL PLENTICORE plus 7.0 (with Battery)</label> + <label>KOSTAL PLENTICORE Plus 7.0 (with Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 7.0 solar inverter (with battery attached on PV string 3)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHOUTBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHOUTBATTERY.xml index 7dcc8a67ab8ad..6e73eed746c66 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHOUTBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS70WITHOUTBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS70WITHOUTBATTERY"> - <label>KOSTAL PLENTICORE plus 7.0 (no battery)</label> + <label>KOSTAL PLENTICORE Plus 7.0 (no Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 7.0 solar inverter (no battery attached)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHBATTERY.xml index ad987eb3419f0..957ef414cc23a 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS85WITHBATTERY"> - <label>KOSTAL PLENTICORE plus 8.5 (with Battery)</label> + <label>KOSTAL PLENTICORE Plus 8.5 (with Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 8.5 solar inverter (with battery attached on PV string 3)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHOUTBATTERY.xml b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHOUTBATTERY.xml index 459eb6ff67037..31483ab8aabef 100644 --- a/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHOUTBATTERY.xml +++ b/bundles/org.openhab.binding.kostalinverter/src/main/resources/ESH-INF/thing/PLENTICOREPLUS85WITHOUTBATTERY.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="PLENTICOREPLUS85WITHOUTBATTERY"> - <label>KOSTAL PLENTICORE plus 8.5 (no battery)</label> + <label>KOSTAL PLENTICORE Plus 8.5 (no Battery)</label> <description>Bindings for the KOSTAL PIKO PLENTICORE plus 8.5 solar inverter (no battery attached)</description> <category>Inverter</category> <channels> diff --git a/bundles/org.openhab.binding.lametrictime/NOTICE b/bundles/org.openhab.binding.lametrictime/NOTICE index e983197d63d27..6e0a5bb9c3454 100644 --- a/bundles/org.openhab.binding.lametrictime/NOTICE +++ b/bundles/org.openhab.binding.lametrictime/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.lametrictime/README.md b/bundles/org.openhab.binding.lametrictime/README.md index c73f8791f3fd0..53f58ecaef27e 100644 --- a/bundles/org.openhab.binding.lametrictime/README.md +++ b/bundles/org.openhab.binding.lametrictime/README.md @@ -1,6 +1,6 @@ # LaMetric Binding -The LaMetric binding allows to connect openHab to LaMetric Time connected clock devices, providing following features: +The LaMetric binding allows to connect openHAB to LaMetric Time connected clock devices, providing following features: * Control the LaMetric Time Device * Control Display Brightness @@ -16,13 +16,13 @@ The device acts as a bridge and is exposed as "LaMetric Time" Thing. The "LaMetric Time" Thing is directly responsible for device operations which include the display, audio, bluetooth, and notifications. All apps are implemented as separate things under the bridge. -| App | Thing Type | Description | -|-------------------|--------------|---------------------------------------------------------------| -| Clock | clockApp | Clock that dispays time and date | -| Timer | countdownApp | A countdown timer that counts by seconds | -| Radio | radioApp | Streaming radio player | -| Stopwatch | stopwatchApp | Stopwatch that counts up by seconds | -| Weather | weatherApp | Current weather conditions as well as a forecast | +| App | Thing Type | Description | +|-------------------|--------------|--------------------------------------------------| +| Clock | clockApp | Clock that dispays time and date | +| Timer | countdownApp | A countdown timer that counts by seconds | +| Radio | radioApp | Streaming radio player | +| Stopwatch | stopwatchApp | Stopwatch that counts up by seconds | +| Weather | weatherApp | Current weather conditions as well as a forecast | ## Discovery @@ -125,7 +125,7 @@ They exist as one-way communication only. ## How Tos The following configuration examples assume the device was added with the thing id `lametrictime:device:demo`. -Replace the thing id in all the configurations with your real thing id which can be looked up via paper UI. +Replace the thing id in all the configurations with your real thing id which can be looked up via Paper UI. ### Notifications diff --git a/bundles/org.openhab.binding.lametrictime/pom.xml b/bundles/org.openhab.binding.lametrictime/pom.xml index ce2b9db8e409f..0ddf434e8ebe6 100644 --- a/bundles/org.openhab.binding.lametrictime/pom.xml +++ b/bundles/org.openhab.binding.lametrictime/pom.xml @@ -1,24 +1,33 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lametrictime</artifactId> <name>openHAB Add-ons :: Bundles :: LaMetric Time Binding</name> + <properties> + <dep.noembedding>provider-gson</dep.noembedding> + </properties> + <dependencies> <dependency> <groupId>org.syphr</groupId> <artifactId>lametrictime-api</artifactId> <version>0.1.0</version> - <scope>provided</scope> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.eclipsesource.jaxrs</groupId> + <artifactId>provider-gson</artifactId> + <version>2.3</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.lametrictime/src/main/feature/feature.xml b/bundles/org.openhab.binding.lametrictime/src/main/feature/feature.xml index 7cc27d619766a..d6f4b6aa4f2aa 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lametrictime/src/main/feature/feature.xml @@ -1,12 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lametrictime-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lametrictime" description="LaMetric Time Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-upnp</feature> <bundle dependency="true">mvn:com.eclipsesource.jaxrs/provider-gson/2.3</bundle> - <bundle dependency="true">mvn:org.syphr/lametrictime-api/0.1.0</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.lametrictime/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeBindingConstants.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeBindingConstants.java index e134a64468182..0901a248ffc48 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeBindingConstants.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeConfigStatusMessage.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeConfigStatusMessage.java index 84ba963215d66..07eb93f05cedd 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeConfigStatusMessage.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeConfigStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeHandlerFactory.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeHandlerFactory.java index 1fa5b7ba66fb6..b2ed287b0929f 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeHandlerFactory.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeUtil.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeUtil.java index a991c50303eda..0c06fcb02502c 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeUtil.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/LaMetricTimeUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java index 73f368fd57b06..0fcac81d43475 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/StateDescriptionOptionsProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/WidgetRef.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/WidgetRef.java index 79a6795a28bd0..9683bfe715555 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/WidgetRef.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/WidgetRef.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeAppConfiguration.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeAppConfiguration.java index 53afab381b7e8..dc5d2d6ed3809 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeAppConfiguration.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeAppConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeConfiguration.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeConfiguration.java index 515ce55181893..85f1793655560 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeConfiguration.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/config/LaMetricTimeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeAppDiscoveryService.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeAppDiscoveryService.java index ba96c82b45467..ef0c74b44e2c1 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeAppDiscoveryService.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeAppDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeDiscoveryParticipant.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeDiscoveryParticipant.java index 0804e4dc0ce1e..ceff442cdbccd 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/discovery/LaMetricTimeDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/AbstractLaMetricTimeAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/AbstractLaMetricTimeAppHandler.java index 26b406ac937ef..caa0670b2bb34 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/AbstractLaMetricTimeAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/AbstractLaMetricTimeAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/ClockAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/ClockAppHandler.java index 9a2c1997135ed..bef143bfa56e3 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/ClockAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/ClockAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/CountdownAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/CountdownAppHandler.java index be1b387e22d84..fd47e0b0e9f58 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/CountdownAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/CountdownAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeAppHandler.java index b23ad4dedaaf4..eb9a9b5e3069f 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeHandler.java index ab07a06b65152..4a027d3d6e1b2 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/LaMetricTimeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/RadioAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/RadioAppHandler.java index 46313361ae8be..2d8e9913a307c 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/RadioAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/RadioAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/StopwatchAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/StopwatchAppHandler.java index 6fe5c9aced7ec..14ad85240a8f1 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/StopwatchAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/StopwatchAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/WeatherAppHandler.java b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/WeatherAppHandler.java index 55fe43e5f7cbe..b8b9127c5d0f2 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/WeatherAppHandler.java +++ b/bundles/org.openhab.binding.lametrictime/src/main/java/org/openhab/binding/lametrictime/internal/handler/WeatherAppHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lametrictime/src/main/resources/ESH-INF/thing/device.xml b/bundles/org.openhab.binding.lametrictime/src/main/resources/ESH-INF/thing/device.xml index c692adb1fbe5d..82b128e5e73d9 100644 --- a/bundles/org.openhab.binding.lametrictime/src/main/resources/ESH-INF/thing/device.xml +++ b/bundles/org.openhab.binding.lametrictime/src/main/resources/ESH-INF/thing/device.xml @@ -31,7 +31,7 @@ <description>Host name or network address of the LaMetric Time</description> </parameter> <parameter name="apiKey" type="text" required="true"> - <label>API key</label> + <label>API Key</label> <description>API key to access LaMetric Time</description> <context>password</context> </parameter> diff --git a/bundles/org.openhab.binding.leapmotion/.classpath b/bundles/org.openhab.binding.leapmotion/.classpath index bf682f222d418..cd04a794bfd47 100644 --- a/bundles/org.openhab.binding.leapmotion/.classpath +++ b/bundles/org.openhab.binding.leapmotion/.classpath @@ -11,7 +11,6 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/LeapJava.jar"/> <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"/> diff --git a/bundles/org.openhab.binding.leapmotion/NOTICE b/bundles/org.openhab.binding.leapmotion/NOTICE index c5c4f5a3dafb3..f66c50218f1b7 100644 --- a/bundles/org.openhab.binding.leapmotion/NOTICE +++ b/bundles/org.openhab.binding.leapmotion/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.leapmotion/README.md b/bundles/org.openhab.binding.leapmotion/README.md index 7c3343dee2d16..05248bab468ca 100644 --- a/bundles/org.openhab.binding.leapmotion/README.md +++ b/bundles/org.openhab.binding.leapmotion/README.md @@ -2,7 +2,7 @@ The [Leap Motion](https://www.leapmotion.com/) controller is a gesture sensoring device that uses stereoscopic cameras and is connected through USB. As all processing is done in software, it requires quite some powerful computer, such that it unfortunately does not work on single-board computers such as the Raspberry Pi. -In fact, the binding is currently only working on MacOS computers with Intel x86 processors. +In fact, the binding is currently only working on macOS computers with Intel x86 processors. ## Supported Things diff --git a/bundles/org.openhab.binding.leapmotion/lib/LeapJava.jar b/bundles/org.openhab.binding.leapmotion/lib/LeapJava.jar deleted file mode 100644 index c6bebfda18d6e..0000000000000 Binary files a/bundles/org.openhab.binding.leapmotion/lib/LeapJava.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.leapmotion/pom.xml b/bundles/org.openhab.binding.leapmotion/pom.xml index 59b4e85f0e88d..61a7f1f8fa04a 100644 --- a/bundles/org.openhab.binding.leapmotion/pom.xml +++ b/bundles/org.openhab.binding.leapmotion/pom.xml @@ -1,16 +1,23 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.leapmotion</artifactId> <name>openHAB Add-ons :: Bundles :: Leap Motion Binding</name> + <dependencies> + <dependency> + <groupId>com.leapmotion.leap</groupId> + <artifactId>leap-java</artifactId> + <version>2.0.0</version> + <scope>compile</scope> + </dependency> + </dependencies> </project> diff --git a/bundles/org.openhab.binding.leapmotion/src/main/feature/feature.xml b/bundles/org.openhab.binding.leapmotion/src/main/feature/feature.xml index c81cccde16324..f5f9059438ee4 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.leapmotion/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.leapmotion-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-leapmotion" description="LeapMotion Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionBindingConstants.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionBindingConstants.java index 62efa5cd4d586..cdf0485080da9 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionBindingConstants.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionColorProfile.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionColorProfile.java index 9a669403837c5..4e64e028a5420 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionColorProfile.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionColorProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionDimmerProfile.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionDimmerProfile.java index 942a007a98e94..25fba73fcb0ba 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionDimmerProfile.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionDimmerProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionHandlerFactory.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionHandlerFactory.java index 9e034ef80b005..94a9e45fca359 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionHandlerFactory.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionProfileFactory.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionProfileFactory.java index ed9853a21bf3b..0559433f614a9 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionProfileFactory.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionSwitchProfile.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionSwitchProfile.java index 78d1b4b74e8d2..b650c2933657f 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionSwitchProfile.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/LeapMotionSwitchProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/discovery/LeapMotionDiscoveryService.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/discovery/LeapMotionDiscoveryService.java index cf4095f96d50b..0c2807d5d0576 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/discovery/LeapMotionDiscoveryService.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/discovery/LeapMotionDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/handler/LeapMotionHandler.java b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/handler/LeapMotionHandler.java index c312dc079a824..8659ecf37bf00 100644 --- a/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/handler/LeapMotionHandler.java +++ b/bundles/org.openhab.binding.leapmotion/src/main/java/org/openhab/binding/leapmotion/internal/handler/LeapMotionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lghombot/.classpath b/bundles/org.openhab.binding.lghombot/.classpath new file mode 100644 index 0000000000000..a5d95095ccaaf --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/.classpath @@ -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> diff --git a/bundles/org.openhab.binding.lghombot/.project b/bundles/org.openhab.binding.lghombot/.project new file mode 100644 index 0000000000000..d69b7494b89f2 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.lghombot</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> diff --git a/bundles/org.openhab.binding.lghombot/NOTICE b/bundles/org.openhab.binding.lghombot/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.lghombot/README.md b/bundles/org.openhab.binding.lghombot/README.md new file mode 100644 index 0000000000000..6bf73bc9bb18b --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/README.md @@ -0,0 +1,111 @@ +# LG HomBot Binding + +The binding integrates a modified LG HomBot VR6260 based vacuum robots. +Details on how to modify your HomBot can be found at [roboter-forum.com](https://www.roboter-forum.com/index.php?thread/10009-lg-hombot-3-0-wlan-kamera-steuerung-per-weboberfläche/). +The binding uses the HTTP service on port 6260 right now. +Please take care when modifying your HomBot! This binding is a complement to a modified HomBot not an excuse to do the modification. +Remember, You are responsible if You brick Your HomBot. + +## Supported Things + +Hacked LG HomBot series 62XX are supported. + +The service that the binding connects to is actually lg.srv found at [sourceforge.net](https://sourceforge.net/projects/lgsrv/) running on a HomBot. + +## Discovery + +The auto-discovery should hopefully find your HomBot, be aware that it will try to connect to port 6260 on all IP-addresses on your subnet. +If you already know the IP-address of your HomBot you might as well just configure it. + +## Thing Configuration + +The thing only requires an IP-address to function, this could also be found using the discovery method. +The parameter is called "ipAdress". + +You can also configure the polling interval in seconds by setting "pollingPeriod", and the network port of the server by using "port". + +## Channels + + +| Channel Type ID | Item Type | Description | Read/Write | +|-----------------|-----------|--------------------------------------------------------------------------|------------| +| state | String | Current state of the HomBot. | R | +| battery | Number | Current battery charge. | R | +| cpuLoad | Number | Current CPU load. | R | +| srvMem | Number | Current server memory load. | R | +| clean | Switch | Start cleaning / return home. | RW | +| start | Switch | Start cleaning. | RW | +| home | Switch | Send HomBot home. | RW | +| pause | Switch | Pause current activity. | RW | +| turbo | Switch | Turn turbo on/off. | RW | +| repeat | Switch | Turn repeat cleaning on/off. | RW | +| mode | String | Current cleaning mode. | RW | +| nickname | String | Nickname of the HomBot. | R | +| move | String | Manually control the HomBot. | RW | +| camera | Image | Image from the top camera. | R | +| lastClean | DateTime | Date of last clean. | R | +| map | Image | Image of clean area. | R | +| monday | DateTime | Time when cleaning is on Mondays. | R | +| tuesday | DateTime | Time when cleaning is on Tuesdays. | R | +| wednsday | DateTime | Time when cleaning is on Wednsdays. | R | +| thursday | DateTime | Time when cleaning is on Thursdays. | R | +| friday | DateTime | Time when cleaning is on Fridays. | R | +| saturday | DateTime | Time when cleaning is on Saturdays. | R | +| sunday | DateTime | Time when cleaning is on Sundays. | R | + +## Full Example + +Example of how to configure a thing. + +demo.thing + +``` +Thing lghombot:LGHomBot:mycleanerbot "LGHomBot" @ "Living Room" [ ipAdress="192.168.0.2", pollingPeriod="3", port="6260" ] +``` + +Here are some examples on how to map the channels to items. + +demo.items: + +``` +String HomBot_State "State [%s]" <CleaningRobot> { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:state" } +Number HomBot_Battery "Battery [%d%%]" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:battery" } +Switch HomBot_Clean "Clean" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:clean" } +Switch HomBot_Start "Start" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:start" } +Switch HomBot_Home "Home" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:home" } +Switch HomBot_Pause "Pause" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:pause" } +Switch HomBot_Turbo "Turbo" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:turbo" } +Switch HomBot_Repeat "Repeat" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:repeat" } +String HomBot_CleanMode "Clean mode [%s]" { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:mode" } +String HomBot_Nickname { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:nickname" } +Image HomBot_Camera { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:camera" } +DateTime HomBot_LastClean { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:lastClean" } +Image HomBot_Map { channel="lghombot:LGHomBot:a4_24_56_8f_2c_5b:map" } +``` + +demo.sitemap: + +``` +sitemap demo label="Main Menu" +{ + Frame label="HomBot" { + Text item=HomBot_State + Text item=HomBot_Battery + Switch item=HomBot_Clean + Switch item=HomBot_Start + Switch item=HomBot_Home + Switch item=HomBot_Pause + Switch item=HomBot_Turbo + Switch item=HomBot_Repeat + Selection item=HomBot_CleanMode mappings=[ + "ZZ"="Zigzag mode", + "SB"="Cell by cell mode", + "SPOT"="Spiral spot mode", + "MACRO_SECTOR" = "My space mode" ] + Text item=HomBot_Nickname + Image item=HomBot_Camera + DateTime item=HomBot_LastClean + Image item=HomBot_Map + } +} +``` diff --git a/bundles/org.openhab.binding.lghombot/pom.xml b/bundles/org.openhab.binding.lghombot/pom.xml new file mode 100644 index 0000000000000..21c32179cbe3c --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/pom.xml @@ -0,0 +1,15 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.lghombot</artifactId> + + <name>openHAB Add-ons :: Bundles :: LG HomBot Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.lghombot/src/main/feature/feature.xml b/bundles/org.openhab.binding.lghombot/src/main/feature/feature.xml new file mode 100644 index 0000000000000..82e20407ed8f9 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.lghombot-${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-lghombot" description="LG HomBot Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.lghombot/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/CameraUtil.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/CameraUtil.java new file mode 100644 index 0000000000000..e8dc949d98cfc --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/CameraUtil.java @@ -0,0 +1,84 @@ +/** + * 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.lghombot.internal; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +import javax.imageio.ImageIO; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.RawType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link CameraUtil} is responsible for parsing the raw yuv 422 image from a LG HomBot. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +public class CameraUtil { + + private static final Logger logger = LoggerFactory.getLogger(CameraUtil.class); + + private CameraUtil() { + // No need to instance this class. + } + + /** + * This converts a non-interleaved YUV-422 image to a JPEG image. + * + * @param yuvData The uncompressed YUV data + * @param width The width of image. + * @param height The height of the image. + * @return A JPEG image as a State + */ + static State parseImageFromBytes(byte[] yuvData, int width, int height) { + final int size = width * height; + + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + + for (int i = 0; i < size; i++) { + double y = yuvData[i] & 0xFF; + double u = yuvData[size + i / 2] & 0xFF; + double v = yuvData[(int) (size * 1.5 + i / 2.0)] & 0xFF; + + int r = Math.min(Math.max((int) (y + 1.371 * (v - 128)), 0), 255); // red + int g = Math.min(Math.max((int) (y - 0.336 * (u - 128) - 0.698 * (v - 128)), 0), 255); // green + int b = Math.min(Math.max((int) (y + 1.732 * (u - 128)), 0), 255); // blue + + int p = (r << 16) | (g << 8) | b; // pixel + image.setRGB(i % width, i / width, p); + } + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + if (!ImageIO.write(image, "jpg", baos)) { + logger.debug("Couldn't find JPEG writer."); + } + } catch (IOException e) { + logger.info("IOException creating JPEG image.", e); + } + byte[] byteArray = baos.toByteArray(); + if (byteArray != null && byteArray.length > 0) { + return new RawType(byteArray, "image/jpeg"); + } else { + return UnDefType.UNDEF; + } + } + +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotBindingConstants.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotBindingConstants.java new file mode 100644 index 0000000000000..bdfd0dc19ce93 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotBindingConstants.java @@ -0,0 +1,86 @@ +/** + * 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.lghombot.internal; + +import java.util.Collections; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link LGHomBotBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +public final class LGHomBotBindingConstants { + + private static final String BINDING_ID = "lghombot"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_LGHOMBOT = new ThingTypeUID(BINDING_ID, "LGHomBot"); + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_LGHOMBOT); + + // List of all Channel ids + static final String CHANNEL_STATE = "state"; + static final String CHANNEL_BATTERY = "battery"; + static final String CHANNEL_CPU_LOAD = "cpuLoad"; + static final String CHANNEL_SRV_MEM = "srvMem"; + static final String CHANNEL_CLEAN = "clean"; + static final String CHANNEL_START = "start"; + static final String CHANNEL_HOME = "home"; + static final String CHANNEL_PAUSE = "pause"; + static final String CHANNEL_MODE = "mode"; + static final String CHANNEL_TURBO = "turbo"; + static final String CHANNEL_REPEAT = "repeat"; + static final String CHANNEL_NICKNAME = "nickname"; + static final String CHANNEL_MOVE = "move"; + static final String CHANNEL_CAMERA = "camera"; + static final String CHANNEL_LAST_CLEAN = "lastClean"; + static final String CHANNEL_MAP = "map"; + static final String CHANNEL_MONDAY = "monday"; + static final String CHANNEL_TUESDAY = "tuesday"; + static final String CHANNEL_WEDNESDAY = "wednesday"; + static final String CHANNEL_THURSDAY = "thursday"; + static final String CHANNEL_FRIDAY = "friday"; + static final String CHANNEL_SATURDAY = "saturday"; + static final String CHANNEL_SUNDAY = "sunday"; + + // List of all HomBot states + static final String HBSTATE_UNKNOWN = "UNKNOWN"; + static final String HBSTATE_WORKING = "WORKING"; + static final String HBSTATE_BACKMOVING = "BACKMOVING"; + static final String HBSTATE_BACKMOVING_INIT = "BACKMOVING_INIT"; + static final String HBSTATE_BACKMOVING_JOY = "BACKMOVING_JOY"; + static final String HBSTATE_PAUSE = "PAUSE"; + static final String HBSTATE_STANDBY = "STANDBY"; + static final String HBSTATE_HOMING = "HOMING"; + static final String HBSTATE_DOCKING = "DOCKING"; + static final String HBSTATE_CHARGING = "CHARGING"; + static final String HBSTATE_DIAGNOSIS = "DIAGNOSIS"; + static final String HBSTATE_RESERVATION = "RESERVATION"; + static final String HBSTATE_ERROR = "ERROR"; + + /** + * Default port number HomBot uses. + */ + public static final int DEFAULT_HOMBOT_PORT = 6260; + + private LGHomBotBindingConstants() { + // No need to instance this class. + } + +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotConfiguration.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotConfiguration.java new file mode 100644 index 0000000000000..eded25ef2e42d --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotConfiguration.java @@ -0,0 +1,47 @@ +/** + * 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.lghombot.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lghombot.internal.discovery.LGHomBotDiscovery; + +/** + * The {@link LGHomBotConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +public class LGHomBotConfiguration { + + /** + * Constant field used in {@link LGHomBotDiscovery} to set the configuration property during discovery. Value of + * this field needs to match {@link #ipAddress} + */ + public static final String IP_ADDRESS = "ipAddress"; + + /** + * IP Address (or host name) of HomBot + */ + public String ipAddress = ""; + + /** + * Port used by the HomBot + */ + public int port = LGHomBotBindingConstants.DEFAULT_HOMBOT_PORT; + + /** + * Polling time (in seconds) to refresh state from the HomBot itself. + */ + public int pollingPeriod = 3; + +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandler.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandler.java new file mode 100644 index 0000000000000..478a3d06134d2 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandler.java @@ -0,0 +1,662 @@ +/** + * 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.lghombot.internal; + +import static org.openhab.binding.lghombot.internal.LGHomBotBindingConstants.*; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.time.DateTimeException; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import javax.imageio.ImageIO; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.util.UrlEncoded; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.RawType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link LGHomBotHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +public class LGHomBotHandler extends BaseThingHandler { + + private final Logger logger = LoggerFactory.getLogger(LGHomBotHandler.class); + + // This is setup in initialize(). + private LGHomBotConfiguration config = new LGHomBotConfiguration(); + + private @Nullable ScheduledFuture<?> refreshTimer; + + // State of HomBot + private String currentState = ""; + private String currentMode = ""; + private String currentNickname = ""; + private String currentSrvMem = ""; + private DecimalType currentBattery = DecimalType.ZERO; + private DecimalType currentCPULoad = DecimalType.ZERO; + private OnOffType currentCleanState = OnOffType.OFF; + private OnOffType currentStartState = OnOffType.OFF; + private OnOffType currentHomeState = OnOffType.OFF; + private OnOffType currentTurbo = OnOffType.OFF; + private OnOffType currentRepeat = OnOffType.OFF; + private State currentImage = UnDefType.UNDEF; + private State currentMap = UnDefType.UNDEF; + private DateTimeType currentLastClean = new DateTimeType(); + private String currentMonday = ""; + private String currentTuesday = ""; + private String currentWednesday = ""; + private String currentThursday = ""; + private String currentFriday = ""; + private String currentSaturday = ""; + private String currentSunday = ""; + + private final DateTimeFormatter formatterLG = DateTimeFormatter.ofPattern("yyyy/MM/dd/HH/mm/ss"); + private boolean disposed = false; + private boolean refreshSchedule = false; + + public LGHomBotHandler(Thing thing) { + super(thing); + } + + @Override + public void dispose() { + super.dispose(); + disposed = true; + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + if (command.equals(RefreshType.REFRESH)) { + refreshFromState(channelUID); + } else { + switch (channelUID.getId()) { + case CHANNEL_CLEAN: + if (command == OnOffType.ON) { + if (currentState.equals(HBSTATE_HOMING)) { + sendHomBotCommand("PAUSE"); + } + sendHomBotCommand("CLEAN_START"); + } else if (command == OnOffType.OFF) { + sendHomBotCommand("HOMING"); + } + break; + case CHANNEL_START: + if (command == OnOffType.ON) { + sendHomBotCommand("CLEAN_START"); + } + break; + case CHANNEL_HOME: + if (command == OnOffType.ON) { + sendHomBotCommand("HOMING"); + } + break; + case CHANNEL_PAUSE: + if (command instanceof OnOffType) { + sendHomBotCommand("PAUSE"); + } + break; + case CHANNEL_TURBO: + if (command == OnOffType.ON) { + sendHomBotCommand("TURBO", "true"); + } else if (command == OnOffType.OFF) { + sendHomBotCommand("TURBO", "false"); + } + break; + case CHANNEL_REPEAT: + if (command == OnOffType.ON) { + sendHomBotCommand("REPEAT", "true"); + } else if (command == OnOffType.OFF) { + sendHomBotCommand("REPEAT", "false"); + } + break; + case CHANNEL_MODE: + if (command instanceof StringType) { + switch (command.toString()) { + case "SB": + sendHomBotCommand("CLEAN_MODE", "CLEAN_SB"); + break; + case "ZZ": + sendHomBotCommand("CLEAN_MODE", "CLEAN_ZZ"); + break; + case "SPOT": + sendHomBotCommand("CLEAN_MODE", "CLEAN_SPOT"); + break; + case "MACRO_SECTOR": + sendHomBotCommand("CLEAN_MODE", "CLEAN_MACRO_SECTOR"); + break; + default: + break; + } + } + break; + case CHANNEL_MOVE: + if (command instanceof StringType) { + String commandString = command.toString(); + switch (commandString) { + case "FORWARD": + case "FORWARD_LEFT": + case "FORWARD_RIGHT": + case "LEFT": + case "RIGHT": + case "BACKWARD": + case "BACKWARD_LEFT": + case "BACKWARD_RIGHT": + case "RELEASE": + sendHomBotJoystick(commandString); + break; + default: + break; + } + } + break; + default: + logger.debug("Command received for unknown channel {}: {}", channelUID.getId(), command); + break; + } + } + } + + @Override + public void initialize() { + disposed = false; + logger.debug("Initializing handler for LG HomBot"); + config = getConfigAs(LGHomBotConfiguration.class); + + setupRefreshTimer(0); + } + + /** + * Sets up a refresh timer (using the scheduler) with the given interval. + * + * @param initialWaitTime The delay before the first refresh. Maybe 0 to immediately + * initiate a refresh. + */ + private void setupRefreshTimer(int initialWaitTime) { + ScheduledFuture<?> localTimer = refreshTimer; + if (localTimer != null) { + localTimer.cancel(false); + } + refreshTimer = scheduler.scheduleWithFixedDelay(this::updateAllChannels, initialWaitTime, config.pollingPeriod, + TimeUnit.SECONDS); + } + + private String buildHttpAddress(String path) { + return "http://" + config.ipAddress + ":" + config.port + path; + } + + private void sendHomBotCommand(String command) { + String fullCmd = "/json.cgi?" + UrlEncoded.encodeString("{\"COMMAND\":\"" + command + "\"}"); + sendCommand(fullCmd); + } + + private void sendHomBotCommand(String command, String argument) { + String fullCmd = "/json.cgi?" + + UrlEncoded.encodeString("{\"COMMAND\":{\"" + command + "\":\"" + argument + "\"}}"); + sendCommand(fullCmd); + } + + private void sendHomBotJoystick(String command) { + String fullCmd = "/json.cgi?" + UrlEncoded.encodeString("{\"JOY\":\"" + command + "\"}"); + sendCommand(fullCmd); + } + + private @Nullable String sendCommand(String path) { + String url = buildHttpAddress(path); + String status = null; + try { + status = HttpUtil.executeUrl("GET", url, 1000); + if (getThing().getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + } catch (IOException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + logger.trace("Status received: {}", status); + return status; + } + + private void refreshFromState(ChannelUID channelUID) { + switch (channelUID.getId()) { + case CHANNEL_STATE: + updateState(channelUID, StringType.valueOf(currentState)); + break; + case CHANNEL_CLEAN: + updateState(channelUID, currentCleanState); + break; + case CHANNEL_START: + updateState(channelUID, currentStartState); + break; + case CHANNEL_HOME: + updateState(channelUID, currentHomeState); + break; + case CHANNEL_BATTERY: + updateState(channelUID, currentBattery); + break; + case CHANNEL_CPU_LOAD: + updateState(channelUID, currentCPULoad); + break; + case CHANNEL_SRV_MEM: + updateState(channelUID, StringType.valueOf(currentSrvMem)); + break; + case CHANNEL_TURBO: + updateState(channelUID, currentTurbo); + break; + case CHANNEL_REPEAT: + updateState(channelUID, currentRepeat); + break; + case CHANNEL_MODE: + updateState(channelUID, StringType.valueOf(currentMode)); + break; + case CHANNEL_NICKNAME: + updateState(channelUID, StringType.valueOf(currentNickname)); + break; + case CHANNEL_CAMERA: + parseImage(); + updateState(channelUID, currentImage); + break; + case CHANNEL_LAST_CLEAN: + updateState(channelUID, currentLastClean); + break; + case CHANNEL_MAP: + parseMap(); + updateState(channelUID, currentMap); + break; + case CHANNEL_MONDAY: + updateState(channelUID, StringType.valueOf(currentMonday)); + refreshSchedule = true; + break; + case CHANNEL_TUESDAY: + updateState(channelUID, StringType.valueOf(currentTuesday)); + refreshSchedule = true; + break; + case CHANNEL_WEDNESDAY: + updateState(channelUID, StringType.valueOf(currentWednesday)); + refreshSchedule = true; + break; + case CHANNEL_THURSDAY: + updateState(channelUID, StringType.valueOf(currentThursday)); + refreshSchedule = true; + break; + case CHANNEL_FRIDAY: + updateState(channelUID, StringType.valueOf(currentFriday)); + refreshSchedule = true; + break; + case CHANNEL_SATURDAY: + updateState(channelUID, StringType.valueOf(currentSaturday)); + refreshSchedule = true; + break; + case CHANNEL_SUNDAY: + updateState(channelUID, StringType.valueOf(currentSunday)); + refreshSchedule = true; + break; + default: + logger.warn("Channel refresh for {} not implemented!", channelUID.getId()); + } + } + + private void updateAllChannels() { + if (disposed) { + return; + } + if (refreshSchedule) { + refreshSchedule = false; + fetchSchedule(); + return; + } + + String status = sendCommand("/status.txt"); + if (status != null && !status.isEmpty()) { + boolean parsingOk = true; + String[] rows = status.split("\\r?\\n"); + for (String row : rows) { + int idx = row.indexOf('='); + if (idx == -1) { + continue; + } + final String key = row.substring(0, idx); + String value = row.substring(idx + 1).replace("\"", ""); + switch (key) { + case "JSON_ROBOT_STATE": + if (value.isEmpty()) { + value = HBSTATE_UNKNOWN; + } + if (!value.equals(currentState)) { + currentState = value; + updateState(CHANNEL_STATE, StringType.valueOf(value)); + + switch (value) { + case HBSTATE_WORKING: + case HBSTATE_BACKMOVING: + case HBSTATE_BACKMOVING_INIT: + currentCleanState = OnOffType.ON; + currentStartState = OnOffType.ON; + currentHomeState = OnOffType.OFF; + break; + case HBSTATE_HOMING: + case HBSTATE_DOCKING: + currentCleanState = OnOffType.OFF; + currentStartState = OnOffType.OFF; + currentHomeState = OnOffType.ON; + break; + default: + currentCleanState = OnOffType.OFF; + currentStartState = OnOffType.OFF; + currentHomeState = OnOffType.OFF; + break; + } + updateState(CHANNEL_CLEAN, currentCleanState); + updateState(CHANNEL_START, currentStartState); + updateState(CHANNEL_HOME, currentHomeState); + } + break; + case "JSON_BATTPERC": + try { + DecimalType battery = DecimalType.valueOf(value); + if (!battery.equals(currentBattery)) { + currentBattery = battery; + updateState(CHANNEL_BATTERY, battery); + } + } catch (NumberFormatException e) { + logger.debug("Couldn't parse Battery Percent."); + parsingOk = false; + } + break; + case "CPU_IDLE": + if (isLinked(CHANNEL_CPU_LOAD)) { + try { + DecimalType cpuLoad = new DecimalType(100 - Double.valueOf(value).longValue()); + if (!cpuLoad.equals(currentCPULoad)) { + currentCPULoad = cpuLoad; + updateState(CHANNEL_CPU_LOAD, cpuLoad); + } + } catch (NumberFormatException e) { + logger.debug("Couldn't parse CPU Idle."); + parsingOk = false; + } + } + break; + case "LGSRV_MEMUSAGE": + if (!value.equals(currentSrvMem)) { + currentSrvMem = value; + updateState(CHANNEL_SRV_MEM, StringType.valueOf(value)); + } + break; + case "JSON_TURBO": + OnOffType turbo = OnOffType.from("true".equalsIgnoreCase(value)); + if (!turbo.equals(currentTurbo)) { + currentTurbo = turbo; + updateState(CHANNEL_TURBO, turbo); + } + break; + case "JSON_REPEAT": + OnOffType repeat = OnOffType.from("true".equalsIgnoreCase(value)); + if (!repeat.equals(currentRepeat)) { + currentRepeat = repeat; + updateState(CHANNEL_REPEAT, repeat); + } + break; + case "JSON_MODE": + if (!value.equals(currentMode)) { + currentMode = value; + updateState(CHANNEL_MODE, StringType.valueOf(value)); + } + break; + case "JSON_NICKNAME": + if (!value.equals(currentNickname)) { + currentNickname = value; + updateState(CHANNEL_NICKNAME, StringType.valueOf(value)); + } + break; + case "CLREC_LAST_CLEAN": + if (value.length() < 19) { + logger.debug("Couldn't parse Last Clean from: String length: {}", value.length()); + parsingOk = false; + break; + } + final String stringDate = value.substring(0, 19); + try { + LocalDateTime localDateTime = LocalDateTime.parse(stringDate, formatterLG); + ZonedDateTime date = ZonedDateTime.of(localDateTime, ZoneId.systemDefault()); + DateTimeType lastClean = new DateTimeType(date); + if (!lastClean.equals(currentLastClean)) { + currentLastClean = lastClean; + updateState(CHANNEL_LAST_CLEAN, lastClean); + } + } catch (DateTimeException e) { + logger.debug("Couldn't parse Last Clean from: {}", stringDate); + parsingOk = false; + } + break; + default: + break; + } + } + if (!parsingOk) { + logger.debug("Couldn't parse status response;\n {}", status); + } + } + } + + private void fetchSchedule() { + String status = sendCommand("/.../usr/data/htdocs/timer.txt"); + + if (status != null && !status.isEmpty()) { + String monday = ""; + String tuesday = ""; + String wednesday = ""; + String thursday = ""; + String friday = ""; + String saturday = ""; + String sunday = ""; + String[] rows = status.split("\\r?\\n"); + for (String row : rows) { + int idx = row.indexOf('='); + String name = row.substring(0, idx); + String state = row.substring(idx + 1); + switch (name) { + case "MONDAY": + monday = state; + break; + case "TUESDAY": + tuesday = state; + break; + case "WEDNESDAY": + wednesday = state; + break; + case "THURSDAY": + thursday = state; + break; + case "FRIDAY": + friday = state; + break; + case "SATURDAY": + saturday = state; + break; + case "SUNDAY": + sunday = state; + break; + default: + break; + } + + } + if (!currentMonday.equals(monday)) { + currentMonday = monday; + updateState(CHANNEL_MONDAY, StringType.valueOf(monday)); + } + if (!currentTuesday.equals(tuesday)) { + currentTuesday = tuesday; + updateState(CHANNEL_TUESDAY, StringType.valueOf(tuesday)); + } + if (!currentWednesday.equals(wednesday)) { + currentWednesday = wednesday; + updateState(CHANNEL_WEDNESDAY, StringType.valueOf(wednesday)); + } + if (!currentThursday.equals(thursday)) { + currentThursday = thursday; + updateState(CHANNEL_THURSDAY, StringType.valueOf(thursday)); + } + if (!currentFriday.equals(friday)) { + currentFriday = friday; + updateState(CHANNEL_FRIDAY, StringType.valueOf(friday)); + } + if (!currentSaturday.equals(saturday)) { + currentSaturday = saturday; + updateState(CHANNEL_SATURDAY, StringType.valueOf(saturday)); + } + if (!currentSunday.equals(sunday)) { + currentSunday = sunday; + updateState(CHANNEL_SUNDAY, StringType.valueOf(sunday)); + } + } + } + + private void parseImage() { + if (!isLinked(CHANNEL_CAMERA)) { + return; + } + final int width = 320; + final int height = 240; + final int size = width * height; + String url = buildHttpAddress("/images/snapshot.yuv"); + byte[] yuvData = HttpUtil.downloadData(url, null, false, size * 2).getBytes(); + + currentImage = CameraUtil.parseImageFromBytes(yuvData, width, height); + } + + /** Parse the maps.html file to find the black-box filename. */ + private String findBlackBoxFile() { + String url = buildHttpAddress("/sites/maps.html"); + try { + String htmlString = HttpUtil.executeUrl("GET", url, 1000); + int idx = htmlString.indexOf("blkfiles"); + return "/.../usr/data/blackbox/" + htmlString.substring(idx + 13, idx + 50); + } catch (IOException e1) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e1.getMessage()); + } + return ""; + } + + private void parseMap() { + if (!isLinked(CHANNEL_MAP)) { + return; + } + final int tileSize = 10; + final int tileArea = tileSize * tileSize; + final int rowLength = 100; + final int scale = 1; + + String blackBox = findBlackBoxFile(); + String url = buildHttpAddress(blackBox); + RawType dlData = HttpUtil.downloadData(url, null, false, -1); + if (dlData == null) { + return; + } + byte[] mapData = dlData.getBytes(); + + final int tileCount = mapData[32]; + int maxX = 0; + int maxY = 0; + int minX = 0x10000; + int minY = 0x10000; + int pixPos; + + for (int i = 0; i < tileCount; i++) { + pixPos = (mapData[52 + i * 16] & 0xFF) + (mapData[52 + 1 + i * 16] << 8); + int xPos = (pixPos % rowLength) * tileSize; + int yPos = (pixPos / rowLength) * tileSize; + if (xPos < minX) { + minX = xPos; + } + if (xPos > maxX) { + maxX = xPos; + } + if (yPos > maxY) { + maxY = yPos; + } + if (yPos < minY) { + minY = yPos; + } + } + + final int width = (tileSize + maxX - minX) * scale; + final int height = (tileSize + maxY - minY) * scale; + + BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + image.setRGB(j, i, 0xFFFFFF); + } + } + for (int i = 0; i < tileCount; i++) { + pixPos = (mapData[52 + i * 16] & 0xFF) + (mapData[52 + 1 + i * 16] << 8); + int xPos = ((pixPos % rowLength) * tileSize - minX) * scale; + int yPos = (maxY - (pixPos / rowLength) * tileSize) * scale; + int indexTab = 16044 + i * tileArea; + for (int j = 0; j < tileSize; j++) { + for (int k = 0; k < tileSize; k++) { + int p = 0xFFFFFF; + if ((mapData[indexTab] & 0xF0) != 0) { + p = 0xFF0000; + } else if (mapData[indexTab] != 0) { + p = 0xBFBFBF; + } + image.setRGB(xPos + k * scale, yPos + (9 - j) * scale, p); + indexTab++; + } + } + } + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + if (!ImageIO.write(image, "png", baos)) { + logger.debug("Couldn't find PNG writer."); + } + } catch (IOException e) { + logger.info("IOException creating PNG image.", e); + } + byte[] byteArray = baos.toByteArray(); + if (byteArray != null && byteArray.length > 0) { + currentMap = new RawType(byteArray, "image/png"); + } else { + currentMap = UnDefType.UNDEF; + } + } +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandlerFactory.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandlerFactory.java new file mode 100644 index 0000000000000..e306b805088dc --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/LGHomBotHandlerFactory.java @@ -0,0 +1,56 @@ +/** + * 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.lghombot.internal; + +import static org.openhab.binding.lghombot.internal.LGHomBotBindingConstants.THING_TYPE_LGHOMBOT; + +import java.util.Collections; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.osgi.service.component.annotations.Component; + +/** + * The {@link LGHomBotHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.lghombot", service = ThingHandlerFactory.class) +public class LGHomBotHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_LGHOMBOT); + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (THING_TYPE_LGHOMBOT.equals(thingTypeUID)) { + return new LGHomBotHandler(thing); + } + + return null; + } +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/discovery/LGHomBotDiscovery.java b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/discovery/LGHomBotDiscovery.java new file mode 100644 index 0000000000000..fefb90439747e --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/java/org/openhab/binding/lghombot/internal/discovery/LGHomBotDiscovery.java @@ -0,0 +1,288 @@ +/** + * 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.lghombot.internal.discovery; + +import java.io.IOException; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.net.CidrAddress; +import org.eclipse.smarthome.core.net.NetUtil; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.lghombot.internal.LGHomBotBindingConstants; +import org.openhab.binding.lghombot.internal.LGHomBotConfiguration; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Discovery class for the LG HomBot line. Right now we try to do http requests to all IPs on port 6260. + * If we get a connection and correct answer we set the IP as result. + * + * @author Fredrik Ahlström - Initial contribution + */ +@NonNullByDefault +@Component(service = { DiscoveryService.class, LGHomBotDiscovery.class }, configurationPid = "discovery.lghombot") +public class LGHomBotDiscovery extends AbstractDiscoveryService { + + private final Logger logger = LoggerFactory.getLogger(LGHomBotDiscovery.class); + + /** + * HTTP read timeout (in milliseconds) - allows us to shutdown the listening every TIMEOUT + */ + private static final int TIMEOUT_MS = 500; + + /** + * Timeout in seconds of the complete scan + */ + private static final int FULL_SCAN_TIMEOUT_SECONDS = 30; + + /** + * Total number of concurrent threads during scanning. + */ + private static final int SCAN_THREADS = 10; + + /** + * Whether we are currently scanning or not + */ + private boolean scanning; + + private int octet; + private int ipMask; + private int addressCount; + private @Nullable CidrAddress baseIp; + + /** + * The {@link ExecutorService} to run the listening threads on. + */ + private @Nullable ExecutorService executorService; + + /** + * Constructs the discovery class using the thing IDs that we can discover. + */ + public LGHomBotDiscovery() { + super(LGHomBotBindingConstants.SUPPORTED_THING_TYPES_UIDS, FULL_SCAN_TIMEOUT_SECONDS, false); + } + + private void setupBaseIp(CidrAddress adr) { + byte[] octets = adr.getAddress().getAddress(); + addressCount = (1 << (32 - adr.getPrefix())) - 2; + ipMask = 0xFFFFFFFF << (32 - adr.getPrefix()); + octets[0] &= ipMask >> 24; + octets[1] &= ipMask >> 16; + octets[2] &= ipMask >> 8; + octets[3] &= ipMask; + try { + InetAddress iAdr = InetAddress.getByAddress(octets); + baseIp = new CidrAddress(iAdr, (short) adr.getPrefix()); + } catch (UnknownHostException e) { + logger.debug("Could not build net ip address.", e); + } + octet = 0; + } + + private synchronized String getNextIPAddress(CidrAddress adr) { + octet++; + octet &= ~ipMask; + byte[] octets = adr.getAddress().getAddress(); + octets[2] += (octet >> 8); + octets[3] += octet; + String address = ""; + try { + InetAddress iAdr = null; + iAdr = InetAddress.getByAddress(octets); + address = iAdr.getHostAddress(); + } catch (UnknownHostException e) { + logger.debug("Could not find next ip address.", e); + } + return address; + } + + /** + * {@inheritDoc} + * + * Starts the scan. This discovery will: + * <ul> + * <li>Request this hosts first IPV4 address.</li> + * <li>Send a HTTP request on port 6260 to all IPs on the subnet.</li> + * <li>The response is then investigated to see if is an answer from a HomBot lg.srv</li> + * </ul> + * The process will continue until all addresses are checked, timeout or {@link #stopScan()} is called. + */ + @Override + protected void startScan() { + if (executorService != null) { + stopScan(); + } + + CidrAddress localAdr = getLocalIP4Address(); + if (localAdr == null) { + stopScan(); + return; + } + setupBaseIp(localAdr); + CidrAddress baseAdr = baseIp; + scanning = true; + ExecutorService localExecutorService = Executors.newFixedThreadPool(SCAN_THREADS); + executorService = localExecutorService; + for (int i = 0; i < addressCount; i++) { + + localExecutorService.execute(() -> { + if (scanning && baseAdr != null) { + String ipAdd = getNextIPAddress(baseAdr); + String url = "http://" + ipAdd + ":" + LGHomBotBindingConstants.DEFAULT_HOMBOT_PORT + "/status.txt"; + + try { + String message = HttpUtil.executeUrl("GET", url, TIMEOUT_MS); + if (message != null && !message.isEmpty()) { + messageReceive(message, ipAdd); + } + } catch (IOException e) { + // Ignore, this is the expected behavior. + } + } + + }); + } + } + + /** + * Tries to find valid IP4 address. + * + * @return An IP4 address or null if none is found. + */ + private @Nullable CidrAddress getLocalIP4Address() { + List<CidrAddress> adrList = NetUtil.getAllInterfaceAddresses().stream() + .filter(a -> a.getAddress() instanceof Inet4Address).collect(Collectors.toList()); + + for (CidrAddress adr : adrList) { + // Don't return a "fake" DHCP lease. + if (!adr.toString().startsWith("169.254.")) { + return adr; + } + } + return null; + } + + /** + * lgsrv message has the following format + * + * <pre> + * JSON_ROBOT_STATE="CHARGING" + * JSON_BATTPERC="100" + * LGSRV_VERSION="lg.srv, V2.51 compiled 18.11.2016, by fx2" + * LGSRV_SUMCMD="0" + * LGSRV_SUMCMDSEC="0.000000" + * LGSRV_NUMHTTP="929" + * LGSRV_MEMUSAGE="0.387 MB" + * CPU_IDLE="67.92" + * CPU_USER="19.49" + * CPU_SYS="12.57" + * CPU_NICE="0.00" + * JSON_TURBO="false" + * JSON_REPEAT="false" + * JSON_MODE="ZZ" + * JSON_VERSION="16552" + * JSON_NICKNAME="HOMBOT" + * CLREC_CURRENTBUMPING="29441" + * CLREC_LAST_CLEAN="2018/08/30/11/00/00.826531" + * </pre> + * + * First parse the first string to see that it's a HomBot, then parse nickname, server version & firmware version. + * We then create our thing from it. + * + * @param message a response from a lgsrv to be parsed + * @param ipAddress current probed ip address + */ + private void messageReceive(String message, String ipAddress) { + if (!message.startsWith("JSON_ROBOT_STATE=")) { + return; + } + + String model = "HomBot"; + String nickName = ""; + String srvVersion = "0"; + String fwVersion = "0"; + + for (String msg : message.split("\\r?\\n")) { + int idx = msg.indexOf('='); + if (idx > 0) { + String name = msg.substring(0, idx); + + if (name.equalsIgnoreCase("JSON_NICKNAME")) { + nickName = msg.substring(idx + 1).trim().replaceAll("\"", ""); + } else if (name.equalsIgnoreCase("JSON_VERSION")) { + fwVersion = msg.substring(idx + 1).trim().replaceAll("\"", ""); + } else if (name.equalsIgnoreCase("LGSRV_VERSION")) { + srvVersion = msg.substring(idx + 1).trim().replaceAll("\"", ""); + } + } + + } + + if (!ipAddress.isEmpty()) { + if (nickName.isEmpty()) { + nickName = "HOMBOT1"; + } + ThingTypeUID typeId = LGHomBotBindingConstants.THING_TYPE_LGHOMBOT; + ThingUID uid = new ThingUID(typeId, nickName); + + Map<String, Object> properties = new HashMap<>(3); + properties.put(LGHomBotConfiguration.IP_ADDRESS, ipAddress); + properties.put(Thing.PROPERTY_FIRMWARE_VERSION, fwVersion); + properties.put("server", srvVersion); + DiscoveryResult result = DiscoveryResultBuilder.create(uid).withProperties(properties) + .withLabel(model + " (" + nickName + ")").build(); + thingDiscovered(result); + } + } + + /** + * {@inheritDoc} + * + * Stops the discovery scan. We set {@link #scanning} to false (allowing the listening threads to end naturally + * within {@link #TIMEOUT_MS) * {@link #SCAN_THREADS} time then shutdown the {@link #executorService} + */ + @Override + protected synchronized void stopScan() { + super.stopScan(); + ExecutorService localExecutorService = executorService; + if (localExecutorService != null) { + scanning = false; + try { + localExecutorService.awaitTermination(TIMEOUT_MS * SCAN_THREADS, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + logger.debug("Stop scan interrupted.", e); + } + localExecutorService.shutdown(); + executorService = null; + } + } +} diff --git a/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..e64db94377007 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="lghombot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>LG HomBot Binding</name> + <description>The LG HomBot binding allows control and supervision of your HomBot.</description> + <author>Fredrik Ahlström</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_en.properties b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_en.properties new file mode 100644 index 0000000000000..84b83271b383d --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_en.properties @@ -0,0 +1,85 @@ +# binding +binding.lghombot.name = LG HomBot Binding +binding.lghombot.description = The LG HomBot binding allows control and supervision of your HomBot. + +# thing types +thing-type.lghombot.LGHomBot.label = LG HomBot +thing-type.lghombot.LGHomBot.description = HomBot vacuum robot + +# thing type configuration +thing-type.config.lghombot.LGHomBot.ipAddress.label = Network Address +thing-type.config.lghombot.LGHomBot.ipAddress.description = The IP or host name of the HomBot. +thing-type.config.lghombot.LGHomBot.port.label = Port +thing-type.config.lghombot.LGHomBot.port.description = Port of the HomBot to control. +thing-type.config.lghombot.LGHomBot.pollingPeriod.label = Polling Period +thing-type.config.lghombot.LGHomBot.pollingPeriod.description = Time between polls in seconds. + +# channel types +channel-type.lghombot.stateType.label = State +channel-type.lghombot.stateType.description = Current state. +channel-type.lghombot.stateType.state.option.UNKNOWN = Unknown +channel-type.lghombot.stateType.state.option.WORKING = Cleaning +channel-type.lghombot.stateType.state.option.BACKMOVING = Backmoving +channel-type.lghombot.stateType.state.option.BACKMOVING_INIT = Backmoving init +channel-type.lghombot.stateType.state.option.BACKMOVING_JOY = Backmoving joy +channel-type.lghombot.stateType.state.option.PAUSE = Paused +channel-type.lghombot.stateType.state.option.STANDBY = Standby +channel-type.lghombot.stateType.state.option.HOMING = Homing +channel-type.lghombot.stateType.state.option.DOCKING = Docking +channel-type.lghombot.stateType.state.option.CHARGING = Charging +channel-type.lghombot.stateType.state.option.DIAGNOSIS = Running diagnosis +channel-type.lghombot.stateType.state.option.RESERVATION = Changing settings +channel-type.lghombot.stateType.state.option.ERROR = Error + +channel-type.lghombot.batteryType.label = Battery +channel-type.lghombot.batteryType.description = Current battery charge + +channel-type.lghombot.cpuLoadType.label = CPU Load +channel-type.lghombot.cpuLoadType.description = Current CPU load +channel-type.lghombot.srvMemType.label = Used Memory +channel-type.lghombot.srvMemType.description = Memory used by webserver on HomBot. +channel-type.lghombot.cleanType.label = Clean +channel-type.lghombot.cleanType.description = Start cleaning / return home. +channel-type.lghombot.startType.label = Start +channel-type.lghombot.startType.description = Start cleaning. +channel-type.lghombot.homeType.label = Home +channel-type.lghombot.homeType.description = Return home. +channel-type.lghombot.stopType.label = Pause +channel-type.lghombot.stopType.description = Pause the HomBot. +channel-type.lghombot.turboType.label = Turbo +channel-type.lghombot.turboType.description = Turbo mode ON, OFF. +channel-type.lghombot.repeatType.label = Repeat +channel-type.lghombot.repeatType.description = Repeat cleaning ON, OFF. + +channel-type.lghombot.modeType.label = Mode +channel-type.lghombot.modeType.description = Cleaning mode. +channel-type.lghombot.modeType.state.option.ZZ = Zigzag mode +channel-type.lghombot.modeType.state.option.SB = Cell by cell mode +channel-type.lghombot.modeType.state.option.SPOT = Spiral spot mode +channel-type.lghombot.modeType.state.option.MACRO_SECTOR = My space mode + +channel-type.lghombot.nicknameType.label = Nickname +channel-type.lghombot.nicknameType.description = Nickname of the HomBot. +channel-type.lghombot.moveType.label = Move +channel-type.lghombot.moveType.description = Move direction. +channel-type.lghombot.cameraType.label = Camera +channel-type.lghombot.cameraType.description = Image feed from the top camera. +channel-type.lghombot.lastCleanType.label = Last Clean +channel-type.lghombot.lastCleanType.description = Last time the HomBot cleaned. +channel-type.lghombot.mapType.label = Map +channel-type.lghombot.mapType.description = Map of last cleaned area. + +channel-type.lghombot.mondayType.label = Monday +channel-type.lghombot.mondayType.description = Scheduled start time on Monday. +channel-type.lghombot.tuesdayType.label = Tuesday +channel-type.lghombot.tuesdayType.description = Scheduled start time on Tuesday. +channel-type.lghombot.wednesdayType.label = Wednesday +channel-type.lghombot.wednesdayType.description = Scheduled start time on Wednesday. +channel-type.lghombot.thursdayType.label = Thursday +channel-type.lghombot.thursdayType.description = Scheduled start time on Thursday. +channel-type.lghombot.fridayType.label = Friday +channel-type.lghombot.fridayType.description = Scheduled start time on Friday. +channel-type.lghombot.saturdayType.label = Saturday +channel-type.lghombot.saturdayType.description = Scheduled start time on Saturday. +channel-type.lghombot.sundayType.label = Sunday +channel-type.lghombot.sundayType.description = Scheduled start time on Sunday. diff --git a/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_sv.properties b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_sv.properties new file mode 100644 index 0000000000000..a38ceaa2931a4 --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/i18n/lghombot_sv.properties @@ -0,0 +1,86 @@ + +# binding +binding.lghombot.name = LG HomBot Binding +binding.lghombot.description = LG HomBot binding tillåter kontrol och övervakning av din HomBot. + +# thing types +thing-type.lghombot.LGHomBot.label = LG HomBot +thing-type.lghombot.LGHomBot.description = HomBot Robotdamsugare + +# thing type configuration +thing-type.config.lghombot.LGHomBot.ipAddress.label = Nätverksdress +thing-type.config.lghombot.LGHomBot.ipAddress.description = IP-adress eller namn på HomBot. +thing-type.config.lghombot.LGHomBot.port.label = Port +thing-type.config.lghombot.LGHomBot.port.description = Nätverksport på HomBot. +thing-type.config.lghombot.LGHomBot.pollingPeriod.label = Pollningsperiod +thing-type.config.lghombot.LGHomBot.pollingPeriod.description = Tid mellan pollningar i sekunder. + +# channel types +channel-type.lghombot.stateType.label = Status +channel-type.lghombot.stateType.description = Nuvarande status. +channel-type.lghombot.stateType.state.option.UNKNOWN = Okänd +channel-type.lghombot.stateType.state.option.WORKING = Städar +channel-type.lghombot.stateType.state.option.BACKMOVING = Backar +channel-type.lghombot.stateType.state.option.BACKMOVING_INIT = Startar backning +channel-type.lghombot.stateType.state.option.BACKMOVING_JOY = Backar ur +channel-type.lghombot.stateType.state.option.PAUSE = Pausad +channel-type.lghombot.stateType.state.option.STANDBY = Väntar +channel-type.lghombot.stateType.state.option.HOMING = Åker hemåt +channel-type.lghombot.stateType.state.option.DOCKING = Dockar +channel-type.lghombot.stateType.state.option.CHARGING = Laddar +channel-type.lghombot.stateType.state.option.DIAGNOSIS = Kör diagnos +channel-type.lghombot.stateType.state.option.RESERVATION = Gör inställning +channel-type.lghombot.stateType.state.option.ERROR = Fel + +channel-type.lghombot.batteryType.label = Batteri +channel-type.lghombot.batteryType.description = Nuvarande batteriladdning. + +channel-type.lghombot.cpuLoadType.label = CPU belastning +channel-type.lghombot.cpuLoadType.description = Nuvarande CPU belastning. +channel-type.lghombot.srvMemType.label = Använt minne +channel-type.lghombot.srvMemType.description = Minne använt av webserver på HomBot. +channel-type.lghombot.cleanType.label = Städa +channel-type.lghombot.cleanType.description = Börja städa / återvänd hem. +channel-type.lghombot.startType.label = Starta +channel-type.lghombot.startType.description = Börja städa. +channel-type.lghombot.homeType.label = Hemåt +channel-type.lghombot.homeType.description = Återvänd hem. +channel-type.lghombot.stopType.label = Paus +channel-type.lghombot.stopType.description = Pausa HomBot. +channel-type.lghombot.turboType.label = Turbo +channel-type.lghombot.turboType.description = Turbo läge AV, PÅ. +channel-type.lghombot.repeatType.label = Återupprepa +channel-type.lghombot.repeatType.description = Återupprepande städning AV, PÅ. + +channel-type.lghombot.modeType.label = Städläge +channel-type.lghombot.modeType.description = Städläge. +channel-type.lghombot.modeType.state.option.ZZ = Sicksack läge +channel-type.lghombot.modeType.state.option.SB = Cell vid cell läge +channel-type.lghombot.modeType.state.option.SPOT = Punktspiral läge +channel-type.lghombot.modeType.state.option.MACRO_SECTOR = Mitt utrymme läge + +channel-type.lghombot.nicknameType.label = Smeknamn +channel-type.lghombot.nicknameType.description = Smeknamn på HomBot. +channel-type.lghombot.moveType.label = Styr +channel-type.lghombot.moveType.description = Styr riktning. +channel-type.lghombot.cameraType.label = Kamera +channel-type.lghombot.cameraType.description = Bild från toppkameran. +channel-type.lghombot.lastCleanType.label = Senaste städning +channel-type.lghombot.lastCleanType.description = Senaste tillfälle som HomBot städade. +channel-type.lghombot.mapType.label = Karta +channel-type.lghombot.mapType.description = Karta över senaste städade arean. + +channel-type.lghombot.mondayType.label = Måndag +channel-type.lghombot.mondayType.description = Schemalagd tid på Måndag. +channel-type.lghombot.tuesdayType.label = Tisdag +channel-type.lghombot.tuesdayType.description = Schemalagd tid på Tisdag. +channel-type.lghombot.wednesdayType.label = Onsdag +channel-type.lghombot.wednesdayType.description = Schemalagd tid på Onsdag. +channel-type.lghombot.thursdayType.label = Torsdag +channel-type.lghombot.thursdayType.description = Schemalagd tid på Torsdag. +channel-type.lghombot.fridayType.label = Fredag +channel-type.lghombot.fridayType.description = Schemalagd tid på Fredag. +channel-type.lghombot.saturdayType.label = Lördag +channel-type.lghombot.saturdayType.description = Schemalagd tid på Lördag. +channel-type.lghombot.sundayType.label = Söndag +channel-type.lghombot.sundayType.description = Schemalagd tid på Söndag. diff --git a/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..219713a7d6e7a --- /dev/null +++ b/bundles/org.openhab.binding.lghombot/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,238 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="lghombot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="LGHomBot"> + <label>LG HomBot</label> + <description>HomBot vacuum robot.</description> + <category>CleaningRobot</category> + + <channels> + <channel id="state" typeId="stateType" /> + <channel id="battery" typeId="batteryType" /> + <channel id="cpuLoad" typeId="cpuLoadType" /> + <channel id="srvMem" typeId="srvMemType" /> + <channel id="clean" typeId="cleanType" /> + <channel id="start" typeId="startType" /> + <channel id="home" typeId="homeType" /> + <channel id="pause" typeId="pauseType" /> + <channel id="turbo" typeId="turboType" /> + <channel id="repeat" typeId="repeatType" /> + <channel id="mode" typeId="modeType" /> + <channel id="nickname" typeId="nicknameType" /> + <channel id="move" typeId="moveType" /> + <channel id="camera" typeId="cameraType" /> + <channel id="lastClean" typeId="lastCleanType" /> + <channel id="map" typeId="mapType" /> + <channel id="monday" typeId="mondayType" /> + <channel id="tuesday" typeId="tuesdayType" /> + <channel id="wednesday" typeId="wednesdayType" /> + <channel id="thursday" typeId="thursdayType" /> + <channel id="friday" typeId="fridayType" /> + <channel id="saturday" typeId="saturdayType" /> + <channel id="sunday" typeId="sundayType" /> + </channels> + + <properties> + <property name="vendor">LG</property> + <property name="modelId">HomBot</property> + </properties> + <representation-property>deviceId</representation-property> + + <config-description> + <parameter name="ipAddress" type="text" required="true"> + <label>Network Address</label> + <description>The IP or host name of the HomBot.</description> + <context>network-address</context> + </parameter> + <parameter name="port" type="integer" min="1000" max="65535"> + <label>Port</label> + <description>Port of the HomBot to control.</description> + <default>6260</default> + <advanced>true</advanced> + </parameter> + <parameter name="pollingPeriod" type="integer" min="1" max="60" unit="s"> + <label>Polling Period</label> + <description>Time between polls in seconds.</description> + <default>3</default> + <advanced>true</advanced> + </parameter> + </config-description> + + </thing-type> + + <channel-type id="stateType"> + <item-type>String</item-type> + <label>State</label> + <description>Current state.</description> + <state pattern="%s" readOnly="true"> + <options> + <option value="UNKNOWN">Unknown</option> + <option value="WORKING">Cleaning</option> + <option value="BACKMOVING">Backmoving</option> + <option value="BACKMOVING_INIT">Backmoving init</option> + <option value="BACKMOVING_JOY">Backmoving joy</option> + <option value="PAUSE">Pause</option> + <option value="STANDBY">Standby</option> + <option value="HOMING">Homing</option> + <option value="DOCKING">Docking</option> + <option value="CHARGING">Charging</option> + <option value="DIAGNOSIS">Running diagnosis</option> + <option value="RESERVATION">Changing settings</option> + <option value="ERROR">Error</option> + </options> + </state> + </channel-type> + <channel-type id="batteryType"> + <item-type>Number</item-type> + <label>Battery</label> + <description>Current battery charge.</description> + <category>BatteryLevel</category> + <state pattern="%d%%" readOnly="true" /> + </channel-type> + <channel-type id="cpuLoadType" advanced="true"> + <item-type>Number</item-type> + <label>CPU Load</label> + <description>Current CPU load.</description> + <state pattern="%d%%" readOnly="true" /> + </channel-type> + <channel-type id="srvMemType" advanced="true"> + <item-type>String</item-type> + <label>Used Memory</label> + <description>Memory used by webserver on HomBot.</description> + <state pattern="%s" readOnly="true" /> + </channel-type> + <channel-type id="cleanType"> + <item-type>Switch</item-type> + <label>Clean</label> + <description>Start cleaning / return home.</description> + <tags> + <tag>Switchable</tag> + </tags> + </channel-type> + <channel-type id="startType"> + <item-type>Switch</item-type> + <label>Start</label> + <description>Start cleaning.</description> + </channel-type> + <channel-type id="homeType"> + <item-type>Switch</item-type> + <label>Home</label> + <description>Return home.</description> + </channel-type> + <channel-type id="pauseType" advanced="true"> + <item-type>Switch</item-type> + <label>Pause</label> + <description>Pause the HomBot.</description> + </channel-type> + <channel-type id="turboType"> + <item-type>Switch</item-type> + <label>Turbo</label> + <description>Turbo mode ON, OFF.</description> + </channel-type> + <channel-type id="repeatType"> + <item-type>Switch</item-type> + <label>Repeat</label> + <description>Repeat cleaning ON, OFF.</description> + </channel-type> + <channel-type id="modeType"> + <item-type>String</item-type> + <label>Mode</label> + <description>Cleaning mode.</description> + <state> + <options> + <option value="ZZ">Zigzag mode</option> + <option value="SB">Cell by cell mode</option> + <option value="SPOT">Spiral spot mode</option> + <option value="MACRO_SECTOR">My space mode</option> + </options> + </state> + </channel-type> + <channel-type id="nicknameType"> + <item-type>String</item-type> + <label>Nickname</label> + <description>Nickname of the HomBot.</description> + <state pattern="%s" readOnly="true" /> + </channel-type> + <channel-type id="moveType" advanced="true"> + <item-type>String</item-type> + <label>Move</label> + <description>Move direction.</description> + <category>MoveControl</category> + <state> + <options> + <option value="FORWARD">Forward</option> + <option value="FORWARD_LEFT">Forward left</option> + <option value="FORWARD_RIGHT">Forward right</option> + <option value="LEFT">Left</option> + <option value="RIGHT">Right</option> + <option value="BACKWARD">Backward</option> + <option value="BACKWARD_LEFT">Backward left</option> + <option value="BACKWARD_RIGHT">Backward right</option> + <option value="RELEASE">Release</option> + </options> + </state> + </channel-type> + <channel-type id="cameraType"> + <item-type>Image</item-type> + <label>Camera</label> + <description>Image feed from the top camera.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="lastCleanType"> + <item-type>DateTime</item-type> + <label>Last Clean</label> + <description>Last time the HomBot cleaned.</description> + <state pattern="%1$tF %1$tR" readOnly="true" /> + </channel-type> + <channel-type id="mapType" advanced="true"> + <item-type>Image</item-type> + <label>Cleaning map</label> + <description>Map of last cleaned area.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="mondayType" advanced="true"> + <item-type>String</item-type> + <label>Monday</label> + <description>Scheduled start time on Monday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="tuesdayType" advanced="true"> + <item-type>String</item-type> + <label>Tuesday</label> + <description>Scheduled start time on Tuesday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="wednesdayType" advanced="true"> + <item-type>String</item-type> + <label>Wednesday</label> + <description>Scheduled start time on Wednesday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="thursdayType" advanced="true"> + <item-type>String</item-type> + <label>Thursday</label> + <description>Scheduled start time on Thursday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="fridayType" advanced="true"> + <item-type>String</item-type> + <label>Friday</label> + <description>Scheduled start time on Friday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="saturdayType" advanced="true"> + <item-type>String</item-type> + <label>Saturday</label> + <description>Scheduled start time on Saturday.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="sundayType" advanced="true"> + <item-type>String</item-type> + <label>Sunday</label> + <description>Scheduled start time on Sunday.</description> + <state readOnly="true" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.lgtvserial/NOTICE b/bundles/org.openhab.binding.lgtvserial/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.lgtvserial/NOTICE +++ b/bundles/org.openhab.binding.lgtvserial/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.lgtvserial/README.md b/bundles/org.openhab.binding.lgtvserial/README.md index 7fba44d2f75af..4f9e5a541e520 100644 --- a/bundles/org.openhab.binding.lgtvserial/README.md +++ b/bundles/org.openhab.binding.lgtvserial/README.md @@ -17,8 +17,8 @@ The serial port may be marked "Service only". Tested and developed with : -- LG 55UF772V (with [this cable adapter](http://www.ebay.com/itm/DB9-9-Pin-Female-To-TRS-3-5mm-Male-Stereo-Serial-Data-Converter-Cable-1-8M-6Ft-/291541959764?)). -- LG 47LK520 with a [serial hat](https://www.buyapi.ca/product/serial-hat-rs232/) on a raspberry pi +- LG 55UF772V (with [this cable adapter](https://www.ebay.com/itm/DB9-9-Pin-Female-To-TRS-3-5mm-Male-Stereo-Serial-Data-Converter-Cable-1-8M-6Ft-/291541959764?)). +- LG 47LK520 with a [serial hat](https://www.buyapi.ca/product/serial-hat-rs232/) on a Raspberry Pi ## Discovery diff --git a/bundles/org.openhab.binding.lgtvserial/pom.xml b/bundles/org.openhab.binding.lgtvserial/pom.xml index 59c61df956efc..fea1547e3110c 100644 --- a/bundles/org.openhab.binding.lgtvserial/pom.xml +++ b/bundles/org.openhab.binding.lgtvserial/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lgtvserial</artifactId> diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/feature/feature.xml b/bundles/org.openhab.binding.lgtvserial/src/main/feature/feature.xml index 81aa51961a128..d27108dd3b076 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lgtvserial/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lgtvserial-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lgtvserial" description="LG TV Serial Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialBindingConstants.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialBindingConstants.java index 7236e89d49b24..9517c04e8aac3 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialBindingConstants.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialHandlerFactory.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialHandlerFactory.java index 72a97f8500fbe..3ece422c80877 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialHandlerFactory.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/LgTvSerialHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/handler/LgTvSerialHandler.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/handler/LgTvSerialHandler.java index 369909e362b91..2fe4b3559544b 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/handler/LgTvSerialHandler.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/handler/LgTvSerialHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommand.java index 2a788e5dd18fc..d3a5dde447f02 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommunicator.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommunicator.java index 39ddacd08da85..97747ef9a27b8 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommunicator.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponse.java index 56fdbc308a878..579ae7a3c29ff 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponseListener.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponseListener.java index 12269fed20d9b..a0611fe50fd31 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponseListener.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/LGSerialResponseListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/RegistrationCallback.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/RegistrationCallback.java index df32d92583e72..17c1ca385d603 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/RegistrationCallback.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/RegistrationCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/SerialCommunicatorFactory.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/SerialCommunicatorFactory.java index decc023b40157..e3a909e7e86a6 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/SerialCommunicatorFactory.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/SerialCommunicatorFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AspectRatioCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AspectRatioCommand.java index 4550a73f3818f..1dafeef0f0a10 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AspectRatioCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AspectRatioCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoSleepCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoSleepCommand.java index 0aa0f001e8c1d..0b57cb80556ef 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoSleepCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoSleepCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoVolumeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoVolumeCommand.java index 94765a90dccb6..936031ee067aa 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoVolumeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/AutoVolumeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BacklightCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BacklightCommand.java index f3dbbef351825..8484ef09f87d4 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BacklightCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BacklightCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BalanceCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BalanceCommand.java index cad6a497ee835..bcf69a007c3ec 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BalanceCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BalanceCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseDecimalCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseDecimalCommand.java index 54fe53abf7a61..d42ebac752962 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseDecimalCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseDecimalCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseLGSerialCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseLGSerialCommand.java index 8f6fd86ed606a..edecef65d272d 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseLGSerialCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseLGSerialCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseOnOffCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseOnOffCommand.java index a8f2da9c86c08..bbe448e297c2d 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseOnOffCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseOnOffCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BasePercentCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BasePercentCommand.java index 82e21a1d18a69..03710ce5c871c 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BasePercentCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BasePercentCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseStringCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseStringCommand.java index dcdebe0b7c504..f515822f5e8b1 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseStringCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BaseStringCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BassCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BassCommand.java index 1e4dfc12aabf7..0d78ec3b2d2e9 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BassCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BassCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BrightnessCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BrightnessCommand.java index 76bcdf44a5f2e..0e8933e51c42c 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BrightnessCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/BrightnessCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorCommand.java index 7b369d7a1771c..005d4786a2c44 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperature2Command.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperature2Command.java index 33e399f3a9808..403f3cf2028ac 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperature2Command.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperature2Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperatureCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperatureCommand.java index 451066792cfb0..8e8cb2c9f044a 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperatureCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ColorTemperatureCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/CommandFactory.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/CommandFactory.java index ff9c449720bdf..0c7b87d799762 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/CommandFactory.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/CommandFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ContrastCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ContrastCommand.java index b34a61ca914a6..db530e53e4b85 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ContrastCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ContrastCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/DPMCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/DPMCommand.java index 737aa294c2e52..2cad10de3f974 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/DPMCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/DPMCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ElapsedTimeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ElapsedTimeCommand.java index 358c8b8184f41..0f1e2d75c0330 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ElapsedTimeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ElapsedTimeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/EnergySavingCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/EnergySavingCommand.java index 2285754229a14..567404a6466fd 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/EnergySavingCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/EnergySavingCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/FanFaultCheckCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/FanFaultCheckCommand.java index c8526a815a5ea..dcceec6760382 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/FanFaultCheckCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/FanFaultCheckCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HPositionCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HPositionCommand.java index 419e0d5832845..4a000f223c22e 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HPositionCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HPositionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HSizeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HSizeCommand.java index b91a1175f5225..1acbdb94ade91 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HSizeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/HSizeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/IRKeyCodeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/IRKeyCodeCommand.java index 03027d8929102..d3245e2bfa4a4 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/IRKeyCodeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/IRKeyCodeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ISMMethodCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ISMMethodCommand.java index f0b42510377d1..65e185de4512f 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ISMMethodCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ISMMethodCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelect2Command.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelect2Command.java index 4f557ed0067bd..c14b725b3a90d 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelect2Command.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelect2Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelectCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelectCommand.java index d66f35e2a1a19..d9eada0acd814 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelectCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/InputSelectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DCommand.java index 37512b3217385..b8eeae1556fae 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DExtendedCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DExtendedCommand.java index 980aba2654aca..b8e8d2f49510c 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DExtendedCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LG3DExtendedCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LampFaultCheckCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LampFaultCheckCommand.java index acba8e949364b..81d7a8d2f453a 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LampFaultCheckCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/LampFaultCheckCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/NaturalModeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/NaturalModeCommand.java index fb661670270a0..5ec26c18cc142 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/NaturalModeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/NaturalModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDLanguageCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDLanguageCommand.java index 21cca709aad10..8272fa64e0c19 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDLanguageCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDLanguageCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDSelectCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDSelectCommand.java index b6084bfcb78e1..2ad062bf09029 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDSelectCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/OSDSelectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PictureModeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PictureModeCommand.java index 95f661f6b1388..6bd86e7e9dff6 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PictureModeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PictureModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerCommand.java index ae325d8c2d71d..95c8033908bd1 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerIndicatorCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerIndicatorCommand.java index 1219b39d234d8..9f6ed48a22720 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerIndicatorCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerIndicatorCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerSavingCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerSavingCommand.java index 5e462349d3a0a..e6540dbea9633 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerSavingCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/PowerSavingCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/RawCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/RawCommand.java index 786565b677a7e..42fa344a42ff0 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/RawCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/RawCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ScreenMuteCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ScreenMuteCommand.java index 395632f153592..5bd48cb28d8ca 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ScreenMuteCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/ScreenMuteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SerialNoCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SerialNoCommand.java index f84a6b76ee46b..874e0b9b3d046 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SerialNoCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SerialNoCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SharpnessCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SharpnessCommand.java index 7c2e1b0e60174..2858691de3166 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SharpnessCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SharpnessCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SleepTimeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SleepTimeCommand.java index 0d7e46434808a..25d681cac68d1 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SleepTimeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SleepTimeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoftwareVersionCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoftwareVersionCommand.java index 7d44a9904cd39..8571daadf2bc7 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoftwareVersionCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoftwareVersionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoundModeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoundModeCommand.java index ff13ee54ea6ab..e98566d92b186 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoundModeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SoundModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SpeakerCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SpeakerCommand.java index 6198938b1e621..a86267d9062c1 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SpeakerCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/SpeakerCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TemperatureValueCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TemperatureValueCommand.java index 0e729968b3ca6..89178e218d872 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TemperatureValueCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TemperatureValueCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileCommand.java index a8318321b132b..88d977db51212 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHPositionCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHPositionCommand.java index 5d152de46e950..4a915e089545c 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHPositionCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHPositionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHSizeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHSizeCommand.java index 522dca755cbe2..86f6f0debf929 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHSizeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileHSizeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileIdSetCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileIdSetCommand.java index 003dd153a3961..0dc23840225b4 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileIdSetCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileIdSetCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVPositionCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVPositionCommand.java index 395989ab06813..3561d240e048a 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVPositionCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVPositionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVSizeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVSizeCommand.java index bd2217e9c7cd7..36dc668c41fe0 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVSizeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TileVSizeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TimeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TimeCommand.java index acad1df530eb8..c57c0bdfcf16c 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TimeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TimeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TintCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TintCommand.java index 1f8688cccf428..2fabb093f5828 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TintCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TintCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TrebleCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TrebleCommand.java index 8a8704b5e0f35..f8bcf91fb791a 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TrebleCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/TrebleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VPositionCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VPositionCommand.java index f05cffba79632..e9e6c089cc62e 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VPositionCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VPositionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VSizeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VSizeCommand.java index b81e252cb5276..9342c80f10615 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VSizeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VSizeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeCommand.java index db7df63d23db9..12371dd737667 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeMuteCommand.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeMuteCommand.java index ad34a3a59210b..eef7c46e339d1 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeMuteCommand.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/commands/VolumeMuteCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/DecimalResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/DecimalResponse.java index 974086f37fcb0..0463b94133659 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/DecimalResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/DecimalResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/OnOffResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/OnOffResponse.java index 290a6a98c4ef6..85e6089d0192b 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/OnOffResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/OnOffResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/PercentResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/PercentResponse.java index b335e52a0c48b..dfee61e49c147 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/PercentResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/PercentResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/QuantityResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/QuantityResponse.java index 45176d58c7ba5..0f4577dbaf90d 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/QuantityResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/QuantityResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/StringResponse.java b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/StringResponse.java index 679ddcf665dbf..7a331f399035f 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/StringResponse.java +++ b/bundles/org.openhab.binding.lgtvserial/src/main/java/org/openhab/binding/lgtvserial/internal/protocol/serial/responses/StringResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/config/config.xml index 055fd35f845a5..9559f78f602b3 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/config/config.xml @@ -6,7 +6,7 @@ <config-description uri="thing-type:lgtvserial:serial"> <parameter name="port" type="text"> <context>serial-port</context> - <label>Serial port</label> + <label>Serial Port</label> <description>Select serial port (COM1, /dev/ttyS0, ...)</description> <required>true</required> <default>/dev/ttyS0</default> diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-channels.xml b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-channels.xml index c567394895ed9..984e2c728bf8f 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-channels.xml +++ b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-channels.xml @@ -12,13 +12,13 @@ <channel-type id="3d-extended"> <item-type>String</item-type> - <label>3d extended</label> + <label>3d Extended</label> <description>Change the 3d option, if your TV supports it</description> </channel-type> <channel-type id="aspect-ratio"> <item-type>String</item-type> - <label>Aspect ratio</label> + <label>Aspect Ratio</label> <description>Adjust the screen format</description> <state> <options> @@ -49,13 +49,13 @@ <channel-type id="auto-sleep"> <item-type>Switch</item-type> - <label>Auto sleep</label> + <label>Auto Sleep</label> <description>Set Auto Sleep</description> </channel-type> <channel-type id="auto-volume"> <item-type>Switch</item-type> - <label>Auto volume</label> + <label>Auto Volume</label> <description>Automatically adjust the volume level</description> </channel-type> @@ -97,7 +97,7 @@ <channel-type id="color-temperature"> <item-type>String</item-type> - <label>Color temperature</label> + <label>Color Temperature</label> <description>Color temperature of the display</description> <state> <options> @@ -110,7 +110,7 @@ <channel-type id="color-temperature2"> <item-type>Dimmer</item-type> - <label>Color temperature</label> + <label>Color Temperature</label> <description>Color temperature of the display (between 0 and 100)</description> </channel-type> @@ -122,7 +122,7 @@ <channel-type id="elapsed-time"> <item-type>String</item-type> - <label>Elapsed time</label> + <label>Elapsed Time</label> <description>Read the elapsed time</description> </channel-type> @@ -144,7 +144,7 @@ <channel-type id="fan-fault-check"> <item-type>String</item-type> - <label>Fan fault</label> + <label>Fan Fault</label> <description>Check the fan fault of the TV</description> <state readOnly="true"> <options> @@ -288,7 +288,7 @@ <channel-type id="lamp-fault-check"> <item-type>String</item-type> - <label>Lamp fault</label> + <label>Lamp Fault</label> <description>Check the lamp fault of the TV</description> <state readOnly="true"> <options> @@ -300,7 +300,7 @@ <channel-type id="natural-mode"> <item-type>Switch</item-type> - <label>Natural mode</label> + <label>Natural Mode</label> <description>To assign the Tile Natural mode for Tiling function</description> </channel-type> @@ -332,7 +332,7 @@ <channel-type id="picture-mode"> <item-type>String</item-type> - <label>Picture mode</label> + <label>Picture Mode</label> <description>To adjust picture mode</description> <state> <options> @@ -355,13 +355,13 @@ <channel-type id="power-indicator"> <item-type>Switch</item-type> - <label>Power indicator</label> + <label>Power Indicator</label> <description>To set the LED for Power Indicator</description> </channel-type> <channel-type id="power-saving"> <item-type>String</item-type> - <label>Power saving</label> + <label>Power Saving</label> <description>Set the Power saving mode</description> <state> <options> @@ -381,7 +381,7 @@ <channel-type id="screen-mute"> <item-type>String</item-type> - <label>Screen mute</label> + <label>Screen Mute</label> <description>Select screen mute on/off</description> <state> <options> @@ -394,7 +394,7 @@ <channel-type id="serial-number"> <item-type>String</item-type> - <label>Serial number</label> + <label>Serial Number</label> <description>Read the serial numbers</description> <state readOnly="true" /> </channel-type> @@ -408,7 +408,7 @@ <!-- Definition of the M6503C definition as this is the only one we've seen so far --> <channel-type id="sleep-time"> <item-type>String</item-type> - <label>Sleep time</label> + <label>Sleep Time</label> <description>Set sleep time</description> <state> <options> @@ -428,7 +428,7 @@ <!-- Definition of the M6503C definition as this is the only one we've seen so far --> <channel-type id="sound-mode"> <item-type>String</item-type> - <label>Sound mode</label> + <label>Sound Mode</label> <description>To adjust sound mode</description> <state> <options> @@ -445,7 +445,7 @@ <channel-type id="software-version"> <item-type>String</item-type> - <label>Software version</label> + <label>Software Version</label> <description>Check the software version</description> <state readOnly="true" /> </channel-type> @@ -459,7 +459,7 @@ <!-- Definition of the M6503C definition as this is the only one we've seen so far --> <channel-type id="temperature-value"> <item-type>Number:Temperature</item-type> - <label>Temperature value</label> + <label>Temperature Value</label> <description>Read the inside temperature value</description> <state readOnly="true" pattern="%.1f %unit%" /> </channel-type> @@ -467,7 +467,7 @@ <!-- Definition of the M6503C definition as this is the only one we've seen so far --> <channel-type id="tile"> <item-type>String</item-type> - <label>Tile mode</label> + <label>Tile Mode</label> <description>Change a tile mode</description> <state> <options> @@ -503,13 +503,13 @@ <channel-type id="tile-h-position"> <item-type>Dimmer</item-type> - <label>Horizontal position</label> + <label>Horizontal Position</label> <description>Set the horizontal position</description> </channel-type> <channel-type id="tile-h-size"> <item-type>Dimmer</item-type> - <label>Horizontal size</label> + <label>Horizontal Size</label> <description>Set the horizontal size</description> </channel-type> @@ -523,13 +523,13 @@ <channel-type id="tile-v-position"> <item-type>Dimmer</item-type> - <label>Vertical position</label> + <label>Vertical Position</label> <description>Set the vertical position</description> </channel-type> <channel-type id="tile-v-size"> <item-type>Dimmer</item-type> - <label>Vertical size</label> + <label>Vertical Size</label> <description>Set the vertical size</description> </channel-type> diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-M6503C.xml b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-M6503C.xml index c0c277481bced..92afce5d0c255 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-M6503C.xml +++ b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-M6503C.xml @@ -6,7 +6,7 @@ <!-- Unimplemented so far : Abnormal state, Remote lock, Auto configure, command 36,37,38,39,42 (timers), reset, 52 scheduling input select --> <thing-type id="lgtv-M6503C"> - <label>M6503C model</label> + <label>M6503C Model</label> <description><![CDATA[This thing supports the M6503C LG TV]]></description> <channels> @@ -68,7 +68,7 @@ <channel-type id="aspect-ratio-M6503C"> <item-type>String</item-type> - <label>Aspect ratio</label> + <label>Aspect Ratio</label> <description>Adjust the screen format</description> <state> <options> diff --git a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-SAC34134216.xml b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-SAC34134216.xml index 29c274242ead5..2916c00ffedb8 100644 --- a/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-SAC34134216.xml +++ b/bundles/org.openhab.binding.lgtvserial/src/main/resources/ESH-INF/thing/thing-types-SAC34134216.xml @@ -9,7 +9,7 @@ <!-- These things supports the LG TV models from the document with P/NO : SAC34134216 --> <thing-type id="lgtv-LV-series"> - <label>LV/LW series</label> + <label>LV/LW Series</label> <description><![CDATA[This thing supports the LED LCD TV models <size>LV<type> and <size>LW<type> except *LV255C, *LV355B, *LV355C models]]></description> <channels> @@ -42,7 +42,7 @@ </thing-type> <thing-type id="lgtv-LVx55-series"> - <label>LV/LW series</label> + <label>LV/LW Series</label> <description><![CDATA[This thing supports the *LV255C, *LV355B, *LV355C models.]]></description> <channels> <channel id="3d" typeId="3d" /> @@ -75,7 +75,7 @@ <thing-type id="lgtv-LK-series"> - <label>LK series</label> + <label>LK Series</label> <description><![CDATA[This thing supports the LCD TV models <size>LK<type>]]></description> <channels> @@ -107,7 +107,7 @@ </thing-type> <thing-type id="lgtv-PW-series"> - <label>PW series</label> + <label>PW Series</label> <description><![CDATA[This thing supports the PLASMA TV models <size>PW<type>]]></description> <channels> @@ -140,7 +140,7 @@ <channel-type id="aspect-ratio-SAC34134216"> <item-type>String</item-type> - <label>Aspect ratio</label> + <label>Aspect Ratio</label> <description>Adjust the screen format</description> <state> <options> diff --git a/bundles/org.openhab.binding.lgwebos/.classpath b/bundles/org.openhab.binding.lgwebos/.classpath index 965d9e67fe9f4..91356226c1031 100644 --- a/bundles/org.openhab.binding.lgwebos/.classpath +++ b/bundles/org.openhab.binding.lgwebos/.classpath @@ -28,6 +28,5 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/Connect-SDK-Java-Core-1.0.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.lgwebos/NOTICE b/bundles/org.openhab.binding.lgwebos/NOTICE index b923043f4ee64..4cabe473e87bc 100644 --- a/bundles/org.openhab.binding.lgwebos/NOTICE +++ b/bundles/org.openhab.binding.lgwebos/NOTICE @@ -10,26 +10,10 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content -Connect-SDK-Java-Core -* License: Apache 2.0 License -* Project: https://github.com/ConnectSDK/Connect-SDK-Android-Core -* Source: https://github.com/sprehn/Connect-SDK-Java-Core/releases - -Java-WebSocket -* License: MIT License -* Project: https://tootallnate.github.io/Java-WebSocket -* Source: https://github.com/TooTallNate/Java-WebSocket - -json -* License: JSON License -* Project: https://www.json.org -* Source: https://github.com/douglascrockford/JSON-java - -xpp3 -* License: Apache 2.0 License -* Project: http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1 -* Source: http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1 +The web socket communication with LGWebOS is derived from Connect-SDK-Java-Core. + * License: Apache 2.0 License + * Project: https://github.com/ConnectSDK/Connect-SDK-Android-Core diff --git a/bundles/org.openhab.binding.lgwebos/README.md b/bundles/org.openhab.binding.lgwebos/README.md index 74a52303ce2fe..98074fc3610ed 100644 --- a/bundles/org.openhab.binding.lgwebos/README.md +++ b/bundles/org.openhab.binding.lgwebos/README.md @@ -1,7 +1,7 @@ # LG webOS Binding The binding integrates LG WebOS based smart TVs. -This binding uses a [forked version](https://github.com/sprehn/Connect-SDK-Java-Core) of LG's [Connect SDK](https://github.com/ConnectSDK/Connect-SDK-Android-Core) library. +This binding is an adoption of LG's [Connect SDK](https://github.com/ConnectSDK/Connect-SDK-Android-Core) library, which is no longer maintained and which was specific to Android. ## Supported Things @@ -20,25 +20,34 @@ In combination with the wake on LAN binding this will allow you to start the TV ## Binding Configuration -The binding has only one configuration parameter, which is only required if the binding cannot automatically detect openHAB's local IP address: - -| Name | Description | -|---------|----------------------------------------------------------------------| -| localIP | This is the local IP of your openHAB host on the network. (Optional) | - -If LocalIP is not set, the binding will use openHAB's primary IP address, which may be configured under network settings. +The binding has no configuration parameter. ## Discovery TVs are auto discovered through SSDP in the local network. The binding broadcasts a search message via UDP on the network in order to discover and monitor availability of the TV. -Please note, that if you are running openHAB in a docker container you need to use macvlan or host networking for this binding to work. +Please note, that if you are running openHAB in a Docker container you need to use macvlan or host networking for this binding to work. +If automatic discovery is not possible you may still manually configure a device based on host and access key. ## Thing Configuration -WebOS TV has no configuration parameters. -Please note that at least one channel must be bound to an item before the binding will make an attempt to connect and pair with the TV once that one is turned on. +WebOS TV has two configuration parameters. + +Parameters: + +| Name | Description | +|---------|------------------------------------------------------------------------------| +| host | Hostname or IP address of TV | +| key | Key exchanged with TV after pairing (enter it after you paired the device) | + +### Configuration in .things file + +Set host and key parameter as in the following example: + +``` +Thing lgwebos:WebOSTV:tv1 [host="192.168.2.119", key="6ef1dff6c7c936c8dc5056fc85ea3aef"] +``` ## Channels @@ -47,8 +56,8 @@ Please note that at least one channel must be bound to an item before the bindin | power | Switch | Current power setting. TV can only be powered off, not on. | RW | | mute | Switch | Current mute setting. | RW | | volume | Dimmer | Current volume setting. Setting and reporting absolute percent values only works when using internal speakers. When connected to an external amp, the volume should be controlled using increase and decrease commands. | RW | -| channel | String | Current channel number. | RW | -| channelName | String | Current channel name. | R | +| channel | String | Current channel number. | RW | +| channelName | String | Current channel name. | R | | toast | String | Displays a short message on the TV screen. See also rules section. | W | | mediaPlayer | Player | Media control player | W | | mediaStop | Switch | Media control stop | W | @@ -56,18 +65,7 @@ Please note that at least one channel must be bound to an item before the bindin ## Example -Assuming your TV has device ID 3aab9eea-953b-4272-bdbd-f0cd0ecf4a46. -By default this binding will create ThingIDs for discovery results with prefix lgwebos:WebOSTV: and the device ID. e.g. lgwebos:WebOSTV:3aab9eea-953b-4272-bdbd-f0cd0ecf4a46. -Thus, you can find your TV's device ID by looking into discovery results in Paper UI. - -You could also specify an alternate ThingID using a .things file, specifying the deviceId as a mandatory configuration parameter: - -``` -Thing lgwebos:WebOSTV:tv1 [ deviceId="3aab9eea-953b-4272-bdbd-f0cd0ecf4a46" ] -``` - -However, for the next steps of this example we will assumes you are using automatic discovery and the default ThingID. - +Assuming your ThingID is lgwebos:WebOSTV:3aab9eea-953b-4272-bdbd-f0cd0ecf4a46. demo.items: @@ -183,7 +181,7 @@ Example ### showToast(text) -Sends a toast message to a WebOS device with openHab icon. +Sends a toast message to a WebOS device with openHAB icon. Parameters: @@ -347,8 +345,3 @@ In case of issues you may find it helpful to enable debug level logging and chec log:set debug org.openhab.binding.lgwebos ``` -Additional logs are available from the underlying library: - -``` -log:set debug com.connectsdk -``` diff --git a/bundles/org.openhab.binding.lgwebos/lib/Connect-SDK-Java-Core-1.0.jar b/bundles/org.openhab.binding.lgwebos/lib/Connect-SDK-Java-Core-1.0.jar deleted file mode 100644 index 89730e61bcc23..0000000000000 Binary files a/bundles/org.openhab.binding.lgwebos/lib/Connect-SDK-Java-Core-1.0.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.lgwebos/pom.xml b/bundles/org.openhab.binding.lgwebos/pom.xml index 0611a0341a039..67785e2e04bd4 100644 --- a/bundles/org.openhab.binding.lgwebos/pom.xml +++ b/bundles/org.openhab.binding.lgwebos/pom.xml @@ -1,37 +1,15 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lgwebos</artifactId> <name>openHAB Add-ons :: Bundles :: LG webOS Binding</name> - <dependencies> - <dependency> - <groupId>xpp3</groupId> - <artifactId>xpp3</artifactId> - <version>1.1.4c</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <version>20140107</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>org.java-websocket.java-websocket</artifactId> - <version>1.3.2</version> - <scope>provided</scope> - </dependency> - </dependencies> - </project> diff --git a/bundles/org.openhab.binding.lgwebos/src/main/feature/feature.xml b/bundles/org.openhab.binding.lgwebos/src/main/feature/feature.xml index b38e6a708ae15..afed8cf537a61 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lgwebos/src/main/feature/feature.xml @@ -1,14 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lgwebos-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lgwebos" description="LG webOS Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.4</bundle> - <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle> - <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/1.1.4c_7</bundle> - <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/20140107_1</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/org.java-websocket.java-websocket/1.3.2</bundle> + <feature>openhab-transport-upnp</feature> + <feature>openhab.tp-httpclient</feature> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.lgwebos/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/Application.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/Application.java index 2fc98577b8ac5..0cd2bc92169b3 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/Application.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/Application.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,11 +12,14 @@ */ package org.openhab.binding.lgwebos.action; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * This represents id and name of a WebOS application. * * @author Sebastian Prehn - Initial contribution */ +@NonNullByDefault public class Application { private String id; private String name; diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/LGWebOSActions.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/LGWebOSActions.java index 06309a09eaf29..71c494fd99546 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/LGWebOSActions.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/action/LGWebOSActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,30 +29,24 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.binding.ThingActions; import org.eclipse.smarthome.core.thing.binding.ThingActionsScope; import org.eclipse.smarthome.core.thing.binding.ThingHandler; -import org.json.JSONException; -import org.json.JSONObject; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.LGWebOSTVMouseSocket.ButtonType; +import org.openhab.binding.lgwebos.internal.handler.LGWebOSTVSocket; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.AppInfo; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; +import org.openhab.binding.lgwebos.internal.handler.core.TextInputStatusInfo; import org.openhab.core.automation.annotation.ActionInput; import org.openhab.core.automation.annotation.RuleAction; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.core.AppInfo; -import com.connectsdk.core.TextInputStatusInfo; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.CapabilityMethods; -import com.connectsdk.service.capability.KeyControl; -import com.connectsdk.service.capability.Launcher; -import com.connectsdk.service.capability.TVControl; -import com.connectsdk.service.capability.TextInputControl; -import com.connectsdk.service.capability.TextInputControl.TextInputStatusListener; -import com.connectsdk.service.capability.ToastControl; -import com.connectsdk.service.capability.listeners.ResponseListener; -import com.connectsdk.service.command.ServiceCommandError; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; /** * This is the automation engine action handler service for the @@ -64,7 +58,7 @@ @NonNullByDefault public class LGWebOSActions implements ThingActions { private final Logger logger = LoggerFactory.getLogger(LGWebOSActions.class); - private final TextInputStatusListener textInputListener = createTextInputStatusListener(); + private final ResponseListener<TextInputStatusInfo> textInputListener = createTextInputStatusListener(); private @Nullable LGWebOSHandler handler; @Override @@ -77,6 +71,16 @@ public void setThingHandler(@Nullable ThingHandler handler) { return this.handler; } + // a NonNull getter for handler + private LGWebOSHandler getLGWebOSHandler() { + LGWebOSHandler lgWebOSHandler = this.handler; + if (lgWebOSHandler == null) { + throw new IllegalStateException( + "ThingHandler must be set before any action may be invoked on LGWebOSActions."); + } + return lgWebOSHandler; + } + private enum Button { UP, DOWN, @@ -93,7 +97,7 @@ private enum Button { public void showToast( @ActionInput(name = "text", label = "@text/actionShowToastInputTextLabel", description = "@text/actionShowToastInputTextDesc") String text) throws IOException { - getControl(ToastControl.class).ifPresent(control -> control.showToast(text, createResponseListener())); + getConnectedSocket().ifPresent(control -> control.showToast(text, createResponseListener())); } @RuleAction(label = "@text/actionShowToastWithIconLabel", description = "@text/actionShowToastWithIconLabel") @@ -105,37 +109,31 @@ public void showToast( try (ByteArrayOutputStream os = new ByteArrayOutputStream(); OutputStream b64 = Base64.getEncoder().wrap(os)) { ImageIO.write(bi, "png", b64); String string = os.toString(StandardCharsets.UTF_8.name()); - getControl(ToastControl.class) - .ifPresent(control -> control.showToast(text, string, "png", createResponseListener())); + getConnectedSocket().ifPresent(control -> control.showToast(text, string, "png", createResponseListener())); } } @RuleAction(label = "@text/actionLaunchBrowserLabel", description = "@text/actionLaunchBrowserDesc") public void launchBrowser( @ActionInput(name = "url", label = "@text/actionLaunchBrowserInputUrlLabel", description = "@text/actionLaunchBrowserInputUrlDesc") String url) { - getControl(Launcher.class).ifPresent(control -> control.launchBrowser(url, createResponseListener())); + getConnectedSocket().ifPresent(control -> control.launchBrowser(url, createResponseListener())); } private List<AppInfo> getAppInfos() { - LGWebOSHandler lgWebOSHandler = this.handler; - if (lgWebOSHandler == null) { - throw new IllegalStateException( - "ThingHandler must be set before any action may be invoked on LGWebOSActions."); - } + LGWebOSHandler lgWebOSHandler = getLGWebOSHandler(); - final Optional<ConnectableDevice> connectableDevice = lgWebOSHandler.getDevice(); - if (!connectableDevice.isPresent()) { - logger.warn("Device not present."); + if (!this.getConnectedSocket().isPresent()) { return Collections.emptyList(); } - ConnectableDevice device = connectableDevice.get(); - List<AppInfo> appInfos = lgWebOSHandler.getLauncherApplication().getAppInfos(device); + List<AppInfo> appInfos = lgWebOSHandler.getLauncherApplication() + .getAppInfos(lgWebOSHandler.getThing().getUID()); if (appInfos == null) { - logger.warn("No application list cached for {}, ignoring command.", lgWebOSHandler.getThing().getLabel()); + logger.warn("No AppInfos found for device with ThingID {}.", lgWebOSHandler.getThing().getUID()); return Collections.emptyList(); } return appInfos; + } public List<Application> getApplications() { @@ -146,45 +144,47 @@ public List<Application> getApplications() { @RuleAction(label = "@text/actionLaunchApplicationLabel", description = "@text/actionLaunchApplicationDesc") public void launchApplication( @ActionInput(name = "appId", label = "@text/actionLaunchApplicationInputAppIDLabel", description = "@text/actionLaunchApplicationInputAppIDDesc") String appId) { - List<AppInfo> appInfos = getAppInfos(); - getControl(Launcher.class).ifPresent(control -> { - Optional<AppInfo> appInfo = appInfos.stream().filter(a -> a.getId().equals(appId)).findFirst(); - if (appInfo.isPresent()) { - control.launchApp(appId, createResponseListener()); - } else { - logger.warn("TV does not support any app with id: {}.", appId); - } - }); + Optional<AppInfo> appInfo = getAppInfos().stream().filter(a -> a.getId().equals(appId)).findFirst(); + if (appInfo.isPresent()) { + getConnectedSocket() + .ifPresent(control -> control.launchAppWithInfo(appInfo.get(), createResponseListener())); + } else { + logger.warn("Device with ThingID {} does not support any app with id: {}.", + getLGWebOSHandler().getThing().getUID(), appId); + } + } @RuleAction(label = "@text/actionLaunchApplicationWithParamsLabel", description = "@text/actionLaunchApplicationWithParamsDesc") public void launchApplication( @ActionInput(name = "appId", label = "@text/actionLaunchApplicationInputAppIDLabel", description = "@text/actionLaunchApplicationInputAppIDDesc") String appId, - @ActionInput(name = "params", label = "@text/actionLaunchApplicationInputParamsLabel", description = "@text/actionLaunchApplicationInputParamsDesc") Object params) { - JSONObject parameters; + @ActionInput(name = "params", label = "@text/actionLaunchApplicationInputParamsLabel", description = "@text/actionLaunchApplicationInputParamsDesc") String params) { try { - parameters = new JSONObject(params); - } catch (JSONException ex) { - logger.warn("Parameters value ({}) is not in a valid JSON format. {}", params, ex.getMessage()); - return; - } - List<AppInfo> appInfos = getAppInfos(); - getControl(Launcher.class).ifPresent(control -> { - Optional<AppInfo> appInfo = appInfos.stream().filter(a -> a.getId().equals(appId)).findFirst(); + JsonParser parser = new JsonParser(); + JsonObject payload = (JsonObject) parser.parse(params); + + Optional<AppInfo> appInfo = getAppInfos().stream().filter(a -> a.getId().equals(appId)).findFirst(); if (appInfo.isPresent()) { - control.launchAppWithInfo(appInfo.get(), parameters, createResponseListener()); + getConnectedSocket().ifPresent( + control -> control.launchAppWithInfo(appInfo.get(), payload, createResponseListener())); } else { - logger.warn("TV does not support any app with id: {}.", appId); + logger.warn("Device with ThingID {} does not support any app with id: {}.", + getLGWebOSHandler().getThing().getUID(), appId); } - }); + + } catch (JsonParseException ex) { + logger.warn("Parameters value ({}) is not in a valid JSON format. {}", params, ex.getMessage()); + return; + } } @RuleAction(label = "@text/actionSendTextLabel", description = "@text/actionSendTextDesc") public void sendText( @ActionInput(name = "text", label = "@text/actionSendTextInputTextLabel", description = "@text/actionSendTextInputTextDesc") String text) { - getControl(TextInputControl.class).ifPresent(control -> { - control.subscribeTextInputStatus(textInputListener); + getConnectedSocket().ifPresent(control -> { + ServiceSubscription<TextInputStatusInfo> subscription = control.subscribeTextInputStatus(textInputListener); control.sendText(text); + control.unsubscribe(subscription); }); } @@ -194,37 +194,31 @@ public void sendButton( try { switch (Button.valueOf(button)) { case UP: - getControl(KeyControl.class).ifPresent(control -> control.up(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button(ButtonType.UP))); break; case DOWN: - getControl(KeyControl.class).ifPresent(control -> control.down(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button(ButtonType.DOWN))); break; case LEFT: - getControl(KeyControl.class).ifPresent(control -> control.left(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button(ButtonType.LEFT))); break; case RIGHT: - getControl(KeyControl.class).ifPresent(control -> control.right(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button(ButtonType.RIGHT))); break; case BACK: - getControl(KeyControl.class).ifPresent(control -> control.back(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button(ButtonType.BACK))); break; case DELETE: - getControl(TextInputControl.class).ifPresent(control -> { - control.subscribeTextInputStatus(textInputListener); - control.sendDelete(); - }); + getConnectedSocket().ifPresent(control -> control.sendDelete()); break; case ENTER: - getControl(TextInputControl.class).ifPresent(control -> { - control.subscribeTextInputStatus(textInputListener); - control.sendEnter(); - }); + getConnectedSocket().ifPresent(control -> control.sendEnter()); break; case HOME: - getControl(KeyControl.class).ifPresent(control -> control.home(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.button("HOME"))); break; case OK: - getControl(KeyControl.class).ifPresent(control -> control.ok(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.executeMouse(s -> s.click())); break; } } catch (IllegalArgumentException ex) { @@ -235,47 +229,32 @@ public void sendButton( @RuleAction(label = "@text/actionIncreaseChannelLabel", description = "@text/actionIncreaseChannelDesc") public void increaseChannel() { - getControl(TVControl.class).ifPresent(control -> control.channelUp(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.channelUp(createResponseListener())); } @RuleAction(label = "@text/actionDecreaseChannelLabel", description = "@text/actionDecreaseChannelDesc") public void decreaseChannel() { - getControl(TVControl.class).ifPresent(control -> control.channelDown(createResponseListener())); + getConnectedSocket().ifPresent(control -> control.channelDown(createResponseListener())); } - private <C extends @Nullable CapabilityMethods> Optional<C> getControl(Class<C> clazz) { - LGWebOSHandler lgWebOSHandler = this.handler; - if (lgWebOSHandler == null) { - throw new IllegalStateException( - "ThingHandler must be set before any action may be invoked on LGWebOSActions."); - } + private Optional<LGWebOSTVSocket> getConnectedSocket() { + LGWebOSHandler lgWebOSHandler = getLGWebOSHandler(); + final LGWebOSTVSocket socket = lgWebOSHandler.getSocket(); - ThingStatus status = lgWebOSHandler.getThing().getStatus(); - if (!ThingStatus.ONLINE.equals(status)) { - logger.info("Device not online."); + if (!socket.isConnected()) { + logger.warn("Device with ThingID {} is currently not connected.", lgWebOSHandler.getThing().getUID()); return Optional.empty(); } - final Optional<ConnectableDevice> connectableDevice = lgWebOSHandler.getDevice(); - if (!connectableDevice.isPresent()) { - logger.warn("Device not present."); - return Optional.empty(); - } - - C control = connectableDevice.get().getCapability(clazz); - if (control == null) { - logger.warn("Device does not have the ability: {}.", clazz.getName()); - return Optional.empty(); - } - return Optional.of(control); + return Optional.of(socket); } - private TextInputStatusListener createTextInputStatusListener() { - return new TextInputStatusListener() { + private ResponseListener<TextInputStatusInfo> createTextInputStatusListener() { + return new ResponseListener<TextInputStatusInfo>() { @Override - public void onError(@Nullable ServiceCommandError error) { - logger.warn("Response: {}", error == null ? "" : error.getMessage()); + public void onError(@Nullable String error) { + logger.warn("Response: {}", error); } @Override @@ -289,12 +268,12 @@ private <O> ResponseListener<O> createResponseListener() { return new ResponseListener<O>() { @Override - public void onError(@Nullable ServiceCommandError error) { - logger.warn("Response: {}", error == null ? "" : error.getMessage()); + public void onError(@Nullable String error) { + logger.warn("Response: {}", error); } @Override - public void onSuccess(O object) { + public void onSuccess(@Nullable O object) { logger.debug("Response: {}", object == null ? "OK" : object.toString()); } }; diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/BaseChannelHandler.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/BaseChannelHandler.java index bdac351cd99b4..78d5ccc2abd67 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/BaseChannelHandler.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/BaseChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,61 +17,62 @@ import java.util.concurrent.ConcurrentHashMap; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.ThingUID; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.listeners.ResponseListener; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; - /** * An abstract implementation of ChannelHander which serves as a base class for all concrete instances. * * @author Sebastian Prehn - initial contribution */ @NonNullByDefault -abstract class BaseChannelHandler<T, R> implements ChannelHandler { +abstract class BaseChannelHandler<T> implements ChannelHandler { private final Logger logger = LoggerFactory.getLogger(BaseChannelHandler.class); - private final ResponseListener<R> defaultResponseListener = new ResponseListener<R>() { + private final ResponseListener<T> defaultResponseListener = createResponseListener(); - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.warn("{}: received error response: ", getClass().getName(), error); - } + protected <Y> ResponseListener<Y> createResponseListener() { + return new ResponseListener<Y>() { - @Override - public void onSuccess(R object) { - logger.debug("{}: {}.", getClass().getName(), object); - } - }; + @Override + public void onError(String error) { + logger.warn("{} received error response: {}", BaseChannelHandler.this.getClass().getSimpleName(), + error); + } + + @Override + public void onSuccess(Y object) { + logger.debug("{} received: {}.", BaseChannelHandler.this.getClass().getSimpleName(), object); + } + }; + } // IP to Subscriptions map - private Map<String, ServiceSubscription<T>> subscriptions = new ConcurrentHashMap<>(); + private Map<ThingUID, ServiceSubscription<T>> subscriptions = new ConcurrentHashMap<>(); @Override - public void onDeviceReady(ConnectableDevice device, String channelId, LGWebOSHandler handler) { + public void onDeviceReady(String channelId, LGWebOSHandler handler) { // NOP } @Override - public void onDeviceRemoved(ConnectableDevice device, String channelId, LGWebOSHandler handler) { + public void onDeviceRemoved(String channelId, LGWebOSHandler handler) { // NOP } @Override - public final synchronized void refreshSubscription(ConnectableDevice device, String channelId, - LGWebOSHandler handler) { - removeAnySubscription(device); + public final synchronized void refreshSubscription(String channelId, LGWebOSHandler handler) { + removeAnySubscription(handler); if (handler.isChannelInUse(channelId)) { // only listen if least one item is configured for this channel - Optional<ServiceSubscription<T>> listener = getSubscription(device, channelId, handler); + Optional<ServiceSubscription<T>> listener = getSubscription(channelId, handler); if (listener.isPresent()) { - logger.debug("Subscribed {} on IP: {}", this.getClass().getName(), device.getIpAddress()); - subscriptions.put(device.getIpAddress(), listener.get()); + logger.debug("Subscribed {} on IP: {}", this.getClass().getName(), handler.getThing().getUID()); + subscriptions.put(handler.getThing().getUID(), listener.get()); } } } @@ -85,37 +86,21 @@ public final synchronized void refreshSubscription(ConnectableDevice device, Str * @return an {@code Optional} containing the ServiceSubscription, or an empty {@code Optional} if subscription is * not supported. */ - protected Optional<ServiceSubscription<T>> getSubscription(ConnectableDevice device, String channelId, - LGWebOSHandler handler) { + protected Optional<ServiceSubscription<T>> getSubscription(String channelId, LGWebOSHandler handler) { return Optional.empty(); } @Override - public final synchronized void removeAnySubscription(ConnectableDevice device) { - ServiceSubscription<T> l = subscriptions.remove(device.getIpAddress()); + public final synchronized void removeAnySubscription(LGWebOSHandler handler) { + ServiceSubscription<T> l = subscriptions.remove(handler.getThing().getUID()); if (l != null) { - l.unsubscribe(); - logger.debug("Unsubscribed {} on IP: {}", this.getClass().getName(), device.getIpAddress()); + handler.getSocket().unsubscribe(l); + logger.debug("Unsubscribed {} on IP: {}", this.getClass().getName(), handler.getThing().getUID()); } } - protected ResponseListener<R> getDefaultResponseListener() { + protected ResponseListener<T> getDefaultResponseListener() { return defaultResponseListener; } - /** - * A convenience method that calls device.hasCapability, but logs a message if the result is false. - * - * @param device the webos tv - * @param capability the capability to check - * - */ - protected boolean hasCapability(ConnectableDevice device, String capability) { - boolean result = device.hasCapability(capability); - if (!result) { - logger.debug("Device {} does not have capability {} as required by handler {}", device.getFriendlyName(), - capability, this.getClass().getName()); - } - return result; - } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ChannelHandler.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ChannelHandler.java index 0f782691b46c9..694f6b1a11499 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ChannelHandler.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,12 +13,9 @@ package org.openhab.binding.lgwebos.internal; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; -import com.connectsdk.device.ConnectableDevice; - /** * Channel Handler mediates between connect sdk device state changes and openhab channel events. * @@ -31,13 +28,11 @@ public interface ChannelHandler { * This method will be called whenever a command is received for this handler. * All implementations provide custom logic here. * - * @param device may be <code>null</code> in case the device is currently offline * @param channelId must not be <code>null</code> * @param handler must not be <code>null</code> * @param command must not be <code>null</code> */ - void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command); + void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command); /** * Handle underlying subscription status if device changes online state, capabilities or channel gets linked or @@ -47,35 +42,32 @@ void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWe * subscription on this device channel * and handler. * - * @param device must not be <code>null</code> * @param channelId must not be <code>null</code> * @param handler must not be <code>null</code> */ - void refreshSubscription(ConnectableDevice device, String channelId, LGWebOSHandler handler); + void refreshSubscription(String channelId, LGWebOSHandler handler); /** * Removes subscriptions if there are any. * - * @param device must not be <code>null</code> + * @param handler must not be <code>null</code> */ - void removeAnySubscription(ConnectableDevice device); + void removeAnySubscription(LGWebOSHandler handler); /** * Callback method whenever a device disappears. * - * @param device must not be <code>null</code> * @param channelId must not be <code>null</code> * @param handler must not be <code>null</code> */ - void onDeviceRemoved(ConnectableDevice device, String channelId, LGWebOSHandler handler); + void onDeviceRemoved(String channelId, LGWebOSHandler handler); /** * Callback method whenever a device is discovered and ready to operate. * - * @param device must not be <code>null</code> * @param channelId must not be <code>null</code> * @param handler must not be <code>null</code> */ - void onDeviceReady(ConnectableDevice device, String channelId, LGWebOSHandler handler); + void onDeviceReady(String channelId, LGWebOSHandler handler); } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSBindingConstants.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSBindingConstants.java index 0afeea8b178c0..b9e7ff8e40726 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSBindingConstants.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,11 +17,12 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.jupnp.model.types.ServiceType; /** * This class defines common constants, which are used across the whole binding. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault public class LGWebOSBindingConstants { @@ -32,11 +33,33 @@ public class LGWebOSBindingConstants { public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_WEBOSTV); - public static final String BINDING_CONFIGURATION_LOCALIP = "localIP"; + public static final ServiceType UPNP_SERVICE_TYPE = new ServiceType("lge-com", "webos-second-screen", 1); + /* + * Config names must match property names in + * - WebOSConfiguration + * - parameter names in ESH-INF/config/config.xml + * - property names in ESH-INF/thing/thing-types.xml + */ + public static final String CONFIG_HOST = "host"; + public static final String CONFIG_KEY = "key"; + + /* + * Property names must match property names in + * - property names in ESH-INF/thing/thing-types.xml + */ public static final String PROPERTY_DEVICE_ID = "deviceId"; + public static final String PROPERTY_DEVICE_OS = "deviceOS"; + public static final String PROPERTY_DEVICE_OS_VERSION = "deviceOSVersion"; + public static final String PROPERTY_DEVICE_OS_RELEASE_VERSION = "deviceOSReleaseVersion"; + public static final String PROPERTY_LAST_CONNECTED = "lastConnected"; + public static final String PROPERTY_MODEL_NAME = "modelName"; + public static final String PROPERTY_MANUFACTURER = "manufacturer"; - // List of all Channel ids. Values have to match ids in thing-types.xml + /* + * List of all Channel ids. + * Values have to match ids in thing-types.xml + */ public static final String CHANNEL_VOLUME = "volume"; public static final String CHANNEL_POWER = "power"; public static final String CHANNEL_MUTE = "mute"; diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java index 1ed38d4dafe70..cf76158c1868a 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LGWebOSHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,15 +16,20 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; -import org.openhab.binding.lgwebos.internal.discovery.LGWebOSDiscovery; +import org.eclipse.smarthome.io.net.http.WebSocketFactory; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The {@link LGWebOSHandlerFactory} is responsible for creating things and thing @@ -35,32 +40,62 @@ @NonNullByDefault @Component(service = ThingHandlerFactory.class, configurationPid = "binding.lgwebos") public class LGWebOSHandlerFactory extends BaseThingHandlerFactory { - private @Nullable LGWebOSDiscovery discovery; + private final Logger logger = LoggerFactory.getLogger(LGWebOSHandlerFactory.class); - @Override - public boolean supportsThingType(ThingTypeUID thingTypeUID) { - return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); - } + private final WebSocketClient webSocketClient; - @Reference - protected void bindDiscovery(LGWebOSDiscovery discovery) { - this.discovery = discovery; + @Activate + public LGWebOSHandlerFactory(final @Reference WebSocketFactory webSocketFactory) { + /* + * Cannot use openHAB's shared web socket client (webSocketFactory.getCommonWebSocketClient()) as we have to + * change client settings. + */ + this.webSocketClient = webSocketFactory.createWebSocketClient("lgwebos"); } - protected void unbindDiscovery(LGWebOSDiscovery discovery) { - this.discovery = null; + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); } @Override protected @Nullable ThingHandler createHandler(Thing thing) { - LGWebOSDiscovery lgWebOSDiscovery = discovery; - if (lgWebOSDiscovery == null) { - throw new IllegalStateException("LGWebOSDiscovery must be bound before ThingHandlers can be created"); - } ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(THING_TYPE_WEBOSTV)) { - return new LGWebOSHandler(thing, lgWebOSDiscovery.getDiscoveryManager()); + return new LGWebOSHandler(thing, webSocketClient); } return null; } + + @Override + protected void activate(ComponentContext componentContext) { + super.activate(componentContext); + // LGWebOS TVs only support WEAK cipher suites, thus not using SSL. + // SslContextFactory sslContextFactory = new SslContextFactory(true); + // sslContextFactory.addExcludeProtocols("tls/1.3"); + + // reduce timeout from default 15sec + this.webSocketClient.setConnectTimeout(1000); + + // channel and app listing are json docs up to 3MB + this.webSocketClient.getPolicy().setMaxTextMessageSize(3 * 1024 * 1024); + + // since this is not using openHAB's shared web socket client we need to start and stop + try { + this.webSocketClient.start(); + } catch (Exception e) { + logger.warn("Unable to to start websocket client.", e); + } + } + + @Override + protected void deactivate(ComponentContext componentContext) { + super.deactivate(componentContext); + try { + this.webSocketClient.stop(); + } catch (Exception e) { + logger.warn("Unable to to stop websocket client.", e); + } + } + } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LauncherApplication.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LauncherApplication.java index 89b66f2119571..0b51a7264c48d 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LauncherApplication.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/LauncherApplication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,117 +20,100 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.AppInfo; +import org.openhab.binding.lgwebos.internal.handler.core.LaunchSession; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.core.AppInfo; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.Launcher; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; -import com.connectsdk.service.sessions.LaunchSession; - /** * Provides ability to launch an application on the TV. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class LauncherApplication extends BaseChannelHandler<Launcher.AppInfoListener, LaunchSession> { +public class LauncherApplication extends BaseChannelHandler<AppInfo> { private final Logger logger = LoggerFactory.getLogger(LauncherApplication.class); - private final Map<String, List<AppInfo>> applicationListCache = new HashMap<>(); - - private Launcher getControl(final ConnectableDevice device) { - return device.getCapability(Launcher.class); - } + private final Map<ThingUID, @Nullable List<AppInfo>> applicationListCache = new HashMap<>(); + private final ResponseListener<LaunchSession> launchSessionResponseListener = createResponseListener(); @Override - public void onDeviceReady(ConnectableDevice device, String channelId, LGWebOSHandler handler) { - super.onDeviceReady(device, channelId, handler); - if (hasCapability(device, Launcher.Application_List)) { + public void onDeviceReady(String channelId, LGWebOSHandler handler) { + super.onDeviceReady(channelId, handler); - final Launcher control = getControl(device); - control.getAppList(new Launcher.AppListListener() { + handler.getSocket().getAppList(new ResponseListener<List<AppInfo>>() { - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.warn("Error requesting application list: {}.", error == null ? "" : error.getMessage()); - } + @Override + public void onError(String error) { + logger.warn("Error requesting application list: {}.", error); + } - @Override - @NonNullByDefault({}) - public void onSuccess(List<AppInfo> appInfos) { - if (logger.isDebugEnabled()) { - for (AppInfo a : appInfos) { - logger.debug("AppInfo {} - {}", a.getId(), a.getName()); - } + @Override + @NonNullByDefault({}) + public void onSuccess(List<AppInfo> appInfos) { + if (logger.isDebugEnabled()) { + for (AppInfo a : appInfos) { + logger.debug("AppInfo {} - {}", a.getId(), a.getName()); } - applicationListCache.put(device.getId(), appInfos); } - }); - } + applicationListCache.put(handler.getThing().getUID(), appInfos); + } + }); } @Override - public void onDeviceRemoved(ConnectableDevice device, String channelId, LGWebOSHandler handler) { - super.onDeviceRemoved(device, channelId, handler); - applicationListCache.remove(device.getId()); + public void onDeviceRemoved(String channelId, LGWebOSHandler handler) { + super.onDeviceRemoved(channelId, handler); + applicationListCache.remove(handler.getThing().getUID()); } @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - if (hasCapability(device, Launcher.Application)) { - final String value = command.toString(); - final Launcher control = getControl(device); - List<AppInfo> appInfos = applicationListCache.get(device.getId()); - if (appInfos == null) { - logger.warn("No application list cached for this device {}, ignoring command.", device.getId()); + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + final String value = command.toString(); + + List<AppInfo> appInfos = applicationListCache.get(handler.getThing().getUID()); + if (appInfos == null) { + logger.warn("No application list cached for this device {}, ignoring command.", + handler.getThing().getUID()); + } else { + Optional<AppInfo> appInfo = appInfos.stream().filter(a -> a.getId().equals(value)).findFirst(); + if (appInfo.isPresent()) { + handler.getSocket().launchAppWithInfo(appInfo.get(), launchSessionResponseListener); } else { - Optional<AppInfo> appInfo = appInfos.stream().filter(a -> a.getId().equals(value)).findFirst(); - if (appInfo.isPresent()) { - control.launchApp(appInfo.get().getId(), getDefaultResponseListener()); - } else { - logger.warn("TV does not support any app with id: {}.", value); - } + logger.warn("TV does not support any app with id: {}.", value); } } + } @Override - protected Optional<ServiceSubscription<Launcher.AppInfoListener>> getSubscription(ConnectableDevice device, - String channelId, LGWebOSHandler handler) { - if (hasCapability(device, Launcher.RunningApp_Subscribe)) { - return Optional.of(getControl(device).subscribeRunningApp(new Launcher.AppInfoListener() { - - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.debug("Error in listening to application changes: {}.", - error == null ? "" : error.getMessage()); - } + protected Optional<ServiceSubscription<AppInfo>> getSubscription(String channelId, LGWebOSHandler handler) { + return Optional.of(handler.getSocket().subscribeRunningApp(new ResponseListener<AppInfo>() { - @Override - public void onSuccess(@Nullable AppInfo appInfo) { - if (appInfo == null) { - handler.postUpdate(channelId, UnDefType.UNDEF); - } else { - handler.postUpdate(channelId, new StringType(appInfo.getId())); - } + @Override + public void onError(@Nullable String error) { + logger.debug("Error in listening to application changes: {}.", error); + } + + @Override + public void onSuccess(@Nullable AppInfo appInfo) { + if (appInfo == null) { + handler.postUpdate(channelId, UnDefType.UNDEF); + } else { + handler.postUpdate(channelId, new StringType(appInfo.getId())); } - })); - } else { - return Optional.empty(); - } + } + })); + } - public List<AppInfo> getAppInfos(ConnectableDevice device) { - return applicationListCache.get(device.getId()); + public @Nullable List<AppInfo> getAppInfos(ThingUID key) { + return applicationListCache.get(key); } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlPlayer.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlPlayer.java index afbc06ae6b862..7957142827417 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlPlayer.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlPlayer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,71 +13,38 @@ package org.openhab.binding.lgwebos.internal; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.library.types.NextPreviousType; import org.eclipse.smarthome.core.library.types.PlayPauseType; import org.eclipse.smarthome.core.library.types.RewindFastforwardType; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.MediaControl; -import com.connectsdk.service.capability.MediaControl.PlayStateListener; -import com.connectsdk.service.capability.PlaylistControl; - /** * Handles commands of a Player Item. * * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class MediaControlPlayer extends BaseChannelHandler<PlayStateListener, Object> { +public class MediaControlPlayer extends BaseChannelHandler<CommandConfirmation> { private final Logger logger = LoggerFactory.getLogger(MediaControlPlayer.class); - private MediaControl getMediaControl(ConnectableDevice device) { - return device.getCapability(MediaControl.class); - } - - private PlaylistControl getPlayListControl(ConnectableDevice device) { - return device.getCapability(PlaylistControl.class); - } - @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - if (NextPreviousType.NEXT == command) { - if (hasCapability(device, PlaylistControl.Next)) { - getPlayListControl(device).next(getDefaultResponseListener()); - } - } else if (NextPreviousType.PREVIOUS == command) { - if (hasCapability(device, PlaylistControl.Previous)) { - getPlayListControl(device).previous(getDefaultResponseListener()); - } - } else if (PlayPauseType.PLAY == command) { - if (hasCapability(device, MediaControl.Play)) { - getMediaControl(device).play(getDefaultResponseListener()); - } + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + if (PlayPauseType.PLAY == command) { + handler.getSocket().play(getDefaultResponseListener()); } else if (PlayPauseType.PAUSE == command) { - if (hasCapability(device, MediaControl.Pause)) { - getMediaControl(device).pause(getDefaultResponseListener()); - } + handler.getSocket().pause(getDefaultResponseListener()); } else if (RewindFastforwardType.FASTFORWARD == command) { - if (hasCapability(device, MediaControl.FastForward)) { - getMediaControl(device).fastForward(getDefaultResponseListener()); - } + handler.getSocket().fastForward(getDefaultResponseListener()); } else if (RewindFastforwardType.REWIND == command) { - if (hasCapability(device, MediaControl.Rewind)) { - getMediaControl(device).rewind(getDefaultResponseListener()); - } + handler.getSocket().rewind(getDefaultResponseListener()); } else { - logger.warn("Only accept NextPreviousType, PlayPauseType, RewindFastforwardType. Type was {}.", - command.getClass()); + logger.warn("Only accept PlayPauseType, RewindFastforwardType. Type was {}.", command.getClass()); } } + + // TODO: playstatesubscription } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlStop.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlStop.java index 0589a5940eb3e..76c0e697a6d14 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlStop.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/MediaControlStop.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,33 +13,20 @@ package org.openhab.binding.lgwebos.internal; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; - -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.MediaControl; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; /** * Handles Media Control Command Stop. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class MediaControlStop extends BaseChannelHandler<Void, Object> { - - private MediaControl getControl(ConnectableDevice device) { - return device.getCapability(MediaControl.class); - } +public class MediaControlStop extends BaseChannelHandler<CommandConfirmation> { @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - if (hasCapability(device, MediaControl.Stop)) { - getControl(device).stop(getDefaultResponseListener()); - } + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + handler.getSocket().stop(getDefaultResponseListener()); } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/PowerControlPower.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/PowerControlPower.java index f4609f2d5b80c..310673c89b00c 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/PowerControlPower.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/PowerControlPower.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,51 +13,38 @@ package org.openhab.binding.lgwebos.internal; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.PowerControl; - /** * Handles Power Control Command. * Note: Connect SDK only supports powering OFF for most devices. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class PowerControlPower extends BaseChannelHandler<Void, Object> { +public class PowerControlPower extends BaseChannelHandler<CommandConfirmation> { private final Logger logger = LoggerFactory.getLogger(PowerControlPower.class); - private PowerControl getControl(ConnectableDevice device) { - return device.getCapability(PowerControl.class); - } - @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + if (OnOffType.ON == command) { + logger.debug( + "Received ON - Turning TV on via API is not supported by LG WebOS TVs. You may succeed using wake on lan binding, please consult lgwebos binding documentation."); + } + if (!handler.getSocket().isConnected()) { /* - * Unable to send anything to a null device. Unless the user configured autoupdate="false" neither + * Unable to send anything to a not connected device. * onDeviceReady nor onDeviceRemoved will be called and item state would be permanently inconsistent. * Therefore setting state to OFF */ handler.postUpdate(channelId, OnOffType.OFF); - return; - } - - if (OnOffType.ON == command) { - if (hasCapability(device, PowerControl.On)) { - getControl(device).powerOn(getDefaultResponseListener()); - } } else if (OnOffType.OFF == command) { - if (hasCapability(device, PowerControl.Off)) { - getControl(device).powerOff(getDefaultResponseListener()); - } + handler.getSocket().powerOff(getDefaultResponseListener()); } else { logger.warn("Only accept OnOffType. Type was {}.", command.getClass()); } @@ -65,12 +52,12 @@ public void onReceiveCommand(@Nullable ConnectableDevice device, String channelI } @Override - public void onDeviceReady(ConnectableDevice device, String channelId, LGWebOSHandler handler) { + public void onDeviceReady(String channelId, LGWebOSHandler handler) { handler.postUpdate(channelId, OnOffType.ON); } @Override - public void onDeviceRemoved(ConnectableDevice device, String channelId, LGWebOSHandler handler) { + public void onDeviceRemoved(String channelId, LGWebOSHandler handler) { handler.postUpdate(channelId, OnOffType.OFF); } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannel.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannel.java index 2972702ba3837..e87c9a5086e72 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannel.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,115 +17,95 @@ import java.util.Map; import java.util.Optional; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.ChannelInfo; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.core.ChannelInfo; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.TVControl; -import com.connectsdk.service.capability.TVControl.ChannelListener; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; - /** * Handles TV Control Channel Command. * Allows to set a channel to an absolute channel number. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class TVControlChannel extends BaseChannelHandler<ChannelListener, Object> { +public class TVControlChannel extends BaseChannelHandler<ChannelInfo> { private final Logger logger = LoggerFactory.getLogger(TVControlChannel.class); - private final Map<String, List<ChannelInfo>> channelListCache = new HashMap<>(); - - private TVControl getControl(ConnectableDevice device) { - return device.getCapability(TVControl.class); - } + private final Map<ThingUID, @Nullable List<ChannelInfo>> channelListCache = new HashMap<>(); + private final ResponseListener<CommandConfirmation> objResponseListener = createResponseListener(); @Override - public void onDeviceReady(@NonNull ConnectableDevice device, @NonNull String channelId, - @NonNull LGWebOSHandler handler) { - super.onDeviceReady(device, channelId, handler); - - if (device.hasCapabilities(TVControl.Channel_List)) { - final TVControl control = getControl(device); - control.getChannelList(new TVControl.ChannelListListener() { - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.warn("error requesting channel list: {}.", error == null ? "" : error.getMessage()); - } + public void onDeviceReady(String channelId, LGWebOSHandler handler) { + super.onDeviceReady(channelId, handler); + handler.getSocket().getChannelList(new ResponseListener<List<ChannelInfo>>() { + @Override + public void onError(@Nullable String error) { + logger.warn("error requesting channel list: {}.", error); + } - @Override - @NonNullByDefault({}) - public void onSuccess(List<ChannelInfo> channels) { - if (logger.isDebugEnabled()) { - channels.forEach(c -> logger.debug("Channel {} - {}", c.getNumber(), c.getName())); - } - channelListCache.put(device.getId(), channels); + @Override + @NonNullByDefault({}) + public void onSuccess(List<ChannelInfo> channels) { + if (logger.isDebugEnabled()) { + channels.forEach(c -> logger.debug("Channel {} - {}", c.getChannelNumber(), c.getName())); } - }); - } + channelListCache.put(handler.getThing().getUID(), channels); + } + }); } @Override - public void onDeviceRemoved(@NonNull ConnectableDevice device, @NonNull String channelId, - @NonNull LGWebOSHandler handler) { - super.onDeviceRemoved(device, channelId, handler); - channelListCache.remove(device.getId()); + public void onDeviceRemoved(String channelId, LGWebOSHandler handler) { + super.onDeviceRemoved(channelId, handler); + channelListCache.remove(handler.getThing().getUID()); } @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - if (hasCapability(device, TVControl.Channel_Set)) { - final String value = command.toString(); - final TVControl control = getControl(device); - List<ChannelInfo> channels = channelListCache.get(device.getId()); - if (channels == null) { - logger.warn("No channel list cached for this device {}, ignoring command.", device.getId()); + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + final String value = command.toString(); + + List<ChannelInfo> channels = channelListCache.get(handler.getThing().getUID()); + if (channels == null) { + logger.warn("No channel list cached for this device {}, ignoring command.", + handler.getThing().getUID().toString()); + } else { + Optional<ChannelInfo> channelInfo = channels.stream().filter(c -> c.getChannelNumber().equals(value)) + .findFirst(); + if (channelInfo.isPresent()) { + handler.getSocket().setChannel(channelInfo.get(), objResponseListener); } else { - Optional<ChannelInfo> channelInfo = channels.stream().filter(c -> c.getNumber().equals(value)) - .findFirst(); - if (channelInfo.isPresent()) { - control.setChannel(channelInfo.get(), getDefaultResponseListener()); - } else { - logger.warn("TV does not have a channel: {}.", value); - } + logger.warn("TV does not have a channel: {}.", value); } } + } @Override - protected Optional<ServiceSubscription<ChannelListener>> getSubscription(ConnectableDevice device, String channelId, - LGWebOSHandler handler) { - if (hasCapability(device, TVControl.Channel_Subscribe)) { - return Optional.of(getControl(device).subscribeCurrentChannel(new ChannelListener() { + protected Optional<ServiceSubscription<ChannelInfo>> getSubscription(String channelId, LGWebOSHandler handler) { + return Optional.of(handler.getSocket().subscribeCurrentChannel(new ResponseListener<ChannelInfo>() { - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.debug("Error in listening to channel changes: {}.", error == null ? "" : error.getMessage()); - } + @Override + public void onError(@Nullable String error) { + logger.debug("Error in listening to channel changes: {}.", error); + } - @Override - public void onSuccess(@Nullable ChannelInfo channelInfo) { - if (channelInfo == null) { - return; - } - handler.postUpdate(channelId, new StringType(channelInfo.getNumber())); + @Override + public void onSuccess(@Nullable ChannelInfo channelInfo) { + if (channelInfo == null) { + return; } - })); - } else { - return Optional.empty(); - } + handler.postUpdate(channelId, new StringType(channelInfo.getChannelNumber())); + } + })); + } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannelName.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannelName.java index bbe6f2f199956..f57cd4ddd5c26 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannelName.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/TVControlChannelName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,16 +19,12 @@ import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.ChannelInfo; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.core.ChannelInfo; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.TVControl; -import com.connectsdk.service.capability.TVControl.ChannelListener; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; - /** * Handles TV Control Channel State. This is read only. * Subscribes to to current channel name. @@ -36,41 +32,30 @@ * @author Sebastian Prehn - initial contribution */ @NonNullByDefault -public class TVControlChannelName extends BaseChannelHandler<ChannelListener, Object> { +public class TVControlChannelName extends BaseChannelHandler<ChannelInfo> { private final Logger logger = LoggerFactory.getLogger(TVControlChannelName.class); - private TVControl getControl(ConnectableDevice device) { - return device.getCapability(TVControl.class); - } - @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { // nothing to do, this is read only. } @Override - protected Optional<ServiceSubscription<ChannelListener>> getSubscription(ConnectableDevice device, String channelId, - LGWebOSHandler handler) { - if (hasCapability(device, TVControl.Channel_Subscribe)) { - return Optional.of(getControl(device).subscribeCurrentChannel(new ChannelListener() { - - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.debug("Error in listening to channel name changes: {}.", - error == null ? "" : error.getMessage()); + protected Optional<ServiceSubscription<ChannelInfo>> getSubscription(String channelId, LGWebOSHandler handler) { + return Optional.of(handler.getSocket().subscribeCurrentChannel(new ResponseListener<ChannelInfo>() { + @Override + public void onError(@Nullable String error) { + logger.debug("Error in listening to channel name changes: {}.", error); + } + + @Override + public void onSuccess(@Nullable ChannelInfo channelInfo) { + if (channelInfo == null) { + return; } + handler.postUpdate(channelId, new StringType(channelInfo.getName())); + } + })); - @Override - public void onSuccess(@Nullable ChannelInfo channelInfo) { - if (channelInfo == null) { - return; - } - handler.postUpdate(channelId, new StringType(channelInfo.getName())); - } - })); - } else { - return Optional.empty(); - } } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ToastControlToast.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ToastControlToast.java index 4bf359464497c..962bb4b3a862c 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ToastControlToast.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/ToastControlToast.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,37 +13,20 @@ package org.openhab.binding.lgwebos.internal; import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.ToastControl; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; /** * Handles Toast Control Command. This allows to send messages to the TV screen. * - * @author Sebastian Prehn - initial contribution + * @author Sebastian Prehn - Initial contribution */ @NonNullByDefault -public class ToastControlToast extends BaseChannelHandler<Void, Object> { - private final Logger logger = LoggerFactory.getLogger(ToastControlToast.class); - - private ToastControl getControl(ConnectableDevice device) { - return device.getCapability(ToastControl.class); - } +public class ToastControlToast extends BaseChannelHandler<CommandConfirmation> { @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - if (hasCapability(device, ToastControl.Show_Toast)) { - final String value = command.toString(); - getControl(device).showToast(value, getDefaultResponseListener()); - } + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + handler.getSocket().showToast(command.toString(), getDefaultResponseListener()); } } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlMute.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlMute.java index 8028069886e8b..293b89a392061 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlMute.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlMute.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,64 +19,49 @@ import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.VolumeControl; -import com.connectsdk.service.capability.VolumeControl.MuteListener; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; - /** * Handles TV Control Mute Command. * * @author Sebastian Prehn - initial contribution */ @NonNullByDefault -public class VolumeControlMute extends BaseChannelHandler<MuteListener, Object> { +public class VolumeControlMute extends BaseChannelHandler<Boolean> { private final Logger logger = LoggerFactory.getLogger(VolumeControlMute.class); - private VolumeControl getControl(ConnectableDevice device) { - return device.getCapability(VolumeControl.class); - } + private final ResponseListener<CommandConfirmation> objResponseListener = createResponseListener(); @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { if (OnOffType.ON == command || OnOffType.OFF == command) { - if (hasCapability(device, VolumeControl.Mute_Set)) { - getControl(device).setMute(OnOffType.ON == command, getDefaultResponseListener()); - } + handler.getSocket().setMute(OnOffType.ON == command, objResponseListener); } else { logger.warn("Only accept OnOffType. Type was {}.", command.getClass()); } } @Override - protected Optional<ServiceSubscription<MuteListener>> getSubscription(ConnectableDevice device, String channelId, - LGWebOSHandler handler) { - if (hasCapability(device, VolumeControl.Mute_Subscribe)) { - return Optional.of(getControl(device).subscribeMute(new MuteListener() { + protected Optional<ServiceSubscription<Boolean>> getSubscription(String channelId, LGWebOSHandler handler) { + return Optional.of(handler.getSocket().subscribeMute(new ResponseListener<Boolean>() { - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.debug("Error in listening to mute changes: {}.", error == null ? "" : error.getMessage()); - } + @Override + public void onError(@Nullable String error) { + logger.debug("Error in listening to mute changes: {}.", error); + } - @Override - public void onSuccess(@Nullable Boolean value) { - if (value == null) { - return; - } - handler.postUpdate(channelId, OnOffType.from(value)); + @Override + public void onSuccess(@Nullable Boolean value) { + if (value == null) { + return; } - })); - } else { - return Optional.empty(); - } + handler.postUpdate(channelId, OnOffType.from(value)); + } + })); } + } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlVolume.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlVolume.java index 8fe6b5e33ee90..bac220819e58c 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlVolume.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/VolumeControlVolume.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,15 +23,12 @@ import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.lgwebos.internal.handler.LGWebOSHandler; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.service.capability.VolumeControl; -import com.connectsdk.service.capability.VolumeControl.VolumeListener; -import com.connectsdk.service.command.ServiceCommandError; -import com.connectsdk.service.command.ServiceSubscription; - /** * Handles TV Control Volume Commands. Allows to set a volume to an absolute number or increment and decrement the * volume. If used with On Off type commands it will mute volume when receiving OFF and unmute when receiving ON. @@ -39,68 +36,54 @@ * @author Sebastian Prehn - initial contribution */ @NonNullByDefault -public class VolumeControlVolume extends BaseChannelHandler<VolumeListener, Object> { +public class VolumeControlVolume extends BaseChannelHandler<Float> { private final Logger logger = LoggerFactory.getLogger(VolumeControlVolume.class); - private VolumeControl getControl(ConnectableDevice device) { - return device.getCapability(VolumeControl.class); - } + private final ResponseListener<CommandConfirmation> objResponseListener = createResponseListener(); @Override - public void onReceiveCommand(@Nullable ConnectableDevice device, String channelId, LGWebOSHandler handler, - Command command) { - if (device == null) { - return; - } - PercentType percent = null; + public void onReceiveCommand(String channelId, LGWebOSHandler handler, Command command) { + final PercentType percent; if (command instanceof PercentType) { percent = (PercentType) command; } else if (command instanceof DecimalType) { percent = new PercentType(((DecimalType) command).toBigDecimal()); } else if (command instanceof StringType) { percent = new PercentType(((StringType) command).toString()); + } else { + percent = null; } + if (percent != null) { - if (hasCapability(device, VolumeControl.Volume_Set)) { - getControl(device).setVolume(percent.floatValue() / 100.0f, getDefaultResponseListener()); - } + handler.getSocket().setVolume(percent.floatValue() / 100.0f, objResponseListener); } else if (IncreaseDecreaseType.INCREASE == command) { - if (hasCapability(device, VolumeControl.Volume_Up_Down)) { - getControl(device).volumeUp(getDefaultResponseListener()); - } + handler.getSocket().volumeUp(objResponseListener); } else if (IncreaseDecreaseType.DECREASE == command) { - if (hasCapability(device, VolumeControl.Volume_Up_Down)) { - getControl(device).volumeDown(getDefaultResponseListener()); - } + handler.getSocket().volumeDown(objResponseListener); } else if (OnOffType.OFF == command || OnOffType.ON == command) { - if (hasCapability(device, VolumeControl.Mute_Set)) { - getControl(device).setMute(OnOffType.OFF == command, getDefaultResponseListener()); - } + handler.getSocket().setMute(OnOffType.OFF == command, objResponseListener); } else { logger.warn("Only accept PercentType, DecimalType, StringType command. Type was {}.", command.getClass()); } } @Override - protected Optional<ServiceSubscription<VolumeListener>> getSubscription(ConnectableDevice device, String channelUID, - LGWebOSHandler handler) { - if (hasCapability(device, VolumeControl.Volume_Subscribe)) { - return Optional.of(getControl(device).subscribeVolume(new VolumeListener() { + protected Optional<ServiceSubscription<Float>> getSubscription(String channelUID, LGWebOSHandler handler) { + return Optional.of(handler.getSocket().subscribeVolume(new ResponseListener<Float>() { - @Override - public void onError(@Nullable ServiceCommandError error) { - logger.debug("Error in listening to volume changes: {}.", error == null ? "" : error.getMessage()); - } + @Override + public void onError(@Nullable String error) { + logger.debug("Error in listening to volume changes: {}.", error); + } - @Override - public void onSuccess(@Nullable Float value) { - if (value != null) { - handler.postUpdate(channelUID, new PercentType(Math.round(value * 100))); - } + @Override + public void onSuccess(@Nullable Float value) { + if (value != null && !Float.isNaN(value)) { + handler.postUpdate(channelUID, new PercentType(Math.round(value * 100))); } - })); - } else { - return Optional.empty(); - } + } + })); + } + } diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSDiscovery.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSDiscovery.java deleted file mode 100644 index 712c9c758bd78..0000000000000 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSDiscovery.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.lgwebos.internal.discovery; - -import static org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants.*; - -import java.io.File; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Map; -import java.util.Optional; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.config.core.ConfigConstants; -import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; -import org.eclipse.smarthome.config.discovery.DiscoveryResult; -import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; -import org.eclipse.smarthome.config.discovery.DiscoveryService; -import org.eclipse.smarthome.core.net.NetworkAddressService; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.connectsdk.core.Context; -import com.connectsdk.core.Util; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.discovery.DiscoveryManager; -import com.connectsdk.discovery.DiscoveryManagerListener; -import com.connectsdk.service.command.ServiceCommandError; - -/** - * This class provides the bridge between openhab thing discovery and connect sdk device discovery. - * - * @author Sebastian Prehn - initial contribution - */ -@NonNullByDefault -@Component(service = { DiscoveryService.class, - LGWebOSDiscovery.class }, immediate = true, configurationPid = "binding.lgwebos") -public class LGWebOSDiscovery extends AbstractDiscoveryService implements DiscoveryManagerListener, Context { - private static final int DISCOVERY_TIMEOUT_SECONDS = 5; - - private final Logger logger = LoggerFactory.getLogger(LGWebOSDiscovery.class); - - private @Nullable DiscoveryManager discoveryManager; - - private @Nullable NetworkAddressService networkAddressService; - private Optional<InetAddress> localInetAddressesOverride = Optional.empty(); - - public LGWebOSDiscovery() { - super(LGWebOSBindingConstants.SUPPORTED_THING_TYPES_UIDS, DISCOVERY_TIMEOUT_SECONDS, true); - DiscoveryManager.init(this); - } - - @Reference - protected void setNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = networkAddressService; - } - - protected void unsetNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = null; - } - - @Override - protected void activate(@Nullable Map<String, @Nullable Object> configProperties) { - logger.debug("Config Parameters: {}", configProperties); - if (configProperties != null) { - localInetAddressesOverride = evaluateConfigPropertyLocalIP( - (String) configProperties.get(BINDING_CONFIGURATION_LOCALIP)); - } - Util.init(scheduler); - - DiscoveryManager manager = DiscoveryManager.getInstance(); - manager.setPairingLevel(DiscoveryManager.PairingLevel.ON); - manager.addListener(this); - discoveryManager = manager; - - super.activate(configProperties); // starts background discovery - } - - @Override - protected void deactivate() { - super.deactivate(); // stops background discovery - DiscoveryManager manager = discoveryManager; - if (manager != null) { - manager.removeListener(this); - } - discoveryManager = null; - DiscoveryManager.destroy(); - Util.uninit(); - } - - // @Override - @Override - protected void startScan() { - // no adhoc scanning. Discovery Service runs in background, but re-discover all known devices in case they were - // deleted from the inbox. - DiscoveryManager manager = discoveryManager; - if (manager != null) { - manager.getCompatibleDevices().values().forEach(device -> thingDiscovered(createDiscoveryResult(device))); - } - } - - @Override - protected void startBackgroundDiscovery() { - DiscoveryManager manager = discoveryManager; - if (manager != null) { - manager.start(); - } - } - - @Override - protected void stopBackgroundDiscovery() { - DiscoveryManager manager = discoveryManager; - if (manager != null) { - manager.stop(); - } - } - - // DiscoveryManagerListener - - @Override - public void onDeviceAdded(@Nullable DiscoveryManager manager, @Nullable ConnectableDevice device) { - if (device == null) { - throw new IllegalArgumentException("ConnectableDevice must not be null"); - } - thingDiscovered(createDiscoveryResult(device)); - } - - @Override - public void onDeviceUpdated(@Nullable DiscoveryManager manager, @Nullable ConnectableDevice device) { - logger.debug("Device updated: {}", device); - } - - @Override - public void onDeviceRemoved(@Nullable DiscoveryManager manager, @Nullable ConnectableDevice device) { - if (device == null) { - throw new IllegalArgumentException("ConnectableDevice must not be null"); - } - logger.debug("Device removed: {}", device); - thingRemoved(createThingUID(device)); - } - - @Override - public void onDiscoveryFailed(@Nullable DiscoveryManager manager, @Nullable ServiceCommandError error) { - logger.warn("Discovery Failed {}", error == null ? "" : error.getMessage()); - } - - // Helpers for DiscoveryManagerListener Impl - private DiscoveryResult createDiscoveryResult(ConnectableDevice device) { - ThingUID thingUID = createThingUID(device); - return DiscoveryResultBuilder.create(thingUID).withLabel(device.getFriendlyName()) - .withProperty(PROPERTY_DEVICE_ID, device.getId()).withRepresentationProperty(PROPERTY_DEVICE_ID) - .build(); - } - - private ThingUID createThingUID(ConnectableDevice device) { - return new ThingUID(THING_TYPE_WEBOSTV, device.getId()); - } - - public @Nullable DiscoveryManager getDiscoveryManager() { - return this.discoveryManager; - } - - @Override - public String getDataDir() { - return ConfigConstants.getUserDataFolder() + File.separator + "lgwebos"; - } - - @Override - public String getApplicationName() { - return "openHAB"; - } - - @Override - public String getPackageName() { - // In combination with ApplicationName this is used by LG TVs to identify the client application. - // We don't want the actual package name. We need a constant namespace here. - return "org.openhab"; - } - - @Override - public @Nullable InetAddress getIpAddress() { - return localInetAddressesOverride.orElseGet(() -> getIpFromNetworkAddressService().orElse(null)); - } - - /** - * Evaluate local IP optional configuration property. - * - * @param localIP optional configuration string - * @return local ip or <code>empty</code> if property is not set or unparseable. - */ - private Optional<InetAddress> evaluateConfigPropertyLocalIP(@Nullable String localIP) { - if (localIP != null && !localIP.trim().isEmpty()) { - try { - logger.debug("localIP property was explicitly set to: {}", localIP); - return Optional.ofNullable(InetAddress.getByName(localIP.trim())); - } catch (UnknownHostException e) { - logger.warn("localIP property could not be parsed: {} Details: {}", localIP, e.getMessage()); - } - } - - return Optional.empty(); - } - - /** - * Uses OpenHAB's NetworkAddressService to determine the local primary network interface. - * - * @return local ip or <code>empty</code> if configured primary IP is not set or could not be parsed. - */ - @NonNullByDefault({}) - private Optional<InetAddress> getIpFromNetworkAddressService() { - NetworkAddressService service = networkAddressService; - if (service == null) { - throw new IllegalStateException( - "NetworkAddressService must be bound before getIpFromNetworkAddressService can be called."); - } - - String ipAddress = service.getPrimaryIpv4HostAddress(); - if (ipAddress == null) { - logger.warn("No network interface could be found."); - return Optional.empty(); - } - try { - return Optional.of(InetAddress.getByName(ipAddress)); - } catch (UnknownHostException e) { - logger.warn("Configured primary IP cannot be parsed: {} Details: {}", ipAddress, e.getMessage()); - return Optional.empty(); - } - } - -} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoveryParticipant.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoveryParticipant.java new file mode 100644 index 0000000000000..bd09c08f0204d --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoveryParticipant.java @@ -0,0 +1,76 @@ +/** + * 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.lgwebos.internal.discovery; + +import static org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants.*; + +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.upnp.UpnpDiscoveryParticipant; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.jupnp.model.meta.RemoteDevice; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This Upnp Discovery participant add the ability to auto discover LG Web OS devices on the network. + * Some users choose to not use upnp. Therefore this can only play an optional role and help discover the device and its + * ip. + * + * @author Sebastian Prehn - Initial contribution + */ +@NonNullByDefault +@Component(service = UpnpDiscoveryParticipant.class, immediate = true, configurationPid = "discovery.lgwebos.upnp") +public class LGWebOSUpnpDiscoveryParticipant implements UpnpDiscoveryParticipant { + + private final Logger logger = LoggerFactory.getLogger(LGWebOSUpnpDiscoveryParticipant.class); + + @Override + public Set<ThingTypeUID> getSupportedThingTypeUIDs() { + return SUPPORTED_THING_TYPES_UIDS; + } + + @Override + public @Nullable DiscoveryResult createResult(RemoteDevice device) { + ThingUID thingUID = getThingUID(device); + + if (thingUID == null) { + return null; + } + + return DiscoveryResultBuilder.create(thingUID).withLabel(device.getDetails().getFriendlyName()) + .withProperty(PROPERTY_DEVICE_ID, device.getIdentity().getUdn().getIdentifierString()) + .withProperty(CONFIG_HOST, device.getIdentity().getDescriptorURL().getHost()) + .withLabel(device.getDetails().getFriendlyName()) + .withProperty(PROPERTY_MODEL_NAME, device.getDetails().getModelDetails().getModelName()) + .withProperty(PROPERTY_MANUFACTURER, device.getDetails().getManufacturerDetails().getManufacturer()) + .withRepresentationProperty(PROPERTY_DEVICE_ID).withThingType(THING_TYPE_WEBOSTV).build(); + } + + @Override + public @Nullable ThingUID getThingUID(RemoteDevice device) { + logger.trace("Discovered remote device {}", device); + if (device.findService(UPNP_SERVICE_TYPE) != null) { + logger.debug("Found LG WebOS TV: {}", device); + return new ThingUID(THING_TYPE_WEBOSTV, device.getIdentity().getUdn().getIdentifierString()); + } + return null; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoverySearch.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoverySearch.java new file mode 100644 index 0000000000000..8defd27d3f54b --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/discovery/LGWebOSUpnpDiscoverySearch.java @@ -0,0 +1,89 @@ +/** + * 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.lgwebos.internal.discovery; + +import static org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants.*; + +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.jupnp.UpnpService; +import org.jupnp.model.message.header.ServiceTypeHeader; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * WebOS TV does not automatically show up by the normal background scans, as it does not respond to openHABs generic + * search request. A special ssdp search request for lge-com:service:webos-second-screen:1 is required. + * This component sends this ssdp search request. + * + * @author Sebastian Prehn - Initial contribution + * + */ +@NonNullByDefault +@Component(service = DiscoveryService.class, immediate = true, configurationPid = "discovery.lgwebos") +public class LGWebOSUpnpDiscoverySearch extends AbstractDiscoveryService { + private final Logger logger = LoggerFactory.getLogger(LGWebOSUpnpDiscoverySearch.class); + + private static final int DISCOVERY_TIMEOUT_SECONDS = 10; + private static final int SEARCH_INTERVAL_SECONDS = 10; + private static final int SEARCH_START_UP_DELAY_SECONDS = 0; + + private final UpnpService upnpService; + + private @Nullable ScheduledFuture<?> searchJob; + + @Activate + public LGWebOSUpnpDiscoverySearch(final @Reference UpnpService upnpService) { + super(SUPPORTED_THING_TYPES_UIDS, DISCOVERY_TIMEOUT_SECONDS, true); + this.upnpService = upnpService; + } + + private void search() { + logger.trace("Sending Upnp Search Request for {}", UPNP_SERVICE_TYPE); + upnpService.getControlPoint().search(new ServiceTypeHeader(UPNP_SERVICE_TYPE)); + } + + @Override + protected void startBackgroundDiscovery() { + logger.debug("Start LGWebOS device background discovery"); + ScheduledFuture<?> job = searchJob; + if (job == null || job.isCancelled()) { + searchJob = scheduler.scheduleWithFixedDelay(() -> search(), SEARCH_START_UP_DELAY_SECONDS, + SEARCH_INTERVAL_SECONDS, TimeUnit.SECONDS); + } + } + + @Override + protected void stopBackgroundDiscovery() { + logger.debug("Stop LGWebOS device background discovery"); + ScheduledFuture<?> job = searchJob; + if (job != null && !job.isCancelled()) { + job.cancel(false); + searchJob = null; + } + } + + @Override + protected void startScan() { + search(); + } +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSConfiguration.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSConfiguration.java new file mode 100644 index 0000000000000..536e2e1d78ce4 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSConfiguration.java @@ -0,0 +1,51 @@ +/** + * 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.lgwebos.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link LGWebOSConfiguration} class contains the thing configuration + * parameters for LGWebOS devices + * + * @author Sebastian Prehn - Initial contribution + */ +@NonNullByDefault +public class LGWebOSConfiguration { + @Nullable + String host; // name has to match LGWebOSBindingConstants.CONFIG_HOST + int port = 3000; // 3001 for TLS + @Nullable + String key; // name has to match LGWebOSBindingConstants.CONFIG_KEY + + public String getHost() { + String h = host; + return h == null ? "" : h; + } + + public String getKey() { + String k = key; + return k == null ? "" : k; + } + + public int getPort() { + return port; + } + + @Override + public String toString() { + return "WebOSConfiguration [host=" + host + ", port=" + port + ", key.length=" + getKey().length() + "]"; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java index ea4982e108533..40ecbab6d0a8a 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,11 +17,14 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.Optional; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; @@ -32,6 +35,7 @@ import org.eclipse.smarthome.core.types.State; import org.openhab.binding.lgwebos.action.LGWebOSActions; import org.openhab.binding.lgwebos.internal.ChannelHandler; +import org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants; import org.openhab.binding.lgwebos.internal.LauncherApplication; import org.openhab.binding.lgwebos.internal.MediaControlPlayer; import org.openhab.binding.lgwebos.internal.MediaControlStop; @@ -41,37 +45,50 @@ import org.openhab.binding.lgwebos.internal.ToastControlToast; import org.openhab.binding.lgwebos.internal.VolumeControlMute; import org.openhab.binding.lgwebos.internal.VolumeControlVolume; +import org.openhab.binding.lgwebos.internal.handler.LGWebOSTVSocket.WebOSTVSocketListener; +import org.openhab.binding.lgwebos.internal.handler.core.AppInfo; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.connectsdk.device.ConnectableDevice; -import com.connectsdk.device.ConnectableDeviceListener; -import com.connectsdk.discovery.DiscoveryManager; -import com.connectsdk.discovery.DiscoveryManagerListener; -import com.connectsdk.service.DeviceService; -import com.connectsdk.service.DeviceService.PairingType; -import com.connectsdk.service.command.ServiceCommandError; - /** * The {@link LGWebOSHandler} is responsible for handling commands, which are * sent to one of the channels. * * @author Sebastian Prehn - initial contribution */ -public class LGWebOSHandler extends BaseThingHandler implements ConnectableDeviceListener, DiscoveryManagerListener { +@NonNullByDefault +public class LGWebOSHandler extends BaseThingHandler implements LGWebOSTVSocket.ConfigProvider, WebOSTVSocketListener { + + /* + * constants for device polling + */ + private static final int RECONNECT_INTERVAL_SECONDS = 10; + private static final int RECONNECT_START_UP_DELAY_SECONDS = 0; + + /* + * error messages + */ + private static final String MSG_MISSING_PARAM = "Missing parameter \"host\""; private final Logger logger = LoggerFactory.getLogger(LGWebOSHandler.class); - private final DiscoveryManager discoveryManager; // ChannelID to CommandHandler Map private final Map<String, ChannelHandler> channelHandlers; - private String deviceId; - private LauncherApplication appLauncher = new LauncherApplication(); + private final LauncherApplication appLauncher = new LauncherApplication(); + private @Nullable LGWebOSTVSocket socket; + private final WebSocketClient webSocketClient; - public LGWebOSHandler(@NonNull Thing thing, DiscoveryManager discoveryManager) { + private @Nullable ScheduledFuture<?> reconnectJob; + private @Nullable ScheduledFuture<?> keepAliveJob; + + private @Nullable LGWebOSConfiguration config; + + public LGWebOSHandler(Thing thing, WebSocketClient webSocketClient) { super(thing); - this.discoveryManager = discoveryManager; + this.webSocketClient = webSocketClient; + Map<String, ChannelHandler> handlers = new HashMap<>(); handlers.put(CHANNEL_VOLUME, new VolumeControlVolume()); handlers.put(CHANNEL_POWER, new PowerControlPower()); @@ -85,13 +102,113 @@ public LGWebOSHandler(@NonNull Thing thing, DiscoveryManager discoveryManager) { channelHandlers = Collections.unmodifiableMap(handlers); } + private LGWebOSConfiguration getLGWebOSConfig() { + LGWebOSConfiguration c = config; + if (c == null) { + c = getConfigAs(LGWebOSConfiguration.class); + config = c; + } + return c; + } + + @Override + public void initialize() { + LGWebOSConfiguration c = getLGWebOSConfig(); + logger.trace("Handler initialized with config {}", c); + String host = c.getHost(); + if (host.isEmpty()) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, MSG_MISSING_PARAM); + return; + } + + LGWebOSTVSocket s = new LGWebOSTVSocket(webSocketClient, this, host, c.getPort()); + s.setListener(this); + socket = s; + + startReconnectJob(); + } + + @Override + public void dispose() { + stopKeepAliveJob(); + stopReconnectJob(); + + LGWebOSTVSocket s = socket; + if (s != null) { + s.setListener(null); + scheduler.execute(() -> s.disconnect()); // dispose should be none-blocking + } + socket = null; + super.dispose(); + } + + private void startReconnectJob() { + ScheduledFuture<?> job = reconnectJob; + if (job == null || job.isCancelled()) { + reconnectJob = scheduler.scheduleWithFixedDelay(() -> getSocket().connect(), + RECONNECT_START_UP_DELAY_SECONDS, RECONNECT_INTERVAL_SECONDS, TimeUnit.SECONDS); + } + } + + private void stopReconnectJob() { + ScheduledFuture<?> job = reconnectJob; + if (job != null && !job.isCancelled()) { + job.cancel(true); + } + reconnectJob = null; + } + + /** + * Keep alive ensures that the web socket connection is used and does not time out. + */ + private void startKeepAliveJob() { + ScheduledFuture<?> job = keepAliveJob; + if (job == null || job.isCancelled()) { + // half of idle time out setting + long keepAliveInterval = this.webSocketClient.getMaxIdleTimeout() / 2; + + // it is irrelevant which service is queried. Only need to send some packets over the wire + + keepAliveJob = scheduler + .scheduleWithFixedDelay(() -> getSocket().getRunningApp(new ResponseListener<AppInfo>() { + + @Override + public void onSuccess(AppInfo responseObject) { + // ignore - actual response is not relevant here + } + + @Override + public void onError(String message) { + // ignore + } + }), keepAliveInterval, keepAliveInterval, TimeUnit.MILLISECONDS); + + } + } + + private void stopKeepAliveJob() { + ScheduledFuture<?> job = keepAliveJob; + if (job != null && !job.isCancelled()) { + job.cancel(true); + } + keepAliveJob = null; + } + + public LGWebOSTVSocket getSocket() { + LGWebOSTVSocket s = this.socket; + if (s == null) { + throw new IllegalStateException("Component called before it was initialized or already disposed."); + } + return s; + } + public LauncherApplication getLauncherApplication() { return appLauncher; } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("handleCommand({},{}) is called", channelUID, command); + logger.debug("handleCommand({},{})", channelUID, command); ChannelHandler handler = channelHandlers.get(channelUID.getId()); if (handler == null) { logger.warn( @@ -99,86 +216,79 @@ public void handleCommand(ChannelUID channelUID, Command command) { command, channelUID); return; } - Optional<ConnectableDevice> device = getDevice(); - if (!device.isPresent()) { - logger.debug("Device {} not found - most likely is is currently offline. Details: Channel {}, Command {}.", - deviceId, channelUID.getId(), command); - } - handler.onReceiveCommand(device.orElse(null), channelUID.getId(), this, command); - } - public Optional<ConnectableDevice> getDevice() { - return discoveryManager.getCompatibleDevices().values().stream() - .filter(device -> deviceId.equals(device.getId())).findFirst(); + handler.onReceiveCommand(channelUID.getId(), this, command); } @Override - public void initialize() { - discoveryManager.addListener(this); - deviceId = getConfig().get(PROPERTY_DEVICE_ID).toString(); - - Optional<ConnectableDevice> deviceOpt = getDevice(); - if (deviceOpt.isPresent()) { - ConnectableDevice device = deviceOpt.get(); - device.addListener(this); - if (device.isConnected()) { - onDeviceReady(device); - } else { - updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE, "Connecting ..."); - device.connect(); - // on success onDeviceReady will be called, - // if pairing is required onPairingRequired, - // otherwise onConnectionFailed - } - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "TV is off"); - } + public String getKey() { + return getLGWebOSConfig().getKey(); } @Override - public void dispose() { - super.dispose(); - getDevice().ifPresent(device -> device.removeListener(this)); - discoveryManager.removeListener(this); + public void storeKey(@Nullable String key) { + // store it current configuration and avoiding complete re-initialization via handleConfigurationUpdate + getLGWebOSConfig().key = key; + + // persist the configuration change + Configuration configuration = editConfiguration(); + configuration.put(LGWebOSBindingConstants.CONFIG_KEY, key); + updateConfiguration(configuration); } - // Connectable Device Listener @Override - public void onDeviceReady(ConnectableDevice device) { // this gets called on connection success - updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, "Connected"); - refreshAllChannelSubscriptions(device); - channelHandlers.forEach((k, v) -> v.onDeviceReady(device, k, this)); + public void storeProperties(Map<String, String> properties) { + Map<String, String> map = editProperties(); + map.putAll(properties); + updateProperties(map); } @Override - public void onDeviceDisconnected(ConnectableDevice device) { - logger.debug("Device disconnected: {}", device); - for (Map.Entry<String, ChannelHandler> e : channelHandlers.entrySet()) { - e.getValue().onDeviceRemoved(device, e.getKey(), this); - e.getValue().removeAnySubscription(device); - } - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "TV is off"); - } + public void onStateChanged(LGWebOSTVSocket.State state) { + switch (state) { + case DISCONNECTED: + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "TV is off"); + channelHandlers.forEach((k, v) -> { + v.onDeviceRemoved(k, this); + v.removeAnySubscription(this); + }); + + stopKeepAliveJob(); + startReconnectJob(); + break; + + case REGISTERING: + stopReconnectJob(); + startKeepAliveJob(); + updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, + "Registering - You may need to confirm pairing on TV."); + break; + case REGISTERED: + updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, "Connected"); + channelHandlers.forEach((k, v) -> { + v.refreshSubscription(k, this); + v.onDeviceReady(k, this); + }); + break; - @Override - public void onPairingRequired(ConnectableDevice device, DeviceService service, PairingType pairingType) { - updateStatus(thing.getStatus(), ThingStatusDetail.CONFIGURATION_PENDING, "Pairing Required"); - } + } - @Override - public void onCapabilityUpdated(ConnectableDevice device, List<String> added, List<String> removed) { - logger.debug("Capabilities updated: {} - added: {} - removed: {}", device, added, removed); - refreshAllChannelSubscriptions(device); } @Override - public void onConnectionFailed(ConnectableDevice device, ServiceCommandError error) { - logger.debug("Connection failed: {} - error: {}", device, error.getMessage()); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, - "Connection Failed: " + error.getMessage()); + public void onError(String error) { + logger.debug("Connection failed - error: {}", error); + + switch (getSocket().getState()) { + case DISCONNECTED: + break; + case REGISTERING: + case REGISTERED: + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Connection Failed: " + error); + break; + } } - // callback methods for commandHandlers public void postUpdate(String channelId, State state) { updateState(channelId, state); } @@ -199,8 +309,6 @@ public void channelUnlinked(ChannelUID channelUID) { refreshChannelSubscription(channelUID); } - // private helpers - /** * Refresh channel subscription for one specific channel. * @@ -208,51 +316,10 @@ public void channelUnlinked(ChannelUID channelUID) { */ private void refreshChannelSubscription(ChannelUID channelUID) { String channelId = channelUID.getId(); - - getDevice().ifPresent(device -> { - // may be called even if the device is not currently connected - if (device.isConnected()) { - channelHandlers.get(channelId).refreshSubscription(device, channelId, this); - } - }); - } - - /** - * Refresh channel subscriptions on all handlers. - * - * @param device must not be <code>null</code> - */ - private void refreshAllChannelSubscriptions(ConnectableDevice device) { - channelHandlers.forEach((k, v) -> v.refreshSubscription(device, k, this)); - } - - // just to make sure, this device is registered, if it was powered off during initialization - @Override - public void onDeviceAdded(DiscoveryManager manager, ConnectableDevice device) { - if (device.getId().equals(deviceId)) { - device.removeListener(this); - device.addListener(this); - updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, "Device Ready"); - device.connect(); - } - } - - @Override - public void onDeviceUpdated(DiscoveryManager manager, ConnectableDevice device) { - if (device.getId().equals(deviceId)) { - device.removeListener(this); - device.addListener(this); + if (getSocket().isConnected()) { + channelHandlers.get(channelId).refreshSubscription(channelId, this); } - } - @Override - public void onDeviceRemoved(DiscoveryManager manager, ConnectableDevice device) { - // NOP - } - - @Override - public void onDiscoveryFailed(DiscoveryManager manager, ServiceCommandError error) { - // NOP } @Override diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVKeyboardInput.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVKeyboardInput.java new file mode 100644 index 0000000000000..f84a2ab4fc17f --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVKeyboardInput.java @@ -0,0 +1,204 @@ +/** + * 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 + */ +/* + * WebOSTVKeyboardInput + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler; + +import java.util.ArrayList; +import java.util.List; + +import org.openhab.binding.lgwebos.internal.handler.command.ServiceCommand; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; +import org.openhab.binding.lgwebos.internal.handler.core.TextInputStatusInfo; + +import com.google.gson.JsonObject; + +/** + * {@link LGWebOSTVKeyboardInput} handles WebOSTV keyboard api. + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +public class LGWebOSTVKeyboardInput { + + private LGWebOSTVSocket service; + private boolean waiting; + private final List<String> toSend; + + private static final String KEYBOARD_INPUT = "ssap://com.webos.service.ime/registerRemoteKeyboard"; + private static final String ENTER = "ENTER"; + private static final String DELETE = "DELETE"; + + public LGWebOSTVKeyboardInput(LGWebOSTVSocket service) { + this.service = service; + waiting = false; + toSend = new ArrayList<String>(); + } + + public void sendText(String input) { + toSend.add(input); + if (!waiting) { // TODO: use a latch,and send in any case + sendData(); + } + } + + public void sendEnter() { + sendText(ENTER); + } + + public void sendDel() { + if (toSend.size() == 0) { + toSend.add(DELETE); + if (!waiting) { + sendData(); + } + } else { + toSend.remove(toSend.size() - 1); + } + } + + private void sendData() { + waiting = true; + + String uri; + String typeTest = toSend.get(0); + + JsonObject payload = new JsonObject(); + + if (typeTest.equals(ENTER)) { + toSend.remove(0); + uri = "ssap://com.webos.service.ime/sendEnterKey"; + } else if (typeTest.equals(DELETE)) { + uri = "ssap://com.webos.service.ime/deleteCharacters"; + + int count = 0; + while (toSend.size() > 0 && toSend.get(0).equals(DELETE)) { + toSend.remove(0); + count++; + } + + payload.addProperty("count", count); + + } else { + uri = "ssap://com.webos.service.ime/insertText"; + StringBuilder sb = new StringBuilder(); + + while (toSend.size() > 0 && !(toSend.get(0).equals(DELETE) || toSend.get(0).equals(ENTER))) { + String text = toSend.get(0); + sb.append(text); + toSend.remove(0); + } + + payload.addProperty("text", sb.toString()); + payload.addProperty("replace", 0); + + } + + ResponseListener<JsonObject> responseListener = new ResponseListener<JsonObject>() { + + @Override + public void onSuccess(JsonObject response) { + waiting = false; + if (toSend.size() > 0) { + sendData(); + } + } + + @Override + public void onError(String error) { + waiting = false; + if (toSend.size() > 0) { + sendData(); + } + } + }; + + ServiceCommand<JsonObject> request = new ServiceCommand<>(uri, payload, x -> x, responseListener); + service.sendCommand(request); + } + + public ServiceSubscription<TextInputStatusInfo> connect(final ResponseListener<TextInputStatusInfo> listener) { + ServiceSubscription<TextInputStatusInfo> subscription = new ServiceSubscription<>(KEYBOARD_INPUT, null, + rawData -> parseRawKeyboardData(rawData), listener); + service.sendCommand(subscription); + + return subscription; + } + + private TextInputStatusInfo parseRawKeyboardData(JsonObject rawData) { + boolean focused = false; + String contentType = null; + boolean predictionEnabled = false; + boolean correctionEnabled = false; + boolean autoCapitalization = false; + boolean hiddenText = false; + boolean focusChanged = false; + + TextInputStatusInfo keyboard = new TextInputStatusInfo(); + keyboard.setRawData(rawData); + + if (rawData.has("currentWidget")) { + JsonObject currentWidget = (JsonObject) rawData.get("currentWidget"); + focused = currentWidget.get("focus").getAsBoolean(); + + if (currentWidget.has("contentType")) { + contentType = currentWidget.get("contentType").getAsString(); + } + if (currentWidget.has("predictionEnabled")) { + predictionEnabled = currentWidget.get("predictionEnabled").getAsBoolean(); + } + if (currentWidget.has("correctionEnabled")) { + correctionEnabled = currentWidget.get("correctionEnabled").getAsBoolean(); + } + if (currentWidget.has("autoCapitalization")) { + autoCapitalization = currentWidget.get("autoCapitalization").getAsBoolean(); + } + if (currentWidget.has("hiddenText")) { + hiddenText = currentWidget.get("hiddenText").getAsBoolean(); + } + } + if (rawData.has("focusChanged")) { + focusChanged = rawData.get("focusChanged").getAsBoolean(); + } + + keyboard.setFocused(focused); + keyboard.setContentType(contentType); + keyboard.setPredictionEnabled(predictionEnabled); + keyboard.setCorrectionEnabled(correctionEnabled); + keyboard.setAutoCapitalization(autoCapitalization); + keyboard.setHiddenText(hiddenText); + keyboard.setFocusChanged(focusChanged); + + return keyboard; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVMouseSocket.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVMouseSocket.java new file mode 100644 index 0000000000000..bdea494961694 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVMouseSocket.java @@ -0,0 +1,210 @@ +/** + * 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.lgwebos.internal.handler; + +import java.io.IOException; +import java.net.URI; +import java.util.Optional; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.websocket.api.Session; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; +import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * WebSocket implementation to connect to WebOSTV mouse api. + * + * @author Sebastian Prehn - Initial contribution + * + */ +@WebSocket() +@NonNullByDefault +public class LGWebOSTVMouseSocket { + private final Logger logger = LoggerFactory.getLogger(LGWebOSTVMouseSocket.class); + + public enum State { + DISCONNECTED, + CONNECTING, + CONNECTED, + DISCONNECTING + } + + public enum ButtonType { + HOME, + BACK, + UP, + DOWN, + LEFT, + RIGHT, + } + + private State state = State.DISCONNECTED; + private final WebSocketClient client; + private @Nullable Session session; + private @Nullable WebOSTVMouseSocketListener listener; + + public LGWebOSTVMouseSocket(WebSocketClient client) { + this.client = client; + } + + public State getState() { + return state; + } + + private void setState(State state) { + State oldState = this.state; + this.state = state; + Optional.ofNullable(this.listener).ifPresent(l -> l.onStateChanged(oldState, this.state)); + } + + public interface WebOSTVMouseSocketListener { + + public void onStateChanged(State oldState, State newState); + + public void onError(String errorMessage); + + } + + public void setListener(@Nullable WebOSTVMouseSocketListener listener) { + this.listener = listener; + } + + public void connect(URI destUri) { + synchronized (this) { + if (state != State.DISCONNECTED) { + logger.debug("Already connecting; not trying to connect again: {}", state); + return; + } + setState(State.CONNECTING); + } + + try { + this.client.connect(this, destUri); + logger.debug("Connecting to: {}", destUri); + } catch (IOException e) { + logger.warn("Unable to connect.", e); + setState(State.DISCONNECTED); + } + } + + public void disconnect() { + setState(State.DISCONNECTING); + try { + Optional.ofNullable(this.session).ifPresent(s -> s.close()); + } catch (Exception e) { + logger.debug("Error connecting to device.", e); + } + setState(State.DISCONNECTED); + } + + @OnWebSocketClose + public void onClose(int statusCode, String reason) { + setState(State.DISCONNECTED); + logger.debug("WebSocket Closed - Code: {}, Reason: {}", statusCode, reason); + this.session = null; + } + + @OnWebSocketConnect + public void onConnect(Session session) { + logger.debug("WebSocket Connected to: {}", session.getRemoteAddress().getAddress()); + this.session = session; + setState(State.CONNECTED); + } + + @OnWebSocketMessage + public void onMessage(String message) { + logger.debug("Message [in]: {}", message); + } + + @OnWebSocketError + public void onError(Throwable cause) { + Optional.ofNullable(this.listener).ifPresent(l -> l.onError(cause.getMessage())); + logger.debug("Connection Error.", cause); + } + + private void sendMessage(String msg) { + Session s = this.session; + try { + if (s != null) { + logger.debug("Message [out]: {}", msg); + s.getRemote().sendString(msg); + } else { + logger.warn("No Connection to TV, skipping [out]: {}", msg); + } + + } catch (IOException e) { + logger.error("Unable to send message.", e); + } + } + + public void click() { + sendMessage("type:click\n" + "\n"); + } + + public void button(ButtonType type) { + String keyName; + switch (type) { + case HOME: + keyName = "HOME"; + break; + case BACK: + keyName = "BACK"; + break; + case UP: + keyName = "UP"; + break; + case DOWN: + keyName = "DOWN"; + break; + case LEFT: + keyName = "LEFT"; + break; + case RIGHT: + keyName = "RIGHT"; + break; + + default: + keyName = "NONE"; + break; + } + + button(keyName); + } + + public void button(String keyName) { + sendMessage("type:button\n" + "name:" + keyName + "\n" + "\n"); + + } + + public void move(double dx, double dy) { + sendMessage("type:move\n" + "dx:" + dx + "\n" + "dy:" + dy + "\n" + "down:0\n" + "\n"); + + } + + public void move(double dx, double dy, boolean drag) { + sendMessage("type:move\n" + "dx:" + dx + "\n" + "dy:" + dy + "\n" + "down:" + (drag ? 1 : 0) + "\n" + "\n"); + + } + + public void scroll(double dx, double dy) { + sendMessage("type:scroll\n" + "dx:" + dx + "\n" + "dy:" + dy + "\n" + "\n"); + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVSocket.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVSocket.java new file mode 100644 index 0000000000000..631a0d166bfb0 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/LGWebOSTVSocket.java @@ -0,0 +1,822 @@ +/** + * 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 + */ +/* + * This file is based on: + * + * WebOSTVService + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openhab.binding.lgwebos.internal.handler; + +import static org.openhab.binding.lgwebos.internal.LGWebOSBindingConstants.*; + +import java.io.IOException; +import java.net.ConnectException; +import java.net.SocketTimeoutException; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.websocket.api.Session; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketError; +import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; +import org.eclipse.jetty.websocket.api.annotations.WebSocket; +import org.eclipse.jetty.websocket.client.WebSocketClient; +import org.openhab.binding.lgwebos.internal.handler.LGWebOSTVMouseSocket.WebOSTVMouseSocketListener; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceCommand; +import org.openhab.binding.lgwebos.internal.handler.command.ServiceSubscription; +import org.openhab.binding.lgwebos.internal.handler.core.AppInfo; +import org.openhab.binding.lgwebos.internal.handler.core.ChannelInfo; +import org.openhab.binding.lgwebos.internal.handler.core.CommandConfirmation; +import org.openhab.binding.lgwebos.internal.handler.core.LaunchSession; +import org.openhab.binding.lgwebos.internal.handler.core.LaunchSession.LaunchSessionType; +import org.openhab.binding.lgwebos.internal.handler.core.Response; +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; +import org.openhab.binding.lgwebos.internal.handler.core.TextInputStatusInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; + +/** + * WebSocket to handle the communication with WebOS device. + * + * @author Hyun Kook Khang - Initial contribution + * @author Sebastian Prehn - Web Socket implementation and adoption for openHAB + */ +@WebSocket() +@NonNullByDefault +public class LGWebOSTVSocket { + + private static final Gson GSON = new GsonBuilder().create(); + + public enum State { + DISCONNECTED, + REGISTERING, + REGISTERED + } + + private State state = State.DISCONNECTED; + + private final ConfigProvider config; + private final WebSocketClient client; + private @Nullable Session session; + private final URI destUri; + private @Nullable WebOSTVSocketListener listener; + private final LGWebOSTVKeyboardInput keyboardInput; + /** + * Requests to which we are awaiting response. + */ + private HashMap<Integer, ServiceCommand<?>> requests = new HashMap<>(); + + private final Logger logger = LoggerFactory.getLogger(LGWebOSTVSocket.class); + private int nextRequestId = 0; + + private static final String FOREGROUND_APP = "ssap://com.webos.applicationManager/getForegroundAppInfo"; + // private static final String APP_STATUS = "ssap://com.webos.service.appstatus/getAppStatus"; + // private static final String APP_STATE = "ssap://system.launcher/getAppState"; + private static final String VOLUME = "ssap://audio/getVolume"; + private static final String MUTE = "ssap://audio/getMute"; + // private static final String VOLUME_STATUS = "ssap://audio/getStatus"; + private static final String CHANNEL_LIST = "ssap://tv/getChannelList"; + private static final String CHANNEL = "ssap://tv/getCurrentChannel"; + // private static final String PROGRAM = "ssap://tv/getChannelProgramInfo"; + // private static final String CURRENT_PROGRAM = "ssap://tv/getChannelCurrentProgramInfo"; + // private static final String THREED_STATUS = "ssap://com.webos.service.tv.display/get3DStatus"; + + public LGWebOSTVSocket(WebSocketClient client, ConfigProvider config, String host, int port) { + this.config = config; + this.client = client; + this.keyboardInput = new LGWebOSTVKeyboardInput(this); + + try { + this.destUri = new URI("ws://" + host + ":" + port); + } catch (URISyntaxException e) { + throw new IllegalArgumentException("IP address or hostname provided is invalid: " + host); + } + } + + public State getState() { + return state; + } + + private void setState(State state) { + State oldState = this.state; + if (oldState != state) { + this.state = state; + Optional.ofNullable(this.listener).ifPresent(l -> l.onStateChanged(this.state)); + } + } + + public void setListener(@Nullable WebOSTVSocketListener listener) { + this.listener = listener; + } + + public void clearRequests() { + requests.clear(); + } + + public void connect() { + try { + this.client.connect(this, this.destUri); + logger.debug("Connecting to: {}", this.destUri); + } catch (IOException e) { + logger.debug("Unable to connect.", e); + } + } + + public void disconnect() { + Optional.ofNullable(this.session).ifPresent(s -> s.close()); + setState(State.DISCONNECTED); + } + /* + * WebSocket Callbacks + */ + + @OnWebSocketConnect + public void onConnect(Session session) { + logger.debug("WebSocket Connected to: {}", session.getRemoteAddress().getAddress()); + this.session = session; + sendHello(); + } + + @OnWebSocketError + public void onError(Throwable cause) { + logger.trace("Connection Error", cause); + if (cause instanceof SocketTimeoutException && "Connect Timeout".equals(cause.getMessage())) { + // this is expected during connection attempts while TV is off + setState(State.DISCONNECTED); + return; + } + if (cause instanceof ConnectException && "Connection refused".equals(cause.getMessage())) { + // this is expected during TV startup or shutdown + return; + } + + Optional.ofNullable(this.listener).ifPresent(l -> l.onError(cause.getMessage())); + } + + @OnWebSocketClose + public void onClose(int statusCode, String reason) { + logger.debug("WebSocket Closed - Code: {}, Reason: {}", statusCode, reason); + this.requests.clear(); + this.session = null; + setState(State.DISCONNECTED); + } + + /* + * WebOS WebSocket API specific Communication + */ + void sendHello() { + JsonObject packet = new JsonObject(); + packet.addProperty("id", nextRequestId()); + packet.addProperty("type", "hello"); + + JsonObject payload = new JsonObject(); + payload.addProperty("appId", "org.openhab"); + payload.addProperty("appName", "openHAB"); + payload.addProperty("appRegion", Locale.getDefault().getDisplayCountry()); + packet.add("payload", payload); + // the hello response will not contain id, therefore not registering in requests + sendMessage(packet); + } + + void sendRegister() { + setState(State.REGISTERING); + + JsonObject packet = new JsonObject(); + int id = nextRequestId(); + packet.addProperty("id", id); + packet.addProperty("type", "register"); + + JsonObject manifest = new JsonObject(); + manifest.addProperty("manifestVersion", 1); + + String[] permissions = { "LAUNCH", "LAUNCH_WEBAPP", "APP_TO_APP", "CONTROL_AUDIO", + "CONTROL_INPUT_MEDIA_PLAYBACK", "CONTROL_POWER", "READ_INSTALLED_APPS", "CONTROL_DISPLAY", + "CONTROL_INPUT_JOYSTICK", "CONTROL_INPUT_MEDIA_RECORDING", "CONTROL_INPUT_TV", "READ_INPUT_DEVICE_LIST", + "READ_NETWORK_STATE", "READ_TV_CHANNEL_LIST", "WRITE_NOTIFICATION_TOAST", "CONTROL_INPUT_TEXT", + "CONTROL_MOUSE_AND_KEYBOARD", "READ_CURRENT_CHANNEL", "READ_RUNNING_APPS" }; + + manifest.add("permissions", GSON.toJsonTree(permissions)); + + JsonObject payload = new JsonObject(); + String key = config.getKey(); + if (!key.isEmpty()) { + payload.addProperty("client-key", key); + } + payload.addProperty("pairingType", "PROMPT"); // PIN, COMBINED + payload.add("manifest", manifest); + packet.add("payload", payload); + ResponseListener<JsonObject> dummyListener = new ResponseListener<JsonObject>() { + + @Override + public void onSuccess(@Nullable JsonObject payload) { + // Noting to do here. TV shows PROMPT dialog. + // Waiting for message of type error or registered + } + + @Override + public void onError(String message) { + logger.debug("Registration failed with message: {}", message); + disconnect(); + } + + }; + + this.requests.put(id, new ServiceSubscription<JsonObject>("dummy", payload, x -> x, dummyListener)); + sendMessage(packet); + } + + private int nextRequestId() { + int requestId; + do { + requestId = nextRequestId++; + } while (requests.containsKey(requestId)); + return requestId; + } + + public void sendCommand(ServiceCommand<?> command) { + switch (state) { + case REGISTERED: + int requestId = nextRequestId(); + requests.put(requestId, command); + JsonObject packet = new JsonObject(); + packet.addProperty("type", command.getType()); + packet.addProperty("id", requestId); + packet.addProperty("uri", command.getTarget()); + JsonElement payload = command.getPayload(); + if (payload != null) { + packet.add("payload", payload); + } + this.sendMessage(packet); + + break; + case REGISTERING: + case DISCONNECTED: + logger.warn("Skipping command {} for {} in state {}", command, command.getTarget(), state); + break; + } + + } + + public void unsubscribe(ServiceSubscription<?> subscription) { + Optional<Entry<Integer, ServiceCommand<?>>> entry = this.requests.entrySet().stream() + .filter(e -> e.getValue().equals(subscription)).findFirst(); + if (entry.isPresent()) { + int requestId = entry.get().getKey(); + this.requests.remove(requestId); + JsonObject packet = new JsonObject(); + packet.addProperty("type", "unsubscribe"); + packet.addProperty("id", requestId); + sendMessage(packet); + } + } + + private void sendMessage(JsonObject json) { + String msg = GSON.toJson(json); + Session s = this.session; + try { + if (s != null) { + logger.trace("Message [out]: {}", msg); + s.getRemote().sendString(msg); + } else { + logger.warn("No Connection to TV, skipping [out]: {}", msg); + } + } catch (IOException e) { + logger.warn("Unable to send message.", e); + } + } + + @OnWebSocketMessage + public void onMessage(String message) { + logger.trace("Message [in]: {}", message); + Response response = GSON.fromJson(message, Response.class); + ServiceCommand<?> request = null; + + if (response.getId() != null) { + request = requests.get(response.getId()); + if (request == null) { + logger.warn("Received a response with id {}, for which no request was found. This should not happen.", + response.getId()); + } else { + // for subscriptions we want to keep the original + // message, so that we have a reference to the response listener + if (!(request instanceof ServiceSubscription<?>)) { + requests.remove(response.getId()); + } + } + } + + switch (response.getType()) { + case "response": + if (request == null) { + logger.debug("No matching request found for response message: {}", message); + break; + } + if (response.getPayload() == null) { + logger.debug("No payload in response message: {}", message); + break; + } + try { + request.processResponse(response.getPayload().getAsJsonObject()); + } catch (RuntimeException ex) { + // An uncaught runtime exception in @OnWebSocketMessage annotated method will cause the web socket + // implementation to call @OnWebSocketError callback in which we would reset the connection. + // Users have the ability to create miss-configurations in which IllegalArgumentException could be + // thrown + logger.warn("Error while processing message: {} - in response to request: {} - Error Message: {}", + message, request, ex.getMessage()); + } + break; + case "error": + logger.debug("Error: {}", message); + + if (request == null) { + logger.warn("No matching request found for error message: {}", message); + break; + } + if (response.getPayload() == null) { + logger.warn("No payload in error message: {}", message); + break; + } + try { + request.processError(response.getError()); + } catch (RuntimeException ex) { + // An uncaught runtime exception in @OnWebSocketMessage annotated method will cause the web socket + // implementation to call @OnWebSocketError callback in which we would reset the connection. + // Users have the ability to create miss-configurations in which IllegalArgumentException could be + // thrown + logger.warn("Error while processing error: {} - in response to request: {} - Error Message: {}", + message, request, ex.getMessage()); + } + break; + case "hello": + if (response.getPayload() == null) { + logger.warn("No payload in error message: {}", message); + break; + } + JsonObject deviceDescription = response.getPayload().getAsJsonObject(); + Map<String, String> map = new HashMap<>(); + map.put(PROPERTY_DEVICE_OS, deviceDescription.get("deviceOS").getAsString()); + map.put(PROPERTY_DEVICE_OS_VERSION, deviceDescription.get("deviceOSVersion").getAsString()); + map.put(PROPERTY_DEVICE_OS_RELEASE_VERSION, + deviceDescription.get("deviceOSReleaseVersion").getAsString()); + map.put(PROPERTY_LAST_CONNECTED, Instant.now().toString()); + config.storeProperties(map); + sendRegister(); + break; + case "registered": + if (response.getPayload() == null) { + logger.warn("No payload in registered message: {}", message); + break; + } + this.requests.remove(response.getId()); + config.storeKey(response.getPayload().getAsJsonObject().get("client-key").getAsString()); + setState(State.REGISTERED); + break; + } + + } + + public boolean isConnected() { + return state == State.REGISTERED; + } + + public interface WebOSTVSocketListener { + + public void onStateChanged(State state); + + public void onError(String errorMessage); + + } + + public ServiceSubscription<Boolean> subscribeMute(ResponseListener<Boolean> listener) { + ServiceSubscription<Boolean> request = new ServiceSubscription<>(MUTE, null, + (jsonObj) -> jsonObj.get("mute").getAsBoolean(), listener); + sendCommand(request); + return request; + } + + public ServiceSubscription<Float> subscribeVolume(ResponseListener<Float> listener) { + ServiceSubscription<Float> request = new ServiceSubscription<>(VOLUME, null, + // "scenario" in the response determines whether "volume" is absolute or a delta value. + // it only makes sense to subscribe to changes in absolute volume + // accept: "mastervolume_tv_speaker" or "mastervolume_tv_speaker_ext" + // ignore external amp/receiver: "mastervolume_ext_speaker_arc" or "mastervolume_ext_speaker_urcu_oss" + jsonObj -> jsonObj.get("scenario").getAsString().startsWith("mastervolume_tv_speaker") + ? (float) (jsonObj.get("volume").getAsInt() / 100.0) + : Float.NaN, + listener); + sendCommand(request); + return request; + } + + public void setMute(boolean isMute, ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://audio/setMute"; + JsonObject payload = new JsonObject(); + payload.addProperty("mute", isMute); + + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, payload, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void setVolume(float volume, ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://audio/setVolume"; + JsonObject payload = new JsonObject(); + int intVolume = Math.round(volume * 100.0f); + payload.addProperty("volume", intVolume); + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, payload, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void volumeUp(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://audio/volumeUp"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void volumeDown(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://audio/volumeDown"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public ServiceSubscription<ChannelInfo> subscribeCurrentChannel(ResponseListener<ChannelInfo> listener) { + ServiceSubscription<ChannelInfo> request = new ServiceSubscription<>(CHANNEL, null, + jsonObj -> GSON.fromJson(jsonObj, ChannelInfo.class), listener); + sendCommand(request); + + return request; + } + + public void setChannel(ChannelInfo channelInfo, ResponseListener<CommandConfirmation> listener) { + JsonObject payload = new JsonObject(); + if (channelInfo.getId() != null) { + payload.addProperty("channelId", channelInfo.getId()); + } + if (channelInfo.getChannelNumber() != null) { + payload.addProperty("channelNumber", channelInfo.getChannelNumber()); + } + setChannel(payload, listener); + } + + private void setChannel(JsonObject payload, ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://tv/openChannel"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, payload, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void channelUp(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://tv/channelUp"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void channelDown(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://tv/channelDown"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void getChannelList(ResponseListener<List<ChannelInfo>> listener) { + ServiceCommand<List<ChannelInfo>> request = new ServiceCommand<>(CHANNEL_LIST, null, + jsonObj -> GSON.fromJson(jsonObj.get("channelList"), new TypeToken<ArrayList<ChannelInfo>>() { + }.getType()), listener); + sendCommand(request); + } + + // TOAST + + public void showToast(String message, ResponseListener<CommandConfirmation> listener) { + showToast(message, null, null, listener); + } + + public void showToast(String message, @Nullable String iconData, @Nullable String iconExtension, + ResponseListener<CommandConfirmation> listener) { + JsonObject payload = new JsonObject(); + payload.addProperty("message", message); + + if (iconData != null && iconExtension != null) { + payload.addProperty("iconData", iconData); + payload.addProperty("iconExtension", iconExtension); + } + + sendToast(payload, listener); + } + + private void sendToast(JsonObject payload, ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://system.notifications/createToast"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, payload, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + // POWER + public void powerOff(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://system/turnOff"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + // MEDIA CONTROL + public void play(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://media.controls/play"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void pause(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://media.controls/pause"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void stop(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://media.controls/stop"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void rewind(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://media.controls/rewind"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + public void fastForward(ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://media.controls/fastForward"; + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, null, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + sendCommand(request); + } + + // APPS + + public void getAppList(final ResponseListener<List<AppInfo>> listener) { + String uri = "ssap://com.webos.applicationManager/listApps"; + + ServiceCommand<List<AppInfo>> request = new ServiceCommand<>(uri, null, + jsonObj -> GSON.fromJson(jsonObj.get("apps"), new TypeToken<ArrayList<AppInfo>>() { + }.getType()), listener); + + sendCommand(request); + } + + public void launchAppWithInfo(AppInfo appInfo, ResponseListener<LaunchSession> listener) { + launchAppWithInfo(appInfo, null, listener); + } + + public void launchAppWithInfo(final AppInfo appInfo, @Nullable JsonObject params, + final ResponseListener<LaunchSession> listener) { + String uri = "ssap://system.launcher/launch"; + JsonObject payload = new JsonObject(); + + final String appId = appInfo.getId(); + + String contentId = null; + + if (params != null) { + contentId = params.get("contentId").getAsString(); + } + + payload.addProperty("id", appId); + + if (contentId != null) { + payload.addProperty("contentId", contentId); + } + + if (params != null) { + payload.add("params", params); + } + + ServiceCommand<LaunchSession> request = new ServiceCommand<>(uri, payload, obj -> { + LaunchSession launchSession = new LaunchSession(); + launchSession.setService(this); + launchSession.setAppId(appId); // note that response uses id to mean appId + if (obj.has("sessionId")) { + launchSession.setSessionId(obj.get("sessionId").getAsString()); + launchSession.setSessionType(LaunchSessionType.App); + } else { + launchSession.setSessionType(LaunchSessionType.Unknown); + } + return launchSession; + }, listener); + sendCommand(request); + } + + public void launchBrowser(String url, final ResponseListener<LaunchSession> listener) { + String uri = "ssap://system.launcher/open"; + JsonObject payload = new JsonObject(); + payload.addProperty("target", url); + + ServiceCommand<LaunchSession> request = new ServiceCommand<>(uri, payload, obj -> { + LaunchSession launchSession = new LaunchSession(); + launchSession.setService(this); + launchSession.setAppId(obj.get("id").getAsString()); // note that response uses id to mean appId + if (obj.has("sessionId")) { + launchSession.setSessionId(obj.get("sessionId").getAsString()); + launchSession.setSessionType(LaunchSessionType.App); + } else { + launchSession.setSessionType(LaunchSessionType.Unknown); + } + return launchSession; + }, listener); + sendCommand(request); + } + + public void closeLaunchSession(LaunchSession launchSession, ResponseListener<CommandConfirmation> listener) { + LGWebOSTVSocket service = launchSession.getService(); + + switch (launchSession.getSessionType()) { + case App: + case ExternalInputPicker: + service.closeApp(launchSession, listener); + break; + + /* + * If we want to extend support for MediaPlayer or WebAppLauncher at some point, this is how it was handeled + * in connectsdk: + * + * case Media: + * if (service instanceof MediaPlayer) { + * ((MediaPlayer) service).closeMedia(launchSession, listener); + * } + * break; + * + * + * case WebApp: + * if (service instanceof WebAppLauncher) { + * ((WebAppLauncher) service).closeWebApp(launchSession, listener); + * } + * break; + * case Unknown: + */ + default: + listener.onError("This DeviceService does not know ho to close this LaunchSession"); + break; + } + } + + public void closeApp(LaunchSession launchSession, ResponseListener<CommandConfirmation> listener) { + String uri = "ssap://system.launcher/close"; + + JsonObject payload = new JsonObject(); + payload.addProperty("id", launchSession.getAppId()); + payload.addProperty("sessionId", launchSession.getSessionId()); + + ServiceCommand<CommandConfirmation> request = new ServiceCommand<>(uri, payload, + x -> GSON.fromJson(x, CommandConfirmation.class), listener); + launchSession.getService().sendCommand(request); + } + + public ServiceSubscription<AppInfo> subscribeRunningApp(ResponseListener<AppInfo> listener) { + ServiceSubscription<AppInfo> request = new ServiceSubscription<>(FOREGROUND_APP, null, + jsonObj -> GSON.fromJson(jsonObj, AppInfo.class), listener); + sendCommand(request); + return request; + + } + + public ServiceCommand<AppInfo> getRunningApp(ResponseListener<AppInfo> listener) { + ServiceCommand<AppInfo> request = new ServiceCommand<>(FOREGROUND_APP, null, + jsonObj -> GSON.fromJson(jsonObj, AppInfo.class), listener); + sendCommand(request); + return request; + + } + + // KEYBOARD + + public ServiceSubscription<TextInputStatusInfo> subscribeTextInputStatus( + ResponseListener<TextInputStatusInfo> listener) { + return keyboardInput.connect(listener); + } + + public void sendText(String input) { + keyboardInput.sendText(input); + } + + public void sendEnter() { + keyboardInput.sendEnter(); + } + + public void sendDelete() { + keyboardInput.sendDel(); + } + + // MOUSE + + public void executeMouse(Consumer<LGWebOSTVMouseSocket> onConnected) { + LGWebOSTVMouseSocket mouseSocket = new LGWebOSTVMouseSocket(this.client); + mouseSocket.setListener(new WebOSTVMouseSocketListener() { + + @Override + public void onStateChanged(LGWebOSTVMouseSocket.State oldState, LGWebOSTVMouseSocket.State newState) { + switch (newState) { + case CONNECTED: + onConnected.accept(mouseSocket); + mouseSocket.disconnect(); + break; + default: + break; + } + + } + + @Override + public void onError(String errorMessage) { + logger.debug("Error in communication with Mouse Socket: {}", errorMessage); + } + }); + + String uri = "ssap://com.webos.service.networkinput/getPointerInputSocket"; + + ResponseListener<JsonObject> listener = new ResponseListener<JsonObject>() { + + @Override + public void onSuccess(@Nullable JsonObject jsonObj) { + if (jsonObj != null) { + String socketPath = jsonObj.get("socketPath").getAsString().replace("wss:", "ws:").replace(":3001/", + ":3000/"); + try { + mouseSocket.connect(new URI(socketPath)); + } catch (URISyntaxException e) { + logger.warn("Connect mouse error: {}", e.getMessage()); + } + } + } + + @Override + public void onError(String error) { + logger.warn("Connect mouse error: {}", error); + } + }; + + ServiceCommand<JsonObject> request = new ServiceCommand<>(uri, null, x -> x, listener); + sendCommand(request); + + } + + public interface ConfigProvider { + void storeKey(String key); + + void storeProperties(Map<String, String> properties); + + String getKey(); + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceCommand.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceCommand.java new file mode 100644 index 0000000000000..fc8895ab27830 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceCommand.java @@ -0,0 +1,102 @@ +/** + * 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 + */ +/* + * This file is based on: + * + * ServiceCommand + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.command; + +import java.util.function.Function; + +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +/** + * Internal implementation of ServiceCommand for URL-based commands + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +public class ServiceCommand<T> { + + protected enum Type { + request, + subscribe + } + + protected Type type; + protected JsonObject payload; + protected String target; + protected Function<JsonObject, T> converter; + + ResponseListener<T> responseListener; + + public ServiceCommand(String targetURL, JsonObject payload, Function<JsonObject, T> converter, + ResponseListener<T> listener) { + this.target = targetURL; + this.payload = payload; + this.converter = converter; + this.responseListener = listener; + this.type = Type.request; + } + + public JsonElement getPayload() { + return payload; + } + + public String getType() { + return type.name(); + } + + public String getTarget() { + return target; + } + + public void processResponse(JsonObject response) { + this.getResponseListener().onSuccess(this.converter.apply(response)); + } + + public void processError(String error) { + this.getResponseListener().onError(error); + } + + public ResponseListener<T> getResponseListener() { + return responseListener; + } + + @Override + public String toString() { + return "ServiceCommand [type=" + type + ", target=" + target + ", payload=" + payload + "]"; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceSubscription.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceSubscription.java new file mode 100644 index 0000000000000..18df4b9acff44 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/command/ServiceSubscription.java @@ -0,0 +1,57 @@ +/** + * 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 + */ +/* + * This file is based on URLServiceSubscription: + * + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.command; + +import java.util.function.Function; + +import org.openhab.binding.lgwebos.internal.handler.core.ResponseListener; + +import com.google.gson.JsonObject; + +/** + * Internal implementation of ServiceSubscription for URL-based commands. + * + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +public class ServiceSubscription<T> extends ServiceCommand<T> { + + public ServiceSubscription(String uri, JsonObject payload, Function<JsonObject, T> converter, + ResponseListener<T> listener) { + super(uri, payload, converter, listener); + type = Type.subscribe; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/AppInfo.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/AppInfo.java new file mode 100644 index 0000000000000..17812218544dc --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/AppInfo.java @@ -0,0 +1,106 @@ +/** + * 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 + */ +/* + * This file is based on: + * + * AppInfo + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.core; + +import com.google.gson.annotations.SerializedName; + +/** + * {@link AppInfo} is a value object to describe an application on WebOSTV. + * The id value is mandatory when starting an application. The name is a human readable friendly name, which is not + * further interpreted by the TV. + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB, made immutable + */ +public class AppInfo { + + @SerializedName(value = "id", alternate = "appId") + private String id; + @SerializedName(value = "name", alternate = { "appName", "title" }) + private String name; + + public AppInfo() { + // no-argument constructor for gson + } + + public AppInfo(String id, String name) { + this.id = id; + this.name = name; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return "AppInfo [id=" + id + ", name=" + name + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AppInfo other = (AppInfo) obj; + if (id == null) { + if (other.id != null) { + return false; + } + } else if (!id.equals(other.id)) { + return false; + } + return true; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ChannelInfo.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ChannelInfo.java new file mode 100644 index 0000000000000..22b93dcea3da2 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ChannelInfo.java @@ -0,0 +1,110 @@ +/** + * 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 + */ +/* + * This file is based on: + * + * ChannelInfo + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openhab.binding.lgwebos.internal.handler.core; + +/** + * {@link ChannelInfo} is a value object to describe a channel on WebOSTV. + * The id value is mandatory when starting an channel. The channelName is a human readable friendly name, which is not + * further interpreted by the TV. + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB, removed minor major number, made immutable + */ +public class ChannelInfo { + + private String channelName; + private String channelId; + private String channelNumber; + private String channelType; + + public ChannelInfo() { + // no-argument constructor for gson + } + + public ChannelInfo(String channelName, String channelId, String channelNumber, String channelType) { + this.channelId = channelId; + this.channelNumber = channelNumber; + this.channelName = channelName; + this.channelType = channelType; + } + + public String getName() { + return channelName; + } + + public String getId() { + return channelId; + } + + public String getChannelNumber() { + return channelNumber; + } + + @Override + public String toString() { + return "ChannelInfo [channelId=" + channelId + ", channelNumber=" + channelNumber + ", channelName=" + + channelName + ", channelType=" + channelType + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((channelId == null) ? 0 : channelId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ChannelInfo other = (ChannelInfo) obj; + if (channelId == null) { + if (other.channelId != null) { + return false; + } + } else if (!channelId.equals(other.channelId)) { + return false; + } + return true; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/CommandConfirmation.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/CommandConfirmation.java new file mode 100644 index 0000000000000..193af39171310 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/CommandConfirmation.java @@ -0,0 +1,40 @@ +/** + * 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.lgwebos.internal.handler.core; + +/** + * {@link CommandConfirmation} represents payload in response from TV were it only confirms the result of an operation. + * + * @author Sebastian Prehn - Initial contribution + */ +public class CommandConfirmation { + private boolean returnValue; + + public CommandConfirmation() { + // no-argument constructor for gson + } + + public CommandConfirmation(boolean returnValue) { + this.returnValue = returnValue; + } + + public boolean getReturnValue() { + return returnValue; + } + + @Override + public String toString() { + return "CommandConfirmation [returnValue=" + returnValue + "]"; + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/LaunchSession.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/LaunchSession.java new file mode 100644 index 0000000000000..897a577ddc365 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/LaunchSession.java @@ -0,0 +1,171 @@ +/** + * 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 + */ +/* This file is based on: + * + * LaunchSession + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Jeffrey Glenn on 07 Mar 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.core; + +import org.openhab.binding.lgwebos.internal.handler.LGWebOSTVSocket; + +/** + * {@link LaunchSession} is a value object to describe a session with an application running on WebOSTV. + * + * Any time anything is launched onto a first screen device, there will be important session information that needs to + * be tracked. {@link LaunchSession} tracks this data, and must be retained to perform certain actions within the + * session. + * + * @author Jeffrey Glenn - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +public class LaunchSession { + + private String appId; + private String appName; + private String sessionId; + + private transient LGWebOSTVSocket socket; + private transient LaunchSessionType sessionType; + + /** + * LaunchSession type is used to help DeviceService's know how to close a LaunchSession. + * + */ + public enum LaunchSessionType { + /** Unknown LaunchSession type, may be unable to close this launch session */ + Unknown, + /** LaunchSession represents a launched app */ + App, + /** LaunchSession represents an external input picker that was launched */ + ExternalInputPicker, + /** LaunchSession represents a media app */ + Media, + /** LaunchSession represents a web app */ + WebApp + } + + public LaunchSession() { + } + + /** + * Instantiates a LaunchSession object for a given app ID. + * + * @param appId System-specific, unique ID of the app + * @return the launch session + */ + public static LaunchSession launchSessionForAppId(String appId) { + LaunchSession launchSession = new LaunchSession(); + launchSession.appId = appId; + return launchSession; + } + + /** @return System-specific, unique ID of the app (ex. youtube.leanback.v4, 0000134, hulu) */ + public String getAppId() { + return appId; + } + + /** + * Sets the system-specific, unique ID of the app (ex. youtube.leanback.v4, 0000134, hulu) + * + * @param appId Id of the app + */ + public void setAppId(String appId) { + this.appId = appId; + } + + /** @return User-friendly name of the app (ex. YouTube, Browser, Hulu) */ + public String getAppName() { + return appName; + } + + /** + * Sets the user-friendly name of the app (ex. YouTube, Browser, Hulu) + * + * @param appName Name of the app + */ + public void setAppName(String appName) { + this.appName = appName; + } + + /** @return Unique ID for the session (only provided by certain protocols) */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the session id (only provided by certain protocols) + * + * @param sessionId Id of the current session + */ + public void setSessionId(String sessionId) { + this.sessionId = sessionId; + } + + /** @return WebOSTVSocket responsible for launching the session. */ + public LGWebOSTVSocket getService() { + return socket; + } + + /** + * DeviceService responsible for launching the session. + * + * @param service Sets the DeviceService + */ + public void setService(LGWebOSTVSocket service) { + this.socket = service; + } + + /** + * @return When closing a LaunchSession, the DeviceService relies on the sessionType to determine the method of + * closing the session. + */ + public LaunchSessionType getSessionType() { + return sessionType; + } + + /** + * Sets the LaunchSessionType of this LaunchSession. + * + * @param sessionType The type of LaunchSession + */ + public void setSessionType(LaunchSessionType sessionType) { + this.sessionType = sessionType; + } + + /** + * Close the app/media associated with the session. + * + * @param listener the response listener + */ + public void close(ResponseListener<CommandConfirmation> listener) { + socket.closeLaunchSession(this, listener); + } + +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/Response.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/Response.java new file mode 100644 index 0000000000000..f541fae2766d9 --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/Response.java @@ -0,0 +1,55 @@ +/** + * 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.lgwebos.internal.handler.core; + +import com.google.gson.JsonElement; + +/** + * {@link Response} is a value object for a response message from WebOSTV. + * + * @author Sebastian Prehn - Initial contribution + */ +public class Response { + /** Required response type */ + private String type; + /** Optional payload */ + private JsonElement payload; + /** + * Message ID to which this is a response to. + * This is optional. + */ + private Integer id; + + public Response() { + // no-argument constructor for gson + } + + /** Optional error message. */ + private String error; + + public Integer getId() { + return id; + } + + public String getType() { + return type; + } + + public String getError() { + return error; + } + + public JsonElement getPayload() { + return payload; + } +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ResponseListener.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ResponseListener.java new file mode 100644 index 0000000000000..994bbeaf677cf --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/ResponseListener.java @@ -0,0 +1,63 @@ +/** + * 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 + */ +/* This file is based on: + * + * ResponseListener + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.core; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Generic asynchronous operation response success handler block. If there is any response data to be processed, it will + * be provided via the responseObject parameter. + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +@NonNullByDefault +public interface ResponseListener<T> { + + /** + * Returns the success of the call of type T. + * Contains the output data as a generic object reference. + * This value may be any of a number of types as defined by T in subclasses of ResponseListener. + * + * @param responseObject Response object, can be any number of object types, depending on the + * protocol/capability/etc + */ + void onSuccess(T responseObject); + + /** + * Method to return the error message that was generated. + * + */ + void onError(String message); +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/TextInputStatusInfo.java b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/TextInputStatusInfo.java new file mode 100644 index 0000000000000..7fbf5a809b5ce --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/main/java/org/openhab/binding/lgwebos/internal/handler/core/TextInputStatusInfo.java @@ -0,0 +1,178 @@ +/** + * 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 + */ +/* This file is based on: + * + * TextInputStatusInfo + * Connect SDK + * + * Copyright (c) 2014 LG Electronics. + * Created by Hyun Kook Khang on 19 Jan 2014 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openhab.binding.lgwebos.internal.handler.core; + +import com.google.gson.JsonObject; + +/** + * Normalized reference object for information about a text input event. + * + * @author Hyun Kook Khang - Connect SDK initial contribution + * @author Sebastian Prehn - Adoption for openHAB + */ +public class TextInputStatusInfo { + // @cond INTERNAL + public enum TextInputType { + DEFAULT, + URL, + NUMBER, + PHONE_NUMBER, + EMAIL + } + + boolean focused = false; + String contentType = null; + boolean predictionEnabled = false; + boolean correctionEnabled = false; + boolean autoCapitalization = false; + boolean hiddenText = false; + boolean focusChanged = false; + + JsonObject rawData; + // @endcond + + public TextInputStatusInfo() { + } + + public boolean isFocused() { + return focused; + } + + public void setFocused(boolean focused) { + this.focused = focused; + } + + /** + * Gets the type of keyboard that should be displayed to the user. + * + * @return the keyboard type + */ + public TextInputType getTextInputType() { + TextInputType textInputType = TextInputType.DEFAULT; + + if (contentType != null) { + if (contentType.equals("number")) { + textInputType = TextInputType.NUMBER; + } else if (contentType.equals("phonenumber")) { + textInputType = TextInputType.PHONE_NUMBER; + } else if (contentType.equals("url")) { + textInputType = TextInputType.URL; + } else if (contentType.equals("email")) { + textInputType = TextInputType.EMAIL; + } + } + + return textInputType; + } + + /** + * Sets the type of keyboard that should be displayed to the user. + * + * @param textInputType the keyboard type + */ + public void setTextInputType(TextInputType textInputType) { + switch (textInputType) { + case NUMBER: + contentType = "number"; + break; + case PHONE_NUMBER: + contentType = "phonenumber"; + break; + case URL: + contentType = "url"; + break; + case EMAIL: + contentType = "number"; + break; + case DEFAULT: + default: + contentType = "email"; + break; + } + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public boolean isPredictionEnabled() { + return predictionEnabled; + } + + public void setPredictionEnabled(boolean predictionEnabled) { + this.predictionEnabled = predictionEnabled; + } + + public boolean isCorrectionEnabled() { + return correctionEnabled; + } + + public void setCorrectionEnabled(boolean correctionEnabled) { + this.correctionEnabled = correctionEnabled; + } + + public boolean isAutoCapitalization() { + return autoCapitalization; + } + + public void setAutoCapitalization(boolean autoCapitalization) { + this.autoCapitalization = autoCapitalization; + } + + public boolean isHiddenText() { + return hiddenText; + } + + public void setHiddenText(boolean hiddenText) { + this.hiddenText = hiddenText; + } + + /** @return the raw data from the first screen device about the text input status. */ + public JsonObject getRawData() { + return rawData; + } + + /** @param data the raw data from the first screen device about the text input status. */ + public void setRawData(JsonObject data) { + rawData = data; + } + + public boolean isFocusChanged() { + return focusChanged; + } + + public void setFocusChanged(boolean focusChanged) { + this.focusChanged = focusChanged; + } +} diff --git a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/binding/binding.xml index b3fcbeb2246c1..8161192c167e4 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/binding/binding.xml @@ -4,17 +4,8 @@ xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>LG webOS Binding</name> - <description>Binding to connect LG's WebOS based smart TVs based on Connect SDK</description> + <description>Binding to connect LG's WebOS based smart TVs</description> <author>Sebastian Prehn</author> - <config-description> - <parameter name="localIP" type="text"> - <label>Local IP</label> - <description>Local IP of server network interface to bind to. This is optional. If not set, the binding will use openHAB's primary IP address, which may be configured under network settings. - </description> - <required>false</required> - <context>network-address</context> - </parameter> - </config-description> </binding:binding> diff --git a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/config/config.xml index d310e46e90df3..d24e98399def6 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/config/config.xml @@ -1,12 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> -<config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:lgwebos:WebOSTV"> - <parameter name="deviceId" type="text" required="true"> - <label>Device ID</label> + <parameter name="host" type="text" required="true"> + <label>Host</label> + <description>Hostname or IP address of TV.</description> + <context>network-address</context> + </parameter> + <parameter name="key" type="text" required="false"> + <label>Access Key</label> + <description>Key exchanged with TV after pairing.</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/i18n/lgwebos.properties b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/i18n/lgwebos.properties index d0b0b7b577bc9..62e2ccf2d0d39 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/i18n/lgwebos.properties +++ b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/i18n/lgwebos.properties @@ -37,4 +37,4 @@ actionIncreaseChannelLabel=Channel Up actionIncreaseChannelDesc=TV will switch one channel up in the current channel list. actionDecreaseChannelLabel=Channel Down -actionDecreaseChannelDesc=TV will switch one channel down in the current channel list. \ No newline at end of file +actionDecreaseChannelDesc=TV will switch one channel down in the current channel list. diff --git a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/thing/thing-types.xml index 2aa85d71c9e63..22f66381242dd 100644 --- a/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.lgwebos/src/main/resources/ESH-INF/thing/thing-types.xml @@ -20,8 +20,18 @@ <channel id="appLauncher" typeId="appLauncherChannelType" /> </channels> + <properties> + <property name="deviceId" /> + <property name="lastConnected" /> + <property name="modelName" /> + <property name="manufacturer" /> + <property name="deviceOS" /> + <property name="deviceOSVersion" /> + <property name="deviceOSReleaseVersion" /> + </properties> <representation-property>deviceId</representation-property> + <config-description-ref uri="thing-type:lgwebos:WebOSTV" /> </thing-type> diff --git a/bundles/org.openhab.binding.lgwebos/src/test/resources/simplelogger.properties b/bundles/org.openhab.binding.lgwebos/src/test/resources/simplelogger.properties new file mode 100644 index 0000000000000..f7608ca50c9aa --- /dev/null +++ b/bundles/org.openhab.binding.lgwebos/src/test/resources/simplelogger.properties @@ -0,0 +1,3 @@ +org.slf4j.simpleLogger.defaultLogLevel=info +org.slf4j.simpleLogger.log.org.openhab.binding.lgwebos=trace +org.slf4j.simpleLogger.log.org.eclipse.jetty.websocket=info diff --git a/bundles/org.openhab.binding.lifx/NOTICE b/bundles/org.openhab.binding.lifx/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.lifx/NOTICE +++ b/bundles/org.openhab.binding.lifx/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.lifx/README.md b/bundles/org.openhab.binding.lifx/README.md index ff770c8ea6a2b..0c8ffa222613f 100644 --- a/bundles/org.openhab.binding.lifx/README.md +++ b/bundles/org.openhab.binding.lifx/README.md @@ -1,6 +1,7 @@ # LIFX Binding -This binding integrates the [LIFX LED Lights](http://www.lifx.com/). All LIFX lights are directly connected to the WLAN and the binding communicates with them over a UDP protocol. +This binding integrates the [LIFX LED Lights](https://www.lifx.com/). +All LIFX lights are directly connected to the WLAN and the binding communicates with them over a UDP protocol. ![LIFX E27](doc/lifx_e27.jpg) @@ -16,10 +17,10 @@ The following table lists the thing types of the supported LIFX devices: | Color 1000 BR30 | colorlight | | LIFX A19 | colorlight | | LIFX BR30 | colorlight | +| LIFX Candle | colorlight | | LIFX Downlight | colorlight | | LIFX GU10 | colorlight | | LIFX Mini Color | colorlight | -| LIFX Tile | colorlight | | | | | LIFX+ A19 | colorirlight | | LIFX+ BR30 | colorirlight | @@ -27,30 +28,38 @@ The following table lists the thing types of the supported LIFX devices: | LIFX Beam | colormzlight | | LIFX Z | colormzlight | | | | +| LIFX Tile | tilelight | +| | | | White 800 (Low Voltage) | whitelight | | White 800 (High Voltage) | whitelight | | White 900 BR30 (Low Voltage) | whitelight | | LIFX Mini Day and Dusk | whitelight | | LIFX Mini White | whitelight | -The thing type determines the capability of a device and with that the possible ways of interacting with it. The following matrix lists the capabilities (channels) for each type: +The thing type determines the capability of a device and with that the possible ways of interacting with it. +The following matrix lists the capabilities (channels) for each type: -| Thing Type | On/Off | Brightness | Color | Color Zone | Color Temperature | Color Temperature Zone | Infrared | -|--------------|:------:|:----------:|:-----:|:----------:|:-----------------:|:----------------------:|:--------:| -| colorlight | X | | X | | X | | | -| colorirlight | X | | X | | X | | X | -| colormzlight | X | | X | X | X | X | | -| whitelight | X | X | | | X | | | +| Thing Type | On/Off | Brightness | Color | Color Zone | Color Temperature | Color Temperature Zone | Infrared | Tile Effects | +|--------------|:------:|:----------:|:-----:|:----------:|:-----------------:|:----------------------:|:--------:|:------------:| +| colorlight | X | | X | | X | | | | +| colorirlight | X | | X | | X | | X | | +| colormzlight | X | | X | X | X | X | | | +| tilelight | X | X | X | | X | | | X | +| whitelight | X | X | | | X | | | | ## Discovery -The binding is able to auto-discover all lights in a network over the LIFX UDP protocol. Therefore all lights must be turned on. +The binding is able to auto-discover all lights in a network over the LIFX UDP protocol. +Therefore all lights must be turned on. -*Note:* To get the binding working, all lights must be added to the WLAN network first with the help of the [LIFX smart phone applications](http://www.lifx.com/pages/go). The binding is NOT able to add or detect lights outside the network. +*Note:* To get the binding working, all lights must be added to the WLAN network first with the help of the [LIFX smart phone applications](https://www.lifx.com/pages/app). +The binding is NOT able to add or detect lights outside the network. ## Thing Configuration -Each light needs a Device ID or Host as a configuration parameter. The device ID is printed as a serial number on the light and can also be found within the native LIFX Android or iOS application. But usually the discovery works quite reliably, so that a manual configuration is not needed. +Each light needs a Device ID or Host as a configuration parameter. +The device ID is printed as a serial number on the light and can also be found within the native LIFX Android or iOS application. +But usually the discovery works quite reliably, so that a manual configuration is not needed. However, in the thing file, a manual configuration looks e.g. like @@ -58,7 +67,8 @@ However, in the thing file, a manual configuration looks e.g. like Thing lifx:colorlight:living [ deviceId="D073D5A1A1A1", fadetime=200 ] ``` -The *fadetime* is an optional thing configuration parameter which configures the time to fade to a new color value (in ms). When the *fadetime* is not configured, the binding uses 300ms as default. +The *fadetime* is an optional thing configuration parameter which configures the time to fade to a new color value (in ms). +When the *fadetime* is not configured, the binding uses 300ms as default. You can optionally also configure a fixed Host or IP address when lights are in a different subnet and are not discovered. @@ -70,24 +80,34 @@ Thing lifx:colorirlight:porch [ host="10.120.130.4", fadetime=0 ] All devices support some of the following channels: -| Channel Type ID | Item Type | Description | Thing Types | -|-----------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------| -| brightness | Dimmer | This channel supports adjusting the brightness value. | whitelight | -| color | Color | This channel supports full color control with hue, saturation and brightness values. | colorlight, colorirlight, colormzlight | -| colorzone | Color | This channel supports full zone color control with hue, saturation and brightness values. | colormzlight | -| infrared | Dimmer | This channel supports adjusting the infrared value. *Note:* IR capable lights only activate their infrared LEDs when the brightness drops below a certain level. | colorirlight | -| signalstrength | Number | This channel represents signal strength with values 0, 1, 2, 3 or 4; 0 being worst strength and 4 being best strength. | colorlight, colorirlight, colormzlight, whitelight | -| temperature | Dimmer | This channel supports adjusting the color temperature from cold (0%) to warm (100%). | colorlight, colorirlight, colormzlight, whitelight | -| temperaturezone | Dimmer | This channel supports adjusting the zone color temperature from cold (0%) to warm (100%). | colormzlight | - -The *color* and *brightness* channels have a "Power on brightness" configuration option that is used to determine the brightness when a light is switched on. When it is left empty, the brightness of a light remains unchanged when a light is switched on or off. - -The *color* channels have a "Power on color" configuration option that is used to determine the hue, saturation, brightness levels when a light is switched on. When it is left empty, the color of a light remains unchanged when a light is switched on or off. Configuration options contains 3 comma separated values, where first value is hue (0-360), second saturation (0-100) and third brightness (0-100). If both "Power on brightness" and "Power on color" configuration options are defined, "Power on brightness" option overrides the brightness level defined on the "Power on color" configuration option. +| Channel Type ID | Item Type | Description | Thing Types | +|-----------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------| +| brightness | Dimmer | This channel supports adjusting the brightness value. | whitelight | +| color | Color | This channel supports full color control with hue, saturation and brightness values. | colorlight, colorirlight, colormzlight, tile | +| colorzone | Color | This channel supports full zone color control with hue, saturation and brightness values. | colormzlight | +| effect | String | This channel represents a type of light effect (e.g. for tile light: off, morph, flame) | tilelight | +| infrared | Dimmer | This channel supports adjusting the infrared value. *Note:* IR capable lights only activate their infrared LEDs when the brightness drops below a certain level. | colorirlight | +| signalstrength | Number | This channel represents signal strength with values 0, 1, 2, 3 or 4; 0 being worst strength and 4 being best strength. | colorlight, colorirlight, colormzlight, whitelight, tile | +| temperature | Dimmer | This channel supports adjusting the color temperature from cold (0%) to warm (100%). | colorlight, colorirlight, colormzlight, whitelight, tile | +| temperaturezone | Dimmer | This channel supports adjusting the zone color temperature from cold (0%) to warm (100%). | colormzlight | + +The *color* and *brightness* channels have a "Power on brightness" configuration option that is used to determine the brightness when a light is switched on. +When it is left empty, the brightness of a light remains unchanged when a light is switched on or off. + +The *color* channels have a "Power on color" configuration option that is used to determine the hue, saturation, brightness levels when a light is switched on. +When it is left empty, the color of a light remains unchanged when a light is switched on or off. +Configuration options contains 3 comma separated values, where first value is hue (0-360), second saturation (0-100) and third brightness (0-100). +If both "Power on brightness" and "Power on color" configuration options are defined, "Power on brightness" option overrides the brightness level defined on the "Power on color" configuration option. The *temperature* channels have a "Power on temperature" configuration option that is used to determine the color temperature when a light is switched on. When it is left empty, the color temperature of a light remains unchanged when a light is switched on or off. -MultiZone lights (*colormzlight*) have serveral channels (e.g. *colorzone0*, *temperaturezone0*, etc.) that allow for controlling specific zones of the light. Changing the *color* and *temperature* channels will update the states of all zones. The *color* and *temperature* channels of MultiZone lights always return the same state as *colorzone0*, *temperaturezone0*. +MultiZone lights (*colormzlight*) have serveral channels (e.g. *colorzone0*, *temperaturezone0*, etc.) that allow for controlling specific zones of the light. +Changing the *color* and *temperature* channels will update the states of all zones. +The *color* and *temperature* channels of MultiZone lights always return the same state as *colorzone0*, *temperaturezone0*. +LIFX Tile (*tilelight*) supports special tile effects: morph and flame. +These effects are predefined to their appearance using LIFX application. +Each effect has a separate speed configurable. ## Full Example diff --git a/bundles/org.openhab.binding.lifx/pom.xml b/bundles/org.openhab.binding.lifx/pom.xml index 601ba9c8090fa..9e6673b3a7950 100644 --- a/bundles/org.openhab.binding.lifx/pom.xml +++ b/bundles/org.openhab.binding.lifx/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lifx</artifactId> diff --git a/bundles/org.openhab.binding.lifx/src/main/feature/feature.xml b/bundles/org.openhab.binding.lifx/src/main/feature/feature.xml index bd1b5ec06e7bb..a81e3c8b94bd4 100644 --- a/bundles/org.openhab.binding.lifx/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lifx/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lifx-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lifx" description="LIFX Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxBindingConstants.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxBindingConstants.java index 23de5536b8fdf..c2c1aa6478443 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxBindingConstants.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -54,6 +54,7 @@ public class LifxBindingConstants { public static final String CHANNEL_BRIGHTNESS = "brightness"; public static final String CHANNEL_COLOR = "color"; public static final String CHANNEL_COLOR_ZONE = "colorzone"; + public static final String CHANNEL_EFFECT = "effect"; public static final String CHANNEL_INFRARED = "infrared"; public static final String CHANNEL_SIGNAL_STRENGTH = "signalstrength"; public static final String CHANNEL_TEMPERATURE = "temperature"; @@ -63,11 +64,17 @@ public class LifxBindingConstants { public static final ChannelTypeUID CHANNEL_TYPE_BRIGHTNESS = new ChannelTypeUID(BINDING_ID, CHANNEL_BRIGHTNESS); public static final ChannelTypeUID CHANNEL_TYPE_COLOR = new ChannelTypeUID(BINDING_ID, CHANNEL_COLOR); public static final ChannelTypeUID CHANNEL_TYPE_COLOR_ZONE = new ChannelTypeUID(BINDING_ID, CHANNEL_COLOR_ZONE); + public static final ChannelTypeUID CHANNEL_TYPE_EFFECT = new ChannelTypeUID(BINDING_ID, CHANNEL_EFFECT); public static final ChannelTypeUID CHANNEL_TYPE_INFRARED = new ChannelTypeUID(BINDING_ID, CHANNEL_INFRARED); public static final ChannelTypeUID CHANNEL_TYPE_TEMPERATURE = new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE); public static final ChannelTypeUID CHANNEL_TYPE_TEMPERATURE_ZONE = new ChannelTypeUID(BINDING_ID, CHANNEL_TEMPERATURE_ZONE); + // List of options for effect channel + public static final String CHANNEL_TYPE_EFFECT_OPTION_OFF = "off"; + public static final String CHANNEL_TYPE_EFFECT_OPTION_MORPH = "morph"; + public static final String CHANNEL_TYPE_EFFECT_OPTION_FLAME = "flame"; + // Config property for the LIFX device id public static final String CONFIG_PROPERTY_DEVICE_ID = "deviceId"; public static final String CONFIG_PROPERTY_FADETIME = "fadetime"; @@ -76,6 +83,8 @@ public class LifxBindingConstants { public static final String CONFIG_PROPERTY_POWER_ON_BRIGHTNESS = "powerOnBrightness"; public static final String CONFIG_PROPERTY_POWER_ON_COLOR = "powerOnColor"; public static final String CONFIG_PROPERTY_POWER_ON_TEMPERATURE = "powerOnTemperature"; + public static final String CONFIG_PROPERTY_EFFECT_MORPH_SPEED = "effectMorphSpeed"; + public static final String CONFIG_PROPERTY_EFFECT_FLAME_SPEED = "effectFlameSpeed"; // Property keys public static final String PROPERTY_HOST = "host"; @@ -94,9 +103,10 @@ public class LifxBindingConstants { public static final ThingTypeUID THING_TYPE_COLORIRLIGHT = new ThingTypeUID(BINDING_ID, "colorirlight"); public static final ThingTypeUID THING_TYPE_COLORMZLIGHT = new ThingTypeUID(BINDING_ID, "colormzlight"); public static final ThingTypeUID THING_TYPE_WHITELIGHT = new ThingTypeUID(BINDING_ID, "whitelight"); + public static final ThingTypeUID THING_TYPE_TILELIGHT = new ThingTypeUID(BINDING_ID, "tilelight"); - public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream - .of(THING_TYPE_COLORLIGHT, THING_TYPE_COLORIRLIGHT, THING_TYPE_COLORMZLIGHT, THING_TYPE_WHITELIGHT) + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Stream.of(THING_TYPE_COLORLIGHT, + THING_TYPE_COLORIRLIGHT, THING_TYPE_COLORMZLIGHT, THING_TYPE_WHITELIGHT, THING_TYPE_TILELIGHT) .collect(Collectors.toSet()); } diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactory.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactory.java index dfa01286b8fcd..28e8bfa505708 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactory.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactoryImpl.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactoryImpl.java index 54a8c9c8c7e5e..061825fd0c082 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactoryImpl.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxChannelFactoryImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxHandlerFactory.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxHandlerFactory.java index d1bc3d5028ba5..f765ff266d780 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxHandlerFactory.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCommunicationHandler.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCommunicationHandler.java index 7c537518cc5af..7b274db54a5fc 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCommunicationHandler.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCommunicationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightConfig.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightConfig.java index 8e9f8812954e1..33cc6c4d28e89 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightConfig.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightContext.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightContext.java index 5aba48e4be628..f1a77385bfc50 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightContext.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCurrentStateUpdater.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCurrentStateUpdater.java index d556f17364c39..700f7db570968 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCurrentStateUpdater.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightCurrentStateUpdater.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ import org.openhab.binding.lifx.internal.protocol.GetColorZonesRequest; import org.openhab.binding.lifx.internal.protocol.GetLightInfraredRequest; import org.openhab.binding.lifx.internal.protocol.GetRequest; +import org.openhab.binding.lifx.internal.protocol.GetTileEffectRequest; import org.openhab.binding.lifx.internal.protocol.GetWifiInfoRequest; import org.openhab.binding.lifx.internal.protocol.Packet; import org.openhab.binding.lifx.internal.protocol.Product; @@ -37,6 +38,7 @@ import org.openhab.binding.lifx.internal.protocol.StateMultiZoneResponse; import org.openhab.binding.lifx.internal.protocol.StatePowerResponse; import org.openhab.binding.lifx.internal.protocol.StateResponse; +import org.openhab.binding.lifx.internal.protocol.StateTileEffectResponse; import org.openhab.binding.lifx.internal.protocol.StateWifiInfoResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -137,6 +139,9 @@ private void sendLightStateRequests() { if (product.hasFeature(MULTIZONE)) { communicationHandler.sendPacket(new GetColorZonesRequest()); } + if (product.hasFeature(TILE_EFFECT)) { + communicationHandler.sendPacket(new GetTileEffectRequest()); + } if (updateSignalStrength) { communicationHandler.sendPacket(new GetWifiInfoRequest()); } @@ -158,6 +163,8 @@ public void handleResponsePacket(Packet packet) { handleMultiZoneStatus((StateMultiZoneResponse) packet); } else if (packet instanceof StateWifiInfoResponse) { handleWifiInfoStatus((StateWifiInfoResponse) packet); + } else if (packet instanceof StateTileEffectResponse) { + handleTileEffectStatus((StateTileEffectResponse) packet); } currentLightState.setOnline(); @@ -206,4 +213,7 @@ private void handleWifiInfoStatus(StateWifiInfoResponse packet) { currentLightState.setSignalStrength(packet.getSignalStrength()); } + private void handleTileEffectStatus(StateTileEffectResponse packet) { + currentLightState.setTileEffect(packet.getEffect()); + } } diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightDiscovery.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightDiscovery.java index 595d841a86aeb..1e70d7456dd2b 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightDiscovery.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightOnlineStateUpdater.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightOnlineStateUpdater.java index e16cb91fc0ea3..e55cdca466e11 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightOnlineStateUpdater.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightOnlineStateUpdater.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightPropertiesUpdater.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightPropertiesUpdater.java index e3b7c23570a36..0b063b83eefc1 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightPropertiesUpdater.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightPropertiesUpdater.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightState.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightState.java index 47b381402dae4..b09edb05e53b9 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightState.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ import org.openhab.binding.lifx.internal.listener.LifxLightStateListener; import org.openhab.binding.lifx.internal.protocol.PowerState; import org.openhab.binding.lifx.internal.protocol.SignalStrength; +import org.openhab.binding.lifx.internal.protocol.Effect; /** * The {@link LifxLightState} stores the properties that represent the state of a light. @@ -42,6 +43,7 @@ public class LifxLightState { private @Nullable PercentType infrared; private @Nullable PowerState powerState; private @Nullable SignalStrength signalStrength; + private @Nullable Effect tileEffect; private LocalDateTime lastChange = LocalDateTime.MIN; private List<LifxLightStateListener> listeners = new CopyOnWriteArrayList<>(); @@ -51,6 +53,7 @@ public void copy(LifxLightState other) { this.colors = other.getColors(); this.infrared = other.getInfrared(); this.signalStrength = other.getSignalStrength(); + this.tileEffect = other.getTileEffect(); } public @Nullable PowerState getPowerState() { @@ -81,6 +84,10 @@ public HSBK[] getColors() { return signalStrength; } + public @Nullable Effect getTileEffect() { + return tileEffect; + } + public void setColor(HSBType newHSB) { HSBK newColor = getColor(); newColor.setHSB(newHSB); @@ -165,6 +172,14 @@ public void setSignalStrength(SignalStrength newSignalStrength) { listeners.forEach(listener -> listener.handleSignalStrengthChange(oldSignalStrength, newSignalStrength)); } + public void setTileEffect(Effect newEffect) { + // Caller has to take care that newEffect is another object + Effect oldEffect = tileEffect; + tileEffect = newEffect; + updateLastChange(); + listeners.forEach(listener -> listener.handleTileEffectChange(oldEffect, newEffect)); + } + private void updateLastChange() { lastChange = LocalDateTime.now(); } diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightStateChanger.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightStateChanger.java index ee895aa1fb7d3..d7cb0faa62195 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightStateChanger.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxLightStateChanger.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -46,7 +46,9 @@ import org.openhab.binding.lifx.internal.protocol.SetLightInfraredRequest; import org.openhab.binding.lifx.internal.protocol.SetLightPowerRequest; import org.openhab.binding.lifx.internal.protocol.SetPowerRequest; +import org.openhab.binding.lifx.internal.protocol.SetTileEffectRequest; import org.openhab.binding.lifx.internal.protocol.SignalStrength; +import org.openhab.binding.lifx.internal.protocol.Effect; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -327,6 +329,14 @@ public void handleSignalStrengthChange(@Nullable SignalStrength oldSignalStrengt // Nothing to handle } + @Override + public void handleTileEffectChange(@Nullable Effect oldEffect, Effect newEffect) { + if (oldEffect == null || !oldEffect.equals(newEffect)) { + SetTileEffectRequest packet = new SetTileEffectRequest(newEffect); + replacePacketsInMap(packet); + } + } + public void handleResponsePacket(Packet packet) { if (packet instanceof AcknowledgementResponse) { long ackTimestamp = System.currentTimeMillis(); diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSelectorContext.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSelectorContext.java index 4a0c45d00be64..28fac3dc875e4 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSelectorContext.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSelectorContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSequenceNumberSupplier.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSequenceNumberSupplier.java index 2f1e825245b8c..c2f422c101ba2 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSequenceNumberSupplier.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/LifxSequenceNumberSupplier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/ByteField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/ByteField.java index d75c35bd3aae4..e3cf0bbae4d07 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/ByteField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/ByteField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Field.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Field.java index 7776f3ace901e..b1544242c59db 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Field.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Field.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/FloatField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/FloatField.java index 967b6f7119d2f..8b8d715cb1823 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/FloatField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/FloatField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBK.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBK.java index 617d61c747411..78895b45dfc16 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBK.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBK.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBKField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBKField.java index e204651232597..a6f1b3b1fa6d5 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBKField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/HSBKField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/LittleField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/LittleField.java index d15b7828b5375..7cc6c466bc786 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/LittleField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/LittleField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddress.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddress.java index 71d016412280b..bd32cc7832a03 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddress.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddress.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddressField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddressField.java index bb6bd2f4cbda9..3061e325d4f9c 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddressField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/MACAddressField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/StringField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/StringField.java index 3b87ee092c257..b93c90ebb16ed 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/StringField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/StringField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt16Field.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt16Field.java index 274e480f9a969..709b3d9ecc8a6 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt16Field.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt16Field.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt32Field.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt32Field.java index e1194b65a3d51..2b402657eebaa 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt32Field.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt32Field.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt64Field.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt64Field.java index 397a272f6622d..c2e60a9d989f0 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt64Field.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt64Field.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt8Field.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt8Field.java index 928a7ae23186c..0ca0ddf6f5f77 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt8Field.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/UInt8Field.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Version.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Version.java index cf7220b5ed666..eb216191bf412 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Version.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/Version.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/VersionField.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/VersionField.java index 4a842260a1f6e..616742494e7f2 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/VersionField.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/fields/VersionField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/handler/LifxLightHandler.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/handler/LifxLightHandler.java index ccc07b8574c75..ebb5c9203a9e4 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/handler/LifxLightHandler.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/handler/LifxLightHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -34,6 +34,7 @@ import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.Channel; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; @@ -56,9 +57,11 @@ import org.openhab.binding.lifx.internal.LifxLightStateChanger; import org.openhab.binding.lifx.internal.fields.HSBK; import org.openhab.binding.lifx.internal.fields.MACAddress; +import org.openhab.binding.lifx.internal.protocol.Effect; import org.openhab.binding.lifx.internal.protocol.GetLightInfraredRequest; import org.openhab.binding.lifx.internal.protocol.GetLightPowerRequest; import org.openhab.binding.lifx.internal.protocol.GetRequest; +import org.openhab.binding.lifx.internal.protocol.GetTileEffectRequest; import org.openhab.binding.lifx.internal.protocol.GetWifiInfoRequest; import org.openhab.binding.lifx.internal.protocol.Packet; import org.openhab.binding.lifx.internal.protocol.PowerState; @@ -92,6 +95,8 @@ public class LifxLightHandler extends BaseThingHandler { private @Nullable PercentType powerOnBrightness; private @Nullable HSBType powerOnColor; private @Nullable PercentType powerOnTemperature; + private Double effectMorphSpeed = 3.0; + private Double effectFlameSpeed = 4.0; private @NonNullByDefault({}) String logId; @@ -198,6 +203,12 @@ public void setSignalStrength(SignalStrength signalStrength) { super.setSignalStrength(signalStrength); } + @Override + public void setTileEffect(Effect effect) { + updateStateIfChanged(CHANNEL_EFFECT, new StringType(effect.getType().stringValue())); + super.setTileEffect(effect); + } + private void updateZoneChannels(@Nullable PowerState powerState, HSBK[] colors) { if (!product.hasFeature(MULTIZONE) || colors.length == 0) { return; @@ -217,7 +228,6 @@ private void updateZoneChannels(@Nullable PowerState powerState, HSBK[] colors) kelvinToPercentType(updateColor.getKelvin(), product.getTemperatureRange())); } } - } public LifxLightHandler(Thing thing, LifxChannelFactory channelFactory) { @@ -235,12 +245,19 @@ public void initialize() { logId = getLogId(configuration.getMACAddress(), configuration.getHost()); product = getProduct(); - logger.debug("{} : Initializing handler", logId); + logger.debug("{} : Initializing handler for product {}", logId, product.getName()); powerOnBrightness = getPowerOnBrightness(); powerOnColor = getPowerOnColor(); powerOnTemperature = getPowerOnTemperature(); - + Double speed = getEffectSpeed(LifxBindingConstants.CONFIG_PROPERTY_EFFECT_MORPH_SPEED); + if (speed != null) { + effectMorphSpeed = speed; + } + speed = getEffectSpeed(LifxBindingConstants.CONFIG_PROPERTY_EFFECT_FLAME_SPEED); + if (speed != null) { + effectFlameSpeed = speed; + } channelStates.clear(); currentLightState = new CurrentLightState(); pendingLightState = new LifxLightState(); @@ -371,10 +388,34 @@ public String getLogId(@Nullable MACAddress macAddress, @Nullable InetSocketAddr return null; } + private @Nullable Double getEffectSpeed(String parameter) { + Channel channel = null; + + if (product.hasFeature(TILE_EFFECT)) { + ChannelUID channelUID = new ChannelUID(getThing().getUID(), LifxBindingConstants.CHANNEL_EFFECT); + channel = getThing().getChannel(channelUID.getId()); + } + + if (channel == null) { + return null; + } + + Configuration configuration = channel.getConfiguration(); + Object speed = configuration.get(parameter); + return speed == null ? null : new Double(speed.toString()); + } + private Product getProduct() { - String propertyValue = getThing().getProperties().get(LifxBindingConstants.PROPERTY_PRODUCT_ID); + Object propertyValue = getThing().getProperties().get(LifxBindingConstants.PROPERTY_PRODUCT_ID); + if (propertyValue == null) { + return Product.getLikelyProduct(getThing().getThingTypeUID()); + } try { - long productID = Long.parseLong(propertyValue); + // Without first conversion to double, on a very first thing creation from discovery inbox, + // the product type is incorrectly parsed, as framework passed it as a floating point number + // (e.g. 50.0 instead of 50) + Double d = Double.parseDouble((String) propertyValue); + long productID = d.longValue(); return Product.getProductFromProductID(productID); } catch (IllegalArgumentException e) { return Product.getLikelyProduct(getThing().getThingTypeUID()); @@ -443,6 +484,11 @@ public void handleCommand(ChannelUID channelUID, Command command) { case CHANNEL_SIGNAL_STRENGTH: sendPacket(new GetWifiInfoRequest()); break; + case CHANNEL_EFFECT: + if (product.hasFeature(TILE_EFFECT)) { + sendPacket(new GetTileEffectRequest()); + } + break; default: break; } @@ -491,6 +537,13 @@ public void handleCommand(ChannelUID channelUID, Command command) { supportedCommand = false; } break; + case CHANNEL_EFFECT: + if (command instanceof StringType && product.hasFeature(TILE_EFFECT)) { + handleTileEffectCommand((StringType) command); + } else { + supportedCommand = false; + } + break; default: try { if (channelUID.getId().startsWith(CHANNEL_COLOR_ZONE)) { @@ -628,6 +681,19 @@ private void handleIncreaseDecreaseInfraredCommand(IncreaseDecreaseType increase } } + private void handleTileEffectCommand(StringType type) { + logger.debug("handleTileEffectCommand mode={}", type); + Double morphSpeedInMSecs = effectMorphSpeed * 1000.0; + Double flameSpeedInMSecs = effectFlameSpeed * 1000.0; + try { + Effect effect = Effect.createDefault(type.toString(), morphSpeedInMSecs.longValue(), + flameSpeedInMSecs.longValue()); + getLightStateForCommand().setTileEffect(effect); + } catch (IllegalArgumentException e) { + logger.debug("Wrong effect type received as command: {}", type); + } + } + private void updateStateIfChanged(String channel, State newState) { State oldState = channelStates.get(channel); if (oldState == null || !oldState.equals(newState)) { diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxLightStateListener.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxLightStateListener.java index ddc9c44d0b32b..9eab26632530d 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxLightStateListener.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxLightStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,6 +19,7 @@ import org.openhab.binding.lifx.internal.fields.HSBK; import org.openhab.binding.lifx.internal.protocol.PowerState; import org.openhab.binding.lifx.internal.protocol.SignalStrength; +import org.openhab.binding.lifx.internal.protocol.Effect; /** * The {@link LifxLightStateListener} is notified when the properties of a {@link LifxLightState} change. @@ -59,4 +60,12 @@ public interface LifxLightStateListener { * @param newSignalStrength the new signal strength value */ void handleSignalStrengthChange(@Nullable SignalStrength oldSignalStrength, SignalStrength newSignalStrength); + + /** + * Called when the tile effect changes. + * + * @param oldEffect the old tile effect value + * @param newEffect new tile effectvalue + */ + void handleTileEffectChange(@Nullable Effect oldEffect, Effect newEffect); } diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxPropertiesUpdateListener.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxPropertiesUpdateListener.java index ac1d6e747043c..69854c3462406 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxPropertiesUpdateListener.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxPropertiesUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxResponsePacketListener.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxResponsePacketListener.java index 6ecf6e6a714c4..568b8a02cb485 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxResponsePacketListener.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/listener/LifxResponsePacketListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/AcknowledgementResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/AcknowledgementResponse.java index fde1c592635ea..f600a94daf100 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/AcknowledgementResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/AcknowledgementResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/ApplicationRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/ApplicationRequest.java index a64d475d7e080..9d6e5c4f598dc 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/ApplicationRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/ApplicationRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/EchoRequestResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/EchoRequestResponse.java index f36e6356546cf..7c1f99e692268 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/EchoRequestResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/EchoRequestResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Effect.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Effect.java new file mode 100644 index 0000000000000..c94a5580dfd8c --- /dev/null +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Effect.java @@ -0,0 +1,169 @@ +/** + * 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.lifx.internal.protocol; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.lifx.internal.LifxBindingConstants; +import org.openhab.binding.lifx.internal.fields.HSBK; + +/** + * This class represents LIFX Tile effect + * + * @author Pawel Pieczul - initial contribution + */ +@NonNullByDefault +public class Effect { + public enum EffectType { + OFF(0), + MORPH(2), + FLAME(3); + + Integer type; + + EffectType(Integer type) { + this.type = type; + } + + public static EffectType fromValue(Integer value) { + switch (value) { + case 0: + return OFF; + case 2: + return MORPH; + case 3: + return FLAME; + default: + throw new IllegalArgumentException("Unknown effect type"); + } + } + + public static EffectType fromValue(String value) { + if (LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_OFF.equals(value)) { + return OFF; + } else if (LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_MORPH.equals(value)) { + return MORPH; + } else if (LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_FLAME.equals(value)) { + return FLAME; + } + throw new IllegalArgumentException("Unknown effect type"); + } + + public Integer intValue() { + return type; + } + + public String stringValue() { + switch (type) { + case 2: + return LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_MORPH; + case 3: + return LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_FLAME; + default: + return LifxBindingConstants.CHANNEL_TYPE_EFFECT_OPTION_OFF; + } + } + } + + final EffectType type; + final Long speed; + final Long duration; + final HSBK[] palette; + + public EffectType getType() { + return type; + } + + public Long getSpeed() { + return speed; + } + + public Long getDuration() { + return duration; + } + + HSBK[] getPalette() { + return palette; + } + + public Effect(EffectType type, Long speed, Long duration, HSBK[] palette) { + this.type = type; + this.palette = palette; + this.duration = duration; + this.speed = speed; + } + + public Effect(Integer type, Long speed, Long duration, HSBK[] palette) { + this(EffectType.fromValue(type), speed, duration, palette); + } + + public Effect() { + this(EffectType.OFF, 3000L, 0L, new HSBK[0]); + } + + public static Effect createDefault(String type, @Nullable Long morphSpeed, @Nullable Long flameSpeed) { + Long speed; + EffectType effectType = EffectType.fromValue(type); + switch (effectType) { + case OFF: + return new Effect(effectType, 0L, 0L, new HSBK[0]); + case MORPH: + if (morphSpeed == null) { + speed = 3000L; + } else { + speed = morphSpeed; + } + HSBK[] p = { new HSBK(0, 65535, 65535, 3500), new HSBK(7281, 65535, 65535, 3500), + new HSBK(10922, 65535, 65535, 3500), new HSBK(22209, 65535, 65535, 3500), + new HSBK(43507, 65535, 65535, 3500), new HSBK(49333, 65535, 65535, 3500), + new HSBK(53520, 65535, 65535, 3500) }; + return new Effect(effectType, speed, 0L, p); + case FLAME: + if (flameSpeed == null) { + speed = 4000L; + } else { + speed = flameSpeed; + } + return new Effect(effectType, speed, 0L, new HSBK[0]); + default: + throw new IllegalArgumentException("Unknown effect type"); + } + } + + @Override + public boolean equals(@Nullable Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + if (o.getClass() != getClass()) { + return false; + } + Effect n = (Effect) o; + return n.getType().equals(this.getType()) && n.duration.equals(this.duration) && n.speed.equals(this.speed) + && n.palette == this.palette; + } + + @Override + public int hashCode() { + Long hash = 1L; + int prime = 31; + hash = prime * hash + type.hashCode(); + hash = prime * hash + duration; + hash = prime * hash + speed; + hash = prime * hash + palette.hashCode(); + return hash.intValue(); + } +} diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericHandler.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericHandler.java index d453bd25c39f5..086f0577b633e 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericHandler.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericPacket.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericPacket.java index e3072aa0bc854..542672bcae9cd 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericPacket.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GenericPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetColorZonesRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetColorZonesRequest.java index fc5a18642c022..d28b49737898c 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetColorZonesRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetColorZonesRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetEchoRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetEchoRequest.java index c3df0767eb7fd..29b8f93c1322f 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetEchoRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetEchoRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetGroupRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetGroupRequest.java index 4d29ec67631c2..964e8012e5f94 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetGroupRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetGroupRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostFirmwareRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostFirmwareRequest.java index ca4700aff9565..35b9ef1ca80bf 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostFirmwareRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostFirmwareRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostInfoRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostInfoRequest.java index 49e9f81f4983a..c8aaf0d634b2f 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostInfoRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetHostInfoRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetInfoRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetInfoRequest.java index 593a0512cd8c2..94d35aaa6b6c1 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetInfoRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetInfoRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLabelRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLabelRequest.java index b18eee2a8f0a0..7ba5d5fabeadd 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLabelRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLabelRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightInfraredRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightInfraredRequest.java index f8f3ba5118e8b..4bc40a5180fd1 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightInfraredRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightInfraredRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightPowerRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightPowerRequest.java index ea6e5a7ccc158..16ce666646257 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightPowerRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLightPowerRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLocationRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLocationRequest.java index 1a1a43fe67e7b..f4bb2375ae1ae 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLocationRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetLocationRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetPowerRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetPowerRequest.java index 92e7914d57932..7d5a41ce28f61 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetPowerRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetPowerRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetRequest.java index 63c333c924463..ce7c0a30d44e8 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetServiceRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetServiceRequest.java index e781861182d11..1bb0555cd5223 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetServiceRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetServiceRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagLabelsRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagLabelsRequest.java index b73d9fbf457eb..a0e6e331d740e 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagLabelsRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagLabelsRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagsRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagsRequest.java index 458553469ec85..c3910d05bf2a3 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagsRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTagsRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTileEffectRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTileEffectRequest.java new file mode 100644 index 0000000000000..2e464a68c31ea --- /dev/null +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetTileEffectRequest.java @@ -0,0 +1,57 @@ +/** + * 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.lifx.internal.protocol; + +import java.nio.ByteBuffer; + +/** + * Implementation of GetTileEffect packet + * + * @author Pawel Pieczul - Add support for Tile Effects + */ +public class GetTileEffectRequest extends Packet { + + public static final int TYPE = 0x2CE; + + public GetTileEffectRequest() { + setTagged(false); + setAddressable(true); + setResponseRequired(true); + } + + @Override + public int packetType() { + return TYPE; + } + + @Override + protected int packetLength() { + return 0; + } + + @Override + protected void parsePacket(ByteBuffer bytes) { + // do nothing + } + + @Override + protected ByteBuffer packetBytes() { + return ByteBuffer.allocate(0); + } + + @Override + public int[] expectedResponses() { + return new int[] { StateTileEffectResponse.TYPE }; + } + +} diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetVersionRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetVersionRequest.java index d8f23368cc0f5..4479eec318fc9 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetVersionRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetVersionRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiFirmwareRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiFirmwareRequest.java index cfb5d45fdf986..22ad119029ce3 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiFirmwareRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiFirmwareRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiInfoRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiInfoRequest.java index 5a6d73ca0d268..468dd6e29d52b 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiInfoRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/GetWifiInfoRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Packet.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Packet.java index 57d2db9a2fb27..25dcec356fcc2 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Packet.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Packet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketFactory.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketFactory.java index ccd9c7c5a27dd..b05926d7cca25 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketFactory.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -64,6 +64,7 @@ private PacketFactory() { register(GetServiceRequest.class); register(GetTagLabelsRequest.class); register(GetTagsRequest.class); + register(GetTileEffectRequest.class); register(GetVersionRequest.class); register(GetWifiFirmwareRequest.class); register(GetWifiInfoRequest.class); @@ -87,6 +88,7 @@ private PacketFactory() { register(StatePowerResponse.class); register(StateResponse.class); register(StateServiceResponse.class); + register(StateTileEffectResponse.class); register(StateVersionResponse.class); register(StateWifiFirmwareResponse.class); register(StateWifiInfoResponse.class); diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketHandler.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketHandler.java index e8306fdeb783c..5f984d682d5cb 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketHandler.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PacketHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PowerState.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PowerState.java index 7f2e0c26c6e7c..b665c92b7f9c9 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PowerState.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/PowerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Product.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Product.java index 95458a7fc80e6..67f54538f47d6 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Product.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/Product.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -58,10 +58,12 @@ public enum Product { PRODUCT_50(50, "LIFX Mini Day and Dusk", TR_1500_4000), PRODUCT_51(51, "LIFX Mini White", TR_2700_2700), PRODUCT_52(52, "LIFX GU10", TR_2500_9000, COLOR), - PRODUCT_55(55, "LIFX Tile", TR_2500_9000, CHAIN, COLOR), + PRODUCT_55(55, "LIFX Tile", TR_2500_9000, CHAIN, COLOR, MATRIX, TILE_EFFECT), + PRODUCT_57(57, "LIFX Candle", TR_2500_9000, COLOR, MATRIX), PRODUCT_59(59, "LIFX Mini Color", TR_2500_9000, COLOR), PRODUCT_60(60, "LIFX Mini Day and Dusk", TR_1500_4000), - PRODUCT_61(61, "LIFX Mini White", TR_2700_2700); + PRODUCT_61(61, "LIFX Mini White", TR_2700_2700), + PRODUCT_68(68, "LIFX Candle", TR_2500_9000, COLOR, MATRIX); /** * Enumerates the product features. @@ -70,7 +72,9 @@ public enum Feature { CHAIN, COLOR, INFRARED, + MATRIX, MULTIZONE, + TILE_EFFECT } /** @@ -205,7 +209,9 @@ public TemperatureRange getTemperatureRange() { public ThingTypeUID getThingTypeUID() { if (hasFeature(COLOR)) { - if (hasFeature(INFRARED)) { + if (hasFeature(TILE_EFFECT)) { + return LifxBindingConstants.THING_TYPE_TILELIGHT; + } else if (hasFeature(INFRARED)) { return LifxBindingConstants.THING_TYPE_COLORIRLIGHT; } else if (hasFeature(MULTIZONE)) { return LifxBindingConstants.THING_TYPE_COLORMZLIGHT; diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorRequest.java index 60de1380210ab..b29d5d5938eac 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorZonesRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorZonesRequest.java index 57710ede6169c..771142d3812cd 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorZonesRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetColorZonesRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetDimAbsoluteRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetDimAbsoluteRequest.java index e0b8cd5043867..34b3eb3114cba 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetDimAbsoluteRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetDimAbsoluteRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLabelRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLabelRequest.java index 53208740a9bfa..1e581b20debcd 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLabelRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLabelRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightInfraredRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightInfraredRequest.java index f0d20bed8ec9e..f7dd20d59bd05 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightInfraredRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightInfraredRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightPowerRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightPowerRequest.java index 9ca809bb0bee3..a387c4d5c39cb 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightPowerRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetLightPowerRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetPowerRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetPowerRequest.java index 748d3f128a43c..23dfecae3ef11 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetPowerRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetPowerRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTagsRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTagsRequest.java index 200c438241c81..51e0fa17fcd97 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTagsRequest.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTagsRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTileEffectRequest.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTileEffectRequest.java new file mode 100644 index 0000000000000..1a49bdd3a2c4c --- /dev/null +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SetTileEffectRequest.java @@ -0,0 +1,154 @@ +/** + * 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.lifx.internal.protocol; + +import java.nio.ByteBuffer; + +import org.openhab.binding.lifx.internal.fields.Field; +import org.openhab.binding.lifx.internal.fields.HSBK; +import org.openhab.binding.lifx.internal.fields.HSBKField; +import org.openhab.binding.lifx.internal.fields.UInt32Field; +import org.openhab.binding.lifx.internal.fields.UInt64Field; +import org.openhab.binding.lifx.internal.fields.UInt8Field; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implementation of SetTileEffect packet + * + * @author Pawel Pieczul - Initial contribution + */ +public class SetTileEffectRequest extends Packet { + + public static final int TYPE = 0x2CF; + + // size.from.to....what + // ------------------------------ + // 1....0....0.....reserved + // 1....1....1.....reserved + // 4....2....5.....instance ID + // 1....6....6.....effect type + // 4....7....10....speed + // 8....11...18....duration + // 4....19...22....reserved + // 4....23...26....reserved + // 32...27...58....parameters (8*32 bits) + // 1....59...59....palette count + // 128..60...187...palette (16*8 bits) + + private static final Field<Integer> FIELD_RESERVED_0 = new UInt8Field(); + private static final Field<Integer> FIELD_RESERVED_1 = new UInt8Field(); + private static final Field<Long> FIELD_INSTANCE_ID = new UInt32Field().little(); + private static final Field<Integer> FIELD_TYPE = new UInt8Field(); + private static final Field<Long> FIELD_SPEED = new UInt32Field().little(); + private static final Field<Long> FIELD_DURATION = new UInt64Field().little(); + private static final Field<Long> FIELD_RESERVED_19_TO_26 = new UInt32Field().little(); + private static final Field<Long> FIELD_PARAMETER_27_TO_58 = new UInt32Field().little(); + private static final Field<Integer> FIELD_PALETTE_COUNT = new UInt8Field(); + private static final Field<HSBK> FIELD_PALETTE_60_TO_187 = new HSBKField(); + + private final Logger logger = LoggerFactory.getLogger(SetTileEffectRequest.class); + + private Integer reserved0 = 0; + private Integer reserved1 = 0; + private Long reserved19to22 = 0L; + private Long reserved23to26 = 0L; + private Effect effect; + + public SetTileEffectRequest() { + setTagged(false); + setAddressable(true); + setAckRequired(true); + } + + public SetTileEffectRequest(Effect effect) { + this(); + this.effect = effect; + } + + @Override + public int packetType() { + return TYPE; + } + + @Override + protected int packetLength() { + return 188; + } + + @Override + protected void parsePacket(ByteBuffer bytes) { + reserved0 = FIELD_RESERVED_0.value(bytes); + reserved1 = FIELD_RESERVED_1.value(bytes); + FIELD_INSTANCE_ID.value(bytes); + Integer effectType = FIELD_TYPE.value(bytes); + Long speed = FIELD_SPEED.value(bytes); + Long duration = FIELD_DURATION.value(bytes); + reserved19to22 = FIELD_RESERVED_19_TO_26.value(bytes); + reserved23to26 = FIELD_RESERVED_19_TO_26.value(bytes); + Long[] parameters = new Long[8]; + for (int i = 0; i < parameters.length; i++) { + parameters[i] = FIELD_PARAMETER_27_TO_58.value(bytes); + } + Integer paletteCount = FIELD_PALETTE_COUNT.value(bytes); + HSBK[] palette = new HSBK[paletteCount]; + for (int i = 0; i < palette.length; i++) { + palette[i] = FIELD_PALETTE_60_TO_187.value(bytes); + } + try { + effect = new Effect(effectType, speed, duration, palette); + } catch (IllegalArgumentException e) { + logger.debug("Wrong effect type received: {}", effectType); + effect = null; + } + } + + @Override + protected ByteBuffer packetBytes() { + ByteBuffer buffer = ByteBuffer.allocate(packetLength()); + buffer.put(FIELD_RESERVED_0.bytes(reserved0)); + buffer.put(FIELD_RESERVED_1.bytes(reserved1)); + buffer.put(FIELD_INSTANCE_ID.bytes(0L)); + buffer.put(FIELD_TYPE.bytes(effect.getType().intValue())); + buffer.put(FIELD_SPEED.bytes(effect.getSpeed())); + buffer.put(FIELD_DURATION.bytes(effect.getDuration())); + buffer.put(FIELD_RESERVED_19_TO_26.bytes(reserved19to22)); + buffer.put(FIELD_RESERVED_19_TO_26.bytes(reserved23to26)); + for (int i = 0; i < 8; i++) { + buffer.put(FIELD_PARAMETER_27_TO_58.bytes(0L)); + } + buffer.put(FIELD_PALETTE_COUNT.bytes(effect.getPalette().length)); + HSBK[] palette = effect.getPalette(); + for (int i = 0; i < palette.length; i++) { + buffer.put(FIELD_PALETTE_60_TO_187.bytes(palette[i])); + } + HSBK hsbkZero = new HSBK(0, 0, 0, 0); + for (int i = 0; i < 16 - palette.length; i++) { + buffer.put(FIELD_PALETTE_60_TO_187.bytes(hsbkZero)); + } + if (logger.isDebugEnabled()) { + logger.debug("SetTileEffectRequest: type={}, speed={}, duration={}, palette_count={}", effect.getType(), + effect.getSpeed(), effect.getDuration(), palette.length); + for (int i = 0; i < palette.length; i++) { + logger.debug("SetTileEffectRequest palette[{}] = {}", i, palette[i]); + } + } + return buffer; + } + + @Override + public int[] expectedResponses() { + return new int[] {}; + } + +} diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SignalStrength.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SignalStrength.java index c3fa439fc0a20..687b2add3d748 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SignalStrength.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/SignalStrength.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateGroupResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateGroupResponse.java index 72d2d2648b5fa..0a0b95f70603a 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateGroupResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateGroupResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostFirmwareResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostFirmwareResponse.java index 059e0ed74f667..029193db0727c 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostFirmwareResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostFirmwareResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostInfoResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostInfoResponse.java index e952b6409a14c..c33a575829f87 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostInfoResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateHostInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateInfoResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateInfoResponse.java index 2eaea1166b856..170caed171437 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateInfoResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLabelResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLabelResponse.java index 8f2e5c3b00d46..97e5ba198ee9c 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLabelResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLabelResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightInfraredResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightInfraredResponse.java index aef76a2995d94..5fd8aa320fb5c 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightInfraredResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightInfraredResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightPowerResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightPowerResponse.java index 6df8b5506e278..939ff6afde4c2 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightPowerResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLightPowerResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLocationResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLocationResponse.java index a5b624f5fe3eb..2fe40417d28c6 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLocationResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateLocationResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateMultiZoneResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateMultiZoneResponse.java index 94a032b5fe180..2d366b0407911 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateMultiZoneResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateMultiZoneResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StatePowerResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StatePowerResponse.java index ac5cabceff58a..55065df608330 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StatePowerResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StatePowerResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateResponse.java index 7e23d8a780d50..1c4be112f87a9 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateServiceResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateServiceResponse.java index c472d15b89aef..c391d0cf52b19 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateServiceResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateServiceResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateTileEffectResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateTileEffectResponse.java new file mode 100644 index 0000000000000..616c7e86b00ac --- /dev/null +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateTileEffectResponse.java @@ -0,0 +1,144 @@ +/** + * 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.lifx.internal.protocol; + +import java.nio.ByteBuffer; + +import org.openhab.binding.lifx.internal.fields.Field; +import org.openhab.binding.lifx.internal.fields.HSBK; +import org.openhab.binding.lifx.internal.fields.HSBKField; +import org.openhab.binding.lifx.internal.fields.UInt32Field; +import org.openhab.binding.lifx.internal.fields.UInt64Field; +import org.openhab.binding.lifx.internal.fields.UInt8Field; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Implementation of StateTileEffect packet + * + * @author Pawel Pieczul - Initial Contribution + */ +public class StateTileEffectResponse extends Packet { + + public static final int TYPE = 0x2D0; + + // size.from.to....what + // ------------------------------ + // 1....0....0.....reserved + // 4....1....4.....instance ID + // 1....5....5.....effect type + // 4....6....9.....speed + // 8....10...17....duration + // 4....18...21....reserved + // 4....22...25....reserved + // 32...26...57....parameters (8*32 bits) + // 1....58...58....palette count + // 128..59...186...palette (16*8 bits) + + private static final Field<Integer> FIELD_RESERVED_0 = new UInt8Field(); + private static final Field<Long> FIELD_INSTANCE_ID = new UInt32Field().little(); + private static final Field<Integer> FIELD_TYPE = new UInt8Field(); + private static final Field<Long> FIELD_SPEED = new UInt32Field().little(); + private static final Field<Long> FIELD_DURATION = new UInt64Field().little(); + private static final Field<Long> FIELD_RESERVED_18_TO_25 = new UInt32Field().little(); + private static final Field<Long> FIELD_PARAMETER_26_TO_57 = new UInt32Field().little(); + private static final Field<Integer> FIELD_PALETTE_COUNT = new UInt8Field(); + private static final Field<HSBK> FIELD_PALETTE_59_TO_186 = new HSBKField(); + + private Integer reserved0 = 0; + private Long reserved18to21 = 0L; + private Long reserved22to25 = 0L; + private Effect effect; + + private final Logger logger = LoggerFactory.getLogger(StateTileEffectResponse.class); + + public Effect getEffect() { + return effect; + } + + @Override + public int packetType() { + return TYPE; + } + + @Override + protected int packetLength() { + return 187; + } + + @Override + protected void parsePacket(ByteBuffer bytes) { + reserved0 = FIELD_RESERVED_0.value(bytes); + Long instanceId = FIELD_INSTANCE_ID.value(bytes); + Integer effectType = FIELD_TYPE.value(bytes); + Long speed = FIELD_SPEED.value(bytes); + Long duration = FIELD_DURATION.value(bytes); + reserved18to21 = FIELD_RESERVED_18_TO_25.value(bytes); + reserved22to25 = FIELD_RESERVED_18_TO_25.value(bytes); + Long[] parameters = new Long[8]; + for (int i = 0; i < 8; i++) { + parameters[i] = FIELD_PARAMETER_26_TO_57.value(bytes); + } + Integer paletteCount = FIELD_PALETTE_COUNT.value(bytes); + HSBK[] palette = new HSBK[paletteCount]; + for (int i = 0; i < palette.length; i++) { + palette[i] = FIELD_PALETTE_59_TO_186.value(bytes); + } + try { + effect = new Effect(effectType, speed, duration, palette); + } catch (IllegalArgumentException e) { + logger.debug("Wrong effect type received: {}", effectType); + effect = null; + } + if (logger.isDebugEnabled()) { + logger.debug("StateTileEffectResponse: instanceId={}, type={}, speed={}, duration={}, palette_count={}", + instanceId, effectType, speed, duration, paletteCount); + logger.debug("StateTileEffectResponse parameters=[{}, {}, {}, {}, {}, {}, {}, {}]", parameters[0], + parameters[1], parameters[2], parameters[3], parameters[4], parameters[5], parameters[6], + parameters[7]); + for (int i = 0; i < palette.length; i++) { + logger.debug("StateTileEffectResponse palette[{}] = {}", i, palette[i]); + } + } + } + + @Override + protected ByteBuffer packetBytes() { + ByteBuffer buffer = ByteBuffer.allocate(packetLength()); + buffer.put(FIELD_RESERVED_0.bytes(reserved0)); + buffer.put(FIELD_INSTANCE_ID.bytes(0L)); + buffer.put(FIELD_TYPE.bytes(effect.getType().intValue())); + buffer.put(FIELD_SPEED.bytes(effect.getSpeed())); + buffer.put(FIELD_DURATION.bytes(effect.getDuration())); + buffer.put(FIELD_RESERVED_18_TO_25.bytes(reserved18to21)); + buffer.put(FIELD_RESERVED_18_TO_25.bytes(reserved22to25)); + for (int i = 0; i < 8; i++) { + buffer.put(FIELD_PARAMETER_26_TO_57.bytes(0L)); + } + HSBK[] palette = effect.getPalette(); + buffer.put(FIELD_PALETTE_COUNT.bytes(palette.length)); + for (int i = 0; i < palette.length; i++) { + buffer.put(FIELD_PALETTE_59_TO_186.bytes(palette[i])); + } + HSBK hsbkZero = new HSBK(0, 0, 0, 0); + for (int i = 0; i < 16 - palette.length; i++) { + buffer.put(FIELD_PALETTE_59_TO_186.bytes(hsbkZero)); + } + return buffer; + } + + @Override + public int[] expectedResponses() { + return new int[] {}; + } +} diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateVersionResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateVersionResponse.java index 985e0a0384a2a..d301b52c16581 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateVersionResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateVersionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiFirmwareResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiFirmwareResponse.java index 0825589382979..876eb43eb876d 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiFirmwareResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiFirmwareResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiInfoResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiInfoResponse.java index 73e4a7dedde6e..401b7a71c8139 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiInfoResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateWifiInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateZoneResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateZoneResponse.java index 5fd270614ec04..a975bdd80aefd 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateZoneResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/StateZoneResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagLabelsResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagLabelsResponse.java index 74e5fa00ad5c3..d90493b9a650d 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagLabelsResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagLabelsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagsResponse.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagsResponse.java index 7811460f7599c..0caea16525460 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagsResponse.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/protocol/TagsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxMessageUtil.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxMessageUtil.java index 55bcf27c82dc9..d03a3b4c58dbc 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxMessageUtil.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxMessageUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxNetworkUtil.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxNetworkUtil.java index 61b362d961b23..70fd4d02bfa11 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxNetworkUtil.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxNetworkUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxSelectorUtil.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxSelectorUtil.java index 6941a502e0b28..3c76885d7c60f 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxSelectorUtil.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxSelectorUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxThrottlingUtil.java b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxThrottlingUtil.java index 6f930466b6ac9..e7785afef1dc3 100644 --- a/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxThrottlingUtil.java +++ b/bundles/org.openhab.binding.lifx/src/main/java/org/openhab/binding/lifx/internal/util/LifxThrottlingUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/config/config.xml index 090c5be36df06..af6f9df2d1741 100644 --- a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/config/config.xml @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:lifx:light"> <parameter name="deviceId" type="text" pattern="([0-9A-Fa-f]{12})" required="false"> - <label>LIFX device ID</label> + <label>LIFX Device ID</label> <description>Identifies the light e.g. "D073D5A1A1A1"</description> </parameter> <parameter name="host" type="text" required="false"> @@ -14,7 +15,7 @@ <context>network-address</context> </parameter> <parameter name="fadetime" type="integer" required="false"> - <label>Fade time</label> + <label>Fade Time</label> <description>The time to fade to the new color value (in ms).</description> <default>300</default> </parameter> @@ -22,27 +23,42 @@ <config-description uri="channel-type:lifx:brightness"> <parameter name="powerOnBrightness" type="integer" min="0" max="100" required="false" unit="%"> - <label>Power on brightness</label> + <label>Power On Brightness</label> <description>Brightness level used when switching on the light. Use empty value to leave brightness as is.</description> </parameter> </config-description> <config-description uri="channel-type:lifx:color"> <parameter name="powerOnBrightness" type="integer" min="0" max="100" required="false" unit="%"> - <label>Power on brightness</label> + <label>Power On Brightness</label> <description>Brightness level used when switching on the light. Use empty value to leave brightness as is.</description> </parameter> - <parameter name="powerOnColor" type="text" pattern="(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9][0-9]|[0-9]),(100|[1-9][0-9]|[0-9]),(100|[1-9][0-9]|[0-9])" required="false"> - <label>Power on Color</label> + <parameter name="powerOnColor" type="text" + pattern="(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9][0-9]|[0-9]),(100|[1-9][0-9]|[0-9]),(100|[1-9][0-9]|[0-9])" + required="false"> + <label>Power On Color</label> <description>Comma separated Hue (0-360), saturation (0-100) and brightness (0-100) levels used when switching on the light. Use empty value to leave it as is.</description> </parameter> </config-description> <config-description uri="channel-type:lifx:temperature"> <parameter name="powerOnTemperature" type="integer" min="0" max="100" required="false" unit="%"> - <label>Power on temperature</label> + <label>Power On Temperature</label> <description>Color temperature level used when switching on the light. Use empty value to leave color temperature as is.</description> </parameter> </config-description> + <config-description uri="channel-type:lifx:effect"> + <parameter name="effectMorphSpeed" type="decimal" min="0" max="120" step="0.1" required="false" unit="s"> + <label>Morph effect speed</label> + <description>Speed of the morph effect in seconds.</description> + <default>3</default> + </parameter> + <parameter name="effectFlameSpeed" type="decimal" min="0" max="120" step="0.1" required="false" unit="s"> + <label>Flame effect speed</label> + <description>Speed of the flame effect in seconds.</description> + <default>4</default> + </parameter> + </config-description> + </config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx.properties b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx.properties index dd3e50c8ae59c..1cc88dac0005a 100644 --- a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx.properties +++ b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx.properties @@ -29,6 +29,11 @@ channel-type.lifx.temperature.label = Temperature channel-type.lifx.temperature.description = Sets the temperature of the light channel-type.lifx.temperaturezone.label = Temperature zone {0} channel-type.lifx.temperaturezone.description = Sets the zone {0} temperature of the light +channel-type.lifx.effect.label = Effect +channel-type.lifx.effect.description = Sets the effect of the light +channel-type.lifx.effect.state.option.off = Off +channel-type.lifx.effect.state.option.morph = Morph +channel-type.lifx.effect.state.option.flame = Flame # channel type configuration channel-type.config.lifx.brightness.powerOnBrightness.label = Power on brightness @@ -39,3 +44,7 @@ channel-type.config.lifx.color.powerOnColor.label = Power on color channel-type.config.lifx.color.powerOnColor.description = Color used when switching on the light. Use empty value to leave color as is. channel-type.config.lifx.temperature.powerOnTemperature.label = Power on color temperature channel-type.config.lifx.temperature.powerOnTemperature.description = Color temperature used when switching on the light. Use empty value to leave color temperature as is. +channel-type.config.lifx.effect.effectMorphSpeed.label = Morph effect speed +channel-type.config.lifx.effect.effectMorphSpeed.description = Speed of the morph effect in seconds. +channel-type.config.lifx.effect.effectFlameSpeed.label = Flame effect speed +channel-type.config.lifx.effect.effectFlameSpeed.description = Speed of the flame effect in seconds. diff --git a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx_nl.properties b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx_nl.properties index 321280f49051e..1a6afa243d36d 100644 --- a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx_nl.properties +++ b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/i18n/lifx_nl.properties @@ -29,7 +29,16 @@ channel-type.lifx.temperature.label = Temperatuur channel-type.lifx.temperature.description = Bepaalt de kleurtemperatuur van de lamp channel-type.lifx.temperaturezone.label = Temperatuur zone {0} channel-type.lifx.temperaturezone.description = Bepaalt de kleurtemperatuur van lampzone {0} +channel-type.lifx.effect.label = Effect +channel-type.lifx.effect.description = Bepaalt het lichteffect +channel-type.lifx.effect.state.option.off = Uit +channel-type.lifx.effect.state.option.morph = Morph +channel-type.lifx.effect.state.option.flame = Flamme # channel type configuration channel-type.config.lifx.brightness.powerOnBrightness.label = Inschakelhelderheid channel-type.config.lifx.brightness.powerOnBrightness.description = Het helderheidsniveau bij inschakeling van de lamp. Gebruik een lege waarde om de helderheid ongewijzigd te laten. +channel-type.config.lifx.effect.effectMorphSpeed.label = Morph-effect snelheid +channel-type.config.lifx.effect.effectMorphSpeed.description = De snelheid van het Morph-effect in seconden. +channel-type.config.lifx.effect.effectFlameSpeed.label = Vlam-effect snelheid +channel-type.config.lifx.effect.effectFlameSpeed.description = De snelheid van het Vlam-effect in seconden. diff --git a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/channel.xml b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/channel.xml index 877eb5efeea33..2435546d4dfb8 100644 --- a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/channel.xml +++ b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/channel.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="lifx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="lifx" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -27,7 +28,7 @@ <channel-type id="colorzone" advanced="true"> <item-type>Color</item-type> - <label>Color zone</label> + <label>Color Zone</label> <description>Selects the zone color of the light</description> <category>ColorLight</category> <tags> @@ -51,9 +52,23 @@ <channel-type id="temperaturezone" advanced="true"> <item-type>Dimmer</item-type> - <label>Temperature zone</label> + <label>Temperature Zone</label> <description>Sets the zone temperature of the light</description> <category>ColorLight</category> </channel-type> + <channel-type id="effect"> + <item-type>String</item-type> + <label>Effect</label> + <description>Sets the effect of the light</description> + <state> + <options> + <option value="off">Off</option> + <option value="morph">Morph</option> + <option value="flame">Flame</option> + </options> + </state> + <config-description-ref uri="channel-type:lifx:effect" /> + </channel-type> + </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/tilelight.xml b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/tilelight.xml new file mode 100644 index 0000000000000..6f155fca97056 --- /dev/null +++ b/bundles/org.openhab.binding.lifx/src/main/resources/ESH-INF/thing/tilelight.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="lifx" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="tilelight"> + <label>LIFX Tile Light</label> + <channels> + <channel id="color" typeId="color" /> + <channel id="temperature" typeId="temperature" /> + <channel id="signalstrength" typeId="system.signal-strength" /> + <channel id="effect" typeId="effect" /> + </channels> + <representation-property>macAddress</representation-property> + <config-description-ref uri="thing-type:lifx:light" /> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.linuxinput/NOTICE b/bundles/org.openhab.binding.linuxinput/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.linuxinput/NOTICE +++ b/bundles/org.openhab.binding.linuxinput/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.linuxinput/noEmbedDependencies.profile b/bundles/org.openhab.binding.linuxinput/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.linuxinput/pom.xml b/bundles/org.openhab.binding.linuxinput/pom.xml index 5d11fa612e77b..d874193a2ce94 100644 --- a/bundles/org.openhab.binding.linuxinput/pom.xml +++ b/bundles/org.openhab.binding.linuxinput/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.linuxinput</artifactId> @@ -23,7 +22,7 @@ <groupId>com.github.jnr</groupId> <artifactId>jffi</artifactId> <version>1.2.18</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <!-- we need this for RPi hardfloat abi --> <dependency> @@ -31,7 +30,7 @@ <artifactId>jffi</artifactId> <version>1.2.18</version> <classifier>native</classifier> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> </dependencyManagement> @@ -41,13 +40,13 @@ <groupId>com.github.jnr</groupId> <artifactId>jnr-enxio</artifactId> <version>0.19</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>com.github.jnr</groupId> <artifactId>jnr-posix</artifactId> <version>3.0.47</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> </project> diff --git a/bundles/org.openhab.binding.linuxinput/src/main/feature/feature.xml b/bundles/org.openhab.binding.linuxinput/src/main/feature/feature.xml index f650076db82f7..2e411ff0f8f35 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.linuxinput/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.linuxinput-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-linuxinput" description="Linux Input Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/DeviceReadingHandler.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/DeviceReadingHandler.java index a9cc429b0f0e4..b8a007e0f609d 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/DeviceReadingHandler.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/DeviceReadingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputBindingConstants.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputBindingConstants.java index be784d110eac2..5ef068393e58c 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputBindingConstants.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputConfiguration.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputConfiguration.java index 7dd0d1951e622..ae5f37cbb8369 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputConfiguration.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputDiscoveryService.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputDiscoveryService.java index 8052e7251ab93..d28366554753b 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputDiscoveryService.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandler.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandler.java index bb8c1367499fb..e9b01bf1d4560 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandler.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandlerFactory.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandlerFactory.java index 6d0bc2b8f1f91..6bfb1ab3c005f 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandlerFactory.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/LinuxInputHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/Utils.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/Utils.java index 77add8dbeaa9d..311bc9ccf1e7b 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/Utils.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/EvdevDevice.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/EvdevDevice.java index 13eac51b00323..162ab8171cb44 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/EvdevDevice.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/EvdevDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/LastErrorException.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/LastErrorException.java index 2be8b7fe94db3..11da336fa995f 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/LastErrorException.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/LastErrorException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/Utils.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/Utils.java index 433fa47bf556d..fc155af72e79c 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/Utils.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/EvdevLibrary.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/EvdevLibrary.java index c8215525541e2..286a7550abf4c 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/EvdevLibrary.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/EvdevLibrary.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -10,7 +10,6 @@ * * SPDX-License-Identifier: EPL-2.0 */ - package org.openhab.binding.linuxinput.internal.evdev4j.jnr; import static org.openhab.binding.linuxinput.internal.evdev4j.Utils.constantFromInt; diff --git a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/Utils.java b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/Utils.java index 57b73434f5689..8d1fcd2484009 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/Utils.java +++ b/bundles/org.openhab.binding.linuxinput/src/main/java/org/openhab/binding/linuxinput/internal/evdev4j/jnr/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/binding/binding.xml index d49001dae06eb..847e17071cc0d 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="linuxinput" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>LinuxInput Binding</name> <description>This is the binding for LinuxInput.</description> diff --git a/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/thing/thing-types.xml index a2ed4799c8071..b27e32f5f0106 100644 --- a/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.linuxinput/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="linuxinput" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="input-device"> <label>LinuxInput Device</label> diff --git a/bundles/org.openhab.binding.lirc/NOTICE b/bundles/org.openhab.binding.lirc/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.lirc/NOTICE +++ b/bundles/org.openhab.binding.lirc/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.lirc/pom.xml b/bundles/org.openhab.binding.lirc/pom.xml index 2412486306a85..037f575e3e34d 100644 --- a/bundles/org.openhab.binding.lirc/pom.xml +++ b/bundles/org.openhab.binding.lirc/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lirc</artifactId> diff --git a/bundles/org.openhab.binding.lirc/src/main/feature/feature.xml b/bundles/org.openhab.binding.lirc/src/main/feature/feature.xml index a5ed530427df9..6aaff9cd5f012 100644 --- a/bundles/org.openhab.binding.lirc/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lirc/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lirc-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lirc" description="LIRC Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCBindingConstants.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCBindingConstants.java index 7edbec1bcbcc2..7d17b0981dd89 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCBindingConstants.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCHandlerFactory.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCHandlerFactory.java index 9cb467710356c..91b04e536a873 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCHandlerFactory.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCMessageListener.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCMessageListener.java index 3d7d1ef4dc48e..126d861177e1e 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCMessageListener.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCResponseException.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCResponseException.java index ab1b64e534a83..1888795d31140 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCResponseException.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/LIRCResponseException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCBridgeConfiguration.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCBridgeConfiguration.java index 9c918f53f37e1..78c732d71f0da 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCBridgeConfiguration.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCRemoteConfiguration.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCRemoteConfiguration.java index 93ecaebf18ef6..e613411786130 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCRemoteConfiguration.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/config/LIRCRemoteConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCConnector.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCConnector.java index c0c138b8f9c1d..7bdf61fe5c9be 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCConnector.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCEventListener.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCEventListener.java index 191afb762363d..aa9ce31148504 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCEventListener.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCStreamReader.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCStreamReader.java index 6e127eac3dacd..ac50b58de8731 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCStreamReader.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/connector/LIRCStreamReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/discovery/LIRCRemoteDiscoveryService.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/discovery/LIRCRemoteDiscoveryService.java index 41033b4c2b4ea..5dcadaac23299 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/discovery/LIRCRemoteDiscoveryService.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/discovery/LIRCRemoteDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCBridgeHandler.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCBridgeHandler.java index 36352035f30a5..672b2447d85b4 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCBridgeHandler.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCRemoteHandler.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCRemoteHandler.java index ca31f07c3eae0..3851d4c2c4569 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCRemoteHandler.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/handler/LIRCRemoteHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCButtonEvent.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCButtonEvent.java index 5a7d72a1e3112..c0c39ca1719ae 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCButtonEvent.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCButtonEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCResponse.java b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCResponse.java index dc8d117b9a1ee..3e0faaec8cda6 100644 --- a/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCResponse.java +++ b/bundles/org.openhab.binding.lirc/src/main/java/org/openhab/binding/lirc/internal/messages/LIRCResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/bridge.xml index 880a67d4e46fc..a9ab8d2759fae 100644 --- a/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/bridge.xml @@ -16,7 +16,7 @@ <description>The host of the LIRC server</description> <default>localhost</default> </parameter> - <parameter name="portNumber" type="integer" min="0" max="65536" step="1"> + <parameter name="portNumber" type="integer" min="1" max="65535"> <label>Port</label> <description>The port number the LIRC server is listening to.</description> <default>8765</default> diff --git a/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/thing-types.xml index e57ab362a450e..c3f53524fbe36 100644 --- a/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.lirc/src/main/resources/ESH-INF/thing/thing-types.xml @@ -15,7 +15,7 @@ <config-description> <parameter name="remote" type="text" required="true"> - <label>Remote name</label> + <label>Remote Name</label> <description>The name of the remote as configured in LIRC</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.logreader/.classpath b/bundles/org.openhab.binding.logreader/.classpath old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.logreader/.project b/bundles/org.openhab.binding.logreader/.project old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.logreader/NOTICE b/bundles/org.openhab.binding.logreader/NOTICE index 3aa8e63be0dee..006babd8dd2e3 100644 --- a/bundles/org.openhab.binding.logreader/NOTICE +++ b/bundles/org.openhab.binding.logreader/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.logreader/README.md b/bundles/org.openhab.binding.logreader/README.md old mode 100755 new mode 100644 index 386248535ad46..2ad53f7d683c7 --- a/bundles/org.openhab.binding.logreader/README.md +++ b/bundles/org.openhab.binding.logreader/README.md @@ -7,6 +7,7 @@ When certain log events are recognized, openHAB rules can be used to send notifi This binding supports one ThingType: `reader`. A reader supports 3 separate channels + * One for errors * one for warnings * one custom channel for other purposes. @@ -19,31 +20,31 @@ The `reader` Thing has the following configuration parameters: | ------------------------------| ------- | -------- | -------------------------------- |-----------------------------------------------------------------------------------------| | `filePath` | String | yes | `${OPENHAB_LOGDIR}/openhab.log` | Path to log file. ${OPENHAB_LOGDIR} is automatically replaced by the correct directory. | | `refreshRate` | integer | no | `1000` | Time in milliseconds between individual log reads. | -| `errorPatterns` | String | no | `ERROR+` | Search patterns separated by \| character for error events. | +| `errorPatterns` | String | no | `ERROR+` | Search patterns separated by \| character for error events. | | `errorBlacklistingPatterns` | String | no | | Search patterns for blacklisting unwanted error events separated by \| character. | -| `warningPatterns` | String | no | `WARN+` | Search patterns separated by \| character for warning events. | +| `warningPatterns` | String | no | `WARN+` | Search patterns separated by \| character for warning events. | | `warningBlacklistingPatterns` | String | no | | Search patterns for blacklisting unwanted warning events separated by \| character. | -| `customPatterns` | String | no | | Search patterns separated by \| character for custom events. | +| `customPatterns` | String | no | | Search patterns separated by \| character for custom events. | | `customBlacklistingPatterns` | String | no | | Search patterns for blacklisting unwanted custom events separated by \| character. | -Search patterns follows Java regular expression syntax. See https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html. +Search patterns follows Java regular expression syntax. See https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html. ## Channels List of channels -| Channel Type ID | Item Type | Description | -| ------------------ | ------------ | -------------------------------------------------------------- | -| `lastErrorEvent` | `String` | Displays content of last [ERROR] event | -| `lastWarningEvent` | `String` | Displays content of last [WARN] event | -| `lastCustomEvent` | `String` | Displays content of last [CUSTOM] event | -| `errorEvents` | `Number` | Displays number of [ERROR] lines matched to search pattern | -| `warningEvents` | `Number` | Displays number of [WARN] lines matched to search pattern | -| `customEvents` | `Number` | Displays number of [CUSTOM] lines matched to search pattern | -| `logRotated` | `DateTime` | Last time when log rotated recognized | -| `newErrorEvent` | - | Trigger channel for last [ERROR] line | -| `newWarningEvent` | - | Trigger channel for last [WARN] line | -| `newCustomEvent` | - | Trigger channel for last [CUSTOM] line | +| Channel Type ID | Item Type | Description | +| ------------------ | ------------ | ----------------------------------------------------------- | +| `lastErrorEvent` | `String` | Displays content of last [ERROR] event | +| `lastWarningEvent` | `String` | Displays content of last [WARN] event | +| `lastCustomEvent` | `String` | Displays content of last [CUSTOM] event | +| `errorEvents` | `Number` | Displays number of [ERROR] lines matched to search pattern | +| `warningEvents` | `Number` | Displays number of [WARN] lines matched to search pattern | +| `customEvents` | `Number` | Displays number of [CUSTOM] lines matched to search pattern | +| `logRotated` | `DateTime` | Last time when log rotated recognized | +| `newErrorEvent` | - | Trigger channel for last [ERROR] line | +| `newWarningEvent` | - | Trigger channel for last [WARN] line | +| `newCustomEvent` | - | Trigger channel for last [CUSTOM] line | ## Examples diff --git a/bundles/org.openhab.binding.logreader/pom.xml b/bundles/org.openhab.binding.logreader/pom.xml old mode 100755 new mode 100644 index db43d4f563583..f18ccc6b72f12 --- a/bundles/org.openhab.binding.logreader/pom.xml +++ b/bundles/org.openhab.binding.logreader/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.logreader</artifactId> diff --git a/bundles/org.openhab.binding.logreader/src/main/feature/feature.xml b/bundles/org.openhab.binding.logreader/src/main/feature/feature.xml index ac0ca97b6709c..588337bb6a077 100644 --- a/bundles/org.openhab.binding.logreader/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.logreader/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.logreader-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-logreader" description="Log Reader Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderBindingConstants.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderBindingConstants.java old mode 100755 new mode 100644 index af0aac2c8186a..7568210b965c6 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderBindingConstants.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderHandlerFactory.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderHandlerFactory.java old mode 100755 new mode 100644 index 7c24e19658743..0427489636a90 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderHandlerFactory.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/LogReaderHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/config/LogReaderConfiguration.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/config/LogReaderConfiguration.java index 6436afcc84ca5..bb713d199381a 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/config/LogReaderConfiguration.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/config/LogReaderConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/AbstractLogFileReader.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/AbstractLogFileReader.java index e3935b0ed1d70..09b697d961e8f 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/AbstractLogFileReader.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/AbstractLogFileReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/FileTailer.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/FileTailer.java index b123ec5bdcba6..49f9742912767 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/FileTailer.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/FileTailer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,8 @@ package org.openhab.binding.logreader.internal.filereader; import java.io.File; -import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import org.apache.commons.io.input.Tailer; import org.apache.commons.io.input.TailerListener; @@ -34,6 +35,7 @@ public class FileTailer extends AbstractLogFileReader implements LogFileReader { private final Logger logger = LoggerFactory.getLogger(FileTailer.class); private Tailer tailer; + private ExecutorService executor; TailerListener logListener = new TailerListenerAdapter() { @@ -59,13 +61,13 @@ public void fileRotated() { }; @Override - public void start(String filePath, long refreshRate, ScheduledExecutorService scheduler) - throws FileReaderException { + public void start(String filePath, long refreshRate) throws FileReaderException { tailer = new Tailer(new File(filePath), logListener, refreshRate, true, false, true); - + executor = Executors.newSingleThreadExecutor(); try { logger.debug("Start executor"); - scheduler.execute(tailer); + executor.execute(tailer); + logger.debug("Executor started"); } catch (Exception e) { throw new FileReaderException(e); } @@ -74,9 +76,12 @@ public void start(String filePath, long refreshRate, ScheduledExecutorService sc @Override public void stop() { logger.debug("Shutdown"); - if (tailer != null) { tailer.stop(); } + if (executor != null) { + executor.shutdown(); + } + logger.debug("Shutdown complite"); } } diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderException.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderException.java index c4eba6cf8d70f..a0dd32978f026 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderException.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderListener.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderListener.java index e0066dfead263..cd699e948aa2a 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderListener.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/FileReaderListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/LogFileReader.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/LogFileReader.java index 4a18b8d92f408..5df2fd379e017 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/LogFileReader.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/filereader/api/LogFileReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,8 +12,6 @@ */ package org.openhab.binding.logreader.internal.filereader.api; -import java.util.concurrent.ScheduledExecutorService; - /** * Interface for log file readers. * @@ -42,10 +40,9 @@ public interface LogFileReader { * * @param filePath file to read. * @param refreshRate how often file is read. - * @param scheduler executor service to use. * @throws FileReaderException */ - void start(String filePath, long refreshRate, ScheduledExecutorService scheduler) throws FileReaderException; + void start(String filePath, long refreshRate) throws FileReaderException; /** * Stop log file reader. diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/handler/LogHandler.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/handler/LogHandler.java old mode 100755 new mode 100644 index 263917a0ad8fc..e9a440a163fe8 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/handler/LogHandler.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/handler/LogHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -104,7 +104,7 @@ public void initialize() { try { fileReader.registerListener(this); - fileReader.start(configuration.filePath, configuration.refreshRate, scheduler); + fileReader.start(configuration.filePath, configuration.refreshRate); updateStatus(ThingStatus.ONLINE); } catch (Exception e) { logger.debug("Exception occurred during initalization: {}. ", e.getMessage(), e); diff --git a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/searchengine/SearchEngine.java b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/searchengine/SearchEngine.java index 7788cd8c09a5f..e764d4b4dd5a6 100644 --- a/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/searchengine/SearchEngine.java +++ b/bundles/org.openhab.binding.logreader/src/main/java/org/openhab/binding/logreader/internal/searchengine/SearchEngine.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/binding/binding.xml old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/channels.xml index effb9174cb5e0..083464f84cbd7 100644 --- a/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/channels.xml @@ -5,35 +5,35 @@ <channel-type id="lastErrorEvent"> <item-type>String</item-type> - <label>Last error event</label> + <label>Last Error Event</label> <description>Displays contents of last [ERROR] event</description> <state readOnly="true"></state> </channel-type> <channel-type id="lastWarningEvent"> <item-type>String</item-type> - <label>Last warning event</label> + <label>Last Warning Event</label> <description>Displays contents of last [WARN] event</description> <state readOnly="true"></state> </channel-type> <channel-type id="lastCustomEvent" advanced="true"> <item-type>String</item-type> - <label>Last custom event</label> + <label>Last Custom Event</label> <description>Displays contents of last custom event</description> <state readOnly="true"></state> </channel-type> <channel-type id="warningEvents"> <item-type>Number</item-type> - <label>Warning events matched</label> + <label>Warning Events Matched</label> <description>Displays number of [WARN] lines matched to search pattern</description> </channel-type> <channel-type id="errorEvents"> <item-type>Number</item-type> - <label>Error events matched</label> + <label>Error Events Matched</label> <description>Displays number of [ERROR] lines matched to search pattern</description> </channel-type> <channel-type id="customEvents" advanced="true"> <item-type>Number</item-type> - <label>Custom events matched</label> + <label>Custom Events Matched</label> <description>Displays number of custom lines matched to search pattern</description> </channel-type> <channel-type id="logRotated" advanced="true"> diff --git a/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/reader.xml b/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/reader.xml old mode 100755 new mode 100644 index 21cac16afc507..f460d2b1b0849 --- a/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/reader.xml +++ b/bundles/org.openhab.binding.logreader/src/main/resources/ESH-INF/thing/reader.xml @@ -24,12 +24,12 @@ <config-description> <parameter name="filePath" type="text" required="true"> - <label>Log file path</label> + <label>Log File Path</label> <description>Path to log file. Empty will default to ${OPENHAB_LOGDIR}/openhab.log</description> <default>${OPENHAB_LOGDIR}/openhab.log</default> </parameter> <parameter name="refreshRate" type="integer" required="false"> - <label>Refresh rate</label> + <label>Refresh Rate</label> <description>Refresh rate in milliseconds for reading logs</description> <default>1000</default> </parameter> diff --git a/bundles/org.openhab.binding.loxone/NOTICE b/bundles/org.openhab.binding.loxone/NOTICE index e374be948c848..f26b23eaf999b 100644 --- a/bundles/org.openhab.binding.loxone/NOTICE +++ b/bundles/org.openhab.binding.loxone/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.loxone/README.md b/bundles/org.openhab.binding.loxone/README.md index aae1d9d26a854..cf4641c237533 100644 --- a/bundles/org.openhab.binding.loxone/README.md +++ b/bundles/org.openhab.binding.loxone/README.md @@ -1,6 +1,6 @@ # Loxone Binding -This binding integrates [Loxone Miniserver](https://www.loxone.com/enen/products/miniserver-extensions/) with [openHAB](http://www.openhab.org/). +This binding integrates [Loxone Miniserver](https://www.loxone.com/enen/products/miniserver-extensions/) with [openHAB](https://www.openhab.org/). Miniserver is represented as a [Thing](https://www.openhab.org/docs/configuration/things.html). Miniserver controls, that are visible in the Loxone [UI](https://www.loxone.com/enen/kb/user-interface-configuration/), are exposed as openHAB channels. ## Features @@ -14,7 +14,7 @@ The following features are currently supported: * Updates of openHAB channel's state in runtime according to control's state changes on the Miniserver * Passing channel commands to the Miniserver's controls * Hash-based and token-based authentication methods -* Command encryption and response decryption +* Command encryption and response decryption ## Things @@ -121,6 +121,19 @@ Currently supported controls are presented in the table below. | Dimmer | [Dimmer](https://www.loxone.com/enen/kb/dimmer/) | `Dimmer` | `OnOffType.*`, `PercentType` | | InfoOnlyAnalog | Analog [virtual inputs](https://www.loxone.com/enen/kb/virtual-inputs-outputs/) (virtual state) | `Number` | Read-only channel | | InfoOnlyDigital | Digital [virtual inputs](https://www.loxone.com/enen/kb/virtual-inputs-outputs/) (virtual state) | `String` | Read-only channel | +| IRoomControllerV2 | [Intelligent Room Controller V2](https://www.loxone.com/enen/kb/irc-v2/) | `Number` - active mode | Read-only channel | +| | | `Number` - operating mode | `DecimalType` - operating mode | +| | | `Number` - prepare state | Read-only channel | +| | | `Switch` - open window | Read-only channel | +| | | `Number` - current temperature | Read-only channel | +| | | `Number` - target temperature | `DecimalType` | +| | | `Number` - comfort temperature | `DecimalType` | +| | | `Number` - comfort temperature offset | `DecimalType` | +| | | `Number` - comfort tolerance | `DecimalType` | +| | | `Number` - absent minimum temperature offset | `DecimalType` | +| | | `Number` - absent maximum temperature offset | `DecimalType` | +| | | `Number` - frost protect temperature | Read-only channel | +| | | `Number` - heat protect temperature | Read-only channel | | Jalousie | Blinds, [Automatic Blinds](https://www.loxone.com/enen/kb/automatic-blinds/), Automatic Blinds Integrated | `Rollershutter` - main control element | `UpDownType.*`, `StopMoveType.*`, `PercentType` | | | | `Switch` - shading | `OnOffType.ON` - shade | | | | `Switch` - automatic shading | `OnOffType.*` - automatic shading enabled/disabled | @@ -130,6 +143,8 @@ Currently supported controls are presented in the table below. | LightController | [Lighting controller V1 (obsolete)](https://www.loxone.com/enen/kb/lighting-controller/), [Hotel lighting controller](https://www.loxone.com/enen/kb/hotel-lighting-controller/)<br>Additionally, for each configured output of a lighting controller, a new independent control (with own channel/item) will be created. | `Number` | `DecimalType` - select lighting scene, `UpDownType.*` - swipe through scenes, `OnOffType.*` - select all off or all on scene | | LightControllerV2 | [Lighting controller](https://www.loxone.com/enen/kb/lighting-controller-v2/)<br>Additionally, for each configured output and for each mood of a lighting controller, a new independent control (with own channel/item) will be created. | `Number` | `DecimalType` - select mood, `UpDownType.*` - swipe through moods | | LightControllerV2 Mood | A mood defined for a [Lighting controller](https://www.loxone.com/enen/kb/lighting-controller-v2/). Each mood will have own channel and can be operated independently in order to allow mixing of moods. | `Switch` | `OnOffType.*` - mixes mood in or out of the controller | +| Meter | [Utility meter](https://www.loxone.com/enen/kb/utility-meter/) | `Number` | `DecimalType` - current meter value | +| | | `Number` | `DecimalType` - total meter value | | Pushbutton | [Virtual inputs](https://www.loxone.com/enen/kb/virtual-inputs-outputs/) of pushbutton type | `Switch` | `OnOffType.ON` - generates Pulse command | | Radio | [Radio button 8x and 16x](https://www.loxone.com/enen/kb/radio-buttons/) | `Number` | `DecimalType` - select output number 1-8/16 or 0 for all outputs off, `OnOffType.OFF` - all outputs off | | Slider | [Virtual inputs](https://www.loxone.com/enen/kb/virtual-inputs-outputs/) of slider type | `Number` | `DecimalType` | @@ -171,7 +186,7 @@ Channels have the default tags as follows: ## Advanced Parameters -This section describes the optional advanced parameters that can be configured for a Miniserver. They can be set using UI (e.g. PaperUI) or in a .things file. +This section describes the optional advanced parameters that can be configured for a Miniserver. They can be set using UI (e.g. Paper UI) or in a .things file. If a parameter is not explicitly defined, binding will use its default value. To define a parameter value in a .things file, please refer to it by parameter's ID, for example: diff --git a/bundles/org.openhab.binding.loxone/pom.xml b/bundles/org.openhab.binding.loxone/pom.xml index f38b72a34d820..d5051c8ac1668 100644 --- a/bundles/org.openhab.binding.loxone/pom.xml +++ b/bundles/org.openhab.binding.loxone/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.loxone</artifactId> diff --git a/bundles/org.openhab.binding.loxone/src/main/feature/feature.xml b/bundles/org.openhab.binding.loxone/src/main/feature/feature.xml index 591b48130a5c6..86b6d39dfd083 100644 --- a/bundles/org.openhab.binding.loxone/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.loxone/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.loxone-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-loxone" description="Loxone Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConfiguration.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConfiguration.java index 9de618932a76e..2b4093958cc5a 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConfiguration.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConstants.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConstants.java index bac39273146e3..6767218e5ed3d 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConstants.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,7 +36,10 @@ public class LxBindingConstants { public static final String MINISERVER_CHANNEL_TYPE_DIMMER = "dimmerTypeId"; public static final String MINISERVER_CHANNEL_TYPE_NUMBER = "numberTypeId"; public static final String MINISERVER_CHANNEL_TYPE_COLORPICKER = "colorPickerTypeId"; - + public static final String MINISERVER_CHANNEL_TYPE_IROOM_V2_ACTIVE_MODE = "iRoomV2ActiveModeTypeId"; + public static final String MINISERVER_CHANNEL_TYPE_IROOM_V2_OPERATING_MODE = "iRoomV2OperatingModeTypeId"; + public static final String MINISERVER_CHANNEL_TYPE_IROOM_V2_PREPARE_STATE = "iRoomV2PrepareStateTypeId"; + public static final String MINISERVER_CHANNEL_TYPE_IROOM_V2_COMFORT_TOLERANCE = "iRoomV2ComfortToleranceTypeId"; // Channel Type IDs - read only public static final String MINISERVER_CHANNEL_TYPE_RO_TEXT = "roTextTypeId"; public static final String MINISERVER_CHANNEL_TYPE_RO_SWITCH = "roSwitchTypeId"; diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDiscoveryParticipant.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDiscoveryParticipant.java index 8897b73e013eb..3e30b29b03bff 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDynamicStateDescriptionProvider.java index ec7a4c5ea593b..e523fb2744ca0 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxHandlerFactory.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxHandlerFactory.java index 073bd5a72c175..dad785d91dbf6 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxHandlerFactory.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandler.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandler.java index ed94f0561f31e..4066c004cfa3b 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandler.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandlerApi.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandlerApi.java index 9fb99f237338a..ddce35e2c10c3 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandlerApi.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxServerHandlerApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxWebSocket.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxWebSocket.java index 07102460f780a..a6796c58bc9a8 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxWebSocket.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/LxWebSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControl.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControl.java index 6a3cdb1a21270..da8d27c9b965c 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControl.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,7 +31,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragment; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.loxone.internal.LxServerHandlerApi; import org.openhab.binding.loxone.internal.types.LxCategory; @@ -121,12 +121,15 @@ class LxControlDetails { Double max; Double step; String format; + String actualFormat; + String totalFormat; Boolean increaseOnly; String allOff; String url; String urlHd; Map<String, String> outputs; Boolean presenceConnected; + Integer connectedInputs; } /** @@ -254,7 +257,7 @@ public LxControl deserialize(JsonElement json, Type type, JsonDeserializationCon * A method that executes commands by the control. It delegates command execution to a registered callback method. * * @param channelId channel Id for the command - * @param command value of the command to perform + * @param command value of the command to perform * @throws IOException in case of communication error with the Miniserver */ public final void handleCommand(ChannelUID channelId, Command command) throws IOException { @@ -395,6 +398,8 @@ public void initialize(LxControlConfig configToSet) { if (subControls == null) { subControls = new HashMap<>(); + } else { + subControls.values().removeIf(Objects::isNull); } if (config.room != null) { @@ -525,7 +530,7 @@ LxCategory getCategory() { /** * Changes the channel state in the framework. * - * @param id channel ID + * @param id channel ID * @param state new state value */ void setChannelState(ChannelUID id, State state) { @@ -631,13 +636,13 @@ State getStateOnOffValue(String name) { * Create a new channel and add it to the control. Channel ID is assigned automatically in the order of calls to * this method, see (@link LxControl#getChannelId}. * - * @param itemType item type for the channel - * @param typeId channel type ID for the channel - * @param channelLabel channel label + * @param itemType item type for the channel + * @param typeId channel type ID for the channel + * @param channelLabel channel label * @param channelDescription channel description - * @param tags tags for the channel or null if no tags needed - * @param commandCallback {@link LxControl} child class method that will be called when command is received - * @param stateCallback {@link LxControl} child class method that will be called to get state value + * @param tags tags for the channel or null if no tags needed + * @param commandCallback {@link LxControl} child class method that will be called when command is received + * @param stateCallback {@link LxControl} child class method that will be called to get state value * @return channel ID of the added channel (can be used to later set state description to it) */ ChannelUID addChannel(String itemType, ChannelTypeUID typeId, String channelLabel, String channelDescription, @@ -660,17 +665,19 @@ ChannelUID addChannel(String itemType, ChannelTypeUID typeId, String channelLabe } /** - * Adds a new {@link StateDescription} for a channel that has multiple options to select from or a custom format - * string. + * Adds a new {@link StateDescriptionFragment} for a channel that has multiple options to select from or a custom + * format string. * - * @param channelId channel ID to add the description for - * @param description channel state description + * @param channelId channel ID to add the description for + * @param descriptionFragment channel state description fragment */ - void addChannelStateDescription(ChannelUID channelId, StateDescription description) { + void addChannelStateDescriptionFragment(ChannelUID channelId, StateDescriptionFragment descriptionFragment) { if (config == null) { logger.error("Attempt to set channel state description with not finalized configuration!: {}", channelId); } else { - config.thingHandler.setChannelStateDescription(channelId, description); + if (channelId != null && descriptionFragment != null) { + config.thingHandler.setChannelStateDescription(channelId, descriptionFragment.toStateDescription()); + } } } @@ -715,7 +722,7 @@ private void dispose() { * Build channel ID for the control, based on control's UUID, thing's UUID and index of the channel for the control * * @param index index of a channel within control (0 for primary channel) all indexes greater than 0 will have - * -index added to the channel ID + * -index added to the channel ID * @return channel ID for the control and index */ private ChannelUID getChannelId(int index) { diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlAlarm.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlAlarm.java index 39aebd009f729..ab64e7e0d8c31 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlAlarm.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlAlarm.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,7 +27,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.loxone.internal.types.LxState; import org.openhab.binding.loxone.internal.types.LxUuid; @@ -171,7 +171,8 @@ public void initialize(LxControlConfig config) { ackChannelId = addChannel("Switch", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_SWITCH), defaultChannelLabel + " / Acknowledge", "Acknowledge alarm", tags, this::handleQuitAlarm, () -> OnOffType.OFF); - addChannelStateDescription(ackChannelId, new StateDescription(null, null, null, null, true, null)); + addChannelStateDescriptionFragment(ackChannelId, + StateDescriptionFragmentBuilder.create().withReadOnly(true).build()); if (presenceConnected) { // this channel has reversed logic - we show state of enabled option, but receive state updates if disabled @@ -199,8 +200,8 @@ public void onStateChange(LxState state) { setChannelState(startTimeId, startTime); } else if (STATE_LEVEL.equals(stateName)) { Object obj = state.getStateValue(); - addChannelStateDescription(ackChannelId, new StateDescription(null, null, null, null, - (obj instanceof Double && ((Double) obj) == 0.0), null)); + addChannelStateDescriptionFragment(ackChannelId, StateDescriptionFragmentBuilder.create() + .withReadOnly(obj instanceof Double && ((Double) obj) == 0.0).build()); super.onStateChange(state); } else { super.onStateChange(state); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlColorPickerV2.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlColorPickerV2.java index abbe8fdc70d79..8fe3c80e43048 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlColorPickerV2.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlColorPickerV2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlDimmer.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlDimmer.java index 006e3657afdc3..83d5d58fcf1d5 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlDimmer.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlDimmer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; import org.openhab.binding.loxone.internal.types.LxCategory; +import org.openhab.binding.loxone.internal.types.LxTags; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -75,7 +76,7 @@ public void initialize(LxControlConfig config) { super.initialize(config); LxCategory category = getCategory(); if (category != null && category.getType() == LxCategory.CategoryType.LIGHTS) { - tags.add("Lighting"); + tags.addAll(LxTags.LIGHTING); } addChannel("Dimmer", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_DIMMER), defaultChannelLabel, "Dimmer", tags, this::handleCommands, this::getChannelState); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlFactory.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlFactory.java index df0b6269c80b4..2b324640106bc 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlFactory.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,11 +33,13 @@ class LxControlFactory { add(new LxControlDimmer.Factory()); add(new LxControlInfoOnlyAnalog.Factory()); add(new LxControlInfoOnlyDigital.Factory()); + add(new LxControlIRoomControllerV2.Factory()); add(new LxControlJalousie.Factory()); add(new LxControlLeftRightAnalog.Factory()); add(new LxControlLeftRightDigital.Factory()); add(new LxControlLightController.Factory()); add(new LxControlLightControllerV2.Factory()); + add(new LxControlMeter.Factory()); add(new LxControlPushbutton.Factory()); add(new LxControlRadio.Factory()); add(new LxControlSlider.Factory()); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2.java new file mode 100644 index 0000000000000..349c410266f33 --- /dev/null +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2.java @@ -0,0 +1,182 @@ +/** + * 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.loxone.internal.controls; + +import static org.openhab.binding.loxone.internal.LxBindingConstants.*; + +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.StateDescriptionFragment; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; +import org.openhab.binding.loxone.internal.types.LxTags; +import org.openhab.binding.loxone.internal.types.LxUuid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * An Intelligent Room Controller V2. + * This implementation does not support the timers which describe temperature zones during the day. + * + * @author Pawel Pieczul - initial contribution + * + */ +class LxControlIRoomControllerV2 extends LxControl { + + static class Factory extends LxControlInstance { + @Override + LxControl create(LxUuid uuid) { + return new LxControlIRoomControllerV2(uuid); + } + + @Override + String getType() { + return "iroomcontrollerv2"; + } + } + + private static final String STATE_ACTIVE_MODE = "activemode"; + private static final String STATE_OPERATING_MODE = "operatingmode"; + private static final String STATE_PREPARE_STATE = "preparestate"; + private static final String STATE_OPEN_WINDOW = "openwindow"; + private static final String STATE_TEMP_ACTUAL = "tempactual"; + private static final String STATE_TEMP_TARGET = "temptarget"; + private static final String STATE_COMFORT_TEMPERATURE = "comforttemperature"; + private static final String STATE_COMFORT_TEMPERATURE_OFFSET = "comforttemperatureoffset"; + private static final String STATE_COMFORT_TOLERANCE = "comforttolerance"; + private static final String STATE_ABSENT_MIN_OFFSET = "absentminoffset"; + private static final String STATE_ABSENT_MAX_OFFSET = "absentmaxoffset"; + private static final String STATE_FROST_PROTECT_TEMPERATURE = "frostprotecttemperature"; + private static final String STATE_HEAT_PROTECT_TEMPERATURE = "heatprotecttemperature"; + + private static final String CMD_SET_OPERATING_MODE = "setOperatingMode/"; + private static final String CMD_SET_COMFORT_TOLERANCE = "setComfortTolerance/"; + private static final String CMD_SET_COMFORT_TEMPERATURE = "setComfortTemperature/"; + private static final String CMD_SET_COMFORT_TEMPERATURE_OFFSET = "setComfortModeTemp/"; + private static final String CMD_SET_ABSENT_MIN_TEMPERATURE = "setAbsentMinTemperature/"; + private static final String CMD_SET_ABSENT_MAX_TEMPERATURE = "setAbsentMaxTemperature/"; + private static final String CMD_SET_MANUAL_TEMPERATURE = "setManualTemperature/"; + + private final Logger logger = LoggerFactory.getLogger(LxControlIRoomControllerV2.class); + + private LxControlIRoomControllerV2(LxUuid uuid) { + super(uuid); + } + + @Override + public void initialize(LxControlConfig config) { + super.initialize(config); + ChannelUID cid; + Set<String> tempTags = new HashSet<>(tags); + tempTags.addAll(LxTags.TEMPERATURE); + String format = details.format; + StateDescriptionFragment patternRoFragment = null; + StateDescriptionFragment patternRwFragment = null; + if (format != null) { + patternRoFragment = StateDescriptionFragmentBuilder.create().withPattern(format).withReadOnly(true).build(); + patternRwFragment = StateDescriptionFragmentBuilder.create().withPattern(format).withReadOnly(false) + .build(); + } + + addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_IROOM_V2_ACTIVE_MODE), + defaultChannelLabel + "/ Active Mode", "Active mode", tags, null, + () -> getStateDecimalValue(STATE_ACTIVE_MODE)); + + addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_IROOM_V2_OPERATING_MODE), + defaultChannelLabel + "/ Operating Mode", "Operating mode", tags, this::setOperatingMode, + () -> getStateDecimalValue(STATE_OPERATING_MODE)); + + addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_IROOM_V2_PREPARE_STATE), + defaultChannelLabel + "/ Prepare State", "Prepare state", tags, null, + () -> getStateDecimalValue(STATE_PREPARE_STATE)); + + addChannel("Switch", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_SWITCH), + defaultChannelLabel + "/ Open Window", "Open window", tags, null, + () -> getSwitchState(STATE_OPEN_WINDOW)); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_ANALOG), + defaultChannelLabel + "/ Current Temperature", "Current temperature", tempTags, null, + () -> getStateDecimalValue(STATE_TEMP_ACTUAL)); + addChannelStateDescriptionFragment(cid, patternRoFragment); + + // manual temperature will affect value of target temperature only in manual operating modes + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_NUMBER), + defaultChannelLabel + "/ Target Temperature", "Target temperature", tempTags, + (c) -> setTemperature(c, CMD_SET_MANUAL_TEMPERATURE), () -> getStateDecimalValue(STATE_TEMP_TARGET)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_NUMBER), + defaultChannelLabel + "/ Comfort Temperature", "Comfort temperature", tempTags, + (c) -> setTemperature(c, CMD_SET_COMFORT_TEMPERATURE), + () -> getStateDecimalValue(STATE_COMFORT_TEMPERATURE)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_NUMBER), + defaultChannelLabel + "/ Comfort Temperature Offset", "Comfort temperature offset", tempTags, + (c) -> setTemperature(c, CMD_SET_COMFORT_TEMPERATURE_OFFSET), + () -> getStateDecimalValue(STATE_COMFORT_TEMPERATURE_OFFSET)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_IROOM_V2_COMFORT_TOLERANCE), + defaultChannelLabel + "/ Comfort Tolerance", "Comfort tolerance", tempTags, + (c) -> setTemperature(c, CMD_SET_COMFORT_TOLERANCE), + () -> getStateDecimalValue(STATE_COMFORT_TOLERANCE)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_NUMBER), + defaultChannelLabel + "/ Absent Min Offset", "Absent minimum temperature offset", tempTags, + (c) -> setTemperature(c, CMD_SET_ABSENT_MIN_TEMPERATURE), + () -> getStateDecimalValue(STATE_ABSENT_MIN_OFFSET)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_NUMBER), + defaultChannelLabel + "/ Absent Max Offset", "Absent maximum temperature offset", tempTags, + (c) -> setTemperature(c, CMD_SET_ABSENT_MAX_TEMPERATURE), + () -> getStateDecimalValue(STATE_ABSENT_MAX_OFFSET)); + addChannelStateDescriptionFragment(cid, patternRwFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_ANALOG), + defaultChannelLabel + "/ Frost Protect Temperature", "Frost protect temperature", tempTags, null, + () -> getStateDecimalValue(STATE_FROST_PROTECT_TEMPERATURE)); + addChannelStateDescriptionFragment(cid, patternRoFragment); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_ANALOG), + defaultChannelLabel + "/ Heat Protect Temperature", "Heat protect temperature", tempTags, null, + () -> getStateDecimalValue(STATE_HEAT_PROTECT_TEMPERATURE)); + addChannelStateDescriptionFragment(cid, patternRoFragment); + } + + private State getSwitchState(String name) { + return LxControlSwitch.convertSwitchState(getStateDoubleValue(name)); + } + + private void setOperatingMode(Command command) throws IOException { + if (command instanceof DecimalType) { + DecimalType mode = (DecimalType) command; + sendAction(CMD_SET_OPERATING_MODE + String.valueOf(mode.intValue())); + } + } + + private void setTemperature(Command command, String prefix) throws IOException { + if (command instanceof DecimalType) { + DecimalType temp = (DecimalType) command; + sendAction(prefix + String.valueOf(temp.doubleValue())); + } + } +} diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalog.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalog.java index dbccc3a45938d..79c321bd8a40f 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalog.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalog.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,8 +16,9 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxCategory; +import org.openhab.binding.loxone.internal.types.LxTags; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -57,7 +58,7 @@ public void initialize(LxControlConfig config) { super.initialize(config); LxCategory category = getCategory(); if (category != null && category.getType() == LxCategory.CategoryType.TEMPERATURE) { - tags.add("CurrentTemperature"); + tags.addAll(LxTags.TEMPERATURE); } ChannelUID cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_ANALOG), defaultChannelLabel, "Analog virtual state", tags, null, () -> getStateDecimalValue(STATE_VALUE)); @@ -67,6 +68,7 @@ public void initialize(LxControlConfig config) { } else { format = "%.1f"; } - addChannelStateDescription(cid, new StateDescription(null, null, null, format, true, null)); + addChannelStateDescriptionFragment(cid, + StateDescriptionFragmentBuilder.create().withPattern(format).withReadOnly(true).build()); } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigital.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigital.java index 94f95ae7821ee..e11b29ac6fdcc 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigital.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigital.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java index 0d7bf78724694..50782ce9a24b1 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlJalousie.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalog.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalog.java index 4926a2f4c4f6a..7768a4831ee42 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalog.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalog.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigital.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigital.java index 3db34c58048c7..4d919585f8922 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigital.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigital.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightController.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightController.java index 86de8ee59fb53..a1860c667b9a0 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightController.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,9 +25,10 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.StateOption; import org.openhab.binding.loxone.internal.types.LxState; +import org.openhab.binding.loxone.internal.types.LxTags; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -97,7 +98,7 @@ private LxControlLightController(LxUuid uuid) { @Override public void initialize(LxControlConfig config) { super.initialize(config); - tags.add("Scene"); + tags.addAll(LxTags.SCENE); // add only channel, state description will be added later when a control state update message is received channelId = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_LIGHT_CTRL), defaultChannelLabel, "Light controller", tags, this::handleCommands, this::getChannelState); @@ -151,8 +152,10 @@ public void onStateChange(LxState state) { sceneNames.add(new StateOption(params[0], params[1])); } } - addChannelStateDescription(channelId, new StateDescription(BigDecimal.ZERO, - new BigDecimal(NUM_OF_SCENES - 1), BigDecimal.ONE, null, false, sceneNames)); + addChannelStateDescriptionFragment(channelId, + StateDescriptionFragmentBuilder.create().withMinimum(BigDecimal.ZERO) + .withMaximum(new BigDecimal(NUM_OF_SCENES - 1)).withStep(BigDecimal.ONE) + .withReadOnly(false).withOptions(sceneNames).build()); } } else { super.onStateChange(state); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2.java index 76cdba0c8095e..1c14b706112a4 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,7 +29,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.StateOption; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.loxone.internal.types.LxState; @@ -252,8 +252,10 @@ private void onMoodsListChange(String text) throws JsonSyntaxException { // convert all moods to options list for state description List<StateOption> optionsList = newMoodList.values().stream() .map(mood -> new StateOption(mood.getId().toString(), mood.getName())).collect(Collectors.toList()); - addChannelStateDescription(channelId, new StateDescription(new BigDecimal(minMoodId), - new BigDecimal(maxMoodId), BigDecimal.ONE, null, false, optionsList)); + addChannelStateDescriptionFragment(channelId, + StateDescriptionFragmentBuilder.create().withMinimum(new BigDecimal(minMoodId)) + .withMaximum(new BigDecimal(maxMoodId)).withStep(BigDecimal.ONE).withReadOnly(false) + .withOptions(optionsList).build()); } moodList.values().forEach(m -> removeControl(m)); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMeter.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMeter.java new file mode 100644 index 0000000000000..4f176efbc762d --- /dev/null +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMeter.java @@ -0,0 +1,101 @@ +/** + * 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.loxone.internal.controls; + +import static org.openhab.binding.loxone.internal.LxBindingConstants.*; + +import java.io.IOException; + +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; +import org.openhab.binding.loxone.internal.types.LxUuid; + +/** + * A meter type of control on Loxone Miniserver. + * According to Loxone API documentation, a meter control covers Utility Meter functional block in Loxone Config. + * + * @author Pawel Pieczul - initial contribution + * + */ +class LxControlMeter extends LxControl { + + static class Factory extends LxControlInstance { + @Override + LxControl create(LxUuid uuid) { + return new LxControlMeter(uuid); + } + + @Override + String getType() { + return "meter"; + } + } + + /** + * Value for actual consumption + */ + private static final String STATE_ACTUAL = "actual"; + + /** + * Value for total consumption + */ + private static final String STATE_TOTAL = "total"; + + /** + * Command string used to reset the meter + */ + private static final String CMD_RESET = "reset"; + + LxControlMeter(LxUuid uuid) { + super(uuid); + } + + @Override + public void initialize(LxControlConfig config) { + super.initialize(config); + ChannelUID cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_NUMBER), + defaultChannelLabel + " / Current", "Current meter value", tags, null, + () -> getStateDecimalValue(STATE_ACTUAL)); + String format; + if (details != null && details.actualFormat != null) { + format = details.actualFormat; + } else { + format = "%.3f"; // Loxone default for this format + } + addChannelStateDescriptionFragment(cid, + StateDescriptionFragmentBuilder.create().withPattern(format).withReadOnly(true).build()); + + cid = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_NUMBER), + defaultChannelLabel + " / Total", "Total meter consumption", tags, null, + () -> getStateDecimalValue(STATE_TOTAL)); + if (details != null && details.totalFormat != null) { + format = details.totalFormat; + } else { + format = "%.1f"; // Loxone default for this format + } + addChannelStateDescriptionFragment(cid, + StateDescriptionFragmentBuilder.create().withPattern(format).withReadOnly(true).build()); + + addChannel("Switch", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_SWITCH), + defaultChannelLabel + " / Reset", "Reset meter", tags, this::handleResetCommands, () -> OnOffType.OFF); + } + + private void handleResetCommands(Command command) throws IOException { + if (command instanceof OnOffType && (OnOffType) command == OnOffType.ON) { + sendAction(CMD_RESET); + } + } +} diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMood.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMood.java index 6ffbd6095a344..8cb0716c23fec 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMood.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlMood.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlPushbutton.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlPushbutton.java index c56f44c42a7a0..f77a3aa6252b1 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlPushbutton.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlPushbutton.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlRadio.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlRadio.java index 80664f1adb101..f5a3b0bb2181f 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlRadio.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlRadio.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,7 +26,7 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.StateOption; import org.openhab.binding.loxone.internal.types.LxUuid; @@ -85,8 +85,10 @@ public void initialize(LxControlConfig config) { outputs.add(new StateOption("0", details.allOff)); outputsMap.put("0", details.allOff); } - addChannelStateDescription(cid, new StateDescription(BigDecimal.ZERO, new BigDecimal(MAX_RADIO_OUTPUTS), - BigDecimal.ONE, null, false, outputs)); + addChannelStateDescriptionFragment(cid, + StateDescriptionFragmentBuilder.create().withMinimum(BigDecimal.ZERO) + .withMaximum(new BigDecimal(MAX_RADIO_OUTPUTS)).withStep(BigDecimal.ONE).withReadOnly(false) + .withOptions(outputs).build()); } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSlider.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSlider.java index 3ccc8e1ea9409..974cdd1c1515a 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSlider.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSlider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSwitch.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSwitch.java index a24697d01fec6..3b915f537b9d0 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSwitch.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.loxone.internal.types.LxCategory; +import org.openhab.binding.loxone.internal.types.LxTags; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -73,9 +74,9 @@ public void initialize(LxControlConfig config) { super.initialize(config); LxCategory category = getCategory(); if (category != null && category.getType() == LxCategory.CategoryType.LIGHTS) { - tags.add("Lighting"); + tags.addAll(LxTags.LIGHTING); } else { - tags.add("Switchable"); + tags.addAll(LxTags.SWITCHABLE); } addChannel("Switch", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_SWITCH), defaultChannelLabel, "Switch", tags, this::handleSwitchCommands, this::getSwitchState); @@ -125,7 +126,16 @@ void off() throws IOException { * @return ON/OFF or null if undefined */ State getSwitchState() { - Double value = getStateDoubleValue(STATE_ACTIVE); + return convertSwitchState(getStateDoubleValue(STATE_ACTIVE)); + } + + /** + * Convert double value of switch into ON/OFF state value + * + * @param value state value as double + * @return state value as ON/OFF + */ + static State convertSwitchState(Double value) { if (value != null) { if (value == 1.0) { return OnOffType.ON; diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTextState.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTextState.java index 9ab9a02dd4583..dbb93e0dfc091 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTextState.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTextState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,7 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -55,6 +55,6 @@ public void initialize(LxControlConfig config) { super.initialize(config); ChannelUID id = addChannel("String", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_TEXT), defaultChannelLabel, "Text state", tags, null, () -> getStateStringValue(STATE_TEXT_AND_ICON)); - addChannelStateDescription(id, new StateDescription(null, null, null, null, true, null)); + addChannelStateDescriptionFragment(id, StateDescriptionFragmentBuilder.create().withReadOnly(true).build()); } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitch.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitch.java index aebb3bda7ac0d..52fa761619785 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitch.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,7 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -68,7 +68,8 @@ public void initialize(LxControlConfig config) { ChannelUID id = addChannel("Number", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_NUMBER), defaultChannelLabel + " / Deactivation Delay", "Deactivation Delay", null, null, this::getDeactivationState); - addChannelStateDescription(id, new StateDescription(new BigDecimal(-1), null, null, null, true, null)); + addChannelStateDescriptionFragment(id, + StateDescriptionFragmentBuilder.create().withMinimum(new BigDecimal(-1)).withReadOnly(true).build()); } private State getDeactivationState() { diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTracker.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTracker.java index c4aa52e0396d9..739bd3f762d47 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTracker.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlTracker.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,7 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -55,6 +55,6 @@ public void initialize(LxControlConfig config) { super.initialize(config); ChannelUID id = addChannel("String", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_TEXT), defaultChannelLabel, "Tracker", tags, null, () -> getStateStringValue(STATE_ENTRIES)); - addChannelStateDescription(id, new StateDescription(null, null, null, null, true, null)); + addChannelStateDescriptionFragment(id, StateDescriptionFragmentBuilder.create().withReadOnly(true).build()); } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalog.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalog.java index 91e5006b054e7..8f16eb5ad0401 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalog.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalog.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,7 +22,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.loxone.internal.types.LxUuid; import org.slf4j.Logger; @@ -78,10 +78,11 @@ void initialize(LxControlConfig config, String channelDescription) { minValue = details.min; maxValue = details.max; if (details.step != null) { - addChannelStateDescription(channelId, - new StateDescription(new BigDecimal(minValue), new BigDecimal(maxValue), - new BigDecimal(details.step), details.format != null ? details.format : "%.1f", - false, null)); + addChannelStateDescriptionFragment(channelId, + StateDescriptionFragmentBuilder.create().withMinimum(new BigDecimal(minValue)) + .withMaximum(new BigDecimal(maxValue)).withStep(new BigDecimal(details.step)) + .withPattern(details.format != null ? details.format : "%.1f").withReadOnly(false) + .build()); } } else { logger.warn("Received min value > max value: {}, {}", minValue, maxValue); diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigital.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigital.java index d922822da00ea..7c5c6594f06e7 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigital.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigital.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelector.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelector.java index fc2c61617e5fe..b5744c2595602 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelector.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,7 +24,8 @@ import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragment; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxState; import org.openhab.binding.loxone.internal.types.LxUuid; import org.slf4j.Logger; @@ -192,10 +193,11 @@ public void onStateChange(LxState state) { logger.debug("Error parsing value for state {}: {}", stateName, e.getMessage()); } if (minValue != null && maxValue != null && stepValue != null && minValue < maxValue) { - StateDescription description = new StateDescription(new BigDecimal(minValue), new BigDecimal(maxValue), - new BigDecimal(stepValue), format, false, null); - addChannelStateDescription(channelId, description); - addChannelStateDescription(numberChannelId, description); + StateDescriptionFragment fragment = StateDescriptionFragmentBuilder.create() + .withMinimum(new BigDecimal(minValue)).withMaximum(new BigDecimal(maxValue)) + .withStep(new BigDecimal(stepValue)).withPattern(format).withReadOnly(false).build(); + addChannelStateDescriptionFragment(channelId, fragment); + addChannelStateDescriptionFragment(numberChannelId, fragment); } } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlWebPage.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlWebPage.java index feabcbe451feb..ed44f370c3264 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlWebPage.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/controls/LxControlWebPage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,7 +17,8 @@ import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragment; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.openhab.binding.loxone.internal.types.LxUuid; /** @@ -57,12 +58,13 @@ public void initialize(LxControlConfig config) { urlHd = new StringType(details.urlHd); } } + StateDescriptionFragment fragment = StateDescriptionFragmentBuilder.create().withReadOnly(true).build(); ChannelUID c1 = addChannel("String", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_TEXT), defaultChannelLabel + " / URL", "Low resolution URL", tags, null, () -> url); - addChannelStateDescription(c1, new StateDescription(null, null, null, null, true, null)); + addChannelStateDescriptionFragment(c1, fragment); ChannelUID c2 = addChannel("String", new ChannelTypeUID(BINDING_ID, MINISERVER_CHANNEL_TYPE_RO_TEXT), defaultChannelLabel + " / URL HD", "High resolution URL", tags, null, () -> urlHd); - addChannelStateDescription(c2, new StateDescription(null, null, null, null, true, null)); + addChannelStateDescriptionFragment(c2, fragment); } } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java index d287a1ca7edd2..35ca7be176bfd 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityHash.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityHash.java index 79e42f7ac3bab..a2483f474fcf3 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityHash.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityHash.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityToken.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityToken.java index fb88b69f23096..c87ea275cebed 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityToken.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurityToken.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxCategory.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxCategory.java index b6e73cfc43300..b0a0800cab7fe 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxCategory.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxCategory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxConfig.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxConfig.java index 95de43cf759a4..c34ce2180406f 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxConfig.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxContainer.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxContainer.java index b3dc5408d4131..7a7ce846bc621 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxContainer.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxContainer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxErrorCode.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxErrorCode.java index 4ce9dea9878c7..59e3d3afe82b6 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxErrorCode.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxErrorCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxResponse.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxResponse.java index 66cd05bb6d135..07db405306860 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxResponse.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxState.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxState.java index 23e56d135e896..fd2fec2d81baa 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxState.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTags.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTags.java new file mode 100644 index 0000000000000..3bc6bdb97bf48 --- /dev/null +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTags.java @@ -0,0 +1,31 @@ +/** + * 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.loxone.internal.types; + +import java.util.Collections; +import java.util.Set; + +import org.openhab.binding.loxone.internal.controls.LxControl; + +/** + * Channel tags for a {@link LxControl} object. + * + * @author Pawel Pieczul - initial contribution + * + */ +public class LxTags { + public static final Set<String> SCENE = Collections.singleton("Scene"); + public static final Set<String> LIGHTING = Collections.singleton("Lighting"); + public static final Set<String> SWITCHABLE = Collections.singleton("Switchable"); + public static final Set<String> TEMPERATURE = Collections.singleton("CurrentTemperature"); +} diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTemperatureHSBType.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTemperatureHSBType.java index 79583d7065109..1360c63a8c58d 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTemperatureHSBType.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxTemperatureHSBType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxUuid.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxUuid.java index bfa4372f793b1..03bd8d86aea78 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxUuid.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxUuid.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsBinaryHeader.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsBinaryHeader.java index 5caf6fc3f8ba4..c8af7b3c7adbc 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsBinaryHeader.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsBinaryHeader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsSecurityType.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsSecurityType.java index 024776a650ec9..08debdd4b7786 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsSecurityType.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/types/LxWsSecurityType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.loxone/src/main/resources/ESH-INF/thing/thing-types.xml index 3febdcbf1feb8..47f1c4df36982 100644 --- a/bundles/org.openhab.binding.loxone/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.loxone/src/main/resources/ESH-INF/thing/thing-types.xml @@ -12,23 +12,23 @@ <config-description> <parameter-group name="miniserver"> - <label>Miniserver settings</label> + <label>Miniserver Settings</label> <description>Connection to Miniserver</description> </parameter-group> <parameter-group name="security"> - <label>Security settings</label> + <label>Security Settings</label> <description>Authentication and encryption parameters</description> </parameter-group> <parameter-group name="timeouts"> - <label>Timeout settings</label> + <label>Timeout Settings</label> <description>Various timeout parameters</description> <advanced>true</advanced> </parameter-group> <parameter-group name="sizes"> - <label>Size settings</label> + <label>Size Settings</label> <description>Various sizing parameters</description> <advanced>true</advanced> </parameter-group> @@ -38,14 +38,14 @@ <context>network-address</context> <description>Host address or IP of the Loxone Miniserver</description> </parameter> - <parameter name="port" type="integer" min="0" groupName="miniserver"> + <parameter name="port" type="integer" min="1" max="65535" groupName="miniserver"> <label>Port</label> <description>Web interface port of the Loxone Miniserver</description> <default>80</default> </parameter> <parameter name="authMethod" type="integer" min="0" max="2" groupName="security"> - <label>Authorization method</label> + <label>Authorization Method</label> <description>Method used to authorize user in the Miniserver</description> <default>0</default> <options> @@ -71,42 +71,42 @@ </parameter> <parameter name="firstConDelay" type="integer" min="0" max="120" groupName="timeouts"> - <label>First connection delay</label> + <label>First Connection Delay</label> <description>Time between binding initialization and first connection attempt (seconds, 0-120)</description> <default>1</default> </parameter> <parameter name="keepAlivePeriod" type="integer" min="1" max="600" groupName="timeouts"> - <label>Period between connection keep-alive messages</label> + <label>Period Between Connection Keep-alive Messages</label> <description>Time between sending two consecutive keep-alive messages (seconds, 1-600)</description> <default>240</default> </parameter> <parameter name="connectErrDelay" type="integer" min="0" max="600" groupName="timeouts"> - <label>Connect error delay</label> + <label>Connect Error Delay</label> <description>Time between failed websocket connect attempts (seconds, 0-600)</description> <default>10</default> </parameter> <parameter name="responseTimeout" type="integer" min="0" max="60" groupName="timeouts"> - <label>Miniserver response timeout</label> + <label>Miniserver Response Timeout</label> <description>Time to wait for a response from Miniserver to a request sent from the binding (seconds, 0-60)</description> <default>4</default> </parameter> <parameter name="userErrorDelay" type="integer" min="0" max="3600" groupName="timeouts"> - <label>Authentication error delay</label> + <label>Authentication Error Delay</label> <description>Time in seconds between user login error as a result of wrong name/password or no authority and next connection attempt (seconds, 0-3600)</description> <default>60</default> </parameter> <parameter name="comErrorDelay" type="integer" min="0" max="3600" groupName="timeouts"> - <label>Communication error delay</label> + <label>Communication Error Delay</label> <description>Time between connection close (as a result of some communication error) and next connection attempt (seconds, 0-3600)</description> <default>30</default> </parameter> <parameter name="maxBinMsgSize" type="integer" min="0" max="102400" groupName="sizes"> - <label>Maximum binary message size (kB)</label> + <label>Maximum Binary Message Size (kB)</label> <description>Websocket client's maximum binary message size in kB</description> <default>3072</default> </parameter> <parameter name="maxTextMsgSize" type="integer" min="0" max="102400" groupName="sizes"> - <label>Maximum text message size (kB)</label> + <label>Maximum Text Message Size (kB)</label> <description>Websocket client's maximum text message size in kB</description> <default>512</default> </parameter> @@ -206,5 +206,55 @@ <state readOnly="true"></state> </channel-type> + <channel-type id="iRoomV2ActiveModeTypeId"> + <item-type>Number</item-type> + <label>Active Mode</label> + <description>Loxone Intelligent Room Controller V2 Active Mode.</description> + <state pattern="%d" min="0" max="3" step="1" readOnly="true"> + <options> + <option value="0">Economy</option> + <option value="1">Comfort temperature</option> + <option value="2">Building protection</option> + <option value="3">Manual</option> + </options> + </state> + </channel-type> + + <channel-type id="iRoomV2OperatingModeTypeId"> + <item-type>Number</item-type> + <label>Operating Mode</label> + <description>Loxone Intelligent Room Controller V2 Operating Mode.</description> + <state pattern="%d" min="0" max="5" step="1"> + <options> + <option value="0">Automatic, heating and cooling allowed</option> + <option value="1">Automatic, only heating allowed</option> + <option value="2">Automatic, only cooling allowed</option> + <option value="3">Manual, heating and cooling allowed</option> + <option value="4">Manual, only heating allowed</option> + <option value="5">Manual, only cooling allowed</option> + </options> + </state> + </channel-type> + + <channel-type id="iRoomV2PrepareStateTypeId"> + <item-type>Number</item-type> + <label>Prepare State</label> + <description>Loxone Intelligent Room Controller V2 Prepare State.</description> + <state pattern="%d" min="-1" max="1" step="1" readOnly="true"> + <options> + <option value="-1">Cooling down</option> + <option value="0">No action</option> + <option value="1">Heating up</option> + </options> + </state> + </channel-type> + + <channel-type id="iRoomV2ComfortToleranceTypeId"> + <item-type>Number</item-type> + <label>Comfort Tolerance Temperature</label> + <description>Loxone Intelligent Room Controller V2 Comfort Tolerance.</description> + <state min="0.5" max="3" /> + </channel-type> + </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmNoPresenceTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmNoPresenceTest.java index 75e46232f9885..ea522e271b7cf 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmNoPresenceTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmNoPresenceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmWithPresenceTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmWithPresenceTest.java index 41524cf3a1a45..bbb4842125c57 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmWithPresenceTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlAlarmWithPresenceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlDimmerTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlDimmerTest.java index 17a22a9ec39ab..3091a475033cc 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlDimmerTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlDimmerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2Test.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2Test.java new file mode 100644 index 0000000000000..8686ff0ab6fe8 --- /dev/null +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlIRoomControllerV2Test.java @@ -0,0 +1,154 @@ +/** + * 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.loxone.internal.controls; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.junit.Before; +import org.junit.Test; + +/** + * Test class for {@link LxControlIRoomControllerV2} + * + * @author Pawel Pieczul - initial contribution + * + */ +public class LxControlIRoomControllerV2Test extends LxControlTest { + private static final String ACTIVE_MODE_CHANNEL = "/ Active Mode"; + private static final String OPERATING_MODE_CHANNEL = "/ Operating Mode"; + private static final String PREPARE_STATE_CHANNEL = "/ Prepare State"; + private static final String OPEN_WINDOW_CHANNEL = "/ Open Window"; + private static final String TEMP_ACTUAL_CHANNEL = "/ Current Temperature"; + private static final String TEMP_TARGET_CHANNEL = "/ Target Temperature"; + private static final String COMFORT_TEMPERATURE_CHANNEL = "/ Comfort Temperature"; + private static final String COMFORT_TEMPERATURE_OFFSET_CHANNEL = "/ Comfort Temperature Offset"; + private static final String COMFORT_TOLERANCE_CHANNEL = "/ Comfort Tolerance"; + private static final String ABSENT_MIN_OFFSET_CHANNEL = "/ Absent Min Offset"; + private static final String ABSENT_MAX_OFFSET_CHANNEL = "/ Absent Max Offset"; + private static final String FROST_PROTECT_TEMPERATURE_CHANNEL = "/ Frost Protect Temperature"; + private static final String HEAT_PROTECT_TEMPERATURE_CHANNEL = "/ Heat Protect Temperature"; + + @Before + public void setup() { + setupControl("14328f8a-21c9-7c0d-ffff403fb0c34b9e", "0b734138-037d-034e-ffff403fb0c34b9e", + "0fe650c2-0004-d446-ffff504f9410790f", "Intelligent Room Controller"); + } + + @Test + public void testControlCreation() { + testControlCreation(LxControlIRoomControllerV2.class, 1, 0, 13, 13, 17); + } + + @Test + public void testChannels() { + Set<String> tempTags = new HashSet<>(); + tempTags.add("CurrentTemperature"); + testChannel("Number", ACTIVE_MODE_CHANNEL); + testChannel("Number", OPERATING_MODE_CHANNEL); + testChannel("Number", PREPARE_STATE_CHANNEL); + testChannel("Switch", OPEN_WINDOW_CHANNEL); + testChannel("Number", TEMP_ACTUAL_CHANNEL, null, null, null, "%.1f°", true, null, tempTags); + testChannel("Number", TEMP_TARGET_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", COMFORT_TEMPERATURE_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", COMFORT_TEMPERATURE_OFFSET_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", COMFORT_TOLERANCE_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", ABSENT_MIN_OFFSET_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", ABSENT_MAX_OFFSET_CHANNEL, null, null, null, "%.1f°", false, null, tempTags); + testChannel("Number", FROST_PROTECT_TEMPERATURE_CHANNEL, null, null, null, "%.1f°", true, null, tempTags); + testChannel("Number", HEAT_PROTECT_TEMPERATURE_CHANNEL, null, null, null, "%.1f°", true, null, tempTags); + } + + @Test + public void testModeStateChanges() { + for (int i = 0; i <= 3; i++) { + changeLoxoneState("activemode", Double.valueOf(i)); + testChannelState(ACTIVE_MODE_CHANNEL, new DecimalType(i)); + } + for (int i = 0; i <= 5; i++) { + changeLoxoneState("operatingmode", Double.valueOf(i)); + testChannelState(OPERATING_MODE_CHANNEL, new DecimalType(i)); + } + for (int i = -1; i <= 1; i++) { + changeLoxoneState("preparestate", Double.valueOf(i)); + testChannelState(PREPARE_STATE_CHANNEL, new DecimalType(i)); + } + } + + @Test + public void testWindowStateChanges() { + for (int i = 0; i < 100; i++) { + changeLoxoneState("openwindow", 0.0); + testChannelState(OPEN_WINDOW_CHANNEL, OnOffType.OFF); + changeLoxoneState("openwindow", 1.0); + testChannelState(OPEN_WINDOW_CHANNEL, OnOffType.ON); + } + } + + @Test + public void testTemperatureStateChanges() { + for (Double i = -50.0; i < 50.0; i += 0.3) { + changeLoxoneState("tempactual", i); + changeLoxoneState("temptarget", i + 0.01); + changeLoxoneState("comforttemperature", i + 0.02); + changeLoxoneState("comforttemperatureoffset", i + 0.03); + changeLoxoneState("comforttolerance", i + 0.04); + changeLoxoneState("absentminoffset", i + 0.05); + changeLoxoneState("absentmaxoffset", i + 0.06); + changeLoxoneState("frostprotecttemperature", i + 0.07); + changeLoxoneState("heatprotecttemperature", i + 0.08); + testChannelState(TEMP_ACTUAL_CHANNEL, new DecimalType(i)); + testChannelState(TEMP_TARGET_CHANNEL, new DecimalType(i + 0.01)); + testChannelState(COMFORT_TEMPERATURE_CHANNEL, new DecimalType(i + 0.02)); + testChannelState(COMFORT_TEMPERATURE_OFFSET_CHANNEL, new DecimalType(i + 0.03)); + testChannelState(COMFORT_TOLERANCE_CHANNEL, new DecimalType(i + 0.04)); + testChannelState(ABSENT_MIN_OFFSET_CHANNEL, new DecimalType(i + 0.05)); + testChannelState(ABSENT_MAX_OFFSET_CHANNEL, new DecimalType(i + 0.06)); + testChannelState(FROST_PROTECT_TEMPERATURE_CHANNEL, new DecimalType(i + 0.07)); + testChannelState(HEAT_PROTECT_TEMPERATURE_CHANNEL, new DecimalType(i + 0.08)); + } + } + + @Test + public void testModeCommands() { + testAction(null); + for (int i = 0; i <= 5; i++) { + executeCommand(OPERATING_MODE_CHANNEL, new DecimalType(i)); + testAction("setOperatingMode/" + i); + } + testAction(null); + } + + @Test + public void testTemperatureCommands() { + testAction(null); + for (Double t = -50.0; t < 50.0; t += 0.03) { + DecimalType a = new DecimalType(t); + executeCommand(TEMP_TARGET_CHANNEL, a); + testAction("setManualTemperature/" + t.toString()); + executeCommand(COMFORT_TEMPERATURE_CHANNEL, a); + testAction("setComfortTemperature/" + t.toString()); + executeCommand(COMFORT_TEMPERATURE_OFFSET_CHANNEL, a); + testAction("setComfortModeTemp/" + t.toString()); + executeCommand(COMFORT_TOLERANCE_CHANNEL, a); + testAction("setComfortTolerance/" + t.toString()); + executeCommand(ABSENT_MAX_OFFSET_CHANNEL, a); + testAction("setAbsentMaxTemperature/" + t.toString()); + executeCommand(ABSENT_MIN_OFFSET_CHANNEL, a); + testAction("setAbsentMinTemperature/" + t.toString()); + } + testAction(null); + } +} diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTempTagTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTempTagTest.java index 5d49652d04793..b1d60db91ac94 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTempTagTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTempTagTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTest.java index 9721f1f35b7d0..6d02233093ed6 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyAnalogTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigitalTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigitalTest.java index 40bdda911da90..7db9b423df935 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigitalTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlInfoOnlyDigitalTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java index ed938115cefb7..09c2d31d9678e 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlJalousieTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalogTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalogTest.java index da846473746e9..77ce5df91aa27 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalogTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightAnalogTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigitalTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigitalTest.java index 9cd19bc705a13..b7fc9efd9c5ca 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigitalTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLeftRightDigitalTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2Test.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2Test.java index 9371ebf26768c..a4732ef4616a8 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2Test.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlLightControllerV2Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlMeterTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlMeterTest.java new file mode 100644 index 0000000000000..72511fe527383 --- /dev/null +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlMeterTest.java @@ -0,0 +1,69 @@ +/** + * 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.loxone.internal.controls; + +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.junit.Before; +import org.junit.Test; + +/** + * Test class for (@link LxControlMeter} + * + * @author Pawel Pieczul - initial contribution + * + */ +public class LxControlMeterTest extends LxControlTest { + private static final String ACTUAL_VALUE_CHANNEL = " / Current"; + private static final String TOTAL_VALUE_CHANNEL = " / Total"; + private static final String RESET_CHANNEL = " / Reset"; + + @Before + public void setup() { + setupControl("13b3ea27-00fc-6f1b-ffff403fb0c34b9e", "0b734138-037d-034e-ffff403fb0c34b9e", + "0fe650c2-0004-d446-ffff504f9410790f", "Energy Meter"); + } + + @Test + public void testControlCreation() { + testControlCreation(LxControlMeter.class, 1, 0, 3, 3, 2); + } + + @Test + public void testChannels() { + testChannel("Number", ACTUAL_VALUE_CHANNEL, null, null, null, "%.3fkW", true, null); + testChannel("Number", TOTAL_VALUE_CHANNEL, null, null, null, "%.1fkWh", true, null); + testChannel("Switch", RESET_CHANNEL); + } + + @Test + public void testLoxoneStateChanges() { + for (Double i = 0.0; i < 50.0; i += 0.25) { + changeLoxoneState("actual", i); + changeLoxoneState("total", i * 2.0); + testChannelState(ACTUAL_VALUE_CHANNEL, new DecimalType(i)); + testChannelState(TOTAL_VALUE_CHANNEL, new DecimalType(i * 2.0)); + testChannelState(RESET_CHANNEL, OnOffType.OFF); + } + } + + @Test + public void testCommands() { + testAction(null); + for (int i = 0; i < 100; i++) { + executeCommand(RESET_CHANNEL, OnOffType.ON); + testAction("reset"); + testChannelState(RESET_CHANNEL, OnOffType.OFF); + } + } +} diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlPushbuttonTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlPushbuttonTest.java index 459faff099a8f..00d2fb6ebb6bb 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlPushbuttonTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlPushbuttonTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest.java index b7724f486df9f..8bd185fe183a6 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest2.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest2.java index 01862b8be61a1..f752c5c6a9ab6 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest2.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlRadioTest2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSliderTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSliderTest.java index e9fbb9d927f83..b443c6c787145 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSliderTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSliderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSwitchTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSwitchTest.java index 6eeb15fcad97a..0bef81d4c3b24 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSwitchTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlSwitchTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTest.java index 8a91d5fd85bbf..3e559207c394e 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTextStateTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTextStateTest.java index 324c8c15bd99b..327a360601b19 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTextStateTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTextStateTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitchTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitchTest.java index b597d5b6d1d47..13e6fb23bda26 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitchTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTimedSwitchTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTrackerTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTrackerTest.java index 1e4895a1494b5..fa23ad566665d 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTrackerTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlTrackerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalogTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalogTest.java index 2ee861f2de133..6425e1cc9207d 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalogTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownAnalogTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigitalTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigitalTest.java index c81c38437c76b..74ca9e42cfaaf 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigitalTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlUpDownDigitalTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorIncrTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorIncrTest.java index 1e1e9234dda72..12f66ce17d5e7 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorIncrTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorIncrTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorTest.java index 67ac449a97e8c..fbd72ee9424d4 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlValueSelectorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlWebPageTest.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlWebPageTest.java index d75e78a0af9b5..2fdcb6cf6db95 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlWebPageTest.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxControlWebPageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxServerHandlerDummy.java b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxServerHandlerDummy.java index 7e70bc7cc0558..04c74a58bbc36 100644 --- a/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxServerHandlerDummy.java +++ b/bundles/org.openhab.binding.loxone/src/test/java/org/openhab/binding/loxone/internal/controls/LxServerHandlerDummy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.LinkedList; import java.util.Map; @@ -64,7 +65,7 @@ public LxServerHandlerDummy() { void loadConfiguration() { InputStream stream = LxServerHandlerDummy.class.getResourceAsStream("LoxAPP3.json"); assertNotNull(stream); - BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); + BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8)); assertNotNull(reader); String msg = reader.lines().collect(Collectors.joining(System.lineSeparator())); assertNotNull(msg); diff --git a/bundles/org.openhab.binding.loxone/src/test/resources/org/openhab/binding/loxone/internal/controls/LoxAPP3.json b/bundles/org.openhab.binding.loxone/src/test/resources/org/openhab/binding/loxone/internal/controls/LoxAPP3.json index 32853f21abee5..48cfd4e86375e 100644 --- a/bundles/org.openhab.binding.loxone/src/test/resources/org/openhab/binding/loxone/internal/controls/LoxAPP3.json +++ b/bundles/org.openhab.binding.loxone/src/test/resources/org/openhab/binding/loxone/internal/controls/LoxAPP3.json @@ -590,6 +590,17 @@ "states": { "active": "1076668f-0101-7062-ffffe94fed106136" } + }, + "1076668f-0101-7076-ffff403fb0dddb9e/AI5": { + "name": "Unsupported Subcontrol To Be Ignored", + "type": "UnsupportedSubcontrolType", + "uuidAction": "1076668f-0101-7076-ffff403fb0dddb9e/AI5", + "defaultRating": 0, + "isFavorite": false, + "isSecured": false, + "states": { + "wrong": "1076668f-0101-7072-ffffe94ddddd6136" + } } } }, @@ -739,6 +750,94 @@ "value": "131fb314-0370-c93c-ffff403fb0c34b9e", "error": "131fb314-0370-c93b-ffff6a7be057af65" } + }, + "13b3ea27-00fc-6f1b-ffff403fb0c34b9e": { + "name": "Energy Meter", + "type": "Meter", + "uuidAction": "13b3ea27-00fc-6f1b-ffff403fb0c34b9e", + "room": "0b734138-037d-034e-ffff403fb0c34b9e", + "cat": "0fe650c2-0004-d446-ffff504f9410790f", + "defaultRating": 0, + "isFavorite": false, + "isSecured": false, + "details": { + "actualFormat": "%.3fkW", + "totalFormat": "%.1fkWh" + }, + "states": { + "actual": "13b3ea27-00fc-6f10-ffffd63e2e9a902a", + "total": "13b3ea27-00fc-6f0f-ffffd63e2e9a902a" + } + }, + "14328f8a-21c9-7c0d-ffff403fb0c34b9e": { + "name": "Intelligent Room Controller", + "type": "IRoomControllerV2", + "uuidAction": "14328f8a-21c9-7c0d-ffff403fb0c34b9e", + "room": "0b734138-037d-034e-ffff403fb0c34b9e", + "cat": "0fe650c2-0004-d446-ffff504f9410790f", + "defaultRating": 2, + "isFavorite": false, + "isSecured": false, + "details": { + "timerModes": [ + { + "name": "In Use", + "description": "Comfort", + "id": 1 + }, + { + "name": "Not In Use", + "description": "Economy", + "id": 0 + }, + { + "name": "Off", + "description": "Fabric Protection", + "id": 2 + } + ], + "format": "%.1f°", + "connectedInputs": 0 + }, + "states": { + "tempActual": "14328f8a-00c9-7be6-ffffd54e02f0b858", + "tempTarget": "14328f8a-00c9-7c0b-ffffd43a02f0b858", + "comfortTemperature": "14328f8a-00c9-7bee-ecafd48e02f0b858", + "comfortTolerance": "14328f8a-00c9-7bef-ffffd26802f0b858", + "absentMinOffset": "14328f8a-00c9-7bf0-ffffd43e22f0b858", + "absentMaxOffset": "14328f8a-00c9-7bf1-ffffd44e02f0b858", + "frostProtectTemperature": "14328f8a-00c9-7bf1-ffffd48e02f0b858", + "heatProtectTemperature": "14328f8a-00c9-7bf7-ffffd48e02f0b858", + "activeMode": "14328f8a-00c9-7be0-ffffd48e02a0b858", + "comfortTemperatureOffset": "14328f8a-00c9-7adb-ffffd48e02f0b858", + "overrideEntries": "14328f8a-00c9-7bdc-ffffda8e02f0b858", + "prepareState": "14328f8a-00c9-7bdd-ffffd48ea2f0b858", + "useOutdoor": "14328f8a-00c9-7bde-ffffd48e02a0b858", + "operatingMode": "14328f8a-00c9-7be1-ffffd48a02f0b858", + "overrideReason": "14328f8a-00c9-7be3-ffffd48a02f0b858", + "openWindow": "14328f8a-00c9-7be7-ffffd48e02f0a858", + "modeList": "14328f8a-00c9-7be2-ffffd48e02f0b8a8" + }, + "subControls": { + "14328f8a-00c9-7bda-ffffd48e02f0b858": { + "name": "Heating and Cooling", + "type": "IRCV2Daytimer", + "uuidAction": "14328f8a-00c9-7bda-ffeed48e02f0b858", + "defaultRating": 0, + "isFavorite": false, + "isSecured": false, + "details": { + "analog": true, + "format": "%.1f°" + }, + "states": { + "entriesAndDefaultValue": "14328f5a-00c9-7bda-ffffd48e02f0b858", + "mode": "14328f8a-00c9-7c0c-ffffd42e02f0b858", + "modeList": "14328f8a-00c9-7be2-fffff48e02f0b858", + "value": "14328f8a-00c9-7be0-ffffd48efef0b858" + } + } + } } }, "weatherServer": { diff --git a/bundles/org.openhab.binding.lutron/NOTICE b/bundles/org.openhab.binding.lutron/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.lutron/NOTICE +++ b/bundles/org.openhab.binding.lutron/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.lutron/README.md b/bundles/org.openhab.binding.lutron/README.md index 128724fb7a33a..a0b7116c35d8e 100644 --- a/bundles/org.openhab.binding.lutron/README.md +++ b/bundles/org.openhab.binding.lutron/README.md @@ -3,19 +3,19 @@ This binding integrates with [Lutron](http://www.lutron.com) lighting control and home automation systems. It contains separate binding support for four different types of Lutron systems: -* RadioRA 2 and other systems that can be controlled by Lutron Integration Protocol, such as Homeworks QS, RA2 Select, and Caseta PRO +* RadioRA 2, HomeWorks QS, and other systems that can be controlled by Lutron Integration Protocol, such as RA2 Select, and Caseta Pro * The original RadioRA system, referred to here as RadioRA Classic * Legacy HomeWorks RS232 Processors * Grafik Eye 3x/4x systems with GRX-PRG or GRX-CI-PRG control interfaces Each is described in a separate section below. -# Lutron RadioRA 2 Binding +# Lutron RadioRA 2/HomeWorks QS Binding -**Note:** While the integration protocol used by this binding should largely be compatible with other current Lutron systems, this binding has only been fully tested with RadioRA 2 and Caseta. -Homeworks QS support is still a work in progress. -RA2 Select is believed to work, but it is unconfirmed. -It has not yet been tested with Quantum, QS Standalone, or myRoom plus systems. +**Note:** While the integration protocol used by this binding should largely be compatible with other current Lutron systems, this binding has only been fully tested with RadioRA 2, HomeWorks QS, and Caseta with Smart Bridge Pro. +Homeworks QS support is still a work in progress, since not all features/devices are supported yet. +RA2 Select has been reported to work with the binding, but support is unconfirmed. +The binding has not been tested with Quantum, QS Standalone, or myRoom Plus systems. **Note:** Caseta support is only possible with the Smart Bridge **Pro** hub. The standard Caseta hub does not support Lutron Integration Protocol. @@ -31,13 +31,16 @@ This binding currently supports the following thing types: * **keypad** - Lutron seeTouch or Hybrid seeTouch Keypad * **ttkeypad** - Tabletop seeTouch Keypad * **intlkeypad** - International seeTouch Keypad (HomeWorks QS only) +* **palladiomkeypad** - Palladiom Keypad (HomeWorks QS only) * **pico** - Pico Keypad * **grafikeyekeypad** - GRAFIK Eye QS Keypad (RadioRA 2/HomeWorks QS only) * **virtualkeypad** - Repeater virtual keypad * **vcrx** - Visor control receiver module (VCRX) -* **qsio** - HomeWorks QS IO Interface +* **qsio** - QS IO Interface (HomeWorks QS only) +* **wci** - QS Wallbox Closure Interface (WCI) (HomeWorks QS only) * **cco** - Contact closure output module or VCRX CCO -* **shade** - Lutron shade or motorized drape +* **shade** - Lutron shade, motorized drape, or motor controller +* **blind** - Lutron venetian blind or horizontal sheer blind [**Experimental**] * **greenmode** - Green Mode subsystem * **timeclock** - Scheduling subsystem @@ -47,12 +50,10 @@ Full discovery is supported for RadioRA 2 and HomeWorks QS systems. Both the main repeaters/processors themselves and the devices connected to them can be automatically discovered. Discovered repeaters/processors will be accessed using the default integration credentials. These can be changed in the bridge thing configuration. +Discovered keypad devices should now have their model parameters automatically set to the correct value. Hubs and their connected devices in Caseta and RA2 Select systems need to be configured manually. -**Remember:** Discovered keypads will not have their model parameter automatically set. -You must manually set the model parameter for each keypad so that the correct channels for your particular keypad model will be created. - ## Binding Configuration This binding does not require any special configuration. @@ -77,6 +78,13 @@ Note that the handler will wait up to 30 seconds for a heartbeat response before The optional advanced parameter `reconnect` can be used to set the connection retry interval, in minutes. It also defaults to 5. +The optional advanced parameter `delay` can be used to set a delay (in milliseconds) between transmission of integration commands to the bridge device. +This may be used for command send rate throttling. +It can be set to an integer value between 0 and 250 ms, and defaults to 0 (no delay). +It is recommended that this parameter be left at the default unless you experience problems with sent commands being dropped/ignored. +This has been reported in some rare cases when large numbers of commands were sent in short periods to Caseta hubs. +If you experience this problem, try setting a delay value of around 100 ms as a starting point. + The optional advanced parameter `discoveryFile` can be set to force the device discovery service to read the Lutron configuration XML from a local file rather than retrieving it via HTTP from the RadioRA 2 or HomeWorks QS bridge device. This is useful in the case of some older Lutron software versions, where the discovery service may have problems retrieving the file from the bridge device. Note that the user which openHAB runs under must have permission to read the file. @@ -155,10 +163,7 @@ You can monitor button channels for ON and OFF state changes to indicate button Ditto for the indicator LED channels. Note, however, that version 11.6 or higher of the RadioRA 2 software may be required in order to drive keypad LED states, and then this may only be done on unbound buttons. -When using auto-discovery, remember to select the correct value for the `model` parameter after accepting the keypad thing from the inbox. -The correct channels will then be automatically configured. - -Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.104 (http://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). +Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.104 (https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). If you are having problems determining which channels have been created for a given keypad model, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:keypad:radiora2:entrykeypad`) from the openHAB CLI to list the channels. Supported settings for `model` parameter: H1RLD, H2RLD, H3BSRL, H3S, H4S, H5BRL, H6BRL, HN1RLD, HN2RLD, HN3S, HN3BSRL, HN4S, HN5BRL, HN6BRL, W1RLD, W2RLD, W3BD, W3BRL, W3BSRL, W3S, W4S, W5BRL, W5BRLIR, W6BRL, W7B, Generic (default) @@ -186,10 +191,7 @@ Tabletop seeTouch keypads use the **ttkeypad** thing. It accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same channel types as the **keypad** thing. See the **keypad** section above for a full discussion of configuration and use. -When using auto-discovery, remember to select the correct value for the `model` parameter after accepting the **ttkeypad** thing from the inbox. -The correct channels will then be automatically configured. - -Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.110 (http://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). +Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.110 (https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). If you are having problems determining which channels have been created for a given keypad model, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:ttkeypad:radiora2:bedroomkeypad`) from the openHAB CLI to list the channels. Supported settings for `model` parameter: T5RL, T10RL, T15RL, T5CRL, T10CRL, T15CRL, Generic (default) @@ -200,20 +202,17 @@ Thing configuration file example: Thing ttkeypad bedroomkeypad [ integrationId=11, model="T10RL" autorelease=true ] ``` -### International seeTouch Keypads (Homeworks QS) +### International seeTouch Keypads (HomeWorks QS) -International seeTouch keypads used in the Homeworks QS system use the **intlkeypad** thing. -It accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same button and led channel types as the **keypad** thing. +International seeTouch keypads used in the HomeWorks QS system use the **intlkeypad** thing. +It accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same button and LED channel types as the **keypad** thing. See the **keypad** section above for a full discussion of configuration and use. -If using auto-discovery, remember to select the correct value for the `model` parameter after accepting the **intlkeypad** thing from the inbox. -The correct channels will then be automatically configured. - To support this keypad's contact closure inputs, CCI channels named *cci1* and *cci2* are created with item type Contact and category Switch. They are marked as Advanced, so they will not be automatically linked to items in the Paper UI's Simple Mode. They present ON/OFF states the same as a keypad button. -Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.107 (http://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). +Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.107 (https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). If you are having problems determining which channels have been created for a given keypad model, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:intlkeypad:hwprocessor:kitchenkeypad`) from the openHAB CLI to list the channels. Supported settings for `model` parameter: 2B, 3B, 4B, 5BRL, 6BRL, 7BRL, 8BRL, 10BRL / Generic (default) @@ -224,6 +223,24 @@ Thing configuration file example: Thing intlkeypad kitchenkeypad [ integrationId=15, model="10BRL" autorelease=true ] ``` +### Palladiom Keypads (HomeWorks QS) + +Palladiom keypads used in the HomeWorks QS system use the **palladiomkeypad** thing. +It accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same button and LED channel types as the **keypad** thing. +See the **keypad** section above for a full discussion of configuration and use. + +Component numbering: For button and LED layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.95 (https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). +If you are having problems determining which channels have been created for a given keypad model, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:palladiomkeypad:hwprocessor:kitchenkeypad`) from the openHAB CLI to list the channels. + +Supported settings for `model` parameter: 2W, 3W, 4W, RW, 22W, 24W, 42W, 44W, 2RW, 4RW, RRW + +Thing configuration file example: + +``` +Thing palladiomkeypad kitchenkeypad [ integrationId=16, model="4W" autorelease=true ] +``` + + ### Pico Keypads Pico keypads use the **pico** thing. @@ -231,10 +248,7 @@ It accepts the same `integrationID`, `model`, and `autorelease` parameters and c The only difference is that no LED channels will be created, since Pico keypads have no indicator LEDs. See the discussion above for a full discussion of configuration and use. -When using auto-discovery, remember to select the correct value for the `model` parameter after accepting the **pico** thing from the inbox. -The correct channels will then be automatically configured. - -Component numbering: For button layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.113 (http://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). +Component numbering: For button layouts and numbering, see the Lutron Integration Protocol Guide (rev. AA) p.113 (https://www.lutron.com/TechnicalDocumentLibrary/040249.pdf). If you are having problems determining which channels have been created for a given keypad model, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:pico:radiora2:hallpico`) from the openHAB CLI to list the channels. Supported settings for `model` parameter: 2B, 2BRL, 3B, 3BRL, 4B, Generic (default) @@ -255,13 +269,16 @@ In this configuration, the integrated dimmers will appear to openHAB as separate If your GRAFIK Eye is being used as a stand-alone device and is not integrated in to a RadioRA 2 or HomeWorks QS system, then *this is not the thing you are looking for*. You should instead be using the **grafikeye** thing (see below). -The **grafikeyekeypad** thing accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same button, led, and cci, channel types as the other keypad things (see above). The model parameter should be set to indicate whether there are zero, one, two, or three columns of buttons on the left side of the panel. Note that this count does not include the column of 5 scene buttons always found on the right side of the panel. +The **grafikeyekeypad** thing accepts the same `integrationID`, `model`, and `autorelease` parameters and creates the same button, LED, and CCI, channel types as the other keypad things (see above). +The model parameter should be set to indicate whether there are zero, one, two, or three columns of buttons on the left side of the panel. +Note that this count does not include the column of 5 scene buttons always found on the right side of the panel. To support the GRAFIK Eye's contact closure input, a CCI channel named *cci1* will be created with item type Contact and category Switch. It is marked as Advanced, so it will not be automatically linked to items in the Paper UI's Simple Mode. It presents ON/OFF states the same as a keypad button. -Component numbering: The buttons and LEDs on the GRAFIK Eye are numbered top to bottom, starting with the 5 scene buttons in a column on the right side of the panel, and then proceeding with the columns of buttons (if any) on the left side of the panel, working left to right. If you are having problems determining which channels have been created for a given model setting, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:grafikeyekeypad:radiora2:theaterkeypad`) from the openHAB CLI to list the channels. +Component numbering: The buttons and LEDs on the GRAFIK Eye are numbered top to bottom, starting with the 5 scene buttons in a column on the right side of the panel, and then proceeding with the columns of buttons (if any) on the left side of the panel, working left to right. +If you are having problems determining which channels have been created for a given model setting, click on the thing under Configuration/Things in the Paper UI, or run the command `things show <thingUID>` (e.g. `things show lutron:grafikeyekeypad:radiora2:theaterkeypad`) from the openHAB CLI to list the channels. Supported settings for `model` parameter: 0COL, 1COL, 2COL, 3COL (default) @@ -277,7 +294,7 @@ The **virtualkeypad** thing is used to interface to the virtual buttons on the R These are sometimes referred to in the Lutron documentation as phantom buttons or integration buttons, and are used only for integration. There are 100 of these virtual buttons, and 100 corresponding virtual indicator LEDs. -The behavior of this binding is the same as the other keypad bindings, with the exception that the button and led channels created have the Advanced flag set. +The behavior of this binding is the same as the other keypad bindings, with the exception that the button and LED channels created have the Advanced flag set. This means, among other things, that they will not be automatically linked to items in the Paper UI's Simple Mode. Thing configuration file example: @@ -325,6 +342,24 @@ Thing configuration file example: Thing qsio sensorinputs [ integrationId=42 ] ``` +### QS Wallbox Closure Interface (WCI) (HomeWorks QS only) + +The Lutron Wallbox Closure Interface (QSE-CI-WCI) is used to interface to contact closure keypads. +It is handled by the **wci** thing. +The 8 button inputs appear to the HomeWorks system as normal keypad buttons. +There are also 8 LEDs, although they are normally hidden and thus mainly useful for setup and diagnostics. + +Supported options are `integrationId` and `autorelease`. +Supplying a model is not required, as there is only one model. + +See the Lutron documentation for more information. + +Thing configuration file example: + +``` +Thing wci specialkeypad [ integrationId=48, autorelease=true ] +``` + ### CCO Modules Contact closure output (**cco**) things accept `outputType` and `pulseLength` parameters. @@ -343,7 +378,7 @@ Each **cco** thing creates one switch channel called *switchstatus*. For pulsed CCOs, sending an ON command will close the output for the configured pulse time. Sending an OFF command does nothing. Because of limitations in RadioRA 2, you cannot monitor the state of a pulsed CCO. -Therefore, the channel state will only transition OFF->ON->OFF when you send a ON command. +Therefore, the channel state will only transition OFF->ON->OFF when you send an ON command. For maintained CCOs, sending ON and OFF commands works as expected, and the channel state updates as expected when either openHAB commands or external events change the CCO device state. @@ -357,7 +392,7 @@ Thing ccomaintained relay1 [ integrationId=7 ] ### Shades -Each Lutron shade or motorized drape is controlled by a **shade** thing. +Each Lutron shade, motorized drape, or QS motor controller output (LQSE-4M-D) is controlled by a **shade** thing. The only configuration parameter it accepts is `integrationId`. A single channel *shadelevel* with item type Rollershutter and category Rollershutter will be created for each **shade** thing. @@ -367,7 +402,12 @@ You can also read the current shade level from the channel. It is specified as a percentage, where 0% = closed and 100% = fully open. Movement delays are not currently supported. The shade handler should be compatible with all Lutron devices which appear to the system as shades, including roller shades, honeycomb shades, pleated shades, roman shades, tension roller shades, drapes, and Kirbe vertical drapes. -**Note:** While a shade is moving, the Lutron system will report the target level for the shade rather than the actual current level. +Motor controller outputs on a LQSE-4M-D (HomeWorks QS only) behave similarly to a shade. +The only difference is that percentages other than 0% and 100% will be ignored, since arbitrary positioning is not supported by the hardware. +The value of *shadelevel* for a motor will likewise always be either 0% or 100%, depending on whether the last command sent was Up or Down. + +**Note:** While a shade is moving to a specific level because of a Percent command, the system will report the target level for the shade rather than the actual current level. +While a shade is moving because of an Up or Down command, it will report the previous level until it stops moving. Thing configuration file example: @@ -375,6 +415,32 @@ Thing configuration file example: Thing shade libraryshade [ integrationId=33] ``` +### Blinds [**Experimental**] + +Each Lutron Sivoia QS Venetian Blind or Horizontal Sheer Blind is controlled by a **blind** thing. +Besides `integrationId`, it requires that the parameter `type` be set to either "Venetian" for venetian blinds or "Sheer" for horizontal sheer blinds. +There is no default. +If discovery is used, the `type` parameter will set automatically when the **blind** thing is created. + +Two channels, *blindliftlevel* and *blindtiltlevel*, with item type Rollershutter and category Rollershutter will be created for each **blind** thing. +They control the up/down motion and the slat tilt motions of the blinds, respectively. +Each channel accepts Percent, Up, Down, Stop and Refresh commands. +Sending a Percent command will cause the blind to immediately move so as to be open the specified percentage. +You can also read the current setting from each channel. +It is specified as a percentage, where 0% = closed and 100% = fully open. Movement delays are not currently supported. + +**Note:** While a blind is moving to a specific level because of a Percent command, the Lutron system will report the target position for the blind rather than the actual current position. +While a blind is moving because of an Up or Down command, it will report the previous level until it stops moving. + +**Note:** Support for Sivoia QS blinds is new and has been through very limited testing. +Please comment on your use of it in the openHAB community forum. + +Thing configuration file example: + +``` +Thing blind officeblinds [ integrationId=76, type="Venetian"] +``` + ### Green Mode Radio RA2 and HomeWorks QS systems have a "Green Mode" or "Green Button" feature which allows the system to be placed in to one or more user-defined power saving modes called "steps". @@ -459,6 +525,8 @@ The following is a summary of channels for all RadioRA 2 binding things: | keypads(except pico)| led* | Switch | LED indicator for the associated button | | vcrx | cci* | Contact | Contact closure input on/off status | | shade | shadelevel | Rollershutter | Level of the shade (100% = full open) | +| blind | blindliftlevel | Rollershutter | Level of the blind (100% = full open) | +| blind | blindtiltlevel | Rollershutter | Tilt of the blind slats | | greenmode | step | Number | Get/set active green mode step number | | timeclock | clockmode | Number | Get/set active clock mode index number | | timeclock | sunrise | DateTime | Get the timeclock's sunrise time | @@ -482,6 +550,8 @@ Appropriate channels will be created automatically by the keypad, ttkeypad, intl | |led* |OnOffType |OnOffType, RefreshType | | |cci* |OpenClosedType|(*readonly*) | |shade |shadelevel |PercentType |PercentType, UpDownType, StopMoveType.STOP, RefreshType| +|blind |blindliftlevel |PercentType |PercentType, UpDownType, StopMoveType.STOP, RefreshType| +| |blindtiltlevel |PercentType |PercentType, UpDownType, StopMoveType.STOP, RefreshType| |greenmode |step |DecimalType |DecimalType, OnOffType (ON=2,OFF=1), RefreshType | |timeclock |clockmode |DecimalType |DecimalType, RefreshType | | |sunrise |DateTimeType |RefreshType (*readonly*) | @@ -540,7 +610,7 @@ Rollershutter Lib_Shade1 "Shade 1" { channel="lutron:shade:radiora2: This binding integrates with the legacy Lutron RadioRA (Classic) lighting system. This binding depends on RS232 communication. -It has only been tested using the Chronos time module but the RS232 module should work as well. +It has only been tested using the Chronos time module but the RS232 module should work as well. ## Supported Things @@ -601,9 +671,10 @@ Switch Phantom_Movie "Movie Scene" { channel="lutronradiora:phantomButton:chrono # Legacy HomeWorks RS232 (Serial) Processors -The binding supports legacy HomeWorks processors that interface with a Serial RS232 connection. To connect to such a system, you would need to use a RS232 -> USB adapter (assuming you don't have a serial port). +The binding supports legacy HomeWorks processors that interface with a Serial RS232 connection. +To connect to such a system, you would need to use a RS232 -> USB adapter (assuming you don't have a serial port). -Please see [HomeWorks RS232 Protocol Guide](http://www.lutron.com/TechnicalDocumentLibrary/HWI%20RS232%20Protocol.pdf) for information on the protocol. +Please see [HomeWorks RS232 Protocol Guide](https://www.lutron.com/TechnicalDocumentLibrary/HWI%20RS232%20Protocol.pdf) for information on the protocol. ## Supported Things @@ -617,11 +688,12 @@ Supported in future updates: ## Discovery -This binding supports active and passive discovery. It will detect dimmers as they are manually raised or lowered, or can be made to scan for configured dimmer modules. +This binding supports active and passive discovery. +It will detect dimmers as they are manually raised or lowered, or can be made to scan for configured dimmer modules. ## Thing Configuration -The bridge requires the port location (e.g., /dev/ttyUSB1 or COM1) and the baud rate. The default baud rate for HomeWorks processors is set to 9600. +The bridge requires the port location (e.g., /dev/ttyUSB1 or COM1) and the baud rate. The default baud rate for HomeWorks processors is set to 9600. ``` lutron:hwserialbridge:home [serialPort="/dev/ttyUSB1", baudRate="9600] @@ -645,7 +717,7 @@ The following channels are supported: # Lutron Grafik Eye 3x/4x binding via GRX-PRG or GRX-CI-PRG This lutron binding will also work with Grafik Eye 3x/4x systems in conjuction with the GRX-PRG or GRX-CI-PRG interfaces. -Please see [RS232ProtocolCommandSet](http://www.lutron.com/TechnicalDocumentLibrary/RS232ProtocolCommandSet.040196d.pdf) for more information. +Please see [RS232ProtocolCommandSet](https://www.lutron.com/TechnicalDocumentLibrary/RS232ProtocolCommandSet.040196d.pdf) for more information. ## Supported Things @@ -660,7 +732,7 @@ You will need to specify them directly. The bridge requires the IP address/Host name of the bridge. Optionally, you may specify the username (defaults to 'nwk') and retryPolling (in seconds) to retry connections if the connection fails (defaults to 10 seconds). -This bridge does support two way communication with the Grafik Eye units (if a scene is selected or a zone changed on the unit or via a keypad, that information is immediately available in openhab). +This bridge does support two way communication with the Grafik Eye units (if a scene is selected or a zone changed on the unit or via a keypad, that information is immediately available in openHAB). ``` lutron:prgbridge:home [ ipAddress="192.168.1.51", user="nwk", retryPolling=10 ] diff --git a/bundles/org.openhab.binding.lutron/pom.xml b/bundles/org.openhab.binding.lutron/pom.xml index 4be95289720f3..ca6adc2197647 100644 --- a/bundles/org.openhab.binding.lutron/pom.xml +++ b/bundles/org.openhab.binding.lutron/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.lutron</artifactId> diff --git a/bundles/org.openhab.binding.lutron/src/main/feature/feature.xml b/bundles/org.openhab.binding.lutron/src/main/feature/feature.xml index b304d5de05e1c..54f387eaac281 100644 --- a/bundles/org.openhab.binding.lutron/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.lutron/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.lutron-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-lutron" description="Lutron Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/KeypadComponent.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/KeypadComponent.java index 1c9534e8a493f..8a877f876c80e 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/KeypadComponent.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/KeypadComponent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,8 @@ */ package org.openhab.binding.lutron.internal; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + /** * The {@link KeypadComponent} interface is used to access enums describing the possible components * in a given keypad model. @@ -26,4 +28,6 @@ public interface KeypadComponent { public String channel(); public String description(); + + public ComponentType type(); } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronBindingConstants.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronBindingConstants.java index 96cb7837380f2..ba264622b8569 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronBindingConstants.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,6 +47,9 @@ public class LutronBindingConstants { public static final ThingTypeUID THING_TYPE_GREENMODE = new ThingTypeUID(BINDING_ID, "greenmode"); public static final ThingTypeUID THING_TYPE_QSIO = new ThingTypeUID(BINDING_ID, "qsio"); public static final ThingTypeUID THING_TYPE_GRAFIKEYEKEYPAD = new ThingTypeUID(BINDING_ID, "grafikeyekeypad"); + public static final ThingTypeUID THING_TYPE_BLIND = new ThingTypeUID(BINDING_ID, "blind"); + public static final ThingTypeUID THING_TYPE_PALLADIOMKEYPAD = new ThingTypeUID(BINDING_ID, "palladiomkeypad"); + public static final ThingTypeUID THING_TYPE_WCI = new ThingTypeUID(BINDING_ID, "wci"); // List of all Channel ids public static final String CHANNEL_LIGHTLEVEL = "lightlevel"; @@ -60,6 +63,8 @@ public class LutronBindingConstants { public static final String CHANNEL_ENABLEEVENT = "enableevent"; public static final String CHANNEL_DISABLEEVENT = "disableevent"; public static final String CHANNEL_STEP = "step"; + public static final String CHANNEL_BLINDLIFTLEVEL = "blindliftlevel"; + public static final String CHANNEL_BLINDTILTLEVEL = "blindtiltlevel"; // Bridge config properties (used by discovery service) public static final String HOST = "ipAddress"; @@ -79,4 +84,9 @@ public class LutronBindingConstants { // GreenMode config properties public static final String POLL_INTERVAL = "pollInterval"; + + // Blind types + public static final String BLIND_TYPE_PARAMETER = "type"; + public static final String BLIND_TYPE_SHEER = "Sheer"; + public static final String BLIND_TYPE_VENETIAN = "Venetian"; } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronHandlerFactory.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronHandlerFactory.java index 48cb5d05cd310..c4e2057fe8c2c 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronHandlerFactory.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/LutronHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,6 @@ import java.util.Collections; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -38,6 +37,7 @@ import org.openhab.binding.lutron.internal.grxprg.GrafikEyeHandler; import org.openhab.binding.lutron.internal.grxprg.PrgBridgeHandler; import org.openhab.binding.lutron.internal.grxprg.PrgConstants; +import org.openhab.binding.lutron.internal.handler.BlindHandler; import org.openhab.binding.lutron.internal.handler.CcoHandler; import org.openhab.binding.lutron.internal.handler.DimmerHandler; import org.openhab.binding.lutron.internal.handler.GrafikEyeKeypadHandler; @@ -47,6 +47,7 @@ import org.openhab.binding.lutron.internal.handler.KeypadHandler; import org.openhab.binding.lutron.internal.handler.MaintainedCcoHandler; import org.openhab.binding.lutron.internal.handler.OccupancySensorHandler; +import org.openhab.binding.lutron.internal.handler.PalladiomKeypadHandler; import org.openhab.binding.lutron.internal.handler.PicoKeypadHandler; import org.openhab.binding.lutron.internal.handler.PulsedCcoHandler; import org.openhab.binding.lutron.internal.handler.QSIOHandler; @@ -56,6 +57,7 @@ import org.openhab.binding.lutron.internal.handler.TimeclockHandler; import org.openhab.binding.lutron.internal.handler.VcrxHandler; import org.openhab.binding.lutron.internal.handler.VirtualKeypadHandler; +import org.openhab.binding.lutron.internal.handler.WciHandler; import org.openhab.binding.lutron.internal.hw.HwConstants; import org.openhab.binding.lutron.internal.hw.HwDimmerHandler; import org.openhab.binding.lutron.internal.hw.HwSerialBridgeHandler; @@ -81,12 +83,12 @@ public class LutronHandlerFactory extends BaseThingHandlerFactory { // Used by LutronDeviceDiscoveryService to discover these types - public static final Set<ThingTypeUID> DISCOVERABLE_DEVICE_TYPES_UIDS = Collections.unmodifiableSet(Stream - .of(THING_TYPE_DIMMER, THING_TYPE_SWITCH, THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_KEYPAD, + public static final Set<ThingTypeUID> DISCOVERABLE_DEVICE_TYPES_UIDS = Collections.unmodifiableSet( + Stream.of(THING_TYPE_DIMMER, THING_TYPE_SWITCH, THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_KEYPAD, THING_TYPE_TTKEYPAD, THING_TYPE_INTLKEYPAD, THING_TYPE_PICO, THING_TYPE_VIRTUALKEYPAD, THING_TYPE_VCRX, THING_TYPE_CCO_PULSED, THING_TYPE_CCO_MAINTAINED, THING_TYPE_SHADE, - THING_TYPE_TIMECLOCK, THING_TYPE_GREENMODE, THING_TYPE_QSIO, THING_TYPE_GRAFIKEYEKEYPAD) - .collect(Collectors.toSet())); + THING_TYPE_TIMECLOCK, THING_TYPE_GREENMODE, THING_TYPE_QSIO, THING_TYPE_GRAFIKEYEKEYPAD, + THING_TYPE_BLIND, THING_TYPE_PALLADIOMKEYPAD, THING_TYPE_WCI).collect(Collectors.toSet())); // Used by the HwDiscoveryService public static final Set<ThingTypeUID> HW_DISCOVERABLE_DEVICE_TYPES_UIDS = Collections @@ -130,8 +132,7 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { if (thingTypeUID.equals(THING_TYPE_IPBRIDGE)) { IPBridgeHandler bridgeHandler = new IPBridgeHandler((Bridge) thing); - LutronDeviceDiscoveryService discoveryService = registerDiscoveryService(bridgeHandler); - bridgeHandler.setDiscoveryService(discoveryService); + registerDiscoveryService(bridgeHandler); return bridgeHandler; } else if (thingTypeUID.equals(THING_TYPE_DIMMER)) { return new DimmerHandler(thing); @@ -157,16 +158,22 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { return new PicoKeypadHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_GRAFIKEYEKEYPAD)) { return new GrafikEyeKeypadHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_PALLADIOMKEYPAD)) { + return new PalladiomKeypadHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_VIRTUALKEYPAD)) { return new VirtualKeypadHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_VCRX)) { return new VcrxHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_WCI)) { + return new WciHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_TIMECLOCK)) { return new TimeclockHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_GREENMODE)) { return new GreenModeHandler(thing); } else if (thingTypeUID.equals(THING_TYPE_QSIO)) { return new QSIOHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_BLIND)) { + return new BlindHandler(thing); } else if (thingTypeUID.equals(PrgConstants.THING_TYPE_PRGBRIDGE)) { return new PrgBridgeHandler((Bridge) thing); } else if (thingTypeUID.equals(PrgConstants.THING_TYPE_GRAFIKEYE)) { @@ -204,11 +211,11 @@ protected synchronized void removeHandler(ThingHandler thingHandler) { * * @param bridgeHandler bridge handler for which to register the discovery service */ - private synchronized LutronDeviceDiscoveryService registerDiscoveryService(IPBridgeHandler bridgeHandler) { + private synchronized void registerDiscoveryService(IPBridgeHandler bridgeHandler) { logger.debug("Registering discovery service."); LutronDeviceDiscoveryService discoveryService = new LutronDeviceDiscoveryService(bridgeHandler, httpClient); + bridgeHandler.setDiscoveryService(discoveryService); discoveryServiceRegMap.put(bridgeHandler.getThing().getUID(), - bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<>())); - return discoveryService; + bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, null)); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/BlindConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/BlindConfig.java new file mode 100644 index 0000000000000..71ebcc45a33c8 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/BlindConfig.java @@ -0,0 +1,23 @@ +/** + * 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.lutron.internal.config; + +/** + * Configuration settings for an {@link org.openhab.binding.lutron.internal.handler.BlindHandler}. + * + * @author Bob Adair - Initial contribution + */ +public class BlindConfig { + public int integrationId = 0; + public String type; +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/DimmerConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/DimmerConfig.java index c3b4405d656de..998ea1c006c38 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/DimmerConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/DimmerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/IPBridgeConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/IPBridgeConfig.java index e44b9bb7e0de1..998b8a6e25970 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/IPBridgeConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/config/IPBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,10 +27,11 @@ public class IPBridgeConfig { public String discoveryFile; public int reconnect; public int heartbeat; + public int delay = 0; public boolean sameConnectionParameters(IPBridgeConfig config) { return StringUtils.equals(ipAddress, config.ipAddress) && StringUtils.equals(user, config.user) && StringUtils.equals(password, config.password) && (reconnect == config.reconnect) - && (heartbeat == config.heartbeat); + && (heartbeat == config.heartbeat) && (delay == config.delay); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronDeviceDiscoveryService.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronDeviceDiscoveryService.java index 043d92686ae5e..f53e9562d08ed 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,10 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; +import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; import java.util.Map; import java.util.Stack; import java.util.concurrent.ExecutionException; @@ -44,6 +47,8 @@ import org.eclipse.smarthome.core.thing.ThingUID; import org.openhab.binding.lutron.internal.LutronHandlerFactory; import org.openhab.binding.lutron.internal.discovery.project.Area; +import org.openhab.binding.lutron.internal.discovery.project.Component; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; import org.openhab.binding.lutron.internal.discovery.project.Device; import org.openhab.binding.lutron.internal.discovery.project.DeviceGroup; import org.openhab.binding.lutron.internal.discovery.project.DeviceNode; @@ -54,6 +59,13 @@ import org.openhab.binding.lutron.internal.discovery.project.Project; import org.openhab.binding.lutron.internal.discovery.project.Timeclock; import org.openhab.binding.lutron.internal.handler.IPBridgeHandler; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfig; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigGrafikEye; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigIntlSeetouch; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigPalladiom; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigPico; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigSeetouch; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigTabletopSeetouch; import org.openhab.binding.lutron.internal.xml.DbXmlInfoReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +77,7 @@ * @author Allan Tong - Initial contribution * @author Bob Adair - Added support for more output devices and keypads, VCRX, repeater virtual buttons, * Timeclock, and Green Mode. Added option to read XML from file. Switched to jetty HTTP client for better - * exception handling. + * exception handling. Added keypad model discovery. */ public class LutronDeviceDiscoveryService extends AbstractDiscoveryService { @@ -105,7 +117,7 @@ private synchronized void asyncDiscoveryTask() { try { readDeviceDatabase(); } catch (RuntimeException e) { - logger.warn("Runtime exception scanning for devices: {}", e.getMessage()); + logger.warn("Runtime exception scanning for devices: {}", e.getMessage(), e); if (scanListener != null) { scanListener.onErrorOccurred(null); // null so it won't log a stack trace @@ -248,6 +260,10 @@ private void processDeviceGroup(DeviceGroup deviceGroup, Stack<String> context) } private void processDevice(Device device, Stack<String> context) { + List<Integer> buttons; + KeypadConfig kpConfig; + String kpModel; + DeviceType type = device.getDeviceType(); if (type != null) { @@ -260,25 +276,38 @@ private void processDevice(Device device, Stack<String> context) { case SEETOUCH_KEYPAD: case HYBRID_SEETOUCH_KEYPAD: - notifyDiscovery(THING_TYPE_KEYPAD, device.getIntegrationId(), label); + kpConfig = new KeypadConfigSeetouch(); + discoverKeypad(device, label, THING_TYPE_KEYPAD, "seeTouch Keypad", kpConfig); break; case INTERNATIONAL_SEETOUCH_KEYPAD: - notifyDiscovery(THING_TYPE_INTLKEYPAD, device.getIntegrationId(), label); + kpConfig = new KeypadConfigIntlSeetouch(); + discoverKeypad(device, label, THING_TYPE_INTLKEYPAD, "International seeTouch Keypad", kpConfig); break; case SEETOUCH_TABLETOP_KEYPAD: - notifyDiscovery(THING_TYPE_TTKEYPAD, device.getIntegrationId(), label); + kpConfig = new KeypadConfigTabletopSeetouch(); + discoverKeypad(device, label, THING_TYPE_TTKEYPAD, "Tabletop seeTouch Keypad", kpConfig); + break; + + case PALLADIOM_KEYPAD: + kpConfig = new KeypadConfigPalladiom(); + discoverKeypad(device, label, THING_TYPE_PALLADIOMKEYPAD, "Palladiom Keypad", kpConfig); break; case PICO_KEYPAD: - notifyDiscovery(THING_TYPE_PICO, device.getIntegrationId(), label); + kpConfig = new KeypadConfigPico(); + discoverKeypad(device, label, THING_TYPE_PICO, "Pico Keypad", kpConfig); break; case VISOR_CONTROL_RECEIVER: notifyDiscovery(THING_TYPE_VCRX, device.getIntegrationId(), label); break; + case WCI: + notifyDiscovery(THING_TYPE_WCI, device.getIntegrationId(), label); + break; + case MAIN_REPEATER: notifyDiscovery(THING_TYPE_VIRTUALKEYPAD, device.getIntegrationId(), label); break; @@ -288,7 +317,24 @@ private void processDevice(Device device, Stack<String> context) { break; case GRAFIK_EYE_QS: - notifyDiscovery(THING_TYPE_GRAFIKEYEKEYPAD, device.getIntegrationId(), label); + buttons = getComponentIdList(device.getComponents(), ComponentType.BUTTON); + // remove button IDs >= 300 which the handler does not recognize + List<Integer> buttonsCopy = new ArrayList<>(buttons); + for (Integer c : buttonsCopy) { + if (c >= 300) { + buttons.remove(Integer.valueOf(c)); + } + } + kpConfig = new KeypadConfigGrafikEye(); + kpModel = kpConfig.determineModelFromComponentIds(buttons); + if (kpModel == null) { + logger.info("Unable to determine model of GrafikEye Keypad {} with button IDs: {}", + device.getIntegrationId(), buttons); + notifyDiscovery(THING_TYPE_GRAFIKEYEKEYPAD, device.getIntegrationId(), label); + } else { + logger.debug("Found GrafikEye keypad {} model: {}", device.getIntegrationId(), kpModel); + notifyDiscovery(THING_TYPE_GRAFIKEYEKEYPAD, device.getIntegrationId(), label, "model", kpModel); + } break; } } else { @@ -296,6 +342,30 @@ private void processDevice(Device device, Stack<String> context) { } } + private void discoverKeypad(Device device, String label, ThingTypeUID ttUid, String description, + KeypadConfig kpConfig) { + List<Integer> buttons = getComponentIdList(device.getComponents(), ComponentType.BUTTON); + String kpModel = kpConfig.determineModelFromComponentIds(buttons); + if (kpModel == null) { + logger.info("Unable to determine model of {} {} with button IDs: {}", description, + device.getIntegrationId(), buttons); + notifyDiscovery(ttUid, device.getIntegrationId(), label); + } else { + logger.debug("Found {} {} model: {}", description, device.getIntegrationId(), kpModel); + notifyDiscovery(ttUid, device.getIntegrationId(), label, "model", kpModel); + } + } + + private List<Integer> getComponentIdList(List<Component> clist, ComponentType ctype) { + List<Integer> returnList = new LinkedList<>(); + for (Component c : clist) { + if (c.getComponentType() == ctype) { + returnList.add(c.getComponentNumber()); + } + } + return returnList; + } + private void processOutput(Output output, Stack<String> context) { OutputType type = output.getOutputType(); @@ -330,8 +400,19 @@ private void processOutput(Output output, Stack<String> context) { break; case SYSTEM_SHADE: + case MOTOR: notifyDiscovery(THING_TYPE_SHADE, output.getIntegrationId(), label); break; + + case SHEER_BLIND: + notifyDiscovery(THING_TYPE_BLIND, output.getIntegrationId(), label, BLIND_TYPE_PARAMETER, + BLIND_TYPE_SHEER); + break; + + case VENETIAN_BLIND: + notifyDiscovery(THING_TYPE_BLIND, output.getIntegrationId(), label, BLIND_TYPE_PARAMETER, + BLIND_TYPE_VENETIAN); + break; } } else { logger.warn("Unrecognized output type {}", output.getType()); @@ -348,7 +429,8 @@ private void processGreenModes(GreenMode greenmode, Stack<String> context) { notifyDiscovery(THING_TYPE_GREENMODE, greenmode.getIntegrationId(), label); } - private void notifyDiscovery(ThingTypeUID thingTypeUID, Integer integrationId, String label) { + private void notifyDiscovery(ThingTypeUID thingTypeUID, Integer integrationId, String label, String propName, + Object propValue) { if (integrationId == null) { logger.info("Discovered {} with no integration ID", label); @@ -362,6 +444,10 @@ private void notifyDiscovery(ThingTypeUID thingTypeUID, Integer integrationId, S properties.put(INTEGRATION_ID, integrationId); + if (propName != null && propValue != null) { + properties.put(propName, propValue); + } + DiscoveryResult result = DiscoveryResultBuilder.create(uid).withBridge(bridgeUID).withLabel(label) .withProperties(properties).withRepresentationProperty(INTEGRATION_ID).build(); @@ -370,6 +456,10 @@ private void notifyDiscovery(ThingTypeUID thingTypeUID, Integer integrationId, S logger.debug("Discovered {}", uid); } + private void notifyDiscovery(ThingTypeUID thingTypeUID, Integer integrationId, String label) { + notifyDiscovery(thingTypeUID, integrationId, label, null, null); + } + private String generateLabel(Stack<String> context, String deviceName) { return String.join(" ", context) + " " + deviceName; } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronMcastBridgeDiscoveryService.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronMcastBridgeDiscoveryService.java index b3a500101428b..72b3bec5748b0 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronMcastBridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/LutronMcastBridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Area.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Area.java index 99a1d5de312f4..020ca9b3adff1 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Area.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Area.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Component.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Component.java index 1cc95a41737f1..6073e2b254f13 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Component.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Component.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/ComponentType.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/ComponentType.java index 8a78ac0ac7f1f..3aebcf162599a 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/ComponentType.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/ComponentType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,5 +20,6 @@ public enum ComponentType { BUTTON, CCI, - LED + LED, + SCENE_CONTROLLER } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Device.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Device.java index 3b22baf345547..95d840ac866e8 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Device.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceGroup.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceGroup.java index a493403f39fca..0b02bcc9ce645 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceGroup.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceNode.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceNode.java index fccaca15eecad..543b8c2b8e506 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceNode.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceNode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceType.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceType.java index bf0194499079a..39d6d1239212b 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceType.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,9 +23,11 @@ public enum DeviceType { INTERNATIONAL_SEETOUCH_KEYPAD, MAIN_REPEATER, MOTION_SENSOR, + PALLADIOM_KEYPAD, PICO_KEYPAD, QS_IO_INTERFACE, SEETOUCH_KEYPAD, SEETOUCH_TABLETOP_KEYPAD, - VISOR_CONTROL_RECEIVER + VISOR_CONTROL_RECEIVER, + WCI } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/GreenMode.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/GreenMode.java index 7cf4626add24f..30c8eea2ea431 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/GreenMode.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/GreenMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Output.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Output.java index f0281920ae45a..32d87c3280c64 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Output.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Output.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/OutputType.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/OutputType.java index 68ebb2fc4b046..499a84d81881f 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/OutputType.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/OutputType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ public enum OutputType { FLUORESCENT_DB, INC, MLV, + MOTOR, NON_DIM, NON_DIM_ELV, NON_DIM_INC, diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Project.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Project.java index 9dc830d9d933f..a297e3bfde2ec 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Project.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Project.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Timeclock.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Timeclock.java index d9705e5653180..151f70f750b05 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Timeclock.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/discovery/project/Timeclock.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeConfig.java index 104a0737037a4..c4b52bc42dc2d 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeHandler.java index c05459aee2971..0f77ded220952 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/GrafikEyeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeConfig.java index a43db7c1d835d..701cc2bdde26e 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeHandler.java index 78a10339ec532..3ef13701beea7 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgConstants.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgConstants.java index 572dbd9ba7ea0..bd667b6d64931 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgConstants.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgHandlerCallback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgHandlerCallback.java index 191d867902b84..25d6208f4422e 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgHandlerCallback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgProtocolHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgProtocolHandler.java index 8039579da4fcd..e645970bfb816 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgProtocolHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/PrgProtocolHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSession.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSession.java index 654e9f2cad6f6..b091f3cacfbe3 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSession.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSessionCallback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSessionCallback.java index 427e5f634fb0b..5a283db14f3c1 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSessionCallback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/grxprg/SocketSessionCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BaseKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BaseKeypadHandler.java index b525d1d2dc72e..bd44664c79680 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BaseKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BaseKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,6 +35,7 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfig; import org.openhab.binding.lutron.internal.protocol.LutronCommandType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,18 +72,47 @@ public abstract class BaseKeypadHandler extends LutronHandler { protected abstract void configureComponents(String model); - protected abstract boolean isLed(int id); - - protected abstract boolean isButton(int id); - - protected abstract boolean isCCI(int id); - private final Object asyncInitLock = new Object(); + protected KeypadConfig kp; + public BaseKeypadHandler(Thing thing) { super(thing); } + /** + * Determine if keypad component with the specified id is a LED. Keypad handlers which do not use a KeypadConfig + * object must override this to provide their own test. + * + * @param id The component id. + * @return True if the component is a LED. + */ + protected boolean isLed(int id) { + return kp.isLed(id); + } + + /** + * Determine if keypad component with the specified id is a button. Keypad handlers which do not use a KeypadConfig + * object must override this to provide their own test. + * + * @param id The component id. + * @return True if the component is a button. + */ + protected boolean isButton(int id) { + return kp.isButton(id); + } + + /** + * Determine if keypad component with the specified id is a CCI. Keypad handlers which do not use a KeypadConfig + * object must override this to provide their own test. + * + * @param id The component id. + * @return True if the component is a CCI. + */ + protected boolean isCCI(int id) { + return kp.isCCI(id); + } + protected void configureChannels() { Channel channel; ChannelTypeUID channelTypeUID; diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BlindHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BlindHandler.java new file mode 100644 index 0000000000000..4c154f00aa605 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/BlindHandler.java @@ -0,0 +1,184 @@ +/** + * 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.lutron.internal.handler; + +import static org.openhab.binding.lutron.internal.LutronBindingConstants.*; + +import java.math.BigDecimal; + +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.StopMoveType; +import org.eclipse.smarthome.core.library.types.UpDownType; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.openhab.binding.lutron.internal.config.BlindConfig; +import org.openhab.binding.lutron.internal.protocol.LutronCommandType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Handler responsible for communicating with Lutron blinds + * + * @author Bob Adair - Initial contribution based on Alan Tong's DimmerHandler + */ +public class BlindHandler extends LutronHandler { + private static final Integer ACTION_LIFTLEVEL = 1; + private static final Integer ACTION_TILTLEVEL = 9; + private static final Integer ACTION_LIFTTILTLEVEL = 10; + private static final Integer ACTION_STARTRAISINGTILT = 11; + private static final Integer ACTION_STARTLOWERINGTILT = 12; + private static final Integer ACTION_STOPTILT = 13; + private static final Integer ACTION_STARTRAISINGLIFT = 14; + private static final Integer ACTION_STARTLOWERINGLIFT = 15; + private static final Integer ACTION_STOPLIFT = 16; + private static final Integer ACTION_POSITION_UPDATE = 32; // undocumented in integration protocol guide + private static final Integer PARAMETER_POSITION_UPDATE = 2; // undocumented in integration protocol guide + + private int tiltMax = 100; // max 50 for horizontal sheer, 100 for venetian + + private final Logger logger = LoggerFactory.getLogger(BlindHandler.class); + + private BlindConfig config; + + public BlindHandler(Thing thing) { + super(thing); + } + + @Override + public int getIntegrationId() { + if (config == null) { + throw new IllegalStateException("handler configuration not initialized"); + } + return config.integrationId; + } + + @Override + public void initialize() { + config = getThing().getConfiguration().as(BlindConfig.class); + if (config.integrationId <= 0) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "No integrationId configured"); + return; + } + if (config.type == null || (!(BLIND_TYPE_SHEER.equalsIgnoreCase(config.type)) + && !(BLIND_TYPE_VENETIAN.equalsIgnoreCase(config.type)))) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Parameter type not set to valid value"); + return; + } + String blindType = config.type; + if (BLIND_TYPE_SHEER.equalsIgnoreCase(blindType)) { + tiltMax = 50; + } + logger.debug("Initializing Blind handler with type {} for integration ID {}", blindType, config.integrationId); + initDeviceState(); + } + + @Override + protected void initDeviceState() { + logger.debug("Initializing device state for Shade {}", getIntegrationId()); + Bridge bridge = getBridge(); + if (bridge == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "No bridge configured"); + } else if (bridge.getStatus() == ThingStatus.ONLINE) { + updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.NONE, "Awaiting initial response"); + queryOutput(ACTION_LIFTLEVEL); // handleUpdate() will set thing status to online when response arrives + queryOutput(ACTION_TILTLEVEL); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + } + } + + @Override + public void channelLinked(ChannelUID channelUID) { + // Refresh state when new item is linked. + if (channelUID.getId().equals(CHANNEL_BLINDLIFTLEVEL)) { + queryOutput(ACTION_LIFTLEVEL); + } else if (channelUID.getId().equals(CHANNEL_BLINDTILTLEVEL)) { + queryOutput(ACTION_TILTLEVEL); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + if (channelUID.getId().equals(CHANNEL_BLINDLIFTLEVEL)) { + handleLiftCommand(command); + } else if (channelUID.getId().equals(CHANNEL_BLINDTILTLEVEL)) { + handleTiltCommand(command); + } + } + + private void handleLiftCommand(Command command) { + if (command instanceof PercentType) { + int level = ((PercentType) command).intValue(); + output(ACTION_LIFTLEVEL, level, 0); + } else if (command.equals(UpDownType.UP)) { + output(ACTION_STARTRAISINGLIFT); + } else if (command.equals(UpDownType.DOWN)) { + output(ACTION_STARTLOWERINGLIFT); + } else if (command.equals(StopMoveType.STOP)) { + output(ACTION_STOPLIFT); + } else if (command instanceof RefreshType) { + queryOutput(ACTION_LIFTLEVEL); + } + } + + private void handleTiltCommand(Command command) { + if (command instanceof PercentType) { + int level = ((PercentType) command).intValue(); + output(ACTION_TILTLEVEL, Math.min(level, tiltMax), 0); + } else if (command.equals(UpDownType.UP)) { + output(ACTION_STARTRAISINGTILT); + } else if (command.equals(UpDownType.DOWN)) { + output(ACTION_STARTLOWERINGTILT); + } else if (command.equals(StopMoveType.STOP)) { + output(ACTION_STOPTILT); + } else if (command instanceof RefreshType) { + queryOutput(ACTION_TILTLEVEL); + } + } + + @Override + public void handleUpdate(LutronCommandType type, String... parameters) { + if (type == LutronCommandType.OUTPUT && parameters.length >= 2) { + if (getThing().getStatus() == ThingStatus.UNKNOWN) { + updateStatus(ThingStatus.ONLINE); + } + + if (ACTION_LIFTLEVEL.toString().equals(parameters[0])) { + BigDecimal liftLevel = new BigDecimal(parameters[1]); + logger.trace("Blind {} received lift level: {}", getIntegrationId(), liftLevel); + updateState(CHANNEL_BLINDLIFTLEVEL, new PercentType(liftLevel)); + } else if (ACTION_TILTLEVEL.toString().equals(parameters[0])) { + BigDecimal tiltLevel = new BigDecimal(parameters[1]); + logger.trace("Blind {} received tilt level: {}", getIntegrationId(), tiltLevel); + updateState(CHANNEL_BLINDTILTLEVEL, new PercentType(tiltLevel)); + } else if (ACTION_LIFTTILTLEVEL.toString().equals(parameters[0]) && parameters.length > 2) { + BigDecimal liftLevel = new BigDecimal(parameters[1]); + BigDecimal tiltLevel = new BigDecimal(parameters[2]); + logger.trace("Blind {} received lift/tilt level: {} {}", getIntegrationId(), liftLevel, tiltLevel); + updateState(CHANNEL_BLINDLIFTLEVEL, new PercentType(liftLevel)); + updateState(CHANNEL_BLINDTILTLEVEL, new PercentType(tiltLevel)); + } else if (ACTION_POSITION_UPDATE.toString().equals(parameters[0]) + && PARAMETER_POSITION_UPDATE.toString().equals(parameters[1]) && parameters.length >= 3) { + BigDecimal level = new BigDecimal(parameters[2]); + logger.trace("Blind {} received lift level position update: {}", getIntegrationId(), level); + updateState(CHANNEL_BLINDLIFTLEVEL, new PercentType(level)); + } + } + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/CcoHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/CcoHandler.java index 73df128cceb6e..5d16aa839aaef 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/CcoHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/CcoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/DimmerHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/DimmerHandler.java index 4c51034badfcb..3af58f922b10d 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/DimmerHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/DimmerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GrafikEyeKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GrafikEyeKeypadHandler.java index 6d9179f218c75..505a50f589bd3 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GrafikEyeKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GrafikEyeKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,11 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.Arrays; -import java.util.List; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; -import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigGrafikEye; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,155 +29,37 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class GrafikEyeKeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - BUTTON1(70, "button1", "Button 1"), // Scene button 1 - BUTTON2(71, "button2", "Button 2"), // Scene button 2 - BUTTON3(76, "button3", "Button 3"), // Scene button 3 - BUTTON4(77, "button4", "Button 4"), // Scene button 4 - BUTTON5(83, "button5", "Button 5"), // Scene button 5/Off - - BUTTON10(38, "button10", "Button 10"), // Col 1 - BUTTON11(39, "button11", "Button 11"), // Col 1 - BUTTON12(40, "button12", "Button 12"), // Col 1 - LOWER1(41, "buttonlower1", "Lower button col 1"), // Col 1 lower - RAISE1(47, "buttonraise1", "Raise button col 1"), // Col 1 raise - - BUTTON20(44, "button20", "Button 20"), // Col 2 - BUTTON21(45, "button21", "Button 21"), // Col 2 - BUTTON22(46, "button22", "Button 22"), // Col 2 - LOWER2(52, "buttonlower2", "Lower button col 2"), // Col 2 lower - RAISE2(53, "buttonraise2", "Raise button col 2"), // Col 2 raise - - BUTTON30(50, "button30", "Button 30"), // Col 3 - BUTTON31(51, "button31", "Button 31"), // Col 3 - BUTTON32(56, "button32", "Button 32"), // Col 3 - LOWER3(57, "buttonlower3", "Lower button col 3"), // Col 3 lower - RAISE3(58, "buttonraise3", "Raise button col 3"), // Col 3 raise - - CCI1(163, "cci1", "CCI 1"), - - LED1(201, "led1", "LED 1"), // Scene button LEDs - LED2(210, "led2", "LED 2"), - LED3(219, "led3", "LED 3"), - LED4(228, "led4", "LED 4"), - LED5(237, "led5", "LED 5"), - - LED10(174, "led10", "LED 10"), // Col 1 LEDs - LED11(175, "led11", "LED 11"), - LED12(211, "led12", "LED 12"), - - LED20(183, "led20", "LED 20"), // Col 2 LEDs - LED21(184, "led21", "LED 21"), - LED22(220, "led22", "LED 22"), - - LED30(192, "led30", "LED 30"), // Col 3 LEDs - LED31(193, "led31", "LED 31"), - LED32(229, "led32", "LED 32"); - - private final int id; - private final String channel; - private final String description; - - Component(int id, String channel, String description) { - this.id = id; - this.channel = channel; - this.description = description; - } - - @Override - public int id() { - return this.id; - } - - @Override - public String channel() { - return this.channel; - } - - @Override - public String description() { - return this.description; - } - - } - - private static final List<Component> SCENE_BUTTON_GROUP = Arrays.asList(Component.BUTTON1, Component.BUTTON2, - Component.BUTTON3, Component.BUTTON4, Component.BUTTON5); - private static final List<Component> SCENE_LED_GROUP = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, - Component.LED4, Component.LED5); - - private static final List<Component> CCI_GROUP = Arrays.asList(Component.CCI1); - - private static final List<Component> COL1_BUTTON_GROUP = Arrays.asList(Component.BUTTON10, Component.BUTTON11, - Component.BUTTON12, Component.LOWER1, Component.RAISE1); - private static final List<Component> COL2_BUTTON_GROUP = Arrays.asList(Component.BUTTON20, Component.BUTTON21, - Component.BUTTON22, Component.LOWER2, Component.RAISE2); - private static final List<Component> COL3_BUTTON_GROUP = Arrays.asList(Component.BUTTON30, Component.BUTTON31, - Component.BUTTON32, Component.LOWER3, Component.RAISE3); - - private static final List<Component> COL1_LED_GROUP = Arrays.asList(Component.LED10, Component.LED11, - Component.LED12); - private static final List<Component> COL2_LED_GROUP = Arrays.asList(Component.LED20, Component.LED21, - Component.LED22); - private static final List<Component> COL3_LED_GROUP = Arrays.asList(Component.LED30, Component.LED31, - Component.LED32); - private final Logger logger = LoggerFactory.getLogger(GrafikEyeKeypadHandler.class); @Override - protected boolean isLed(int id) { - return (id >= 174 && id <= 237); - } - - @Override - protected boolean isButton(int id) { - return (id >= 38 && id <= 83); - } - - @Override - protected boolean isCCI(int id) { - return (id == 163); - } - - @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { String mod = model == null ? "3COL" : model; logger.debug("Configuring components for GRAFIK Eye QS"); - buttonList.addAll(SCENE_BUTTON_GROUP); - ledList.addAll(SCENE_LED_GROUP); - cciList.addAll(CCI_GROUP); - switch (mod) { - default: - logger.warn("No valid keypad model defined ({}). Assuming model 3COL.", mod); case "3COL": - buttonList.addAll(COL1_BUTTON_GROUP); - buttonList.addAll(COL2_BUTTON_GROUP); - buttonList.addAll(COL3_BUTTON_GROUP); - ledList.addAll(COL1_LED_GROUP); - ledList.addAll(COL2_LED_GROUP); - ledList.addAll(COL3_LED_GROUP); - break; case "2COL": - buttonList.addAll(COL1_BUTTON_GROUP); - buttonList.addAll(COL2_BUTTON_GROUP); - ledList.addAll(COL1_LED_GROUP); - ledList.addAll(COL2_LED_GROUP); - break; case "1COL": - buttonList.addAll(COL1_BUTTON_GROUP); - ledList.addAll(COL1_LED_GROUP); - break; case "0COL": + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); + cciList = kp.getComponents(mod, ComponentType.CCI); + break; + default: + logger.warn("No valid keypad model defined ({}). Assuming model 3COL.", mod); + buttonList = kp.getComponents("3COL", ComponentType.BUTTON); + ledList = kp.getComponents("3COL", ComponentType.LED); + cciList = kp.getComponents("3COL", ComponentType.CCI); break; } } public GrafikEyeKeypadHandler(Thing thing) { super(thing); + kp = new KeypadConfigGrafikEye(); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GreenModeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GreenModeHandler.java index 43e8b719fcee4..aa33d80be1b91 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GreenModeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/GreenModeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java index 173d43d8d898e..1a1f728511747 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -78,6 +78,7 @@ public class IPBridgeHandler extends BaseBridgeHandler { private IPBridgeConfig config; private int reconnectInterval; private int heartbeatInterval; + private int sendDelay; private TelnetSession session; private BlockingQueue<LutronCommand> sendQueue = new LinkedBlockingQueue<>(); @@ -90,10 +91,6 @@ public class IPBridgeHandler extends BaseBridgeHandler { private Date lastDbUpdateDate; private LutronDeviceDiscoveryService discoveryService; - public LutronDeviceDiscoveryService getDiscoveryService() { - return discoveryService; - } - public void setDiscoveryService(LutronDeviceDiscoveryService discoveryService) { this.discoveryService = discoveryService; } @@ -138,6 +135,7 @@ public void initialize() { if (validConfiguration(this.config)) { reconnectInterval = (config.reconnect > 0) ? config.reconnect : DEFAULT_RECONNECT_MINUTES; heartbeatInterval = (config.heartbeat > 0) ? config.heartbeat : DEFAULT_HEARTBEAT_MINUTES; + sendDelay = (config.delay < 0) ? 0 : config.delay; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Connecting"); scheduler.submit(this::connect); // start the async connect task @@ -237,6 +235,9 @@ private void sendCommandsThread() { // reconnect() will start a new thread; terminate this one break; } + if (sendDelay > 0) { + Thread.sleep(sendDelay); // introduce delay to throttle send rate + } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); @@ -315,8 +316,12 @@ private LutronHandler findThingHandler(int integrationId) { if (thing.getHandler() instanceof LutronHandler) { LutronHandler handler = (LutronHandler) thing.getHandler(); - if (handler != null && handler.getIntegrationId() == integrationId) { - return handler; + try { + if (handler != null && handler.getIntegrationId() == integrationId) { + return handler; + } + } catch (IllegalStateException e) { + logger.trace("Handler for id {} not initialized", integrationId); } } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IntlKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IntlKeypadHandler.java index 98a6491322da6..16bfe6de1e12c 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IntlKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IntlKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.Arrays; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; -import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigIntlSeetouch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,135 +26,43 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class IntlKeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - BUTTON1(1, "button1", "Button 1"), - BUTTON2(2, "button2", "Button 2"), - BUTTON3(3, "button3", "Button 3"), - BUTTON4(4, "button4", "Button 4"), - BUTTON5(5, "button5", "Button 5"), - BUTTON6(6, "button6", "Button 6"), - BUTTON7(7, "button7", "Button 7"), - BUTTON8(8, "button8", "Button 8"), - BUTTON9(9, "button9", "Button 9"), - BUTTON10(10, "button10", "Button 10"), - - LOWER1(18, "buttonlower", "Lower button"), - RAISE1(19, "buttonraise", "Raise button"), - - CCI1(25, "cci1", ""), - CCI2(26, "cci2", ""), - - LED1(81, "led1", "LED 1"), - LED2(82, "led2", "LED 2"), - LED3(83, "led3", "LED 3"), - LED4(84, "led4", "LED 4"), - LED5(85, "led5", "LED 5"), - LED6(86, "led6", "LED 6"), - LED7(87, "led7", "LED 7"), - LED8(88, "led8", "LED 8"), - LED9(89, "led9", "LED 9"), - LED10(90, "led10", "LED 10"); - - private final int id; - private final String channel; - private final String description; - - Component(int id, String channel, String description) { - this.id = id; - this.channel = channel; - this.description = description; - } - - @Override - public int id() { - return id; - } - - @Override - public String channel() { - return channel; - } - - @Override - public String description() { - return description; - } - - } - private final Logger logger = LoggerFactory.getLogger(IntlKeypadHandler.class); @Override - protected boolean isLed(int id) { - return (id >= 81 && id <= 90); - } - - @Override - protected boolean isButton(int id) { - return ((id >= 1 && id <= 10) || (id >= 18 && id <= 19)); - } - - @Override - protected boolean isCCI(int id) { - return (id >= 25 && id <= 26); - } - - @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { String mod = model == null ? "Generic" : model; logger.debug("Configuring components for keypad model {}", model); - cciList.addAll(Arrays.asList(Component.CCI1, Component.CCI2)); - switch (mod) { case "2B": - buttonList.addAll(Arrays.asList(Component.BUTTON7, Component.BUTTON9)); - ledList.addAll(Arrays.asList(Component.LED7, Component.LED9)); - break; case "3B": - buttonList.addAll(Arrays.asList(Component.BUTTON6, Component.BUTTON8, Component.BUTTON10)); - ledList.addAll(Arrays.asList(Component.LED6, Component.LED8, Component.LED10)); - break; case "4B": - buttonList.addAll(Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON7, Component.BUTTON9)); - ledList.addAll(Arrays.asList(Component.LED2, Component.LED4, Component.LED7, Component.LED9)); - break; case "5BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10)); - buttonList.addAll(Arrays.asList(Component.LOWER1, Component.RAISE1)); - ledList.addAll(Arrays.asList(Component.LED6, Component.LED7, Component.LED8, Component.LED9, Component.LED10)); - break; case "6BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6, Component.BUTTON8, Component.BUTTON10)); - buttonList.addAll(Arrays.asList(Component.LOWER1, Component.RAISE1)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED3, Component.LED5, Component.LED6, Component.LED8, Component.LED10)); - break; case "7BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10)); - buttonList.addAll(Arrays.asList(Component.LOWER1, Component.RAISE1)); - ledList.addAll(Arrays.asList(Component.LED2, Component.LED4, Component.LED6, Component.LED7, Component.LED8, Component.LED9, Component.LED10)); - break; case "8BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10)); - buttonList.addAll(Arrays.asList(Component.LOWER1, Component.RAISE1)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED3, Component.LED5, Component.LED6, Component.LED7, Component.LED8, Component.LED9, Component.LED10)); + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); + cciList = kp.getComponents(mod, ComponentType.CCI); break; default: logger.warn("No valid keypad model defined ({}). Assuming 10BRL model.", mod); // fall through case "Generic": case "10BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10)); - buttonList.addAll(Arrays.asList(Component.LOWER1, Component.RAISE1)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7, Component.LED8, Component.LED9, Component.LED10)); + buttonList = kp.getComponents("10BRL", ComponentType.BUTTON); + ledList = kp.getComponents("10BRL", ComponentType.LED); + cciList = kp.getComponents("10BRL", ComponentType.CCI); break; } } public IntlKeypadHandler(Thing thing) { super(thing); + kp = new KeypadConfigIntlSeetouch(); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/KeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/KeypadHandler.java index af5135647df27..37d112542149d 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/KeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/KeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.Arrays; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; -import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigSeetouch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,79 +26,13 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class KeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - BUTTON1(1, "button1", "Button 1"), - BUTTON2(2, "button2", "Button 2"), - BUTTON3(3, "button3", "Button 3"), - BUTTON4(4, "button4", "Button 4"), - BUTTON5(5, "button5", "Button 5"), - BUTTON6(6, "button6", "Button 6"), - BUTTON7(7, "button7", "Button 7"), - - LOWER1(16, "buttontoplower", "Top lower button"), - RAISE1(17, "buttontopraise", "Top raise button"), - LOWER2(18, "buttonbottomlower", "Bottom lower button"), - RAISE2(19, "buttonbottomraise", "Bottom raise button"), - - // CCI1(25, "cci1", ""), // listed in spec but currently unused in binding - // CCI2(26, "cci2", ""), // listed in spec but currently unused in binding - - LED1(81, "led1", "LED 1"), - LED2(82, "led2", "LED 2"), - LED3(83, "led3", "LED 3"), - LED4(84, "led4", "LED 4"), - LED5(85, "led5", "LED 5"), - LED6(86, "led6", "LED 6"), - LED7(87, "led7", "LED 7"); - - private final int id; - private final String channel; - private final String description; - - Component(int id, String channel, String description) { - this.id = id; - this.channel = channel; - this.description = description; - } - - @Override - public int id() { - return id; - } - - @Override - public String channel() { - return channel; - } - - @Override - public String description() { - return description; - } - - } - private final Logger logger = LoggerFactory.getLogger(KeypadHandler.class); @Override - protected boolean isLed(int id) { - return (id >= 81 && id <= 87); - } - - @Override - protected boolean isButton(int id) { - return ((id >= 1 && id <= 7) || (id >= 16 && id <= 19)); - } - - @Override - protected boolean isCCI(int id) { - return false; - } - - @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { String mod = model == null ? "Generic" : model; logger.debug("Configuring components for keypad model {}", model); @@ -105,97 +40,72 @@ protected void configureComponents(String model) { case "W1RLD": case "H1RLD": case "HN1RLD": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON5, Component.BUTTON6)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll( - Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED5, Component.LED6)); + buttonList = kp.getComponents("W1RLD", ComponentType.BUTTON); + ledList = kp.getComponents("W1RLD", ComponentType.LED); break; case "W2RLD": case "H2RLD": case "HN2RLD": - buttonList.addAll( - Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON5, Component.BUTTON6)); - buttonList - .addAll(Arrays.asList(Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED5, Component.LED6)); + buttonList = kp.getComponents("W2RLD", ComponentType.BUTTON); + ledList = kp.getComponents("W2RLD", ComponentType.LED); break; case "W3S": case "H3S": case "HN3S": - buttonList.addAll( - Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON6)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED6)); + buttonList = kp.getComponents("W3S", ComponentType.BUTTON); + ledList = kp.getComponents("W3S", ComponentType.LED); + break; case "W3BD": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON5, Component.BUTTON6, Component.BUTTON7)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED5, - Component.LED6, Component.LED7)); + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); break; case "W3BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON2, Component.BUTTON3, Component.BUTTON4)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED2, Component.LED3, Component.LED4)); + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); break; case "W3BSRL": case "H3BSRL": case "HN3BSRL": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED3, Component.LED5)); + buttonList = kp.getComponents("W3BSRL", ComponentType.BUTTON); + ledList = kp.getComponents("W3BSRL", ComponentType.LED); break; case "W4S": case "H4S": case "HN4S": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON4, Component.BUTTON6)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll( - Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, Component.LED6)); + buttonList = kp.getComponents("W4S", ComponentType.BUTTON); + ledList = kp.getComponents("W4S", ComponentType.LED); break; case "W5BRL": case "H5BRL": case "HN5BRL": case "W5BRLIR": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON4, Component.BUTTON5)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll( - Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, Component.LED5)); + buttonList = kp.getComponents("W5BRL", ComponentType.BUTTON); + ledList = kp.getComponents("W5BRL", ComponentType.LED); break; case "W6BRL": case "H6BRL": case "HN6BRL": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON4, Component.BUTTON5, Component.BUTTON6)); - buttonList.addAll(Arrays.asList(Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, - Component.LED5, Component.LED6)); + buttonList = kp.getComponents("W6BRL", ComponentType.BUTTON); + ledList = kp.getComponents("W6BRL", ComponentType.LED); break; case "W7B": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, - Component.LED5, Component.LED6, Component.LED7)); + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); break; default: logger.warn("No valid keypad model defined ({}). Assuming Generic model.", mod); // fall through case "Generic": - buttonList.addAll(Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, - Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7)); - buttonList - .addAll(Arrays.asList(Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2)); - ledList.addAll(Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, - Component.LED5, Component.LED6, Component.LED7)); + buttonList = kp.getComponents("Generic", ComponentType.BUTTON); + ledList = kp.getComponents("Generic", ComponentType.LED); break; } } public KeypadHandler(Thing thing) { super(thing); + kp = new KeypadConfigSeetouch(); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LutronHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LutronHandler.java index 02ddbe3bd9c18..2f40d699bafdc 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LutronHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LutronHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/MaintainedCcoHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/MaintainedCcoHandler.java index 2cf0f7d36d25b..b4a6db1551c8d 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/MaintainedCcoHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/MaintainedCcoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/OccupancySensorHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/OccupancySensorHandler.java index 3c63caeced620..37a1b8f4fea59 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/OccupancySensorHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/OccupancySensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PalladiomKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PalladiomKeypadHandler.java new file mode 100644 index 0000000000000..082f6951affc6 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PalladiomKeypadHandler.java @@ -0,0 +1,71 @@ +/** + * 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.lutron.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Thing; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigPalladiom; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Handler responsible for communicating with Lutron Palladiom keypads used in + * Homeworks QS systems + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public class PalladiomKeypadHandler extends BaseKeypadHandler { + + private final Logger logger = LoggerFactory.getLogger(PalladiomKeypadHandler.class); + + @Override + protected void configureComponents(@Nullable String model) { + String mod = model == null ? "Generic" : model; + logger.debug("Configuring components for keypad model {}", model); + + switch (mod) { + case "2W": + case "3W": + case "4W": + case "RW": + case "22W": + case "24W": + case "42W": + case "44W": + case "2RW": + case "4RW": + case "RRW": + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); + cciList = kp.getComponents(mod, ComponentType.CCI); + break; + default: + logger.warn("No valid keypad model defined ({}). Assuming Generic setting.", mod); + // fall through + case "Generic": + buttonList = kp.getComponents("Generic", ComponentType.BUTTON); + ledList = kp.getComponents("Generic", ComponentType.LED); + cciList = kp.getComponents("Generic", ComponentType.CCI); + break; + } + } + + public PalladiomKeypadHandler(Thing thing) { + super(thing); + kp = new KeypadConfigPalladiom(); + } + +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PicoKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PicoKeypadHandler.java index 5b9c24f6291f3..b32787ee8ef94 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PicoKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PicoKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.Arrays; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; -import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigPico; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,96 +25,34 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class PicoKeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - // Buttons for 2B, 2BRL, 3B, and 3BRL models - BUTTON1(2, "button1", "Button 1"), - BUTTON2(3, "button2", "Button 2"), - BUTTON3(4, "button3", "Button 3"), - - RAISE(5, "buttonraise", "Raise Button"), - LOWER(6, "buttonlower", "Lower Button"), - - // Buttons for PJ2-4B model - BUTTON1_4B(8, "button01", "Button 1"), - BUTTON2_4B(9, "button02", "Button 2"), - BUTTON3_4B(10, "button03", "Button 3"), - BUTTON4_4B(11, "button04", "Button 4"); - - private final int id; - private final String channel; - private final String description; - - Component(int id, String channel, String description) { - this.id = id; - this.channel = channel; - this.description = description; - } - - @Override - public int id() { - return id; - } - - @Override - public String channel() { - return channel; - } - - @Override - public String description() { - return description; - } - } - private final Logger logger = LoggerFactory.getLogger(PicoKeypadHandler.class); public PicoKeypadHandler(Thing thing) { super(thing); + kp = new KeypadConfigPico(); } @Override - protected boolean isLed(int id) { - return false; // No LEDs on Picos - } - - @Override - protected boolean isButton(int id) { - return (id >= 2 && id <= 11); - } - - @Override - protected boolean isCCI(int id) { - return false; - } - - @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { String mod = model == null ? "Generic" : model; logger.debug("Configuring components for keypad model {}", mod); switch (mod) { case "2B": - buttonList = Arrays.asList(Component.BUTTON1, Component.BUTTON3); - break; case "2BRL": - buttonList = Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.RAISE, Component.LOWER); - break; case "3B": - buttonList = Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3); - break; case "4B": - buttonList = Arrays.asList(Component.BUTTON1_4B, Component.BUTTON2_4B, Component.BUTTON3_4B, - Component.BUTTON4_4B); + buttonList = kp.getComponents(mod, ComponentType.BUTTON); break; default: logger.warn("No valid keypad model defined ({}). Assuming model 3BRL.", mod); // fall through case "Generic": case "3BRL": - buttonList = Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.RAISE, - Component.LOWER); + buttonList = kp.getComponents("3BRL", ComponentType.BUTTON); break; } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PulsedCcoHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PulsedCcoHandler.java index b9091b0e3de37..5594208912d51 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PulsedCcoHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/PulsedCcoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/QSIOHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/QSIOHandler.java index f7006f01b9a41..d879cb0aef41a 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/QSIOHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/QSIOHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,8 +14,11 @@ import java.util.Arrays; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,23 +27,26 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class QSIOHandler extends BaseKeypadHandler { private static enum Component implements KeypadComponent { - CCI1(1, "cci1", "CCI 1"), - CCI2(2, "cci2", "CCI 2"), - CCI3(3, "cci3", "CCI 3"), - CCI4(4, "cci4", "CCI 4"), - CCI5(5, "cci5", "CCI 5"); + CCI1(1, "cci1", "CCI 1", ComponentType.CCI), + CCI2(2, "cci2", "CCI 2", ComponentType.CCI), + CCI3(3, "cci3", "CCI 3", ComponentType.CCI), + CCI4(4, "cci4", "CCI 4", ComponentType.CCI), + CCI5(5, "cci5", "CCI 5", ComponentType.CCI); private final int id; private final String channel; private final String description; + private final ComponentType type; - Component(int id, String channel, String description) { + Component(int id, String channel, String description, ComponentType type) { this.id = id; this.channel = channel; this.description = description; + this.type = type; } @Override @@ -58,6 +64,10 @@ public String description() { return this.description; } + @Override + public ComponentType type() { + return type; + } } private final Logger logger = LoggerFactory.getLogger(QSIOHandler.class); @@ -78,7 +88,7 @@ protected boolean isCCI(int id) { } @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { logger.debug("Configuring components for VCRX"); cciList.addAll(Arrays.asList(Component.CCI1, Component.CCI2, Component.CCI3, Component.CCI4, Component.CCI5)); diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/ShadeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/ShadeHandler.java index ea462c19510a5..3b4ee1e3533fa 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/ShadeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/ShadeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -40,6 +40,8 @@ public class ShadeHandler extends LutronHandler { private static final Integer ACTION_STARTRAISING = 2; private static final Integer ACTION_STARTLOWERING = 3; private static final Integer ACTION_STOP = 4; + private static final Integer ACTION_POSITION_UPDATE = 32; // undocumented in integration protocol guide + private static final Integer PARAMETER_POSITION_UPDATE = 2; // undocumented in integration protocol guide private final Logger logger = LoggerFactory.getLogger(ShadeHandler.class); @@ -109,13 +111,20 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void handleUpdate(LutronCommandType type, String... parameters) { - if (type == LutronCommandType.OUTPUT && parameters.length >= 2 - && ACTION_ZONELEVEL.toString().equals(parameters[0])) { - BigDecimal level = new BigDecimal(parameters[1]); - if (getThing().getStatus() == ThingStatus.UNKNOWN) { - updateStatus(ThingStatus.ONLINE); + if (type == LutronCommandType.OUTPUT && parameters.length >= 2) { + if (ACTION_ZONELEVEL.toString().equals(parameters[0])) { + BigDecimal level = new BigDecimal(parameters[1]); + if (getThing().getStatus() == ThingStatus.UNKNOWN) { + updateStatus(ThingStatus.ONLINE); + } + logger.trace("Shade {} received zone level: {}", getIntegrationId(), level); + updateState(CHANNEL_SHADELEVEL, new PercentType(level)); + } else if (ACTION_POSITION_UPDATE.toString().equals(parameters[0]) + && PARAMETER_POSITION_UPDATE.toString().equals(parameters[1]) && parameters.length >= 3) { + BigDecimal level = new BigDecimal(parameters[2]); + logger.trace("Shade {} received position update: {}", getIntegrationId(), level); + updateState(CHANNEL_SHADELEVEL, new PercentType(level)); } - updateState(CHANNEL_SHADELEVEL, new PercentType(level)); } } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/SwitchHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/SwitchHandler.java index 1432e595246f0..7694668fa8dcc 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/SwitchHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/SwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TabletopKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TabletopKeypadHandler.java index 02edbcde28451..c4d15e2f45ed6 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TabletopKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TabletopKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,11 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.Arrays; -import java.util.List; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; -import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.openhab.binding.lutron.internal.keypadconfig.KeypadConfigTabletopSeetouch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,162 +26,40 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class TabletopKeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - BUTTON1(1, "button1", "Button 1"), - BUTTON2(2, "button2", "Button 2"), - BUTTON3(3, "button3", "Button 3"), - BUTTON4(4, "button4", "Button 4"), - BUTTON5(5, "button5", "Button 5"), - BUTTON6(6, "button6", "Button 6"), - BUTTON7(7, "button7", "Button 7"), - BUTTON8(8, "button8", "Button 8"), - BUTTON9(9, "button9", "Button 9"), - BUTTON10(10, "button10", "Button 10"), - BUTTON11(11, "button11", "Button 11"), - BUTTON12(12, "button12", "Button 12"), - BUTTON13(13, "button13", "Button 13"), - BUTTON14(14, "button14", "Button 14"), - BUTTON15(15, "button15", "Button 15"), - - BUTTON16(16, "button16", "Button 16"), - BUTTON17(17, "button17", "Button 17"), - - LOWER1(20, "buttonlower1", "Lower button 1"), - RAISE1(21, "buttonraise1", "Raise button 1"), - LOWER2(22, "buttonlower2", "Lower button 2"), - RAISE2(23, "buttonraise2", "Raise button 2"), - LOWER3(24, "buttonlower3", "Lower button 3"), - RAISE3(25, "buttonraise3", "Raise button 3"), - - LED1(81, "led1", "LED 1"), - LED2(82, "led2", "LED 2"), - LED3(83, "led3", "LED 3"), - LED4(84, "led4", "LED 4"), - LED5(85, "led5", "LED 5"), - LED6(86, "led6", "LED 6"), - LED7(87, "led7", "LED 7"), - LED8(88, "led8", "LED 8"), - LED9(89, "led9", "LED 9"), - LED10(90, "led10", "LED 10"), - LED11(91, "led11", "LED 11"), - LED12(92, "led12", "LED 12"), - LED13(93, "led13", "LED 13"), - LED14(94, "led14", "LED 14"), - LED15(95, "led15", "LED 15"), - - LED16(96, "led16", "LED 16"), - LED17(97, "led17", "LED 17"); - - private final int id; - private final String channel; - private final String description; - - Component(int id, String channel, String description) { - this.id = id; - this.channel = channel; - this.description = description; - } - - @Override - public int id() { - return id; - } - - @Override - public String channel() { - return channel; - } - - @Override - public String description() { - return description; - } - - } - - private static final List<Component> buttonGroup1 = Arrays.asList(Component.BUTTON1, Component.BUTTON2, - Component.BUTTON3, Component.BUTTON4, Component.BUTTON5); - private static final List<Component> buttonGroup2 = Arrays.asList(Component.BUTTON6, Component.BUTTON7, - Component.BUTTON8, Component.BUTTON9, Component.BUTTON10); - private static final List<Component> buttonGroup3 = Arrays.asList(Component.BUTTON11, Component.BUTTON12, - Component.BUTTON13, Component.BUTTON14, Component.BUTTON15); - - private static final List<Component> buttonsBottomRL = Arrays.asList(Component.BUTTON16, Component.BUTTON17, - Component.LOWER3, Component.RAISE3); - private static final List<Component> buttonsBottomCRL = Arrays.asList(Component.LOWER1, Component.RAISE1, - Component.LOWER2, Component.RAISE2, Component.LOWER3, Component.RAISE3); - - private static final List<Component> ledGroup1 = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, - Component.LED4, Component.LED5); - private static final List<Component> ledGroup2 = Arrays.asList(Component.LED6, Component.LED7, Component.LED8, - Component.LED9, Component.LED10); - private static final List<Component> ledGroup3 = Arrays.asList(Component.LED11, Component.LED12, Component.LED13, - Component.LED14, Component.LED15); - - private static final List<Component> LedsBottomRL = Arrays.asList(Component.LED16, Component.LED17); - private final Logger logger = LoggerFactory.getLogger(TabletopKeypadHandler.class); @Override - protected boolean isLed(int id) { - return (id >= 81 && id <= 95); - } - - @Override - protected boolean isButton(int id) { - return (id >= 1 && id <= 25); - } - - @Override - protected boolean isCCI(int id) { - return false; - } - - @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { String mod = model == null ? "Generic" : model; logger.debug("Configuring components for keypad model {}", model); switch (mod) { - default: - logger.warn("No valid keypad model defined ({}). Assuming model T15RL.", mod); - // fall through - case "Generic": - case "T15RL": - buttonList.addAll(buttonGroup3); - ledList.addAll(ledGroup3); - // fall through - case "T10RL": - buttonList.addAll(buttonGroup2); - ledList.addAll(ledGroup2); - // fall through case "T5RL": - buttonList.addAll(buttonGroup1); - buttonList.addAll(buttonsBottomRL); - ledList.addAll(ledGroup1); - ledList.addAll(LedsBottomRL); + case "T10RL": + case "T15RL": + case "T5CRL": + case "T10CRL": + case "T15CRL": + buttonList = kp.getComponents(mod, ComponentType.BUTTON); + ledList = kp.getComponents(mod, ComponentType.LED); break; - case "T15CRL": - buttonList.addAll(buttonGroup3); - ledList.addAll(ledGroup3); - // fall through - case "T10CRL": - buttonList.addAll(buttonGroup2); - ledList.addAll(ledGroup2); + default: + logger.warn("No valid keypad model defined ({}). Assuming model T15RL.", mod); // fall through - case "T5CRL": - buttonList.addAll(buttonGroup1); - buttonList.addAll(buttonsBottomCRL); - ledList.addAll(ledGroup1); + case "Generic": + buttonList = kp.getComponents("Generic", ComponentType.BUTTON); + ledList = kp.getComponents("Generic", ComponentType.LED); break; } } public TabletopKeypadHandler(Thing thing) { super(thing); + kp = new KeypadConfigTabletopSeetouch(); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TimeclockHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TimeclockHandler.java index efa84b81a9559..44af748aa8db4 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TimeclockHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/TimeclockHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VcrxHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VcrxHandler.java index 388675fba074a..08c8d2834e2bf 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VcrxHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VcrxHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,8 +15,11 @@ import java.util.Arrays; import java.util.List; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,36 +28,39 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class VcrxHandler extends BaseKeypadHandler { private static enum Component implements KeypadComponent { - BUTTON1(1, "button1", "Button 1"), - BUTTON2(2, "button2", "Button 2"), - BUTTON3(3, "button3", "Button 3"), - BUTTON4(4, "button4", "Button 4"), - BUTTON5(5, "button5", "Button 5"), - BUTTON6(6, "button6", "Button 6"), - - CCI1(30, "cci1", "CCI 1"), - CCI2(31, "cci2", "CCI 2"), - CCI3(32, "cci3", "CCI 3"), - CCI4(33, "cci4", "CCI 4"), - - LED1(81, "led1", "LED 1"), - LED2(82, "led2", "LED 2"), - LED3(83, "led3", "LED 3"), - LED4(84, "led4", "LED 4"), - LED5(85, "led5", "LED 5"), - LED6(86, "led6", "LED 6"); + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + + CCI1(30, "cci1", "CCI 1", ComponentType.CCI), + CCI2(31, "cci2", "CCI 2", ComponentType.CCI), + CCI3(32, "cci3", "CCI 3", ComponentType.CCI), + CCI4(33, "cci4", "CCI 4", ComponentType.CCI), + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED); private final int id; private final String channel; private final String description; + private final ComponentType type; - Component(int id, String channel, String description) { + Component(int id, String channel, String description, ComponentType type) { this.id = id; this.channel = channel; this.description = description; + this.type = type; } @Override @@ -72,15 +78,19 @@ public String description() { return this.description; } + @Override + public ComponentType type() { + return type; + } } - private static final List<Component> buttonGroup = Arrays.asList(Component.BUTTON1, Component.BUTTON2, + private static final List<Component> BUTTONGROUP = Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, Component.BUTTON5, Component.BUTTON6); - private static final List<Component> ledGroup = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, + private static final List<Component> LEDGROUP = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, Component.LED4, Component.LED5, Component.LED6); - private static final List<Component> cciGroup = Arrays.asList(Component.CCI1, Component.CCI2, Component.CCI3, + private static final List<Component> CCIGROUP = Arrays.asList(Component.CCI1, Component.CCI2, Component.CCI3, Component.CCI4); private final Logger logger = LoggerFactory.getLogger(VcrxHandler.class); @@ -101,12 +111,12 @@ protected boolean isCCI(int id) { } @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { logger.debug("Configuring components for VCRX"); - buttonList.addAll(buttonGroup); - ledList.addAll(ledGroup); - cciList.addAll(cciGroup); + buttonList.addAll(BUTTONGROUP); + ledList.addAll(LEDGROUP); + cciList.addAll(CCIGROUP); } public VcrxHandler(Thing thing) { diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VirtualKeypadHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VirtualKeypadHandler.java index 53c62008b29f9..56bf19d0f2025 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VirtualKeypadHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/VirtualKeypadHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,11 @@ */ package org.openhab.binding.lutron.internal.handler; -import java.util.EnumSet; - +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Thing; import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,219 +25,20 @@ * * @author Bob Adair - Initial contribution */ +@NonNullByDefault public class VirtualKeypadHandler extends BaseKeypadHandler { - private static enum Component implements KeypadComponent { - BUTTON1(1, "button1", "Virtual button"), - BUTTON2(2, "button2", "Virtual button"), - BUTTON3(3, "button3", "Virtual button"), - BUTTON4(4, "button4", "Virtual button"), - BUTTON5(5, "button5", "Virtual button"), - BUTTON6(6, "button6", "Virtual button"), - BUTTON7(7, "button7", "Virtual button"), - BUTTON8(8, "button8", "Virtual button"), - BUTTON9(9, "button9", "Virtual button"), - BUTTON10(10, "button10", "Virtual button"), - BUTTON11(11, "button11", "Virtual button"), - BUTTON12(12, "button12", "Virtual button"), - BUTTON13(13, "button13", "Virtual button"), - BUTTON14(14, "button14", "Virtual button"), - BUTTON15(15, "button15", "Virtual button"), - BUTTON16(16, "button16", "Virtual button"), - BUTTON17(17, "button17", "Virtual button"), - BUTTON18(18, "button18", "Virtual button"), - BUTTON19(19, "button19", "Virtual button"), - BUTTON20(20, "button20", "Virtual button"), - BUTTON21(21, "button21", "Virtual button"), - BUTTON22(22, "button22", "Virtual button"), - BUTTON23(23, "button23", "Virtual button"), - BUTTON24(24, "button24", "Virtual button"), - BUTTON25(25, "button25", "Virtual button"), - BUTTON26(26, "button26", "Virtual button"), - BUTTON27(27, "button27", "Virtual button"), - BUTTON28(28, "button28", "Virtual button"), - BUTTON29(29, "button29", "Virtual button"), - BUTTON30(30, "button30", "Virtual button"), - BUTTON31(31, "button31", "Virtual button"), - BUTTON32(32, "button32", "Virtual button"), - BUTTON33(33, "button33", "Virtual button"), - BUTTON34(34, "button34", "Virtual button"), - BUTTON35(35, "button35", "Virtual button"), - BUTTON36(36, "button36", "Virtual button"), - BUTTON37(37, "button37", "Virtual button"), - BUTTON38(38, "button38", "Virtual button"), - BUTTON39(39, "button39", "Virtual button"), - BUTTON40(40, "button40", "Virtual button"), - BUTTON41(41, "button41", "Virtual button"), - BUTTON42(42, "button42", "Virtual button"), - BUTTON43(43, "button43", "Virtual button"), - BUTTON44(44, "button44", "Virtual button"), - BUTTON45(45, "button45", "Virtual button"), - BUTTON46(46, "button46", "Virtual button"), - BUTTON47(47, "button47", "Virtual button"), - BUTTON48(48, "button48", "Virtual button"), - BUTTON49(49, "button49", "Virtual button"), - BUTTON50(50, "button50", "Virtual button"), - BUTTON51(51, "button51", "Virtual button"), - BUTTON52(52, "button52", "Virtual button"), - BUTTON53(53, "button53", "Virtual button"), - BUTTON54(54, "button54", "Virtual button"), - BUTTON55(55, "button55", "Virtual button"), - BUTTON56(56, "button56", "Virtual button"), - BUTTON57(57, "button57", "Virtual button"), - BUTTON58(58, "button58", "Virtual button"), - BUTTON59(59, "button59", "Virtual button"), - BUTTON60(60, "button60", "Virtual button"), - BUTTON61(61, "button61", "Virtual button"), - BUTTON62(62, "button62", "Virtual button"), - BUTTON63(63, "button63", "Virtual button"), - BUTTON64(64, "button64", "Virtual button"), - BUTTON65(65, "button65", "Virtual button"), - BUTTON66(66, "button66", "Virtual button"), - BUTTON67(67, "button67", "Virtual button"), - BUTTON68(68, "button68", "Virtual button"), - BUTTON69(69, "button69", "Virtual button"), - BUTTON70(70, "button70", "Virtual button"), - BUTTON71(71, "button71", "Virtual button"), - BUTTON72(72, "button72", "Virtual button"), - BUTTON73(73, "button73", "Virtual button"), - BUTTON74(74, "button74", "Virtual button"), - BUTTON75(75, "button75", "Virtual button"), - BUTTON76(76, "button76", "Virtual button"), - BUTTON77(77, "button77", "Virtual button"), - BUTTON78(78, "button78", "Virtual button"), - BUTTON79(79, "button79", "Virtual button"), - BUTTON80(80, "button80", "Virtual button"), - BUTTON81(81, "button81", "Virtual button"), - BUTTON82(82, "button82", "Virtual button"), - BUTTON83(83, "button83", "Virtual button"), - BUTTON84(84, "button84", "Virtual button"), - BUTTON85(85, "button85", "Virtual button"), - BUTTON86(86, "button86", "Virtual button"), - BUTTON87(87, "button87", "Virtual button"), - BUTTON88(88, "button88", "Virtual button"), - BUTTON89(89, "button89", "Virtual button"), - BUTTON90(90, "button90", "Virtual button"), - BUTTON91(91, "button91", "Virtual button"), - BUTTON92(92, "button92", "Virtual button"), - BUTTON93(93, "button93", "Virtual button"), - BUTTON94(94, "button94", "Virtual button"), - BUTTON95(95, "button95", "Virtual button"), - BUTTON96(96, "button96", "Virtual button"), - BUTTON97(97, "button97", "Virtual button"), - BUTTON98(98, "button98", "Virtual button"), - BUTTON99(99, "button99", "Virtual button"), - BUTTON100(100, "button100", "Virtual button"), - - LED1(101, "led1", "Virtual LED"), - LED2(102, "led2", "Virtual LED"), - LED3(103, "led3", "Virtual LED"), - LED4(104, "led4", "Virtual LED"), - LED5(105, "led5", "Virtual LED"), - LED6(106, "led6", "Virtual LED"), - LED7(107, "led7", "Virtual LED"), - LED8(108, "led8", "Virtual LED"), - LED9(109, "led9", "Virtual LED"), - LED10(110, "led10", "Virtual LED"), - LED11(111, "led11", "Virtual LED"), - LED12(112, "led12", "Virtual LED"), - LED13(113, "led13", "Virtual LED"), - LED14(114, "led14", "Virtual LED"), - LED15(115, "led15", "Virtual LED"), - LED16(116, "led16", "Virtual LED"), - LED17(117, "led17", "Virtual LED"), - LED18(118, "led18", "Virtual LED"), - LED19(119, "led19", "Virtual LED"), - LED20(120, "led20", "Virtual LED"), - LED21(121, "led21", "Virtual LED"), - LED22(122, "led22", "Virtual LED"), - LED23(123, "led23", "Virtual LED"), - LED24(124, "led24", "Virtual LED"), - LED25(125, "led25", "Virtual LED"), - LED26(126, "led26", "Virtual LED"), - LED27(127, "led27", "Virtual LED"), - LED28(128, "led28", "Virtual LED"), - LED29(129, "led29", "Virtual LED"), - LED30(130, "led30", "Virtual LED"), - LED31(131, "led31", "Virtual LED"), - LED32(132, "led32", "Virtual LED"), - LED33(133, "led33", "Virtual LED"), - LED34(134, "led34", "Virtual LED"), - LED35(135, "led35", "Virtual LED"), - LED36(136, "led36", "Virtual LED"), - LED37(137, "led37", "Virtual LED"), - LED38(138, "led38", "Virtual LED"), - LED39(139, "led39", "Virtual LED"), - LED40(140, "led40", "Virtual LED"), - LED41(141, "led41", "Virtual LED"), - LED42(142, "led42", "Virtual LED"), - LED43(143, "led43", "Virtual LED"), - LED44(144, "led44", "Virtual LED"), - LED45(145, "led45", "Virtual LED"), - LED46(146, "led46", "Virtual LED"), - LED47(147, "led47", "Virtual LED"), - LED48(148, "led48", "Virtual LED"), - LED49(149, "led49", "Virtual LED"), - LED50(150, "led50", "Virtual LED"), - LED51(151, "led51", "Virtual LED"), - LED52(152, "led52", "Virtual LED"), - LED53(153, "led53", "Virtual LED"), - LED54(154, "led54", "Virtual LED"), - LED55(155, "led55", "Virtual LED"), - LED56(156, "led56", "Virtual LED"), - LED57(157, "led57", "Virtual LED"), - LED58(158, "led58", "Virtual LED"), - LED59(159, "led59", "Virtual LED"), - LED60(160, "led60", "Virtual LED"), - LED61(161, "led61", "Virtual LED"), - LED62(162, "led62", "Virtual LED"), - LED63(163, "led63", "Virtual LED"), - LED64(164, "led64", "Virtual LED"), - LED65(165, "led65", "Virtual LED"), - LED66(166, "led66", "Virtual LED"), - LED67(167, "led67", "Virtual LED"), - LED68(168, "led68", "Virtual LED"), - LED69(169, "led69", "Virtual LED"), - LED70(170, "led70", "Virtual LED"), - LED71(171, "led71", "Virtual LED"), - LED72(172, "led72", "Virtual LED"), - LED73(173, "led73", "Virtual LED"), - LED74(174, "led74", "Virtual LED"), - LED75(175, "led75", "Virtual LED"), - LED76(176, "led76", "Virtual LED"), - LED77(177, "led77", "Virtual LED"), - LED78(178, "led78", "Virtual LED"), - LED79(179, "led79", "Virtual LED"), - LED80(180, "led80", "Virtual LED"), - LED81(181, "led81", "Virtual LED"), - LED82(182, "led82", "Virtual LED"), - LED83(183, "led83", "Virtual LED"), - LED84(184, "led84", "Virtual LED"), - LED85(185, "led85", "Virtual LED"), - LED86(186, "led86", "Virtual LED"), - LED87(187, "led87", "Virtual LED"), - LED88(188, "led88", "Virtual LED"), - LED89(189, "led89", "Virtual LED"), - LED90(190, "led90", "Virtual LED"), - LED91(191, "led91", "Virtual LED"), - LED92(192, "led92", "Virtual LED"), - LED93(193, "led93", "Virtual LED"), - LED94(194, "led94", "Virtual LED"), - LED95(195, "led95", "Virtual LED"), - LED96(196, "led96", "Virtual LED"), - LED97(197, "led97", "Virtual LED"), - LED98(198, "led98", "Virtual LED"), - LED99(199, "led99", "Virtual LED"), - LED100(200, "led100", "Virtual LED"); - + private class Component implements KeypadComponent { private final int id; private final String channel; private final String description; + private final ComponentType type; - Component(int id, String channel, String description) { + Component(int id, String channel, String description, ComponentType type) { this.id = id; this.channel = channel; this.description = description; + this.type = type; } @Override @@ -254,6 +56,10 @@ public String description() { return description; } + @Override + public ComponentType type() { + return type; + } } private final Logger logger = LoggerFactory.getLogger(VirtualKeypadHandler.class); @@ -274,16 +80,12 @@ protected boolean isCCI(int id) { } @Override - protected void configureComponents(String model) { + protected void configureComponents(@Nullable String model) { logger.debug("Configuring components for virtual keypad"); - for (Component x : EnumSet.allOf(Component.class)) { - if (isLed(x.id)) { - ledList.add(x); - } - if (isButton(x.id)) { - buttonList.add(x); - } + for (int x = 1; x <= 100; x++) { + buttonList.add(new Component(x, String.format("button%d", x), "Virtual Button", ComponentType.BUTTON)); + ledList.add(new Component(x + 100, String.format("led%d", x), "Virtual LED", ComponentType.LED)); } } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/WciHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/WciHandler.java new file mode 100644 index 0000000000000..555246d8ff42e --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/WciHandler.java @@ -0,0 +1,122 @@ +/** + * 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.lutron.internal.handler; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Thing; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Handler responsible for communicating with the Lutron Wallbox Input Closure Interface (WCI) + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public class WciHandler extends BaseKeypadHandler { + + private static enum Component implements KeypadComponent { + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON), + BUTTON8(8, "button8", "Button 8", ComponentType.BUTTON), + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED), + LED7(87, "led7", "LED 7", ComponentType.LED), + LED8(88, "led8", "LED 8", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return this.id; + } + + @Override + public String channel() { + return this.channel; + } + + @Override + public String description() { + return this.description; + } + + @Override + public ComponentType type() { + return type; + } + } + + private static final List<KeypadComponent> BUTTON_LIST = Arrays.asList(Component.BUTTON1, Component.BUTTON2, + Component.BUTTON3, Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, + Component.BUTTON8); + + private static final List<KeypadComponent> LED_LIST = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, + Component.LED4, Component.LED5, Component.LED6, Component.LED7, Component.LED8); + + private final Logger logger = LoggerFactory.getLogger(WciHandler.class); + + @Override + protected boolean isLed(int id) { + return (id >= 81 && id <= 88); + } + + @Override + protected boolean isButton(int id) { + return (id >= 1 && id <= 8); + } + + @Override + protected boolean isCCI(int id) { + return false; + } + + @Override + protected void configureComponents(@Nullable String model) { + logger.trace("Configuring components for WCI"); + + buttonList.addAll(BUTTON_LIST); + ledList.addAll(LED_LIST); + } + + public WciHandler(Thing thing) { + super(thing); + } + +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwConstants.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwConstants.java index ba79983c6f2d3..4d28925d04587 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwConstants.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerConfig.java index 70baa43dad144..1f9ec9372e88f 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerHandler.java index 61e2b9b779bd6..bbc7a5b2efb5b 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDimmerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDiscoveryService.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDiscoveryService.java index 9853347ade55b..55a589f5e371b 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDiscoveryService.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,10 +16,15 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.openhab.binding.lutron.internal.LutronHandlerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,18 +37,39 @@ * with the dimmer status and it will be discovered. * * @author Andrew Shilliday - Initial contribution - * */ -public class HwDiscoveryService extends AbstractDiscoveryService { +public class HwDiscoveryService extends AbstractDiscoveryService implements DiscoveryService, ThingHandlerService { private Logger logger = LoggerFactory.getLogger(HwDiscoveryService.class); private final AtomicBoolean isScanning = new AtomicBoolean(false); - private final HwSerialBridgeHandler handler; + private @NonNullByDefault({}) HwSerialBridgeHandler handler; - public HwDiscoveryService(HwSerialBridgeHandler handler) { + public HwDiscoveryService() { super(LutronHandlerFactory.HW_DISCOVERABLE_DEVICE_TYPES_UIDS, 10); - this.handler = handler; + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof HwSerialBridgeHandler) { + this.handler = (HwSerialBridgeHandler) handler; + this.handler.setDiscoveryService(this); + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return handler; + } + + @Override + public void activate() { + super.activate(null); + } + + @Override + public void deactivate() { + super.deactivate(); } @Override diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeConfig.java index a173501911179..4298737920c61 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeHandler.java index 2bedc64ca6847..dd887747c034a 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/hw/HwSerialBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,19 +18,20 @@ import java.io.OutputStreamWriter; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; import java.util.TooManyListenersException; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; -import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -59,13 +60,12 @@ public class HwSerialBridgeHandler extends BaseBridgeHandler implements SerialPo private Boolean updateTime; private ScheduledFuture<?> updateTimeJob; + private HwDiscoveryService discoveryService; + private SerialPort serialPort; private OutputStreamWriter serialOutput; private BufferedReader serialInput; - private HwDiscoveryService discoveryService; - private ServiceRegistration<DiscoveryService> discoveryRegistration; - public HwSerialBridgeHandler(Bridge bridge) { super(bridge); } @@ -82,9 +82,6 @@ public void initialize() { baudRate = configuration.getBaudRate().intValue(); } - this.discoveryService = new HwDiscoveryService(this); - this.discoveryRegistration = bundleContext.registerService(DiscoveryService.class, discoveryService, null); - if (serialPortName == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Serial port not specified"); return; @@ -97,6 +94,10 @@ public void initialize() { scheduler.execute(() -> openConnection()); } + public void setDiscoveryService(HwDiscoveryService discoveryService) { + this.discoveryService = discoveryService; + } + private void openConnection() { try { logger.info("Connecting to Lutron HomeWorks Processor using {}.", serialPortName); @@ -169,6 +170,11 @@ private void updateProcessorTime() { sendCommand("ST, " + timeString); } + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(HwDiscoveryService.class); + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { logger.debug("Unexpected command for HomeWorks Bridge: {} - {}", channelUID, command); @@ -259,10 +265,6 @@ public void dispose() { updateTimeJob.cancel(false); } - if (this.discoveryRegistration != null) { - this.discoveryRegistration.unregister(); - this.discoveryRegistration = null; - } logger.debug("Finished disposing bridge."); } diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfig.java new file mode 100644 index 0000000000000..47a835a5ec7fe --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfig.java @@ -0,0 +1,142 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Abstract base class for keypad configuration definition classes + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public abstract class KeypadConfig { + private final Logger logger = LoggerFactory.getLogger(KeypadConfig.class); + + protected final HashMap<String, @Nullable List<KeypadComponent>> modelData = new HashMap<>(); + + public abstract boolean isCCI(int id); + + public abstract boolean isButton(int id); + + public abstract boolean isLed(int id); + + /** + * Get a list of all {@link KeypadComponent}s for the specified keypad model + * + * @param model The keypad model for which to return components. + * @return List of components. Will be empty if no components match. + */ + public List<KeypadComponent> getComponents(String model) { + return getComponents(model, null); + } + + /** + * Get a list of {@link KeypadComponent}s of the specified type for the specified keypad model + * + * @param model The keypad model for which to return components. + * @param type The component type to include, or null for all components. + * @return List of components. Will be empty if no components match. + */ + public List<KeypadComponent> getComponents(String model, @Nullable ComponentType type) { + List<KeypadComponent> filteredList = new LinkedList<>(); + List<KeypadComponent> cList = modelData.get(model); + if (cList == null) { + logger.debug("Keypad components lookup using invalid keypad model: {}", model); + return filteredList; + } else if (type == null) { + return cList; + } else { + for (KeypadComponent i : cList) { + if (i.type() == type) { + filteredList.add(i); + } + } + return filteredList; + } + } + + /** + * Get a list of all component IDs for the specified keypad model + * + * @param model The keypad model for which to return component IDs. + * @return List of component IDs. Will be empty if no components match. + */ + public @Nullable List<Integer> getComponentIds(String model) { + return getComponentIds(model, null); + } + + /** + * Get a list of component IDs of the specified type for the specified keypad model + * + * @param model The keypad model for which to return component IDs. + * @param type The component type to include, or null for all components. + * @return List of component IDs. Will be empty if no components match. + */ + public List<Integer> getComponentIds(String model, @Nullable ComponentType type) { + List<Integer> idList = new LinkedList<>(); + List<KeypadComponent> cList = modelData.get(model); + if (cList == null) { + logger.debug("Keypad component IDs lookup using invalid keypad model: {}", model); + } else { + for (KeypadComponent i : cList) { + if (type == null || i.type() == type) { + idList.add(i.id()); + } + } + } + return idList; + } + + /** + * Determine keypad model from list of button component IDs + * + * @param buttonIds List of button component IDs for a keypad. Must be in ascending order. + * @return String containing the keypad model, or null if no models match. + */ + public @Nullable String determineModelFromComponentIds(List<Integer> buttonIds) { + for (String k : modelData.keySet()) { + List<Integer> modelButtonIds = getComponentIds(k, ComponentType.BUTTON); + Collections.sort(modelButtonIds); // make sure button IDs are in ascending order for comparison + if (modelButtonIds.equals(buttonIds)) { + return k; + } + } + return null; + } + + /** + * Utility routine to concatenate multiple lists of {@link KeypadComponent}s + * + * @param lists Lists to concatenate + * @return Concatenated list + */ + @SafeVarargs + protected static final List<KeypadComponent> combinedList(final List<KeypadComponent>... lists) { + List<KeypadComponent> newlist = new LinkedList<>(); + for (List<KeypadComponent> list : lists) { + newlist.addAll(list); + } + return newlist; + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigGrafikEye.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigGrafikEye.java new file mode 100644 index 0000000000000..50f1e23826e70 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigGrafikEye.java @@ -0,0 +1,157 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for Tabletop seeTouch line + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigGrafikEye extends KeypadConfig { + + private static enum Component implements KeypadComponent { + BUTTON1(70, "button1", "Button 1", ComponentType.BUTTON), // Scene button 1 + BUTTON2(71, "button2", "Button 2", ComponentType.BUTTON), // Scene button 2 + BUTTON3(76, "button3", "Button 3", ComponentType.BUTTON), // Scene button 3 + BUTTON4(77, "button4", "Button 4", ComponentType.BUTTON), // Scene button 4 + BUTTON5(83, "button5", "Button 5", ComponentType.BUTTON), // Scene button 5/Off + + BUTTON10(38, "button10", "Button 10", ComponentType.BUTTON), // Col 1 + BUTTON11(39, "button11", "Button 11", ComponentType.BUTTON), // Col 1 + BUTTON12(40, "button12", "Button 12", ComponentType.BUTTON), // Col 1 + LOWER1(41, "buttonlower1", "Lower button col 1", ComponentType.BUTTON), // Col 1 lower + RAISE1(47, "buttonraise1", "Raise button col 1", ComponentType.BUTTON), // Col 1 raise + + BUTTON20(44, "button20", "Button 20", ComponentType.BUTTON), // Col 2 + BUTTON21(45, "button21", "Button 21", ComponentType.BUTTON), // Col 2 + BUTTON22(46, "button22", "Button 22", ComponentType.BUTTON), // Col 2 + LOWER2(52, "buttonlower2", "Lower button col 2", ComponentType.BUTTON), // Col 2 lower + RAISE2(53, "buttonraise2", "Raise button col 2", ComponentType.BUTTON), // Col 2 raise + + BUTTON30(50, "button30", "Button 30", ComponentType.BUTTON), // Col 3 + BUTTON31(51, "button31", "Button 31", ComponentType.BUTTON), // Col 3 + BUTTON32(56, "button32", "Button 32", ComponentType.BUTTON), // Col 3 + LOWER3(57, "buttonlower3", "Lower button col 3", ComponentType.BUTTON), // Col 3 lower + RAISE3(58, "buttonraise3", "Raise button col 3", ComponentType.BUTTON), // Col 3 raise + + CCI1(163, "cci1", "CCI 1", ComponentType.CCI), + + LED1(201, "led1", "LED 1", ComponentType.LED), // Scene button LEDs + LED2(210, "led2", "LED 2", ComponentType.LED), + LED3(219, "led3", "LED 3", ComponentType.LED), + LED4(228, "led4", "LED 4", ComponentType.LED), + LED5(237, "led5", "LED 5", ComponentType.LED), + + LED10(174, "led10", "LED 10", ComponentType.LED), // Col 1 LEDs + LED11(175, "led11", "LED 11", ComponentType.LED), + LED12(211, "led12", "LED 12", ComponentType.LED), + + LED20(183, "led20", "LED 20", ComponentType.LED), // Col 2 LEDs + LED21(184, "led21", "LED 21", ComponentType.LED), + LED22(220, "led22", "LED 22", ComponentType.LED), + + LED30(192, "led30", "LED 30", ComponentType.LED), // Col 3 LEDs + LED31(193, "led31", "LED 31", ComponentType.LED), + LED32(229, "led32", "LED 32", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + private static final List<KeypadComponent> SCENE_BUTTON_GROUP = Arrays.asList(Component.BUTTON1, Component.BUTTON2, + Component.BUTTON3, Component.BUTTON4, Component.BUTTON5); + private static final List<KeypadComponent> SCENE_LED_GROUP = Arrays.asList(Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED5); + + private static final List<KeypadComponent> CCI_GROUP = Arrays.asList(Component.CCI1); + + private static final List<KeypadComponent> COL1_BUTTON_GROUP = Arrays.asList(Component.BUTTON10, Component.BUTTON11, + Component.BUTTON12, Component.LOWER1, Component.RAISE1); + private static final List<KeypadComponent> COL2_BUTTON_GROUP = Arrays.asList(Component.BUTTON20, Component.BUTTON21, + Component.BUTTON22, Component.LOWER2, Component.RAISE2); + private static final List<KeypadComponent> COL3_BUTTON_GROUP = Arrays.asList(Component.BUTTON30, Component.BUTTON31, + Component.BUTTON32, Component.LOWER3, Component.RAISE3); + + private static final List<KeypadComponent> COL1_LED_GROUP = Arrays.asList(Component.LED10, Component.LED11, + Component.LED12); + private static final List<KeypadComponent> COL2_LED_GROUP = Arrays.asList(Component.LED20, Component.LED21, + Component.LED22); + private static final List<KeypadComponent> COL3_LED_GROUP = Arrays.asList(Component.LED30, Component.LED31, + Component.LED32); + + @Override + public boolean isLed(int id) { + return (id >= 174 && id <= 237); + } + + @Override + public boolean isButton(int id) { + return (id >= 38 && id <= 83); + } + + @Override + public boolean isCCI(int id) { + return (id == 163); + } + + public KeypadConfigGrafikEye() { + modelData.put("0COL", combinedList(SCENE_BUTTON_GROUP, CCI_GROUP, SCENE_LED_GROUP)); + + modelData.put("1COL", + combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, CCI_GROUP, SCENE_LED_GROUP, COL1_LED_GROUP)); + + modelData.put("2COL", combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, COL2_BUTTON_GROUP, CCI_GROUP, + SCENE_LED_GROUP, COL1_LED_GROUP, COL2_LED_GROUP)); + + modelData.put("3COL", combinedList(SCENE_BUTTON_GROUP, COL1_BUTTON_GROUP, COL2_BUTTON_GROUP, COL3_BUTTON_GROUP, + CCI_GROUP, SCENE_LED_GROUP, COL1_LED_GROUP, COL2_LED_GROUP, COL3_LED_GROUP)); + } + +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigIntlSeetouch.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigIntlSeetouch.java new file mode 100644 index 0000000000000..092c681ab86f1 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigIntlSeetouch.java @@ -0,0 +1,145 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for International seeTouch line + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigIntlSeetouch extends KeypadConfig { + + private static enum Component implements KeypadComponent { + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON), + BUTTON8(8, "button8", "Button 8", ComponentType.BUTTON), + BUTTON9(9, "button9", "Button 9", ComponentType.BUTTON), + BUTTON10(10, "button10", "Button 10", ComponentType.BUTTON), + + LOWER1(18, "buttonlower", "Lower button", ComponentType.BUTTON), + RAISE1(19, "buttonraise", "Raise button", ComponentType.BUTTON), + + CCI1(25, "cci1", "", ComponentType.CCI), + CCI2(26, "cci2", "", ComponentType.CCI), + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED), + LED7(87, "led7", "LED 7", ComponentType.LED), + LED8(88, "led8", "LED 8", ComponentType.LED), + LED9(89, "led9", "LED 9", ComponentType.LED), + LED10(90, "led10", "LED 10", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + @Override + public boolean isLed(int id) { + return (id >= 81 && id <= 90); + } + + @Override + public boolean isButton(int id) { + return ((id >= 1 && id <= 10) || (id >= 18 && id <= 19)); + } + + @Override + public boolean isCCI(int id) { + return (id >= 25 && id <= 26); + } + + public KeypadConfigIntlSeetouch() { + modelData.put("2B", Arrays.asList(Component.BUTTON7, Component.BUTTON9, Component.LED7, Component.LED9, + Component.CCI1, Component.CCI2)); + + modelData.put("3B", Arrays.asList(Component.BUTTON6, Component.BUTTON8, Component.BUTTON10, Component.LED6, + Component.LED8, Component.LED10, Component.CCI1, Component.CCI2)); + + modelData.put("4B", Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON7, Component.BUTTON9, + Component.LED2, Component.LED4, Component.LED7, Component.LED9, Component.CCI1, Component.CCI2)); + + modelData.put("5BRL", + Arrays.asList(Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, + Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED6, Component.LED7, + Component.LED8, Component.LED9, Component.LED10, Component.CCI1, Component.CCI2)); + + modelData.put("6BRL", + Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6, + Component.BUTTON8, Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED1, + Component.LED3, Component.LED5, Component.LED6, Component.LED8, Component.LED10, Component.CCI1, + Component.CCI2)); + + modelData.put("7BRL", + Arrays.asList(Component.BUTTON2, Component.BUTTON4, Component.BUTTON6, Component.BUTTON7, + Component.BUTTON8, Component.BUTTON9, Component.BUTTON10, Component.LOWER1, Component.RAISE1, + Component.LED2, Component.LED4, Component.LED6, Component.LED7, Component.LED8, Component.LED9, + Component.LED10, Component.CCI1, Component.CCI2)); + + modelData.put("8BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.BUTTON6, + Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, Component.BUTTON10, Component.LOWER1, + Component.RAISE1, Component.LED1, Component.LED3, Component.LED5, Component.LED6, Component.LED7, + Component.LED8, Component.LED9, Component.LED10, Component.CCI1, Component.CCI2)); + + modelData.put("10BRL", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.BUTTON9, + Component.BUTTON10, Component.LOWER1, Component.RAISE1, Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7, Component.LED8, + Component.LED9, Component.LED10, Component.CCI1, Component.CCI2)); + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPalladiom.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPalladiom.java new file mode 100644 index 0000000000000..89809df6b4aec --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPalladiom.java @@ -0,0 +1,155 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for Palladiom keypad line + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigPalladiom extends KeypadConfig { + + private static enum Component implements KeypadComponent { + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON), + BUTTON8(8, "button8", "Button 8", ComponentType.BUTTON), + + LOWER1(16, "buttonlower1", "Lower button 1", ComponentType.BUTTON), + RAISE1(17, "buttonraise1", "Raise button 2", ComponentType.BUTTON), + LOWER2(18, "buttonlower2", "Lower button 3", ComponentType.BUTTON), + RAISE2(19, "buttonraise2", "Raise button 4", ComponentType.BUTTON), + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED), + LED7(87, "led7", "LED 7", ComponentType.LED), + LED8(88, "led8", "LED 8", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + @Override + public boolean isLed(int id) { + return (id >= 81 && id <= 88); + } + + @Override + public boolean isButton(int id) { + return ((id >= 1 && id <= 8) || (id >= 16 && id <= 19)); + } + + @Override + public boolean isCCI(int id) { + return false; + } + + public KeypadConfigPalladiom() { + modelData.put("2W", Arrays.asList(Component.BUTTON1, Component.BUTTON4, Component.LED1, Component.LED4)); + + modelData.put("3W", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON4, Component.LED1, + Component.LED2, Component.LED4)); + + modelData.put("4W", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.LED1, Component.LED2, Component.LED3, Component.LED4)); + + modelData.put("RW", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.LOWER1, + Component.RAISE1, Component.LED1, Component.LED2, Component.LED3)); + + modelData.put("22W", Arrays.asList(Component.BUTTON1, Component.BUTTON4, Component.BUTTON5, Component.BUTTON8, + Component.LED1, Component.LED4, Component.LED5, Component.LED8)); + + modelData.put("24W", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON8, Component.LED1, Component.LED2, Component.LED3, + Component.LED4, Component.LED5, Component.LED8)); + + modelData.put("42W", + Arrays.asList(Component.BUTTON1, Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, + Component.BUTTON7, Component.BUTTON8, Component.LED1, Component.LED4, Component.LED5, + Component.LED6, Component.LED7, Component.LED8)); + + modelData.put("44W", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.LED1, + Component.LED2, Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7, + Component.LED8)); + + modelData.put("2RW", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5, + Component.BUTTON8, Component.LOWER1, Component.RAISE1, Component.LED1, Component.LED2, + Component.LED3, Component.LED5, Component.LED8)); + + modelData.put("4RW", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5, + Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, Component.LOWER1, Component.RAISE1, + Component.LED1, Component.LED2, Component.LED3, Component.LED5, Component.LED6, Component.LED7, + Component.LED8)); + + modelData.put("RRW", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5, + Component.BUTTON6, Component.BUTTON7, Component.LOWER1, Component.RAISE1, Component.LOWER2, + Component.RAISE2, Component.LED1, Component.LED2, Component.LED3, Component.LED5, + Component.LED6, Component.LED7)); + + // Superset of all models + modelData.put("Generic", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, + Component.BUTTON4, Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.BUTTON8, + Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7, Component.LED8)); + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPico.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPico.java new file mode 100644 index 0000000000000..abb5548d5a626 --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigPico.java @@ -0,0 +1,101 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for Pico models + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigPico extends KeypadConfig { + + private static enum Component implements KeypadComponent { + // Buttons for 2B, 2BRL, 3B, and 3BRL models + BUTTON1(2, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(3, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(4, "button3", "Button 3", ComponentType.BUTTON), + + RAISE(5, "buttonraise", "Raise Button", ComponentType.BUTTON), + LOWER(6, "buttonlower", "Lower Button", ComponentType.BUTTON), + + // Buttons for PJ2-4B model + BUTTON1_4B(8, "button01", "Button 1", ComponentType.BUTTON), + BUTTON2_4B(9, "button02", "Button 2", ComponentType.BUTTON), + BUTTON3_4B(10, "button03", "Button 3", ComponentType.BUTTON), + BUTTON4_4B(11, "button04", "Button 4", ComponentType.BUTTON); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + @Override + public boolean isLed(int id) { + return false; + } + + @Override + public boolean isButton(int id) { + return (id >= 2 && id <= 11); + } + + @Override + public boolean isCCI(int id) { + return false; + } + + public KeypadConfigPico() { + modelData.put("2B", Arrays.asList(Component.BUTTON1, Component.BUTTON3)); + modelData.put("2BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.RAISE, Component.LOWER)); + modelData.put("3B", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3)); + modelData.put("3BRL", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.RAISE, + Component.LOWER)); + modelData.put("4B", + Arrays.asList(Component.BUTTON1_4B, Component.BUTTON2_4B, Component.BUTTON3_4B, Component.BUTTON4_4B)); + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigSeetouch.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigSeetouch.java new file mode 100644 index 0000000000000..47449132cfe3d --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigSeetouch.java @@ -0,0 +1,153 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for seeTouch and Hybrid seeTouch + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigSeetouch extends KeypadConfig { + + private static enum Component implements KeypadComponent { + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON), + + LOWER1(16, "buttontoplower", "Top lower button", ComponentType.BUTTON), + RAISE1(17, "buttontopraise", "Top raise button", ComponentType.BUTTON), + LOWER2(18, "buttonbottomlower", "Bottom lower button", ComponentType.BUTTON), + RAISE2(19, "buttonbottomraise", "Bottom raise button", ComponentType.BUTTON), + + // CCI1(25, "cci1", "CCI 1", ComponentType.CCI), // listed in spec but currently unused in binding + // CCI2(26, "cci2", "CCI 2", ComponentType.CCI), // listed in spec but currently unused in binding + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED), + LED7(87, "led7", "LED 7", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + @Override + public boolean isLed(int id) { + return (id >= 81 && id <= 87); + } + + @Override + public boolean isButton(int id) { + return ((id >= 1 && id <= 7) || (id >= 16 && id <= 19)); + } + + @Override + public boolean isCCI(int id) { + return false; + } + + public KeypadConfigSeetouch() { + modelData.put("W1RLD", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5, + Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, + Component.LED3, Component.LED5, Component.LED6)); + + modelData.put("W2RLD", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON5, Component.BUTTON6, + Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2, Component.LED1, + Component.LED2, Component.LED5, Component.LED6)); + + modelData.put("W3S", Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON6, + Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, Component.LED3, Component.LED6)); + + modelData.put("W3BD", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON5, + Component.BUTTON6, Component.BUTTON7, Component.LED1, Component.LED2, Component.LED3, + Component.LED5, Component.LED6, Component.LED7)); + + modelData.put("W3BRL", Arrays.asList(Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, Component.LOWER2, + Component.RAISE2, Component.LED2, Component.LED3, Component.LED4)); + + modelData.put("W3BSRL", Arrays.asList(Component.BUTTON1, Component.BUTTON3, Component.BUTTON5, Component.LOWER2, + Component.RAISE2, Component.LED1, Component.LED3, Component.LED5)); + + modelData.put("W4S", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED6)); + + modelData.put("W5BRL", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED5)); + + modelData.put("W6BRL", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON6, Component.LOWER2, Component.RAISE2, Component.LED1, + Component.LED2, Component.LED3, Component.LED4, Component.LED5, Component.LED6)); + + modelData.put("W7B", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.LED1, Component.LED2, + Component.LED3, Component.LED4, Component.LED5, Component.LED6, Component.LED7)); + + modelData.put("Generic", + Arrays.asList(Component.BUTTON1, Component.BUTTON2, Component.BUTTON3, Component.BUTTON4, + Component.BUTTON5, Component.BUTTON6, Component.BUTTON7, Component.LOWER1, Component.RAISE1, + Component.LOWER2, Component.RAISE2, Component.LED1, Component.LED2, Component.LED3, + Component.LED4, Component.LED5, Component.LED6, Component.LED7)); + } +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigTabletopSeetouch.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigTabletopSeetouch.java new file mode 100644 index 0000000000000..673d751966d5d --- /dev/null +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/keypadconfig/KeypadConfigTabletopSeetouch.java @@ -0,0 +1,168 @@ +/** + * 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.lutron.internal.keypadconfig; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.lutron.internal.KeypadComponent; +import org.openhab.binding.lutron.internal.discovery.project.ComponentType; + +/** + * Keypad configuration definition for Tabletop seeTouch line + * + * @author Bob Adair - Initial contribution + */ +@NonNullByDefault +public final class KeypadConfigTabletopSeetouch extends KeypadConfig { + + private static enum Component implements KeypadComponent { + BUTTON1(1, "button1", "Button 1", ComponentType.BUTTON), + BUTTON2(2, "button2", "Button 2", ComponentType.BUTTON), + BUTTON3(3, "button3", "Button 3", ComponentType.BUTTON), + BUTTON4(4, "button4", "Button 4", ComponentType.BUTTON), + BUTTON5(5, "button5", "Button 5", ComponentType.BUTTON), + BUTTON6(6, "button6", "Button 6", ComponentType.BUTTON), + BUTTON7(7, "button7", "Button 7", ComponentType.BUTTON), + BUTTON8(8, "button8", "Button 8", ComponentType.BUTTON), + BUTTON9(9, "button9", "Button 9", ComponentType.BUTTON), + BUTTON10(10, "button10", "Button 10", ComponentType.BUTTON), + BUTTON11(11, "button11", "Button 11", ComponentType.BUTTON), + BUTTON12(12, "button12", "Button 12", ComponentType.BUTTON), + BUTTON13(13, "button13", "Button 13", ComponentType.BUTTON), + BUTTON14(14, "button14", "Button 14", ComponentType.BUTTON), + BUTTON15(15, "button15", "Button 15", ComponentType.BUTTON), + + BUTTON16(16, "button16", "Button 16", ComponentType.BUTTON), + BUTTON17(17, "button17", "Button 17", ComponentType.BUTTON), + + LOWER1(20, "buttonlower1", "Lower button 1", ComponentType.BUTTON), + RAISE1(21, "buttonraise1", "Raise button 1", ComponentType.BUTTON), + LOWER2(22, "buttonlower2", "Lower button 2", ComponentType.BUTTON), + RAISE2(23, "buttonraise2", "Raise button 2", ComponentType.BUTTON), + LOWER3(24, "buttonlower3", "Lower button 3", ComponentType.BUTTON), + RAISE3(25, "buttonraise3", "Raise button 3", ComponentType.BUTTON), + + LED1(81, "led1", "LED 1", ComponentType.LED), + LED2(82, "led2", "LED 2", ComponentType.LED), + LED3(83, "led3", "LED 3", ComponentType.LED), + LED4(84, "led4", "LED 4", ComponentType.LED), + LED5(85, "led5", "LED 5", ComponentType.LED), + LED6(86, "led6", "LED 6", ComponentType.LED), + LED7(87, "led7", "LED 7", ComponentType.LED), + LED8(88, "led8", "LED 8", ComponentType.LED), + LED9(89, "led9", "LED 9", ComponentType.LED), + LED10(90, "led10", "LED 10", ComponentType.LED), + LED11(91, "led11", "LED 11", ComponentType.LED), + LED12(92, "led12", "LED 12", ComponentType.LED), + LED13(93, "led13", "LED 13", ComponentType.LED), + LED14(94, "led14", "LED 14", ComponentType.LED), + LED15(95, "led15", "LED 15", ComponentType.LED), + + LED16(96, "led16", "LED 16", ComponentType.LED), + LED17(97, "led17", "LED 17", ComponentType.LED); + + private final int id; + private final String channel; + private final String description; + private final ComponentType type; + + Component(int id, String channel, String description, ComponentType type) { + this.id = id; + this.channel = channel; + this.description = description; + this.type = type; + } + + @Override + public int id() { + return id; + } + + @Override + public String channel() { + return channel; + } + + @Override + public String description() { + return description; + } + + @Override + public ComponentType type() { + return type; + } + } + + private static final List<KeypadComponent> BUTTONGROUP1 = Arrays.asList(Component.BUTTON1, Component.BUTTON2, + Component.BUTTON3, Component.BUTTON4, Component.BUTTON5); + private static final List<KeypadComponent> BUTTONGROUP2 = Arrays.asList(Component.BUTTON6, Component.BUTTON7, + Component.BUTTON8, Component.BUTTON9, Component.BUTTON10); + private static final List<KeypadComponent> BUTTONGROUP3 = Arrays.asList(Component.BUTTON11, Component.BUTTON12, + Component.BUTTON13, Component.BUTTON14, Component.BUTTON15); + + private static final List<KeypadComponent> BUTTONGROUPBOTTOM_RL = Arrays.asList(Component.BUTTON16, + Component.BUTTON17, Component.LOWER3, Component.RAISE3); + private static final List<KeypadComponent> BUTTONGROUPBOTTOM_CRL = Arrays.asList(Component.LOWER1, Component.RAISE1, + Component.LOWER2, Component.RAISE2, Component.LOWER3, Component.RAISE3); + private static final List<KeypadComponent> BUTTONGROUPBOTTOM_GENERIC = Arrays.asList(Component.BUTTON16, + Component.BUTTON17, Component.LOWER1, Component.RAISE1, Component.LOWER2, Component.RAISE2, + Component.LOWER3, Component.RAISE3); + + private static final List<KeypadComponent> LEDGROUP1 = Arrays.asList(Component.LED1, Component.LED2, Component.LED3, + Component.LED4, Component.LED5); + private static final List<KeypadComponent> LEDGROUP2 = Arrays.asList(Component.LED6, Component.LED7, Component.LED8, + Component.LED9, Component.LED10); + private static final List<KeypadComponent> LEDGROUP3 = Arrays.asList(Component.LED11, Component.LED12, + Component.LED13, Component.LED14, Component.LED15); + + private static final List<KeypadComponent> LEDGROUPBOTTOM_RL = Arrays.asList(Component.LED16, Component.LED17); + + @Override + public boolean isLed(int id) { + return (id >= 81 && id <= 97); + } + + @Override + public boolean isButton(int id) { + return (id >= 1 && id <= 25); + } + + @Override + public boolean isCCI(int id) { + return false; + } + + public KeypadConfigTabletopSeetouch() { + modelData.put("T5RL", combinedList(BUTTONGROUP1, BUTTONGROUPBOTTOM_RL, LEDGROUP1, LEDGROUPBOTTOM_RL)); + + modelData.put("T10RL", combinedList(BUTTONGROUP1, BUTTONGROUP2, BUTTONGROUPBOTTOM_RL, LEDGROUP1, LEDGROUP2, + LEDGROUPBOTTOM_RL)); + + modelData.put("T15RL", combinedList(BUTTONGROUP1, BUTTONGROUP2, BUTTONGROUP3, BUTTONGROUPBOTTOM_RL, LEDGROUP1, + LEDGROUP2, LEDGROUP3, LEDGROUPBOTTOM_RL)); + + modelData.put("T5CRL", combinedList(BUTTONGROUP1, BUTTONGROUPBOTTOM_CRL, LEDGROUP1)); + + modelData.put("T10CRL", combinedList(BUTTONGROUP1, BUTTONGROUP2, BUTTONGROUPBOTTOM_CRL, LEDGROUP1, LEDGROUP2)); + + modelData.put("T15CRL", combinedList(BUTTONGROUP1, BUTTONGROUP2, BUTTONGROUP3, BUTTONGROUPBOTTOM_CRL, LEDGROUP1, + LEDGROUP2, LEDGROUP3)); + + modelData.put("Generic", combinedList(BUTTONGROUP1, BUTTONGROUP2, BUTTONGROUP3, BUTTONGROUPBOTTOM_GENERIC, + LEDGROUP1, LEDGROUP2, LEDGROUP3, LEDGROUPBOTTOM_RL)); // Superset of all models + } + +} diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSession.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSession.java index 5aea0b37183b7..c0cac17c3e1eb 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSession.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSessionListener.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSessionListener.java index 6a1b002142c03..2befec9d9f5ad 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSessionListener.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/net/TelnetSessionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommand.java index 1d55a8695a716..48a1684376e7f 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommandType.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommandType.java index 138fbf6bb91c3..905a34e2b3296 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommandType.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronCommandType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronOperation.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronOperation.java index 2890f13ca88ff..1c9295b16f181 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronOperation.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/protocol/LutronOperation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232Connection.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232Connection.java index 1a35e649fb2ca..588892ff75662 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232Connection.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232Connection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232MessageParser.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232MessageParser.java index e8205771500a5..30b6abd27e899 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232MessageParser.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RS232MessageParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnection.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnection.java index 978d4ba20c109..99c98e2d8ecdd 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnection.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnectionException.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnectionException.java index 032d5a06ade69..b54b435319fde 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnectionException.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConnectionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConstants.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConstants.java index 8033e7585a695..86523234d1482 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConstants.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAFeedbackListener.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAFeedbackListener.java index d77d4a889ce67..2e30348d0b6fd 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAFeedbackListener.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/RadioRAFeedbackListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/DimmerConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/DimmerConfig.java index 0c57acec79e1b..8b7c5c8f64331 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/DimmerConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/DimmerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/PhantomButtonConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/PhantomButtonConfig.java index 43df13a106caa..3341c63d3507c 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/PhantomButtonConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/PhantomButtonConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/RS232Config.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/RS232Config.java index 033084f80a433..acdd990afb5d4 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/RS232Config.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/RS232Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/SwitchConfig.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/SwitchConfig.java index 720f61d54dadf..e548f47d86baa 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/SwitchConfig.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/config/SwitchConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/DimmerHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/DimmerHandler.java index 34ce95c67b9c3..5c3b4634dd1dc 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/DimmerHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/DimmerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/LutronHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/LutronHandler.java index a96c261897488..293eeb60fb858 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/LutronHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/LutronHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/PhantomButtonHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/PhantomButtonHandler.java index fd9ff7dfa12ff..0eb4c3f9a2748 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/PhantomButtonHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/PhantomButtonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/RS232Handler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/RS232Handler.java index 77882ed81455b..d8287692fdbe5 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/RS232Handler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/RS232Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/SwitchHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/SwitchHandler.java index 431a25a1fa01e..6e1eae9f469f0 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/SwitchHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/handler/SwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ButtonPressCommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ButtonPressCommand.java index ad238d86d0df7..829f6fe34cbc4 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ButtonPressCommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ButtonPressCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LEDMapFeedback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LEDMapFeedback.java index 108ce3fea201f..89cd46230fcdb 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LEDMapFeedback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LEDMapFeedback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LocalZoneChangeFeedback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LocalZoneChangeFeedback.java index 3535f8fb48477..c809f9ed515b9 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LocalZoneChangeFeedback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/LocalZoneChangeFeedback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRACommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRACommand.java index d2257b92a6214..b12b66f1acf35 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRACommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRACommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRAFeedback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRAFeedback.java index 19d0e5f6874e2..581b524bf8b3a 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRAFeedback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/RadioRAFeedback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetDimmerLevelCommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetDimmerLevelCommand.java index 4acc8c8c715f9..3393939979275 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetDimmerLevelCommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetDimmerLevelCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetSwitchLevelCommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetSwitchLevelCommand.java index 56bbe7f809363..b1069eb1d6458 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetSwitchLevelCommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/SetSwitchLevelCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapFeedback.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapFeedback.java index 1226f13f1da57..a3692959163e5 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapFeedback.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapFeedback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapInquiryCommand.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapInquiryCommand.java index 8f3822365e9e8..4184e4d150f78 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapInquiryCommand.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/radiora/protocol/ZoneMapInquiryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/xml/DbXmlInfoReader.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/xml/DbXmlInfoReader.java index fb708416c1f67..3b0b7222bd139 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/xml/DbXmlInfoReader.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/xml/DbXmlInfoReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/binding/binding.xml index f9d676ad899d5..4f6a48cff4fae 100644 --- a/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/binding/binding.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Lutron Binding</name> - <description>The Lutron binding controls Lutron lighting control systems such as RadioRA, RadioRA 2, HomeWorks, HomeWorks QS, RA2 Select, and Caseta.</description> - <author>Allan Tong</author> + <description>The Lutron binding interfaces with Lutron lighting control and home automation systems such as RadioRA, RadioRA 2, HomeWorks, HomeWorks QS, RA2 Select, Caseta, and GRAFIK Eye.</description> + <author>Allan Tong, Bob Adair</author> </binding:binding> diff --git a/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/thing/thing-types.xml index eaaf1b74dbeb6..c7daade509b6b 100644 --- a/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.lutron/src/main/resources/ESH-INF/thing/thing-types.xml @@ -40,6 +40,13 @@ <default>5</default> <advanced>true</advanced> </parameter> + <parameter name="delay" type="integer" min="0" max="250" unit="ms"> + <label>Send Delay</label> + <description>The delay in milliseconds between sending integration commands (for throttling)</description> + <unitLabel>ms</unitLabel> + <default>0</default> + <advanced>true</advanced> + </parameter> <parameter name="discoveryFile" type="text"> <label>Discovery Data File</label> <description>File to read device discovery information from (for debugging)</description> @@ -96,6 +103,37 @@ </config-description> </thing-type> + <thing-type id="blind"> + <supported-bridge-type-refs> + <bridge-type-ref id="ipbridge"/> + </supported-bridge-type-refs> + + <label>Lutron Blind</label> + <description>Controls venetian and horizontal sheer blinds</description> + <category>Blinds</category> + + <channels> + <channel id="blindliftlevel" typeId="blindLift"/> + <channel id="blindtiltlevel" typeId="blindTilt"/> + </channels> + + <config-description> + <parameter name="integrationId" type="integer" required="true"> + <label>Integration ID</label> + <description>Address of blind in the Lutron system</description> + </parameter> + <parameter name="type" type="text" required="true"> + <label>Type</label> + <description>Type of blind</description> + <options> + <option value="Sheer">Sheer</option> + <option value="Venetian">Venetian</option> + </options> + <limitToOptions>true</limitToOptions> + </parameter> + </config-description> + </thing-type> + <thing-type id="switch"> <supported-bridge-type-refs> <bridge-type-ref id="ipbridge"/> @@ -342,6 +380,45 @@ </config-description> </thing-type> + <thing-type id="palladiomkeypad"> + <supported-bridge-type-refs> + <bridge-type-ref id="ipbridge"/> + </supported-bridge-type-refs> + + <label>Palladiom Keypad</label> + <description>Lutron Palladiom keypad (HomeWorks QS Only)</description> + + <config-description> + <parameter name="integrationId" type="integer" required="true"> + <label>Integration ID</label> + <description>Address of keypad in the Lutron lighting system</description> + </parameter> + <parameter name="model" type="text"> + <label>Keypad Model</label> + <description>Keypad/faceplate model number without the system prefix</description> + <options> + <option value="2W">2W</option> + <option value="3W">3W</option> + <option value="4W">4W</option> + <option value="RW">RW</option> + <option value="22W">22W</option> + <option value="24W">24W</option> + <option value="42W">42W</option> + <option value="44W">44W</option> + <option value="2RW">2RW</option> + <option value="4RW">4RW</option> + <option value="RRW">RRW</option> + <option value="Generic">Generic</option> + </options> + <default>Generic</default> + </parameter> + <parameter name="autorelease" type="boolean"> + <label>Auto-release</label> + <description>Automatically release pressed buttons</description> + <default>true</default> + </parameter> + </config-description> + </thing-type> <thing-type id="pico"> <supported-bridge-type-refs> @@ -430,6 +507,28 @@ </config-description> </thing-type> + <thing-type id="wci"> + <supported-bridge-type-refs> + <bridge-type-ref id="ipbridge"/> + </supported-bridge-type-refs> + + <label>WCI</label> + <description>QS Wallbox Closure Interface</description> + + <config-description> + <parameter name="integrationId" type="integer" required="true"> + <label>Integration ID</label> + <description>Address of WCI in the Lutron control system</description> + </parameter> + <parameter name="autorelease" type="boolean"> + <label>Auto-release</label> + <description>Automatically release pressed buttons</description> + <default>true</default> + </parameter> + </config-description> + </thing-type> + + <thing-type id="virtualkeypad"> <supported-bridge-type-refs> <bridge-type-ref id="ipbridge"/> @@ -537,11 +636,11 @@ <channels> <channel id="buttonpress" typeId="buttonpress"/> <channel id="zonelowerstop" typeId="button"> - <label>All zone lower stop</label> + <label>All Zone Lower Stop</label> <description>Stopping all ramping down on all Control Units</description> </channel> <channel id="zoneraisestop" typeId="button"> - <label>All zone raise stop</label> + <label>All Zone Raise Stop</label> <description>Stopping all ramping up on all Control Units</description> </channel> <channel id="timeclock" typeId="timeclock"/> @@ -593,7 +692,7 @@ <default>nwk</default> </parameter> <parameter name="retryPolling" type="integer"> - <label>Polling Interval to try to reconnect</label> + <label>Polling Interval to Try to Reconnect</label> <description>Interval (in seconds) to try to (re)connect to the matrix</description> <default>30</default> </parameter> @@ -951,6 +1050,22 @@ <state min="0" max="100" pattern="%d %%"/> </channel-type> + <channel-type id="blindLift"> + <item-type>Rollershutter</item-type> + <label>Blind Level</label> + <description>Raise/lower the blind level</description> + <category>Rollershutter</category> + <state min="0" max="100" pattern="%d %%"/> + </channel-type> + + <channel-type id="blindTilt"> + <item-type>Rollershutter</item-type> + <label>Blind Tilt</label> + <description>Tilt the blinds up/down</description> + <category>Rollershutter</category> + <state min="0" max="50" pattern="%d %%"/> + </channel-type> + <channel-type id="switchState"> <item-type>Switch</item-type> <label>Switch State</label> @@ -968,28 +1083,28 @@ <channel-type id="button"> <item-type>Switch</item-type> - <label>Keypad button</label> + <label>Keypad Button</label> <description>Button to trigger a scene or rule</description> <category>Switch</category> </channel-type> <channel-type id="buttonAdvanced" advanced="true"> <item-type>Switch</item-type> - <label>Keypad button</label> + <label>Keypad Button</label> <description>Button to trigger a scene or rule</description> <category>Switch</category> </channel-type> <channel-type id="ledIndicator"> <item-type>Switch</item-type> - <label>Keypad button LED indicator</label> + <label>Keypad Button LED Indicator</label> <description>LED indicator for the associated button</description> <category>Light</category> </channel-type> <channel-type id="ledIndicatorAdvanced" advanced="true"> <item-type>Switch</item-type> - <label>Keypad button LED indicator</label> + <label>Keypad Button LED Indicator</label> <description>LED indicator for the associated button</description> <category>Light</category> </channel-type> @@ -1110,28 +1225,28 @@ <channel-type id="zonelock"> <item-type>Switch</item-type> - <label>Zone lockout</label> + <label>Zone Lockout</label> <description>Locks/Unlocks the zone</description> <category>Zone</category> </channel-type> <channel-type id="zonerampdown"> <item-type>Switch</item-type> - <label>Ramps down the zone</label> + <label>Ramps Down the Zone</label> <description>Starts ramping down the zone</description> <category>Zone</category> </channel-type> <channel-type id="zonerampup"> <item-type>Switch</item-type> - <label>Ramps up the zone</label> + <label>Ramps up the Zone</label> <description>Starts ramping up the zone</description> <category>Zone</category> </channel-type> <channel-type id="zonefade"> <item-type>Number</item-type> - <label>Zone Fade (in seconds)</label> + <label>Zone Fade (in Seconds)</label> <description>Specifies the fade (in seconds [truncated to nearest minute if more than 60 seconds]) when applying intensity changes</description> <category>Zone</category> <state min="1" max="3600"/> diff --git a/bundles/org.openhab.binding.mail/NOTICE b/bundles/org.openhab.binding.mail/NOTICE index f14d05e90ebda..c242e4387b3e9 100644 --- a/bundles/org.openhab.binding.mail/NOTICE +++ b/bundles/org.openhab.binding.mail/NOTICE @@ -10,8 +10,9 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons +== Third-party Content commons-email: * License: Apache 2.0 License diff --git a/bundles/org.openhab.binding.mail/README.md b/bundles/org.openhab.binding.mail/README.md index f395f45188a85..5867d6a031daf 100644 --- a/bundles/org.openhab.binding.mail/README.md +++ b/bundles/org.openhab.binding.mail/README.md @@ -31,7 +31,7 @@ For authentication `username` and `password` need to be supplied. The `refresh`, `security`, `port`, `username` and `password` parameters are optional. -The `refresh` parameter is the time in seconds between two refreshes of the thing`s channels. +The `refresh` parameter is the time in seconds between two refreshes of the thing's channels. If omitted, the default of 60s is used. The `security` parameter defines the transport security and can be set to `PLAIN` (default), `SSL` or `TLS`. The `port` parameter is used to change the default ports for the SMTP server. @@ -98,6 +98,8 @@ Six different actions available: The `sendMail(...)` send a plain text mail (with attachments if supplied). The `sendHtmlMail(...)` send a HTML mail (with attachments if supplied). +`recipient` can be a single address (`mail@example.com`) or a list of addresses, concatenated by a comma (`mail@example.com, mail2@example.com`). + Since there is a separate rule action instance for each `smtp` thing, this needs to be retrieved through `getActions(scope, thingUID)`. The first parameter always has to be `mail` and the second is the full Thing UID of the SMTP server that should be used. Once this action instance is retrieved, you can invoke the action method on it. @@ -108,8 +110,10 @@ Using different character sets may produce unwanted results. Examples: ``` -val mailActions = getActions("mail","mail:smtp:sampleserver") +val mailActions = getActions("mail","mail:smtp:samplesmtp") mailActions.sendMail("mail@example.com", "Test subject", "This is the mail content.") +mailActions.sendMail("mail1@example.com, mail2@example.com", "Test subject", "This is the mail content sent to multiple recipients.") + ``` ``` diff --git a/bundles/org.openhab.binding.mail/pom.xml b/bundles/org.openhab.binding.mail/pom.xml index 3358fc31422f7..7b52c5ff2dd4c 100644 --- a/bundles/org.openhab.binding.mail/pom.xml +++ b/bundles/org.openhab.binding.mail/pom.xml @@ -1,29 +1,33 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mail</artifactId> <name>openHAB Add-ons :: Bundles :: Mail Binding</name> + <properties> + <dep.noembedding>javax.mail</dep.noembedding> + <bnd.importpackage>sun.security.util;resolution:=optional</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> <version>1.5</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> <version>1.6.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.mail/src/main/feature/feature.xml b/bundles/org.openhab.binding.mail/src/main/feature/feature.xml index 880a90a78a0f4..c4bf2fe840be8 100644 --- a/bundles/org.openhab.binding.mail/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mail/src/main/feature/feature.xml @@ -1,11 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mail-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mail" description="Mail Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <bundle dependency="true">mvn:com.sun.mail/javax.mail/1.6.2</bundle> - <bundle dependency="true">mvn:org.apache.commons/commons-email/1.5</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.mail/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/action/SendMailActions.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/action/SendMailActions.java index a08c9467141a6..9b34aa0dc315f 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/action/SendMailActions.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/action/SendMailActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -70,7 +70,7 @@ public class SendMailActions implements ThingActions { @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "text") @Nullable String text, @ActionInput(name = "urlList") @Nullable List<String> urlStringList) { if (recipient == null) { - logger.info("can't send to missing recipient"); + logger.warn("Cannot send mail as recipient is missing."); return false; } @@ -90,19 +90,19 @@ public class SendMailActions implements ThingActions { } if (handler == null) { - logger.info("handler is null, can't send mail"); + logger.info("Handler is null, cannot send mail."); return false; } else { return handler.sendMail(builder.build()); } } catch (AddressException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("Could not send mail: {}", e.getMessage()); return false; } catch (MalformedURLException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("Could not send mail: {}", e.getMessage()); return false; } catch (EmailException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("Could not send mail: {}", e.getMessage()); return false; } } @@ -126,7 +126,7 @@ public static boolean sendMail(@Nullable ThingActions actions, @Nullable String if (actions instanceof SendMailActions) { return ((SendMailActions) actions).sendMail(recipient, subject, text, urlStringList); } else { - throw new IllegalArgumentException("Instance is not SendMailActions class."); + throw new IllegalArgumentException("Instance is not of class SendMailActions."); } } @@ -156,7 +156,7 @@ public static boolean sendMail(@Nullable ThingActions actions, @Nullable String @ActionInput(name = "subject") @Nullable String subject, @ActionInput(name = "html") @Nullable String html, @ActionInput(name = "urlList") @Nullable List<String> urlStringList) { if (recipient == null) { - logger.info("can't send to missing recipient"); + logger.warn("Cannot send mail as recipient is missing."); return false; } @@ -176,19 +176,19 @@ public static boolean sendMail(@Nullable ThingActions actions, @Nullable String } if (handler == null) { - logger.info("handler is null, can't send mail"); + logger.warn("Handler is null, cannot send mail."); return false; } else { return handler.sendMail(builder.build()); } } catch (AddressException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("Could not send mail: {}", e.getMessage()); return false; } catch (MalformedURLException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("Could not send mail: {}", e.getMessage()); return false; } catch (EmailException e) { - logger.info("could not send mail: {}", e.getMessage()); + logger.warn("could not send mail: {}", e.getMessage()); return false; } } @@ -198,7 +198,7 @@ public static boolean sendHtmlMail(@Nullable ThingActions actions, @Nullable Str return SendMailActions.sendHtmlMail(actions, recipient, subject, html, new ArrayList<String>()); } - public static boolean sendHtmMail(@Nullable ThingActions actions, @Nullable String recipient, + public static boolean sendHtmlMail(@Nullable ThingActions actions, @Nullable String recipient, @Nullable String subject, @Nullable String html, @Nullable String urlString) { List<String> urlList = new ArrayList<>(); if (urlString != null) { @@ -212,7 +212,7 @@ public static boolean sendHtmlMail(@Nullable ThingActions actions, @Nullable Str if (actions instanceof SendMailActions) { return ((SendMailActions) actions).sendHtmlMail(recipient, subject, html, urlStringList); } else { - throw new IllegalArgumentException("Instance is not SendMailActions class."); + throw new IllegalArgumentException("Instance is not of class SendMailActions."); } } diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBindingConstants.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBindingConstants.java index 57da9e1f78b1c..36bb1174c68de 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBindingConstants.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBuilder.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBuilder.java index ba40d33d60631..84aa8199abe09 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBuilder.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -164,10 +164,8 @@ public Email build() throws EmailException { multipartMail.attach(file); } for (URL url : attachmentURLs) { - EmailAttachment attachment = new EmailAttachment(); - attachment.setURL(url); - attachment.setDisposition(EmailAttachment.ATTACHMENT); - multipartMail.attach(attachment); + String fileName = url.toString().replaceFirst(".*/([^/?]+).*", "$1"); + multipartMail.attach(url, fileName, fileName, EmailAttachment.ATTACHMENT); } mail = multipartMail; } else { diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailCountChannelType.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailCountChannelType.java index 013f299d24769..3ab9a1bb07f34 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailCountChannelType.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailCountChannelType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailHandlerFactory.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailHandlerFactory.java index 3dc37de42fd63..4db1d0a48de1a 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailHandlerFactory.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/MailHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/POP3IMAPHandler.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/POP3IMAPHandler.java index 34c696da04aee..5da17457ed18b 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/POP3IMAPHandler.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/POP3IMAPHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/SMTPHandler.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/SMTPHandler.java index 10d52d372215e..15aa70707c8bc 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/SMTPHandler.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/SMTPHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/ServerSecurity.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/ServerSecurity.java index 061ff384f7b10..20d03ea10db17 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/ServerSecurity.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/ServerSecurity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/BaseConfig.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/BaseConfig.java index fff7425c29306..8bcf501b1212a 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/BaseConfig.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/BaseConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPChannelConfig.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPChannelConfig.java index a47ab11425e8e..96a8640159cb5 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPChannelConfig.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPConfig.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPConfig.java index f491623857e5a..c47e9d5553610 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPConfig.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/POP3IMAPConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/SMTPConfig.java b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/SMTPConfig.java index 35467ab9c6306..c1bfabd5cd2f0 100644 --- a/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/SMTPConfig.java +++ b/bundles/org.openhab.binding.mail/src/main/java/org/openhab/binding/mail/internal/config/SMTPConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/binding/binding.xml index 8ee1480e5f6f2..727065f1479b3 100644 --- a/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="mail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://openhab.org/schemas/binding/v1.0.0" - xsi:schemaLocation="http://openhab.org/schemas/binding/v1.0.0 http://openhab.org/schemas/binding-1.0.0.xsd"> +<binding:binding id="mail" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Mail Binding</name> <description>Email support</description> diff --git a/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/thing/thing-types.xml index 6557635206612..903d5f995abfb 100644 --- a/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.mail/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,11 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="mail" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://openhab.org/schemas/thing-description/v1.0.0 http://openhab.org/schemas/thing-description-1.0.0.xsd"> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="smtp"> - <label>SMTP server</label> + <label>SMTP Server</label> <description>Used for sending mail via rule-actions</description> <config-description> <parameter name="sender" type="text" required="true"> @@ -13,15 +12,15 @@ <description>Default sender address for mail</description> </parameter> <parameter name="hostname" type="text" required="true"> - <label>Server hostname</label> + <label>Server Hostname</label> </parameter> <parameter name="port" type="text" required="false"> - <label>Server port</label> + <label>Server Port</label> <description>Default values are 25 for plain/TLS and 465 for SSL</description> <advanced>true</advanced> </parameter> <parameter name="security" type="text" required="false"> - <label>SMTP server security protocol</label> + <label>SMTP Server Security Protocol</label> <options> <option value="PLAIN">plain</option> <option value="SSL">SSL</option> @@ -31,28 +30,28 @@ <default>PLAIN</default> </parameter> <parameter name="username" type="text" required="false"> - <label>SMTP server username</label> + <label>SMTP Server Username</label> </parameter> <parameter name="password" type="text" required="false"> - <label>SMTP server password</label> + <label>SMTP Server Password</label> <context>password</context> </parameter> </config-description> </thing-type> <thing-type id="imap" extensible="mailcount"> - <label>IMAP server</label> + <label>IMAP Server</label> <description>Used for receiving mail</description> <config-description> <parameter name="hostname" type="text" required="true"> - <label>Server hostname</label> + <label>Server Hostname</label> </parameter> <parameter name="port" type="text" required="false"> - <label>Server port</label> + <label>Server Port</label> <description>Default values are 143 for plain/TLS and 993 for SSL</description> <advanced>true</advanced> </parameter> <parameter name="security" type="text" required="false"> - <label>SMTP server security protocol</label> + <label>SMTP Server Security Protocol</label> <options> <option value="PLAIN">plain</option> <option value="SSL">SSL</option> @@ -62,32 +61,32 @@ <default>PLAIN</default> </parameter> <parameter name="username" type="text" required="true"> - <label>SMTP server username</label> + <label>SMTP Server Username</label> </parameter> <parameter name="password" type="text" required="true"> - <label>SMTP server password</label> + <label>SMTP Server Password</label> <context>password</context> </parameter> <parameter name="refresh" type="integer" required="false"> - <label>refresh time for this account in s</label> + <label>Refresh Time for This Account in S</label> <default>60</default> </parameter> </config-description> </thing-type> <thing-type id="pop3" extensible="mailcount"> - <label>POP3 server</label> + <label>POP3 Server</label> <description>Used for receiving mail</description> <config-description> <parameter name="hostname" type="text" required="true"> - <label>Server hostname</label> + <label>Server Hostname</label> </parameter> <parameter name="port" type="text" required="false"> - <label>Server port</label> + <label>Server Port</label> <description>Default values are 110 for plain/TLS and 995 for SSL</description> <advanced>true</advanced> </parameter> <parameter name="security" type="text" required="false"> - <label>SMTP server security protocol</label> + <label>SMTP Server Security Protocol</label> <options> <option value="PLAIN">plain</option> <option value="SSL">SSL</option> @@ -97,14 +96,14 @@ <default>PLAIN</default> </parameter> <parameter name="username" type="text" required="true"> - <label>SMTP server username</label> + <label>SMTP Server Username</label> </parameter> <parameter name="password" type="text" required="true"> - <label>SMTP server password</label> + <label>SMTP Server Password</label> <context>password</context> </parameter> <parameter name="refresh" type="integer" required="false"> - <label>refresh time for this account in s</label> + <label>Refresh Time for This Account in S</label> <default>60</default> </parameter> </config-description> @@ -112,12 +111,12 @@ <channel-type id="mailcount"> <item-type>Number</item-type> - <label>Mail count</label> + <label>Mail Count</label> <description>Number of mails in folder</description> <state readOnly="true" /> <config-description> <parameter name="folder" type="text" required="true"> - <label>Folder name</label> + <label>Folder Name</label> <required>true</required> </parameter> <parameter name="type" type="text" required="false"> diff --git a/bundles/org.openhab.binding.mail/src/test/java/org/openhab/binding/mail/MailBuilderTest.java b/bundles/org.openhab.binding.mail/src/test/java/org/openhab/binding/mail/MailBuilderTest.java index e6f660b33a445..825ceb1a64160 100644 --- a/bundles/org.openhab.binding.mail/src/test/java/org/openhab/binding/mail/MailBuilderTest.java +++ b/bundles/org.openhab.binding.mail/src/test/java/org/openhab/binding/mail/MailBuilderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/NOTICE b/bundles/org.openhab.binding.max/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.max/NOTICE +++ b/bundles/org.openhab.binding.max/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.max/pom.xml b/bundles/org.openhab.binding.max/pom.xml index 478934900dc71..e93ce835895ac 100644 --- a/bundles/org.openhab.binding.max/pom.xml +++ b/bundles/org.openhab.binding.max/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.max</artifactId> diff --git a/bundles/org.openhab.binding.max/src/main/feature/feature.xml b/bundles/org.openhab.binding.max/src/main/feature/feature.xml index 77f7b83873e61..8a1a84b6cc78c 100644 --- a/bundles/org.openhab.binding.max/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.max/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.max-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-max" description="MAX! Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBackupUtils.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBackupUtils.java index 2f18fa74df004..08548e4b79c98 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBackupUtils.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBackupUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBindingConstants.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBindingConstants.java index 342d2e05fb24e..49c435223ba50 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBindingConstants.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxConsoleCommandExtension.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxConsoleCommandExtension.java index ff202b8aa6989..7a357fce6e4ac 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxConsoleCommandExtension.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/MaxConsoleCommandExtension.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/Utils.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/Utils.java index 3cfc85ed25bd6..cf5d039c126a6 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/Utils.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ACommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ACommand.java index b4a485571a657..cad27ec20d264 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ACommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ACommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CCommand.java index b948bf38f64d6..126616bb5fb17 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CubeCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CubeCommand.java index 8e91a3332fd79..32c83d17181f8 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CubeCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/CubeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/FCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/FCommand.java index 81d73f28148c8..41c6dfb5823cb 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/FCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/FCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/LCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/LCommand.java index ac90254481d90..15515a5f99e53 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/LCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/LCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/MCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/MCommand.java index 749df42f32454..2b0b6e491b440 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/MCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/MCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/NCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/NCommand.java index 2ac76426cac91..326355ed63013 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/NCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/NCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/QCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/QCommand.java index d2586cc904605..b1c885fff7c86 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/QCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/QCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SCommand.java index ac33dd0d3ddba..9b15010f92704 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SConfigCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SConfigCommand.java index 7adaa265700c5..7e01862e059a5 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SConfigCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/SConfigCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/TCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/TCommand.java index 6f73dd44b7351..7698c928454c5 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/TCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/TCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/UdpCubeCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/UdpCubeCommand.java index 526c42ccb01dc..30489d081c4d0 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/UdpCubeCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/UdpCubeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ZCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ZCommand.java index 41f1272eabfdf..b427f169e8b70 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ZCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/command/ZCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/config/MaxCubeBridgeConfiguration.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/config/MaxCubeBridgeConfiguration.java index 956f0fd6dfe6e..787e4c2c68d13 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/config/MaxCubeBridgeConfiguration.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/config/MaxCubeBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Cube.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Cube.java index 59b1894aeb40b..7a028b1ebdab0 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Cube.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Cube.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Device.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Device.java index e48ab805ff657..2ed49b7aaae42 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Device.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceConfiguration.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceConfiguration.java index eece1aea6c7da..15e77ee784c18 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceConfiguration.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceInformation.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceInformation.java index b531eea27e948..98827b560a3f6 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceInformation.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceType.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceType.java index cd3e79ef2d7a0..7c562f8d22d7c 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceType.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/EcoSwitch.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/EcoSwitch.java index 5143dac91c03a..082622a4cbf84 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/EcoSwitch.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/EcoSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/HeatingThermostat.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/HeatingThermostat.java index 4c63965adf508..0972037b82665 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/HeatingThermostat.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/HeatingThermostat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/RoomInformation.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/RoomInformation.java index 23a9962d55331..9b1be5b05323b 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/RoomInformation.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/RoomInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ShutterContact.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ShutterContact.java index 47868b32d286a..a18796aecfd22 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ShutterContact.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ShutterContact.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ThermostatModeType.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ThermostatModeType.java index a82a3918ebe23..f9cbb88aecc76 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ThermostatModeType.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/ThermostatModeType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/UnsupportedDevice.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/UnsupportedDevice.java index ccb53051406ed..9859686695450 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/UnsupportedDevice.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/UnsupportedDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/WallMountedThermostat.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/WallMountedThermostat.java index 2d2e0f3b2f976..def5aeeb7abc4 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/WallMountedThermostat.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/device/WallMountedThermostat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxCubeBridgeDiscovery.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxCubeBridgeDiscovery.java index f6bfefd3b8714..a4ebd2d8304e7 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxCubeBridgeDiscovery.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxCubeBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxDeviceDiscoveryService.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxDeviceDiscoveryService.java index efec6080d815c..a174c9e6f1e5f 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/discovery/MaxDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncompleteMessageException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncompleteMessageException.java index a91aeea50c756..2cdf5c067cb42 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncompleteMessageException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncompleteMessageException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncorrectMultilineIndexException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncorrectMultilineIndexException.java index ecaaed0d64662..feb0229c35a73 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncorrectMultilineIndexException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/IncorrectMultilineIndexException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/MessageIsWaitingException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/MessageIsWaitingException.java index 9718e0a12819c..4218b9db5658a 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/MessageIsWaitingException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/MessageIsWaitingException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/NoMessageAvailableException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/NoMessageAvailableException.java index 091363cc4e8d8..c4b61dfaa119a 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/NoMessageAvailableException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/NoMessageAvailableException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnprocessableMessageException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnprocessableMessageException.java index 61656037649af..71f4d99b96e88 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnprocessableMessageException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnprocessableMessageException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnsupportedMessageTypeException.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnsupportedMessageTypeException.java index 2ee5c5d61fed3..c9c32e877922e 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnsupportedMessageTypeException.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/exceptions/UnsupportedMessageTypeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/factory/MaxCubeHandlerFactory.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/factory/MaxCubeHandlerFactory.java index 3944e55c81368..24f359918e50c 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/factory/MaxCubeHandlerFactory.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/factory/MaxCubeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/DeviceStatusListener.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/DeviceStatusListener.java index 57e5884a446cc..34abe0f719c47 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/DeviceStatusListener.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/DeviceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java index f8e22998f521a..81f5941e00e9e 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -56,7 +56,6 @@ import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.max.internal.MaxBackupUtils; @@ -506,12 +505,6 @@ public void onConnectionLost() { logger.debug("Bridge connection lost. Updating thing status to OFFLINE."); previousOnline = false; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR); - for (Thing thing : getThing().getThings()) { - ThingHandler handler = thing.getHandler(); - if (handler != null && handler instanceof MaxDevicesHandler) { - ((MaxDevicesHandler) handler).setForceRefresh(); - } - } clearDeviceList(); } @@ -761,7 +754,6 @@ private void processMMessage(MMessage msg) { if (!roomPropertiesSet) { setProperties(msg); } - setProperties(msg); for (DeviceInformation di : msg.devices) { DeviceConfiguration c = null; for (DeviceConfiguration conf : configurations) { @@ -838,15 +830,18 @@ private void setProperties(HMessage message) { properties.put(Thing.PROPERTY_SERIAL_NUMBER, message.getSerialNumber()); properties.put(Thing.PROPERTY_VENDOR, MaxBindingConstants.PROPERTY_VENDOR_NAME); updateProperties(properties); - // TODO: Remove this once UI is displaying this info - for (Map.Entry<String, String> entry : properties.entrySet()) { - logger.debug("key: {} : {}", entry.getKey(), entry.getValue()); + if (message.getRFAddress() + .equalsIgnoreCase((String) getConfig().get(MaxBindingConstants.PROPERTY_RFADDRESS)) + && message.getSerialNumber() + .equalsIgnoreCase((String) getConfig().get(Thing.PROPERTY_SERIAL_NUMBER))) { + logger.debug("MAX! Cube config already up2date."); + } else { + Configuration configuration = editConfiguration(); + configuration.put(MaxBindingConstants.PROPERTY_RFADDRESS, message.getRFAddress()); + configuration.put(Thing.PROPERTY_SERIAL_NUMBER, message.getSerialNumber()); + updateConfiguration(configuration); + logger.debug("MAX! Cube config updated"); } - Configuration configuration = editConfiguration(); - configuration.put(MaxBindingConstants.PROPERTY_RFADDRESS, message.getRFAddress()); - configuration.put(Thing.PROPERTY_SERIAL_NUMBER, message.getSerialNumber()); - updateConfiguration(configuration); - logger.debug("properties updated"); propertiesSet = true; } catch (Exception e) { logger.debug("Exception occurred during property update: {}", e.getMessage(), e); diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxDevicesHandler.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxDevicesHandler.java index 82fa17d53b12f..7e29d8e56c0f9 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxDevicesHandler.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxDevicesHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -68,7 +68,6 @@ public class MaxDevicesHandler extends BaseThingHandler implements DeviceStatusL private String maxDeviceSerial; private String rfAddress; - private boolean forceRefresh = true; private boolean propertiesSet; private boolean configSet; @@ -109,7 +108,6 @@ public void initialize() { } propertiesSet = false; configSet = false; - forceRefresh = true; getMaxCubeBridgeHandler(); } catch (Exception e) { logger.debug("Exception occurred during initialize : {}", e.getMessage(), e); @@ -140,7 +138,6 @@ public void dispose() { @Override public void thingUpdated(Thing thing) { configSet = false; - forceRefresh = true; super.thingUpdated(thing); } @@ -316,7 +313,6 @@ private synchronized MaxCubeBridgeHandler getMaxCubeBridgeHandler() { } this.bridgeHandler = (MaxCubeBridgeHandler) handler; this.bridgeHandler.registerDeviceStatusListener(this); - forceRefresh = true; } return this.bridgeHandler; } @@ -329,7 +325,6 @@ public void handleCommand(ChannelUID channelUID, Command command) { return; } if (command instanceof RefreshType) { - forceRefresh = true; maxCubeBridge.handleCommand(channelUID, command); return; } @@ -378,49 +373,42 @@ public void onDeviceStateChanged(ThingUID bridge, Device device) { || device.getType() == DeviceType.HeatingThermostatPlus)) { refreshActualCheck((HeatingThermostat) device); } - if (device.isUpdated() || forceRefresh) { - logger.debug("Updating states of {} {} ({}) id: {}", device.getType(), device.getName(), - device.getSerialNumber(), getThing().getUID()); - switch (device.getType()) { - case WallMountedThermostat: // fall-through - case HeatingThermostat: // fall-through - case HeatingThermostatPlus: - updateState(new ChannelUID(getThing().getUID(), CHANNEL_LOCKED), - ((HeatingThermostat) device).isPanelLocked() ? OpenClosedType.CLOSED : OpenClosedType.OPEN); - updateState(new ChannelUID(getThing().getUID(), CHANNEL_SETTEMP), - new QuantityType<>(((HeatingThermostat) device).getTemperatureSetpoint(), CELSIUS)); - updateState(new ChannelUID(getThing().getUID(), CHANNEL_MODE), - new StringType(((HeatingThermostat) device).getModeString())); - updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), - ((HeatingThermostat) device).getBatteryLow()); - updateState(new ChannelUID(getThing().getUID(), CHANNEL_VALVE), - new DecimalType(((HeatingThermostat) device).getValvePosition())); - double actualTemp = ((HeatingThermostat) device).getTemperatureActual(); - if (actualTemp != 0) { - updateState(new ChannelUID(getThing().getUID(), CHANNEL_ACTUALTEMP), - new QuantityType<>(actualTemp, CELSIUS)); - } - break; - case ShutterContact: - updateState(new ChannelUID(getThing().getUID(), CHANNEL_CONTACT_STATE), - ((ShutterContact) device).getShutterState()); - updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), - ((ShutterContact) device).getBatteryLow()); - break; - case EcoSwitch: - updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), - ((EcoSwitch) device).getBatteryLow()); - break; - default: - logger.debug("Unhandled Device {}.", device.getType()); - break; - } - forceRefresh = false; - device.setUpdated(false); - } else { - logger.debug("No changes for {} {} ({}) id: {}", device.getType(), device.getName(), - device.getSerialNumber(), getThing().getUID()); + logger.debug("Updating states of {} {} ({}) id: {}", device.getType(), device.getName(), + device.getSerialNumber(), getThing().getUID()); + switch (device.getType()) { + case WallMountedThermostat: // fall-through + case HeatingThermostat: // fall-through + case HeatingThermostatPlus: + updateState(new ChannelUID(getThing().getUID(), CHANNEL_LOCKED), + ((HeatingThermostat) device).isPanelLocked() ? OpenClosedType.CLOSED : OpenClosedType.OPEN); + updateState(new ChannelUID(getThing().getUID(), CHANNEL_SETTEMP), + new QuantityType<>(((HeatingThermostat) device).getTemperatureSetpoint(), CELSIUS)); + updateState(new ChannelUID(getThing().getUID(), CHANNEL_MODE), + new StringType(((HeatingThermostat) device).getModeString())); + updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), + ((HeatingThermostat) device).getBatteryLow()); + updateState(new ChannelUID(getThing().getUID(), CHANNEL_VALVE), + new DecimalType(((HeatingThermostat) device).getValvePosition())); + double actualTemp = ((HeatingThermostat) device).getTemperatureActual(); + if (actualTemp != 0) { + updateState(new ChannelUID(getThing().getUID(), CHANNEL_ACTUALTEMP), + new QuantityType<>(actualTemp, CELSIUS)); + } + break; + case ShutterContact: + updateState(new ChannelUID(getThing().getUID(), CHANNEL_CONTACT_STATE), + ((ShutterContact) device).getShutterState()); + updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), + ((ShutterContact) device).getBatteryLow()); + break; + case EcoSwitch: + updateState(new ChannelUID(getThing().getUID(), CHANNEL_BATTERY), ((EcoSwitch) device).getBatteryLow()); + break; + default: + logger.debug("Unhandled Device {}.", device.getType()); + break; } + device.setUpdated(false); } private void refreshActualCheck(HeatingThermostat device) { @@ -500,21 +488,12 @@ public void onDeviceRemoved(MaxCubeBridgeHandler bridge, Device device) { if (device.getSerialNumber().equals(maxDeviceSerial)) { bridgeHandler.unregisterDeviceStatusListener(this); bridgeHandler = null; - forceRefresh = true; updateStatus(ThingStatus.OFFLINE); } } @Override public void onDeviceAdded(Bridge bridge, Device device) { - forceRefresh = true; - } - - /** - * Set the forceRefresh flag to ensure update when next data is coming - */ - public void setForceRefresh() { - forceRefresh = true; } /** @@ -540,7 +519,6 @@ public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { logger.debug("Bridge Status updated to {} for device: {}", bridgeStatusInfo.getStatus(), getThing().getUID()); if (!bridgeStatusInfo.getStatus().equals(ThingStatus.ONLINE)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); - forceRefresh = true; } } @@ -549,18 +527,35 @@ public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { */ private void setDeviceConfiguration(Device device) { try { + boolean config_changed = false; logger.debug("MAX! {} {} configuration update", device.getType(), device.getSerialNumber()); Configuration configuration = editConfiguration(); - configuration.put(PROPERTY_ROOMNAME, device.getRoomName()); - configuration.put(PROPERTY_ROOMID, new BigDecimal(device.getRoomId())); - configuration.put(PROPERTY_DEVICENAME, device.getName()); - configuration.put(PROPERTY_RFADDRESS, device.getRFAddress()); - // Add additional device config entries + if (!device.getRoomName().equalsIgnoreCase((String) getConfig().get(PROPERTY_ROOMNAME))) { + configuration.put(PROPERTY_ROOMNAME, device.getRoomName()); + config_changed = true; + } + if (getConfig().get(PROPERTY_ROOMID) == null || !(new BigDecimal(device.getRoomId()) + .compareTo((BigDecimal) getConfig().get(PROPERTY_ROOMID)) == 0)) { + configuration.put(PROPERTY_ROOMID, new BigDecimal(device.getRoomId())); + config_changed = true; + } + if (!device.getName().equalsIgnoreCase((String) getConfig().get(PROPERTY_DEVICENAME))) { + configuration.put(PROPERTY_DEVICENAME, device.getName()); + config_changed = true; + } + if (!device.getRFAddress().equalsIgnoreCase((String) getConfig().get(PROPERTY_RFADDRESS))) { + configuration.put(PROPERTY_RFADDRESS, device.getRFAddress()); + config_changed = true; + } for (Map.Entry<String, Object> entry : device.getProperties().entrySet()) { configuration.put(entry.getKey(), entry.getValue()); } - updateConfiguration(configuration); - logger.debug("Config updated: {}", configuration.getProperties()); + if (config_changed) { + updateConfiguration(configuration); + logger.debug("Config updated: {}", configuration.getProperties()); + } else { + logger.debug("MAX! {} {} no updated required.", device.getType(), device.getSerialNumber()); + } configSet = true; } catch (Exception e) { logger.debug("Exception occurred during configuration edit: {}", e.getMessage(), e); diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/SendCommand.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/SendCommand.java index 97293430443b5..673cc8870bb45 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/SendCommand.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/SendCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/AMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/AMessage.java index b3b1fd413ae95..9468b3f232235 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/AMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/AMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/CMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/CMessage.java index a010b3781e9e1..2ca823e2616ca 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/CMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/CMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/FMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/FMessage.java index cb3e5cec9de85..40b8ed9638b9d 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/FMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/FMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/HMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/HMessage.java index 34ccd69448eb6..60dd07e6f62d6 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/HMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/HMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/LMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/LMessage.java index fdffa373d1ff3..24bf9348d1feb 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/LMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/LMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MMessage.java index d1f120c25171e..f933fdf20a8d2 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MaxTokenizer.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MaxTokenizer.java index cd7cf98965e5c..d6d254ccc33a1 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MaxTokenizer.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MaxTokenizer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/Message.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/Message.java index bbda37ba656d5..77a99f52440d9 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/Message.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageProcessor.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageProcessor.java index 4230e9238846b..f2217e490b705 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageProcessor.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageType.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageType.java index 537f3d608b0c5..3f5b746c8a0d4 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageType.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/MessageType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/NMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/NMessage.java index c4af9ee82b550..52ffbc4392fb0 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/NMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/NMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/SMessage.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/SMessage.java index 7d5a959d559fa..a33fed04be8ca 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/SMessage.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/message/SMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.max/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.max/src/main/resources/ESH-INF/thing/bridge.xml index 6beabeb23d2b1..906f04774cd5d 100644 --- a/bundles/org.openhab.binding.max/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.max/src/main/resources/ESH-INF/thing/bridge.xml @@ -40,12 +40,12 @@ <parameter name="ipAddress" type="text" required="true" groupName="network"> <context>network-address</context> - <label>MAX! Cube LAN gateway IP</label> + <label>MAX! Cube LAN Gateway IP</label> <description>The IP address of the MAX! Cube LAN gateway</description> </parameter> - <parameter name="port" type="integer" required="false" min="1" max="65335" groupName="network"> + <parameter name="port" type="integer" required="false" min="1" max="65535" groupName="network"> <context>network-address</context> - <label>MAX! Cube LAN gateway port</label> + <label>MAX! Cube LAN Gateway Port</label> <description>Port of the LAN gateway</description> <default>62910</default> <advanced>true</advanced> @@ -71,7 +71,7 @@ <default>true</default> </parameter> <parameter name="maxRequestsPerConnection" type="integer" required="false" groupName="network"> - <label>Max Requests per Connection</label> + <label>Max Requests Per Connection</label> <description>In exclusive mode, how many requests are allowed until connection is closed and reopened.</description> <default>1000</default> diff --git a/bundles/org.openhab.binding.mcp23017/NOTICE b/bundles/org.openhab.binding.mcp23017/NOTICE index 391a0aecff77c..d12cc88ee35bf 100644 --- a/bundles/org.openhab.binding.mcp23017/NOTICE +++ b/bundles/org.openhab.binding.mcp23017/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.mcp23017/README.md b/bundles/org.openhab.binding.mcp23017/README.md index 0e26812c8c7da..bf7c74d517b7b 100644 --- a/bundles/org.openhab.binding.mcp23017/README.md +++ b/bundles/org.openhab.binding.mcp23017/README.md @@ -1,67 +1,69 @@ # MCP23017 Binding This binding allows you to have native access for MCP23017 I/O expander on I2C bus. -It was tested with Raspberry Pi 2 and Raspberry Pi 3, but probably should work with other devices supported by [Pi4J](http://pi4j.com/) library. +It was tested with Raspberry Pi 2 and Raspberry Pi 3, but probably should work with other devices supported by [Pi4J](https://pi4j.com/) library. On Raspberry Pi the user on which openHAB is running (default user name is "openhab") needs to be added to groups "i2c" and "gpio". ## Dependencies Make sure that the [wiringPi](http://wiringpi.com/) library has been installed and that the `gpio` command line tool is available to openHAB. -The shared library `libwiringPi.so` is required by the [Pi4J](http://pi4j.com/) Java library to access the GPIO ports. +The shared library `libwiringPi.so` is required by the [Pi4J](https://pi4j.com/) Java library to access the GPIO ports. Without satisfying this dependency you will see strange `NoClassDefFoundError: Could not initialize class ...` errors in the openHAB logs. ## Supported Things This binding supports one thing type: -mcp23017 - which is a mcp23017 chip connected to a I2C bus on specified HEX address and bus number +mcp23017 - which is a mcp23017 chip connected to an I2C bus on specified HEX address and bus number ## Thing Configuration * Required configuration for mcp23017 thing: - | Parameter | Description | Default value | +| Parameter | Description | Default value | |------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------| -| address | MCP23017 I2C bus address. On Raspberry PI it can be checked as a result of command: "i2cdetect -y 1". Value should be set in HEX. | "20" | +| address | MCP23017 I2C bus address. On Raspberry Pi it can be checked as a result of command: "i2cdetect -y 1". Value should be set in HEX. | "20" | | bus_number | a bus number to which mcp23017 is connected. On RPI2 and RPI3 it will be "1", on RPI1 it will be "0". | "1" | ## Channels mcp23017 supports 16 channels in 2 groups: - | Group | Channels | Additional parameters | - | --- | --- | --- | - | input | A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B3, B4, B5, B6, B7 | pull_mode (OFF, PULL_UP), default is OFF | - | output| A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B3, B4, B5, B6, B7 | default_state (LOW, HIGH), default is LOW | +| Group | Channels | Additional parameters | +|--------|----------------------------------------------------------------|-------------------------------------------| +| input | A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B3, B4, B5, B6, B7 | pull_mode (OFF, PULL_UP), default is OFF | +| output | A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B3, B4, B5, B6, B7 | default_state (LOW, HIGH), default is LOW | - Channel determines MCP23017 PIN we want to use. +Channel determines MCP23017 PIN we want to use. - Group determines mode in which PIN shoud work. +Group determines mode in which PIN shoud work. - When PIN should work as DIGITAL_INPUT, channel from group "input" should be used. +When PIN should work as DIGITAL_INPUT, channel from group "input" should be used. - When PIN should work as DIGITAL_OUTPUT, channel from group "output" should be used. +When PIN should work as DIGITAL_OUTPUT, channel from group "output" should be used. ## Full Example Let's imagine a setup with: - 1. a wall switch connected to pin B1 on the MCP23017 chip which should turn on/off your LED light when pressed (released). - 2. a relay which is connected to pin A0 on the MCP23017 chip. This relay takes care of turning on/off your light. +1. a wall switch connected to pin B1 on the MCP23017 chip which should turn on/off your LED light when pressed (released). +2. a relay which is connected to pin A0 on the MCP23017 chip. This relay takes care of turning on/off your light. - Pressing (and releasing) a wall switch should notify openHAB, and then openHAB should change state of relay to on/off the light. - Your pin B1 should work as DIGITAL_INPUT, because it READS state of a PIN (state of wall switch). Your pin A0 should work as DIGITAL_OUTPUT - because openHAB will SET state of this PIN. So your config should look like this: +Pressing (and releasing) a wall switch should notify openHAB, and then openHAB should change state of relay to on/off the light. +Your pin B1 should work as DIGITAL_INPUT, because it READS state of a PIN (state of wall switch). Your pin A0 should work as DIGITAL_OUTPUT +because openHAB will SET state of this PIN. So your config should look like this: * Things: Minimal configuration: + ``` Thing mcp23017:mcp23017:chipA "MCP23017 chip A" [address=20,bus=1] ``` Configuration with default_state and pull_mode: + ``` Thing mcp23017:mcp23017:chipA "MCP23017 chip A" [address=20,bus=1] { Type output_pin : output#A0 [default_state="HIGH"] @@ -77,8 +79,8 @@ Thing mcp23017:mcp23017:chipA "MCP23017 chip A" [address=20,bus=1] { * Items: ``` -Switch living_room_led_switch "Living room led switch" {channel="mcp23017:mcp23017:chipA:output#A0"} -Contact living_room_led_contact "Living room led contact" {channel="mcp23017:mcp23017:chipA:input#B1"} +Switch living_room_led_switch "Living room LED switch" {channel="mcp23017:mcp23017:chipA:output#A0"} +Contact living_room_led_contact "Living room LED contact" {channel="mcp23017:mcp23017:chipA:input#B1"} ``` * Rules: @@ -90,5 +92,4 @@ when then living_room_led_switch.sendCommand(living_room_led_switch.state != ON ? ON : OFF) end - ``` diff --git a/bundles/org.openhab.binding.mcp23017/pom.xml b/bundles/org.openhab.binding.mcp23017/pom.xml index 16e031aa3ece0..7502980311959 100644 --- a/bundles/org.openhab.binding.mcp23017/pom.xml +++ b/bundles/org.openhab.binding.mcp23017/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mcp23017</artifactId> @@ -18,13 +17,13 @@ <groupId>com.pi4j</groupId> <artifactId>pi4j-core</artifactId> <version>1.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.pi4j.pi4j-gpio-extension</artifactId> + <groupId>com.pi4j</groupId> + <artifactId>pi4j-gpio-extension</artifactId> <version>1.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.mcp23017/src/main/feature/feature.xml b/bundles/org.openhab.binding.mcp23017/src/main/feature/feature.xml index f4c2ad6f8a390..9bfe8060d35c5 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mcp23017/src/main/feature/feature.xml @@ -1,11 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mcp23017-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mcp23017" description="MCP23017 Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:com.pi4j/pi4j-core/1.2</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/com.pi4j.pi4j-gpio-extension/1.2</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.mcp23017/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/GPIODataHolder.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/GPIODataHolder.java index 4587090c78010..9ff086bcefdf6 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/GPIODataHolder.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/GPIODataHolder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017BindingConstants.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017BindingConstants.java index dde73972353da..482be5071045f 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017BindingConstants.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017BindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017HandlerFactory.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017HandlerFactory.java index 5f44705ee56e1..9546317fd8081 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017HandlerFactory.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/Mcp23017HandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/PinMapper.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/PinMapper.java index 83a3158f1015d..f6c99c3c14bba 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/PinMapper.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/PinMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017Handler.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017Handler.java index 693d8c664a302..d1222a66b3c8a 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017Handler.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -183,7 +183,12 @@ private GpioPinDigitalInput initializeInputPin(ChannelUID channel) { @Override public void dispose() { - pinStateHolder.unBindGpioPins(); + final Mcp23017PinStateHolder holder = pinStateHolder; + + if (holder != null) { + holder.unBindGpioPins(); + } + super.dispose(); } diff --git a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017PinStateHolder.java b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017PinStateHolder.java index 67bec0369426c..faf619280a828 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017PinStateHolder.java +++ b/bundles/org.openhab.binding.mcp23017/src/main/java/org/openhab/binding/mcp23017/internal/handler/Mcp23017PinStateHolder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/config/config.xml index 0bf37cce888af..8b9814f8144e0 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/config/config.xml @@ -6,7 +6,7 @@ <config-description uri="channel-type:input_pin:config"> <parameter name="pull_mode" type="text" required="true"> - <label>PullResistor mode</label> + <label>PullResistor Mode</label> <description>mcp2317 input pull resistor mode</description> <options> <option value="OFF">OFF</option> @@ -18,7 +18,7 @@ <config-description uri="channel-type:output_pin:config"> <parameter name="default_state" type="text" required="true"> - <label>Default state</label> + <label>Default State</label> <description>mcp2317 pin default state (LOW, HIGH)</description> <options> <option value="LOW">LOW</option> diff --git a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/channels.xml index 5422642bbb893..4457f2dc9ada2 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/channels.xml @@ -5,7 +5,7 @@ <!-- Input Group Type --> <channel-group-type id="inputgroup"> - <label>Input pins</label> + <label>Input Pins</label> <description>MCP 23017 pins working in DIGITAL_INPUT mode (contact)</description> <channels> <channel id="A0" typeId="input_pin" /> @@ -29,7 +29,7 @@ <!-- Output Group Type --> <channel-group-type id="outputgroup"> - <label>Output pins</label> + <label>Output Pins</label> <description>MCP 23017 pins working in DIGITAL_OUTPUT mode (switch)</description> <channels> <channel id="A0" typeId="output_pin" /> @@ -53,7 +53,7 @@ <channel-type id="input_pin"> <item-type>Contact</item-type> - <label>Input pin</label> + <label>Input Pin</label> <description>channel type for MCP23017 pin in DIGITAL_INPUT mode (contact)</description> <category>Contact</category> <state readOnly="false" /> @@ -62,7 +62,7 @@ <channel-type id="output_pin"> <item-type>Switch</item-type> - <label>Output pin</label> + <label>Output Pin</label> <description>channel type for MCP23017 pin in DIGITAL_INPUT mode (switch)</description> <category>Switch</category> <state readOnly="true" /> diff --git a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/thing-types.xml index 5613efe4605d1..243e2538de424 100644 --- a/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.mcp23017/src/main/resources/ESH-INF/thing/thing-types.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="mcp23017"> - <label>mcp23017</label> + <label>MCP23017</label> <description>Thing for mcp23017 integrated circuit</description> <channel-groups> <channel-group id="input" typeId="inputgroup"/> diff --git a/bundles/org.openhab.binding.melcloud/.classpath b/bundles/org.openhab.binding.melcloud/.classpath new file mode 100644 index 0000000000000..66499b2691224 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/.classpath @@ -0,0 +1,43 @@ +<?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="src" path="target/generated-sources/annotations"> + <attributes> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/bundles/org.openhab.binding.melcloud/.project b/bundles/org.openhab.binding.melcloud/.project new file mode 100644 index 0000000000000..00a9e18b6fd06 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.melcloud</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> diff --git a/bundles/org.openhab.binding.melcloud/NOTICE b/bundles/org.openhab.binding.melcloud/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.melcloud/README.md b/bundles/org.openhab.binding.melcloud/README.md new file mode 100644 index 0000000000000..67d88bb7cce5b --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/README.md @@ -0,0 +1,148 @@ +# MELCloud Binding + +This is an openHAB binding for Mitsubishi MELCloud (https://www.melcloud.com/). +Installing this binding you can control your Mitsubishi devices from openHAB without accessing the MELCloud App and benefiting from all openHAB automations. + +## Supported Things + +Supported thing types + +* melcloudaccount (bridge) +* acdevice +* heatpump + +A bridge is required to connect to your MELCloud account. + + +## Discovery + +Discovery is used _after_ a bridge has been created and configured with your login information. + +1. Add the binding +2. Add a new thing of type melcloudaccount and configure with username and password +3. Go to Inbox and start discovery devices using MELCloud Binding +4. Supported devices (A.C. Device, Heatpump Device) should appear in your inbox + +Binding support also manual thing configuration by thing files. + +## Thing Configuration + +In order to manually create a thing file and not use the discovery routine you will need to know device MELCloud device ID. +This is a bit difficult to get. The easiest way of getting this is enable debug level logging of the binding or discovery devices by the binding (discovered device can be removed afterwards). + +MELCloud account configuration: + +| Config | Mandatory | Description | +|----------|-----------|-----------------------------------------| +| username | x | Email address tied to MELCloud account. | +| password | x | Password to MELCloud account. | +| language | | Language ID, see table below. | + +| LanguageId | Language | +|-------------|-------------------| +| 0 | English (default) | +| 1 | Bulgarian | +| 2 | Czech | +| 3 | Danish | +| 4 | German | +| 5 | Estonian | +| 6 | Spanish | +| 7 | French | +| 8 | Armenian | +| 9 | Latvian | +| 10 | Lithuanian | +| 11 | Hungarian | +| 12 | Dutch | +| 13 | Norwegian | +| 14 | Polish | +| 15 | Portuguese | +| 16 | Russian | +| 17 | Finnish | +| 18 | Swedish | +| 19 | Italian | +| 20 | Ukrainian | +| 21 | Turkish | +| 22 | Greek | +| 23 | Croatian | +| 24 | Romanian | +| 25 | Slovenian | + + +A.C. device and Heatpump device configuration: + +| Config | Mandatory | Description | +|-----------------|-----------|---------------------------------------------------------------------------------------| +| deviceID | x | MELCloud device ID. | +| buildingID | | MELCloud building ID. If not defined, binding tries to find matching id by device ID. | +| pollingInterval | | Refresh time interval in seconds for updates from MELCloud. Defaults to 60 seconds. | + + + +## Channels + +A.C. device channels + +| Channel | Type | Description | Read Only | +|---------------------|--------------------|------------------------------------------------------------------------------------------|-----------| +| power | Switch | Power Status of Device. | False | +| operationMode | String | Operation mode: "1" = Heat, "2" = Dry, "3" = Cool, "7" = Fan, "8" = Auto. | False | +| setTemperature | Number:Temperature | Set Temperature: Min = 10, Max = 40. | False | +| fanSpeed | String | Fan speed: "0" = Auto, "1" = 1, "2" = 2, "3" = 3, "4" = 4, "5" = 5. | False | +| vaneHorizontal | String | Vane Horizontal: "0" = Auto, "1" = 1, "2" = 2, "3" = 3, "4" = 4, "5" = 5, "12" = Swing. | False | +| vaneVertical | String | Vane Vertical: "0" = Auto, "1" = 1, "2" = 2, "3" = 3, "4" = 4, "5" = 5, "7" = Swing. | False | +| roomTemperature | Number:Temperature | Room temperature. | True | +| lastCommunication | DateTime | Last Communication time when MELCloud communicated to the device. | True | +| nextCommunication | DateTime | Next communication time when MELCloud will communicate to the device. | True | +| offline | Switch | Is device in offline state. | True | +| hasPendingCommand | Switch | Device has a pending command(s). | True | + +Heatpump device channels + +| Channel | Type | Description | Read Only | +|---------------------|--------------------|----------------------------------------------------------------------------|-----------| +| power | Switch | Power Status of Device. | False | +| forcedHotWaterMode | Switch | If water mode is Heat Now (true) or Auto (false) | False | +| setTemperatureZone1 | Number:Temperature | Set Temperature Zone 1: Min = 10, Max = 30. | False | +| roomTemperatureZone1| Number:Temperature | Room temperature Zone 1. | True | +| tankWaterTemperature| Number:Temperature | Tank water temperature. | True | +| lastCommunication | DateTime | Last Communication time when MELCloud communicated to the device. | True | +| nextCommunication | DateTime | Next communication time when MELCloud will communicate to the device. | True | +| offline | Switch | Is device in offline state. | True | +| hasPendingCommand | Switch | Device has a pending command(s). | True | + +## Full Example for items configuration + +**melcloud.things** + +``` +Bridge melcloud:melcloudaccount:myaccount "My MELCloud account" [ username="user.name@example.com", password="xxxxxx", language="0" ] { + Thing acdevice livingroom "Livingroom A.C. device" [ deviceID=123456, pollingInterval=60 ] + Thing heatpump attic "Attic Heatpump device" [ deviceID=789012, pollingInterval=60 ] +} +``` + +**melcloud.items** + +``` +Switch power { channel="melcloud:acdevice:myaccount:livingroom:power" } +String operationMode { channel="melcloud:acdevice:myaccount:livingroom:operationMode" } +Number setTemperature { channel="melcloud:acdevice:myaccount:livingroom:setTemperature" } +String fanSpeed { channel="melcloud:acdevice:myaccount:livingroom:fanSpeed" } +String vaneHorizontal { channel="melcloud:acdevice:myaccount:livingroom:vaneHorizontal" } +String vaneVertical { channel="melcloud:acdevice:myaccount:livingroom:vaneVertical" } +Number roomTemperature { channel="melcloud:acdevice:myaccount:livingroom:roomTemperature" } +DateTime lastCommunication { channel="melcloud:acdevice:myaccount:livingroom:lastCommunication" } +DateTime nextCommunication { channel="melcloud:acdevice:myaccount:livingroom:nextCommunication" } +Switch offline { channel="melcloud:acdevice:myaccount:livingroom:offline" } +Switch hasPendingCommand { channel="melcloud:acdevice:myaccount:livingroom:hasPendingCommand" } + +Switch heatpumpPower { channel="melcloud:heatpump:myaccount:attic:power" } +Switch heatpumpForcedHotWaterMode { channel="melcloud:heatpump:myaccount:attic:forcedHotWaterMode" } +Number heatpumpSetTemperatureZone1 { channel="melcloud:heatpump:myaccount:attic:setTemperatureZone1" } +Number heatpumpRoomTemperatureZone1{ channel="melcloud:heatpump:myaccount:attic:roomTemperatureZone1" } +Number heatpumpTankWaterTemperature{ channel="melcloud:heatpump:myaccount:attic:tankWaterTemperature" } +DateTime heatpumpLastCommunication { channel="melcloud:heatpump:myaccount:attic:lastCommunication" } +DateTime heatpumpNextCommunication { channel="melcloud:heatpump:myaccount:attic:nextCommunication" } +Switch heatpumpOffline { channel="melcloud:heatpump:myaccount:attic:offline" } +Switch heatpumpHasPendingCommand { channel="melcloud:heatpump:myaccount:attic:hasPendingCommand" } +``` \ No newline at end of file diff --git a/bundles/org.openhab.binding.melcloud/pom.xml b/bundles/org.openhab.binding.melcloud/pom.xml new file mode 100644 index 0000000000000..d1050e4e5ce29 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/pom.xml @@ -0,0 +1,15 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.melcloud</artifactId> + + <name>openHAB Add-ons :: Bundles :: MELCloud Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.melcloud/src/main/feature/feature.xml b/bundles/org.openhab.binding.melcloud/src/main/feature/feature.xml new file mode 100644 index 0000000000000..4a0e9cd87b42f --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.ihc-${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-melcloud" description="MELCloud Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.melcloud/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudBindingConstants.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudBindingConstants.java new file mode 100644 index 0000000000000..19e9540c033c1 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudBindingConstants.java @@ -0,0 +1,65 @@ +/** + * 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.melcloud.internal; + +import java.util.Collections; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link MelCloudBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Luca Calcaterra - Initial contribution + * @author Wietse van Buitenen - Added heatpump device + */ +public class MelCloudBindingConstants { + + private static final String BINDING_ID = "melcloud"; + + // List of Bridge Type UIDs + public static final ThingTypeUID THING_TYPE_MELCLOUD_ACCOUNT = new ThingTypeUID(BINDING_ID, "melcloudaccount"); + public static final ThingTypeUID THING_TYPE_HEATPUMPDEVICE = new ThingTypeUID(BINDING_ID, "heatpumpdevice"); + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_ACDEVICE = new ThingTypeUID(BINDING_ID, "acdevice"); + + // List of all Channel ids + public static final String CHANNEL_POWER = "power"; + public static final String CHANNEL_OPERATION_MODE = "operationMode"; + public static final String CHANNEL_SET_TEMPERATURE = "setTemperature"; + public static final String CHANNEL_FAN_SPEED = "fanSpeed"; + public static final String CHANNEL_VANE_HORIZONTAL = "vaneHorizontal"; + public static final String CHANNEL_VANE_VERTICAL = "vaneVertical"; + public static final String CHANNEL_SET_TEMPERATURE_ZONE1 = "setTemperatureZone1"; + public static final String CHANNEL_ROOM_TEMPERATURE_ZONE1 = "roomTemperatureZone1"; + public static final String CHANNEL_FORCED_HOTWATERMODE = "forcedHotWaterMode"; + public static final String CHANNEL_TANKWATERTEMPERATURE = "tankWaterTemperature"; + + // Read Only Channels + public static final String CHANNEL_ROOM_TEMPERATURE = "roomTemperature"; + public static final String CHANNEL_LAST_COMMUNICATION = "lastCommunication"; + public static final String CHANNEL_NEXT_COMMUNICATION = "nextCommunication"; + public static final String CHANNEL_HAS_PENDING_COMMAND = "hasPendingCommand"; + public static final String CHANNEL_OFFLINE = "offline"; + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPE_UIDS = Collections + .unmodifiableSet(Stream.of(THING_TYPE_MELCLOUD_ACCOUNT, THING_TYPE_ACDEVICE, THING_TYPE_HEATPUMPDEVICE) + .collect(Collectors.toSet())); + + public static final Set<ThingTypeUID> DISCOVERABLE_THING_TYPE_UIDS = Collections + .unmodifiableSet(Stream.of(THING_TYPE_ACDEVICE, THING_TYPE_HEATPUMPDEVICE).collect(Collectors.toSet())); +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudHandlerFactory.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudHandlerFactory.java new file mode 100644 index 0000000000000..e69c6a23d67ac --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/MelCloudHandlerFactory.java @@ -0,0 +1,62 @@ +/** + * 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.melcloud.internal; + +import static org.openhab.binding.melcloud.internal.MelCloudBindingConstants.*; + +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.openhab.binding.melcloud.internal.handler.MelCloudAccountHandler; +import org.openhab.binding.melcloud.internal.handler.MelCloudDeviceHandler; +import org.openhab.binding.melcloud.internal.handler.MelCloudHeatpumpDeviceHandler; +import org.osgi.service.component.annotations.Component; + +/** + * The {@link MelCloudHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Luca Calcaterra - Initial contribution + * @author Wietse van Buitenen - Added heatpump device + */ +@Component(configurationPid = "binding.melcloud", service = ThingHandlerFactory.class) +public class MelCloudHandlerFactory extends BaseThingHandlerFactory { + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPE_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (THING_TYPE_MELCLOUD_ACCOUNT.equals(thingTypeUID)) { + MelCloudAccountHandler handler = new MelCloudAccountHandler((Bridge) thing); + return handler; + } else if (THING_TYPE_ACDEVICE.equals(thingTypeUID)) { + MelCloudDeviceHandler handler = new MelCloudDeviceHandler(thing); + return handler; + } else if (THING_TYPE_HEATPUMPDEVICE.equals(thingTypeUID)) { + MelCloudHeatpumpDeviceHandler handler = new MelCloudHeatpumpDeviceHandler(thing); + return handler; + } + + return null; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/MelCloudConnection.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/MelCloudConnection.java new file mode 100644 index 0000000000000..dc0dcad7b55df --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/MelCloudConnection.java @@ -0,0 +1,210 @@ +/** + * 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.melcloud.internal.api; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; + +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.melcloud.internal.api.json.Device; +import org.openhab.binding.melcloud.internal.api.json.DeviceStatus; +import org.openhab.binding.melcloud.internal.api.json.HeatpumpDeviceStatus; +import org.openhab.binding.melcloud.internal.api.json.ListDevicesResponse; +import org.openhab.binding.melcloud.internal.api.json.LoginClientResponse; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudCommException; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudLoginException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.FieldNamingPolicy; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonSyntaxException; + +/** + * The {@link MelCloudConnection} Manage connection to Mitsubishi Cloud (MelCloud). + * + * @author Luca Calcaterra - Initial Contribution + * @author Pauli Anttila - Refactoring + * @author Wietse van Buitenen - Return all devices, added heatpump device + */ +public class MelCloudConnection { + + private static final String LOGIN_URL = "https://app.melcloud.com/Mitsubishi.Wifi.Client/Login/ClientLogin"; + private static final String DEVICE_LIST_URL = "https://app.melcloud.com/Mitsubishi.Wifi.Client/User/ListDevices"; + private static final String DEVICE_URL = "https://app.melcloud.com/Mitsubishi.Wifi.Client/Device"; + + private static final int TIMEOUT_MILLISECONDS = 10000; + + // Gson objects are safe to share across threads and are somewhat expensive to construct. Use a single instance. + private static final Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation() + .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE).create(); + + private final Logger logger = LoggerFactory.getLogger(MelCloudConnection.class); + + private boolean isConnected = false; + private String sessionKey; + + public void login(String username, String password, int languageId) + throws MelCloudCommException, MelCloudLoginException { + setConnected(false); + sessionKey = null; + JsonObject jsonReq = new JsonObject(); + jsonReq.addProperty("Email", username); + jsonReq.addProperty("Password", password); + jsonReq.addProperty("Language", languageId); + jsonReq.addProperty("AppVersion", "1.17.5.0"); + jsonReq.addProperty("Persist", false); + jsonReq.addProperty("CaptchaResponse", (String) null); + InputStream data = new ByteArrayInputStream(jsonReq.toString().getBytes(StandardCharsets.UTF_8)); + + try { + String loginResponse = HttpUtil.executeUrl("POST", LOGIN_URL, null, data, "application/json", + TIMEOUT_MILLISECONDS); + logger.debug("Login response: {}", loginResponse); + LoginClientResponse resp = gson.fromJson(loginResponse, LoginClientResponse.class); + if (resp.getErrorId() != null) { + String errorMsg = String.format("Login failed, error code: %s", resp.getErrorId()); + if (resp.getErrorMessage() != null) { + errorMsg = String.format("%s (%s)", errorMsg, resp.getErrorMessage()); + } + throw new MelCloudLoginException(errorMsg); + } + sessionKey = resp.getLoginData().getContextKey(); + setConnected(true); + } catch (IOException | JsonSyntaxException e) { + throw new MelCloudCommException(String.format("Login error, reason: %s", e.getMessage()), e); + } + } + + public List<Device> fetchDeviceList() throws MelCloudCommException { + assertConnected(); + try { + String response = HttpUtil.executeUrl("GET", DEVICE_LIST_URL, getHeaderProperties(), null, null, + TIMEOUT_MILLISECONDS); + logger.debug("Device list response: {}", response); + List<Device> devices = new ArrayList<Device>(); + ListDevicesResponse[] buildings = gson.fromJson(response, ListDevicesResponse[].class); + Arrays.asList(buildings).forEach(building -> { + if (building.getStructure().getDevices() != null) { + devices.addAll(building.getStructure().getDevices()); + } + building.getStructure().getFloors().forEach(floor -> { + if (floor.getDevices() != null) { + devices.addAll(floor.getDevices()); + } + floor.getAreas().forEach(area -> { + if (area.getDevices() != null) { + devices.addAll(area.getDevices()); + } + }); + }); + }); + logger.debug("Found {} devices", devices.size()); + + return devices; + } catch (IOException | JsonSyntaxException e) { + setConnected(false); + throw new MelCloudCommException("Error occurred during device list poll", e); + } + } + + public DeviceStatus fetchDeviceStatus(int deviceId, int buildingId) throws MelCloudCommException { + assertConnected(); + String url = DEVICE_URL + String.format("/Get?id=%d&buildingID=%d", deviceId, buildingId); + try { + String response = HttpUtil.executeUrl("GET", url, getHeaderProperties(), null, null, TIMEOUT_MILLISECONDS); + logger.debug("Device status response: {}", response); + DeviceStatus deviceStatus = gson.fromJson(response, DeviceStatus.class); + return deviceStatus; + } catch (IOException | JsonSyntaxException e) { + setConnected(false); + throw new MelCloudCommException("Error occurred during device status fetch", e); + } + } + + public DeviceStatus sendDeviceStatus(DeviceStatus deviceStatus) throws MelCloudCommException { + assertConnected(); + String content = gson.toJson(deviceStatus, DeviceStatus.class); + logger.debug("Sending device status: {}", content); + InputStream data = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); + try { + String response = HttpUtil.executeUrl("POST", DEVICE_URL + "/SetAta", getHeaderProperties(), data, + "application/json", TIMEOUT_MILLISECONDS); + logger.debug("Device status sending response: {}", response); + return gson.fromJson(response, DeviceStatus.class); + } catch (IOException | JsonSyntaxException e) { + setConnected(false); + throw new MelCloudCommException("Error occurred during device command sending", e); + } + } + + public HeatpumpDeviceStatus fetchHeatpumpDeviceStatus(int deviceId, int buildingId) throws MelCloudCommException { + assertConnected(); + String url = DEVICE_URL + String.format("/Get?id=%d&buildingID=%d", deviceId, buildingId); + try { + String response = HttpUtil.executeUrl("GET", url, getHeaderProperties(), null, null, TIMEOUT_MILLISECONDS); + logger.debug("Device heatpump status response: {}", response); + HeatpumpDeviceStatus heatpumpDeviceStatus = gson.fromJson(response, HeatpumpDeviceStatus.class); + return heatpumpDeviceStatus; + } catch (IOException | JsonSyntaxException e) { + setConnected(false); + throw new MelCloudCommException("Error occurred during heatpump device status fetch", e); + } + } + + public HeatpumpDeviceStatus sendHeatpumpDeviceStatus(HeatpumpDeviceStatus heatpumpDeviceStatus) + throws MelCloudCommException { + assertConnected(); + String content = gson.toJson(heatpumpDeviceStatus, HeatpumpDeviceStatus.class); + logger.debug("Sending heatpump device status: {}", content); + InputStream data = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); + try { + String response = HttpUtil.executeUrl("POST", DEVICE_URL + "/SetAtw", getHeaderProperties(), data, + "application/json", TIMEOUT_MILLISECONDS); + logger.debug("Device heatpump status sending response: {}", response); + return gson.fromJson(response, HeatpumpDeviceStatus.class); + } catch (IOException | JsonSyntaxException e) { + setConnected(false); + throw new MelCloudCommException("Error occurred during heatpump device command sending", e); + } + + } + + public synchronized boolean isConnected() { + return isConnected; + } + + private synchronized void setConnected(boolean state) { + isConnected = state; + } + + private Properties getHeaderProperties() { + Properties headers = new Properties(); + headers.put("X-MitsContextKey", sessionKey); + return headers; + } + + private void assertConnected() throws MelCloudCommException { + if (!isConnected) { + throw new MelCloudCommException("Not connected to MELCloud"); + } + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Area.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Area.java new file mode 100644 index 0000000000000..382377eb507ab --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Area.java @@ -0,0 +1,148 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * {@link Area} provides area specific information for JSON data returned from MELCloud API + * Area Data + * Generated with jsonschema2pojo + * + * @author Wietse van Buitenen - Initial contribution + */ +public class Area { + + @Expose + private Integer iD; + + @Expose + private String name; + + @Expose + private Integer buildingId; + + @Expose + private Integer floorId; + + @Expose + private Integer accessLevel; + + @Expose + private Boolean directAccess; + + @Expose + private Object endDate; + + @Expose + private Integer minTemperature; + + @Expose + private Integer maxTemperature; + + @Expose + private Boolean expanded; + + @Expose + private List<Device> devices = null; + + public Integer getID() { + return iD; + } + + public void setID(Integer iD) { + this.iD = iD; + } + + public Integer getBuildingId() { + return buildingId; + } + + public void setBuildingId(Integer buildingId) { + this.buildingId = buildingId; + } + + public Integer getFloorId() { + return floorId; + } + + public void setFloorId(Integer floorId) { + this.floorId = floorId; + } + + public Integer getAccessLevel() { + return accessLevel; + } + + public void setAccessLevel(Integer accessLevel) { + this.accessLevel = accessLevel; + } + + public Boolean getDirectAccess() { + return directAccess; + } + + public void setDirectAccess(Boolean directAccess) { + this.directAccess = directAccess; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List<Device> getDevices() { + return devices; + } + + public void setDevices(List<Device> devices) { + this.devices = devices; + } + + public Integer getMinTemperature() { + return minTemperature; + } + + public void setMinTemperature(Integer minTemperature) { + this.minTemperature = minTemperature; + } + + public Integer getMaxTemperature() { + return maxTemperature; + } + + public void setMaxTemperature(Integer maxTemperature) { + this.maxTemperature = maxTemperature; + } + + public Boolean getExpanded() { + return expanded; + } + + public void setExpanded(Boolean expanded) { + this.expanded = expanded; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Device.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Device.java new file mode 100644 index 0000000000000..ce8bda29cd8f0 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Device.java @@ -0,0 +1,557 @@ +/** + * 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.melcloud.internal.api.json; + +import java.security.Permissions; +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * The {@link Device} is responsible of JSON data For MELCloud API + * Device Structure. + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ + +public class Device { + + @Expose + private Integer deviceID; + + @Expose + private String deviceName; + + @Expose + private Integer buildingID; + + @Expose + private Object buildingName; + + @Expose + private Object floorID; + + @Expose + private Object floorName; + + @Expose + private Object areaID; + + @Expose + private Object areaName; + + @Expose + private Integer imageID; + + @Expose + private String installationDate; + + @Expose + private Object lastServiceDate; + + @Expose + private List<Preset> presets = null; + + @Expose + private Object ownerID; + + @Expose + private Object ownerName; + + @Expose + private Object ownerEmail; + + @Expose + private Integer accessLevel; + + @Expose + private Boolean directAccess; + + @Expose + private String endDate; + + @Expose + private Object zone1Name; + + @Expose + private Object zone2Name; + + @Expose + private Integer minTemperature; + + @Expose + private Integer maxTemperature; + + @Expose + private Boolean hideVaneControls; + + @Expose + private Boolean hideDryModeControl; + + @Expose + private Boolean hideRoomTemperature; + + @Expose + private Boolean hideSupplyTemperature; + + @Expose + private Boolean hideOutdoorTemperature; + + @Expose + private Object buildingCountry; + + @Expose + private Object ownerCountry; + + @Expose + private Integer adaptorType; + + @Expose + private Integer type; + + @Expose + private String macAddress; + + @Expose + private String serialNumber; + + @Expose + private DeviceProps device; + + @Expose + private Integer diagnosticMode; + + @Expose + private Object diagnosticEndDate; + + @Expose + private Integer location; + + @Expose + private Object detectedCountry; + + @Expose + private Integer registrations; + + @Expose + private Object localIPAddress; + + @Expose + private Integer timeZone; + + @Expose + private Object registReason; + + @Expose + private Integer expectedCommand; + + private Integer registRetry; + + @Expose + private String dateCreated; + + @Expose + private Object firmwareDeployment; + + @Expose + private Boolean firmwareUpdateAborted; + + @Expose + private Permissions permissions; + + public Integer getDeviceID() { + return deviceID; + } + + public void setDeviceID(Integer deviceID) { + this.deviceID = deviceID; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public Integer getBuildingID() { + return buildingID; + } + + public void setBuildingID(Integer buildingID) { + this.buildingID = buildingID; + } + + public Object getBuildingName() { + return buildingName; + } + + public void setBuildingName(Object buildingName) { + this.buildingName = buildingName; + } + + public Object getFloorID() { + return floorID; + } + + public void setFloorID(Object floorID) { + this.floorID = floorID; + } + + public Object getFloorName() { + return floorName; + } + + public void setFloorName(Object floorName) { + this.floorName = floorName; + } + + public Object getAreaID() { + return areaID; + } + + public void setAreaID(Object areaID) { + this.areaID = areaID; + } + + public Object getAreaName() { + return areaName; + } + + public void setAreaName(Object areaName) { + this.areaName = areaName; + } + + public Integer getImageID() { + return imageID; + } + + public void setImageID(Integer imageID) { + this.imageID = imageID; + } + + public String getInstallationDate() { + return installationDate; + } + + public void setInstallationDate(String installationDate) { + this.installationDate = installationDate; + } + + public Object getLastServiceDate() { + return lastServiceDate; + } + + public void setLastServiceDate(Object lastServiceDate) { + this.lastServiceDate = lastServiceDate; + } + + public List<Preset> getPresets() { + return presets; + } + + public void setPresets(List<Preset> presets) { + this.presets = presets; + } + + public Object getOwnerID() { + return ownerID; + } + + public void setOwnerID(Object ownerID) { + this.ownerID = ownerID; + } + + public Object getOwnerName() { + return ownerName; + } + + public void setOwnerName(Object ownerName) { + this.ownerName = ownerName; + } + + public Object getOwnerEmail() { + return ownerEmail; + } + + public void setOwnerEmail(Object ownerEmail) { + this.ownerEmail = ownerEmail; + } + + public Integer getAccessLevel() { + return accessLevel; + } + + public void setAccessLevel(Integer accessLevel) { + this.accessLevel = accessLevel; + } + + public Boolean getDirectAccess() { + return directAccess; + } + + public void setDirectAccess(Boolean directAccess) { + this.directAccess = directAccess; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public Object getZone1Name() { + return zone1Name; + } + + public void setZone1Name(Object zone1Name) { + this.zone1Name = zone1Name; + } + + public Object getZone2Name() { + return zone2Name; + } + + public void setZone2Name(Object zone2Name) { + this.zone2Name = zone2Name; + } + + public Integer getMinTemperature() { + return minTemperature; + } + + public void setMinTemperature(Integer minTemperature) { + this.minTemperature = minTemperature; + } + + public Integer getMaxTemperature() { + return maxTemperature; + } + + public void setMaxTemperature(Integer maxTemperature) { + this.maxTemperature = maxTemperature; + } + + public Boolean getHideVaneControls() { + return hideVaneControls; + } + + public void setHideVaneControls(Boolean hideVaneControls) { + this.hideVaneControls = hideVaneControls; + } + + public Boolean getHideDryModeControl() { + return hideDryModeControl; + } + + public void setHideDryModeControl(Boolean hideDryModeControl) { + this.hideDryModeControl = hideDryModeControl; + } + + public Boolean getHideRoomTemperature() { + return hideRoomTemperature; + } + + public void setHideRoomTemperature(Boolean hideRoomTemperature) { + this.hideRoomTemperature = hideRoomTemperature; + } + + public Boolean getHideSupplyTemperature() { + return hideSupplyTemperature; + } + + public void setHideSupplyTemperature(Boolean hideSupplyTemperature) { + this.hideSupplyTemperature = hideSupplyTemperature; + } + + public Boolean getHideOutdoorTemperature() { + return hideOutdoorTemperature; + } + + public void setHideOutdoorTemperature(Boolean hideOutdoorTemperature) { + this.hideOutdoorTemperature = hideOutdoorTemperature; + } + + public Object getBuildingCountry() { + return buildingCountry; + } + + public void setBuildingCountry(Object buildingCountry) { + this.buildingCountry = buildingCountry; + } + + public Object getOwnerCountry() { + return ownerCountry; + } + + public void setOwnerCountry(Object ownerCountry) { + this.ownerCountry = ownerCountry; + } + + public Integer getAdaptorType() { + return adaptorType; + } + + public void setAdaptorType(Integer adaptorType) { + this.adaptorType = adaptorType; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getMacAddress() { + return macAddress; + } + + public void setMacAddress(String macAddress) { + this.macAddress = macAddress; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public DeviceProps getDeviceProps() { + return device; + } + + public void setDeviceProps(DeviceProps device) { + this.device = device; + } + + public Integer getDiagnosticMode() { + return diagnosticMode; + } + + public void setDiagnosticMode(Integer diagnosticMode) { + this.diagnosticMode = diagnosticMode; + } + + public Object getDiagnosticEndDate() { + return diagnosticEndDate; + } + + public void setDiagnosticEndDate(Object diagnosticEndDate) { + this.diagnosticEndDate = diagnosticEndDate; + } + + public Integer getLocation() { + return location; + } + + public void setLocation(Integer location) { + this.location = location; + } + + public Object getDetectedCountry() { + return detectedCountry; + } + + public void setDetectedCountry(Object detectedCountry) { + this.detectedCountry = detectedCountry; + } + + public Integer getRegistrations() { + return registrations; + } + + public void setRegistrations(Integer registrations) { + this.registrations = registrations; + } + + public Object getLocalIPAddress() { + return localIPAddress; + } + + public void setLocalIPAddress(Object localIPAddress) { + this.localIPAddress = localIPAddress; + } + + public Integer getTimeZone() { + return timeZone; + } + + public void setTimeZone(Integer timeZone) { + this.timeZone = timeZone; + } + + public Object getRegistReason() { + return registReason; + } + + public void setRegistReason(Object registReason) { + this.registReason = registReason; + } + + public Integer getExpectedCommand() { + return expectedCommand; + } + + public void setExpectedCommand(Integer expectedCommand) { + this.expectedCommand = expectedCommand; + } + + public Integer getRegistRetry() { + return registRetry; + } + + public void setRegistRetry(Integer registRetry) { + this.registRetry = registRetry; + } + + public String getDateCreated() { + return dateCreated; + } + + public void setDateCreated(String dateCreated) { + this.dateCreated = dateCreated; + } + + public Object getFirmwareDeployment() { + return firmwareDeployment; + } + + public void setFirmwareDeployment(Object firmwareDeployment) { + this.firmwareDeployment = firmwareDeployment; + } + + public Boolean getFirmwareUpdateAborted() { + return firmwareUpdateAborted; + } + + public void setFirmwareUpdateAborted(Boolean firmwareUpdateAborted) { + this.firmwareUpdateAborted = firmwareUpdateAborted; + } + + public Permissions getPermissions() { + return permissions; + } + + public void setPermissions(Permissions permissions) { + this.permissions = permissions; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceProps.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceProps.java new file mode 100644 index 0000000000000..13b678a07a751 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceProps.java @@ -0,0 +1,1106 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * The {@link DeviceProps} is responsible of JSON data For MELCloud API + * Device Properties. + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class DeviceProps { + + @Expose + private List<Object> listHistory24Formatters = null; + + @Expose + private Integer deviceType; + + @Expose + private Boolean canCool; + + @Expose + private Boolean canHeat; + + @Expose + private Boolean canDry; + + @Expose + private Boolean hasAutomaticFanSpeed; + + @Expose + private Boolean airDirectionFunction; + + @Expose + private Boolean swingFunction; + + @Expose + private Integer numberOfFanSpeeds; + + @Expose + private Boolean useTemperatureA; + + @Expose + private Integer temperatureIncrementOverride; + + @Expose + private Double temperatureIncrement; + + @Expose + private Double minTempCoolDry; + + @Expose + private Double maxTempCoolDry; + + @Expose + private Double minTempHeat; + + @Expose + private Double maxTempHeat; + + @Expose + private Double minTempAutomatic; + + @Expose + private Double maxTempAutomatic; + + @Expose + private Boolean legacyDevice; + + @Expose + private Boolean unitSupportsStandbyMode; + + @Expose + private Boolean modelIsAirCurtain; + + @Expose + private Boolean modelSupportsFanSpeed; + + @Expose + private Boolean modelSupportsAuto; + + @Expose + private Boolean modelSupportsHeat; + + @Expose + private Boolean modelSupportsDry; + + @Expose + private Boolean modelSupportsVaneVertical; + + @Expose + private Boolean modelSupportsVaneHorizontal; + + @Expose + private Boolean modelSupportsStandbyMode; + + @Expose + private Boolean modelSupportsEnergyReporting; + + @Expose + private Boolean power; + + @Expose + private Double roomTemperature; + + @Expose + private Double setTemperature; + + @Expose + private Integer actualFanSpeed; + + @Expose + private Integer fanSpeed; + + @Expose + private Boolean automaticFanSpeed; + + @Expose + private Integer vaneVerticalDirection; + + @Expose + private Boolean vaneVerticalSwing; + + @Expose + private Integer vaneHorizontalDirection; + + @Expose + private Boolean vaneHorizontalSwing; + + @Expose + private Integer operationMode; + + @Expose + private Integer effectiveFlags; + + @Expose + private Integer lastEffectiveFlags; + + @Expose + private Boolean inStandbyMode; + + @Expose + private Double defaultCoolingSetTemperature; + + @Expose + private Double defaultHeatingSetTemperature; + + @Expose + private Integer roomTemperatureLabel; + + @Expose + private Boolean hasEnergyConsumedMeter; + + @Expose + private Integer currentEnergyConsumed; + + @Expose + private Integer currentEnergyMode; + + @Expose + private Boolean coolingDisabled; + + @Expose + private Integer minPcycle; + + @Expose + private Integer maxPcycle; + + @Expose + private Integer effectivePCycle; + + @Expose + private Integer maxOutdoorUnits; + + @Expose + private Integer maxIndoorUnits; + + @Expose + private Integer maxTemperatureControlUnits; + + @Expose + private Integer deviceID; + + @Expose + private String macAddress; + + @Expose + private String serialNumber; + + @Expose + private Integer timeZoneID; + + @Expose + private Integer diagnosticMode; + + @Expose + private Object diagnosticEndDate; + + @Expose + private Integer expectedCommand; + + @Expose + private Object owner; + + @Expose + private Object detectedCountry; + + @Expose + private Integer adaptorType; + + @Expose + private Object firmwareDeployment; + + @Expose + private Boolean firmwareUpdateAborted; + + @Expose + private Integer wifiSignalStrength; + + @Expose + private String wifiAdapterStatus; + + @Expose + private String position; + + @Expose + private Integer pCycle; + + @Expose + private Integer recordNumMax; + + @Expose + private String lastTimeStamp; + + @Expose + private Integer errorCode; + + @Expose + private Boolean hasError; + + @Expose + private String lastReset; + + @Expose + private Integer flashWrites; + + @Expose + private Object scene; + + @Expose + private Object sSLExpirationDate; + + @Expose + private Object sPTimeout; + + @Expose + private Object passcode; + + @Expose + private Boolean serverCommunicationDisabled; + + @Expose + private Integer consecutiveUploadErrors; + + @Expose + private Object doNotRespondAfter; + + @Expose + private Integer ownerRoleAccessLevel; + + @Expose + private Integer ownerCountry; + + @Expose + private Object rate1StartTime; + + @Expose + private Object rate2StartTime; + + @Expose + private Integer protocolVersion; + + @Expose + private Integer unitVersion; + + @Expose + private Integer firmwareAppVersion; + + @Expose + private Integer firmwareWebVersion; + + @Expose + private Integer firmwareWlanVersion; + + @Expose + private Boolean hasErrorMessages; + + @Expose + private Boolean hasZone2; + + @Expose + private Boolean offline; + + @Expose + private List<Object> units = null; + + public List<Object> getListHistory24Formatters() { + return listHistory24Formatters; + } + + public void setListHistory24Formatters(List<Object> listHistory24Formatters) { + this.listHistory24Formatters = listHistory24Formatters; + } + + public Integer getDeviceType() { + return deviceType; + } + + public void setDeviceType(Integer deviceType) { + this.deviceType = deviceType; + } + + public Boolean getCanCool() { + return canCool; + } + + public void setCanCool(Boolean canCool) { + this.canCool = canCool; + } + + public Boolean getCanHeat() { + return canHeat; + } + + public void setCanHeat(Boolean canHeat) { + this.canHeat = canHeat; + } + + public Boolean getCanDry() { + return canDry; + } + + public void setCanDry(Boolean canDry) { + this.canDry = canDry; + } + + public Boolean getHasAutomaticFanSpeed() { + return hasAutomaticFanSpeed; + } + + public void setHasAutomaticFanSpeed(Boolean hasAutomaticFanSpeed) { + this.hasAutomaticFanSpeed = hasAutomaticFanSpeed; + } + + public Boolean getAirDirectionFunction() { + return airDirectionFunction; + } + + public void setAirDirectionFunction(Boolean airDirectionFunction) { + this.airDirectionFunction = airDirectionFunction; + } + + public Boolean getSwingFunction() { + return swingFunction; + } + + public void setSwingFunction(Boolean swingFunction) { + this.swingFunction = swingFunction; + } + + public Integer getNumberOfFanSpeeds() { + return numberOfFanSpeeds; + } + + public void setNumberOfFanSpeeds(Integer numberOfFanSpeeds) { + this.numberOfFanSpeeds = numberOfFanSpeeds; + } + + public Boolean getUseTemperatureA() { + return useTemperatureA; + } + + public void setUseTemperatureA(Boolean useTemperatureA) { + this.useTemperatureA = useTemperatureA; + } + + public Integer getTemperatureIncrementOverride() { + return temperatureIncrementOverride; + } + + public void setTemperatureIncrementOverride(Integer temperatureIncrementOverride) { + this.temperatureIncrementOverride = temperatureIncrementOverride; + } + + public Double getTemperatureIncrement() { + return temperatureIncrement; + } + + public void setTemperatureIncrement(Double temperatureIncrement) { + this.temperatureIncrement = temperatureIncrement; + } + + public Double getMinTempCoolDry() { + return minTempCoolDry; + } + + public void setMinTempCoolDry(Double minTempCoolDry) { + this.minTempCoolDry = minTempCoolDry; + } + + public Double getMaxTempCoolDry() { + return maxTempCoolDry; + } + + public void setMaxTempCoolDry(Double maxTempCoolDry) { + this.maxTempCoolDry = maxTempCoolDry; + } + + public Double getMinTempHeat() { + return minTempHeat; + } + + public void setMinTempHeat(Double minTempHeat) { + this.minTempHeat = minTempHeat; + } + + public Double getMaxTempHeat() { + return maxTempHeat; + } + + public void setMaxTempHeat(Double maxTempHeat) { + this.maxTempHeat = maxTempHeat; + } + + public Double getMinTempAutomatic() { + return minTempAutomatic; + } + + public void setMinTempAutomatic(Double minTempAutomatic) { + this.minTempAutomatic = minTempAutomatic; + } + + public Double getMaxTempAutomatic() { + return maxTempAutomatic; + } + + public void setMaxTempAutomatic(Double maxTempAutomatic) { + this.maxTempAutomatic = maxTempAutomatic; + } + + public Boolean getLegacyDevice() { + return legacyDevice; + } + + public void setLegacyDevice(Boolean legacyDevice) { + this.legacyDevice = legacyDevice; + } + + public Boolean getUnitSupportsStandbyMode() { + return unitSupportsStandbyMode; + } + + public void setUnitSupportsStandbyMode(Boolean unitSupportsStandbyMode) { + this.unitSupportsStandbyMode = unitSupportsStandbyMode; + } + + public Boolean getModelIsAirCurtain() { + return modelIsAirCurtain; + } + + public void setModelIsAirCurtain(Boolean modelIsAirCurtain) { + this.modelIsAirCurtain = modelIsAirCurtain; + } + + public Boolean getModelSupportsFanSpeed() { + return modelSupportsFanSpeed; + } + + public void setModelSupportsFanSpeed(Boolean modelSupportsFanSpeed) { + this.modelSupportsFanSpeed = modelSupportsFanSpeed; + } + + public Boolean getModelSupportsAuto() { + return modelSupportsAuto; + } + + public void setModelSupportsAuto(Boolean modelSupportsAuto) { + this.modelSupportsAuto = modelSupportsAuto; + } + + public Boolean getModelSupportsHeat() { + return modelSupportsHeat; + } + + public void setModelSupportsHeat(Boolean modelSupportsHeat) { + this.modelSupportsHeat = modelSupportsHeat; + } + + public Boolean getModelSupportsDry() { + return modelSupportsDry; + } + + public void setModelSupportsDry(Boolean modelSupportsDry) { + this.modelSupportsDry = modelSupportsDry; + } + + public Boolean getModelSupportsVaneVertical() { + return modelSupportsVaneVertical; + } + + public void setModelSupportsVaneVertical(Boolean modelSupportsVaneVertical) { + this.modelSupportsVaneVertical = modelSupportsVaneVertical; + } + + public Boolean getModelSupportsVaneHorizontal() { + return modelSupportsVaneHorizontal; + } + + public void setModelSupportsVaneHorizontal(Boolean modelSupportsVaneHorizontal) { + this.modelSupportsVaneHorizontal = modelSupportsVaneHorizontal; + } + + public Boolean getModelSupportsStandbyMode() { + return modelSupportsStandbyMode; + } + + public void setModelSupportsStandbyMode(Boolean modelSupportsStandbyMode) { + this.modelSupportsStandbyMode = modelSupportsStandbyMode; + } + + public Boolean getModelSupportsEnergyReporting() { + return modelSupportsEnergyReporting; + } + + public void setModelSupportsEnergyReporting(Boolean modelSupportsEnergyReporting) { + this.modelSupportsEnergyReporting = modelSupportsEnergyReporting; + } + + public Boolean getPower() { + return power; + } + + public void setPower(Boolean power) { + this.power = power; + } + + public Double getRoomTemperature() { + return roomTemperature; + } + + public void setRoomTemperature(Double roomTemperature) { + this.roomTemperature = roomTemperature; + } + + public Double getSetTemperature() { + return setTemperature; + } + + public void setSetTemperature(Double setTemperature) { + this.setTemperature = setTemperature; + } + + public Integer getActualFanSpeed() { + return actualFanSpeed; + } + + public void setActualFanSpeed(Integer actualFanSpeed) { + this.actualFanSpeed = actualFanSpeed; + } + + public Integer getFanSpeed() { + return fanSpeed; + } + + public void setFanSpeed(Integer fanSpeed) { + this.fanSpeed = fanSpeed; + } + + public Boolean getAutomaticFanSpeed() { + return automaticFanSpeed; + } + + public void setAutomaticFanSpeed(Boolean automaticFanSpeed) { + this.automaticFanSpeed = automaticFanSpeed; + } + + public Integer getVaneVerticalDirection() { + return vaneVerticalDirection; + } + + public void setVaneVerticalDirection(Integer vaneVerticalDirection) { + this.vaneVerticalDirection = vaneVerticalDirection; + } + + public Boolean getVaneVerticalSwing() { + return vaneVerticalSwing; + } + + public void setVaneVerticalSwing(Boolean vaneVerticalSwing) { + this.vaneVerticalSwing = vaneVerticalSwing; + } + + public Integer getVaneHorizontalDirection() { + return vaneHorizontalDirection; + } + + public void setVaneHorizontalDirection(Integer vaneHorizontalDirection) { + this.vaneHorizontalDirection = vaneHorizontalDirection; + } + + public Boolean getVaneHorizontalSwing() { + return vaneHorizontalSwing; + } + + public void setVaneHorizontalSwing(Boolean vaneHorizontalSwing) { + this.vaneHorizontalSwing = vaneHorizontalSwing; + } + + public Integer getOperationMode() { + return operationMode; + } + + public void setOperationMode(Integer operationMode) { + this.operationMode = operationMode; + } + + public Integer getEffectiveFlags() { + return effectiveFlags; + } + + public void setEffectiveFlags(Integer effectiveFlags) { + this.effectiveFlags = effectiveFlags; + } + + public Integer getLastEffectiveFlags() { + return lastEffectiveFlags; + } + + public void setLastEffectiveFlags(Integer lastEffectiveFlags) { + this.lastEffectiveFlags = lastEffectiveFlags; + } + + public Boolean getInStandbyMode() { + return inStandbyMode; + } + + public void setInStandbyMode(Boolean inStandbyMode) { + this.inStandbyMode = inStandbyMode; + } + + public Double getDefaultCoolingSetTemperature() { + return defaultCoolingSetTemperature; + } + + public void setDefaultCoolingSetTemperature(Double defaultCoolingSetTemperature) { + this.defaultCoolingSetTemperature = defaultCoolingSetTemperature; + } + + public Double getDefaultHeatingSetTemperature() { + return defaultHeatingSetTemperature; + } + + public void setDefaultHeatingSetTemperature(Double defaultHeatingSetTemperature) { + this.defaultHeatingSetTemperature = defaultHeatingSetTemperature; + } + + public Integer getRoomTemperatureLabel() { + return roomTemperatureLabel; + } + + public void setRoomTemperatureLabel(Integer roomTemperatureLabel) { + this.roomTemperatureLabel = roomTemperatureLabel; + } + + public Boolean getHasEnergyConsumedMeter() { + return hasEnergyConsumedMeter; + } + + public void setHasEnergyConsumedMeter(Boolean hasEnergyConsumedMeter) { + this.hasEnergyConsumedMeter = hasEnergyConsumedMeter; + } + + public Integer getCurrentEnergyConsumed() { + return currentEnergyConsumed; + } + + public void setCurrentEnergyConsumed(Integer currentEnergyConsumed) { + this.currentEnergyConsumed = currentEnergyConsumed; + } + + public Integer getCurrentEnergyMode() { + return currentEnergyMode; + } + + public void setCurrentEnergyMode(Integer currentEnergyMode) { + this.currentEnergyMode = currentEnergyMode; + } + + public Boolean getCoolingDisabled() { + return coolingDisabled; + } + + public void setCoolingDisabled(Boolean coolingDisabled) { + this.coolingDisabled = coolingDisabled; + } + + public Integer getMinPcycle() { + return minPcycle; + } + + public void setMinPcycle(Integer minPcycle) { + this.minPcycle = minPcycle; + } + + public Integer getMaxPcycle() { + return maxPcycle; + } + + public void setMaxPcycle(Integer maxPcycle) { + this.maxPcycle = maxPcycle; + } + + public Integer getEffectivePCycle() { + return effectivePCycle; + } + + public void setEffectivePCycle(Integer effectivePCycle) { + this.effectivePCycle = effectivePCycle; + } + + public Integer getMaxOutdoorUnits() { + return maxOutdoorUnits; + } + + public void setMaxOutdoorUnits(Integer maxOutdoorUnits) { + this.maxOutdoorUnits = maxOutdoorUnits; + } + + public Integer getMaxIndoorUnits() { + return maxIndoorUnits; + } + + public void setMaxIndoorUnits(Integer maxIndoorUnits) { + this.maxIndoorUnits = maxIndoorUnits; + } + + public Integer getMaxTemperatureControlUnits() { + return maxTemperatureControlUnits; + } + + public void setMaxTemperatureControlUnits(Integer maxTemperatureControlUnits) { + this.maxTemperatureControlUnits = maxTemperatureControlUnits; + } + + public Integer getDeviceID() { + return deviceID; + } + + public void setDeviceID(Integer deviceID) { + this.deviceID = deviceID; + } + + public String getMacAddress() { + return macAddress; + } + + public void setMacAddress(String macAddress) { + this.macAddress = macAddress; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public Integer getTimeZoneID() { + return timeZoneID; + } + + public void setTimeZoneID(Integer timeZoneID) { + this.timeZoneID = timeZoneID; + } + + public Integer getDiagnosticMode() { + return diagnosticMode; + } + + public void setDiagnosticMode(Integer diagnosticMode) { + this.diagnosticMode = diagnosticMode; + } + + public Object getDiagnosticEndDate() { + return diagnosticEndDate; + } + + public void setDiagnosticEndDate(Object diagnosticEndDate) { + this.diagnosticEndDate = diagnosticEndDate; + } + + public Integer getExpectedCommand() { + return expectedCommand; + } + + public void setExpectedCommand(Integer expectedCommand) { + this.expectedCommand = expectedCommand; + } + + public Object getOwner() { + return owner; + } + + public void setOwner(Object owner) { + this.owner = owner; + } + + public Object getDetectedCountry() { + return detectedCountry; + } + + public void setDetectedCountry(Object detectedCountry) { + this.detectedCountry = detectedCountry; + } + + public Integer getAdaptorType() { + return adaptorType; + } + + public void setAdaptorType(Integer adaptorType) { + this.adaptorType = adaptorType; + } + + public Object getFirmwareDeployment() { + return firmwareDeployment; + } + + public void setFirmwareDeployment(Object firmwareDeployment) { + this.firmwareDeployment = firmwareDeployment; + } + + public Boolean getFirmwareUpdateAborted() { + return firmwareUpdateAborted; + } + + public void setFirmwareUpdateAborted(Boolean firmwareUpdateAborted) { + this.firmwareUpdateAborted = firmwareUpdateAborted; + } + + public Integer getWifiSignalStrength() { + return wifiSignalStrength; + } + + public void setWifiSignalStrength(Integer wifiSignalStrength) { + this.wifiSignalStrength = wifiSignalStrength; + } + + public String getWifiAdapterStatus() { + return wifiAdapterStatus; + } + + public void setWifiAdapterStatus(String wifiAdapterStatus) { + this.wifiAdapterStatus = wifiAdapterStatus; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public Integer getPCycle() { + return pCycle; + } + + public void setPCycle(Integer pCycle) { + this.pCycle = pCycle; + } + + public Integer getRecordNumMax() { + return recordNumMax; + } + + public void setRecordNumMax(Integer recordNumMax) { + this.recordNumMax = recordNumMax; + } + + public String getLastTimeStamp() { + return lastTimeStamp; + } + + public void setLastTimeStamp(String lastTimeStamp) { + this.lastTimeStamp = lastTimeStamp; + } + + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(Integer errorCode) { + this.errorCode = errorCode; + } + + public Boolean getHasError() { + return hasError; + } + + public void setHasError(Boolean hasError) { + this.hasError = hasError; + } + + public String getLastReset() { + return lastReset; + } + + public void setLastReset(String lastReset) { + this.lastReset = lastReset; + } + + public Integer getFlashWrites() { + return flashWrites; + } + + public void setFlashWrites(Integer flashWrites) { + this.flashWrites = flashWrites; + } + + public Object getScene() { + return scene; + } + + public void setScene(Object scene) { + this.scene = scene; + } + + public Object getSSLExpirationDate() { + return sSLExpirationDate; + } + + public void setSSLExpirationDate(Object sSLExpirationDate) { + this.sSLExpirationDate = sSLExpirationDate; + } + + public Object getSPTimeout() { + return sPTimeout; + } + + public void setSPTimeout(Object sPTimeout) { + this.sPTimeout = sPTimeout; + } + + public Object getPasscode() { + return passcode; + } + + public void setPasscode(Object passcode) { + this.passcode = passcode; + } + + public Boolean getServerCommunicationDisabled() { + return serverCommunicationDisabled; + } + + public void setServerCommunicationDisabled(Boolean serverCommunicationDisabled) { + this.serverCommunicationDisabled = serverCommunicationDisabled; + } + + public Integer getConsecutiveUploadErrors() { + return consecutiveUploadErrors; + } + + public void setConsecutiveUploadErrors(Integer consecutiveUploadErrors) { + this.consecutiveUploadErrors = consecutiveUploadErrors; + } + + public Object getDoNotRespondAfter() { + return doNotRespondAfter; + } + + public void setDoNotRespondAfter(Object doNotRespondAfter) { + this.doNotRespondAfter = doNotRespondAfter; + } + + public Integer getOwnerRoleAccessLevel() { + return ownerRoleAccessLevel; + } + + public void setOwnerRoleAccessLevel(Integer ownerRoleAccessLevel) { + this.ownerRoleAccessLevel = ownerRoleAccessLevel; + } + + public Integer getOwnerCountry() { + return ownerCountry; + } + + public void setOwnerCountry(Integer ownerCountry) { + this.ownerCountry = ownerCountry; + } + + public Object getRate1StartTime() { + return rate1StartTime; + } + + public void setRate1StartTime(Object rate1StartTime) { + this.rate1StartTime = rate1StartTime; + } + + public Object getRate2StartTime() { + return rate2StartTime; + } + + public void setRate2StartTime(Object rate2StartTime) { + this.rate2StartTime = rate2StartTime; + } + + public Integer getProtocolVersion() { + return protocolVersion; + } + + public void setProtocolVersion(Integer protocolVersion) { + this.protocolVersion = protocolVersion; + } + + public Integer getUnitVersion() { + return unitVersion; + } + + public void setUnitVersion(Integer unitVersion) { + this.unitVersion = unitVersion; + } + + public Integer getFirmwareAppVersion() { + return firmwareAppVersion; + } + + public void setFirmwareAppVersion(Integer firmwareAppVersion) { + this.firmwareAppVersion = firmwareAppVersion; + } + + public Integer getFirmwareWebVersion() { + return firmwareWebVersion; + } + + public void setFirmwareWebVersion(Integer firmwareWebVersion) { + this.firmwareWebVersion = firmwareWebVersion; + } + + public Integer getFirmwareWlanVersion() { + return firmwareWlanVersion; + } + + public void setFirmwareWlanVersion(Integer firmwareWlanVersion) { + this.firmwareWlanVersion = firmwareWlanVersion; + } + + public Boolean getHasErrorMessages() { + return hasErrorMessages; + } + + public void setHasErrorMessages(Boolean hasErrorMessages) { + this.hasErrorMessages = hasErrorMessages; + } + + public Boolean getHasZone2() { + return hasZone2; + } + + public void setHasZone2(Boolean hasZone2) { + this.hasZone2 = hasZone2; + } + + public Boolean getOffline() { + return offline; + } + + public void setOffline(Boolean offline) { + this.offline = offline; + } + + public List<Object> getUnits() { + return units; + } + + public void setUnits(List<Object> units) { + this.units = units; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceStatus.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceStatus.java new file mode 100644 index 0000000000000..be27f500a9229 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/DeviceStatus.java @@ -0,0 +1,347 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * The {@link DeviceProps} is responsible of JSON data For MELCloud API + * Device Status data + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + * @author Pauli Anttila - Fine tuned expose annotations + */ +public class DeviceStatus { + + @Expose + private Integer effectiveFlags; + + @Expose(serialize = false, deserialize = true) + private Object localIPAddress; + + @Expose(serialize = false, deserialize = true) + private Double roomTemperature; + + @Expose + private Double setTemperature; + + @Expose + private Integer setFanSpeed; + + @Expose + private Integer operationMode; + + @Expose + private Integer vaneHorizontal; + + @Expose + private Integer vaneVertical; + + @Expose + private Object name; + + @Expose(serialize = false, deserialize = true) + private Integer numberOfFanSpeeds; + + @Expose(serialize = false, deserialize = true) + private List<WeatherObservation> weatherObservations = null; + + @Expose(serialize = false, deserialize = true) + private Object errorMessage; + + @Expose(serialize = false, deserialize = true) + private Integer errorCode; + + @Expose(serialize = false, deserialize = true) + private Double defaultHeatingSetTemperature; + + @Expose(serialize = false, deserialize = true) + private Double defaultCoolingSetTemperature; + + @Expose(serialize = false, deserialize = true) + private Boolean hideVaneControls; + + @Expose(serialize = false, deserialize = true) + private Boolean hideDryModeControl; + + @Expose(serialize = false, deserialize = true) + private Integer roomTemperatureLabel; + + @Expose(serialize = false, deserialize = true) + private Boolean inStandbyMode; + + @Expose(serialize = false, deserialize = true) + private Integer temperatureIncrementOverride; + + @Expose + private Integer deviceID; + + @Expose(serialize = false, deserialize = true) + private Integer deviceType; + + @Expose(serialize = false, deserialize = true) + private String lastCommunication; + + @Expose(serialize = false, deserialize = true) + private String nextCommunication; + + @Expose + private Boolean power; + + @Expose + private Boolean hasPendingCommand; + + @Expose(serialize = false, deserialize = true) + private Boolean offline; + + @Expose(serialize = false, deserialize = true) + private Object scene; + + @Expose(serialize = false, deserialize = true) + private Object sceneOwner; + + public Integer getEffectiveFlags() { + return effectiveFlags; + } + + public void setEffectiveFlags(Integer effectiveFlags) { + this.effectiveFlags = effectiveFlags; + } + + public Object getLocalIPAddress() { + return localIPAddress; + } + + public void setLocalIPAddress(Object localIPAddress) { + this.localIPAddress = localIPAddress; + } + + public Double getRoomTemperature() { + return roomTemperature; + } + + public void setRoomTemperature(Double roomTemperature) { + this.roomTemperature = roomTemperature; + } + + public Double getSetTemperature() { + return setTemperature; + } + + public void setSetTemperature(Double setTemperature) { + this.setTemperature = setTemperature; + } + + public Integer getSetFanSpeed() { + return setFanSpeed; + } + + public void setSetFanSpeed(Integer setFanSpeed) { + this.setFanSpeed = setFanSpeed; + } + + public Integer getOperationMode() { + return operationMode; + } + + public void setOperationMode(Integer operationMode) { + this.operationMode = operationMode; + } + + public Integer getVaneHorizontal() { + return vaneHorizontal; + } + + public void setVaneHorizontal(Integer vaneHorizontal) { + this.vaneHorizontal = vaneHorizontal; + } + + public Integer getVaneVertical() { + return vaneVertical; + } + + public void setVaneVertical(Integer vaneVertical) { + this.vaneVertical = vaneVertical; + } + + public Object getName() { + return name; + } + + public void setName(Object name) { + this.name = name; + } + + public Integer getNumberOfFanSpeeds() { + return numberOfFanSpeeds; + } + + public void setNumberOfFanSpeeds(Integer numberOfFanSpeeds) { + this.numberOfFanSpeeds = numberOfFanSpeeds; + } + + public List<WeatherObservation> getWeatherObservations() { + return weatherObservations; + } + + public void setWeatherObservations(List<WeatherObservation> weatherObservations) { + this.weatherObservations = weatherObservations; + } + + public Object getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(Object errorMessage) { + this.errorMessage = errorMessage; + } + + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(Integer errorCode) { + this.errorCode = errorCode; + } + + public Double getDefaultHeatingSetTemperature() { + return defaultHeatingSetTemperature; + } + + public void setDefaultHeatingSetTemperature(Double defaultHeatingSetTemperature) { + this.defaultHeatingSetTemperature = defaultHeatingSetTemperature; + } + + public Double getDefaultCoolingSetTemperature() { + return defaultCoolingSetTemperature; + } + + public void setDefaultCoolingSetTemperature(Double defaultCoolingSetTemperature) { + this.defaultCoolingSetTemperature = defaultCoolingSetTemperature; + } + + public Boolean getHideVaneControls() { + return hideVaneControls; + } + + public void setHideVaneControls(Boolean hideVaneControls) { + this.hideVaneControls = hideVaneControls; + } + + public Boolean getHideDryModeControl() { + return hideDryModeControl; + } + + public void setHideDryModeControl(Boolean hideDryModeControl) { + this.hideDryModeControl = hideDryModeControl; + } + + public Integer getRoomTemperatureLabel() { + return roomTemperatureLabel; + } + + public void setRoomTemperatureLabel(Integer roomTemperatureLabel) { + this.roomTemperatureLabel = roomTemperatureLabel; + } + + public Boolean getInStandbyMode() { + return inStandbyMode; + } + + public void setInStandbyMode(Boolean inStandbyMode) { + this.inStandbyMode = inStandbyMode; + } + + public Integer getTemperatureIncrementOverride() { + return temperatureIncrementOverride; + } + + public void setTemperatureIncrementOverride(Integer temperatureIncrementOverride) { + this.temperatureIncrementOverride = temperatureIncrementOverride; + } + + public Integer getDeviceID() { + return deviceID; + } + + public void setDeviceID(Integer deviceID) { + this.deviceID = deviceID; + } + + public Integer getDeviceType() { + return deviceType; + } + + public void setDeviceType(Integer deviceType) { + this.deviceType = deviceType; + } + + public String getLastCommunication() { + return lastCommunication; + } + + public void setLastCommunication(String lastCommunication) { + this.lastCommunication = lastCommunication; + } + + public String getNextCommunication() { + return nextCommunication; + } + + public void setNextCommunication(String nextCommunication) { + this.nextCommunication = nextCommunication; + } + + public Boolean getPower() { + return power; + } + + public void setPower(Boolean power) { + this.power = power; + } + + public Boolean getHasPendingCommand() { + return hasPendingCommand; + } + + public void setHasPendingCommand(Boolean hasPendingCommand) { + this.hasPendingCommand = hasPendingCommand; + } + + public Boolean getOffline() { + return offline; + } + + public void setOffline(Boolean offline) { + this.offline = offline; + } + + public Object getScene() { + return scene; + } + + public void setScene(Object scene) { + this.scene = scene; + } + + public Object getSceneOwner() { + return sceneOwner; + } + + public void setSceneOwner(Object sceneOwner) { + this.sceneOwner = sceneOwner; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Floor.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Floor.java new file mode 100644 index 0000000000000..efbad742843c5 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Floor.java @@ -0,0 +1,148 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * {@link Floor} provides floor specific information for JSON data returned from MELCloud API + * Floor Data + * Generated with jsonschema2pojo + * + * @author Wietse van Buitenen - Initial contribution + */ +public class Floor { + + @Expose + private Integer iD; + + @Expose + private String name; + + @Expose + private Integer buildingId; + + @Expose + private Integer accessLevel; + + @Expose + private Boolean directAccess; + + @Expose + private Object endDate; + + @Expose + private List<Area> areas = null; + + @Expose + private List<Device> devices = null; + + @Expose + private Integer minTemperature; + + @Expose + private Integer maxTemperature; + + @Expose + private Boolean expanded; + + public Integer getID() { + return iD; + } + + public void setID(Integer iD) { + this.iD = iD; + } + + public Integer getBuildingId() { + return buildingId; + } + + public void setBuildingId(Integer buildingId) { + this.buildingId = buildingId; + } + + public Integer getAccessLevel() { + return accessLevel; + } + + public void setAccessLevel(Integer accessLevel) { + this.accessLevel = accessLevel; + } + + public Boolean getDirectAccess() { + return directAccess; + } + + public void setDirectAccess(Boolean directAccess) { + this.directAccess = directAccess; + } + + public Object getEndDate() { + return endDate; + } + + public void setEndDate(Object endDate) { + this.endDate = endDate; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List<Area> getAreas() { + return areas; + } + + public void setAreas(List<Area> areas) { + this.areas = areas; + } + + public List<Device> getDevices() { + return devices; + } + + public void setDevices(List<Device> devices) { + this.devices = devices; + } + + public Integer getMinTemperature() { + return minTemperature; + } + + public void setMinTemperature(Integer minTemperature) { + this.minTemperature = minTemperature; + } + + public Integer getMaxTemperature() { + return maxTemperature; + } + + public void setMaxTemperature(Integer maxTemperature) { + this.maxTemperature = maxTemperature; + } + + public Boolean getExpanded() { + return expanded; + } + + public void setExpanded(Boolean expanded) { + this.expanded = expanded; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/HeatpumpDeviceStatus.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/HeatpumpDeviceStatus.java new file mode 100644 index 0000000000000..70c6613e6700c --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/HeatpumpDeviceStatus.java @@ -0,0 +1,477 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * {@link HeatpumpDeviceStatus} is the JSON data we receive from the MELCloud API + * when performing a request to DeviceType 1. + * Generated with jsonschema2pojo + * + * @author Wietse van Buitenen - Initial contribution + */ +public class HeatpumpDeviceStatus { + @Expose + private Long effectiveFlags; + + @Expose(serialize = false, deserialize = true) + private Object localIPAddress; + + @Expose + private Double setTemperatureZone1; + + @Expose + private Double setTemperatureZone2; + + @Expose(serialize = false, deserialize = true) + private Double roomTemperatureZone1; + + @Expose(serialize = false, deserialize = true) + private Double roomTemperatureZone2; + + @Expose + private Integer operationMode; + + @Expose + private Integer operationModeZone1; + + @Expose + private Integer operationModeZone2; + + @Expose(serialize = false, deserialize = true) + private List<WeatherObservation> weatherObservations = null; + + @Expose(serialize = false, deserialize = true) + private Object errorMessage; + + @Expose(serialize = false, deserialize = true) + private Integer errorCode; + + @Expose + private Double setHeatFlowTemperatureZone1; + + @Expose + private Double setHeatFlowTemperatureZone2; + + @Expose + private Double setCoolFlowTemperatureZone1; + + @Expose + private Double setCoolFlowTemperatureZone2; + + @Expose + private Integer hCControlType; + + @Expose(serialize = false, deserialize = true) + private Double tankWaterTemperature; + + @Expose + private Double setTankWaterTemperature; + + @Expose + private Boolean forcedHotWaterMode; + + @Expose + private Integer unitStatus; + + @Expose + private Double outdoorTemperature; + + @Expose + private Boolean ecoHotWater; + + @Expose + private Object zone1Name; + + @Expose + private Object zone2Name; + + @Expose + private Boolean holidayMode; + + @Expose + private Boolean prohibitZone1; + + @Expose + private Boolean prohibitZone2; + + @Expose + private Boolean prohibitHotWater; + + @Expose + private Integer temperatureIncrementOverride; + + @Expose + private Boolean idleZone1; + + @Expose + private Boolean idleZone2; + + @Expose + private Integer deviceID; + + @Expose + private Integer deviceType; + + @Expose(serialize = false, deserialize = true) + private String lastCommunication; + + @Expose(serialize = false, deserialize = true) + private String nextCommunication; + + @Expose + private Boolean power; + + @Expose(serialize = false, deserialize = true) + private Boolean hasPendingCommand; + + @Expose(serialize = false, deserialize = true) + private Boolean offline; + + @Expose + private Object scene; + + @Expose + private Object sceneOwner; + + public Long getEffectiveFlags() { + return effectiveFlags; + } + + public void setEffectiveFlags(Long effectiveFlags) { + this.effectiveFlags = effectiveFlags; + } + + public Object getLocalIPAddress() { + return localIPAddress; + } + + public void setLocalIPAddress(Object localIPAddress) { + this.localIPAddress = localIPAddress; + } + + public Double getSetTemperatureZone1() { + return setTemperatureZone1; + } + + public void setSetTemperatureZone1(Double setTemperatureZone1) { + this.setTemperatureZone1 = setTemperatureZone1; + } + + public Double getSetTemperatureZone2() { + return setTemperatureZone2; + } + + public void setSetTemperatureZone2(Double setTemperatureZone2) { + this.setTemperatureZone2 = setTemperatureZone2; + } + + public Double getRoomTemperatureZone1() { + return roomTemperatureZone1; + } + + public void setRoomTemperatureZone1(Double roomTemperatureZone1) { + this.roomTemperatureZone1 = roomTemperatureZone1; + } + + public Double getRoomTemperatureZone2() { + return roomTemperatureZone2; + } + + public void setRoomTemperatureZone2(Double roomTemperatureZone2) { + this.roomTemperatureZone2 = roomTemperatureZone2; + } + + public Integer getOperationMode() { + return operationMode; + } + + public void setOperationMode(Integer operationMode) { + this.operationMode = operationMode; + } + + public Integer getOperationModeZone1() { + return operationModeZone1; + } + + public void setOperationModeZone1(Integer operationModeZone1) { + this.operationModeZone1 = operationModeZone1; + } + + public Integer getOperationModeZone2() { + return operationModeZone2; + } + + public void setOperationModeZone2(Integer operationModeZone2) { + this.operationModeZone2 = operationModeZone2; + } + + public List<WeatherObservation> getWeatherObservations() { + return weatherObservations; + } + + public void setWeatherObservations(List<WeatherObservation> weatherObservations) { + this.weatherObservations = weatherObservations; + } + + public Object getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(Object errorMessage) { + this.errorMessage = errorMessage; + } + + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(Integer errorCode) { + this.errorCode = errorCode; + } + + public Double getSetHeatFlowTemperatureZone1() { + return setHeatFlowTemperatureZone1; + } + + public void setSetHeatFlowTemperatureZone1(Double setHeatFlowTemperatureZone1) { + this.setHeatFlowTemperatureZone1 = setHeatFlowTemperatureZone1; + } + + public Double getSetHeatFlowTemperatureZone2() { + return setHeatFlowTemperatureZone2; + } + + public void setSetHeatFlowTemperatureZone2(Double setHeatFlowTemperatureZone2) { + this.setHeatFlowTemperatureZone2 = setHeatFlowTemperatureZone2; + } + + public Double getSetCoolFlowTemperatureZone1() { + return setCoolFlowTemperatureZone1; + } + + public void setSetCoolFlowTemperatureZone1(Double setCoolFlowTemperatureZone1) { + this.setCoolFlowTemperatureZone1 = setCoolFlowTemperatureZone1; + } + + public Double getSetCoolFlowTemperatureZone2() { + return setCoolFlowTemperatureZone2; + } + + public void setSetCoolFlowTemperatureZone2(Double setCoolFlowTemperatureZone2) { + this.setCoolFlowTemperatureZone2 = setCoolFlowTemperatureZone2; + } + + public Integer getHCControlType() { + return hCControlType; + } + + public void setHCControlType(Integer hCControlType) { + this.hCControlType = hCControlType; + } + + public Double getTankWaterTemperature() { + return tankWaterTemperature; + } + + public void setTankWaterTemperature(Double tankWaterTemperature) { + this.tankWaterTemperature = tankWaterTemperature; + } + + public Double getSetTankWaterTemperature() { + return setTankWaterTemperature; + } + + public void setSetTankWaterTemperature(Double setTankWaterTemperature) { + this.setTankWaterTemperature = setTankWaterTemperature; + } + + public Boolean getForcedHotWaterMode() { + return forcedHotWaterMode; + } + + public void setForcedHotWaterMode(Boolean forcedHotWaterMode) { + this.forcedHotWaterMode = forcedHotWaterMode; + } + + public Integer getUnitStatus() { + return unitStatus; + } + + public void setUnitStatus(Integer unitStatus) { + this.unitStatus = unitStatus; + } + + public Double getOutdoorTemperature() { + return outdoorTemperature; + } + + public void setOutdoorTemperature(Double outdoorTemperature) { + this.outdoorTemperature = outdoorTemperature; + } + + public Boolean getEcoHotWater() { + return ecoHotWater; + } + + public void setEcoHotWater(Boolean ecoHotWater) { + this.ecoHotWater = ecoHotWater; + } + + public Object getZone1Name() { + return zone1Name; + } + + public void setZone1Name(Object zone1Name) { + this.zone1Name = zone1Name; + } + + public Object getZone2Name() { + return zone2Name; + } + + public void setZone2Name(Object zone2Name) { + this.zone2Name = zone2Name; + } + + public Boolean getHolidayMode() { + return holidayMode; + } + + public void setHolidayMode(Boolean holidayMode) { + this.holidayMode = holidayMode; + } + + public Boolean getProhibitZone1() { + return prohibitZone1; + } + + public void setProhibitZone1(Boolean prohibitZone1) { + this.prohibitZone1 = prohibitZone1; + } + + public Boolean getProhibitZone2() { + return prohibitZone2; + } + + public void setProhibitZone2(Boolean prohibitZone2) { + this.prohibitZone2 = prohibitZone2; + } + + public Boolean getProhibitHotWater() { + return prohibitHotWater; + } + + public void setProhibitHotWater(Boolean prohibitHotWater) { + this.prohibitHotWater = prohibitHotWater; + } + + public Integer getTemperatureIncrementOverride() { + return temperatureIncrementOverride; + } + + public void setTemperatureIncrementOverride(Integer temperatureIncrementOverride) { + this.temperatureIncrementOverride = temperatureIncrementOverride; + } + + public Boolean getIdleZone1() { + return idleZone1; + } + + public void setIdleZone1(Boolean idleZone1) { + this.idleZone1 = idleZone1; + } + + public Boolean getIdleZone2() { + return idleZone2; + } + + public void setIdleZone2(Boolean idleZone2) { + this.idleZone2 = idleZone2; + } + + public Integer getDeviceID() { + return deviceID; + } + + public void setDeviceID(Integer deviceID) { + this.deviceID = deviceID; + } + + public Integer getDeviceType() { + return deviceType; + } + + public void setDeviceType(Integer deviceType) { + this.deviceType = deviceType; + } + + public String getLastCommunication() { + return lastCommunication; + } + + public void setLastCommunication(String lastCommunication) { + this.lastCommunication = lastCommunication; + } + + public String getNextCommunication() { + return nextCommunication; + } + + public void setNextCommunication(String nextCommunication) { + this.nextCommunication = nextCommunication; + } + + public Boolean getPower() { + return power; + } + + public void setPower(Boolean power) { + this.power = power; + } + + public Boolean getHasPendingCommand() { + return hasPendingCommand; + } + + public void setHasPendingCommand(Boolean hasPendingCommand) { + this.hasPendingCommand = hasPendingCommand; + } + + public Boolean getOffline() { + return offline; + } + + public void setOffline(Boolean offline) { + this.offline = offline; + } + + public Object getScene() { + return scene; + } + + public void setScene(Object scene) { + this.scene = scene; + } + + public Object getSceneOwner() { + return sceneOwner; + } + + public void setSceneOwner(Object sceneOwner) { + this.sceneOwner = sceneOwner; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/ListDevicesResponse.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/ListDevicesResponse.java new file mode 100644 index 0000000000000..fb73467feb1e4 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/ListDevicesResponse.java @@ -0,0 +1,445 @@ +/** + * 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.melcloud.internal.api.json; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * The {@link ListDevicesResponse} is responsible of JSON data For MELCloud API + * Response of Devices List. + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class ListDevicesResponse { + + @Expose + private Integer iD; + + @Expose + private String name; + + @Expose + private String addressLine1; + + @Expose + private Object addressLine2; + + @Expose + private String city; + + @Expose + private String postcode; + + @Expose + private Double latitude; + + @Expose + private Double longitude; + + @Expose + private Object district; + + @Expose + private Boolean fPDefined; + + @Expose + private Boolean fPEnabled; + + @Expose + private Integer fPMinTemperature; + + @Expose + private Integer fPMaxTemperature; + + @Expose + private Boolean hMDefined; + + @Expose + private Boolean hMEnabled; + + @Expose + private Object hMStartDate; + + @Expose + private Object hMEndDate; + + @Expose + private Integer buildingType; + + @Expose + private Integer propertyType; + + @Expose + private String dateBuilt; + + @Expose + private Boolean hasGasSupply; + + @Expose + private String locationLookupDate; + + @Expose + private Integer country; + + @Expose + private Integer timeZoneContinent; + + @Expose + private Integer timeZoneCity; + + @Expose + private Integer timeZone; + + @Expose + private Integer location; + + @Expose + private Boolean coolingDisabled; + + @Expose + private Boolean expanded; + + @Expose + private Structure structure; + + @Expose + private Integer accessLevel; + + @Expose + private Boolean directAccess; + + @Expose + private Integer minTemperature; + + @Expose + private Integer maxTemperature; + + @Expose + private Object owner; + + @Expose + private String endDate; + + @SerializedName("iDateBuilt") + @Expose + private Object iDateBuilt; + + @Expose + private QuantizedCoordinates quantizedCoordinates; + + public Integer getID() { + return iD; + } + + public void setID(Integer iD) { + this.iD = iD; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddressLine1() { + return addressLine1; + } + + public void setAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + } + + public Object getAddressLine2() { + return addressLine2; + } + + public void setAddressLine2(Object addressLine2) { + this.addressLine2 = addressLine2; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPostcode() { + return postcode; + } + + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + public Object getDistrict() { + return district; + } + + public void setDistrict(Object district) { + this.district = district; + } + + public Boolean getFPDefined() { + return fPDefined; + } + + public void setFPDefined(Boolean fPDefined) { + this.fPDefined = fPDefined; + } + + public Boolean getFPEnabled() { + return fPEnabled; + } + + public void setFPEnabled(Boolean fPEnabled) { + this.fPEnabled = fPEnabled; + } + + public Integer getFPMinTemperature() { + return fPMinTemperature; + } + + public void setFPMinTemperature(Integer fPMinTemperature) { + this.fPMinTemperature = fPMinTemperature; + } + + public Integer getFPMaxTemperature() { + return fPMaxTemperature; + } + + public void setFPMaxTemperature(Integer fPMaxTemperature) { + this.fPMaxTemperature = fPMaxTemperature; + } + + public Boolean getHMDefined() { + return hMDefined; + } + + public void setHMDefined(Boolean hMDefined) { + this.hMDefined = hMDefined; + } + + public Boolean getHMEnabled() { + return hMEnabled; + } + + public void setHMEnabled(Boolean hMEnabled) { + this.hMEnabled = hMEnabled; + } + + public Object getHMStartDate() { + return hMStartDate; + } + + public void setHMStartDate(Object hMStartDate) { + this.hMStartDate = hMStartDate; + } + + public Object getHMEndDate() { + return hMEndDate; + } + + public void setHMEndDate(Object hMEndDate) { + this.hMEndDate = hMEndDate; + } + + public Integer getBuildingType() { + return buildingType; + } + + public void setBuildingType(Integer buildingType) { + this.buildingType = buildingType; + } + + public Integer getPropertyType() { + return propertyType; + } + + public void setPropertyType(Integer propertyType) { + this.propertyType = propertyType; + } + + public String getDateBuilt() { + return dateBuilt; + } + + public void setDateBuilt(String dateBuilt) { + this.dateBuilt = dateBuilt; + } + + public Boolean getHasGasSupply() { + return hasGasSupply; + } + + public void setHasGasSupply(Boolean hasGasSupply) { + this.hasGasSupply = hasGasSupply; + } + + public String getLocationLookupDate() { + return locationLookupDate; + } + + public void setLocationLookupDate(String locationLookupDate) { + this.locationLookupDate = locationLookupDate; + } + + public Integer getCountry() { + return country; + } + + public void setCountry(Integer country) { + this.country = country; + } + + public Integer getTimeZoneContinent() { + return timeZoneContinent; + } + + public void setTimeZoneContinent(Integer timeZoneContinent) { + this.timeZoneContinent = timeZoneContinent; + } + + public Integer getTimeZoneCity() { + return timeZoneCity; + } + + public void setTimeZoneCity(Integer timeZoneCity) { + this.timeZoneCity = timeZoneCity; + } + + public Integer getTimeZone() { + return timeZone; + } + + public void setTimeZone(Integer timeZone) { + this.timeZone = timeZone; + } + + public Integer getLocation() { + return location; + } + + public void setLocation(Integer location) { + this.location = location; + } + + public Boolean getCoolingDisabled() { + return coolingDisabled; + } + + public void setCoolingDisabled(Boolean coolingDisabled) { + this.coolingDisabled = coolingDisabled; + } + + public Boolean getExpanded() { + return expanded; + } + + public void setExpanded(Boolean expanded) { + this.expanded = expanded; + } + + public Structure getStructure() { + return structure; + } + + public void setStructure(Structure structure) { + this.structure = structure; + } + + public Integer getAccessLevel() { + return accessLevel; + } + + public void setAccessLevel(Integer accessLevel) { + this.accessLevel = accessLevel; + } + + public Boolean getDirectAccess() { + return directAccess; + } + + public void setDirectAccess(Boolean directAccess) { + this.directAccess = directAccess; + } + + public Integer getMinTemperature() { + return minTemperature; + } + + public void setMinTemperature(Integer minTemperature) { + this.minTemperature = minTemperature; + } + + public Integer getMaxTemperature() { + return maxTemperature; + } + + public void setMaxTemperature(Integer maxTemperature) { + this.maxTemperature = maxTemperature; + } + + public Object getOwner() { + return owner; + } + + public void setOwner(Object owner) { + this.owner = owner; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public Object getIDateBuilt() { + return iDateBuilt; + } + + public void setIDateBuilt(Object iDateBuilt) { + this.iDateBuilt = iDateBuilt; + } + + public QuantizedCoordinates getQuantizedCoordinates() { + return quantizedCoordinates; + } + + public void setQuantizedCoordinates(QuantizedCoordinates quantizedCoordinates) { + this.quantizedCoordinates = quantizedCoordinates; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginClientResponse.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginClientResponse.java new file mode 100644 index 0000000000000..dda1b222e2068 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginClientResponse.java @@ -0,0 +1,159 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * The {@link LoginClientResponse} is responsible of JSON data For MELCloud API + * Response Data of Login. + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class LoginClientResponse { + + @Expose + private Object errorId; + + @Expose + private Object errorMessage; + + @Expose + private Integer loginStatus; + + @Expose + private Integer userId; + + @Expose + private Object randomKey; + + @Expose + private Object appVersionAnnouncement; + + @Expose + private LoginData loginData; + + @Expose + private List<Object> listPendingInvite = null; + + @Expose + private List<Object> listOwnershipChangeRequest = null; + + @Expose + private List<Object> listPendingAnnouncement = null; + + @Expose + private Integer loginMinutes; + + @Expose + private Integer loginAttempts; + + public Object getErrorId() { + return errorId; + } + + public void setErrorId(Object errorId) { + this.errorId = errorId; + } + + public Object getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(Object errorMessage) { + this.errorMessage = errorMessage; + } + + public Integer getLoginStatus() { + return loginStatus; + } + + public void setLoginStatus(Integer loginStatus) { + this.loginStatus = loginStatus; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Object getRandomKey() { + return randomKey; + } + + public void setRandomKey(Object randomKey) { + this.randomKey = randomKey; + } + + public Object getAppVersionAnnouncement() { + return appVersionAnnouncement; + } + + public void setAppVersionAnnouncement(Object appVersionAnnouncement) { + this.appVersionAnnouncement = appVersionAnnouncement; + } + + public LoginData getLoginData() { + return loginData; + } + + public void setLoginData(LoginData loginData) { + this.loginData = loginData; + } + + public List<Object> getListPendingInvite() { + return listPendingInvite; + } + + public void setListPendingInvite(List<Object> listPendingInvite) { + this.listPendingInvite = listPendingInvite; + } + + public List<Object> getListOwnershipChangeRequest() { + return listOwnershipChangeRequest; + } + + public void setListOwnershipChangeRequest(List<Object> listOwnershipChangeRequest) { + this.listOwnershipChangeRequest = listOwnershipChangeRequest; + } + + public List<Object> getListPendingAnnouncement() { + return listPendingAnnouncement; + } + + public void setListPendingAnnouncement(List<Object> listPendingAnnouncement) { + this.listPendingAnnouncement = listPendingAnnouncement; + } + + public Integer getLoginMinutes() { + return loginMinutes; + } + + public void setLoginMinutes(Integer loginMinutes) { + this.loginMinutes = loginMinutes; + } + + public Integer getLoginAttempts() { + return loginAttempts; + } + + public void setLoginAttempts(Integer loginAttempts) { + this.loginAttempts = loginAttempts; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginData.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginData.java new file mode 100644 index 0000000000000..2ddefdbd0859d --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/LoginData.java @@ -0,0 +1,510 @@ +/** + * 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.melcloud.internal.api.json; + +import com.google.gson.annotations.Expose; + +/** + * The {@link LoginData} is responsible of JSON data For MELCloud API + * LoginData for Login Request. + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class LoginData { + + @Expose + private String contextKey; + + @Expose + private Integer client; + + @Expose + private Integer terms; + + @Expose + private Integer aL; + + @Expose + private Integer mL; + + @Expose + private Boolean cMI; + + @Expose + private Boolean isStaff; + + @Expose + private Boolean cUTF; + + @Expose + private Boolean cAA; + + @Expose + private Boolean receiveCountryNotifications; + + @Expose + private Boolean receiveAllNotifications; + + @Expose + private Boolean cACA; + + @Expose + private Boolean cAGA; + + @Expose + private Integer maximumDevices; + + @Expose + private Boolean showDiagnostics; + + @Expose + private Integer language; + + @Expose + private Integer country; + + @Expose + private Integer realClient; + + @Expose + private String name; + + @Expose + private Boolean useFahrenheit; + + @Expose + private Integer duration; + + @Expose + private String expiry; + + @Expose + private Boolean cMSC; + + @Expose + private Object partnerApplicationVersion; + + @Expose + private Boolean emailSettingsReminderShown; + + @Expose + private Integer emailUnitErrors; + + @Expose + private Integer emailCommsErrors; + + @Expose + private Boolean isImpersonated; + + @Expose + private String languageCode; + + @Expose + private String countryName; + + @Expose + private String currencySymbol; + + @Expose + private String supportEmailAddress; + + @Expose + private String dateSeperator; + + @Expose + private String timeSeperator; + + @Expose + private String atwLogoFile; + + @Expose + private Boolean dECCReport; + + @Expose + private Boolean cSVReport1min; + + @Expose + private Boolean hidePresetPanel; + + @Expose + private Boolean emailSettingsReminderRequired; + + @Expose + private Object termsText; + + @Expose + private Boolean mapView; + + @Expose + private Integer mapZoom; + + @Expose + private Double mapLongitude; + + @Expose + private Double mapLatitude; + + public String getContextKey() { + return contextKey; + } + + public void setContextKey(String contextKey) { + this.contextKey = contextKey; + } + + public Integer getClient() { + return client; + } + + public void setClient(Integer client) { + this.client = client; + } + + public Integer getTerms() { + return terms; + } + + public void setTerms(Integer terms) { + this.terms = terms; + } + + public Integer getAL() { + return aL; + } + + public void setAL(Integer aL) { + this.aL = aL; + } + + public Integer getML() { + return mL; + } + + public void setML(Integer mL) { + this.mL = mL; + } + + public Boolean getCMI() { + return cMI; + } + + public void setCMI(Boolean cMI) { + this.cMI = cMI; + } + + public Boolean getIsStaff() { + return isStaff; + } + + public void setIsStaff(Boolean isStaff) { + this.isStaff = isStaff; + } + + public Boolean getCUTF() { + return cUTF; + } + + public void setCUTF(Boolean cUTF) { + this.cUTF = cUTF; + } + + public Boolean getCAA() { + return cAA; + } + + public void setCAA(Boolean cAA) { + this.cAA = cAA; + } + + public Boolean getReceiveCountryNotifications() { + return receiveCountryNotifications; + } + + public void setReceiveCountryNotifications(Boolean receiveCountryNotifications) { + this.receiveCountryNotifications = receiveCountryNotifications; + } + + public Boolean getReceiveAllNotifications() { + return receiveAllNotifications; + } + + public void setReceiveAllNotifications(Boolean receiveAllNotifications) { + this.receiveAllNotifications = receiveAllNotifications; + } + + public Boolean getCACA() { + return cACA; + } + + public void setCACA(Boolean cACA) { + this.cACA = cACA; + } + + public Boolean getCAGA() { + return cAGA; + } + + public void setCAGA(Boolean cAGA) { + this.cAGA = cAGA; + } + + public Integer getMaximumDevices() { + return maximumDevices; + } + + public void setMaximumDevices(Integer maximumDevices) { + this.maximumDevices = maximumDevices; + } + + public Boolean getShowDiagnostics() { + return showDiagnostics; + } + + public void setShowDiagnostics(Boolean showDiagnostics) { + this.showDiagnostics = showDiagnostics; + } + + public Integer getLanguage() { + return language; + } + + public void setLanguage(Integer language) { + this.language = language; + } + + public Integer getCountry() { + return country; + } + + public void setCountry(Integer country) { + this.country = country; + } + + public Integer getRealClient() { + return realClient; + } + + public void setRealClient(Integer realClient) { + this.realClient = realClient; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Boolean getUseFahrenheit() { + return useFahrenheit; + } + + public void setUseFahrenheit(Boolean useFahrenheit) { + this.useFahrenheit = useFahrenheit; + } + + public Integer getDuration() { + return duration; + } + + public void setDuration(Integer duration) { + this.duration = duration; + } + + public String getExpiry() { + return expiry; + } + + public void setExpiry(String expiry) { + this.expiry = expiry; + } + + public Boolean getCMSC() { + return cMSC; + } + + public void setCMSC(Boolean cMSC) { + this.cMSC = cMSC; + } + + public Object getPartnerApplicationVersion() { + return partnerApplicationVersion; + } + + public void setPartnerApplicationVersion(Object partnerApplicationVersion) { + this.partnerApplicationVersion = partnerApplicationVersion; + } + + public Boolean getEmailSettingsReminderShown() { + return emailSettingsReminderShown; + } + + public void setEmailSettingsReminderShown(Boolean emailSettingsReminderShown) { + this.emailSettingsReminderShown = emailSettingsReminderShown; + } + + public Integer getEmailUnitErrors() { + return emailUnitErrors; + } + + public void setEmailUnitErrors(Integer emailUnitErrors) { + this.emailUnitErrors = emailUnitErrors; + } + + public Integer getEmailCommsErrors() { + return emailCommsErrors; + } + + public void setEmailCommsErrors(Integer emailCommsErrors) { + this.emailCommsErrors = emailCommsErrors; + } + + public Boolean getIsImpersonated() { + return isImpersonated; + } + + public void setIsImpersonated(Boolean isImpersonated) { + this.isImpersonated = isImpersonated; + } + + public String getLanguageCode() { + return languageCode; + } + + public void setLanguageCode(String languageCode) { + this.languageCode = languageCode; + } + + public String getCountryName() { + return countryName; + } + + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public String getSupportEmailAddress() { + return supportEmailAddress; + } + + public void setSupportEmailAddress(String supportEmailAddress) { + this.supportEmailAddress = supportEmailAddress; + } + + public String getDateSeperator() { + return dateSeperator; + } + + public void setDateSeperator(String dateSeperator) { + this.dateSeperator = dateSeperator; + } + + public String getTimeSeperator() { + return timeSeperator; + } + + public void setTimeSeperator(String timeSeperator) { + this.timeSeperator = timeSeperator; + } + + public String getAtwLogoFile() { + return atwLogoFile; + } + + public void setAtwLogoFile(String atwLogoFile) { + this.atwLogoFile = atwLogoFile; + } + + public Boolean getDECCReport() { + return dECCReport; + } + + public void setDECCReport(Boolean dECCReport) { + this.dECCReport = dECCReport; + } + + public Boolean getCSVReport1min() { + return cSVReport1min; + } + + public void setCSVReport1min(Boolean cSVReport1min) { + this.cSVReport1min = cSVReport1min; + } + + public Boolean getHidePresetPanel() { + return hidePresetPanel; + } + + public void setHidePresetPanel(Boolean hidePresetPanel) { + this.hidePresetPanel = hidePresetPanel; + } + + public Boolean getEmailSettingsReminderRequired() { + return emailSettingsReminderRequired; + } + + public void setEmailSettingsReminderRequired(Boolean emailSettingsReminderRequired) { + this.emailSettingsReminderRequired = emailSettingsReminderRequired; + } + + public Object getTermsText() { + return termsText; + } + + public void setTermsText(Object termsText) { + this.termsText = termsText; + } + + public Boolean getMapView() { + return mapView; + } + + public void setMapView(Boolean mapView) { + this.mapView = mapView; + } + + public Integer getMapZoom() { + return mapZoom; + } + + public void setMapZoom(Integer mapZoom) { + this.mapZoom = mapZoom; + } + + public Double getMapLongitude() { + return mapLongitude; + } + + public void setMapLongitude(Double mapLongitude) { + this.mapLongitude = mapLongitude; + } + + public Double getMapLatitude() { + return mapLatitude; + } + + public void setMapLatitude(Double mapLatitude) { + this.mapLatitude = mapLatitude; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Preset.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Preset.java new file mode 100644 index 0000000000000..f957f0f6cc08b --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Preset.java @@ -0,0 +1,158 @@ +/** + * 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.melcloud.internal.api.json; + +import com.google.gson.annotations.Expose; + +/** + * The {@link Preset} is responsible of JSON data For MELCloud API + * Preset data + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class Preset { + + @Expose + private Double setTemperature; + + @Expose + private Boolean power; + + @Expose + private Integer operationMode; + + @Expose + private Integer vaneHorizontal; + + @Expose + private Integer vaneVertical; + + @Expose + private Integer fanSpeed; + + @Expose + private Integer iD; + + @Expose + private Integer client; + + @Expose + private Integer deviceLocation; + + @Expose + private Integer number; + + @Expose + private String configuration; + + @Expose + private String numberDescription; + + public Double getSetTemperature() { + return setTemperature; + } + + public void setSetTemperature(Double setTemperature) { + this.setTemperature = setTemperature; + } + + public Boolean getPower() { + return power; + } + + public void setPower(Boolean power) { + this.power = power; + } + + public Integer getOperationMode() { + return operationMode; + } + + public void setOperationMode(Integer operationMode) { + this.operationMode = operationMode; + } + + public Integer getVaneHorizontal() { + return vaneHorizontal; + } + + public void setVaneHorizontal(Integer vaneHorizontal) { + this.vaneHorizontal = vaneHorizontal; + } + + public Integer getVaneVertical() { + return vaneVertical; + } + + public void setVaneVertical(Integer vaneVertical) { + this.vaneVertical = vaneVertical; + } + + public Integer getFanSpeed() { + return fanSpeed; + } + + public void setFanSpeed(Integer fanSpeed) { + this.fanSpeed = fanSpeed; + } + + public Integer getID() { + return iD; + } + + public void setID(Integer iD) { + this.iD = iD; + } + + public Integer getClient() { + return client; + } + + public void setClient(Integer client) { + this.client = client; + } + + public Integer getDeviceLocation() { + return deviceLocation; + } + + public void setDeviceLocation(Integer deviceLocation) { + this.deviceLocation = deviceLocation; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getConfiguration() { + return configuration; + } + + public void setConfiguration(String configuration) { + this.configuration = configuration; + } + + public String getNumberDescription() { + return numberDescription; + } + + public void setNumberDescription(String numberDescription) { + this.numberDescription = numberDescription; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/QuantizedCoordinates.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/QuantizedCoordinates.java new file mode 100644 index 0000000000000..908e913dda071 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/QuantizedCoordinates.java @@ -0,0 +1,48 @@ +/** + * 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.melcloud.internal.api.json; + +import com.google.gson.annotations.Expose; + +/** + * The {@link QuantizedCoordinates} is responsible of JSON data For MELCloud API + * QuantizedCoordinates data + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class QuantizedCoordinates { + + @Expose + private Double latitude; + + @Expose + private Double longitude; + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Structure.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Structure.java new file mode 100644 index 0000000000000..572847cfa5891 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/Structure.java @@ -0,0 +1,73 @@ +/** + * 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.melcloud.internal.api.json; + +import java.util.List; + +import com.google.gson.annotations.Expose; + +/** + * The {@link Structure} is responsible of JSON data For MELCloud API + * Structure Data + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + * @author Wietse van Buitenen - Add Floor and Area + */ +public class Structure { + + @Expose + private List<Floor> floors = null; + + @Expose + private List<Area> areas = null; + + @Expose + private List<Device> devices = null; + + @Expose + private List<Object> clients = null; + + public List<Floor> getFloors() { + return floors; + } + + public void setFloors(List<Floor> floors) { + this.floors = floors; + } + + public List<Area> getAreas() { + return areas; + } + + public void setAreas(List<Area> areas) { + this.areas = areas; + } + + public List<Device> getDevices() { + return devices; + } + + public void setDevices(List<Device> devices) { + this.devices = devices; + } + + public List<Object> getClients() { + return clients; + } + + public void setClients(List<Object> clients) { + this.clients = clients; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/WeatherObservation.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/WeatherObservation.java new file mode 100644 index 0000000000000..ea57239dd41ab --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/api/json/WeatherObservation.java @@ -0,0 +1,147 @@ +/** + * 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.melcloud.internal.api.json; + +import com.google.gson.annotations.Expose; + +/** + * The {@link Structure} is responsible of JSON data For MELCloud API + * WeatherObservation Data + * Generated with jsonschema2pojo + * + * @author Luca Calcaterra - Initial contribution + */ +public class WeatherObservation { + + @Expose + private String date; + + @Expose + private String sunrise; + + @Expose + private String sunset; + + @Expose + private Integer condition; + + @Expose + private Integer iD; + + @Expose + private Integer humidity; + + @Expose + private Integer temperature; + + @Expose + private String icon; + + @Expose + private String conditionName; + + @Expose + private Integer day; + + @Expose + private Integer weatherType; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getSunrise() { + return sunrise; + } + + public void setSunrise(String sunrise) { + this.sunrise = sunrise; + } + + public String getSunset() { + return sunset; + } + + public void setSunset(String sunset) { + this.sunset = sunset; + } + + public Integer getCondition() { + return condition; + } + + public void setCondition(Integer condition) { + this.condition = condition; + } + + public Integer getID() { + return iD; + } + + public void setID(Integer iD) { + this.iD = iD; + } + + public Integer getHumidity() { + return humidity; + } + + public void setHumidity(Integer humidity) { + this.humidity = humidity; + } + + public Integer getTemperature() { + return temperature; + } + + public void setTemperature(Integer temperature) { + this.temperature = temperature; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getConditionName() { + return conditionName; + } + + public void setConditionName(String conditionName) { + this.conditionName = conditionName; + } + + public Integer getDay() { + return day; + } + + public void setDay(Integer day) { + this.day = day; + } + + public Integer getWeatherType() { + return weatherType; + } + + public void setWeatherType(Integer weatherType) { + this.weatherType = weatherType; + } + +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AcDeviceConfig.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AcDeviceConfig.java new file mode 100644 index 0000000000000..46078af7b6504 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AcDeviceConfig.java @@ -0,0 +1,31 @@ +/** + * 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.melcloud.internal.config; + +/** + * Config class for a A.C. device. + * + * @author Pauli Anttila - Initial Contribution + * + */ +public class AcDeviceConfig { + + public Integer deviceID; + public Integer buildingID; + public Integer pollingInterval; + + @Override + public String toString() { + return "[deviceID=" + deviceID + ", buildingID=" + buildingID + ", pollingInterval=" + pollingInterval + "]"; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AccountConfig.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AccountConfig.java new file mode 100644 index 0000000000000..f00d69c34ac5e --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/AccountConfig.java @@ -0,0 +1,38 @@ +/** + * 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.melcloud.internal.config; + +/** + * Config class for MELCloud account parameters. + * + * @author Pauli Anttila - Initial Contribution + * + */ +public class AccountConfig { + + public String username; + public String password; + public int language; + + @Override + public String toString() { + return "[username=" + username + ", password=" + getPasswordForPrinting() + ", languageId=" + language + "]"; + } + + private String getPasswordForPrinting() { + if (password != null) { + return password.isEmpty() ? "<empty>" : "*********"; + } + return "<null>"; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/HeatpumpDeviceConfig.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/HeatpumpDeviceConfig.java new file mode 100644 index 0000000000000..30c8fc4e54cd4 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/config/HeatpumpDeviceConfig.java @@ -0,0 +1,30 @@ +/** + * 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.melcloud.internal.config; + +/** + * Config class for a Heatpump device. + * + * @author Wietse van Buitenen - Initial Contribution + * + */ +public class HeatpumpDeviceConfig { + public Integer deviceID; + public Integer buildingID; + public Integer pollingInterval; + + @Override + public String toString() { + return "[deviceID=" + deviceID + ", buildingID=" + buildingID + ", pollingInterval=" + pollingInterval + "]"; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/discovery/MelCloudDiscoveryService.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/discovery/MelCloudDiscoveryService.java new file mode 100644 index 0000000000000..25f0eb0d58123 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/discovery/MelCloudDiscoveryService.java @@ -0,0 +1,177 @@ +/** + * 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.melcloud.internal.discovery; + +import static org.openhab.binding.melcloud.internal.MelCloudBindingConstants.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.openhab.binding.melcloud.internal.MelCloudBindingConstants; +import org.openhab.binding.melcloud.internal.api.json.Device; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudCommException; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudLoginException; +import org.openhab.binding.melcloud.internal.handler.MelCloudAccountHandler; +import org.osgi.service.component.annotations.Modified; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MelCloudDiscoveryService} creates things based on the configured location. + * + * @author Luca Calcaterra - Initial Contribution + * @author Pauli Anttila - Refactoring + * @author Wietse van Buitenen - Check device type, added heatpump device + */ +public class MelCloudDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, ThingHandlerService { + private final Logger logger = LoggerFactory.getLogger(MelCloudDiscoveryService.class); + + private static final int DISCOVER_TIMEOUT_SECONDS = 10; + + private MelCloudAccountHandler melCloudHandler; + private ScheduledFuture<?> scanTask; + + /** + * Creates a MelCloudDiscoveryService with enabled autostart. + */ + public MelCloudDiscoveryService() { + super(MelCloudBindingConstants.DISCOVERABLE_THING_TYPE_UIDS, DISCOVER_TIMEOUT_SECONDS, true); + } + + @Override + protected void activate(Map<String, @Nullable Object> configProperties) { + super.activate(configProperties); + } + + @Override + public void deactivate() { + super.deactivate(); + } + + @Override + @Modified + protected void modified(Map<String, @Nullable Object> configProperties) { + super.modified(configProperties); + } + + @Override + protected void startBackgroundDiscovery() { + discoverDevices(); + } + + @Override + protected void startScan() { + if (this.scanTask != null) { + scanTask.cancel(true); + } + this.scanTask = scheduler.schedule(() -> discoverDevices(), 0, TimeUnit.SECONDS); + } + + @Override + protected void stopScan() { + super.stopScan(); + + if (this.scanTask != null) { + this.scanTask.cancel(true); + this.scanTask = null; + } + } + + private void discoverDevices() { + logger.debug("Discover devices"); + + if (melCloudHandler != null) { + try { + List<Device> deviceList = melCloudHandler.getDeviceList(); + + if (deviceList == null) { + logger.debug("No devices found"); + } else { + ThingUID bridgeUID = melCloudHandler.getThing().getUID(); + + deviceList.forEach(device -> { + ThingTypeUID thingTypeUid = null; + if (device.getType() == 0) { + thingTypeUid = THING_TYPE_ACDEVICE; + } else if (device.getType() == 1) { + thingTypeUid = THING_TYPE_HEATPUMPDEVICE; + } else { + logger.debug("Unsupported device found: name {} : type: {}", device.getDeviceName(), + device.getType()); + return; + } + ThingUID deviceThing = new ThingUID(thingTypeUid, melCloudHandler.getThing().getUID(), + device.getDeviceID().toString()); + + Map<String, Object> deviceProperties = new HashMap<>(); + deviceProperties.put("deviceID", device.getDeviceID().toString()); + deviceProperties.put("serialNumber", device.getSerialNumber().toString()); + deviceProperties.put("macAddress", device.getMacAddress().toString()); + deviceProperties.put("deviceName", device.getDeviceName().toString()); + deviceProperties.put("buildingID", device.getBuildingID().toString()); + + String label = createLabel(device); + logger.debug("Found device: {} : {}", label, deviceProperties); + + thingDiscovered(DiscoveryResultBuilder.create(deviceThing).withLabel(label) + .withProperties(deviceProperties) + .withRepresentationProperty(device.getDeviceID().toString()).withBridge(bridgeUID) + .build()); + }); + } + } catch (MelCloudLoginException e) { + logger.debug("Login error occurred during device list fetch, reason {}. ", e.getMessage(), e); + } catch (MelCloudCommException e) { + logger.debug("Error occurred during device list fetch, reason {}. ", e.getMessage(), e); + } + } + } + + private String createLabel(Device device) { + StringBuilder sb = new StringBuilder(); + if (device.getType() == 0) { + sb.append("A.C. Device - "); + } else if (device.getType() == 1) { + sb.append("Heatpump Device - "); + } + if (device.getBuildingName() != null && device.getBuildingName() instanceof String) { + sb.append(device.getBuildingName()).append(" - "); + } + sb.append(device.getDeviceName()); + return sb.toString(); + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof MelCloudAccountHandler) { + melCloudHandler = (MelCloudAccountHandler) handler; + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return melCloudHandler; + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudCommException.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudCommException.java new file mode 100644 index 0000000000000..0383176f8380a --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudCommException.java @@ -0,0 +1,34 @@ +/** + * 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.melcloud.internal.exceptions; + +/** + * Exception to encapsulate any issues communicating with MELCloud. + * + * @author Pauli Anttila - Initial Contribution + */ +public class MelCloudCommException extends Exception { + private static final long serialVersionUID = 1L; + + public MelCloudCommException(Throwable cause) { + super("Error occurred when communicating with MELCloud", cause); + } + + public MelCloudCommException(String message) { + super(message); + } + + public MelCloudCommException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudLoginException.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudLoginException.java new file mode 100644 index 0000000000000..77163b2ad5ad8 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/exceptions/MelCloudLoginException.java @@ -0,0 +1,34 @@ +/** + * 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.melcloud.internal.exceptions; + +/** + * Exception to encapsulate any login issues with MELCloud. + * + * @author Pauli Anttila - Initial Contribution + */ +public class MelCloudLoginException extends Exception { + private static final long serialVersionUID = 1L; + + public MelCloudLoginException(Throwable cause) { + super("Error occurred during login to MELCloud", cause); + } + + public MelCloudLoginException(String message) { + super(message); + } + + public MelCloudLoginException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudAccountHandler.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudAccountHandler.java new file mode 100644 index 0000000000000..5197507b4b63f --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudAccountHandler.java @@ -0,0 +1,222 @@ +/** + * 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.melcloud.internal.handler; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.melcloud.internal.api.MelCloudConnection; +import org.openhab.binding.melcloud.internal.api.json.Device; +import org.openhab.binding.melcloud.internal.api.json.DeviceStatus; +import org.openhab.binding.melcloud.internal.api.json.HeatpumpDeviceStatus; +import org.openhab.binding.melcloud.internal.config.AccountConfig; +import org.openhab.binding.melcloud.internal.discovery.MelCloudDiscoveryService; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudCommException; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudLoginException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link MelCloudAccountHandler} is the handler for MELCloud API and connects it + * to the webservice. + * + * @author Luca Calcaterra - Initial contribution + * @author Pauli Anttila - Refactoring + * @author Wietse van Buitenen - Return all devices, added heatpump device + */ +public class MelCloudAccountHandler extends BaseBridgeHandler { + private final Logger logger = LoggerFactory.getLogger(MelCloudAccountHandler.class); + + private MelCloudConnection connection; + private List<Device> devices; + private ScheduledFuture<?> connectionCheckTask; + private AccountConfig config; + private boolean loginCredentialError; + + public MelCloudAccountHandler(Bridge bridge) { + super(bridge); + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(MelCloudDiscoveryService.class); + } + + @Override + public void initialize() { + logger.debug("Initializing MELCloud account handler."); + config = getConfigAs(AccountConfig.class); + connection = new MelCloudConnection(); + devices = Collections.emptyList(); + loginCredentialError = false; + startConnectionCheck(); + } + + @Override + public void dispose() { + logger.debug("Running dispose()"); + stopConnectionCheck(); + connection = null; + devices = Collections.emptyList(); + config = null; + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + } + + public ThingUID getID() { + return getThing().getUID(); + } + + public List<Device> getDeviceList() throws MelCloudCommException, MelCloudLoginException { + connectIfNotConnected(); + return connection.fetchDeviceList(); + } + + private void connect() throws MelCloudCommException, MelCloudLoginException { + if (loginCredentialError) { + throw new MelCloudLoginException("Connection to MELCloud can't be opened because of wrong credentials"); + } + logger.debug("Initializing connection to MELCloud"); + updateStatus(ThingStatus.OFFLINE); + try { + connection.login(config.username, config.password, config.language); + devices = connection.fetchDeviceList(); + updateStatus(ThingStatus.ONLINE); + } catch (MelCloudLoginException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); + loginCredentialError = true; + throw e; + } catch (MelCloudCommException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + throw e; + } + } + + private synchronized void connectIfNotConnected() throws MelCloudCommException, MelCloudLoginException { + if (!isConnected()) { + connect(); + } + } + + public boolean isConnected() { + return connection.isConnected(); + } + + public DeviceStatus sendDeviceStatus(DeviceStatus deviceStatus) + throws MelCloudCommException, MelCloudLoginException { + connectIfNotConnected(); + try { + return connection.sendDeviceStatus(deviceStatus); + } catch (MelCloudCommException e) { + logger.debug("Sending failed, retry once with relogin"); + connect(); + return connection.sendDeviceStatus(deviceStatus); + } + } + + public DeviceStatus fetchDeviceStatus(int deviceId, Optional<Integer> buildingId) + throws MelCloudCommException, MelCloudLoginException { + connectIfNotConnected(); + int bid = buildingId.orElse(findBuildingId(deviceId)); + + try { + return connection.fetchDeviceStatus(deviceId, bid); + } catch (MelCloudCommException e) { + logger.debug("Sending failed, retry once with relogin"); + connect(); + return connection.fetchDeviceStatus(deviceId, bid); + } + } + + public HeatpumpDeviceStatus sendHeatpumpDeviceStatus(HeatpumpDeviceStatus heatpumpDeviceStatus) + throws MelCloudCommException, MelCloudLoginException { + connectIfNotConnected(); + try { + return connection.sendHeatpumpDeviceStatus(heatpumpDeviceStatus); + } catch (MelCloudCommException e) { + logger.debug("Sending failed, retry once with relogin"); + connect(); + return connection.sendHeatpumpDeviceStatus(heatpumpDeviceStatus); + } + } + + public HeatpumpDeviceStatus fetchHeatpumpDeviceStatus(int deviceId, Optional<Integer> buildingId) + throws MelCloudCommException, MelCloudLoginException { + connectIfNotConnected(); + int bid = buildingId.orElse(findBuildingId(deviceId)); + + try { + return connection.fetchHeatpumpDeviceStatus(deviceId, bid); + } catch (MelCloudCommException e) { + logger.debug("Sending failed, retry once with relogin"); + connect(); + return connection.fetchHeatpumpDeviceStatus(deviceId, bid); + } + } + + private int findBuildingId(int deviceId) throws MelCloudCommException { + if (devices != null) { + return devices.stream().filter(d -> d.getDeviceID() == deviceId).findFirst().orElseThrow( + () -> new MelCloudCommException(String.format("Can't find building id for device id %s", deviceId))) + .getBuildingID(); + } + throw new MelCloudCommException(String.format("Can't find building id for device id %s", deviceId)); + } + + private void startConnectionCheck() { + if (connectionCheckTask == null || connectionCheckTask.isCancelled()) { + logger.debug("Start periodic connection check"); + Runnable runnable = () -> { + logger.debug("Check MELCloud connection"); + if (connection.isConnected()) { + logger.debug("Connection to MELCloud open"); + } else { + try { + connect(); + } catch (MelCloudLoginException e) { + logger.debug("Connection to MELCloud down due to login error, reason: {}.", e.getMessage()); + } catch (MelCloudCommException e) { + logger.debug("Connection to MELCloud down, reason: {}.", e.getMessage()); + } catch (RuntimeException e) { + logger.warn("Unknown error occurred during connection check, reason: {}.", e.getMessage(), e); + } + } + }; + connectionCheckTask = scheduler.scheduleWithFixedDelay(runnable, 0, 60, TimeUnit.SECONDS); + } else { + logger.debug("Connection check task already running"); + } + } + + private void stopConnectionCheck() { + if (connectionCheckTask != null) { + logger.debug("Stop periodic connection check"); + connectionCheckTask.cancel(true); + connectionCheckTask = null; + } + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudDeviceHandler.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudDeviceHandler.java new file mode 100644 index 0000000000000..a98d4a433fecf --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudDeviceHandler.java @@ -0,0 +1,310 @@ +/** + * 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.melcloud.internal.handler; + +import static org.eclipse.smarthome.core.library.unit.SIUnits.CELSIUS; +import static org.openhab.binding.melcloud.internal.MelCloudBindingConstants.*; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Optional; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import javax.measure.quantity.Temperature; + +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.openhab.binding.melcloud.internal.api.json.DeviceStatus; +import org.openhab.binding.melcloud.internal.config.AcDeviceConfig; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudCommException; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudLoginException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MelCloudDeviceHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Luca Calcaterra - Initial contribution + * @author Pauli Anttila - Refactoring + */ + +public class MelCloudDeviceHandler extends BaseThingHandler { + + private static final int EFFECTIVE_FLAG_POWER = 0x01; + private static final int EFFECTIVE_FLAG_OPERATION_MODE = 0x02; + private static final int EFFECTIVE_FLAG_TEMPERATURE = 0x04; + private static final int EFFECTIVE_FLAG_FAN_SPEED = 0x08; + private static final int EFFECTIVE_FLAG_VANE_VERTICAL = 0x10; + private static final int EFFECTIVE_FLAG_VANE_HORIZONTAL = 0x100; + + private final Logger logger = LoggerFactory.getLogger(MelCloudDeviceHandler.class); + private AcDeviceConfig config; + private MelCloudAccountHandler melCloudHandler; + private DeviceStatus deviceStatus; + private ScheduledFuture<?> refreshTask; + + public MelCloudDeviceHandler(Thing thing) { + super(thing); + } + + @Override + public void initialize() { + logger.debug("Initializing {} handler.", getThing().getThingTypeUID()); + + Bridge bridge = getBridge(); + if (bridge == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge Not set"); + return; + } + + config = getConfigAs(AcDeviceConfig.class); + logger.debug("A.C. device config: {}", config); + + initializeBridge(bridge.getHandler(), bridge.getStatus()); + } + + @Override + public void dispose() { + logger.debug("Running dispose()"); + if (refreshTask != null) { + refreshTask.cancel(true); + refreshTask = null; + } + melCloudHandler = null; + } + + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + logger.debug("bridgeStatusChanged {} for thing {}", bridgeStatusInfo, getThing().getUID()); + Bridge bridge = getBridge(); + if (bridge != null) { + initializeBridge(bridge.getHandler(), bridgeStatusInfo.getStatus()); + } + } + + private void initializeBridge(ThingHandler thingHandler, ThingStatus bridgeStatus) { + logger.debug("initializeBridge {} for thing {}", bridgeStatus, getThing().getUID()); + + if (thingHandler != null && bridgeStatus != null) { + melCloudHandler = (MelCloudAccountHandler) thingHandler; + + if (bridgeStatus == ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + startAutomaticRefresh(); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + } + } else { + updateStatus(ThingStatus.OFFLINE); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("Received command '{}' to channel {}", command, channelUID); + + if (command instanceof RefreshType) { + logger.debug("Refresh command not supported"); + return; + } + + if (melCloudHandler == null) { + logger.warn("No connection to MELCloud available, ignoring command"); + return; + } + + if (deviceStatus == null) { + logger.info("No initial data available, bridge is probably offline. Ignoring command"); + return; + } + + DeviceStatus cmdtoSend = getDeviceStatusCopy(deviceStatus); + cmdtoSend.setEffectiveFlags(0); + + switch (channelUID.getId()) { + case CHANNEL_POWER: + cmdtoSend.setPower(command == OnOffType.ON); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_POWER); + break; + case CHANNEL_OPERATION_MODE: + cmdtoSend.setOperationMode(Integer.parseInt(command.toString())); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_OPERATION_MODE); + break; + case CHANNEL_SET_TEMPERATURE: + BigDecimal val = null; + if (command instanceof QuantityType) { + QuantityType<Temperature> quantity = new QuantityType<Temperature>(command.toString()) + .toUnit(CELSIUS); + if (quantity != null) { + val = quantity.toBigDecimal().setScale(1, RoundingMode.HALF_UP); + // round nearest .5 + double v = Math.round(val.doubleValue() * 2) / 2.0; + cmdtoSend.setSetTemperature(v); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_TEMPERATURE); + } + } + if (val == null) { + logger.debug("Can't convert '{}' to set temperature", command); + } + break; + case CHANNEL_FAN_SPEED: + cmdtoSend.setSetFanSpeed(Integer.parseInt(command.toString())); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_FAN_SPEED); + break; + case CHANNEL_VANE_VERTICAL: + cmdtoSend.setVaneVertical(Integer.parseInt(command.toString())); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_VANE_VERTICAL); + break; + case CHANNEL_VANE_HORIZONTAL: + cmdtoSend.setVaneHorizontal(Integer.parseInt(command.toString())); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_VANE_HORIZONTAL); + break; + default: + logger.debug("Read-only or unknown channel {}, skipping update", channelUID); + } + + if (cmdtoSend.getEffectiveFlags() > 0) { + cmdtoSend.setHasPendingCommand(true); + cmdtoSend.setDeviceID(config.deviceID); + try { + DeviceStatus newDeviceStatus = melCloudHandler.sendDeviceStatus(cmdtoSend); + updateChannels(newDeviceStatus); + } catch (MelCloudLoginException e) { + logger.warn("Command '{}' to channel '{}' failed due to login error, reason {}. ", command, channelUID, + e.getMessage(), e); + } catch (MelCloudCommException e) { + logger.warn("Command '{}' to channel '{}' failed, reason {}. ", command, channelUID, e.getMessage(), e); + } + } else { + logger.debug("Nothing to send"); + } + } + + private DeviceStatus getDeviceStatusCopy(DeviceStatus deviceStatus) { + DeviceStatus copy = new DeviceStatus(); + synchronized (this) { + copy.setPower(deviceStatus.getPower()); + copy.setOperationMode(deviceStatus.getOperationMode()); + copy.setSetTemperature(deviceStatus.getSetTemperature()); + copy.setSetFanSpeed(deviceStatus.getSetFanSpeed()); + copy.setVaneVertical(deviceStatus.getVaneVertical()); + copy.setVaneHorizontal(deviceStatus.getVaneHorizontal()); + copy.setEffectiveFlags(deviceStatus.getEffectiveFlags()); + copy.setHasPendingCommand(deviceStatus.getHasPendingCommand()); + copy.setDeviceID(deviceStatus.getDeviceID()); + } + return copy; + } + + private void startAutomaticRefresh() { + if (refreshTask == null || refreshTask.isCancelled()) { + refreshTask = scheduler.scheduleWithFixedDelay(this::getDeviceDataAndUpdateChannels, 1, + config.pollingInterval, TimeUnit.SECONDS); + } + } + + private void getDeviceDataAndUpdateChannels() { + if (melCloudHandler.isConnected()) { + logger.debug("Update device '{}' channels", getThing().getThingTypeUID()); + try { + DeviceStatus newDeviceStatus = melCloudHandler.fetchDeviceStatus(config.deviceID, + Optional.ofNullable(config.buildingID)); + updateChannels(newDeviceStatus); + } catch (MelCloudLoginException e) { + logger.debug("Login error occurred during device '{}' polling, reason {}. ", + getThing().getThingTypeUID(), e.getMessage(), e); + } catch (MelCloudCommException e) { + logger.debug("Error occurred during device '{}' polling, reason {}. ", getThing().getThingTypeUID(), + e.getMessage(), e); + } + } else { + logger.debug("Connection to MELCloud is not open, skipping periodic update"); + } + } + + private synchronized void updateChannels(DeviceStatus newDeviceStatus) { + deviceStatus = newDeviceStatus; + for (Channel channel : getThing().getChannels()) { + updateChannels(channel.getUID().getId(), deviceStatus); + } + } + + private void updateChannels(String channelId, DeviceStatus deviceStatus) { + switch (channelId) { + case CHANNEL_POWER: + updateState(CHANNEL_POWER, deviceStatus.getPower() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_OPERATION_MODE: + updateState(CHANNEL_OPERATION_MODE, new StringType(deviceStatus.getOperationMode().toString())); + break; + case CHANNEL_SET_TEMPERATURE: + updateState(CHANNEL_SET_TEMPERATURE, + new QuantityType<Temperature>(deviceStatus.getSetTemperature(), SIUnits.CELSIUS)); + break; + case CHANNEL_FAN_SPEED: + updateState(CHANNEL_FAN_SPEED, new StringType(deviceStatus.getSetFanSpeed().toString())); + break; + case CHANNEL_VANE_HORIZONTAL: + updateState(CHANNEL_VANE_HORIZONTAL, new StringType(deviceStatus.getVaneHorizontal().toString())); + break; + case CHANNEL_VANE_VERTICAL: + updateState(CHANNEL_VANE_VERTICAL, new StringType(deviceStatus.getVaneVertical().toString())); + break; + case CHANNEL_OFFLINE: + updateState(CHANNEL_OFFLINE, deviceStatus.getOffline() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_HAS_PENDING_COMMAND: + updateState(CHANNEL_HAS_PENDING_COMMAND, + deviceStatus.getHasPendingCommand() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_ROOM_TEMPERATURE: + updateState(CHANNEL_ROOM_TEMPERATURE, new DecimalType(deviceStatus.getRoomTemperature())); + break; + case CHANNEL_LAST_COMMUNICATION: + updateState(CHANNEL_LAST_COMMUNICATION, + new DateTimeType(convertDateTime(deviceStatus.getLastCommunication()))); + break; + case CHANNEL_NEXT_COMMUNICATION: + updateState(CHANNEL_NEXT_COMMUNICATION, + new DateTimeType(convertDateTime(deviceStatus.getNextCommunication()))); + break; + } + } + + private ZonedDateTime convertDateTime(String dateTime) { + return ZonedDateTime.ofInstant(LocalDateTime.parse(dateTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME), + ZoneOffset.UTC, ZoneId.systemDefault()); + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudHeatpumpDeviceHandler.java b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudHeatpumpDeviceHandler.java new file mode 100644 index 0000000000000..e1dc1651aff92 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/java/org/openhab/binding/melcloud/internal/handler/MelCloudHeatpumpDeviceHandler.java @@ -0,0 +1,285 @@ +/** + * 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.melcloud.internal.handler; + +import static org.eclipse.smarthome.core.library.unit.SIUnits.CELSIUS; +import static org.openhab.binding.melcloud.internal.MelCloudBindingConstants.*; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Optional; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import javax.measure.quantity.Temperature; + +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.openhab.binding.melcloud.internal.api.json.HeatpumpDeviceStatus; +import org.openhab.binding.melcloud.internal.config.HeatpumpDeviceConfig; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudCommException; +import org.openhab.binding.melcloud.internal.exceptions.MelCloudLoginException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MelCloudHeatpumpDeviceHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Wietse van Buitenen - Initial contribution + */ +public class MelCloudHeatpumpDeviceHandler extends BaseThingHandler { + private static final long EFFECTIVE_FLAG_POWER = 1L; + private static final long EFFECTIVE_FLAG_TEMPERATURE_ZONE1 = 8589934720L; + private static final long EFFECTIVE_FLAG_HOTWATER = 65536L; + + private final Logger logger = LoggerFactory.getLogger(MelCloudHeatpumpDeviceHandler.class); + private HeatpumpDeviceConfig config; + private MelCloudAccountHandler melCloudHandler; + private HeatpumpDeviceStatus heatpumpDeviceStatus; + private ScheduledFuture<?> refreshTask; + + public MelCloudHeatpumpDeviceHandler(Thing thing) { + super(thing); + } + + @Override + public void initialize() { + logger.debug("Initializing {} handler.", getThing().getThingTypeUID()); + + Bridge bridge = getBridge(); + if (bridge == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Bridge Not set"); + return; + } + + config = getConfigAs(HeatpumpDeviceConfig.class); + logger.debug("Heatpump device config: {}", config); + + initializeBridge(bridge.getHandler(), bridge.getStatus()); + } + + @Override + public void dispose() { + logger.debug("Running dispose()"); + if (refreshTask != null) { + refreshTask.cancel(true); + refreshTask = null; + } + melCloudHandler = null; + } + + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + logger.debug("bridgeStatusChanged {} for thing {}", bridgeStatusInfo, getThing().getUID()); + Bridge bridge = getBridge(); + if (bridge != null) { + initializeBridge(bridge.getHandler(), bridgeStatusInfo.getStatus()); + } + } + + private void initializeBridge(ThingHandler thingHandler, ThingStatus bridgeStatus) { + logger.debug("initializeBridge {} for thing {}", bridgeStatus, getThing().getUID()); + + if (thingHandler != null && bridgeStatus != null) { + melCloudHandler = (MelCloudAccountHandler) thingHandler; + + if (bridgeStatus == ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + startAutomaticRefresh(); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + } + } else { + updateStatus(ThingStatus.OFFLINE); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("Received command '{}' to channel {}", command, channelUID); + + if (command instanceof RefreshType) { + logger.debug("Refresh command not supported"); + return; + } + + if (melCloudHandler == null) { + logger.warn("No connection to MELCloud available, ignoring command"); + return; + } + + if (heatpumpDeviceStatus == null) { + logger.info("No initial data available, bridge is probably offline. Ignoring command"); + return; + } + + HeatpumpDeviceStatus cmdtoSend = getHeatpumpDeviceStatusCopy(heatpumpDeviceStatus); + cmdtoSend.setEffectiveFlags(0L); + + switch (channelUID.getId()) { + case CHANNEL_POWER: + cmdtoSend.setPower(command == OnOffType.ON); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_POWER); + break; + case CHANNEL_SET_TEMPERATURE_ZONE1: + BigDecimal val = null; + if (command instanceof QuantityType) { + QuantityType<Temperature> quantity = new QuantityType<Temperature>(command.toString()) + .toUnit(CELSIUS); + if (quantity != null) { + val = quantity.toBigDecimal().setScale(1, RoundingMode.HALF_UP); + // round nearest .5 + double v = Math.round(val.doubleValue() * 2) / 2.0; + cmdtoSend.setSetTemperatureZone1(v); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_TEMPERATURE_ZONE1); + } + } + if (val == null) { + logger.debug("Can't convert '{}' to set temperature", command); + } + break; + case CHANNEL_FORCED_HOTWATERMODE: + cmdtoSend.setForcedHotWaterMode(command == OnOffType.ON); + cmdtoSend.setEffectiveFlags(EFFECTIVE_FLAG_HOTWATER); + break; + default: + logger.debug("Read-only or unknown channel {}, skipping update", channelUID); + } + + if (cmdtoSend.getEffectiveFlags() > 0) { + cmdtoSend.setHasPendingCommand(true); + cmdtoSend.setDeviceID(config.deviceID); + try { + HeatpumpDeviceStatus newHeatpumpDeviceStatus = melCloudHandler.sendHeatpumpDeviceStatus(cmdtoSend); + updateChannels(newHeatpumpDeviceStatus); + } catch (MelCloudLoginException e) { + logger.warn("Command '{}' to channel '{}' failed due to login error, reason {}. ", command, channelUID, + e.getMessage(), e); + } catch (MelCloudCommException e) { + logger.warn("Command '{}' to channel '{}' failed, reason {}. ", command, channelUID, e.getMessage(), e); + } + } else { + logger.debug("Nothing to send"); + } + } + + private HeatpumpDeviceStatus getHeatpumpDeviceStatusCopy(HeatpumpDeviceStatus heatpumpDeviceStatus) { + HeatpumpDeviceStatus copy = new HeatpumpDeviceStatus(); + synchronized (this) { + copy.setDeviceID(heatpumpDeviceStatus.getDeviceID()); + copy.setEffectiveFlags(heatpumpDeviceStatus.getEffectiveFlags()); + copy.setPower(heatpumpDeviceStatus.getPower()); + copy.setSetTemperatureZone1(heatpumpDeviceStatus.getSetTemperatureZone1()); + copy.setForcedHotWaterMode(heatpumpDeviceStatus.getForcedHotWaterMode()); + copy.setHasPendingCommand(heatpumpDeviceStatus.getHasPendingCommand()); + } + return copy; + } + + private void startAutomaticRefresh() { + if (refreshTask == null || refreshTask.isCancelled()) { + refreshTask = scheduler.scheduleWithFixedDelay(this::getDeviceDataAndUpdateChannels, 1, + config.pollingInterval, TimeUnit.SECONDS); + } + } + + private void getDeviceDataAndUpdateChannels() { + if (melCloudHandler.isConnected()) { + logger.debug("Update device '{}' channels", getThing().getThingTypeUID()); + try { + HeatpumpDeviceStatus newHeatpumpDeviceStatus = melCloudHandler + .fetchHeatpumpDeviceStatus(config.deviceID, Optional.ofNullable(config.buildingID)); + updateChannels(newHeatpumpDeviceStatus); + } catch (MelCloudLoginException e) { + logger.debug("Login error occurred during device '{}' polling, reason {}. ", + getThing().getThingTypeUID(), e.getMessage(), e); + } catch (MelCloudCommException e) { + logger.debug("Error occurred during device '{}' polling, reason {}. ", getThing().getThingTypeUID(), + e.getMessage(), e); + } + } else { + logger.debug("Connection to MELCloud is not open, skipping periodic update"); + } + } + + private synchronized void updateChannels(HeatpumpDeviceStatus newHeatpumpDeviceStatus) { + heatpumpDeviceStatus = newHeatpumpDeviceStatus; + for (Channel channel : getThing().getChannels()) { + updateChannels(channel.getUID().getId(), heatpumpDeviceStatus); + } + } + + private void updateChannels(String channelId, HeatpumpDeviceStatus heatpumpDeviceStatus) { + switch (channelId) { + case CHANNEL_POWER: + updateState(CHANNEL_POWER, heatpumpDeviceStatus.getPower() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_TANKWATERTEMPERATURE: + updateState(CHANNEL_TANKWATERTEMPERATURE, + new DecimalType(heatpumpDeviceStatus.getTankWaterTemperature())); + break; + case CHANNEL_SET_TEMPERATURE_ZONE1: + updateState(CHANNEL_SET_TEMPERATURE_ZONE1, + new QuantityType<Temperature>(heatpumpDeviceStatus.getSetTemperatureZone1(), SIUnits.CELSIUS)); + break; + case CHANNEL_ROOM_TEMPERATURE_ZONE1: + updateState(CHANNEL_ROOM_TEMPERATURE_ZONE1, + new DecimalType(heatpumpDeviceStatus.getRoomTemperatureZone1())); + break; + case CHANNEL_FORCED_HOTWATERMODE: + updateState(CHANNEL_FORCED_HOTWATERMODE, + heatpumpDeviceStatus.getForcedHotWaterMode() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_LAST_COMMUNICATION: + updateState(CHANNEL_LAST_COMMUNICATION, + new DateTimeType(convertDateTime(heatpumpDeviceStatus.getLastCommunication()))); + break; + case CHANNEL_NEXT_COMMUNICATION: + updateState(CHANNEL_NEXT_COMMUNICATION, + new DateTimeType(convertDateTime(heatpumpDeviceStatus.getNextCommunication()))); + break; + case CHANNEL_HAS_PENDING_COMMAND: + updateState(CHANNEL_HAS_PENDING_COMMAND, + heatpumpDeviceStatus.getHasPendingCommand() ? OnOffType.ON : OnOffType.OFF); + break; + case CHANNEL_OFFLINE: + updateState(CHANNEL_OFFLINE, heatpumpDeviceStatus.getOffline() ? OnOffType.ON : OnOffType.OFF); + break; + } + } + + private ZonedDateTime convertDateTime(String dateTime) { + return ZonedDateTime.ofInstant(LocalDateTime.parse(dateTime, DateTimeFormatter.ISO_LOCAL_DATE_TIME), + ZoneOffset.UTC, ZoneId.systemDefault()); + } +} diff --git a/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..3a7bbcb4d73f1 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="melcloud" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>MELCloud Binding</name> + <description>Binding for Mitsubishi MELCloud connected A.C. devices.</description> + <author>Luca Calcaterra, Pauli Anttila, Wietse van Buitenen</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/acDevice.xml b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/acDevice.xml new file mode 100644 index 0000000000000..5fd39e12e5480 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/acDevice.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="melcloud" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="acdevice"> + <supported-bridge-type-refs> + <bridge-type-ref id="melcloudaccount" /> + </supported-bridge-type-refs> + <label>A.C. Device</label> + <description>Air conditioning device</description> + + <channels> + <channel id="hasPendingCommand" typeId="hasPendingCommand-channel" /> + <channel id="offline" typeId="offline-channel" /> + <channel id="power" typeId="power-channel" /> + <channel id="operationMode" typeId="operationMode-channel" /> + <channel id="setTemperature" typeId="setTemperature-channel" /> + <channel id="fanSpeed" typeId="fanSpeed-channel" /> + <channel id="vaneHorizontal" typeId="vaneHorizontal-channel" /> + <channel id="vaneVertical" typeId="vaneVertical-channel" /> + <channel id="roomTemperature" typeId="roomTemperature-channel" /> + <channel id="lastCommunication" typeId="lastCommunication-channel" /> + <channel id="nextCommunication" typeId="nextCommunication-channel" /> + </channels> + + <config-description> + <parameter name="deviceID" type="integer" required="true"> + <label>Device ID</label> + <description>Device ID of the A.C. device</description> + </parameter> + <parameter name="buildingID" type="integer"> + <label>Building ID</label> + <description>Building ID of the A.C. device.</description> + </parameter> + <parameter name="pollingInterval" type="integer" required="true"> + <label>Polling Interval</label> + <description>Time interval how often poll data from MELCloud</description> + <default>60</default> + </parameter> + </config-description> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..53ab174f9b92a --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="melcloud" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- Common channels --> + <channel-type id="power-channel"> + <item-type>Switch</item-type> + <label>Power</label> + <description>Power status of device</description> + </channel-type> + + <channel-type id="hasPendingCommand-channel"> + <item-type>Switch</item-type> + <label>Pending Command</label> + <description>Device has a pending command(s)</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="offline-channel"> + <item-type>Switch</item-type> + <label>Is Offline</label> + <description>Is device in offline state.</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="lastCommunication-channel"> + <item-type>DateTime</item-type> + <label>Last Communication</label> + <description>Last communication time between device and MELCloud</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="nextCommunication-channel"> + <item-type>DateTime</item-type> + <label>Next Communication</label> + <description>Next communication time between device and MELCloud</description> + <state readOnly="true" /> + </channel-type> + + <!-- A.C. Device Channels --> + <channel-type id="operationMode-channel"> + <item-type>String</item-type> + <label>Operation Mode</label> + <description>Operation mode</description> + <state readOnly="false"> + <options> + <option value="1">Heat</option> + <option value="2">Dry</option> + <option value="3">Cool</option> + <option value="7">Fan</option> + <option value="8">Auto</option> + </options> + </state> + </channel-type> + + <channel-type id="setTemperature-channel"> + <item-type>Number:Temperature</item-type> + <label>Set Temperature</label> + <description>Set temperature</description> + <state min="10" max="40" step="0.5" pattern="%.1f %unit%" readOnly="false" /> + </channel-type> + + <channel-type id="fanSpeed-channel"> + <item-type>String</item-type> + <label>Fan Speed</label> + <description>Fan speed</description> + <state readOnly="false"> + <options> + <option value="0">Auto</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> + <option value="4">4</option> + <option value="5">5</option> + </options> + </state> + </channel-type> + + <channel-type id="vaneHorizontal-channel"> + <item-type>String</item-type> + <label>Vane Horizontal</label> + <description>Vane horizontal</description> + <state readOnly="false"> + <options> + <option value="0">Auto</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> + <option value="4">4</option> + <option value="5">5</option> + <option value="12">Swing</option> + </options> + </state> + </channel-type> + + <channel-type id="vaneVertical-channel"> + <item-type>String</item-type> + <label>Vane Vertical</label> + <description>Vane vertical</description> + <state readOnly="false"> + <options> + <option value="0">Auto</option> + <option value="1">1</option> + <option value="2">2</option> + <option value="3">3</option> + <option value="4">4</option> + <option value="5">5</option> + <option value="7">Swing</option> + </options> + </state> + </channel-type> + + <channel-type id="roomTemperature-channel"> + <item-type>Number:Temperature</item-type> + <label>Room Temperature</label> + <description>Room temperature</description> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <!-- Heatpump Device Channels --> + <channel-type id="tankWaterTemperature-channel"> + <item-type>Number:Temperature</item-type> + <label>Tank Temperature</label> + <description>Temperature of water i</description> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="forcedHotWaterMode-channel"> + <item-type>Switch</item-type> + <label>Forced Hot Water Mode</label> + <description>If water mode is Heat Now (true) or Auto (false)</description> + </channel-type> + + <channel-type id="roomTemperatureZone1-channel"> + <item-type>Number:Temperature</item-type> + <label>Room Temperature Zone 1</label> + <description>Room temperature for zone 1</description> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="setTemperatureZone1-channel"> + <item-type>Number:Temperature</item-type> + <label>Set Temperature Zone 1</label> + <description>Set temperature for zone 1</description> + <state min="10" max="30" step="0.5" pattern="%.1f %unit%" readOnly="false" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/heatpumpDevice.xml b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/heatpumpDevice.xml new file mode 100644 index 0000000000000..dcc9d7b0ea677 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/heatpumpDevice.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="melcloud" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="heatpumpdevice"> + <supported-bridge-type-refs> + <bridge-type-ref id="melcloudaccount" /> + </supported-bridge-type-refs> + <label>Heatpump Device</label> + <description>Heatpump device</description> + + <channels> + <channel id="power" typeId="power-channel" /> + <channel id="tankWaterTemperature" typeId="tankWaterTemperature-channel" /> + <channel id="forcedHotWaterMode" typeId="forcedHotWaterMode-channel" /> + <channel id="roomTemperatureZone1" typeId="roomTemperatureZone1-channel" /> + <channel id="setTemperatureZone1" typeId="setTemperatureZone1-channel" /> + <channel id="hasPendingCommand" typeId="hasPendingCommand-channel" /> + <channel id="offline" typeId="offline-channel" /> + <channel id="lastCommunication" typeId="lastCommunication-channel" /> + <channel id="nextCommunication" typeId="nextCommunication-channel" /> + </channels> + + <config-description> + <parameter name="deviceID" type="integer" required="true"> + <label>Device ID</label> + <description>Device ID of the Heatpump device</description> + </parameter> + <parameter name="buildingID" type="integer"> + <label>Building ID</label> + <description>Building ID of the Heatpump device.</description> + </parameter> + <parameter name="pollingInterval" type="integer" required="true"> + <label>Polling Interval</label> + <description>Time interval how often poll data from MELCloud</description> + <default>60</default> + </parameter> + </config-description> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/melCloudAccount.xml b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/melCloudAccount.xml new file mode 100644 index 0000000000000..4a3913a74cb43 --- /dev/null +++ b/bundles/org.openhab.binding.melcloud/src/main/resources/ESH-INF/thing/melCloudAccount.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="melcloud" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <bridge-type id="melcloudaccount"> + <label>MELCloud Account</label> + <description>MELCloud cloud service account</description> + + <config-description> + <parameter name="username" type="text" required="true"> + <label>Username</label> + <description>MELCloud email address</description> + </parameter> + <parameter name="password" type="text" required="true"> + <context>password</context> + <label>Password</label> + <description>MELCloud password</description> + </parameter> + <parameter name="language" type="text" required="true"> + <label>Language</label> + <description>Language</description> + <options> + <option value="0">English</option> + <option value="1">Bulgarian</option> + <option value="2">Czech</option> + <option value="3">Danish</option> + <option value="4">German</option> + <option value="5">Estonian</option> + <option value="6">Spanish</option> + <option value="7">French</option> + <option value="8">Armenian</option> + <option value="9">Latvian</option> + <option value="10">Lithuanian</option> + <option value="11">Hungarian</option> + <option value="12">Dutch</option> + <option value="13">Norwegian</option> + <option value="14">Polish</option> + <option value="15">Portuguese</option> + <option value="16">Russian</option> + <option value="17">Finnish</option> + <option value="18">Swedish</option> + <option value="19">Italian</option> + <option value="20">Ukrainian</option> + <option value="21">Turkish</option> + <option value="22">Greek</option> + <option value="23">Croatian</option> + <option value="24">Romanian</option> + <option value="25">Slovenian</option> + </options> + <default>0</default> + </parameter> + </config-description> + </bridge-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.meteoblue/NOTICE b/bundles/org.openhab.binding.meteoblue/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.meteoblue/NOTICE +++ b/bundles/org.openhab.binding.meteoblue/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.meteoblue/pom.xml b/bundles/org.openhab.binding.meteoblue/pom.xml index ad63a7bc21dc7..923f60c4f2822 100644 --- a/bundles/org.openhab.binding.meteoblue/pom.xml +++ b/bundles/org.openhab.binding.meteoblue/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.meteoblue</artifactId> diff --git a/bundles/org.openhab.binding.meteoblue/src/main/feature/feature.xml b/bundles/org.openhab.binding.meteoblue/src/main/feature/feature.xml index 9f4dfab920f75..b4ca47ed78843 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.meteoblue/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.meteoblue-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-meteoblue" description="meteoblue Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/Forecast.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/Forecast.java index 812c926723aaa..dd8161949657d 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/Forecast.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/Forecast.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBindingConstants.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBindingConstants.java index c886f5f9a04b4..9581038391d22 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBindingConstants.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBridgeConfig.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBridgeConfig.java index 35008cadcb0ec..ef4d6dae26003 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBridgeConfig.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueConfiguration.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueConfiguration.java index 55d11bbaa91a2..a791644bbb755 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueConfiguration.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueHandlerFactory.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueHandlerFactory.java index b1f9d6b848a16..418fdcae643fe 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueHandlerFactory.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/MeteoBlueHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueBridgeHandler.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueBridgeHandler.java index 60775e9b44dd6..e28c2bac47420 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueBridgeHandler.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueHandler.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueHandler.java index 084ecc94d0636..e777c4af78dd9 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueHandler.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/handler/MeteoBlueHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonData.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonData.java index f7127f3bb6448..4ed3e889c10dd 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonData.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonDataDay.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonDataDay.java index 182c69b84b5ee..7afa0dbca5711 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonDataDay.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonDataDay.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonMetadata.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonMetadata.java index 21cdded6e3a1e..c15f5c7584151 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonMetadata.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonMetadata.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonUnits.java b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonUnits.java index c7a91fda90211..32e3160041253 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonUnits.java +++ b/bundles/org.openhab.binding.meteoblue/src/main/java/org/openhab/binding/meteoblue/internal/json/JsonUnits.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteoblue/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.meteoblue/src/main/resources/ESH-INF/thing/thing-types.xml index 1de6eae2d96eb..855180564f29a 100644 --- a/bundles/org.openhab.binding.meteoblue/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.meteoblue/src/main/resources/ESH-INF/thing/thing-types.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>Weather information</label> + <label>Weather Information</label> <description>Weather data from the meteoblue service</description> <channel-groups> @@ -65,7 +65,7 @@ <description>Time Zone of this location (e.g. America/Louisville). See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</description> </parameter> <parameter name="refresh" type="integer" min="5" unit="min"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval (in minutes)</description> <default>240</default> </parameter> @@ -201,7 +201,7 @@ <channel-type id="windDirection" advanced="true"> <item-type>Number</item-type> - <label>Wind direction</label> + <label>Wind Direction</label> <description>Wind direction (in degrees)</description> <category>Wind</category> <state readOnly="true" min="0" max="360" pattern="%.0f °"> @@ -338,7 +338,7 @@ <channel-type id="humidityGreater90Hours"> <item-type>Number</item-type> - <label>Humidity Greater than 90 Hours</label> + <label>Humidity Greater Than 90 Hours</label> <description>The predicted number of hours having humidity greater than 90%</description> <state readOnly="true" min="0" max="24" pattern="%d"> </state> @@ -381,7 +381,7 @@ <channel-type id="icon" advanced="true"> <item-type>Image</item-type> - <label>Weather icon</label> + <label>Weather Icon</label> <description>Icon representing the weather conditions</description> </channel-type> diff --git a/bundles/org.openhab.binding.meteostick/NOTICE b/bundles/org.openhab.binding.meteostick/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.meteostick/NOTICE +++ b/bundles/org.openhab.binding.meteostick/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.meteostick/README.md b/bundles/org.openhab.binding.meteostick/README.md index d0a0e154e2101..67e6169c6cd9a 100644 --- a/bundles/org.openhab.binding.meteostick/README.md +++ b/bundles/org.openhab.binding.meteostick/README.md @@ -1,6 +1,6 @@ # Meteostick Binding -This is the binding for the [Meteostick](http://www.smartbedded.com/wiki/index.php/Meteostick) weather receiver dongle. +This is the binding for the [Meteostick](https://www.smartbedded.com/wiki/index.php/Meteostick) weather receiver dongle. This is an RF receiver that can receive data directly from Davis weather devices (and others). ## Supported Things @@ -86,7 +86,7 @@ This example uploads weather data to for your personal weather station at Weathe Steps: -1. Install the [MeteoStick](http://www.smartbedded.com/wiki/index.php/Meteostick) binding for use with your [Davis Vantage Vue Integrated Sensor Suite (ISS)](https://www.davisnet.com/solution/vantage-vue/). +1. Install the [MeteoStick](https://www.smartbedded.com/wiki/index.php/Meteostick) binding for use with your [Davis Vantage Vue Integrated Sensor Suite (ISS)](https://www.davisnet.com/solution/vantage-vue/). 1. [Register](https://www.wunderground.com/personal-weather-station/signup.asp) your personal weather station with Weather Underground and make note of the station ID and password issued. 1. Add the following files to your openHAB configuration: diff --git a/bundles/org.openhab.binding.meteostick/pom.xml b/bundles/org.openhab.binding.meteostick/pom.xml index 3ebfb67b0c9ac..71d829b9e17e3 100644 --- a/bundles/org.openhab.binding.meteostick/pom.xml +++ b/bundles/org.openhab.binding.meteostick/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.meteostick</artifactId> diff --git a/bundles/org.openhab.binding.meteostick/src/main/feature/feature.xml b/bundles/org.openhab.binding.meteostick/src/main/feature/feature.xml index b2b0f610b205b..8325de6024f4a 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.meteostick/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.meteostick-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-meteostick" description="Meteostick Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickBindingConstants.java b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickBindingConstants.java index b01e7ae86fb98..937817830263b 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickBindingConstants.java +++ b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickHandlerFactory.java b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickHandlerFactory.java index e3dd25871f5be..bcc3ae6a809e8 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickHandlerFactory.java +++ b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/MeteostickHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickBridgeHandler.java b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickBridgeHandler.java index 44b3ab70cf69e..81f086bd64b8b 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickBridgeHandler.java +++ b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickEventListener.java b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickEventListener.java index f2e919ff82830..d17620c33554d 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickEventListener.java +++ b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickSensorHandler.java b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickSensorHandler.java index fed67dd4746bb..e4407bfdb4a39 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickSensorHandler.java +++ b/bundles/org.openhab.binding.meteostick/src/main/java/org/openhab/binding/meteostick/internal/handler/MeteostickSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.meteostick/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.meteostick/src/main/resources/ESH-INF/thing/thing-types.xml index 2484f91891964..5587839d277d9 100644 --- a/bundles/org.openhab.binding.meteostick/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.meteostick/src/main/resources/ESH-INF/thing/thing-types.xml @@ -172,7 +172,7 @@ <channel-type id="rain-lasthour"> <item-type>Number:Length</item-type> - <label>Rainfall (previous hour)</label> + <label>Rainfall (previous Hour)</label> <description>Rainfall in the previous hour</description> <category>Rain</category> <state readOnly="true" pattern="%.1f %unit%"> @@ -181,7 +181,7 @@ <channel-type id="rain-currenthour"> <item-type>Number:Length</item-type> - <label>Rainfall (60 minutes)</label> + <label>Rainfall (60 Minutes)</label> <description>Rainfall in the last 60 minutes</description> <category>Rain</category> <state readOnly="true" pattern="%.1f %unit%"> diff --git a/bundles/org.openhab.binding.miele/NOTICE b/bundles/org.openhab.binding.miele/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.miele/NOTICE +++ b/bundles/org.openhab.binding.miele/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.miele/README.md b/bundles/org.openhab.binding.miele/README.md index 04978d5fecabe..1543b07ac9f03 100644 --- a/bundles/org.openhab.binding.miele/README.md +++ b/bundles/org.openhab.binding.miele/README.md @@ -1,12 +1,18 @@ # Miele@home Binding This binding integrates Miele@home appliances. -Miele@home is a Zigbee based network to interconnect and control Miele appliances that are equipped with special modules. -See [www.miele.de](http://www.miele.de) for the list of available appliances. +Miele@home allows controlling Miele appliances that are equipped with special communication modules. +There are devices that communicate through ZigBee and others that use WiFi. +See [www.miele.de](https://www.miele.de) for the list of available appliances. ## Supported Things +This binding requires the XGW3000 gateway from Miele as all integration with openHAB is done through this gateway. +While users with ZigBee-enabled Miele appliances usually own such a gateway, this is often not the case for people that have only WiFi-enabled appliances. + +The types of appliances that are supported by this binding are: + - Coffeemachine - Dishwasher - Fridge @@ -26,10 +32,10 @@ When an XGW3000 gateway is discovered, all appliances can be subsequently discov ## Thing Configuration -Each appliances needs the device Zigbee UID as a configuration parameter. -The Zigbee UID is nowhere to be found on the appliances, but since the discovery works quite reilably, a manual configuration is not needed. +Each appliances needs the device UID as a configuration parameter. +The UID is nowhere to be found on the appliances, but since the discovery works quite reliably, a manual configuration is not needed. -However, in the thing file, a manual configuration looks like this: +Once you got hold of the IDs, a manual configuration looks like this: ``` Bridge miele:xgw3000:dilbeek [ipAddress="192.168.0.18", interface="192.168.0.5"] { @@ -49,7 +55,7 @@ Thing coffeemachine coffeemachine [uid="001d63fffe020505#190"] ## Channels -The definition of the channels in use can best be checked in the [source repository](https://github.com/openhab/openhab2-addons/tree/master/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing). +The definition of the channels in use can best be checked in the [source repository](https://github.com/openhab/openhab-addons/tree/master/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing). ## Example diff --git a/bundles/org.openhab.binding.miele/pom.xml b/bundles/org.openhab.binding.miele/pom.xml index 7700fa5270411..514b6ae08e91a 100644 --- a/bundles/org.openhab.binding.miele/pom.xml +++ b/bundles/org.openhab.binding.miele/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.miele</artifactId> diff --git a/bundles/org.openhab.binding.miele/src/main/feature/feature.xml b/bundles/org.openhab.binding.miele/src/main/feature/feature.xml index 5b78f9596abc2..44c58e640fba6 100644 --- a/bundles/org.openhab.binding.miele/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.miele/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.miele-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-miele" description="Miele@home Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleBindingConstants.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleBindingConstants.java index f1da08f2023a5..8bfd12dcd81ee 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleBindingConstants.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,7 @@ * used across the whole binding. * * @author Karel Goderis - Initial contribution + * @author Martin Lepsy - added constants for support of WiFi devices & protocol */ @NonNullByDefault public class MieleBindingConstants { @@ -27,6 +28,9 @@ public class MieleBindingConstants { public static final String BINDING_ID = "miele"; public static final String APPLIANCE_ID = "uid"; public static final String DEVICE_CLASS = "dc"; + public static final String HDM_LAN = "hdm:LAN:"; + public static final String HDM_ZIGBEE = "hdm:ZigBee:"; + public static final String PROTOCOL_PROPERTY_NAME = "protocol"; // List of all Thing Type UIDs public static final ThingTypeUID THING_TYPE_XGW3000 = new ThingTypeUID(BINDING_ID, "xgw3000"); diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleHandlerFactory.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleHandlerFactory.java index ad8bcb6a19d4c..1fbb6bffa07b2 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleHandlerFactory.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/MieleHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleApplianceDiscoveryService.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleApplianceDiscoveryService.java index 742d90141704b..16931589a6560 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleApplianceDiscoveryService.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleApplianceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,6 +42,7 @@ * associated with the Miele@Home gateway * * @author Karel Goderis - Initial contribution + * @author Martin Lepsy - Added protocol information in order so support WiFi devices */ public class MieleApplianceDiscoveryService extends AbstractDiscoveryService implements ApplianceStatusListener { @@ -97,8 +98,10 @@ private void onApplianceAddedInternal(HomeDevice appliance) { if (thingUID != null) { ThingUID bridgeUID = mieleBridgeHandler.getThing().getUID(); Map<String, Object> properties = new HashMap<>(2); - properties.put(APPLIANCE_ID, - StringUtils.right(appliance.UID, appliance.UID.length() - new String("hdm:ZigBee:").length())); + + properties.put(PROTOCOL_PROPERTY_NAME, appliance.getProtocol()); + properties.put(APPLIANCE_ID, appliance.getApplianceId()); + for (JsonElement dc : appliance.DeviceClasses) { if (dc.getAsString().contains("com.miele.xgw3000.gateway.hdm.deviceclasses.Miele") && !dc.getAsString().equals("com.miele.xgw3000.gateway.hdm.deviceclasses.MieleAppliance")) { @@ -155,7 +158,7 @@ private ThingUID getThingUID(HomeDevice appliance) { StringUtils.lowerCase(modelID.replaceAll("[^a-zA-Z0-9_]", "_"))); if (getSupportedThingTypes().contains(thingTypeUID)) { - ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, getId(appliance)); + ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, appliance.getId()); return thingUID; } else { return null; @@ -164,10 +167,4 @@ private ThingUID getThingUID(HomeDevice appliance) { return null; } } - - private String getId(HomeDevice appliance) { - return StringUtils.right(appliance.UID, appliance.UID.length() - new String("hdm:ZigBee:").length()) - .replaceAll("[^a-zA-Z0-9_]", "_"); - } - } diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleMDNSDiscoveryParticipant.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleMDNSDiscoveryParticipant.java index 946e0f77dde60..fbeec362e14e0 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleMDNSDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/discovery/MieleMDNSDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,6 +25,7 @@ import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; import org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant; +import org.eclipse.smarthome.config.discovery.mdns.internal.MDNSDiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; import org.openhab.binding.miele.internal.MieleBindingConstants; @@ -37,12 +38,16 @@ * {@link MDNSDiscoveryService}. * * @author Karel Goderis - Initial contribution + * @author Martin Lepsy - Added check for Miele gateway for cleaner discovery * */ @Component(immediate = true) public class MieleMDNSDiscoveryParticipant implements MDNSDiscoveryParticipant { private final Logger logger = LoggerFactory.getLogger(MieleMDNSDiscoveryParticipant.class); + private static final String PATH_TO_CHECK_FOR_XGW3000 = "/rest/"; + private static final String SERVICE_NAME = "mieleathome"; + private static final String PATH_PROPERTY_NAME = "path"; @Override public Set<ThingTypeUID> getSupportedThingTypeUIDs() { @@ -56,7 +61,7 @@ public String getServiceType() { @Override public DiscoveryResult createResult(ServiceInfo service) { - if (service.getApplication().contains("mieleathome")) { + if (isMieleGateway(service)) { ThingUID uid = getThingUID(service); if (uid != null) { @@ -96,4 +101,18 @@ public ThingUID getThingUID(ServiceInfo service) { return null; } + /** + * Checks if service is a Miele XGW3000 Gateway + * + * application must be mieleathome + * must contain path with value /rest/ + * + * @param service the service to check + * @return true, if the discovered service is a Miele XGW3000 Gateway + */ + private boolean isMieleGateway(ServiceInfo service) { + return service.getApplication().contains(SERVICE_NAME) && service.getPropertyString(PATH_PROPERTY_NAME) != null + && service.getPropertyString(PATH_PROPERTY_NAME).equalsIgnoreCase(PATH_TO_CHECK_FOR_XGW3000); + } + } diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceChannelSelector.java index bb431465aba2d..aeb88fe0a2a23 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceStatusListener.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceStatusListener.java index 78fba5a64e16b..23c9346d25799 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceStatusListener.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/ApplianceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineChannelSelector.java index b744c6c222a8d..b3cc6986f46de 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineHandler.java index 153b133ca002e..ca542e2229835 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/CoffeeMachineHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ * which are sent to one of the channels * * @author Stephan Esch - Initial contribution + * @author Martin Lepsy - fixed handling of empty JSON results */ public class CoffeeMachineHandler extends MieleApplianceHandler<CoffeeMachineChannelSelector> { @@ -68,7 +69,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishWasherHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishWasherHandler.java index 6854915bd8599..af131d8309db3 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishWasherHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishWasherHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,6 +30,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class DishWasherHandler extends MieleApplianceHandler<DishwasherChannelSelector> { @@ -69,7 +70,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishwasherChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishwasherChannelSelector.java index 5084dd66565e7..49685d70ce756 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishwasherChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/DishwasherChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeChannelSelector.java index ca8ac00ba2c78..1821e1a1a3f28 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerChannelSelector.java index f5bb1df069b16..a35840a17422d 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerHandler.java index 808422dfb30da..3d7a254cf4a98 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeFreezerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class FridgeFreezerHandler extends MieleApplianceHandler<FridgeFreezerChannelSelector> { @@ -74,7 +75,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeHandler.java index 589aa920f1497..4c9432135b2c8 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/FridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ * which are sent to one of the channels * * @author Karel Goderis - Initial contribution + * @author Martin Lepsy - fixed handling of empty JSON results */ public class FridgeHandler extends MieleApplianceHandler<FridgeChannelSelector> { @@ -74,7 +75,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobChannelSelector.java index 406557457808a..0d6068af2c815 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobHandler.java index f49b3cd6f60eb..8c9a5626017c0 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HobHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodChannelSelector.java index 7b4f2312c8f28..43ff4ee791b29 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodHandler.java index aab224a345f07..9e8beb65e788e 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/HoodHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class HoodHandler extends MieleApplianceHandler<HoodChannelSelector> { @@ -72,7 +73,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java index 890889c2eca00..cfe96f397a201 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleApplianceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -52,6 +52,7 @@ * the {@link ApplianceChannelSelector} datapoints * * @author Karel Goderis - Initial contribution + * @author Martin Lepsy - Added check for JsonNull result */ public abstract class MieleApplianceHandler<E extends Enum<E> & ApplianceChannelSelector> extends BaseThingHandler implements ApplianceStatusListener { @@ -142,8 +143,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { } @Override - public void onApplianceStateChanged(String UID, DeviceClassObject dco) { - String myUID = "hdm:ZigBee:" + (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID); + public void onApplianceStateChanged(String UID, DeviceClassObject dco) { + String myUID = ((String) getThing().getProperties().get(PROTOCOL_PROPERTY_NAME)) + (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID); String modelID = StringUtils.right(dco.DeviceClass, dco.DeviceClass.length() - new String("com.miele.xgw3000.gateway.hdm.deviceclasses.Miele").length()); @@ -175,7 +176,7 @@ public void onApplianceStateChanged(String UID, DeviceClassObject dco) { @Override public void onAppliancePropertyChanged(String UID, DeviceProperty dp) { - String myUID = "hdm:ZigBee:" + (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID); + String myUID = ((String) getThing().getProperties().get(PROTOCOL_PROPERTY_NAME)) + (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID); if (myUID.equals(UID)) { try { @@ -270,4 +271,8 @@ private synchronized MieleBridgeHandler getMieleBridgeHandler() { } return this.bridgeHandler; } + + protected boolean isResultProcessable(JsonElement result) { + return result != null && !result.isJsonNull(); + } } diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleBridgeHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleBridgeHandler.java index 03ed01139aa53..50ad0db858fca 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleBridgeHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -66,6 +66,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - Fixed lifecycle issues + * @author Martin Lepsy - Added protocol information to support WiFi devices & some refactoring for HomeDevice */ public class MieleBridgeHandler extends BaseBridgeHandler { @@ -96,6 +97,9 @@ public class MieleBridgeHandler extends BaseBridgeHandler { // Data structures to de-JSONify whatever Miele appliances are sending us public class HomeDevice { + + private static final String PROTOCOL_LAN = "LAN"; + public String Name; public String Status; public String ParentUID; @@ -111,6 +115,19 @@ public class HomeDevice { HomeDevice() { } + + public String getId() { + return getApplianceId().replaceAll("[^a-zA-Z0-9_]", "_"); + } + + public String getProtocol() { + return ProtocolAdapterName.equals(PROTOCOL_LAN) ? HDM_LAN : HDM_ZIGBEE; + } + + public String getApplianceId() { + return ProtocolAdapterName.equals(PROTOCOL_LAN) ? StringUtils.right(UID, UID.length() - HDM_LAN.length()) + : StringUtils.right(UID, UID.length() - HDM_ZIGBEE.length()); + } } public class DeviceClassObject { @@ -174,7 +191,7 @@ public void initialize() { headers = new HashMap<>(); onUpdate(); - updateStatus(ThingStatus.ONLINE); + updateStatus(ThingStatus.UNKNOWN); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Invalid IP address for the Miele@Home gateway or multicast interface:" + getConfig().get(HOST) @@ -187,7 +204,6 @@ public void initialize() { } private Runnable pollingRunnable = new Runnable() { - @Override public void run() { if (IP_PATTERN.matcher((String) getConfig().get(HOST)).matches()) { @@ -196,10 +212,8 @@ public void run() { currentBridgeConnectionState = true; } else { currentBridgeConnectionState = false; - if (lastBridgeConnectionState) { - lastBridgeConnectionState = false; - onConnectionLost(); - } + lastBridgeConnectionState = false; + onConnectionLost(); } if (!lastBridgeConnectionState && currentBridgeConnectionState) { @@ -220,7 +234,7 @@ public void run() { } } if (!isExisting) { - logger.info("A new appliance with ID '{}' has been added", hd.UID); + logger.debug("A new appliance with ID '{}' has been added", hd.UID); for (ApplianceStatusListener listener : applianceStatusListeners) { listener.onApplianceAdded(hd); } @@ -236,7 +250,7 @@ public void run() { } } if (!isCurrent) { - logger.info("The appliance with ID '{}' has been removed", hd); + logger.debug("The appliance with ID '{}' has been removed", hd); for (ApplianceStatusListener listener : applianceStatusListeners) { listener.onApplianceRemoved(hd); } @@ -247,7 +261,7 @@ public void run() { for (Thing appliance : getThing().getThings()) { if (appliance.getStatus() == ThingStatus.ONLINE) { - String UID = "hdm:ZigBee:" + String UID = appliance.getProperties().get(PROTOCOL_PROPERTY_NAME) + (String) appliance.getConfiguration().getProperties().get(APPLIANCE_ID); Object[] args = new Object[2]; @@ -411,9 +425,14 @@ public List<HomeDevice> getHomeDevices() { }; public JsonElement invokeOperation(String UID, String modelID, String methodName) { + return invokeOperation(UID, modelID, methodName, HDM_ZIGBEE); + } + + public JsonElement invokeOperation(String UID, String modelID, String methodName, String protocol) { + if (getThing().getStatus() == ThingStatus.ONLINE) { Object[] args = new Object[4]; - args[0] = "hdm:ZigBee:" + UID; + args[0] = protocol + UID; args[1] = "com.miele.xgw3000.gateway.hdm.deviceclasses.Miele" + modelID; args[2] = methodName; args[3] = null; @@ -558,7 +577,7 @@ private synchronized void onUpdate() { * */ public void onConnectionLost() { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.BRIDGE_OFFLINE); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR); } /** diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenChannelSelector.java index 549e187db6885..139e399a26d9b 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenHandler.java index 79969e5267dff..e0cd8f3b20ae6 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/OvenHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,6 +13,7 @@ package org.openhab.binding.miele.internal.handler; import static org.openhab.binding.miele.internal.MieleBindingConstants.APPLIANCE_ID; +import static org.openhab.binding.miele.internal.MieleBindingConstants.PROTOCOL_PROPERTY_NAME; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.ChannelUID; @@ -30,6 +31,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class OvenHandler extends MieleApplianceHandler<OvenChannelSelector> { @@ -45,6 +47,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { String channelID = channelUID.getId(); String uid = (String) getThing().getConfiguration().getProperties().get(APPLIANCE_ID); + String protocol = (String) getThing().getProperties().get(PROTOCOL_PROPERTY_NAME); OvenChannelSelector selector = (OvenChannelSelector) getValueSelectorFromChannelID(channelID); JsonElement result = null; @@ -54,15 +57,15 @@ public void handleCommand(ChannelUID channelUID, Command command) { switch (selector) { case SWITCH: { if (command.equals(OnOffType.ON)) { - result = bridgeHandler.invokeOperation(uid, modelID, "switchOn"); + result = bridgeHandler.invokeOperation(uid, modelID, "switchOn", protocol); } else if (command.equals(OnOffType.OFF)) { - result = bridgeHandler.invokeOperation(uid, modelID, "switchOff"); + result = bridgeHandler.invokeOperation(uid, modelID, "switchOff", protocol); } break; } case STOP: { if (command.equals(OnOffType.ON)) { - result = bridgeHandler.invokeOperation(uid, modelID, "stop"); + result = bridgeHandler.invokeOperation(uid, modelID, "stop", protocol); } break; } @@ -75,7 +78,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerChannelSelector.java index f03b717ed672c..5556be0edef67 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerHandler.java index 1d04c30c60bff..37d8b30852473 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/TumbleDryerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,6 +30,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class TumbleDryerHandler extends MieleApplianceHandler<TumbleDryerChannelSelector> { @@ -69,7 +70,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineChannelSelector.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineChannelSelector.java index aee0263968d8c..ffbe17590f654 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineChannelSelector.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineChannelSelector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineHandler.java b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineHandler.java index d567ee136ca3b..286ebcacca431 100644 --- a/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineHandler.java +++ b/bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/WashingMachineHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,6 +30,7 @@ * * @author Karel Goderis - Initial contribution * @author Kai Kreuzer - fixed handling of REFRESH commands + * @author Martin Lepsy - fixed handling of empty JSON results */ public class WashingMachineHandler extends MieleApplianceHandler<WashingMachineChannelSelector> { @@ -70,7 +71,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } // process result - if (result != null) { + if (isResultProcessable(result)) { logger.debug("Result of operation is {}", result.getAsString()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing/xgw3000.xml b/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing/xgw3000.xml index 75f689df25eda..f14a16d4c355f 100644 --- a/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing/xgw3000.xml +++ b/bundles/org.openhab.binding.miele/src/main/resources/ESH-INF/thing/xgw3000.xml @@ -21,7 +21,7 @@ </parameter> <parameter name="interface" type="text"> <context>network-address</context> - <label>Network Address of the Multicast interface</label> + <label>Network Address of the Multicast Interface</label> <description>Network address of openHAB host interface where the binding will listen for multicast events coming from the Miele@home gateway</description> <required>true</required> </parameter> diff --git a/bundles/org.openhab.binding.mihome/NOTICE b/bundles/org.openhab.binding.mihome/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.mihome/NOTICE +++ b/bundles/org.openhab.binding.mihome/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.mihome/README.md b/bundles/org.openhab.binding.mihome/README.md index f8b132a5ea2eb..b24bfb904bea4 100644 --- a/bundles/org.openhab.binding.mihome/README.md +++ b/bundles/org.openhab.binding.mihome/README.md @@ -3,7 +3,8 @@ This binding allows your openHAB to communicate with the Xiaomi Smart Home Suite. It consists of devices communicating over a ZigBee network with a ZigBee - WiFi gateway. -The devices are very affordable and you can get them from your favourite chinese marktes like [AliExpress](https://www.aliexpress.com/) or [GearBest](https://www.gearbest.com). The sensors run on a coincell battery for over a year. +The devices are very affordable and you can get them from your favourite chinese marktes like [AliExpress](https://www.aliexpress.com/) or [GearBest](https://www.gearbest.com). +The sensors run on a coincell battery for over a year. After setup, you can disconnect the gateway from the internet to keep your sensor information private. @@ -67,27 +68,29 @@ There are three ways of connecting supported devices to the gateway: 1. Click 3 times on the Gateway's button 2. Gateway will flash in blue and you will hear female voice in Chinese, you have 30 seconds to include your new device 3. Place the needle into the sensor and hold it for at least 3 seconds - 4. You'll hear confirmation message in Chinese + 4. You will hear confirmation message in Chinese 5. The device appears in openHAB thing Inbox * With the binding - 1. after adding the gateway make sure you have entered the right developer key - 2. in PaperUI, go to your Inbox and trigger a discovery for the binding - 3. the gateway flashes in blue and you hear a female voice in Chinese, you have 30 seconds to include your new device - 4. follow the instructions for your device to pair it to the gateway - 5. you'll hear a confirmation message in Chinese + 1. After adding the gateway make sure you have entered the right developer key + 2. In Paper UI, go to your Inbox and trigger a discovery for the binding + 3. The gateway flashes in blue and you hear a female voice in Chinese, you have 30 seconds to include your new device + 4. Follow the instructions for your device to pair it to the gateway + 5. You will hear a confirmation message in Chinese 6. The device appears in openHAB thing Inbox __Hints:__ * If you don't want to hear the Chinese voice every time, you can disable it by setting the volume to minimum in the MiHome App (same for the blinking light) -* The devices don't need an Internet connection to be working after you have set up the developer mode BUT you won't be able to connect to them via App anymore - easiest way is to block their outgoing Internet connection in your router and enable it later, when you want to check for updates etc. This will ensure that your smart home data stays only with you! +* The devices don't need an Internet connection to be working after you have set up the developer mode BUT you will not be able to connect to them via App anymore - easiest way is to block their outgoing Internet connection in your router and enable it later, when you want to check for updates etc. This will ensure that your smart home data stays only with you! ## Removing devices from the gateway -If you remove a Thing in PapaerUI it will also trigger the gateway to unpair the device. It will only reappear in your Inbox, if you connect it to the gateway again. Just follow the instructions in ["Connecting devices to the gateway"](#connecting-devices-to-the-gateway). +If you remove a Thing in PapaerUI it will also trigger the gateway to unpair the device. +It will only reappear in your Inbox, if you connect it to the gateway again. +Just follow the instructions in ["Connecting devices to the gateway"](#connecting-devices-to-the-gateway). ## Network configuration @@ -414,14 +417,17 @@ sitemap xiaomi label="Xiaomi" { ## Handling unsupported devices -The Xiaomi ecosystem grows at a steady rate. So there is a good chance that in the future even more devices get added to the suite. This section describes, how to get the necessary information to support new device types. While a device is not supported yet, it is still possible to access it's informations. +The Xiaomi ecosystem grows at a steady rate. +So there is a good chance that in the future even more devices get added to the suite. +This section describes, how to get the necessary information to support new device types. +While a device is not supported yet, it is still possible to access its information. Make sure you have connected your gateway to openHAB and the communication is working. ### Connect the new device - Go through the normal procedure to add a device to the gateway -- The device will show up in your inbox as a new unsupported device and it's model name +- The device will show up in your inbox as a new unsupported device and its model name - Add the device as a new thing of type "basic device", now you have different channels to receive and send messages from/to the device - raw messages from the device - the data from the four different type of messages (see their details in the next chapter) @@ -440,7 +446,7 @@ You have to capture as many of them as possible, so that the device is fully sup ### Open a new issue or get your hands dirty Every little help is welcome, be part of the community! -Post an issue in the Github repository with as much information as possible about the new device: +Post an issue in the GitHub repository with as much information as possible about the new device: - brand and link to device description - model name - content of all the different message types @@ -449,7 +455,8 @@ Or implement the support by youself and submit a pull request. ### Handle the message contents of a basic device thing with items -You can access the whole message contents of the basic device thing with String items. That way you can make use of your device, even if it is not supported yet! +You can access the whole message contents of the basic device thing with String items. +That way you can make use of your device, even if it is not supported yet! The following examples are a demonstration, where a basic device thing for the gateway was manually added. ``` @@ -500,7 +507,8 @@ Make sure to write numbers without quotes and strings with quotes. Also, quotes ## Debugging -If you experience any unexpected behaviour or just want to know what is going on behind the scenes, you can enable debug logging. This makes possible following the communication between the binding and the gateway. +If you experience any unexpected behaviour or just want to know what is going on behind the scenes, you can enable debug logging. +This makes possible following the communication between the binding and the gateway. ### Enable debug logging for the binding @@ -513,12 +521,13 @@ If you experience any unexpected behaviour or just want to know what is going on ## Troubleshooting -For the binding to function properly it is very important, that your network config allows the machine running openHAB to receive multicast traffic. In case you want to check if the communication between the machine and the gateway is working, you can find some hints here. +For the binding to function properly it is very important, that your network config allows the machine running openHAB to receive multicast traffic. +In case you want to check if the communication between the machine and the gateway is working, you can find some hints here. - Set up the developer communication as described in the Setup section -### Check if your linux machine receives multicast traffic +### Check if your Linux machine receives multicast traffic -- Login to the linux console +- Login to the Linux console - make sure you have __netcat__ installed - Enter ```netcat -ukl 9898``` - At least every 10 seconds you should see a message coming in from the gateway which looks like @@ -549,4 +558,7 @@ __I have connected my gateway to the network but it doesn't show up in openHAB:_ - Contact Xiaomi support - get your gateway replaced __Nothing works, I'm frustrated and have thrown my gateway into the bin. Now I don't know what to do with all the sensors:__ -Check out the Zigbee2Mqtt project on Github. It allows you to use the sensors without the gateway and get their values through MQTT. You will need some hardware to act as a gateway which is not expensive. You can find more information and a list of supported Xiaomi devices in the Github repository. +Check out the Zigbee2Mqtt project on GitHub. +It allows you to use the sensors without the gateway and get their values through MQTT. +You will need some hardware to act as a gateway which is not expensive. +You can find more information and a list of supported Xiaomi devices in the GitHub repository. diff --git a/bundles/org.openhab.binding.mihome/pom.xml b/bundles/org.openhab.binding.mihome/pom.xml index bb920d33c05ae..30b0d78e349ab 100644 --- a/bundles/org.openhab.binding.mihome/pom.xml +++ b/bundles/org.openhab.binding.mihome/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mihome</artifactId> diff --git a/bundles/org.openhab.binding.mihome/src/main/feature/feature.xml b/bundles/org.openhab.binding.mihome/src/main/feature/feature.xml index 2613296d88914..73fd4bf9808bc 100644 --- a/bundles/org.openhab.binding.mihome/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mihome/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mihome-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mihome" description="Xiaomi Mi Smart Home Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ChannelMapper.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ChannelMapper.java index ed281708026f4..46e1c8de6d8c9 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ChannelMapper.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ChannelMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ColorUtil.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ColorUtil.java index 45a7f592d85ab..6ba7ade1c9189 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ColorUtil.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ColorUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/EncryptionHelper.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/EncryptionHelper.java index a8328faf6bb25..eb52822be3f94 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/EncryptionHelper.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/EncryptionHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ModelMapper.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ModelMapper.java index 16b070191ca1e..9f89385b70241 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ModelMapper.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/ModelMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiGatewayBindingConstants.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiGatewayBindingConstants.java index 14091d8bdc97c..b53d93665f7b8 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiGatewayBindingConstants.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiGatewayBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiHandlerFactory.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiHandlerFactory.java index 48b19667ec559..71849bc848a65 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiHandlerFactory.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiItemUpdateListener.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiItemUpdateListener.java index 8febbd357658d..f1cc7be9ddd62 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiItemUpdateListener.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/XiaomiItemUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiBridgeDiscoveryService.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiBridgeDiscoveryService.java index aa111386d5552..4b57504d80a65 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiBridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiBridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiItemDiscoveryService.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiItemDiscoveryService.java index e75ef60f36f35..3ec47d5a67e2c 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiItemDiscoveryService.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/discovery/XiaomiItemDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorBaseHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorBaseHandler.java index f3029e5f57e53..222d4bf693a94 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorBaseHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorCurtainHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorCurtainHandler.java index 76d0308e03900..e5afd8592efd9 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorCurtainHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorCurtainHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorGatewayHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorGatewayHandler.java index 2a02b7c5256c7..24b1eb224b56a 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorGatewayHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorGatewayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorPlugHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorPlugHandler.java index cdda139f2b67c..44f4de2e8e8aa 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorPlugHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiActorPlugHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch1Handler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch1Handler.java index e05e1d82d5da6..0a7832212206b 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch1Handler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch1Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch2Handler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch2Handler.java index c9802017d2d12..8e6e14052bf89 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch2Handler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraActorSwitch2Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch1Handler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch1Handler.java index 97892799f2bb2..c09c155e95c7a 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch1Handler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch1Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch2Handler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch2Handler.java index 469a166f05fab..8235f0ad206af 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch2Handler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiAqaraSensorSwitch2Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiBridgeHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiBridgeHandler.java index 261c99bbc56ce..acd67512bbb19 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiBridgeHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiDeviceBaseHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiDeviceBaseHandler.java index 9eed6e1a999b0..f3cc506e3cdf6 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiDeviceBaseHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiDeviceBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseAlarmHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseAlarmHandler.java index 95e1165dcffa8..4853d82569607 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseAlarmHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseAlarmHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandler.java index 0fdff29a15c16..4860c744c0ac4 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandlerWithTimer.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandlerWithTimer.java index 75ca20bebfaa5..90782516f6e3a 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandlerWithTimer.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorBaseHandlerWithTimer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorCubeHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorCubeHandler.java index 80131b58cb674..406c1d561340a 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorCubeHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorCubeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorGasHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorGasHandler.java index 551e8cfbc7bd7..a735c41d3d9aa 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorGasHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorGasHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorHtHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorHtHandler.java index 1115a4a96c538..0fa20f74e4420 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorHtHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorHtHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorLockHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorLockHandler.java index 4907c34a4fd94..0bc3f63517a9f 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorLockHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorLockHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMagnetHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMagnetHandler.java index 5c1c68693bcf2..a2178d966ac57 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMagnetHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMagnetHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMotionHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMotionHandler.java index 94aba077c12d9..9d2b3ff680bc4 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMotionHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorMotionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSmokeHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSmokeHandler.java index e0de4c53e647b..81e1f17b34b72 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSmokeHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSmokeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSwitchHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSwitchHandler.java index e93be886a6bec..67a4a0930edbd 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSwitchHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorSwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorVibrationHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorVibrationHandler.java index 5bb38ce785cf1..3ede02add59d9 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorVibrationHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorVibrationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorWaterHandler.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorWaterHandler.java index 792a1f3c884e5..b81af4c52e48b 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorWaterHandler.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/handler/XiaomiSensorWaterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiBridgeSocket.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiBridgeSocket.java index 9ed27bf96acdd..29148174edbb7 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiBridgeSocket.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiBridgeSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiDiscoverySocket.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiDiscoverySocket.java index 0b0ba44311622..ca4058824c856 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiDiscoverySocket.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiDiscoverySocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java index 2fa7a0e9dcf6e..dcbb5f8ccca19 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocketListener.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocketListener.java index b859207f8b6eb..883af9605d6a0 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocketListener.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocketListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/config/config.xml index cdd4613beabab..e20556b87b3de 100644 --- a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/config/config.xml @@ -6,7 +6,7 @@ <config-description uri="thing-type:mihome:device"> <parameter name="itemId" type="text"> - <label>MiHome device ID</label> + <label>MiHome Device ID</label> <description>The identifier of this MiHome device</description> <required>true</required> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/basic.xml b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/basic.xml index 8548057c30cea..c459d0dd106e1 100644 --- a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/basic.xml +++ b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/basic.xml @@ -12,27 +12,27 @@ <description>This device is not supported by the binding but you can still add it to your OpenHAB configuration. All messages from the device are available as channels providing values to String Items. Please open an issue on the openhab-addons2 github page to get this device added to the binding in the future. Meanwhile you can parse the messages with rules and/or JSONPATH transformations.</description> <channels> <channel id="reportMessage" typeId="rawMessage"> - <label>Last report message</label> + <label>Last Report Message</label> <description>Report state or sensor values</description> </channel> <channel id="heartbeatMessage" typeId="rawMessage"> - <label>Last heartbeat message</label> + <label>Last Heartbeat Message</label> <description>Alive signal (up to every 60 minutes)</description> </channel> <channel id="readAckMessage" typeId="rawMessage"> - <label>Last read acknowledgement message</label> + <label>Last Read Acknowledgement Message</label> <description>Answer to an active read request</description> </channel> <channel id="writeAckMessage" typeId="rawMessage"> - <label>Last write acknowledgement message</label> + <label>Last Write Acknowledgement Message</label> <description>Answer to a command</description> </channel> <channel id="lastMessage" typeId="rawMessage"> - <label>Last raw message</label> + <label>Last Raw Message</label> <description>Last raw message from the device</description> </channel> <channel id="writeMessage" typeId="rawMessage"> - <label>Last command parameters</label> + <label>Last Command Parameters</label> <description>Channel to write command parameters - Example: \"join_permission\":\"yes\"</description> </channel> </channels> diff --git a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/channel.xml b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/channel.xml index b8e42212f6361..675990311fdd8 100644 --- a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/channel.xml +++ b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/channel.xml @@ -78,31 +78,31 @@ <channel-type id="enableSound"> <item-type>Switch</item-type> - <label>Switch to turn sound off when playing</label> + <label>Switch to Turn Sound Off When Playing</label> </channel-type> <channel-type id="rotationAngle"> <item-type>Number:Angle</item-type> - <label>Cube rotation angle</label> + <label>Cube Rotation Angle</label> <state readOnly="true" pattern="%d %unit%"></state> </channel-type> <channel-type id="rotationTime"> <item-type>Number:Time</item-type> - <label>Cube rotation time</label> + <label>Cube Rotation Time</label> <state readOnly="false" pattern="%d %unit%"></state> </channel-type> <channel-type id="gas_alarm"> <item-type>Switch</item-type> - <label>Gas detected</label> + <label>Gas Detected</label> <category>Gas</category> <state readOnly="true"></state> </channel-type> <channel-type id="leak"> <item-type>Switch</item-type> - <label>Leak detected</label> + <label>Leak Detected</label> <state readOnly="true"></state> </channel-type> @@ -229,7 +229,7 @@ <channel-type id="smoke_alarm"> <item-type>Switch</item-type> - <label>Smoke detected</label> + <label>Smoke Detected</label> <category>Smoke</category> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_cube.xml b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_cube.xml index 4cf9e5b2c58e4..ddfbbe5979331 100644 --- a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_cube.xml +++ b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_cube.xml @@ -24,7 +24,7 @@ <channel-type id="cubeAction"> <kind>trigger</kind> - <label>Cube event</label> + <label>Cube Event</label> <event> <options> <option value="MOVE">move</option> diff --git a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_vibration.xml b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_vibration.xml index dcaa054d89adb..30adb1c70879b 100644 --- a/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_vibration.xml +++ b/bundles/org.openhab.binding.mihome/src/main/resources/ESH-INF/thing/sensor_vibration.xml @@ -45,28 +45,28 @@ <channel-type id="orientationX"> <item-type>Number</item-type> - <label>X Orientation of the device</label> + <label>X Orientation of the Device</label> <state step="1" pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="orientationY"> <item-type>Number</item-type> - <label>Y Orientation of the device</label> + <label>Y Orientation of the Device</label> <state step="1" pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="orientationZ"> <item-type>Number</item-type> - <label>Z Orientation of the device</label> + <label>Z Orientation of the Device</label> <state step="1" pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="bedActivity"> <item-type>Number</item-type> - <label>Bed activity index</label> + <label>Bed Activity Index</label> <state step="1" pattern="%d" readOnly="true"> </state> </channel-type> diff --git a/bundles/org.openhab.binding.miio/.gitignore b/bundles/org.openhab.binding.miio/.gitignore index 21bdd323e0bbc..c5083f9fb9482 100644 --- a/bundles/org.openhab.binding.miio/.gitignore +++ b/bundles/org.openhab.binding.miio/.gitignore @@ -1,2 +1 @@ *.md.html -README.base.md diff --git a/bundles/org.openhab.binding.miio/NOTICE b/bundles/org.openhab.binding.miio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.miio/NOTICE +++ b/bundles/org.openhab.binding.miio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.miio/README.base.md b/bundles/org.openhab.binding.miio/README.base.md new file mode 100644 index 0000000000000..f8f5cf3362c9d --- /dev/null +++ b/bundles/org.openhab.binding.miio/README.base.md @@ -0,0 +1,129 @@ +# Xiaomi Mi IO Binding + +This binding is used to control Xiaomi products implementing the Mi IO protocol. +This is a set of wifi devices from Xiaomi that are part of the Mi Ecosystem which is branded as MiJia. + +![MIIO logo](doc/miio.png) + +## Supported Things + +The following things types are available: + +| ThingType | Description | +|------------------|--------------------------------------------------------------------------------------------------------------------------| +| miio:generic | Generic type for discovered devices. Once the token is available and the device model is determined, this ThingType will automatically change to the appropriate ThingType | +| miio:vacuum | For Xiaomi Robot Vacuum products | +| miio:basic | For several basic devices like yeelights, airpurifiers. Channels and commands are determined by database configuration | +| miio:unsupported | For experimenting with other devices which use the Mi IO protocol | + +## Mi IO Devices + +!!!devices + +# Discovery + +The binding has 2 methods for discovering devices. Depending on your network setup and the device model, your device may be discovered by one or both methods. If both methods discover your device, 2 discovery results may be in your inbox for the same device. + +The mDNS discovery method will discover your device type, but will not discover a (required) token. +The basic discovery will not discovery the type, but will discover a token for models that support it. +Accept only one of the 2 discovery results, the alternate one can further be ignored. + +## Tokens + +The binding needs a token from the Xiaomi Mi Device in order to be able to control it. +Some devices provide the token upon discovery. This may depends on the firmware version. + +If the device does not discover your token, it needs to be retrieved from the Mi Home app. +Note: latest Android MiHome no longer has the tokens in the database. Use 5.0.19 version or lower +The token needs to be retrieved from the application database. The easiest way on Android to do is by using [MiToolkit](https://github.com/ultrara1n/MiToolkit/releases). + +Alternatively, on Android open a backup file, or browse a rooted device, find the mio2db file with and read it sqlite. + +For iPhone, use an un-encrypted iTunes-Backup and unpack it and use a sqlite tool to view the files in it: +Then search in "RAW, com.xiaomi.home," for "USERID_mihome.sqlite" and look for the 32-digit-token or 96 digit encrypted token. + +Note. The Xiaomi devices change the token when inclusion is done. Hence if you get your token after reset and than include it with the Mi Home app, the token will change. + +## Binding Configuration + +No binding configuration is required. + +## Thing Configuration + +Each Xiaomi device (thing) needs the IP address and token configured to be able to communicate. See discovery for details. +Optional configuration is the refresh interval and the deviceID. Note that the deviceID is automatically retrieved when it is left blank. +The configuration for model is automatically retrieved from the device in normal operation. +However, for devices that are unsupported, you may override the value and try to use a model string from a similar device to experimentally use your device with the binding. + +| Parameter | Type | Required | Description | +|-----------------|---------|----------|-------------------------------------------------------------------| +| host | text | true | Device IP address | +| token | text | true | Token for communication (in Hex) | +| deviceId | text | true | Device ID number for communication (in Hex) | +| model | text | false | Device model string, used to determine the subtype | +| refreshInterval | integer | false | Refresh interval for refreshing the data in seconds. (0=disabled) | +| timeout | integer | false | Timeout time in milliseconds | + + +### Example Thing file + +`Thing miio:basic:light "My Light" [ host="192.168.x.x", token="put here your token", deviceId="0326xxxx" ]` + +## Channels + +Depending on the device, different channels are available. + +All devices have available the following channels (marked as advanced) besides the device specific channels + +| Channel | Type | Description | +|------------------|---------|-------------------------------------| +| network#ssid | String | Network SSID | +| network#bssid | String | Network BSSID | +| network#rssi | Number | Network RSSI | +| network#life | Number | Network Life | +| actions#commands | String | send commands. see below | + +note: the ADVANCED `actions#commands` channel can be used to send commands that are not automated via the binding. This is available for all devices +e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would enable a pre-configured timer. See https://github.com/marcelrv/XiaomiRobotVacuumProtocol for all known available commands. + + +!!!channelList + + +## Example item file Rockrobo vacuum + +``` +Group gVac "Xiaomi Robot Vacuum" <fan> +Group gVacStat "Status Details" <status> (gVac) +Group gVacCons "Consumables Usage" <line-increase> (gVac) +Group gVacDND "Do Not Disturb Settings" <moon> (gVac) +Group gVacHist "Cleaning History" <calendar> (gVac) + +String actionControl "Vacuum Control" {channel="miio:vacuum:034F0E45:actions#control" } +String actionCommand "Vacuum Command" {channel="miio:vacuum:034F0E45:actions#commands" } + +Number statusBat "Battery Level [%1.0f%%]" <battery> (gVac,gVacStat) {channel="miio:vacuum:034F0E45:status#battery" } +Number statusArea "Cleaned Area [%1.0fm²]" <zoom> (gVac,gVacStat) {channel="miio:vacuum:034F0E45:status#clean_area" } +Number statusTime "Cleaning Time [%1.0f']" <clock> (gVac,gVacStat) {channel="miio:vacuum:034F0E45:status#clean_time" } +String statusError "Error [%s]" <error> (gVac,gVacStat) {channel="miio:vacuum:034F0E45:status#error_code" } +Number statusFanPow "Fan Power [%1.0f%%]" <signal> (gVacStat) {channel="miio:vacuum:034F0E45:status#fan_power" } +Number statusClean "In Cleaning Status [%1.0f]" <switch> (gVacStat) {channel="miio:vacuum:034F0E45:status#in_cleaning" } +Switch statusDND "DND Activated" (gVacStat) {channel="miio:vacuum:034F0E45:status#dnd_enabled" } +Number statusStatus "Status [%1.0f]" <status> (gVacStat) {channel="miio:vacuum:034F0E45:status#state"} + +Number consumableMain "Main Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#main_brush_time"} +Number consumableSide "Side Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#side_brush_time"} +Number consumableFilter "Filter Time[%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#filter_time" } +Number consumableSensor "Sensor [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#sensor_dirt_time"} + +Switch dndFunction "DND Function" <moon> (gVacDND) {channel="miio:vacuum:034F0E45:dnd#dnd_function"} +String dndStart "DND Start Time [%s]" <clock> (gVacDND) {channel="miio:vacuum:034F0E45:dnd#dnd_start"} +String dndEnd "DND End Time [%s]" <clock-on> (gVacDND) {channel="miio:vacuum:034F0E45:dnd#dnd_end"} + +Number historyArea "Total Cleaned Area [%1.0fm²]" <zoom> (gVacHist) {channel="miio:vacuum:034F0E45:history#total_clean_area"} +String historyTime "Total Clean Time [%s]" <clock> (gVacHist) {channel="miio:vacuum:034F0E45:history#total_clean_time"} +Number historyCount "Total # Cleanings [%1.0f]" <office> (gVacHist) {channel="miio:vacuum:034F0E45:history#total_clean_count"} +``` + + +!!!itemFileExamples diff --git a/bundles/org.openhab.binding.miio/README.md b/bundles/org.openhab.binding.miio/README.md index 48c9df4a2fa23..c30071f264a92 100644 --- a/bundles/org.openhab.binding.miio/README.md +++ b/bundles/org.openhab.binding.miio/README.md @@ -20,116 +20,132 @@ The following things types are available: | Device | ThingType | Device Model | Supported | Remark | |------------------------------|------------------|------------------------|-----------|------------| -| AUX Air Conditioner | miio:unsupported | aux.aircondition.v1 | No | | -| Idelan Air Conditioner | miio:unsupported | idelan.aircondition.v1 | No | | -| Midea Air Conditioner v2 | miio:unsupported | midea.aircondition.v1 | No | | -| Midea Air Conditioner v2 | miio:unsupported | midea.aircondition.v2 | No | | -| Midea Air Conditioner xa1 | miio:unsupported | midea.aircondition.xa1 | No | | -| Mi Air Monitor v1 | miio:basic | [zhimi.airmonitor.v1](#zhimi-airmonitor-v1) | Yes | | -| Mi Air Quality Monitor 2gen | miio:basic | [cgllc.airmonitor.b1](#cgllc-airmonitor-b1) | Yes | | -| Mi Air Humidifier | miio:basic | [zhimi.humidifier.v1](#zhimi-humidifier-v1) | Yes | | -| Mi Air Humidifier | miio:basic | [zhimi.humidifier.ca1](#zhimi-humidifier-ca1) | Yes | | -| Mi Air Purifier v1 | miio:basic | [zhimi.airpurifier.v1](#zhimi-airpurifier-v1) | Yes | | -| Mi Air Purifier v2 | miio:basic | [zhimi.airpurifier.v2](#zhimi-airpurifier-v2) | Yes | | -| Mi Air Purifier v3 | miio:basic | [zhimi.airpurifier.v3](#zhimi-airpurifier-v3) | Yes | | -| Mi Air Purifier v5 | miio:basic | [zhimi.airpurifier.v5](#zhimi-airpurifier-v5) | Yes | | -| Mi Air Purifier Pro v6 | miio:basic | [zhimi.airpurifier.v6](#zhimi-airpurifier-v6) | Yes | | -| Mi Air Purifier Pro v7 | miio:basic | [zhimi.airpurifier.v7](#zhimi-airpurifier-v7) | Yes | | -| Mi Air Purifier 2 (mini) | miio:basic | [zhimi.airpurifier.m1](#zhimi-airpurifier-m1) | Yes | | -| Mi Air Purifier (mini) | miio:basic | [zhimi.airpurifier.m2](#zhimi-airpurifier-m2) | Yes | | -| Mi Air Purifier MS1 | miio:basic | [zhimi.airpurifier.ma1](#zhimi-airpurifier-ma1) | Yes | | -| Mi Air Purifier MS2 | miio:basic | [zhimi.airpurifier.ma2](#zhimi-airpurifier-ma2) | Yes | | -| Mi Air Purifier Super | miio:basic | [zhimi.airpurifier.sa1](#zhimi-airpurifier-sa1) | Yes | | -| Mi Air Purifier Super 2 | miio:basic | [zhimi.airpurifier.sa2](#zhimi-airpurifier-sa2) | Yes | | -| Mi Air Purifier mb1 | miio:basic | [zhimi.airpurifier.mb1](#zhimi-airpurifier-mb1) | Yes | | -| Mi Air Purifier mc1 | miio:basic | [zhimi.airpurifier.mc1](#zhimi-airpurifier-mc1) | Yes | | -| Mi Air Purifier virtual | miio:unsupported | zhimi.airpurifier.virtual | No | | -| Mi Air Purifier vtl m1 | miio:unsupported | zhimi.airpurifier.vtl_m1 | No | | -| Mi Remote v2 | miio:unsupported | chuangmi.ir.v2 | No | | -| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal1 | No | | -| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal2 | No | | -| MiJia Rice Cooker | miio:unsupported | hunmi.cooker.normal3 | No | | -| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal4 | No | | -| MiJia Heating Pressure Rice Cooker | miio:unsupported | chunmi.cooker.press1 | No | | -| MiJia Heating Pressure Rice Cooker | miio:unsupported | chunmi.cooker.press2 | No | | -| Mi Smart Fan | miio:basic | [zhimi.fan.v1](#zhimi-fan-v1) | Yes | | -| Mi Smart Fan | miio:basic | [zhimi.fan.v2](#zhimi-fan-v2) | Yes | | -| Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.v3](#zhimi-fan-v3) | Yes | | -| Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.sa1](#zhimi-fan-sa1) | Yes | | -| Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.za1](#zhimi-fan-za1) | Yes | | -| Mi Smart Home Gateway v1 | miio:unsupported | lumi.gateway.v1 | No | | -| Mi Smart Home Gateway v2 | miio:unsupported | lumi.gateway.v2 | No | | -| Mi Smart Home Gateway v3 | miio:unsupported | lumi.gateway.v3 | No | | -| Mi Humdifier | miio:basic | [zhimi.humidifier.v1](#zhimi-humidifier-v1) | Yes | | -| Light Control (Wall Switch) | miio:unsupported | lumi.ctrl_neutral1.v1 | No | | -| Light Control (Wall Switch) | miio:unsupported | lumi.ctrl_neutral2.v1 | No | | -| Xiaomi Philips Eyecare Smart Lamp 2 | miio:basic | [philips.light.sread1](#philips-light-sread1) | Yes | | -| Xiaomi Philips LED Ceiling Lamp | miio:basic | [philips.light.ceiling](#philips-light-ceiling) | Yes | | -| Xiaomi Philips LED Ceiling Lamp | miio:basic | [philips.light.zyceiling](#philips-light-zyceiling) | Yes | | -| Xiaomi Philips Bulb | miio:basic | [philips.light.bulb](#philips-light-bulb) | Yes | | -| PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp | miio:basic | [philips.light.candle](#philips-light-candle) | Yes | | -| Xiaomi Philips Downlight | miio:basic | [philips.light.downlight](#philips-light-downlight) | Yes | | -| Xiaomi Philips ZhiRui bedside lamp | miio:basic | [philips.light.moonlight](#philips-light-moonlight) | Yes | | -| Xiaomi PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp White Crystal | miio:basic | [philips.light.candle2](#philips-light-candle2) | Yes | | -| philips.light.mono1 | miio:basic | [philips.light.mono1](#philips-light-mono1) | Yes | | -| philips.light.virtual | miio:basic | [philips.light.virtual](#philips-light-virtual) | Yes | | -| philips.light.zysread | miio:basic | [philips.light.zysread](#philips-light-zysread) | Yes | | -| philips.light.zystrip | miio:basic | [philips.light.zystrip](#philips-light-zystrip) | Yes | | -| Mi Power-plug | miio:basic | [chuangmi.plug.m1](#chuangmi-plug-m1) | Yes | | -| Mi Power-plug v1 | miio:basic | [chuangmi.plug.v1](#chuangmi-plug-v1) | Yes | | -| Mi Power-plug v2 | miio:basic | [chuangmi.plug.v2](#chuangmi-plug-v2) | Yes | | -| Mi Power-plug v3 | miio:basic | [chuangmi.plug.v3](#chuangmi-plug-v3) | Yes | | -| Mi Power-plug | miio:basic | [chuangmi.plug.m3](#chuangmi-plug-m3) | Yes | | -| Mi Smart Plug | miio:basic | [chuangmi.plug.hmi205](#chuangmi-plug-hmi205) | Yes | | -| Qing Mi Smart Power Strip v1 | miio:basic | [qmi.powerstrip.v1](#qmi-powerstrip-v1) | Yes | | -| Mi Power-strip v2 | miio:basic | [zimi.powerstrip.v2](#zimi-powerstrip-v2) | Yes | | -| Mi Toothbrush | miio:unsupported | soocare.toothbrush.x3 | No | | -| Mi Robot Vacuum | miio:vacuum | [rockrobo.vacuum.v1](#rockrobo-vacuum-v1) | Yes | | -| Mi Robot Vacuum v2 | miio:vacuum | [roborock.vacuum.s5](#roborock-vacuum-s5) | Yes | | -| Rockrobo Xiaowa Vacuum v2 | miio:unsupported | roborock.vacuum.e2 | No | | -| roborock.vacuum.c1 | miio:unsupported | roborock.vacuum.c1 | No | | -| Rockrobo Xiaowa Sweeper v2 | miio:unsupported | roborock.sweeper.e2v2 | No | | -| Rockrobo Xiaowa Sweeper v3 | miio:unsupported | roborock.sweeper.e2v3 | No | | -| Mi Water Purifier v2 | miio:basic | [yunmi.waterpuri.v2](#yunmi-waterpuri-v2) | Yes | | -| Mi Water Purifier lx2 | miio:basic | [yunmi.waterpuri.lx2](#yunmi-waterpuri-lx2) | Yes | | -| Mi Water Purifier lx3 | miio:basic | [yunmi.waterpuri.lx3](#yunmi-waterpuri-lx3) | Yes | | -| Mi Water Purifier lx4 | miio:basic | [yunmi.waterpuri.lx4](#yunmi-waterpuri-lx4) | Yes | | -| Mi Water Purifier v2 | miio:basic | [yunmi.waterpurifier.v2](#yunmi-waterpurifier-v2) | Yes | | -| Mi Water Purifier v3 | miio:basic | [yunmi.waterpurifier.v3](#yunmi-waterpurifier-v3) | Yes | | -| Mi Water Purifier v4 | miio:basic | [yunmi.waterpurifier.v4](#yunmi-waterpurifier-v4) | Yes | | -| Xiaomi Wifi Extender | miio:unsupported | xiaomi.repeater.v2 | No | | -| Mi Internet Speaker | miio:unsupported | xiaomi.wifispeaker.v1 | No | | -| Yeelight Lamp | miio:basic | [yeelink.light.bslamp1](#yeelink-light-bslamp1) | Yes | | -| Yeelight Lamp | miio:basic | [yeelink.light.bslamp2](#yeelink-light-bslamp2) | Yes | | -| Yeelight LED Ceiling Lamp | miio:basic | [yeelink.light.ceiling1](#yeelink-light-ceiling1) | Yes | | -| Yeelight LED Ceiling Lamp v2 | miio:basic | [yeelink.light.ceiling2](#yeelink-light-ceiling2) | Yes | | -| Yeelight LED Ceiling Lamp v3 | miio:basic | [yeelink.light.ceiling3](#yeelink-light-ceiling3) | Yes | | -| Yeelight LED Ceiling Lamp v4 (JIAOYUE 650 RGB) | miio:basic | [yeelink.light.ceiling4](#yeelink-light-ceiling4) | Yes | | -| Yeelight LED Ceiling Lamp v4 | miio:basic | [yeelink.light.ceiling4.ambi](#yeelink-light-ceiling4-ambi) | Yes | | -| Yeelight LED Ceiling Lamp v5 | miio:basic | [yeelink.light.ceiling5](#yeelink-light-ceiling5) | Yes | | -| Yeelight LED Ceiling Lamp v6 | miio:basic | [yeelink.light.ceiling6](#yeelink-light-ceiling6) | Yes | | -| Yeelight LED Ceiling Lamp v7 | miio:basic | [yeelink.light.ceiling7](#yeelink-light-ceiling7) | Yes | | -| Yeelight LED Ceiling Lamp v8 | miio:basic | [yeelink.light.ceiling8](#yeelink-light-ceiling8) | Yes | | -| Yeelight ct2 | miio:basic | [yeelink.light.ct2](#yeelink-light-ct2) | Yes | | -| Yeelight White Bulb | miio:basic | [yeelink.light.mono1](#yeelink-light-mono1) | Yes | | -| Yeelight White Bulb v2 | miio:basic | [yeelink.light.mono2](#yeelink-light-mono2) | Yes | | -| Yeelight Wifi Speaker | miio:unsupported | yeelink.wifispeaker.v1 | No | | -| Yeelight | miio:basic | [yeelink.light.lamp1](#yeelink-light-lamp1) | Yes | | -| Yeelight | miio:basic | [yeelink.light.lamp2](#yeelink-light-lamp2) | Yes | | -| Yeelight | miio:basic | [yeelink.light.lamp3](#yeelink-light-lamp3) | Yes | | -| Yeelight Strip | miio:basic | [yeelink.light.strip1](#yeelink-light-strip1) | Yes | | -| Yeelight Strip | miio:basic | [yeelink.light.strip2](#yeelink-light-strip2) | Yes | | -| Yeelight | miio:basic | [yeelink.light.virtual](#yeelink-light-virtual) | Yes | | -| Yeelight Color Bulb | miio:basic | [yeelink.light.color1](#yeelink-light-color1) | Yes | | -| Yeelight Color Bulb YLDP06YL 10W | miio:basic | [yeelink.light.color2](#yeelink-light-color2) | Yes | | -| Yeelight Color Bulb | miio:basic | [yeelink.light.color3](#yeelink-light-color3) | Yes | | +| AUX Air Conditioner | miio:unsupported | aux.aircondition.v1 | No | | +| Idelan Air Conditioner | miio:unsupported | idelan.aircondition.v1 | No | | +| Midea Air Conditioner v2 | miio:unsupported | midea.aircondition.v1 | No | | +| Midea Air Conditioner v2 | miio:unsupported | midea.aircondition.v2 | No | | +| Midea Air Conditioner xa1 | miio:unsupported | midea.aircondition.xa1 | No | | +| Mi Air Monitor v1 | miio:basic | [zhimi.airmonitor.v1](#zhimi-airmonitor-v1) | Yes | | +| Mi Air Quality Monitor 2gen | miio:basic | [cgllc.airmonitor.b1](#cgllc-airmonitor-b1) | Yes | | +| Mi Air Humidifier | miio:basic | [zhimi.humidifier.v1](#zhimi-humidifier-v1) | Yes | | +| Mi Air Humidifier | miio:basic | [zhimi.humidifier.ca1](#zhimi-humidifier-ca1) | Yes | | +| Mija Smart humidifier | miio:basic | [deerma.humidifier.mjjsq](#deerma-humidifier-mjjsq) | Yes | | +| Mi Air Purifier v1 | miio:basic | [zhimi.airpurifier.v1](#zhimi-airpurifier-v1) | Yes | | +| Mi Air Purifier v2 | miio:basic | [zhimi.airpurifier.v2](#zhimi-airpurifier-v2) | Yes | | +| Mi Air Purifier v3 | miio:basic | [zhimi.airpurifier.v3](#zhimi-airpurifier-v3) | Yes | | +| Mi Air Purifier v5 | miio:basic | [zhimi.airpurifier.v5](#zhimi-airpurifier-v5) | Yes | | +| Mi Air Purifier Pro v6 | miio:basic | [zhimi.airpurifier.v6](#zhimi-airpurifier-v6) | Yes | | +| Mi Air Purifier Pro v7 | miio:basic | [zhimi.airpurifier.v7](#zhimi-airpurifier-v7) | Yes | | +| Mi Air Purifier 2 (mini) | miio:basic | [zhimi.airpurifier.m1](#zhimi-airpurifier-m1) | Yes | | +| Mi Air Purifier (mini) | miio:basic | [zhimi.airpurifier.m2](#zhimi-airpurifier-m2) | Yes | | +| Mi Air Purifier MS1 | miio:basic | [zhimi.airpurifier.ma1](#zhimi-airpurifier-ma1) | Yes | | +| Mi Air Purifier MS2 | miio:basic | [zhimi.airpurifier.ma2](#zhimi-airpurifier-ma2) | Yes | | +| Mi Air Purifier 3 | miio:basic | [zhimi.airpurifier.ma4](#zhimi-airpurifier-ma4) | Yes | | +| Mi Air Purifier Super | miio:basic | [zhimi.airpurifier.sa1](#zhimi-airpurifier-sa1) | Yes | | +| Mi Air Purifier Super 2 | miio:basic | [zhimi.airpurifier.sa2](#zhimi-airpurifier-sa2) | Yes | | +| Mi Fresh Air Ventilator | miio:unsupported | dmaker.airfresh.t2017 | No | | +| Xiao AI Smart Alarm Clock | miio:unsupported | zimi.clock.myk01 | No | | +| Yeelight Smart Bath Heater | miio:unsupported | yeelight.bhf_light.v2 | No | | +| XIAOMI MIJIA WIDETECH WDH318EFW1 Dehumidifier | miio:unsupported | nwt.derh.wdh318efw1 | No | | +| Mi Air Purifier mb1 | miio:basic | [zhimi.airpurifier.mb1](#zhimi-airpurifier-mb1) | Yes | | +| Mi Air Purifier 2S | miio:basic | [zhimi.airpurifier.mc1](#zhimi-airpurifier-mc1) | Yes | | +| Mi Air Purifier virtual | miio:unsupported | zhimi.airpurifier.virtual | No | | +| Mi Air Purifier vtl m1 | miio:unsupported | zhimi.airpurifier.vtl_m1 | No | | +| Mi Remote v2 | miio:unsupported | chuangmi.ir.v2 | No | | +| Xiaomi IR Remote | miio:unsupported | chuangmi.remote.v2 | No | | +| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal1 | No | | +| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal2 | No | | +| MiJia Rice Cooker | miio:unsupported | hunmi.cooker.normal3 | No | | +| MiJia Rice Cooker | miio:unsupported | chunmi.cooker.normal4 | No | | +| MiJia Heating Pressure Rice Cooker | miio:unsupported | chunmi.cooker.press1 | No | | +| MiJia Heating Pressure Rice Cooker | miio:unsupported | chunmi.cooker.press2 | No | | +| Mi Smart Fan | miio:basic | [zhimi.fan.v1](#zhimi-fan-v1) | Yes | | +| Mi Smart Fan | miio:basic | [zhimi.fan.v2](#zhimi-fan-v2) | Yes | | +| Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.v3](#zhimi-fan-v3) | Yes | | +| Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.sa1](#zhimi-fan-sa1) | Yes | | +| Xiaomi Mi Smart Pedestal Fan | miio:basic | [zhimi.fan.za1](#zhimi-fan-za1) | Yes | | +| Viomi Internet refrigerator iLive | miio:unsupported | viomi.fridge.v3 | No | | +| Mi Smart Home Gateway v1 | miio:unsupported | lumi.gateway.v1 | No | | +| Mi Smart Home Gateway v2 | miio:unsupported | lumi.gateway.v2 | No | | +| Mi Smart Home Gateway v3 | miio:unsupported | lumi.gateway.v3 | No | | +| Mi Humdifier | miio:basic | [zhimi.humidifier.v1](#zhimi-humidifier-v1) | Yes | | +| Light Control (Wall Switch) | miio:unsupported | lumi.ctrl_neutral1.v1 | No | | +| Light Control (Wall Switch) | miio:unsupported | lumi.ctrl_neutral2.v1 | No | | +| Xiaomi Philips Eyecare Smart Lamp 2 | miio:basic | [philips.light.sread1](#philips-light-sread1) | Yes | | +| Xiaomi Philips LED Ceiling Lamp | miio:basic | [philips.light.ceiling](#philips-light-ceiling) | Yes | | +| Xiaomi Philips LED Ceiling Lamp | miio:basic | [philips.light.zyceiling](#philips-light-zyceiling) | Yes | | +| Xiaomi Philips Bulb | miio:basic | [philips.light.bulb](#philips-light-bulb) | Yes | | +| PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp | miio:basic | [philips.light.candle](#philips-light-candle) | Yes | | +| Xiaomi Philips Downlight | miio:basic | [philips.light.downlight](#philips-light-downlight) | Yes | | +| Xiaomi Philips ZhiRui bedside lamp | miio:basic | [philips.light.moonlight](#philips-light-moonlight) | Yes | | +| Xiaomi PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp White Crystal | miio:basic | [philips.light.candle2](#philips-light-candle2) | Yes | | +| philips.light.mono1 | miio:basic | [philips.light.mono1](#philips-light-mono1) | Yes | | +| philips.light.virtual | miio:basic | [philips.light.virtual](#philips-light-virtual) | Yes | | +| philips.light.zysread | miio:basic | [philips.light.zysread](#philips-light-zysread) | Yes | | +| philips.light.zystrip | miio:basic | [philips.light.zystrip](#philips-light-zystrip) | Yes | | +| Mi Power-plug | miio:basic | [chuangmi.plug.m1](#chuangmi-plug-m1) | Yes | | +| Mi Power-plug v1 | miio:basic | [chuangmi.plug.v1](#chuangmi-plug-v1) | Yes | | +| Mi Power-plug v2 | miio:basic | [chuangmi.plug.v2](#chuangmi-plug-v2) | Yes | | +| Mi Power-plug v3 | miio:basic | [chuangmi.plug.v3](#chuangmi-plug-v3) | Yes | | +| Mi Power-plug | miio:basic | [chuangmi.plug.m3](#chuangmi-plug-m3) | Yes | | +| Mi Smart Plug | miio:basic | [chuangmi.plug.hmi205](#chuangmi-plug-hmi205) | Yes | | +| Qing Mi Smart Power Strip v1 | miio:basic | [qmi.powerstrip.v1](#qmi-powerstrip-v1) | Yes | | +| Mi Power-strip v2 | miio:basic | [zimi.powerstrip.v2](#zimi-powerstrip-v2) | Yes | | +| Mi Toothbrush | miio:unsupported | soocare.toothbrush.x3 | No | | +| Mi Robot Vacuum | miio:vacuum | [rockrobo.vacuum.v1](#rockrobo-vacuum-v1) | Yes | | +| Mi Xiaowa Vacuum c1 | miio:vacuum | [roborock.vacuum.c1](#roborock-vacuum-c1) | Yes | | +| Mi Robot Vacuum v2 | miio:vacuum | [roborock.vacuum.s5](#roborock-vacuum-s5) | Yes | | +| Mi Robot Vacuum 1S | miio:vacuum | [roborock.vacuum.m1s](#roborock-vacuum-m1s) | Yes | | +| Roborock Vacuum S6 | miio:vacuum | [roborock.vacuum.s6](#roborock-vacuum-s6) | Yes | | +| Roborock Vacuum S5 Max | miio:vacuum | [roborock.vacuum.s5e](#roborock-vacuum-s5e) | Yes | | +| Roborock Vacuum S6 | miio:vacuum | [rockrobo.vacuum.s6](#rockrobo-vacuum-s6) | Yes | | +| Rockrobo Xiaowa Vacuum v2 | miio:unsupported | roborock.vacuum.e2 | No | | +| Xiaomi Mijia vacuum V-RVCLM21B | miio:unsupported | viomi.vacuum.v6 | No | | +| Xiaomi Mijia vacuum STYJ02YM | miio:unsupported | viomi.vacuum.v7 | No | | +| roborock.vacuum.c1 | miio:unsupported | roborock.vacuum.c1 | No | | +| Rockrobo Xiaowa Sweeper v2 | miio:unsupported | roborock.sweeper.e2v2 | No | | +| Rockrobo Xiaowa Sweeper v3 | miio:unsupported | roborock.sweeper.e2v3 | No | | +| Mi Water Purifier v2 | miio:basic | [yunmi.waterpuri.v2](#yunmi-waterpuri-v2) | Yes | | +| Mi Water Purifier lx2 | miio:basic | [yunmi.waterpuri.lx2](#yunmi-waterpuri-lx2) | Yes | | +| Mi Water Purifier lx3 | miio:basic | [yunmi.waterpuri.lx3](#yunmi-waterpuri-lx3) | Yes | | +| Mi Water Purifier lx4 | miio:basic | [yunmi.waterpuri.lx4](#yunmi-waterpuri-lx4) | Yes | | +| Mi Water Purifier v2 | miio:basic | [yunmi.waterpurifier.v2](#yunmi-waterpurifier-v2) | Yes | | +| Mi Water Purifier v3 | miio:basic | [yunmi.waterpurifier.v3](#yunmi-waterpurifier-v3) | Yes | | +| Mi Water Purifier v4 | miio:basic | [yunmi.waterpurifier.v4](#yunmi-waterpurifier-v4) | Yes | | +| Xiaomi Wifi Extender | miio:unsupported | xiaomi.repeater.v2 | No | | +| Mi Internet Speaker | miio:unsupported | xiaomi.wifispeaker.v1 | No | | +| Yeelight Lamp | miio:basic | [yeelink.light.bslamp1](#yeelink-light-bslamp1) | Yes | | +| Yeelight Lamp | miio:basic | [yeelink.light.bslamp2](#yeelink-light-bslamp2) | Yes | | +| Yeelight LED Ceiling Lamp | miio:basic | [yeelink.light.ceiling1](#yeelink-light-ceiling1) | Yes | | +| Yeelight LED Ceiling Lamp v2 | miio:basic | [yeelink.light.ceiling2](#yeelink-light-ceiling2) | Yes | | +| Yeelight LED Ceiling Lamp v3 | miio:basic | [yeelink.light.ceiling3](#yeelink-light-ceiling3) | Yes | | +| Yeelight LED Ceiling Lamp v4 (JIAOYUE 650 RGB) | miio:basic | [yeelink.light.ceiling4](#yeelink-light-ceiling4) | Yes | | +| Yeelight LED Ceiling Lamp v4 | miio:basic | [yeelink.light.ceiling4.ambi](#yeelink-light-ceiling4-ambi) | Yes | | +| Yeelight LED Ceiling Lamp v5 | miio:basic | [yeelink.light.ceiling5](#yeelink-light-ceiling5) | Yes | | +| Yeelight LED Ceiling Lamp v6 | miio:basic | [yeelink.light.ceiling6](#yeelink-light-ceiling6) | Yes | | +| Yeelight LED Ceiling Lamp v7 | miio:basic | [yeelink.light.ceiling7](#yeelink-light-ceiling7) | Yes | | +| Yeelight LED Ceiling Lamp v8 | miio:basic | [yeelink.light.ceiling8](#yeelink-light-ceiling8) | Yes | | +| Yeelight LED Meteorite lamp | miio:basic | [yeelink.light.ceiling10](#yeelink-light-ceiling10) | Yes | | +| Yeelight ct2 | miio:basic | [yeelink.light.ct2](#yeelink-light-ct2) | Yes | | +| Yeelight White Bulb | miio:basic | [yeelink.light.mono1](#yeelink-light-mono1) | Yes | | +| Yeelight White Bulb v2 | miio:basic | [yeelink.light.mono2](#yeelink-light-mono2) | Yes | | +| Yeelight Wifi Speaker | miio:unsupported | yeelink.wifispeaker.v1 | No | | +| Yeelight | miio:basic | [yeelink.light.lamp1](#yeelink-light-lamp1) | Yes | | +| Yeelight | miio:basic | [yeelink.light.lamp2](#yeelink-light-lamp2) | Yes | | +| Yeelight | miio:basic | [yeelink.light.lamp3](#yeelink-light-lamp3) | Yes | | +| Yeelight Strip | miio:basic | [yeelink.light.strip1](#yeelink-light-strip1) | Yes | | +| Yeelight Strip | miio:basic | [yeelink.light.strip2](#yeelink-light-strip2) | Yes | | +| Yeelight | miio:basic | [yeelink.light.virtual](#yeelink-light-virtual) | Yes | | +| Yeelight Color Bulb | miio:basic | [yeelink.light.color1](#yeelink-light-color1) | Yes | | +| Yeelight Color Bulb YLDP06YL 10W | miio:basic | [yeelink.light.color2](#yeelink-light-color2) | Yes | | +| Yeelight Color Bulb | miio:basic | [yeelink.light.color3](#yeelink-light-color3) | Yes | | # Discovery The binding has 2 methods for discovering devices. Depending on your network setup and the device model, your device may be discovered by one or both methods. If both methods discover your device, 2 discovery results may be in your inbox for the same device. -The MDNS discovery method will discover your device type, but won't discover a (required) token. +The mDNS discovery method will discover your device type, but will not discover a (required) token. The basic discovery will not discovery the type, but will discover a token for models that support it. Accept only one of the 2 discovery results, the alternate one can further be ignored. @@ -228,7 +244,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | setHumidity | Number | Humidity Set | | aqi | Number | Air Quality Index | | translevel | Number | Trans_level | -| bright | Number | Led Brightness | +| bright | Number | LED Brightness | | buzzer | Switch | Buzzer Status | | depth | Number | Depth | | dry | Switch | Dry | @@ -247,7 +263,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | setHumidity | Number | Humidity Set | | aqi | Number | Air Quality Index | | translevel | Number | Trans_level | -| bright | Number | Led Brightness | +| bright | Number | LED Brightness | | buzzer | Switch | Buzzer Status | | depth | Number | Depth | | dry | Switch | Dry | @@ -265,7 +281,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -286,7 +302,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -307,7 +323,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -328,7 +344,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -349,8 +365,8 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | -| bright | Number | Led Brightness | +| led | Switch | LED Status | +| bright | Number | LED Brightness | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | | usedhours | Number | Run Time | @@ -370,8 +386,8 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | -| bright | Number | Led Brightness | +| led | Switch | LED Status | +| bright | Number | LED Brightness | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | | usedhours | Number | Run Time | @@ -391,7 +407,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -412,7 +428,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -433,7 +449,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -454,8 +470,29 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | -| bright | Number | Led Brightness | +| led | Switch | LED Status | +| bright | Number | LED Brightness | +| filtermaxlife | Number | Filter Max Life | +| filterhours | Number | Filter Hours used | +| usedhours | Number | Run Time | +| motorspeed | Number | Motor Speed | +| filterlife | Number | Filter Life | +| favoritelevel | Number | Favorite Level | +| temperature | Number | Temperature | +| purifyvolume | Number | Purivied Volume | +| childlock | Switch | Child Lock | + +### Mi Air Purifier 3 (<a name="zhimi-airpurifier-ma4">zhimi.airpurifier.ma4</a>) Channels + +| Channel | Type | Description | +|------------------|---------|-------------------------------------| +| power | Switch | Power | +| mode | String | Mode | +| humidity | Number | Humidity | +| aqi | Number | Air Quality Index | +| averageaqi | Number | Average Air Quality Index | +| led | Switch | LED Status | +| buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | | usedhours | Number | Run Time | @@ -475,7 +512,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -496,7 +533,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -517,7 +554,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -529,7 +566,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | purifyvolume | Number | Purivied Volume | | childlock | Switch | Child Lock | -### Mi Air Purifier mc1 (<a name="zhimi-airpurifier-mc1">zhimi.airpurifier.mc1</a>) Channels +### Mi Air Purifier 2S (<a name="zhimi-airpurifier-mc1">zhimi.airpurifier.mc1</a>) Channels | Channel | Type | Description | |------------------|---------|-------------------------------------| @@ -538,7 +575,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | humidity | Number | Humidity | | aqi | Number | Air Quality Index | | averageaqi | Number | Average Air Quality Index | -| led | Switch | Led Status | +| led | Switch | LED Status | | buzzer | Switch | Buzzer Status | | filtermaxlife | Number | Filter Max Life | | filterhours | Number | Filter Hours used | @@ -560,7 +597,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | angle | Number | Angle | | poweroffTime | Number | Timer | | buzzer | Switch | Buzzer | -| led_b | Number | Led | +| led_b | Number | LED | | child_lock | Switch | Child Lock | | speedLevel | Number | Speed Level | | speed | Number | Speed | @@ -582,7 +619,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | angle | Number | Angle | | poweroffTime | Number | Timer | | buzzer | Switch | Buzzer | -| led_b | Number | Led | +| led_b | Number | LED | | child_lock | Switch | Child Lock | | speedLevel | Number | Speed Level | | speed | Number | Speed | @@ -604,7 +641,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | angle | Number | Angle | | poweroffTime | Number | Timer | | buzzer | Switch | Buzzer | -| led_b | Number | Led | +| led_b | Number | LED | | child_lock | Switch | Child Lock | | speedLevel | Number | Speed Level | | speed | Number | Speed | @@ -626,7 +663,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | angle | Number | Angle | | poweroffTime | Number | Timer | | buzzer | Switch | Buzzer | -| led_b | Number | Led | +| led_b | Number | LED | | child_lock | Switch | Child Lock | | speedLevel | Number | Speed Level | | speed | Number | Speed | @@ -644,7 +681,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | angle | Number | Angle | | poweroffTime | Number | Timer | | buzzer | Switch | Buzzer | -| led_b | Number | Led | +| led_b | Number | LED | | child_lock | Switch | Child Lock | | speedLevel | Number | Speed Level | | speed | Number | Speed | @@ -662,7 +699,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | setHumidity | Number | Humidity Set | | aqi | Number | Air Quality Index | | translevel | Number | Trans_level | -| bright | Number | Led Brightness | +| bright | Number | LED Brightness | | buzzer | Switch | Buzzer Status | | depth | Number | Depth | | dry | Switch | Dry | @@ -845,7 +882,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | power | Switch | Power | | usb | Switch | USB | | temperature | Number | Temperature | -| led | Switch | Wifi led | +| led | Switch | Wifi LED | ### Mi Power-plug (<a name="chuangmi-plug-m3">chuangmi.plug.m3</a>) Channels @@ -867,7 +904,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena |------------------|---------|-------------------------------------| | power | Switch | Power | | powerUsage | Number | Power Consumption | -| led | Switch | wifi_led | +| led | Switch | wifi LED | | power_price | Number | power_price | | current | Number | Current | | temperature | Number | Temperature | @@ -878,7 +915,7 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena |------------------|---------|-------------------------------------| | power | Switch | Power | | powerUsage | Number | Power Consumption | -| led | Switch | wifi_led | +| led | Switch | wifi LED | | power_price | Number | power_price | | current | Number | Current | | temperature | Number | Temperature | @@ -1078,6 +1115,24 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena | customScene | String | Set Scene | | nightlightBrightness | Number | Nightlight Brightness | +### Yeelight LED Meteorite lamp (<a name="yeelink-light-ceiling10">yeelink.light.ceiling10</a>) Channels + +| Channel | Type | Description | +|------------------|---------|-------------------------------------| +| power | Switch | Power | +| brightness | Number | Brightness | +| ambientBrightness | Number | Ambient Brightness | +| delayoff | Number | Shutdowm Timer | +| colorTemperature | Number | Color Temperature | +| colorMode | Number | Color Mode | +| name | String | Name | +| ambientPower | Switch | Ambient Power | +| ambientColor | Color | Ambient Color | +| ambientColorTemperature | Number | Ambient Color Temperature | +| customScene | String | Set Scene | +| ambientColorMode | Number | Ambient Color Mode | +| nightlightBrightness | Number | Nightlight Brightness | + ### Yeelight ct2 (<a name="yeelink-light-ct2">yeelink.light.ct2</a>) Channels | Channel | Type | Description | @@ -1223,7 +1278,6 @@ e.g. `smarthome:send actionCommand 'upd_timer["1498595904821", "on"]'` would ena - ## Example item file Rockrobo vacuum ``` @@ -1261,6 +1315,7 @@ Number historyCount "Total # Cleanings [%1.0f]" <office> (gVacHist) {channe ### Mi Air Monitor v1 (zhimi.airmonitor.v1) item file lines + note: Autogenerated example. Replace the id (airmonitor) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1276,6 +1331,7 @@ Number night_end "Night End Time" (G_airmonitor) {channel="miio:basic:airmonitor ``` ### Mi Air Quality Monitor 2gen (cgllc.airmonitor.b1) item file lines + note: Autogenerated example. Replace the id (airmonitor) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1291,6 +1347,7 @@ Number night_end "Night End Time" (G_airmonitor) {channel="miio:basic:airmonitor ``` ### Mi Air Humidifier (zhimi.humidifier.v1) item file lines + note: Autogenerated example. Replace the id (humidifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1301,7 +1358,7 @@ Number humidity "Humidity" (G_humidifier) {channel="miio:basic:humidifier:humidi Number setHumidity "Humidity Set" (G_humidifier) {channel="miio:basic:humidifier:setHumidity"} Number aqi "Air Quality Index" (G_humidifier) {channel="miio:basic:humidifier:aqi"} Number translevel "Trans_level" (G_humidifier) {channel="miio:basic:humidifier:translevel"} -Number bright "Led Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} +Number bright "LED Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} Switch buzzer "Buzzer Status" (G_humidifier) {channel="miio:basic:humidifier:buzzer"} Number depth "Depth" (G_humidifier) {channel="miio:basic:humidifier:depth"} Switch dry "Dry" (G_humidifier) {channel="miio:basic:humidifier:dry"} @@ -1312,6 +1369,7 @@ Switch childlock "Child Lock" (G_humidifier) {channel="miio:basic:humidifier:chi ``` ### Mi Air Humidifier (zhimi.humidifier.ca1) item file lines + note: Autogenerated example. Replace the id (humidifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1322,7 +1380,7 @@ Number humidity "Humidity" (G_humidifier) {channel="miio:basic:humidifier:humidi Number setHumidity "Humidity Set" (G_humidifier) {channel="miio:basic:humidifier:setHumidity"} Number aqi "Air Quality Index" (G_humidifier) {channel="miio:basic:humidifier:aqi"} Number translevel "Trans_level" (G_humidifier) {channel="miio:basic:humidifier:translevel"} -Number bright "Led Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} +Number bright "LED Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} Switch buzzer "Buzzer Status" (G_humidifier) {channel="miio:basic:humidifier:buzzer"} Number depth "Depth" (G_humidifier) {channel="miio:basic:humidifier:depth"} Switch dry "Dry" (G_humidifier) {channel="miio:basic:humidifier:dry"} @@ -1333,6 +1391,7 @@ Switch childlock "Child Lock" (G_humidifier) {channel="miio:basic:humidifier:chi ``` ### Mi Air Purifier v1 (zhimi.airpurifier.v1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1342,7 +1401,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1356,6 +1415,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier v2 (zhimi.airpurifier.v2) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1365,7 +1425,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1379,6 +1439,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier v3 (zhimi.airpurifier.v3) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1388,7 +1449,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1402,6 +1463,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier v5 (zhimi.airpurifier.v5) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1411,7 +1473,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1425,6 +1487,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier Pro v6 (zhimi.airpurifier.v6) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1434,8 +1497,8 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} -Number bright "Led Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Number bright "LED Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} Number usedhours "Run Time" (G_airpurifier) {channel="miio:basic:airpurifier:usedhours"} @@ -1448,6 +1511,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier Pro v7 (zhimi.airpurifier.v7) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1457,8 +1521,8 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} -Number bright "Led Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Number bright "LED Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} Number usedhours "Run Time" (G_airpurifier) {channel="miio:basic:airpurifier:usedhours"} @@ -1471,6 +1535,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier 2 (mini) (zhimi.airpurifier.m1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1480,7 +1545,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1494,6 +1559,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier (mini) (zhimi.airpurifier.m2) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1503,7 +1569,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1517,6 +1583,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier MS1 (zhimi.airpurifier.ma1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1526,7 +1593,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1540,6 +1607,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier MS2 (zhimi.airpurifier.ma2) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1549,8 +1617,32 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} -Number bright "Led Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Number bright "LED Brightness" (G_airpurifier) {channel="miio:basic:airpurifier:bright"} +Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} +Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} +Number usedhours "Run Time" (G_airpurifier) {channel="miio:basic:airpurifier:usedhours"} +Number motorspeed "Motor Speed" (G_airpurifier) {channel="miio:basic:airpurifier:motorspeed"} +Number filterlife "Filter Life" (G_airpurifier) {channel="miio:basic:airpurifier:filterlife"} +Number favoritelevel "Favorite Level" (G_airpurifier) {channel="miio:basic:airpurifier:favoritelevel"} +Number temperature "Temperature" (G_airpurifier) {channel="miio:basic:airpurifier:temperature"} +Number purifyvolume "Purivied Volume" (G_airpurifier) {channel="miio:basic:airpurifier:purifyvolume"} +Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:childlock"} +``` + +### Mi Air Purifier 3 (zhimi.airpurifier.ma4) item file lines + +note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. + +```java +Group G_airpurifier "Mi Air Purifier 3" <status> +Switch power "Power" (G_airpurifier) {channel="miio:basic:airpurifier:power"} +String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} +Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} +Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} +Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} Number usedhours "Run Time" (G_airpurifier) {channel="miio:basic:airpurifier:usedhours"} @@ -1563,6 +1655,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier Super (zhimi.airpurifier.sa1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1572,7 +1665,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1586,6 +1679,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier Super 2 (zhimi.airpurifier.sa2) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1595,7 +1689,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1609,6 +1703,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Air Purifier mb1 (zhimi.airpurifier.mb1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1618,7 +1713,7 @@ String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1631,17 +1726,18 @@ Number purifyvolume "Purivied Volume" (G_airpurifier) {channel="miio:basic:airpu Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:childlock"} ``` -### Mi Air Purifier mc1 (zhimi.airpurifier.mc1) item file lines +### Mi Air Purifier 2S (zhimi.airpurifier.mc1) item file lines + note: Autogenerated example. Replace the id (airpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java -Group G_airpurifier "Mi Air Purifier mc1" <status> +Group G_airpurifier "Mi Air Purifier 2S" <status> Switch power "Power" (G_airpurifier) {channel="miio:basic:airpurifier:power"} String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:mode"} Number humidity "Humidity" (G_airpurifier) {channel="miio:basic:airpurifier:humidity"} Number aqi "Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:aqi"} Number averageaqi "Average Air Quality Index" (G_airpurifier) {channel="miio:basic:airpurifier:averageaqi"} -Switch led "Led Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} +Switch led "LED Status" (G_airpurifier) {channel="miio:basic:airpurifier:led"} Switch buzzer "Buzzer Status" (G_airpurifier) {channel="miio:basic:airpurifier:buzzer"} Number filtermaxlife "Filter Max Life" (G_airpurifier) {channel="miio:basic:airpurifier:filtermaxlife"} Number filterhours "Filter Hours used" (G_airpurifier) {channel="miio:basic:airpurifier:filterhours"} @@ -1655,6 +1751,7 @@ Switch childlock "Child Lock" (G_airpurifier) {channel="miio:basic:airpurifier:c ``` ### Mi Smart Fan (zhimi.fan.v1) item file lines + note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1665,7 +1762,7 @@ Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} -Number led_b "Led" (G_fan) {channel="miio:basic:fan:led_b"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} @@ -1679,6 +1776,7 @@ String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` ### Mi Smart Fan (zhimi.fan.v2) item file lines + note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1689,7 +1787,7 @@ Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} -Number led_b "Led" (G_fan) {channel="miio:basic:fan:led_b"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} @@ -1703,6 +1801,7 @@ String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` ### Mi Smart Pedestal Fan (zhimi.fan.v3) item file lines + note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1713,7 +1812,7 @@ Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} -Number led_b "Led" (G_fan) {channel="miio:basic:fan:led_b"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} @@ -1727,6 +1826,7 @@ String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` ### Xiaomi Mi Smart Pedestal Fan (zhimi.fan.sa1) item file lines + note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1737,7 +1837,7 @@ Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} -Number led_b "Led" (G_fan) {channel="miio:basic:fan:led_b"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} @@ -1747,6 +1847,7 @@ String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` ### Xiaomi Mi Smart Pedestal Fan (zhimi.fan.za1) item file lines + note: Autogenerated example. Replace the id (fan) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1757,7 +1858,7 @@ Number usedhours "Run Time" (G_fan) {channel="miio:basic:fan:usedhours"} Number angle "Angle" (G_fan) {channel="miio:basic:fan:angle"} Number poweroffTime "Timer" (G_fan) {channel="miio:basic:fan:poweroffTime"} Switch buzzer "Buzzer" (G_fan) {channel="miio:basic:fan:buzzer"} -Number led_b "Led" (G_fan) {channel="miio:basic:fan:led_b"} +Number led_b "LED" (G_fan) {channel="miio:basic:fan:led_b"} Switch child_lock "Child Lock" (G_fan) {channel="miio:basic:fan:child_lock"} Number speedLevel "Speed Level" (G_fan) {channel="miio:basic:fan:speedLevel"} Number speed "Speed" (G_fan) {channel="miio:basic:fan:speed"} @@ -1767,6 +1868,7 @@ String move "Move Direction" (G_fan) {channel="miio:basic:fan:move"} ``` ### Mi Humdifier (zhimi.humidifier.v1) item file lines + note: Autogenerated example. Replace the id (humidifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1777,7 +1879,7 @@ Number humidity "Humidity" (G_humidifier) {channel="miio:basic:humidifier:humidi Number setHumidity "Humidity Set" (G_humidifier) {channel="miio:basic:humidifier:setHumidity"} Number aqi "Air Quality Index" (G_humidifier) {channel="miio:basic:humidifier:aqi"} Number translevel "Trans_level" (G_humidifier) {channel="miio:basic:humidifier:translevel"} -Number bright "Led Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} +Number bright "LED Brightness" (G_humidifier) {channel="miio:basic:humidifier:bright"} Switch buzzer "Buzzer Status" (G_humidifier) {channel="miio:basic:humidifier:buzzer"} Number depth "Depth" (G_humidifier) {channel="miio:basic:humidifier:depth"} Switch dry "Dry" (G_humidifier) {channel="miio:basic:humidifier:dry"} @@ -1788,6 +1890,7 @@ Switch childlock "Child Lock" (G_humidifier) {channel="miio:basic:humidifier:chi ``` ### Xiaomi Philips Eyecare Smart Lamp 2 (philips.light.sread1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1801,6 +1904,7 @@ Switch eyecare "Eyecare" (G_light) {channel="miio:basic:light:eyecare"} ``` ### Xiaomi Philips LED Ceiling Lamp (philips.light.ceiling) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1814,6 +1918,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Xiaomi Philips LED Ceiling Lamp (philips.light.zyceiling) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1827,6 +1932,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Xiaomi Philips Bulb (philips.light.bulb) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1842,6 +1948,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp (philips.light.candle) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1855,6 +1962,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Xiaomi Philips Downlight (philips.light.downlight) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1870,6 +1978,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Xiaomi Philips ZhiRui bedside lamp (philips.light.moonlight) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1885,6 +1994,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Xiaomi PHILIPS Zhirui Smart LED Bulb E14 Candle Lamp White Crystal (philips.light.candle2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1898,6 +2008,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### philips.light.mono1 (philips.light.mono1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1913,6 +2024,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### philips.light.virtual (philips.light.virtual) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1928,6 +2040,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### philips.light.zysread (philips.light.zysread) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1943,6 +2056,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### philips.light.zystrip (philips.light.zystrip) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1958,6 +2072,7 @@ Switch toggle "Toggle" (G_light) {channel="miio:basic:light:toggle"} ``` ### Mi Power-plug (chuangmi.plug.m1) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1967,6 +2082,7 @@ Number temperature "Temperature" (G_plug) {channel="miio:basic:plug:temperature" ``` ### Mi Power-plug v1 (chuangmi.plug.v1) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1976,6 +2092,7 @@ Switch usb "USB" (G_plug) {channel="miio:basic:plug:usb"} ``` ### Mi Power-plug v2 (chuangmi.plug.v2) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1985,6 +2102,7 @@ Switch usb "USB" (G_plug) {channel="miio:basic:plug:usb"} ``` ### Mi Power-plug v3 (chuangmi.plug.v3) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -1992,10 +2110,11 @@ Group G_plug "Mi Power-plug v3" <status> Switch power "Power" (G_plug) {channel="miio:basic:plug:power"} Switch usb "USB" (G_plug) {channel="miio:basic:plug:usb"} Number temperature "Temperature" (G_plug) {channel="miio:basic:plug:temperature"} -Switch led "Wifi led" (G_plug) {channel="miio:basic:plug:led"} +Switch led "Wifi LED" (G_plug) {channel="miio:basic:plug:led"} ``` ### Mi Power-plug (chuangmi.plug.m3) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2005,6 +2124,7 @@ Number temperature "Temperature" (G_plug) {channel="miio:basic:plug:temperature" ``` ### Mi Smart Plug (chuangmi.plug.hmi205) item file lines + note: Autogenerated example. Replace the id (plug) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2014,32 +2134,35 @@ Number temperature "Temperature" (G_plug) {channel="miio:basic:plug:temperature" ``` ### Qing Mi Smart Power Strip v1 (qmi.powerstrip.v1) item file lines + note: Autogenerated example. Replace the id (powerstrip) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java Group G_powerstrip "Qing Mi Smart Power Strip v1" <status> Switch power "Power" (G_powerstrip) {channel="miio:basic:powerstrip:power"} Number powerUsage "Power Consumption" (G_powerstrip) {channel="miio:basic:powerstrip:powerUsage"} -Switch led "wifi_led" (G_powerstrip) {channel="miio:basic:powerstrip:led"} +Switch led "wifi LED" (G_powerstrip) {channel="miio:basic:powerstrip:led"} Number power_price "power_price" (G_powerstrip) {channel="miio:basic:powerstrip:power_price"} Number current "Current" (G_powerstrip) {channel="miio:basic:powerstrip:current"} Number temperature "Temperature" (G_powerstrip) {channel="miio:basic:powerstrip:temperature"} ``` ### Mi Power-strip v2 (zimi.powerstrip.v2) item file lines + note: Autogenerated example. Replace the id (powerstrip) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java Group G_powerstrip "Mi Power-strip v2" <status> Switch power "Power" (G_powerstrip) {channel="miio:basic:powerstrip:power"} Number powerUsage "Power Consumption" (G_powerstrip) {channel="miio:basic:powerstrip:powerUsage"} -Switch led "wifi_led" (G_powerstrip) {channel="miio:basic:powerstrip:led"} +Switch led "wifi LED" (G_powerstrip) {channel="miio:basic:powerstrip:led"} Number power_price "power_price" (G_powerstrip) {channel="miio:basic:powerstrip:power_price"} Number current "Current" (G_powerstrip) {channel="miio:basic:powerstrip:current"} Number temperature "Temperature" (G_powerstrip) {channel="miio:basic:powerstrip:temperature"} ``` ### Mi Water Purifier v2 (yunmi.waterpuri.v2) item file lines + note: Autogenerated example. Replace the id (waterpuri) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2048,6 +2171,7 @@ Switch power "Power" (G_waterpuri) {channel="miio:basic:waterpuri:power"} ``` ### Mi Water Purifier lx2 (yunmi.waterpuri.lx2) item file lines + note: Autogenerated example. Replace the id (waterpuri) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2056,6 +2180,7 @@ Switch power "Power" (G_waterpuri) {channel="miio:basic:waterpuri:power"} ``` ### Mi Water Purifier lx3 (yunmi.waterpuri.lx3) item file lines + note: Autogenerated example. Replace the id (waterpuri) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2064,6 +2189,7 @@ Switch power "Power" (G_waterpuri) {channel="miio:basic:waterpuri:power"} ``` ### Mi Water Purifier lx4 (yunmi.waterpuri.lx4) item file lines + note: Autogenerated example. Replace the id (waterpuri) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2072,6 +2198,7 @@ Switch power "Power" (G_waterpuri) {channel="miio:basic:waterpuri:power"} ``` ### Mi Water Purifier v2 (yunmi.waterpurifier.v2) item file lines + note: Autogenerated example. Replace the id (waterpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2080,6 +2207,7 @@ Switch power "Power" (G_waterpurifier) {channel="miio:basic:waterpurifier:power" ``` ### Mi Water Purifier v3 (yunmi.waterpurifier.v3) item file lines + note: Autogenerated example. Replace the id (waterpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2088,6 +2216,7 @@ Switch power "Power" (G_waterpurifier) {channel="miio:basic:waterpurifier:power" ``` ### Mi Water Purifier v4 (yunmi.waterpurifier.v4) item file lines + note: Autogenerated example. Replace the id (waterpurifier) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2096,6 +2225,7 @@ Switch power "Power" (G_waterpurifier) {channel="miio:basic:waterpurifier:power" ``` ### Yeelight Lamp (yeelink.light.bslamp1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2111,6 +2241,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Lamp (yeelink.light.bslamp2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2126,6 +2257,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight LED Ceiling Lamp (yeelink.light.ceiling1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2141,6 +2273,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v2 (yeelink.light.ceiling2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2156,6 +2289,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v3 (yeelink.light.ceiling3) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2171,6 +2305,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v4 (JIAOYUE 650 RGB) (yeelink.light.ceiling4) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2191,6 +2326,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v4 (yeelink.light.ceiling4.ambi) item file lines + note: Autogenerated example. Replace the id (ceiling4) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2211,6 +2347,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_ceiling4) {channel="miio: ``` ### Yeelight LED Ceiling Lamp v5 (yeelink.light.ceiling5) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2226,6 +2363,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v6 (yeelink.light.ceiling6) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2241,6 +2379,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v7 (yeelink.light.ceiling7) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2256,6 +2395,7 @@ Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:bas ``` ### Yeelight LED Ceiling Lamp v8 (yeelink.light.ceiling8) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2270,7 +2410,29 @@ String customScene "Set Scene" (G_light) {channel="miio:basic:light:customScene" Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:basic:light:nightlightBrightness"} ``` +### Yeelight LED Meteorite lamp (yeelink.light.ceiling10) item file lines + +note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. + +```java +Group G_light "Yeelight LED Meteorite lamp" <status> +Switch power "Power" (G_light) {channel="miio:basic:light:power"} +Number brightness "Brightness" (G_light) {channel="miio:basic:light:brightness"} +Number ambientBrightness "Ambient Brightness" (G_light) {channel="miio:basic:light:ambientBrightness"} +Number delayoff "Shutdowm Timer" (G_light) {channel="miio:basic:light:delayoff"} +Number colorTemperature "Color Temperature" (G_light) {channel="miio:basic:light:colorTemperature"} +Number colorMode "Color Mode" (G_light) {channel="miio:basic:light:colorMode"} +String name "Name" (G_light) {channel="miio:basic:light:name"} +Switch ambientPower "Ambient Power" (G_light) {channel="miio:basic:light:ambientPower"} +Color ambientColor "Ambient Color" (G_light) {channel="miio:basic:light:ambientColor"} +Number ambientColorTemperature "Ambient Color Temperature" (G_light) {channel="miio:basic:light:ambientColorTemperature"} +String customScene "Set Scene" (G_light) {channel="miio:basic:light:customScene"} +Number ambientColorMode "Ambient Color Mode" (G_light) {channel="miio:basic:light:ambientColorMode"} +Number nightlightBrightness "Nightlight Brightness" (G_light) {channel="miio:basic:light:nightlightBrightness"} +``` + ### Yeelight ct2 (yeelink.light.ct2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2284,6 +2446,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight White Bulb (yeelink.light.mono1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2297,6 +2460,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight White Bulb v2 (yeelink.light.mono2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2310,6 +2474,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight (yeelink.light.lamp1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2323,6 +2488,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight (yeelink.light.lamp2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2336,6 +2502,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight (yeelink.light.lamp3) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2349,6 +2516,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Strip (yeelink.light.strip1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2364,6 +2532,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Strip (yeelink.light.strip2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2379,6 +2548,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight (yeelink.light.virtual) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2392,6 +2562,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Color Bulb (yeelink.light.color1) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2407,6 +2578,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Color Bulb YLDP06YL 10W (yeelink.light.color2) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2422,6 +2594,7 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` ### Yeelight Color Bulb (yeelink.light.color3) item file lines + note: Autogenerated example. Replace the id (light) in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered. ```java @@ -2437,4 +2610,3 @@ String name "Name" (G_light) {channel="miio:basic:light:name"} ``` - diff --git a/bundles/org.openhab.binding.miio/pom.xml b/bundles/org.openhab.binding.miio/pom.xml index 7b98f9aa204a2..c8456f1317d2a 100644 --- a/bundles/org.openhab.binding.miio/pom.xml +++ b/bundles/org.openhab.binding.miio/pom.xml @@ -1,10 +1,9 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.miio</artifactId> <name>openHAB Add-ons :: Bundles :: Xiaomi Mi IO Binding</name> diff --git a/bundles/org.openhab.binding.miio/src/main/feature/feature.xml b/bundles/org.openhab.binding.miio/src/main/feature/feature.xml index dd30d68aa52d8..b68528bbb0050 100644 --- a/bundles/org.openhab.binding.miio/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.miio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.miio-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-miio" description="Xiaomi Mi IO Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Message.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Message.java index e15c82795627d..bb75f25745324 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Message.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConfiguration.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConfiguration.java index 5b468f31d1da7..787e9c4f6305b 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConfiguration.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConstants.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConstants.java index bc43d0036a46f..c2ea1bcff75b5 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConstants.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -48,10 +48,12 @@ public final class MiIoBindingConstants { public static final String CHANNEL_CLEAN_TIME = "status#clean_time"; public static final String CHANNEL_DND_ENABLED = "status#dnd_enabled"; public static final String CHANNEL_ERROR_CODE = "status#error_code"; + public static final String CHANNEL_ERROR_ID = "status#error_id"; public static final String CHANNEL_FAN_POWER = "status#fan_power"; public static final String CHANNEL_IN_CLEANING = "status#in_cleaning"; public static final String CHANNEL_MAP_PRESENT = "status#map_present"; public static final String CHANNEL_STATE = "status#state"; + public static final String CHANNEL_STATE_ID = "status#state_id"; public static final String CHANNEL_CONTROL = "actions#control"; public static final String CHANNEL_COMMAND = "actions#commands"; diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCommand.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCommand.java index d1a03e327a081..3c321fd014ac3 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCommand.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCrypto.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCrypto.java index 60a68ab3efc4d..fd1f50daaedb7 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCrypto.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCrypto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCryptoException.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCryptoException.java index 9e4e2e2dd959c..4303a0e030ad3 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCryptoException.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoCryptoException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java index 5d092fa0c5296..519beced685bc 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoDevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,6 +31,7 @@ public enum MiIoDevices { AIRMONITOR_B1("cgllc.airmonitor.b1", "Mi Air Quality Monitor 2gen", THING_TYPE_BASIC), AIR_HUMIDIFIER_V1("zhimi.humidifier.v1", "Mi Air Humidifier", THING_TYPE_BASIC), AIR_HUMIDIFIER_CA1("zhimi.humidifier.ca1", "Mi Air Humidifier", THING_TYPE_BASIC), + AIR_HUMIDIFIER_MJJSQ("deerma.humidifier.mjjsq", "Mija Smart humidifier", THING_TYPE_BASIC), AIR_PURIFIER1("zhimi.airpurifier.v1", "Mi Air Purifier v1", THING_TYPE_BASIC), AIR_PURIFIER2("zhimi.airpurifier.v2", "Mi Air Purifier v2", THING_TYPE_BASIC), AIR_PURIFIER3("zhimi.airpurifier.v3", "Mi Air Purifier v3", THING_TYPE_BASIC), @@ -41,13 +42,19 @@ public enum MiIoDevices { AIR_PURIFIERM2("zhimi.airpurifier.m2", "Mi Air Purifier (mini)", THING_TYPE_BASIC), AIR_PURIFIERMA1("zhimi.airpurifier.ma1", "Mi Air Purifier MS1", THING_TYPE_BASIC), AIR_PURIFIERMA2("zhimi.airpurifier.ma2", "Mi Air Purifier MS2", THING_TYPE_BASIC), + AIR_PURIFIERMA4("zhimi.airpurifier.ma4", "Mi Air Purifier 3", THING_TYPE_BASIC), AIR_PURIFIERSA1("zhimi.airpurifier.sa1", "Mi Air Purifier Super", THING_TYPE_BASIC), AIR_PURIFIERSA2("zhimi.airpurifier.sa2", "Mi Air Purifier Super 2", THING_TYPE_BASIC), + AIRPURIFIER_T2017("dmaker.airfresh.t2017", "Mi Fresh Air Ventilator", THING_TYPE_UNSUPPORTED), + ALARM_CLOCK_MYK01("zimi.clock.myk01", "Xiao AI Smart Alarm Clock", THING_TYPE_UNSUPPORTED), + BATHHEATER_V2("yeelight.bhf_light.v2", "Yeelight Smart Bath Heater", THING_TYPE_UNSUPPORTED), + DEHUMIDIFIER_FW1("nwt.derh.wdh318efw1", "XIAOMI MIJIA WIDETECH WDH318EFW1 Dehumidifier", THING_TYPE_UNSUPPORTED), ZHIMI_AIRPURIFIER_MB1("zhimi.airpurifier.mb1", "Mi Air Purifier mb1", THING_TYPE_BASIC), - ZHIMI_AIRPURIFIER_MC1("zhimi.airpurifier.mc1", "Mi Air Purifier mc1", THING_TYPE_BASIC), + ZHIMI_AIRPURIFIER_MC1("zhimi.airpurifier.mc1", "Mi Air Purifier 2S", THING_TYPE_BASIC), ZHIMI_AIRPURIFIER_VIRTUAL("zhimi.airpurifier.virtual", "Mi Air Purifier virtual", THING_TYPE_UNSUPPORTED), ZHIMI_AIRPURIFIER_VTL_M1("zhimi.airpurifier.vtl_m1", "Mi Air Purifier vtl m1", THING_TYPE_UNSUPPORTED), CHUANGMI_IR2("chuangmi.ir.v2", "Mi Remote v2", THING_TYPE_UNSUPPORTED), + CHUANGMI_V2("chuangmi.remote.v2", "Xiaomi IR Remote", THING_TYPE_UNSUPPORTED), COOKER1("chunmi.cooker.normal1", "MiJia Rice Cooker", THING_TYPE_UNSUPPORTED), COOKER2("chunmi.cooker.normal2", "MiJia Rice Cooker", THING_TYPE_UNSUPPORTED), COOKER3("hunmi.cooker.normal3", "MiJia Rice Cooker", THING_TYPE_UNSUPPORTED), @@ -59,6 +66,7 @@ public enum MiIoDevices { FAN3("zhimi.fan.v3", "Mi Smart Pedestal Fan", THING_TYPE_BASIC), FAN_SA1("zhimi.fan.sa1", "Xiaomi Mi Smart Pedestal Fan", THING_TYPE_BASIC), FAN_ZA1("zhimi.fan.za1", "Xiaomi Mi Smart Pedestal Fan", THING_TYPE_BASIC), + FRIDGE_V3("viomi.fridge.v3", "Viomi Internet refrigerator iLive", THING_TYPE_UNSUPPORTED), GATEWAY1("lumi.gateway.v1", "Mi Smart Home Gateway v1", THING_TYPE_UNSUPPORTED), GATEWAY2("lumi.gateway.v2", "Mi Smart Home Gateway v2", THING_TYPE_UNSUPPORTED), GATEWAY3("lumi.gateway.v3", "Mi Smart Home Gateway v3", THING_TYPE_UNSUPPORTED), @@ -88,9 +96,15 @@ public enum MiIoDevices { POWERSTRIP2("zimi.powerstrip.v2", "Mi Power-strip v2", THING_TYPE_BASIC), TOOTHBRUSH("soocare.toothbrush.x3", "Mi Toothbrush", THING_TYPE_UNSUPPORTED), VACUUM("rockrobo.vacuum.v1", "Mi Robot Vacuum", THING_TYPE_VACUUM), + VACUUM_C1("roborock.vacuum.c1", "Mi Xiaowa Vacuum c1", THING_TYPE_VACUUM), VACUUM2("roborock.vacuum.s5", "Mi Robot Vacuum v2", THING_TYPE_VACUUM), + VACUUM1S("roborock.vacuum.m1s", "Mi Robot Vacuum 1S", THING_TYPE_VACUUM), VACUUMS6("roborock.vacuum.s6", "Roborock Vacuum S6", THING_TYPE_VACUUM), + VACUUMS5MAX("roborock.vacuum.s5e", "Roborock Vacuum S5 Max", THING_TYPE_VACUUM), + VACUUMSS6("rockrobo.vacuum.s6", "Roborock Vacuum S6", THING_TYPE_VACUUM), VACUUME2("roborock.vacuum.e2", "Rockrobo Xiaowa Vacuum v2", THING_TYPE_UNSUPPORTED), + VACUUME_V6("viomi.vacuum.v6", "Xiaomi Mijia vacuum V-RVCLM21B", THING_TYPE_UNSUPPORTED), + VACUUME_V7("viomi.vacuum.v7", "Xiaomi Mijia vacuum STYJ02YM", THING_TYPE_UNSUPPORTED), ROBOROCK_VACUUM_C1("roborock.vacuum.c1", "roborock.vacuum.c1", THING_TYPE_UNSUPPORTED), SWEEPER2("roborock.sweeper.e2v2", "Rockrobo Xiaowa Sweeper v2", THING_TYPE_UNSUPPORTED), SWEEPER3("roborock.sweeper.e2v3", "Rockrobo Xiaowa Sweeper v3", THING_TYPE_UNSUPPORTED), @@ -114,6 +128,7 @@ public enum MiIoDevices { YEELIGHT_CEIL6("yeelink.light.ceiling6", "Yeelight LED Ceiling Lamp v6", THING_TYPE_BASIC), YEELIGHT_CEIL7("yeelink.light.ceiling7", "Yeelight LED Ceiling Lamp v7", THING_TYPE_BASIC), YEELIGHT_CEIL8("yeelink.light.ceiling8", "Yeelight LED Ceiling Lamp v8", THING_TYPE_BASIC), + YEELIGHT_CEIL10("yeelink.light.ceiling10", "Yeelight LED Meteorite lamp", THING_TYPE_BASIC), YEELIGHT_CT2("yeelink.light.ct2", "Yeelight ct2", THING_TYPE_BASIC), YEELIGHT_DOLPHIN("yeelink.light.mono1", "Yeelight White Bulb", THING_TYPE_BASIC), YEELIGHT_DOLPHIN2("yeelink.light.mono2", "Yeelight White Bulb v2", THING_TYPE_BASIC), diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoHandlerFactory.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoHandlerFactory.java index ac74b2669f773..f71c2651cbb30 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoHandlerFactory.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoMessageListener.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoMessageListener.java index e7416f9d1a4a7..b715c8636e89f 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoMessageListener.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoSendCommand.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoSendCommand.java index 3d436067da46b..75bc30cbaeddb 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoSendCommand.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/MiIoSendCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Utils.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Utils.java index 2028324ead907..3fc167992de98 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Utils.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/Utils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/CommandParameterType.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/CommandParameterType.java index 41134999da078..e94b4496a0747 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/CommandParameterType.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/CommandParameterType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/Conversions.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/Conversions.java index 8e905e30cf656..a18b236250609 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/Conversions.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/Conversions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/DeviceMapping.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/DeviceMapping.java index 9248a7f68b1b1..c830ce105c039 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/DeviceMapping.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/DeviceMapping.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicChannel.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicChannel.java index 70df2d2abe427..0cf320af4b837 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicChannel.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicDevice.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicDevice.java index c8aa385ec7fa7..eeaa5d25aca4c 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicDevice.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoBasicDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoDeviceAction.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoDeviceAction.java index 47c82545a4be5..848fee1381483 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoDeviceAction.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/basic/MiIoDeviceAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscovery.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscovery.java index aa73f432705b0..36287ddb1cc8f 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscovery.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscoveryParticipant.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscoveryParticipant.java index 651fe7b3d5662..b0420089844a2 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/discovery/MiIoDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java index 1f74bf4c50707..fa5bcf995a40f 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoAbstractHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java index 1f9a83b984d90..829a20ca9ea11 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoBasicHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoGenericHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoGenericHandler.java index 26e66bbf630a7..316f21571106e 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoGenericHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoGenericHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoUnsupportedHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoUnsupportedHandler.java index 462da6335ad46..7e83d090195cc 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoUnsupportedHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoUnsupportedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoVacuumHandler.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoVacuumHandler.java index b2647be8a3367..c564c5e384816 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoVacuumHandler.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/handler/MiIoVacuumHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -128,19 +128,18 @@ public void handleCommand(ChannelUID channelUID, Command command) { private boolean updateVacuumStatus(JsonObject statusData) { updateState(CHANNEL_BATTERY, new DecimalType(statusData.get("battery").getAsBigDecimal())); updateState(CHANNEL_CLEAN_AREA, new DecimalType(statusData.get("clean_area").getAsDouble() / 1000000.0)); - updateState(CHANNEL_CLEAN_TIME, - new DecimalType(TimeUnit.SECONDS.toMinutes(statusData.get("clean_time").getAsLong()))); + updateState(CHANNEL_CLEAN_TIME, new DecimalType(TimeUnit.SECONDS.toMinutes(statusData.get("clean_time").getAsLong()))); updateState(CHANNEL_DND_ENABLED, new DecimalType(statusData.get("dnd_enabled").getAsBigDecimal())); - updateState(CHANNEL_ERROR_CODE, - new StringType(VacuumErrorType.getType(statusData.get("error_code").getAsInt()).getDescription())); + updateState(CHANNEL_ERROR_CODE, new StringType(VacuumErrorType.getType(statusData.get("error_code").getAsInt()).getDescription())); + updateState(CHANNEL_ERROR_ID, new DecimalType(statusData.get("error_code").getAsInt())); int fanLevel = statusData.get("fan_power").getAsInt(); - FanModeType fanpower = FanModeType.getType(fanLevel); updateState(CHANNEL_FAN_POWER, new DecimalType(fanLevel)); - updateState(CHANNEL_FAN_CONTROL, new DecimalType(fanpower.getId())); + updateState(CHANNEL_FAN_CONTROL, new DecimalType(FanModeType.getType(fanLevel).getId())); updateState(CHANNEL_IN_CLEANING, new DecimalType(statusData.get("in_cleaning").getAsBigDecimal())); updateState(CHANNEL_MAP_PRESENT, new DecimalType(statusData.get("map_present").getAsBigDecimal())); StatusType state = StatusType.getType(statusData.get("state").getAsInt()); updateState(CHANNEL_STATE, new StringType(state.getDescription())); + updateState(CHANNEL_STATE_ID, new DecimalType(statusData.get("state").getAsInt())); State vacuum = OnOffType.OFF; String control; switch (state) { diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/ConsumablesType.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/ConsumablesType.java index 7be249a4f8ae8..81930e0ecba88 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/ConsumablesType.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/ConsumablesType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/FanModeType.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/FanModeType.java index 53d992e41d848..df49a9c027c0f 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/FanModeType.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/FanModeType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/StatusType.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/StatusType.java index df12af708e921..c67ba6517767c 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/StatusType.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/StatusType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,10 +23,10 @@ public enum StatusType { INITIATING(1, "Initiating"), SLEEPING(2, "Sleeping"), IDLE(3, "Idle"), - UNKNOWN4(4, "Remote Control"), + REMOTE(4, "Remote Control"), CLEANING(5, "Cleaning"), RETURNING(6, "Returning Dock"), - UNKNOWN7(7, "Manual Mode"), + MANUAL(7, "Manual Mode"), CHARGING(8, "Charging"), CHARGING_ERROR(9, "Charging Error"), PAUSED(10, "Paused"), @@ -37,6 +37,7 @@ public enum StatusType { DOCKING(15, "Docking"), GOTO(16, "Go To"), ZONE(17, "Zone Clean"), + ROOM(18, "Room Clean"), FULL(100, "Full"); private final int id; diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/VacuumErrorType.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/VacuumErrorType.java index 56c6e7e3b0740..fd81168a19ec2 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/VacuumErrorType.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/robot/VacuumErrorType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,25 +21,31 @@ public enum VacuumErrorType { ERROR00(0, "No error"), - ERROR01(1, "Laser distance sensor error"), - ERROR02(2, "Collision sensor error"), - ERROR03(3, "Wheels on top of void, move robot"), - ERROR04(4, "Clean hovering sensors, move robot"), - ERROR05(5, "Clean main brush"), - ERROR06(6, "Clean side brush"), - ERROR07(7, "Main wheel stuck?"), - ERROR08(8, "Device stuck, clean area"), - ERROR09(9, "Dust collector missing"), - ERROR010(10, "Clean filter"), - ERROR011(11, "Stuck in magnetic barrier"), - ERROR012(12, "Low battery"), - ERROR013(13, "Charging fault"), - ERROR014(14, "Battery fault"), - ERROR015(15, "Wall sensors dirty, wipe them"), - ERROR016(16, "Place me on flat surface"), - ERROR017(17, "Side brushes problem, reboot me"), - ERROR018(18, "Suction fan problem"), - ERROR019(19, "Unpowered charging station"), + ERROR01(1, "Laser sensor fault"), + ERROR02(2, "Collision sensor fault"), + ERROR03(3, "Wheel floating"), + ERROR04(4, "Cliff sensor fault"), + ERROR05(5, "Main brush blocked"), + ERROR06(6, "Side brush blocked"), + ERROR07(7, "Wheel blocked"), + ERROR08(8, "Device stuck"), + ERROR09(9, "Dust bin missing"), + ERROR10(10, "Filter blocked"), + ERROR11(11, "Magnetic field detected"), + ERROR12(12, "Low battery"), + ERROR13(13, "Charging problem"), + ERROR14(14, "Battery failure"), + ERROR15(15, "Wall sensor fault"), + ERROR16(16, "Uneven surface"), + ERROR17(17, "Side brush failure"), + ERROR18(18, "Suction fan failure"), + ERROR19(19, "Unpowered charging station"), + ERROR20(20, "Unknown Error"), + ERROR21(21, "Laser pressure sensor problem"), + ERROR22(22, "Charge sensor problem"), + ERROR23(23, "Dock problem"), + ERROR254(254, "Bin full"), + ERROR255(255, "Internal error"), UNKNOWN(-1, "Unknown Error"); private final int id; diff --git a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/transport/MiIoAsyncCommunication.java b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/transport/MiIoAsyncCommunication.java index a3ba2ffac3024..56c73ea17f31e 100644 --- a/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/transport/MiIoAsyncCommunication.java +++ b/bundles/org.openhab.binding.miio/src/main/java/org/openhab/binding/miio/internal/transport/MiIoAsyncCommunication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/config/config.xml index ea7d1ef861c44..dfaadb22b9900 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/config/config.xml @@ -7,7 +7,7 @@ <config-description uri="thing-type:miio:config"> <parameter name="host" type="text" required="true"> <context>network-address</context> - <label>IP address</label> + <label>IP Address</label> </parameter> <parameter name="token" type="text" pattern="^([A-Fa-f0-9]{96}|[A-Fa-f0-9]{32}|.{16})$" required="true"> <label>Token</label> @@ -24,7 +24,7 @@ <advanced>true</advanced> </parameter> <parameter name="refreshInterval" type="integer" min="0" max="9999" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for refreshing the data in seconds. (0=disabled)</description> <default>30</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/commonChannels.xml b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/commonChannels.xml index 3879e42885c4e..99abd824b6282 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/commonChannels.xml +++ b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/commonChannels.xml @@ -85,7 +85,7 @@ </channel-type> <channel-type id="led"> <item-type>Switch</item-type> - <label>Led</label> + <label>LED</label> </channel-type> <channel-type id="colorMode"> <item-type>Number</item-type> @@ -121,7 +121,7 @@ </channel-type> <channel-type id="delayoff"> <item-type>Number</item-type> - <label>Delay off</label> + <label>Delay Off</label> </channel-type> <channel-type id="act_det"> <item-type>Switch</item-type> diff --git a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml index f7b13a2165e5d..b4499eee2d2fc 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml +++ b/bundles/org.openhab.binding.miio/src/main/resources/ESH-INF/thing/vacuumThing.xml @@ -41,11 +41,13 @@ <channel id="clean_area" typeId="clean_area" /> <channel id="clean_time" typeId="clean_time" /> <channel id="error_code" typeId="error_code" /> + <channel id="error_id" typeId="error_id" /> <channel id="fan_power" typeId="fan_power" /> <channel id="in_cleaning" typeId="in_cleaning" /> <channel id="dnd_enabled" typeId="dnd_enabled" /> <channel id="map_present" typeId="map_present" /> <channel id="state" typeId="state" /> + <channel id="state_id" typeId="state_id" /> </channels> </channel-group-type> <channel-group-type id="consumables"> @@ -63,7 +65,7 @@ </channels> </channel-group-type> <channel-group-type id="dnd"> - <label>Do not Disturb</label> + <label>Do Not Disturb</label> <channels> <channel id="dnd_function" typeId="dnd_function" /> <channel id="dnd_start" typeId="dnd_start" /> @@ -104,11 +106,16 @@ </channel-type> <channel-type id="dnd_enabled"> <item-type>Switch</item-type> - <label>Do not Disturb</label> + <label>Do Not Disturb</label> </channel-type> <channel-type id="error_code"> <item-type>String</item-type> - <label>Error</label> + <label>Error Code</label> + <state readOnly="true" /> + </channel-type> + <channel-type id="error_id"> + <item-type>Number</item-type> + <label>Error ID</label> <state readOnly="true" /> </channel-type> <channel-type id="fan_power"> @@ -118,23 +125,28 @@ </channel-type> <channel-type id="in_cleaning" advanced="true"> <item-type>Number</item-type> - <label>in_cleaning</label> + <label>In Cleaning</label> <state pattern="%.0f" readOnly="true" /> </channel-type> <channel-type id="map_present" advanced="true"> <item-type>Number</item-type> - <label>map_present</label> + <label>Map Present</label> <category>Energy</category> <state pattern="%.0f" readOnly="true" /> </channel-type> <channel-type id="msg_seq" advanced="true"> <item-type>Number</item-type> - <label>msg_seq</label> + <label>Msg Seq</label> <state readOnly="true" /> </channel-type> <channel-type id="state"> <item-type>String</item-type> - <label>state</label> + <label>State</label> + <state readOnly="true" /> + </channel-type> + <channel-type id="state_id"> + <item-type>Number</item-type> + <label>State ID</label> <state readOnly="true" /> </channel-type> @@ -161,22 +173,22 @@ </channel-type> <channel-type id="main_brush_time" advanced="true"> <item-type>Number</item-type> - <label>Main Brush hours till replacement</label> + <label>Main Brush Hours till Replacement</label> <state pattern="%.0fh" readOnly="true" /> </channel-type> <channel-type id="side_brush_time" advanced="true"> <item-type>Number</item-type> - <label>Side Brush hours till replacement</label> + <label>Side Brush Hours till Replacement</label> <state pattern="%.0fh" readOnly="true" /> </channel-type> <channel-type id="filter_time" advanced="true"> <item-type>Number</item-type> - <label>Filter hours till replacement</label> + <label>Filter Hours till Replacement</label> <state pattern="%.0fh" readOnly="true" /> </channel-type> <channel-type id="sensor_dirt_time" advanced="true"> <item-type>Number</item-type> - <label>Sensor Dirt Time till cleaning</label> + <label>Sensor Dirt Time till Cleaning</label> <state pattern="%.0fh" readOnly="true" /> </channel-type> @@ -233,7 +245,7 @@ <!-- DND Setting --> <channel-type id="dnd_function"> <item-type>Switch</item-type> - <label>Do Not Disturb functionality</label> + <label>Do Not Disturb Functionality</label> </channel-type> <channel-type id="dnd_start"> <item-type>String</item-type> @@ -294,7 +306,7 @@ <state pattern="%.0f" readOnly="true" /> </channel-type> <channel-type id="last_clean_finish"> - <item-type>Boolean</item-type> + <item-type>Number</item-type> <label>Cleaning Finished</label> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json index e16c7e0af9034..3a83fce4a0cff 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json @@ -28,6 +28,20 @@ "refresh": true, "ChannelGroup": "", "actions": [] + }, + { + "property": "wifi_led", + "friendlyName": "Indicator light", + "channel": "led", + "type": "Switch", + "refresh": true, + "ChannelGroup": "", + "actions": [ + { + "command": "set_wifi_led", + "parameterType": "ONOFF" + } + ] } ] } diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json index a04f848c9aeaf..2ebe4a333fa44 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json @@ -43,7 +43,7 @@ }, { "property": "wifi_led", - "friendlyName": "Wifi led", + "friendlyName": "Wifi LED", "channel": "led", "type": "Switch", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling.json b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling.json index 705eb5e93cc35..91fd49c22161d 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling.json @@ -116,4 +116,4 @@ } ] } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling2.json b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling2.json index 847ece955d87f..def9388e670c4 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling2.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling2.json @@ -111,4 +111,4 @@ } ] } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling4.json b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling4.json index 96673e29f3912..98f323ffdb35e 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling4.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/yeelink.light.ceiling4.json @@ -2,6 +2,7 @@ "deviceMapping": { "id": [ "yeelink.light.ceiling4", + "yeelink.light.ceiling10", "yeelink.light.ceiling4.ambi" ], "channels": [ diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json index 5f02800727f34..2ae53f58ae733 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json @@ -8,6 +8,7 @@ "zhimi.airpurifier.v3", "zhimi.airpurifier.v5", "zhimi.airpurifier.ma1", + "zhimi.airpurifier.ma4", "zhimi.airpurifier.sa1", "zhimi.airpurifier.sa2", "zhimi.airpurifier.mb1", @@ -71,7 +72,7 @@ }, { "property": "led", - "friendlyName": "Led Status", + "friendlyName": "LED Status", "channel": "led", "type": "Switch", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v1.json index b52feb3ed30db..821bfa3bf52b9 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v1.json @@ -66,7 +66,7 @@ }, { "property": "led", - "friendlyName": "Led Status", + "friendlyName": "LED Status", "channel": "led", "type": "Switch", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json index 87d05f1d8cc25..5e6d3c89f964f 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json @@ -63,7 +63,7 @@ }, { "property": "led", - "friendlyName": "Led Status", + "friendlyName": "LED Status", "channel": "led", "type": "Switch", "refresh": true, @@ -77,7 +77,7 @@ }, { "property": "bright", - "friendlyName": "Led Brightness", + "friendlyName": "LED Brightness", "channel": "bright", "type": "Number", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.sa1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.sa1.json index 0a27f72efdf08..6af4384c2fb3d 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.sa1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.sa1.json @@ -87,7 +87,7 @@ }, { "property": "led_b", - "friendlyName": "Led", + "friendlyName": "LED", "channel": "led_b", "type": "Number", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.v3.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.v3.json index 48666439500bd..253446a51aa3d 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.v3.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.fan.v3.json @@ -88,7 +88,7 @@ }, { "property": "led_b", - "friendlyName": "Led", + "friendlyName": "LED", "channel": "led_b", "type": "Number", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json index a66a78f088c1d..165fb462c6889 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json @@ -76,7 +76,7 @@ }, { "property": "led_b", - "friendlyName": "Led Brightness", + "friendlyName": "LED Brightness", "channel": "bright", "type": "Number", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json index 664d5b236cfa9..758f92f8aa9ee 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json @@ -34,7 +34,7 @@ }, { "property": "wifi_led", - "friendlyName": "wifi_led", + "friendlyName": "wifi LED", "channel": "led", "type": "Switch", "refresh": true, diff --git a/bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java b/bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java new file mode 100644 index 0000000000000..82dc82cdd762e --- /dev/null +++ b/bundles/org.openhab.binding.miio/src/test/java/org/openhab/binding/miio/internal/ReadmeHelper.java @@ -0,0 +1,222 @@ +/** + * 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.miio.internal; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.junit.Ignore; +import org.openhab.binding.miio.internal.basic.MiIoBasicChannel; +import org.openhab.binding.miio.internal.basic.MiIoBasicDevice; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +/** + * Support creation of the miio readme doc + * + * Run after adding devices or changing database entries of basic devices + * + * Run in IDE with 'run as java application' + * or run in command line as: + * mvn exec:java -Dexec.mainClass="org.openhab.binding.miio.internal.ReadmeHelper" -Dexec.classpathScope="test" + * + * @author Marcel Verpaalen - Initial contribution + */ +@NonNullByDefault +public class ReadmeHelper { + private static final Logger LOGGER = LoggerFactory.getLogger(ReadmeHelper.class); + private static final String BASEFILE = "./README.base.md"; + + @Ignore + public static void main(String[] args) { + ReadmeHelper rm = new ReadmeHelper(); + LOGGER.info("## Creating device list"); + StringWriter deviceList = rm.deviceList(); + rm.checkDatabaseEntrys(); + LOGGER.info("## Creating channel list for basic devices"); + StringWriter channelList = rm.channelList(); + LOGGER.info("## Creating Item Files for miio:basic devices"); + StringWriter itemFileExamples = rm.itemFileExamples(); + LOGGER.info("## Done"); + try { + File file = new File(BASEFILE); + String baseDoc = FileUtils.readFileToString(file, "UTF-8"); + String nw = baseDoc.replaceAll("!!!devices", deviceList.toString()) + .replaceAll("!!!channelList", channelList.toString()) + .replaceAll("!!!itemFileExamples", itemFileExamples.toString()); + + File newDocfile = new File("README.md"); + FileUtils.writeStringToFile(newDocfile, nw, "UTF-8"); + } catch (IOException e) { + LOGGER.warn("IO exception", e); + } + } + + private StringWriter deviceList() { + StringWriter sw = new StringWriter(); + + sw.write( + "| Device | ThingType | Device Model | Supported | Remark |\r\n"); + sw.write( + "|------------------------------|------------------|------------------------|-----------|------------|\r\n"); + + Arrays.asList(MiIoDevices.values()).forEach(device -> { + if (!device.getModel().equals("unknown")) { + String link = device.getModel().replace(".", "-"); + boolean isSupported = device.getThingType().equals(MiIoBindingConstants.THING_TYPE_UNSUPPORTED); + sw.write("| "); + sw.write(minLengthString(device.getDescription(), 28)); + sw.write(" | "); + sw.write(minLengthString(device.getThingType().toString(), 16)); + sw.write(" | "); + String model = isSupported ? device.getModel() : "[" + device.getModel() + "](#" + link + ")"; + sw.write(minLengthString(model, 22)); + sw.write(" | "); + sw.write(isSupported ? "No " : "Yes "); + sw.write(" | |\r\n"); + } + }); + return sw; + } + + private StringWriter channelList() { + StringWriter sw = new StringWriter(); + + Arrays.asList(MiIoDevices.values()).forEach(device -> { + if (device.getThingType().equals(MiIoBindingConstants.THING_TYPE_BASIC)) { + MiIoBasicDevice dev = findDatabaseEntry(device.getModel()); + if (dev != null) { + String link = device.getModel().replace(".", "-"); + sw.write("### " + device.getDescription() + " (" + "<a name=\"" + link + "\">" + device.getModel() + + "</a>" + ") Channels\r\n" + "\r\n"); + sw.write("| Channel | Type | Description |\r\n"); + sw.write("|------------------|---------|-------------------------------------|\r\n"); + + for (MiIoBasicChannel ch : dev.getDevice().getChannels()) { + sw.write("| " + minLengthString(ch.getChannel(), 16) + " | " + minLengthString(ch.getType(), 7) + + " | " + minLengthString(ch.getFriendlyName(), 35) + " |\r\n"); + } + sw.write("\r\n"); + + } else { + LOGGER.info("Pls check: Device not found in db: {}", device); + } + } + }); + return sw; + } + + private StringWriter itemFileExamples() { + StringWriter sw = new StringWriter(); + Arrays.asList(MiIoDevices.values()).forEach(device -> { + if (device.getThingType().equals(MiIoBindingConstants.THING_TYPE_BASIC)) { + MiIoBasicDevice dev = findDatabaseEntry(device.getModel()); + if (dev != null) { + sw.write("### " + device.getDescription() + " (" + device.getModel() + ") item file lines\r\n\r\n"); + String[] ids = device.getModel().split("\\."); + String id = ids[ids.length - 2]; + String gr = "G_" + id; + sw.write("note: Autogenerated example. Replace the id (" + id + + ") in the channel with your own. Replace `basic` with `generic` in the thing UID depending on how your thing was discovered.\r\n"); + sw.write("\r\n```java\r\n"); + sw.write("Group " + gr + " \"" + device.getDescription() + "\" <status>\r\n"); + + for (MiIoBasicChannel ch : dev.getDevice().getChannels()) { + sw.write(ch.getType() + " " + ch.getChannel() + " \"" + ch.getFriendlyName() + "\" (" + gr + + ") {channel=\"miio:basic:" + id + ":" + ch.getChannel() + "\"}\r\n"); + } + sw.write("```\r\n\r\n"); + } + } + }); + return sw; + } + + private void checkDatabaseEntrys() { + for (MiIoBasicDevice entry : findDatabaseEntrys()) { + for (String id : entry.getDevice().getId()) { + if (!MiIoDevices.getType(id).getThingType().equals(MiIoBindingConstants.THING_TYPE_BASIC)) { + LOGGER.info("id :" + id + " not found"); + } + } + } + } + + @Nullable + private MiIoBasicDevice findDatabaseEntry(String deviceName) { + for (MiIoBasicDevice entry : findDatabaseEntrys()) { + for (String id : entry.getDevice().getId()) { + if (deviceName.equals(id)) { + return entry; + } + } + } + return null; + } + + private List<MiIoBasicDevice> findDatabaseEntrys() { + List<MiIoBasicDevice> arrayList = new ArrayList<MiIoBasicDevice>(); + String path = "./src/main/resources/database/"; + File dir = new File(path); + File[] filesList = dir.listFiles(); + for (File file : filesList) { + if (file.isFile()) { + try { + JsonObject deviceMapping = convertFileToJSON(path + file.getName()); + Gson gson = new GsonBuilder().serializeNulls().create(); + @Nullable + MiIoBasicDevice devdb = gson.fromJson(deviceMapping, MiIoBasicDevice.class); + arrayList.add(devdb); + } catch (Exception e) { + LOGGER.debug("Error while searching in database '{}': {}", file.getName(), e.getMessage()); + LOGGER.info(e.getMessage()); + } + } + } + return arrayList; + } + + private static String minLengthString(String string, int length) { + return String.format("%-" + length + "s", string); + } + + JsonObject convertFileToJSON(String fileName) { + // Read from File to String + JsonObject jsonObject = new JsonObject(); + + try { + JsonParser parser = new JsonParser(); + JsonElement jsonElement = parser.parse(new FileReader(fileName)); + jsonObject = jsonElement.getAsJsonObject(); + } catch (FileNotFoundException e) { + // + } + return jsonObject; + } +} diff --git a/bundles/org.openhab.binding.milight/.gitignore b/bundles/org.openhab.binding.milight/.gitignore deleted file mode 100644 index 9f970225adb6a..0000000000000 --- a/bundles/org.openhab.binding.milight/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ \ No newline at end of file diff --git a/bundles/org.openhab.binding.milight/NOTICE b/bundles/org.openhab.binding.milight/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.milight/NOTICE +++ b/bundles/org.openhab.binding.milight/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.milight/README.md b/bundles/org.openhab.binding.milight/README.md index d6a6e0bb6c935..b7e879388dd46 100644 --- a/bundles/org.openhab.binding.milight/README.md +++ b/bundles/org.openhab.binding.milight/README.md @@ -33,7 +33,7 @@ Read the device manual for more information about how to connect your device to ## Thing Configuration -Besides adding bridges through Paper-UI, you can also add them manually in your Thing +Besides adding bridges through Paper UI, you can also add them manually in your Thing configuration file. iBox and iBox2 have the version 6, older milight bridges have the version 3. The ID is the MAC address of the bridge in hexadecimal digits. @@ -130,7 +130,7 @@ Dimmer Light_LivingroomC {channel="milight:whiteLed:ACCF23A6C0B4:1:ledtemperatur Dimmer RGBW_LivingroomB {channel="milight:rgbwLed:ACCF23A6C0B4:2:ledbrightness"} # Dimmer changing brightness for RGBW bulb in zone 2 Color Light_Party {channel="milight:rgbwLed:ACCF23A6C0B4:1:ledcolor"}# Colorpicker for rgb bulbs -# You have to link the items to the channels of your prefered group e.g. in paperui after you've saved +# You have to link the items to the channels of your prefered group e.g. in Paper UI after you have saved # your items file. # The command types nightMode and whiteMode are stateless and should be configured as pushbuttons as they only support a trigger action: diff --git a/bundles/org.openhab.binding.milight/pom.xml b/bundles/org.openhab.binding.milight/pom.xml index f2335e29c6a3a..498aa13aee122 100644 --- a/bundles/org.openhab.binding.milight/pom.xml +++ b/bundles/org.openhab.binding.milight/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.milight</artifactId> diff --git a/bundles/org.openhab.binding.milight/src/main/feature/feature.xml b/bundles/org.openhab.binding.milight/src/main/feature/feature.xml index 5f56e7912780a..88403aef7212c 100644 --- a/bundles/org.openhab.binding.milight/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.milight/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.milight-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-milight" description="Milight Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightBindingConstants.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightBindingConstants.java index 031991511c737..01594f37d234f 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightBindingConstants.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightHandlerFactory.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightHandlerFactory.java index 3320283d53d6b..4c98e77771eb7 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightHandlerFactory.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightThingState.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightThingState.java index 6bd9e21f41599..2ce3a6ed131a3 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightThingState.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/MilightThingState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/DiscoveryResultListener.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/DiscoveryResultListener.java index b113991f5040c..213eab4428494 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/DiscoveryResultListener.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/DiscoveryResultListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/MilightBridgeDiscovery.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/MilightBridgeDiscovery.java index c9541eeed11ab..b630da2659a05 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/MilightBridgeDiscovery.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/discovery/MilightBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractBridgeHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractBridgeHandler.java index cdcb40ca0bb09..b1049aa11d40a 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractBridgeHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedHandler.java index b682cf52f3c9e..e7f11334550b6 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV3Handler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV3Handler.java index 0f1cdfbe0dec5..1a96eb8efc209 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV3Handler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV3Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV6Handler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV6Handler.java index 120dca25ece3e..6e52bd8ad5638 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV6Handler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/AbstractLedV6Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeHandlerConfig.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeHandlerConfig.java index 9f1ea74dbed34..cafe616b64174 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeHandlerConfig.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeHandlerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV3Handler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV3Handler.java index dfc2b82bd0d4f..4430306e00bc0 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV3Handler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV3Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV6Handler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV6Handler.java index 2a13da6ac7288..5fb155a2e1130 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV6Handler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/BridgeV6Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerConfig.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerConfig.java index e6c67e6e9c4d8..2e81160023a7c 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerConfig.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerInterface.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerInterface.java index 95275c746251b..dc0aaf8ae90cd 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerInterface.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/LedHandlerInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV2RGBHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV2RGBHandler.java index 814e36bc4b797..e1ef253107106 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV2RGBHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV2RGBHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3RGBWHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3RGBWHandler.java index 37846eb24c32b..f6d47d5c30dd2 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3RGBWHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3RGBWHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3WhiteHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3WhiteHandler.java index e42b081785ecc..42eb8645cb140 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3WhiteHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV3WhiteHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBCWWWHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBCWWWHandler.java index 2766534eb1b8c..10a8b97577316 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBCWWWHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBCWWWHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBIBOXHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBIBOXHandler.java index e8f78b4cdc6a8..1466ba6714b82 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBIBOXHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBIBOXHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBWHandler.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBWHandler.java index 975e8ee959917..c848d96b26d63 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBWHandler.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/handler/MilightV6RGBWHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java index bad2ea1bcca38..98cb8b7536bc7 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/ProtocolConstants.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/ProtocolConstants.java index 3c5825abdfdff..5593ef2011dc0 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/ProtocolConstants.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/ProtocolConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueueItem.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueueItem.java index b948b2c694262..941c56b674038 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueueItem.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueueItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java index 395e1101e313e..69ecb17d216fb 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java index 657c0f598b227..e1fbc61cdbe9e 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/TestDiscovery.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/TestDiscovery.java index 5616bd6639f63..6ecde9ef75bf9 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/TestDiscovery.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/TestDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/channels.xml index 89e689fa6f903..5dad668636ab2 100644 --- a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/channels.xml @@ -28,13 +28,13 @@ <channel-type id="ledlink" advanced="true"> <item-type>Switch</item-type> - <label>Link bulb</label> + <label>Link Bulb</label> <description>Sync bulb to this zone within 3 seconds of light bulb socket power on</description> </channel-type> <channel-type id="ledunlink" advanced="true"> <item-type>Switch</item-type> - <label>Unlink bulb</label> + <label>Unlink Bulb</label> <description>Clear bulb from this zone within 3 seconds of light bulb socket power on</description> </channel-type> @@ -71,7 +71,7 @@ <channel-type id="ledtemperature"> <item-type>Dimmer</item-type> - <label>Color temperature</label> + <label>Color Temperature</label> <description>White leds and RGBWW allow to change between a cold and a warm color temperature. White support 16, RGBWW support 64 steps </description> @@ -81,13 +81,13 @@ <channel-type id="animation_speed_relative"> <item-type>Dimmer</item-type> - <label>Animation speed</label> + <label>Animation Speed</label> <description>The speed of some animations can be increased or decreased</description> </channel-type> <channel-type id="animation_mode_relative"> <item-type>Dimmer</item-type> - <label>Animation mode</label> + <label>Animation Mode</label> <description>Switch to the next/previous animation mode of your RGBW or white LED. Bind this to a Next/Previous channel type. </description> @@ -95,7 +95,7 @@ <channel-type id="animation_mode"> <item-type>Number</item-type> - <label>Animation mode</label> + <label>Animation Mode</label> <description>Animation mode of your LED. RGBWW leds support 9 animation modes.</description> <category>Light</category> <state> diff --git a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v2.xml b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v2.xml index 87f0a844b0f7c..a10029f827750 100644 --- a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v2.xml +++ b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v2.xml @@ -8,7 +8,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV3" /> </supported-bridge-type-refs> - <label>Color bulb (old)</label> + <label>Color Bulb (old)</label> <description>The oldest produced color bulb. Without a white channel. No saturation support.</description> <category>Lightbulb</category> diff --git a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v3.xml b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v3.xml index 0b96895a23ea3..a7eea8b72c503 100644 --- a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v3.xml +++ b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v3.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridgeV3"> - <label>Milight Bridge (first edition)</label> + <label>Milight Bridge (first Edition)</label> <description>A Milight/Easybulb bridge. This bridge cannot handle newer light bulbs (2016+) of the aforementioned manufacturers.</description> @@ -16,7 +16,7 @@ <context>network-address</context> </parameter> <parameter name="repeat" type="integer" required="false" min="0" max="5"> - <label>Repeat commands</label> + <label>Repeat Commands</label> <description>Usually the bridge receives all commands albeit UDP is used. But the actual bulbs might be slightly out of bridge radio range and it sometimes helps to send commands multiple times. </description> @@ -24,7 +24,7 @@ <advanced>true</advanced> </parameter> <parameter name="delayTime" type="integer" required="false" min="0" max="400"> - <label>Wait between commands (ms)</label> + <label>Wait Between Commands (ms)</label> <description>Time to wait before sending another command to the bridge. It is safe to have a wait time of 1/10s but usually sufficient to just wait 50ms. If the value is too high, commands queue up. </description> @@ -32,7 +32,7 @@ <advanced>true</advanced> </parameter> <parameter name="port" type="integer" required="false"> - <label>Custom port</label> + <label>Custom Port</label> <description>You can set a custom port that will take precedence over the default port which is selected depending on the bridge version: Version 6 uses 5987, Version 3/4/5 uses 8899. Version 2 uses 50000. </description> @@ -49,7 +49,7 @@ <advanced>true</advanced> </parameter> <parameter name="refreshTime" type="integer" min="5" max="300"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Interval in seconds to check for device presence. The Bridge ID is used to check if the IP is still the right one. </description> @@ -63,7 +63,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV3" /> </supported-bridge-type-refs> - <label>Color bulb (first edition)</label> + <label>Color Bulb (first Edition)</label> <description>RGB bulb with white channel. No saturation control. If the set saturation is below a threshold of 50%, the bulb turns into white mode.</description> <category>Lightbulb</category> @@ -91,7 +91,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV3" /> </supported-bridge-type-refs> - <label>Cold/warm white bulb (first edition)</label> + <label>Cold/warm White Bulb (first Edition)</label> <description>White bulb for the older bridge (up to 2016)</description> <category>Lightbulb</category> diff --git a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v6.xml b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v6.xml index 25a4b6ae98e60..425bc65a5e93d 100644 --- a/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v6.xml +++ b/bundles/org.openhab.binding.milight/src/main/resources/ESH-INF/thing/v6.xml @@ -35,7 +35,7 @@ <default>0</default> </parameter> <parameter name="repeat" type="integer" required="false" min="0" max="5"> - <label>Repeat commands</label> + <label>Repeat Commands</label> <description>Usually the bridge receives all commands albeit UDP is used. But the actual bulbs might be slightly out of bridge radio range and it sometimes helps to send commands multiple times. </description> @@ -43,7 +43,7 @@ <advanced>true</advanced> </parameter> <parameter name="delayTime" type="integer" required="false" min="0" max="400"> - <label>Wait between commands (ms)</label> + <label>Wait Between Commands (ms)</label> <description>Time to wait before sending another command to the bridge. It is safe to have a wait time of 1/10s but usually sufficient to just wait 50ms. If the value is too high, commands queue up. </description> @@ -51,7 +51,7 @@ <advanced>true</advanced> </parameter> <parameter name="port" type="integer" required="false"> - <label>Custom port</label> + <label>Custom Port</label> <description>You can set a custom port that will take precedence over the default port which is selected depending on the bridge version: Version 6 uses 5987, Version 3/4/5 uses 8899. Version 2 uses 50000. </description> @@ -70,7 +70,7 @@ <advanced>true</advanced> </parameter> <parameter name="refreshTime" type="integer" min="100" max="10000" required="true"> - <label>Keep alive interval</label> + <label>Keep Alive Interval</label> <description>Interval in milliseconds to send a keep alive ping. If the value is too high, a session may expire and the bridge and all devices could go offline for a few seconds. </description> @@ -84,7 +84,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV6" /> </supported-bridge-type-refs> - <label>Integrated bulb (iBox)</label> + <label>Integrated Bulb (iBox)</label> <description>Integrated bulb of the ibox bridge with no dedicated white channel and therefore no saturation control </description> <category>Lightbulb</category> @@ -112,7 +112,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV6" /> </supported-bridge-type-refs> - <label>Color bulb with cold white (iBox)</label> + <label>Color Bulb with Cold White (iBox)</label> <description>Color bulb with white channel for the new Milight/Easybulb system.</description> <category>Lightbulb</category> @@ -142,7 +142,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridgeV6" /> </supported-bridge-type-refs> - <label>Color bulb with cold/warm white (iBox)</label> + <label>Color Bulb with Cold/warm White (iBox)</label> <description>Color bulb with warm and cold white support for the new Milight/Easybulb system.</description> <category>Lightbulb</category> diff --git a/bundles/org.openhab.binding.millheat/.classpath b/bundles/org.openhab.binding.millheat/.classpath new file mode 100644 index 0000000000000..a5d95095ccaaf --- /dev/null +++ b/bundles/org.openhab.binding.millheat/.classpath @@ -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> diff --git a/bundles/org.openhab.binding.millheat/.project b/bundles/org.openhab.binding.millheat/.project new file mode 100644 index 0000000000000..af9790d7ace17 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.millheat</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> diff --git a/bundles/org.openhab.binding.millheat/NOTICE b/bundles/org.openhab.binding.millheat/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.millheat/README.md b/bundles/org.openhab.binding.millheat/README.md new file mode 100644 index 0000000000000..739a8d6c862fd --- /dev/null +++ b/bundles/org.openhab.binding.millheat/README.md @@ -0,0 +1,143 @@ +# Millheat Binding + +This binding integrates the Mill Wi-Fi enabled panel heaters. +See https://www.millheat.com/mill-wifi/ + +## Supported Things + +This binding supports all Wi-Fi enabled heaters as well as the Wi-Fi socket. + +* `account` = Mill Heating API - the account bridge +* `heater` = Panel/standalone heater +* `room` = A room defined in the mobile app +* `home` = A home defined in the mobile app + +## Discovery + +The binding will discover homes with rooms and heaters. + +In order to do discovery, add a thing of type Mill Heating API and add username and password. + +## Thing Configuration + +See full example below for how to configure using thing files. + +### Account + +* `username` = email address used in app +* `password` = password used in app +* `refreshInterval` = number of seconds between refresh calls to the server + +### Home + +* `homeId` = id of home, type number (not string). Use auto discovery to find this value + +### Room + +* `roomId` = id of room, type number (not string). Use auto discovery to find this value + +### Heater + +* `macAddress` = network mac address of device. +Can be found in the app by viewing devices. +Or you can find it during discovery. +Used for heaters connected to a room. +* `heaterId` = id of device/heater, type number (not string) +Use auto discovery to find this value. +Used to identify independent heaters or heaters connected to a room. +* `power` = number of watts this heater is consuming when active. +Used to provide data for the currentPower channel. + +Either `macAddres` or `heaterId` must be specified. + +## Channels + +### Home channels + +| Channel | Read/write | Item type | Description | +| ------------------- | ------------- | ------------------- | ----------- | +| vacationMode | R/W | Switch | Vacation mode active. Note: In order to activate vacation mode, both vacationModeStart and vacationModeEnd must be set to valid values | +| vacationModeAdvanced | R/W | Switch | Vacation mode advanced active. Can only be activated after vacation mode is active | +| vacationModeTargetTemperature | R/W | Number:Temperature | Temperature to use when activating vacation mode. Note: If advanced vacation mode is set, this temperature is ignored and the away temperature for each room is used instead | +| vacationModeStart | R/W | DateTime | Vacation mode start | +| vacationModeEnd | R/W | DateTime | Vacation mode end | + +### Room channels + +| Channel | Read/write | Item type | Description | +| ------------------- | ------------- | --------------------- | ----------- | +| currentTemperature | R | Number:Temperature | Measured temperature in your room (if more than one heater then it is the average of all heaters) | +| currentMode | R | String | Current mode (comfort, away, sleep etc) being active | +| targetTemperature | R | Number:Temperature | Current target temperature for this room (managed by the room program and set by comfort- away- and sleepTemperature) | +| comfortTemperature | R/W | Number:Temperature | Comfort mode temperature | +| awayTemperature | R/W | Number:Temperature | Away mode temperature | +| sleepTemperature | R/W | Number:Temperature | Sleep mode temperature | +| heatingActive | R | Switch | Whether the heaters in this room are active | +| program | R | String | Name of program used in this room | + + +### Heater channels + +| Channel | Read/write | Item type | Description | +| ------------------- | ------------- | ------------------ | ----------- | +| currentTemperature | R | Number:Temperature | Measured temperature by this heater | +| targetTemperature | R/W | Number:Temperature | Target temperature for this heater. Channel available only if heater is not connected to a room | +| currentPower | R | Number:Power | Current power usage in watts. Note that the power attribute of the heater thing config must be set for this channel to be active | +| heatingActive | R | Switch | Whether the heater is active/heating | +| fanActive | R/W | Switch | Whether the fan (if available) is active (UNTESTED) | +| independent | R | Switch | Whether this heater is controlled independently or part of a room setup | +| window | R | Contact | Whether this heater has detected that a window nearby is open/detection of cold air (UNTESTED) | +| masterSwitch | R/W | Switch | Turn heater ON/OFF. Channel available only if heater is not connected to a room | + + +## Full Example + +millheat.things: + +``` +Bridge millheat:account:home "Millheat account" [username="email@address.com",password="topsecret"] { + Thing home monaco "Penthouse Monaco" [ homeId=100000000000000 ] // Note: numeric value + Thing room office "Office room" [ roomId=200000000000000 ] Note: numeric value + Thing heater office "Office panel heater" [ macAddress="F0XXXXXXXXX", power=900, heaterId=12345 ] Note: heaterId is a numeric value +} +``` + +millheat.items: + +``` +// Items connected to HOME channels +Number:Temperature Vacation_Target_Temperature "Vacation target temp [%d %unit%]" <temperature> {channel="millheat:home:home:monaco:vacationModeTargetTemperature"} +Switch Vacation_Mode "Vacation mode" <vacation> {channel="millheat:home:home:monaco:vacationMode"} +Switch Vacation_Mode_Advanced "Use room away temperatures" <vacation> {channel="millheat:home:home:monaco:vacationModeAdvanced"} +DateTime Vacation_Mode_Start "Vacation mode start [%1$td.%1$tm.%1$ty %1$tH:%1$tM]" <vacation> {channel="millheat:home:home:monaco:vacationModeStart"} +DateTime Vacation_Mode_End "Vacation mode end [%1$td.%1$tm.%1$ty %1$tH:%1$tM]" <vacation> {channel="millheat:home:home:monaco:vacationModeStart"} + +// Items connected to ROOM channels +Number:Temperature Heating_Office_Room_Current_Temperature "Office current [%.1f %unit%]" <temperature> {channel="millheat:room:home:office:currentTemperature"} +Number:Temperature Heating_Office_Room_Target_Temperature "Office target [%.1f %unit%]" <temperature> {channel="millheat:room:home:office:targetTemperature"} +Number:Temperature Heating_Office_Room_Sleep_Temperature "Office sleep [%.1f %unit%]" <temperature> {channel="millheat:room:home:office:sleepTemperature"} +Number:Temperature Heating_Office_Room_Away_Temperature "Office away [%.1f %unit%]" <temperature> {channel="millheat:room:home:office:awayTemperature"} +Number:Temperature Heating_Office_Room_Comfort_Temperature "Office comfort [%.1f %unit%]" <temperature> {channel="millheat:room:home:office:comfortTemperature"} +Switch Heating_Office_Room_Heater_Active "Office active [%s]" <fire> {channel="millheat:room:home:office:heatingActive"} +String Heating_Office_Room_Mode "Office current mode [%s]" {channel="millheat:room:home:office:currentMode"} +String Heating_Office_Room_Program "Office program [%s]" {channel="millheat:room:home:office:program"} + +// Items connected to HEATER channels +Number:Power Heating_Office_Heater_Current_Energy "Energy usage [%d W]" <energy> {channel="millheat:heater:home:office:currentEnergy"} +Number:Temperature Heating_Office_Heater_Current_Temperature "Heater current [%.1f %unit%]" <temperature> {channel="millheat:heater:home:office:currentTemperature"} +Number:Temperature Heating_Office_Heater_Target_Temperature "Heater target [%.1f %unit%]" <temperature> {channel="millheat:heater:home:office:targetTemperature"} +Switch Heating_Office_Heater_Heater_Active "Heater active [%s]" <fire> {channel="millheat:heater:home:office:heatingActive"} +Switch Heating_Office_Heater_Fan_Active "Fan active [%s]" <fan> {channel="millheat:heater:home:office:fanActive"} +Contact Heating_Office_Heater_Window "Window status [%s]" <window> {channel="millheat:heater:home:office:window"} +Switch Heating_Office_Heater_Independent "Heater independent [%s]" <switch> {channel="millheat:heater:home:office:independent"} +Switch Heating_Office_Heater_MasterSwitch "Heater masterswitch [%s]" <switch> {channel="millheat:heater:home:office:masterSwitch"} +``` + +## Setting up vacation mode + +In order to activate vacation mode, follow these steps in a rule: + +* Set start time (DateTime) on `DateTime` item linked to channel type `vacationModeStart` +* Set end time (DateTime) on `DateTime` item linked to channel type `vacationModeEnd` +* Activate vacation mode on `Switch` item linked to channel type `vacationMode` +* Optional - set advanced vacation mode on `Switch` item linked to channel type `vacationModeAdvanced` diff --git a/bundles/org.openhab.binding.millheat/pom.xml b/bundles/org.openhab.binding.millheat/pom.xml new file mode 100644 index 0000000000000..c133b41697a66 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/pom.xml @@ -0,0 +1,24 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.millheat</artifactId> + + <name>openHAB Add-ons :: Bundles :: Millheat Binding</name> + + <dependencies> + <dependency> + <groupId>com.github.tomakehurst</groupId> + <artifactId>wiremock-standalone</artifactId> + <version>2.23.0</version> + <scope>test</scope> + </dependency> + </dependencies> + +</project> diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatBindingConstants.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatBindingConstants.java new file mode 100644 index 0000000000000..e7fe0c1035788 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatBindingConstants.java @@ -0,0 +1,63 @@ +/** + * 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.millheat.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; + +/** + * The {@link MillheatBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatBindingConstants { + private static final String BINDING_ID = "millheat"; + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_ACCOUNT = new ThingTypeUID(BINDING_ID, "account"); + public static final ThingTypeUID THING_TYPE_HOME = new ThingTypeUID(BINDING_ID, "home"); + public static final ThingTypeUID THING_TYPE_ROOM = new ThingTypeUID(BINDING_ID, "room"); + public static final ThingTypeUID THING_TYPE_HEATER = new ThingTypeUID(BINDING_ID, "heater"); + // List of all Channel ids + public static final String CHANNEL_CURRENT_TEMPERATURE = "currentTemperature"; + public static final String CHANNEL_COMFORT_TEMPERATURE = "comfortTemperature"; + public static final String CHANNEL_SLEEP_TEMPERATURE = "sleepTemperature"; + public static final String CHANNEL_AWAY_TEMPERATURE = "awayTemperature"; + public static final String CHANNEL_HEATING_ACTIVE = "heatingActive"; + public static final String CHANNEL_FAN_ACTIVE = "fanActive"; + public static final String CHANNEL_TARGET_TEMPERATURE = "targetTemperature"; + public static final String CHANNEL_CURRENT_POWER = "currentEnergy"; + public static final String CHANNEL_CURRENT_MODE = "currentMode"; + public static final String CHANNEL_PROGRAM = "program"; + public static final String CHANNEL_INDEPENDENT = "independent"; + public static final String CHANNEL_WINDOW_STATE = "window"; + public static final String CHANNEL_MASTER_SWITCH = "masterSwitch"; + + // Vacation mode channels + public static final String CHANNEL_HOME_VACATION_TARGET_TEMPERATURE = "vacationModeTargetTemperature"; + public static final String CHANNEL_HOME_VACATION_MODE = "vacationMode"; + public static final String CHANNEL_HOME_VACATION_MODE_ADVANCED = "vacationModeAdvanced"; + public static final String CHANNEL_HOME_VACATION_MODE_START = "vacationModeStart"; + public static final String CHANNEL_HOME_VACATION_MODE_END = "vacationModeEnd"; + + public static final String CHANNEL_TYPE_MASTER_SWITCH = "masterSwitch"; + public static final String CHANNEL_TYPE_TARGET_TEMPERATURE_HEATER = "targetTemperatureHeater"; + + public static final ChannelTypeUID CHANNEL_TYPE_MASTER_SWITCH_UID = new ChannelTypeUID(BINDING_ID, + CHANNEL_TYPE_MASTER_SWITCH); + public static final ChannelTypeUID CHANNEL_TYPE_TARGET_TEMPERATURE_HEATER_UID = new ChannelTypeUID(BINDING_ID, + CHANNEL_TYPE_TARGET_TEMPERATURE_HEATER); + +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatCommunicationException.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatCommunicationException.java new file mode 100644 index 0000000000000..8317c6109e63e --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatCommunicationException.java @@ -0,0 +1,47 @@ +/** + * 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.millheat.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.millheat.internal.dto.AbstractRequest; +import org.openhab.binding.millheat.internal.dto.AbstractResponse; + +/** + * The {@link MillheatCommunicationException} class wraps exceptions raised when communicating with the API + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatCommunicationException extends Exception { + private static final long serialVersionUID = 1L; + private int errorCode = 0; + + public MillheatCommunicationException(final String message, final Throwable cause) { + super(message, cause); + } + + public MillheatCommunicationException(final String message) { + super(message); + } + + public MillheatCommunicationException(final AbstractRequest request, final AbstractResponse response) { + super("Server responded with error to request " + request.getClass().getSimpleName() + "/" + + request.getRequestUrl() + ": " + response.errorCode + "/" + response.errorName + "/" + + response.errorDescription); + this.errorCode = response.errorCode; + } + + public int getErrorCode() { + return errorCode; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatHandlerFactory.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatHandlerFactory.java new file mode 100644 index 0000000000000..c83fad1886559 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/MillheatHandlerFactory.java @@ -0,0 +1,113 @@ +/** + * 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.millheat.internal; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.openhab.binding.millheat.internal.discovery.MillheatDiscoveryService; +import org.openhab.binding.millheat.internal.handler.MillheatAccountHandler; +import org.openhab.binding.millheat.internal.handler.MillheatHeaterHandler; +import org.openhab.binding.millheat.internal.handler.MillheatHomeHandler; +import org.openhab.binding.millheat.internal.handler.MillheatRoomHandler; +import org.osgi.framework.ServiceRegistration; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link MillheatHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.millheat", service = ThingHandlerFactory.class) +public class MillheatHandlerFactory extends BaseThingHandlerFactory { + private HttpClient httpClient; + private Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(Stream + .of(MillheatBindingConstants.THING_TYPE_ACCOUNT, MillheatBindingConstants.THING_TYPE_HEATER, + MillheatBindingConstants.THING_TYPE_ROOM, MillheatBindingConstants.THING_TYPE_HOME) + .collect(Collectors.toSet())); + + @Activate + public MillheatHandlerFactory(@Reference HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + + @Override + protected @Nullable ThingHandler createHandler(final Thing thing) { + final ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + if (MillheatBindingConstants.THING_TYPE_HEATER.equals(thingTypeUID)) { + return new MillheatHeaterHandler(thing); + } else if (MillheatBindingConstants.THING_TYPE_ROOM.equals(thingTypeUID)) { + return new MillheatRoomHandler(thing); + } else if (MillheatBindingConstants.THING_TYPE_HOME.equals(thingTypeUID)) { + return new MillheatHomeHandler(thing); + } else if (MillheatBindingConstants.THING_TYPE_ACCOUNT.equals(thingTypeUID)) { + final MillheatAccountHandler handler = new MillheatAccountHandler((Bridge) thing, httpClient, + bundleContext); + registerDeviceDiscoveryService(handler); + return handler; + } + return null; + } + + @Override + protected void removeHandler(ThingHandler thingHandler) { + if (thingHandler instanceof MillheatAccountHandler) { + ThingUID thingUID = thingHandler.getThing().getUID(); + unregisterDeviceDiscoveryService(thingUID); + } + super.removeHandler(thingHandler); + } + + @Override + public boolean supportsThingType(final ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + private void registerDeviceDiscoveryService(MillheatAccountHandler bridgeHandler) { + MillheatDiscoveryService discoveryService = new MillheatDiscoveryService(bridgeHandler); + discoveryServiceRegs.put(bridgeHandler.getThing().getUID(), bundleContext + .registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<String, Object>())); + } + + private void unregisterDeviceDiscoveryService(ThingUID thingUID) { + if (discoveryServiceRegs.containsKey(thingUID)) { + ServiceRegistration<?> serviceReg = discoveryServiceRegs.get(thingUID); + serviceReg.unregister(); + discoveryServiceRegs.remove(thingUID); + } + } + +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/BooleanSerializer.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/BooleanSerializer.java new file mode 100644 index 0000000000000..68714f8609644 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/BooleanSerializer.java @@ -0,0 +1,41 @@ +/** + * 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.millheat.internal.client; + +import java.lang.reflect.Type; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; + +/** + * The {@link BooleanSerializer} serializes and parses 1/0 to true/false from JSON files + * + * @author Arne Seime - Initial contribution + */ +public class BooleanSerializer implements JsonSerializer<Boolean>, JsonDeserializer<Boolean> { + @Override + public Boolean deserialize(final JsonElement element, final Type type, final JsonDeserializationContext context) + throws JsonParseException { + return element.getAsInt() == 1; + } + + @Override + public JsonElement serialize(final Boolean argument, final Type type, final JsonSerializationContext context) { + return new JsonPrimitive(Boolean.TRUE.equals(argument) ? 1 : 0); + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/RequestLogger.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/RequestLogger.java new file mode 100644 index 0000000000000..385b27adc4562 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/client/RequestLogger.java @@ -0,0 +1,134 @@ +/** + * 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.millheat.internal.client; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.Locale; +import java.util.concurrent.atomic.AtomicLong; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.http.HttpField; +import org.eclipse.jetty.http.HttpFields; +import org.eclipse.jetty.http.HttpHeader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.google.gson.JsonSyntaxException; + +/** + * Logs HttpClient request/response traffic. + * + * @author Gili Tzabari - Initial contribution https://stackoverflow.com/users/14731/gili + * https://stackoverflow.com/questions/50318736/how-to-log-httpclient-requests-response-including-body + * @author Arne Seime - adapted for Millheat binding + */ +@NonNullByDefault +public final class RequestLogger { + private final Logger logger = LoggerFactory.getLogger(RequestLogger.class); + private final AtomicLong nextId = new AtomicLong(); + private final JsonParser parser; + private final Gson gson; + private final String prefix; + + public RequestLogger(final String prefix, final Gson gson) { + this.parser = new JsonParser(); + this.gson = gson; + this.prefix = prefix; + } + + private void dump(final Request request) { + final long idV = nextId.getAndIncrement(); + if (logger.isDebugEnabled()) { + final String id = prefix + "-" + idV; + final StringBuilder group = new StringBuilder(); + request.onRequestBegin(theRequest -> group.append( + String.format("Request %s\n%s > %s %s\n", id, id, theRequest.getMethod(), theRequest.getURI()))); + request.onRequestHeaders(theRequest -> { + for (final HttpField header : theRequest.getHeaders()) { + group.append(String.format("%s > %s\n", id, header)); + } + }); + final StringBuilder contentBuffer = new StringBuilder(); + request.onRequestContent((theRequest, content) -> contentBuffer + .append(reformatJson(getCharset(theRequest.getHeaders()).decode(content).toString()))); + request.onRequestSuccess(theRequest -> { + if (contentBuffer.length() > 0) { + group.append("\n"); + group.append(contentBuffer); + } + String dataToLog = group.toString(); + logger.debug(dataToLog); + contentBuffer.delete(0, contentBuffer.length()); + group.delete(0, group.length()); + }); + request.onResponseBegin(theResponse -> { + group.append(String.format("Response %s\n%s < %s %s", id, id, theResponse.getVersion(), + theResponse.getStatus())); + if (theResponse.getReason() != null) { + group.append(" "); + group.append(theResponse.getReason()); + } + group.append("\n"); + }); + request.onResponseHeaders(theResponse -> { + for (final HttpField header : theResponse.getHeaders()) { + group.append(String.format("%s < %s\n", id, header)); + } + }); + request.onResponseContent((theResponse, content) -> contentBuffer + .append(reformatJson(getCharset(theResponse.getHeaders()).decode(content).toString()))); + request.onResponseSuccess(theResponse -> { + if (contentBuffer.length() > 0) { + group.append("\n"); + group.append(contentBuffer); + } + String dataToLog = group.toString(); + logger.debug(dataToLog); + }); + } + } + + private Charset getCharset(final HttpFields headers) { + final String contentType = headers.get(HttpHeader.CONTENT_TYPE); + if (contentType == null) { + return StandardCharsets.UTF_8; + } + final String[] tokens = contentType.toLowerCase(Locale.US).split("charset="); + if (tokens.length != 2) { + return StandardCharsets.UTF_8; + } + + final String encoding = tokens[1].replaceAll("[;\"]", ""); + return Charset.forName(encoding); + } + + public Request listenTo(final Request request) { + dump(request); + return request; + } + + private String reformatJson(final String jsonString) { + try { + final JsonElement json = parser.parse(jsonString); + return gson.toJson(json); + } catch (final JsonSyntaxException e) { + logger.debug("Could not reformat malformed JSON due to '{}'", e.getMessage()); + return jsonString; + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatAccountConfiguration.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatAccountConfiguration.java new file mode 100644 index 0000000000000..479607e4dc0bd --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatAccountConfiguration.java @@ -0,0 +1,27 @@ +/** + * 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.millheat.internal.config; + +/** + * The {@link MillheatAccountConfiguration} class contains account thing configuration parameters. + * + * @author Arne Seime - Initial contribution + */ +public class MillheatAccountConfiguration { + /** + * Username/email address used in app + */ + public String username; + public String password; + public int refreshInterval = 120; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHeaterConfiguration.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHeaterConfiguration.java new file mode 100644 index 0000000000000..130e6e656c179 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHeaterConfiguration.java @@ -0,0 +1,39 @@ +/** + * 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.millheat.internal.config; + +/** + * The {@link MillheatHeaterConfiguration} class contains heater thing configuration parameters. + * + * @author Arne Seime - Initial contribution + */ +public class MillheatHeaterConfiguration { + /* + * Wi-Fi mac address + */ + public String macAddress; + /* + * Wi-Fi heater id - found in logs + */ + public Long heaterId; + /* + * Nominal heater panel power + */ + public Integer power; + + @Override + public String toString() { + return "MillheatHeaterConfiguration [macAddress=" + macAddress + ", heaterId=" + heaterId + ", power=" + power + + "]"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHomeConfiguration.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHomeConfiguration.java new file mode 100644 index 0000000000000..a1e9bf03dbcfe --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatHomeConfiguration.java @@ -0,0 +1,29 @@ +/** + * 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.millheat.internal.config; + +/** + * The {@link MillheatHomeConfiguration} class contains home thing configuration parameters. + * + * @author Arne Seime - Initial contribution + */ +public class MillheatHomeConfiguration { + + public Long homeId; + + @Override + public String toString() { + return "MillheatHomeConfiguration [homeId=" + homeId + "]"; + } + +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatRoomConfiguration.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatRoomConfiguration.java new file mode 100644 index 0000000000000..4951f54df0ea8 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/config/MillheatRoomConfiguration.java @@ -0,0 +1,30 @@ +/** + * 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.millheat.internal.config; + +/** + * The {@link MillheatRoomConfiguration} class contains room thing configuration parameters. + * + * @author Arne Seime - Initial contribution + */ +public class MillheatRoomConfiguration { + /* + * Room ID + */ + public Long roomId; + + @Override + public String toString() { + return "MillheatRoomConfiguration [roomId=" + roomId + "]"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/discovery/MillheatDiscoveryService.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/discovery/MillheatDiscoveryService.java new file mode 100644 index 0000000000000..bd881ce9befa2 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/discovery/MillheatDiscoveryService.java @@ -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.millheat.internal.discovery; + +import java.util.Collections; +import java.util.Set; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.openhab.binding.millheat.internal.MillheatBindingConstants; +import org.openhab.binding.millheat.internal.handler.MillheatAccountHandler; +import org.openhab.binding.millheat.internal.model.Heater; +import org.openhab.binding.millheat.internal.model.Home; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.openhab.binding.millheat.internal.model.Room; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class does discovery of discoverable things + * + * @author Arne Seime - Initial contribution + */ +public class MillheatDiscoveryService extends AbstractDiscoveryService { + private static final long REFRESH_INTERVAL_MINUTES = 60; + public static final Set<ThingTypeUID> DISCOVERABLE_THING_TYPES_UIDS = Collections.unmodifiableSet( + Stream.of(MillheatBindingConstants.THING_TYPE_HEATER, MillheatBindingConstants.THING_TYPE_ROOM, + MillheatBindingConstants.THING_TYPE_HOME).collect(Collectors.toSet())); + private final Logger logger = LoggerFactory.getLogger(MillheatDiscoveryService.class); + private ScheduledFuture<?> discoveryJob; + private final MillheatAccountHandler accountHandler; + + public MillheatDiscoveryService(final MillheatAccountHandler accountHandler) { + super(DISCOVERABLE_THING_TYPES_UIDS, 10); + this.accountHandler = accountHandler; + } + + @Override + protected void startBackgroundDiscovery() { + discoveryJob = scheduler.scheduleWithFixedDelay(this::startScan, 0, REFRESH_INTERVAL_MINUTES, TimeUnit.MINUTES); + } + + @Override + protected synchronized void startScan() { + logger.debug("Start scan for Millheat devices."); + try { + final ThingUID accountUID = accountHandler.getThing().getUID(); + accountHandler.updateModelFromServerWithRetry(false); + final MillheatModel model = accountHandler.getModel(); + for (final Home home : model.getHomes()) { + final ThingUID homeUID = new ThingUID(MillheatBindingConstants.THING_TYPE_HOME, accountUID, + String.valueOf(home.getId())); + final DiscoveryResult discoveryResultHome = DiscoveryResultBuilder.create(homeUID) + .withBridge(accountUID).withLabel(home.getName()).withProperty("homeId", home.getId()) + .withRepresentationProperty("homeId").build(); + thingDiscovered(discoveryResultHome); + + for (final Room room : home.getRooms()) { + final ThingUID roomUID = new ThingUID(MillheatBindingConstants.THING_TYPE_ROOM, accountUID, + String.valueOf(room.getId())); + final DiscoveryResult discoveryResultRoom = DiscoveryResultBuilder.create(roomUID) + .withBridge(accountUID).withLabel(room.getName()).withProperty("roomId", room.getId()) + .withRepresentationProperty("roomId").build(); + thingDiscovered(discoveryResultRoom); + for (final Heater heater : room.getHeaters()) { + final ThingUID heaterUID = new ThingUID(MillheatBindingConstants.THING_TYPE_HEATER, accountUID, + String.valueOf(heater.getId())); + final DiscoveryResult discoveryResultHeater = DiscoveryResultBuilder.create(heaterUID) + .withBridge(accountUID).withLabel(heater.getName()) + .withProperty("heaterId", heater.getId()).withRepresentationProperty("macAddress") + .withProperty("macAddress", heater.getMacAddress()).build(); + thingDiscovered(discoveryResultHeater); + } + } + for (final Heater heater : home.getIndependentHeaters()) { + final ThingUID heaterUID = new ThingUID(MillheatBindingConstants.THING_TYPE_HEATER, accountUID, + String.valueOf(heater.getId())); + final DiscoveryResult discoveryResultHeater = DiscoveryResultBuilder.create(heaterUID) + .withBridge(accountUID).withLabel(heater.getName()).withRepresentationProperty("heaterId") + .withProperty("heaterId", heater.getId()).build(); + thingDiscovered(discoveryResultHeater); + } + } + } finally { + removeOlderResults(getTimestampOfLastScan()); + } + } + + @Override + protected void stopBackgroundDiscovery() { + stopScan(); + if (discoveryJob != null && !discoveryJob.isCancelled()) { + discoveryJob.cancel(true); + discoveryJob = null; + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractRequest.java new file mode 100644 index 0000000000000..f126b4ef3d586 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractRequest.java @@ -0,0 +1,22 @@ +/** + * 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.millheat.internal.dto; + +/** + * The {@link AbstractRequest} class is implemented by all service requests + ** + * @author Arne Seime - Initial contribution + */ +public interface AbstractRequest { + String getRequestUrl(); +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractResponse.java new file mode 100644 index 0000000000000..40ceba675abcd --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/AbstractResponse.java @@ -0,0 +1,31 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * The {@link AbstractResponse} class is the base class for all decoded JSON responses from the API + * + * @author Arne Seime - Initial contribution + */ +public abstract class AbstractResponse { + public static final int ERROR_CODE_ACCESS_TOKEN_EXPIRED = 3515; + public static final int ERROR_CODE_INVALID_SIGNATURE = 3015; + public static final int ERROR_CODE_AUTHENTICATION_FAILURE = 1025; + public int errorCode; + @SerializedName("error") + public String errorName; + @SerializedName("description") + public String errorDescription; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/DeviceDTO.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/DeviceDTO.java new file mode 100644 index 0000000000000..c0635a0c09c1c --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/DeviceDTO.java @@ -0,0 +1,40 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * The {@link DeviceDTO} class represents a heater device + * + * @author Arne Seime - Initial contribution + */ +public class DeviceDTO { + public boolean heaterFlag; + public int subDomainId; + public int controlType; + public double currentTemp; + public boolean canChangeTemp; + public long deviceId; + public String deviceName; + @SerializedName("mac") + public String macAddress; + public int deviceStatus; + public int holidayTemp; + public boolean fanStatus; + @SerializedName("open") + public boolean openWindow; + public boolean powerStatus; + @SerializedName("isHoliday") + public boolean holiday; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesRequest.java new file mode 100644 index 0000000000000..559db7c76ebee --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesRequest.java @@ -0,0 +1,25 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the selectHomeList request + * + * @author Arne Seime - Initial contribution + */ +public class GetHomesRequest implements AbstractRequest { + @Override + public String getRequestUrl() { + return "selectHomeList"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesResponse.java new file mode 100644 index 0000000000000..adfbeb3ad638e --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetHomesResponse.java @@ -0,0 +1,26 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the selectHomeList response + * + * @author Arne Seime - Initial contribution + */ +public class GetHomesResponse extends AbstractResponse { + public Integer hourSystem; + @SerializedName("homeList") + public HomeDTO[] homes = new HomeDTO[0]; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeRequest.java new file mode 100644 index 0000000000000..950f0530d5625 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeRequest.java @@ -0,0 +1,31 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the get independent devices request + * + * @author Arne Seime - Initial contribution + */ +public class GetIndependentDevicesByHomeRequest implements AbstractRequest { + public final Long homeId; + + public GetIndependentDevicesByHomeRequest(final Long homeId, final String timeZone) { + this.homeId = homeId; + } + + @Override + public String getRequestUrl() { + return "getIndependentDevices"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeResponse.java new file mode 100644 index 0000000000000..c892a11679650 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/GetIndependentDevicesByHomeResponse.java @@ -0,0 +1,25 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the get independent devices response + * + * @author Arne Seime - Initial contribution + */ +public class GetIndependentDevicesByHomeResponse extends AbstractResponse { + @SerializedName("deviceInfo") + public DeviceDTO devices[] = new DeviceDTO[0]; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/HomeDTO.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/HomeDTO.java new file mode 100644 index 0000000000000..a3425188efc2a --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/HomeDTO.java @@ -0,0 +1,41 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the home dto json structure + * + * @author Arne Seime - Initial contribution + */ +public class HomeDTO { + public long homeId; + @SerializedName("homeAlways") + public boolean alwaysHome; + @SerializedName("homeName") + public String name; + @SerializedName("isHoliday") + public boolean holiday; + public Long holidayStartTime; + public String timeZone; + public Integer modeMinute; + public Long modeStartTime; + public Integer holidayTemp; + public Integer modeHour; + public Integer currentMode; + public Long holidayEndTime; + public Integer homeType; + public String programId; + public int holidayTempType; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginRequest.java new file mode 100644 index 0000000000000..a8ba2e74f07f1 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginRequest.java @@ -0,0 +1,33 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the login request + * + * @author Arne Seime - Initial contribution + */ +public class LoginRequest implements AbstractRequest { + public final String account; + public final String password; + + public LoginRequest(final String username, final String password) { + this.account = username; + this.password = password; + } + + @Override + public String getRequestUrl() { + return "login"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginResponse.java new file mode 100644 index 0000000000000..9d3b62a065221 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/LoginResponse.java @@ -0,0 +1,34 @@ +/** + * 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.millheat.internal.dto; + +import java.util.Date; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the login response + * + * @author Arne Seime - Initial contribution + */ +public class LoginResponse extends AbstractResponse { + public String email; + @SerializedName("nickName") + public String nickname; + public String phone; + public String refreshToken; + public Date refreshTokenExpire; + public String token; + public Date tokenExpire; + public Integer userId; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/RoomDTO.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/RoomDTO.java new file mode 100644 index 0000000000000..073d3592b65d2 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/RoomDTO.java @@ -0,0 +1,44 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the room json structure + * + * @author Arne Seime - Initial contribution + */ +public class RoomDTO { + public long roomId; + @SerializedName("roomName") + public String name; + public int comfortTemp; + public int sleepTemp; + public int awayTemp; + @SerializedName("avgTemp") + public double currentTemp; + public String roomProgram; + public int currentMode = 0; + public boolean heatStatus = false; + @SerializedName("onLineDeviceNum") + public int onlineDeviceCount = 0; + @SerializedName("offLineDeviceNum") + public int offLineDeviceCount = 0; + @SerializedName("total") + public int totalCount = 0; + public int independentCount = 0; + @SerializedName("isOffline") + public boolean offline = true; + public String controlSource; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomRequest.java new file mode 100644 index 0000000000000..cadd6dc7aed75 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomRequest.java @@ -0,0 +1,36 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the select device by room request + * + * @author Arne Seime - Initial contribution + */ +public class SelectDeviceByRoomRequest implements AbstractRequest { + public final Long roomId; + @SerializedName("timeZoneNum") + public final String timeZone; + + public SelectDeviceByRoomRequest(final Long roomId, final String timeZone) { + this.roomId = roomId; + this.timeZone = timeZone; + } + + @Override + public String getRequestUrl() { + return "selectDevicebyRoom"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomResponse.java new file mode 100644 index 0000000000000..0d9b9ab1f3b0d --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectDeviceByRoomResponse.java @@ -0,0 +1,25 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the select device by home response + * + * @author Arne Seime - Initial contribution + */ +public class SelectDeviceByRoomResponse extends AbstractResponse { + @SerializedName("deviceInfo") + public DeviceDTO[] devices = new DeviceDTO[0]; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeRequest.java new file mode 100644 index 0000000000000..e8c34fc9201d1 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeRequest.java @@ -0,0 +1,36 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the select room by home request + * + * @author Arne Seime - Initial contribution + */ +public class SelectRoomByHomeRequest implements AbstractRequest { + public final Long homeId; + @SerializedName("timeZoneNum") + public final String timeZone; + + public SelectRoomByHomeRequest(final Long homeId, final String timeZone) { + this.homeId = homeId; + this.timeZone = timeZone; + } + + @Override + public String getRequestUrl() { + return "selectRoombyHome"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeResponse.java new file mode 100644 index 0000000000000..39f577d36862c --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SelectRoomByHomeResponse.java @@ -0,0 +1,25 @@ +/** + * 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.millheat.internal.dto; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the select room by home response + * + * @author Arne Seime - Initial contribution + */ +public class SelectRoomByHomeResponse extends AbstractResponse { + @SerializedName("roomInfo") + public RoomDTO[] rooms = new RoomDTO[0]; +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempRequest.java new file mode 100644 index 0000000000000..2aecaab3b0310 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempRequest.java @@ -0,0 +1,55 @@ +/** + * 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.millheat.internal.dto; + +import org.openhab.binding.millheat.internal.model.Heater; + +/** + * This DTO class wraps the set device temp request + * + * @see SetRoomTempRequest + * @author Arne Seime - Initial contribution + */ +public class SetDeviceTempRequest implements AbstractRequest { + public final int subDomain; + public final long deviceId; + public final boolean testStatus = true; + public final int operation; + public final boolean status; + public final boolean windStatus; + public final int holdTemp; + public final int tempType = 0; // FIXED? + public final int powerLevel = 0; // FIXED? + + @Override + public String getRequestUrl() { + return "deviceControl"; + } + + public SetDeviceTempRequest(final Heater heater, final int targetTemperature, final boolean masterSwitch, + final boolean fanActive) { + this.subDomain = heater.getSubDomain(); + this.deviceId = heater.getId(); + this.holdTemp = targetTemperature; + this.status = masterSwitch; + this.windStatus = fanActive; + if (fanActive != heater.fanActive()) { + // Changed + operation = 4; + } else if (heater.getTargetTemp() != targetTemperature) { + operation = 1; + } else { + operation = 0; + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempResponse.java new file mode 100644 index 0000000000000..0f40b68bdd77a --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetDeviceTempResponse.java @@ -0,0 +1,21 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the set device temp response + * + * @author Arne Seime - Initial contribution + */ +public class SetDeviceTempResponse extends AbstractResponse { +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterRequest.java new file mode 100644 index 0000000000000..0676186c729f2 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterRequest.java @@ -0,0 +1,68 @@ +/** + * 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.millheat.internal.dto; + +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +/** + * This DTO class wraps the set holiday parameter request + * + * @see HomeDTO + * @see GetHomesResponse + * @author Arne Seime - Initial contribution + */ +public class SetHolidayParameterRequest implements AbstractRequest { + + public static final String PROP_TEMP = "holidayTemp"; + public static final String PROP_MODE = "isHoliday"; + public static final String PROP_MODE_ADVANCED = "holidayTempType"; + public static final String PROP_START = "holidayStartTime"; + public static final String PROP_END = "holidayEndTime"; + + // {"timeZoneNum":"-01:00","value":11,"homeList":[{"homeId":XXXXXXXXXXXX}],"key":"holidayTemp"} + public List<HomeID> homeList = new ArrayList<>(); + @SerializedName("timeZoneNum") + public final String timeZone; + public final String key; + public final Object value; + + /* + * Valid parameters: holidayTemp (degrees), holidayStartTime (secs since epoch), holidayEndTime (secs since epoch), + * isHoliday (boolean), holidayTempType (0 == advanced vacation mode - room uses it's own away temp, 1 == uses + * holidayTemp) + */ + public SetHolidayParameterRequest(Long homeId, String timeZone, String parameter, Object value) { + homeList.add(new HomeID(homeId)); + this.timeZone = timeZone; + this.key = parameter; + this.value = value; + } + + @Override + public String getRequestUrl() { + return "holidayChooseHome"; + } + + private class HomeID { + @SuppressWarnings("unused") + public Long homeId; + + public HomeID(Long homeId) { + super(); + this.homeId = homeId; + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterResponse.java new file mode 100644 index 0000000000000..b9df5badb14ce --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetHolidayParameterResponse.java @@ -0,0 +1,26 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the set room temp response + * + * @author Arne Seime - Initial contribution + */ +public class SetHolidayParameterResponse extends AbstractResponse { + public String success; + + public boolean isSuccess() { + return "true".contentEquals(success); + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempRequest.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempRequest.java new file mode 100644 index 0000000000000..12f19007bb518 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempRequest.java @@ -0,0 +1,43 @@ +/** + * 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.millheat.internal.dto; + +import org.openhab.binding.millheat.internal.model.Home; +import org.openhab.binding.millheat.internal.model.Room; + +/** + * This DTO class wraps the set room temp request + * + * @see SetDeviceTempRequest + * @author Arne Seime - Initial contribution + */ +public class SetRoomTempRequest implements AbstractRequest { + public final long roomId; + public int comfortTemp; + public int sleepTemp; + public int awayTemp; + public final int homeType; + + public SetRoomTempRequest(final Home home, final Room room) { + roomId = room.getId(); + homeType = home.getType(); + comfortTemp = room.getComfortTemp(); + sleepTemp = room.getSleepTemp(); + awayTemp = room.getAwayTemp(); + } + + @Override + public String getRequestUrl() { + return "changeRoomModeTempInfo"; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempResponse.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempResponse.java new file mode 100644 index 0000000000000..2334b29bb67a0 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/dto/SetRoomTempResponse.java @@ -0,0 +1,21 @@ +/** + * 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.millheat.internal.dto; + +/** + * This DTO class wraps the set room temp response + * + * @author Arne Seime - Initial contribution + */ +public class SetRoomTempResponse extends AbstractResponse { +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatAccountHandler.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatAccountHandler.java new file mode 100644 index 0000000000000..009423b3224f0 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatAccountHandler.java @@ -0,0 +1,493 @@ +/** + * 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.millheat.internal.handler; + +import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; +import java.security.NoSuchAlgorithmException; +import java.util.List; +import java.util.Optional; +import java.util.Random; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.client.util.BytesContentProvider; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.millheat.internal.MillheatCommunicationException; +import org.openhab.binding.millheat.internal.client.BooleanSerializer; +import org.openhab.binding.millheat.internal.client.RequestLogger; +import org.openhab.binding.millheat.internal.config.MillheatAccountConfiguration; +import org.openhab.binding.millheat.internal.dto.AbstractRequest; +import org.openhab.binding.millheat.internal.dto.AbstractResponse; +import org.openhab.binding.millheat.internal.dto.DeviceDTO; +import org.openhab.binding.millheat.internal.dto.GetHomesRequest; +import org.openhab.binding.millheat.internal.dto.GetHomesResponse; +import org.openhab.binding.millheat.internal.dto.GetIndependentDevicesByHomeRequest; +import org.openhab.binding.millheat.internal.dto.GetIndependentDevicesByHomeResponse; +import org.openhab.binding.millheat.internal.dto.HomeDTO; +import org.openhab.binding.millheat.internal.dto.LoginRequest; +import org.openhab.binding.millheat.internal.dto.LoginResponse; +import org.openhab.binding.millheat.internal.dto.RoomDTO; +import org.openhab.binding.millheat.internal.dto.SelectDeviceByRoomRequest; +import org.openhab.binding.millheat.internal.dto.SelectDeviceByRoomResponse; +import org.openhab.binding.millheat.internal.dto.SelectRoomByHomeRequest; +import org.openhab.binding.millheat.internal.dto.SelectRoomByHomeResponse; +import org.openhab.binding.millheat.internal.dto.SetDeviceTempRequest; +import org.openhab.binding.millheat.internal.dto.SetHolidayParameterRequest; +import org.openhab.binding.millheat.internal.dto.SetHolidayParameterResponse; +import org.openhab.binding.millheat.internal.dto.SetRoomTempRequest; +import org.openhab.binding.millheat.internal.dto.SetRoomTempResponse; +import org.openhab.binding.millheat.internal.model.Heater; +import org.openhab.binding.millheat.internal.model.Home; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.openhab.binding.millheat.internal.model.ModeType; +import org.openhab.binding.millheat.internal.model.Room; +import org.osgi.framework.BundleContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * The {@link MillheatAccountHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatAccountHandler extends BaseBridgeHandler { + private static final int MIN_TIME_BETWEEEN_MODEL_UPDATES_MS = 30_000; + private static final int NUM_NONCE_CHARS = 16; + private static final String CONTENT_TYPE = "application/x-zc-object"; + private static final String ALLOWED_NONCE_CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static final int ALLOWED_NONCE_CHARACTERS_LENGTH = ALLOWED_NONCE_CHARACTERS.length(); + private static final String REQUEST_TIMEOUT = "300"; + public static String authEndpoint = "https://eurouter.ablecloud.cn:9005/zc-account/v1/"; + public static String serviceEndpoint = "https://eurouter.ablecloud.cn:9005/millService/v1/"; + private final Logger logger = LoggerFactory.getLogger(MillheatAccountHandler.class); + private @Nullable String userId; + private @Nullable String token; + private final HttpClient httpClient; + private final RequestLogger requestLogger; + private final Gson gson; + private MillheatModel model = new MillheatModel(0); + private @Nullable ScheduledFuture<?> statusFuture; + private @NonNullByDefault({}) MillheatAccountConfiguration config; + + private static String getRandomString(final int sizeOfRandomString) { + final Random random = new Random(); + final StringBuilder sb = new StringBuilder(sizeOfRandomString); + for (int i = 0; i < sizeOfRandomString; ++i) { + sb.append(ALLOWED_NONCE_CHARACTERS.charAt(random.nextInt(ALLOWED_NONCE_CHARACTERS_LENGTH))); + } + return sb.toString(); + } + + public MillheatAccountHandler(final Bridge bridge, final HttpClient httpClient, final BundleContext context) { + super(bridge); + this.httpClient = httpClient; + final BooleanSerializer serializer = new BooleanSerializer(); + + gson = new GsonBuilder().setPrettyPrinting().setDateFormat("yyyy-MM-dd HH:mm:ss") + .registerTypeAdapter(Boolean.class, serializer).registerTypeAdapter(boolean.class, serializer) + .setLenient().create(); + requestLogger = new RequestLogger(bridge.getUID().getId(), gson); + } + + private boolean allowModelUpdate() { + final long timeSinceLastUpdate = System.currentTimeMillis() - model.getLastUpdated(); + if (timeSinceLastUpdate > MIN_TIME_BETWEEEN_MODEL_UPDATES_MS) { + return true; + } + return false; + } + + public MillheatModel getModel() { + return model; + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + logger.debug("Bridge does not support any commands, but received command {} for channelUID {}", command, + channelUID); + } + + public boolean doLogin() { + try { + final LoginResponse rsp = sendLoginRequest(new LoginRequest(config.username, config.password), + LoginResponse.class); + final int errorCode = rsp.errorCode; + if (errorCode != 0) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + String.format("Error login in: code=%s, type=%s, message=%s", errorCode, rsp.errorName, + rsp.errorDescription)); + } else { + // No error provided on login, proceed to find token and userid + token = StringUtils.trimToNull(rsp.token); + userId = rsp.userId == null ? null : rsp.userId.toString(); + if (token == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "error login in, no token provided"); + } else if (userId == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "error login in, no userId provided"); + } else { + return true; + } + } + } catch (final MillheatCommunicationException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error login: " + e.getMessage()); + } + return false; + } + + @Override + public void initialize() { + config = getConfigAs(MillheatAccountConfiguration.class); + scheduler.execute(() -> { + if (doLogin()) { + try { + model = refreshModel(); + updateStatus(ThingStatus.ONLINE); + initPolling(); + } catch (final MillheatCommunicationException e) { + model = new MillheatModel(0); // Empty model + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "error fetching initial data " + e.getMessage()); + logger.debug("Error initializing Millheat data", e); + // Reschedule init + scheduler.schedule(() -> { + initialize(); + }, 30, TimeUnit.SECONDS); + } + } + }); + logger.debug("Finished initializing!"); + } + + @Override + public void dispose() { + stopPolling(); + super.dispose(); + } + + /** + * starts this things polling future + */ + private void initPolling() { + stopPolling(); + statusFuture = scheduler.scheduleWithFixedDelay(() -> { + try { + updateModelFromServerWithRetry(true); + } catch (final RuntimeException e) { + logger.debug("Error refreshing model", e); + } + }, config.refreshInterval, config.refreshInterval, TimeUnit.SECONDS); + } + + private <T> T sendLoginRequest(final AbstractRequest req, final Class<T> responseType) + throws MillheatCommunicationException { + final Request request = httpClient.newRequest(authEndpoint + req.getRequestUrl()); + addStandardHeadersAndPayload(request, req); + return sendRequest(request, req, responseType); + } + + private <T> T sendLoggedInRequest(final AbstractRequest req, final Class<T> responseType) + throws MillheatCommunicationException { + try { + final Request request = buildLoggedInRequest(req); + return sendRequest(request, req, responseType); + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { + throw new MillheatCommunicationException("Error building Millheat request: " + e.getMessage(), e); + } + } + + @SuppressWarnings("unchecked") + private <T> T sendRequest(final Request request, final AbstractRequest req, final Class<T> responseType) + throws MillheatCommunicationException { + try { + final ContentResponse contentResponse = request.send(); + final String responseJson = contentResponse.getContentAsString(); + if (contentResponse.getStatus() == HttpStatus.OK_200) { + final AbstractResponse rsp = (AbstractResponse) gson.fromJson(responseJson, responseType); + if (rsp == null) { + return (T) null; + } else if (rsp.errorCode == 0) { + return (T) rsp; + } else { + throw new MillheatCommunicationException(req, rsp); + } + } else { + throw new MillheatCommunicationException( + "Error sending request to Millheat server. Server responded with " + contentResponse.getStatus() + + " and payload " + responseJson); + } + } catch (InterruptedException | TimeoutException | ExecutionException e) { + throw new MillheatCommunicationException("Error sending request to Millheat server: " + e.getMessage(), e); + } + } + + public MillheatModel refreshModel() throws MillheatCommunicationException { + final MillheatModel model = new MillheatModel(System.currentTimeMillis()); + final GetHomesResponse homesRsp = sendLoggedInRequest(new GetHomesRequest(), GetHomesResponse.class); + for (final HomeDTO dto : homesRsp.homes) { + model.addHome(new Home(dto)); + } + for (final Home home : model.getHomes()) { + final SelectRoomByHomeResponse roomRsp = sendLoggedInRequest( + new SelectRoomByHomeRequest(home.getId(), home.getTimezone()), SelectRoomByHomeResponse.class); + for (final RoomDTO dto : roomRsp.rooms) { + home.addRoom(new Room(dto, home)); + } + + for (final Room room : home.getRooms()) { + final SelectDeviceByRoomResponse deviceRsp = sendLoggedInRequest( + new SelectDeviceByRoomRequest(room.getId(), home.getTimezone()), + SelectDeviceByRoomResponse.class); + for (final DeviceDTO dto : deviceRsp.devices) { + room.addHeater(new Heater(dto, room)); + } + } + final GetIndependentDevicesByHomeResponse independentRsp = sendLoggedInRequest( + new GetIndependentDevicesByHomeRequest(home.getId(), home.getTimezone()), + GetIndependentDevicesByHomeResponse.class); + for (final DeviceDTO dto : independentRsp.devices) { + home.addHeater(new Heater(dto)); + } + } + return model; + } + + /** + * Stops this thing's polling future + */ + @SuppressWarnings("null") + private void stopPolling() { + if (statusFuture != null && !statusFuture.isCancelled()) { + statusFuture.cancel(true); + statusFuture = null; + } + } + + public void updateModelFromServerWithRetry(boolean forceUpdate) { + if (allowModelUpdate() || forceUpdate) { + try { + updateModel(); + } catch (final MillheatCommunicationException e) { + try { + if (AbstractResponse.ERROR_CODE_ACCESS_TOKEN_EXPIRED == e.getErrorCode() + || AbstractResponse.ERROR_CODE_INVALID_SIGNATURE == e.getErrorCode() + || AbstractResponse.ERROR_CODE_AUTHENTICATION_FAILURE == e.getErrorCode()) { + logger.debug("Token expired, will refresh token, then retry state refresh", e); + if (doLogin()) { + updateModel(); + } + } else { + logger.debug("Initiating retry due to error {}", e.getMessage(), e); + updateModel(); + } + } catch (MillheatCommunicationException e1) { + logger.debug("Retry failed, waiting for next refresh cycle: {}", e.getMessage(), e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e1.getMessage()); + } + } + } + } + + private void updateModel() throws MillheatCommunicationException { + model = refreshModel(); + updateThingStatuses(); + updateStatus(ThingStatus.ONLINE); + } + + private void updateThingStatuses() { + final List<Thing> subThings = getThing().getThings(); + for (final Thing thing : subThings) { + final ThingHandler handler = thing.getHandler(); + if (handler != null) { + final MillheatBaseThingHandler mHandler = (MillheatBaseThingHandler) handler; + mHandler.updateState(model); + } + } + } + + private Request buildLoggedInRequest(final AbstractRequest req) + throws NoSuchAlgorithmException, UnsupportedEncodingException { + final String nonce = getRandomString(NUM_NONCE_CHARS); + final String timestamp = String.valueOf(System.currentTimeMillis() / 1000); + final String signatureBasis = REQUEST_TIMEOUT + timestamp + nonce + token; + final String signature = DigestUtils.shaHex(signatureBasis); + final String reqJson = gson.toJson(req); + + final Request request = httpClient.newRequest(serviceEndpoint + req.getRequestUrl()); + + return addStandardHeadersAndPayload(request, req).header("X-Zc-Timestamp", timestamp) + .header("X-Zc-Timeout", REQUEST_TIMEOUT).header("X-Zc-Nonce", nonce).header("X-Zc-User-Id", userId) + .header("X-Zc-User-Signature", signature).header("X-Zc-Content-Length", "" + reqJson.length()); + } + + private Request addStandardHeadersAndPayload(final Request req, final AbstractRequest payload) { + requestLogger.listenTo(req); + + return req.header("Connection", "Keep-Alive").header("X-Zc-Major-Domain", "seanywell") + .header("X-Zc-Msg-Name", "millService").header("X-Zc-Sub-Domain", "milltype").header("X-Zc-Seq-Id", "1") + .header("X-Zc-Version", "1").method(HttpMethod.POST).timeout(5, TimeUnit.SECONDS) + .content(new BytesContentProvider(gson.toJson(payload).getBytes(StandardCharsets.UTF_8)), CONTENT_TYPE); + } + + public void updateRoomTemperature(final Long roomId, final Command command, final ModeType mode) { + final Optional<Home> optionalHome = model.findHomeByRoomId(roomId); + final Optional<Room> optionalRoom = model.findRoomById(roomId); + if (optionalHome.isPresent() && optionalRoom.isPresent()) { + final SetRoomTempRequest req = new SetRoomTempRequest(optionalHome.get(), optionalRoom.get()); + if (command instanceof QuantityType<?>) { + final int newTemp = (int) ((QuantityType<?>) command).longValue(); + switch (mode) { + case SLEEP: + req.sleepTemp = newTemp; + break; + case AWAY: + req.awayTemp = newTemp; + break; + case COMFORT: + req.comfortTemp = newTemp; + break; + default: + logger.info("Cannot set room temp for mode {}", mode); + } + try { + sendLoggedInRequest(req, SetRoomTempResponse.class); + } catch (final MillheatCommunicationException e) { + logger.debug("Error updating temperature for room {}", roomId, e); + } + } else { + logger.debug("Error updating temperature for room {}, expected QuantityType but got {}", roomId, + command); + } + } + } + + public void updateIndependentHeaterProperties(@Nullable final String macAddress, @Nullable final Long heaterId, + @Nullable final Command temperatureCommand, @Nullable final Command masterOnOffCommand, + @Nullable final Command fanCommand) { + + model.findHeaterByMacOrId(macAddress, heaterId).ifPresent(heater -> { + int setTemp = heater.getTargetTemp(); + if (temperatureCommand instanceof QuantityType<?>) { + setTemp = (int) ((QuantityType<?>) temperatureCommand).longValue(); + } + boolean masterOnOff = heater.powerStatus(); + if (masterOnOffCommand != null) { + masterOnOff = masterOnOffCommand == OnOffType.ON; + } + boolean fanActive = heater.fanActive(); + if (fanCommand != null) { + fanActive = fanCommand == OnOffType.ON; + } + final SetDeviceTempRequest req = new SetDeviceTempRequest(heater, setTemp, masterOnOff, fanActive); + try { + sendLoggedInRequest(req, SetRoomTempResponse.class); + heater.setTargetTemp(setTemp); + heater.setPowerStatus(masterOnOff); + heater.setFanActive(fanActive); + } catch (final MillheatCommunicationException e) { + logger.debug("Error updating temperature for heater {}", macAddress, e); + } + }); + } + + public void updateVacationProperty(Home home, String property, Command command) { + + try { + switch (property) { + case SetHolidayParameterRequest.PROP_START: { + long epoch = ((DateTimeType) command).getZonedDateTime().toEpochSecond(); + SetHolidayParameterRequest req = new SetHolidayParameterRequest(home.getId(), home.getTimezone(), + SetHolidayParameterRequest.PROP_START, epoch); + if (sendLoggedInRequest(req, SetHolidayParameterResponse.class).isSuccess()) { + home.setVacationModeStart(epoch); + } + break; + } + case SetHolidayParameterRequest.PROP_END: { + long epoch = ((DateTimeType) command).getZonedDateTime().toEpochSecond(); + SetHolidayParameterRequest req = new SetHolidayParameterRequest(home.getId(), home.getTimezone(), + SetHolidayParameterRequest.PROP_END, epoch); + if (sendLoggedInRequest(req, SetHolidayParameterResponse.class).isSuccess()) { + home.setVacationModeEnd(epoch); + } + break; + } + case SetHolidayParameterRequest.PROP_TEMP: { + int holidayTemp = ((QuantityType<?>) command).intValue(); + SetHolidayParameterRequest req = new SetHolidayParameterRequest(home.getId(), home.getTimezone(), + SetHolidayParameterRequest.PROP_TEMP, holidayTemp); + if (sendLoggedInRequest(req, SetHolidayParameterResponse.class).isSuccess()) { + home.setHolidayTemp(holidayTemp); + } + break; + } + case SetHolidayParameterRequest.PROP_MODE_ADVANCED: { + if (home.getMode().getMode() == ModeType.VACATION) { + int value = OnOffType.ON == command ? 0 : 1; + SetHolidayParameterRequest req = new SetHolidayParameterRequest(home.getId(), + home.getTimezone(), SetHolidayParameterRequest.PROP_MODE_ADVANCED, value); + if (sendLoggedInRequest(req, SetHolidayParameterResponse.class).isSuccess()) { + home.setVacationModeAdvanced((OnOffType) command); + } + } else { + logger.debug("Must enable vaction mode before advanced vacation mode can be enabled"); + } + break; + } + case SetHolidayParameterRequest.PROP_MODE: { + if (home.getVacationModeStart() != null && home.getVacationModeEnd() != null) { + int value = OnOffType.ON == command ? 1 : 0; + SetHolidayParameterRequest req = new SetHolidayParameterRequest(home.getId(), + home.getTimezone(), SetHolidayParameterRequest.PROP_MODE, value); + if (sendLoggedInRequest(req, SetHolidayParameterResponse.class).isSuccess()) { + updateModelFromServerWithRetry(true); + } + } else { + logger.debug("Cannot enable vacation mode unless start and end time is already set"); + } + break; + } + } + } catch (MillheatCommunicationException e) { + logger.debug("Failure trying to set holiday properties: {}", e.getMessage()); + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatBaseThingHandler.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatBaseThingHandler.java new file mode 100644 index 0000000000000..b7a08b4911920 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatBaseThingHandler.java @@ -0,0 +1,73 @@ +/** + * 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.millheat.internal.handler; + +import java.util.Optional; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Base class for heater and room handlers + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public abstract class MillheatBaseThingHandler extends BaseThingHandler { + private final Logger logger = LoggerFactory.getLogger(MillheatBaseThingHandler.class); + + public MillheatBaseThingHandler(final Thing thing) { + super(thing); + } + + public void updateState(final MillheatModel model) { + for (final Channel channel : getThing().getChannels()) { + handleCommand(channel.getUID(), RefreshType.REFRESH, model); + } + } + + protected MillheatModel getMillheatModel() { + final Optional<MillheatAccountHandler> accountHandler = getAccountHandler(); + if (accountHandler.isPresent()) { + return accountHandler.get().getModel(); + } else { + logger.warn( + "Thing {} cannot exist without a bridge and account handler - returning empty model. No heaters or rooms will be found", + getThing().getUID()); + return new MillheatModel(0); + } + } + + protected Optional<MillheatAccountHandler> getAccountHandler() { + final Bridge bridge = getBridge(); + if (bridge != null) { + MillheatAccountHandler handler = (MillheatAccountHandler) bridge.getHandler(); + if (handler != null) { + return Optional.of(handler); + } + } + return Optional.empty(); + } + + protected abstract void handleCommand(ChannelUID uid, Command command, MillheatModel model); + +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHeaterHandler.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHeaterHandler.java new file mode 100644 index 0000000000000..b668c862766f1 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHeaterHandler.java @@ -0,0 +1,193 @@ +/** + * 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.millheat.internal.handler; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.OpenClosedType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.builder.ChannelBuilder; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.millheat.internal.MillheatBindingConstants; +import org.openhab.binding.millheat.internal.config.MillheatHeaterConfiguration; +import org.openhab.binding.millheat.internal.model.Heater; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MillheatHeaterHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatHeaterHandler extends MillheatBaseThingHandler { + private final Logger logger = LoggerFactory.getLogger(MillheatHeaterHandler.class); + private @NonNullByDefault({}) MillheatHeaterConfiguration config; + + public MillheatHeaterHandler(final Thing thing) { + super(thing); + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + handleCommand(channelUID, command, getMillheatModel()); + } + + @Override + protected void handleCommand(final ChannelUID channelUID, final Command command, final MillheatModel model) { + final Optional<Heater> optionalHeater = model.findHeaterByMacOrId(config.macAddress, config.heaterId); + if (optionalHeater.isPresent()) { + updateStatus(ThingStatus.ONLINE); + final Heater heater = optionalHeater.get(); + if (MillheatBindingConstants.CHANNEL_CURRENT_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(heater.getCurrentTemp(), SIUnits.CELSIUS)); + } + } else if (MillheatBindingConstants.CHANNEL_HEATING_ACTIVE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, heater.isHeatingActive() ? OnOffType.ON : OnOffType.OFF); + } + } else if (MillheatBindingConstants.CHANNEL_FAN_ACTIVE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, heater.fanActive() ? OnOffType.ON : OnOffType.OFF); + } else if (heater.canChangeTemp() && heater.getRoom() == null) { + updateIndependentHeaterProperties(null, null, command); + } else { + logger.debug("Heater {} cannot change temperature and is in a room", getThing().getUID()); + } + } else if (MillheatBindingConstants.CHANNEL_WINDOW_STATE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, heater.windowOpen() ? OpenClosedType.OPEN : OpenClosedType.CLOSED); + } + } else if (MillheatBindingConstants.CHANNEL_INDEPENDENT.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, heater.getRoom() == null ? OnOffType.ON : OnOffType.OFF); + } + } else if (MillheatBindingConstants.CHANNEL_CURRENT_POWER.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + if (config.power != null) { + if (heater.isHeatingActive()) { + updateState(channelUID, new QuantityType<>(config.power, SmartHomeUnits.WATT)); + } else { + updateState(channelUID, new QuantityType<>(0, SmartHomeUnits.WATT)); + } + } else { + updateState(channelUID, UnDefType.UNDEF); + logger.debug( + "Cannot update power for heater as the nominal power has not been configured for thing {}", + getThing().getUID()); + } + } + } else if (MillheatBindingConstants.CHANNEL_TARGET_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + if (heater.canChangeTemp() && heater.getTargetTemp() != null) { + updateState(channelUID, new QuantityType<>(heater.getTargetTemp(), SIUnits.CELSIUS)); + } else if (heater.getRoom() != null) { + final Integer targetTemperature = heater.getRoom().getTargetTemperature(); + if (targetTemperature != null) { + updateState(channelUID, new QuantityType<>(targetTemperature, SIUnits.CELSIUS)); + } else { + updateState(channelUID, UnDefType.UNDEF); + } + } else { + logger.debug( + "Heater {} is neither connected to a room nor marked as standalone. Someting is wrong, heater data: {}", + getThing().getUID(), heater); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR); + } + } else { + if (heater.canChangeTemp() && heater.getRoom() == null) { + updateIndependentHeaterProperties(command, null, null); + } + } + } else if (MillheatBindingConstants.CHANNEL_MASTER_SWITCH.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, heater.powerStatus() ? OnOffType.ON : OnOffType.OFF); + } else { + if (heater.canChangeTemp() && heater.getRoom() == null) { + updateIndependentHeaterProperties(null, command, null); + } else { + // Just overwrite with old state + updateState(channelUID, heater.powerStatus() ? OnOffType.ON : OnOffType.OFF); + } + } + } else { + logger.debug("Received command {} on channel {}, but this channel is not handled or supported by {}", + channelUID.getId(), command.toString(), this.getThing().getUID()); + } + } else { + updateStatus(ThingStatus.OFFLINE); + } + } + + private void updateIndependentHeaterProperties(@Nullable final Command temperatureCommand, + @Nullable final Command masterOnOffCommand, @Nullable final Command fanCommand) { + getAccountHandler().ifPresent(handler -> { + handler.updateIndependentHeaterProperties(config.macAddress, config.heaterId, temperatureCommand, + masterOnOffCommand, fanCommand); + }); + } + + @Override + public void initialize() { + config = getConfigAs(MillheatHeaterConfiguration.class); + logger.debug("Initializing Millheat heater using config {}", config); + if (config.heaterId == null && config.macAddress == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR); + } else { + final Optional<Heater> heater = getMillheatModel().findHeaterByMacOrId(config.macAddress, config.heaterId); + if (heater.isPresent()) { + addOptionalChannels(heater.get()); + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE); + } + } + } + + private void addOptionalChannels(final Heater heater) { + final List<Channel> newChannels = new ArrayList<>(); + newChannels.addAll(getThing().getChannels()); + if (heater.canChangeTemp() && heater.getRoom() == null) { + // Add power switch channel + newChannels + .add(ChannelBuilder + .create(new ChannelUID(getThing().getUID(), MillheatBindingConstants.CHANNEL_MASTER_SWITCH), + "Switch") + .withType(MillheatBindingConstants.CHANNEL_TYPE_MASTER_SWITCH_UID).build()); + // Add independent heater target temperature + newChannels.add(ChannelBuilder + .create(new ChannelUID(getThing().getUID(), MillheatBindingConstants.CHANNEL_TARGET_TEMPERATURE), + "Number:Temperature") + .withType(MillheatBindingConstants.CHANNEL_TYPE_TARGET_TEMPERATURE_HEATER_UID).build()); + } + + updateThing(editThing().withChannels(newChannels).build()); + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHomeHandler.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHomeHandler.java new file mode 100644 index 0000000000000..e95865f04a20f --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatHomeHandler.java @@ -0,0 +1,137 @@ +/** + * 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.millheat.internal.handler; + +import static org.openhab.binding.millheat.internal.MillheatBindingConstants.*; + +import java.time.ZoneId; +import java.util.Optional; + +import javax.measure.quantity.Temperature; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.millheat.internal.config.MillheatHomeConfiguration; +import org.openhab.binding.millheat.internal.dto.SetHolidayParameterRequest; +import org.openhab.binding.millheat.internal.model.Home; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.openhab.binding.millheat.internal.model.ModeType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MillheatHomeHandler} is responsible for handling home commands, for now vacation mode properties + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatHomeHandler extends MillheatBaseThingHandler { + private final Logger logger = LoggerFactory.getLogger(MillheatHomeHandler.class); + private @NonNullByDefault({}) MillheatHomeConfiguration config; + + public MillheatHomeHandler(final Thing thing) { + super(thing); + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + handleCommand(channelUID, command, getMillheatModel()); + } + + @Override + protected void handleCommand(final ChannelUID channelUID, final Command command, final MillheatModel model) { + final Optional<Home> optionalHome = model.findHomeById(config.homeId); + if (optionalHome.isPresent()) { + updateStatus(ThingStatus.ONLINE); + final Home home = optionalHome.get(); + if (CHANNEL_HOME_VACATION_TARGET_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(home.getHolidayTemp(), SIUnits.CELSIUS)); + } else if (command instanceof QuantityType<?>) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_TEMP, command); + } else if (command instanceof DecimalType) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_TEMP, + new QuantityType<Temperature>((DecimalType) command, SIUnits.CELSIUS)); + } + } else if (CHANNEL_HOME_VACATION_MODE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, OnOffType.from(home.getMode().getMode() == ModeType.VACATION)); + } else if (command instanceof OnOffType) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_MODE, command); + } + } else if (CHANNEL_HOME_VACATION_MODE_ADVANCED.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, OnOffType.from(home.isAdvancedVacationMode())); + } else if (command instanceof OnOffType) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_MODE_ADVANCED, command); + } + } else if (CHANNEL_HOME_VACATION_MODE_START.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + if (home.getVacationModeStart() != null) { + updateState(channelUID, + new DateTimeType(home.getVacationModeStart().atZone(ZoneId.systemDefault()))); + } else { + updateState(channelUID, UnDefType.UNDEF); + } + } else if (command instanceof DateTimeType) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_START, command); + } + } else if (CHANNEL_HOME_VACATION_MODE_END.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + if (home.getVacationModeEnd() != null) { + updateState(channelUID, + new DateTimeType(home.getVacationModeEnd().atZone(ZoneId.systemDefault()))); + } else { + updateState(channelUID, UnDefType.UNDEF); + } + } else if (command instanceof DateTimeType) { + updateVacationModeProperty(home, SetHolidayParameterRequest.PROP_END, command); + } + } else { + logger.debug("Received command {} on channel {}, but this channel is not handled or supported by {}", + channelUID.getId(), command.toString(), this.getThing().getUID()); + } + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE); + } + } + + private void updateVacationModeProperty(Home home, String property, Command command) { + getAccountHandler().ifPresent(handler -> { + handler.updateVacationProperty(home, property, command); + }); + } + + @Override + public void initialize() { + config = getConfigAs(MillheatHomeConfiguration.class); + logger.debug("Initializing Millheat home using config {}", config); + final Optional<Home> room = getMillheatModel().findHomeById(config.homeId); + if (room.isPresent()) { + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE); + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatRoomHandler.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatRoomHandler.java new file mode 100644 index 0000000000000..7d681cfd781bf --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/handler/MillheatRoomHandler.java @@ -0,0 +1,133 @@ +/** + * 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.millheat.internal.handler; + +import static org.openhab.binding.millheat.internal.MillheatBindingConstants.*; + +import java.util.Optional; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.millheat.internal.config.MillheatRoomConfiguration; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.openhab.binding.millheat.internal.model.ModeType; +import org.openhab.binding.millheat.internal.model.Room; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link MillheatRoomHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatRoomHandler extends MillheatBaseThingHandler { + private final Logger logger = LoggerFactory.getLogger(MillheatRoomHandler.class); + private @NonNullByDefault({}) MillheatRoomConfiguration config; + + public MillheatRoomHandler(final Thing thing) { + super(thing); + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + handleCommand(channelUID, command, getMillheatModel()); + } + + private void updateRoomTemperature(final Long roomId, final Command command, final ModeType modeType) { + getAccountHandler().ifPresent(handler -> { + handler.updateRoomTemperature(config.roomId, command, modeType); + }); + } + + @Override + protected void handleCommand(final ChannelUID channelUID, final Command command, final MillheatModel model) { + final Optional<Room> optionalRoom = model.findRoomById(config.roomId); + if (optionalRoom.isPresent()) { + updateStatus(ThingStatus.ONLINE); + final Room room = optionalRoom.get(); + if (CHANNEL_CURRENT_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(room.getCurrentTemp(), SIUnits.CELSIUS)); + } + } else if (CHANNEL_CURRENT_MODE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new StringType(room.getMode().toString())); + } + } else if (CHANNEL_PROGRAM.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new StringType(room.getRoomProgramName())); + } + } else if (CHANNEL_COMFORT_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(room.getComfortTemp(), SIUnits.CELSIUS)); + } else { + updateRoomTemperature(config.roomId, command, ModeType.COMFORT); + } + } else if (CHANNEL_SLEEP_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(room.getSleepTemp(), SIUnits.CELSIUS)); + } else { + updateRoomTemperature(config.roomId, command, ModeType.SLEEP); + } + } else if (CHANNEL_AWAY_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, new QuantityType<>(room.getAwayTemp(), SIUnits.CELSIUS)); + } else { + updateRoomTemperature(config.roomId, command, ModeType.AWAY); + } + } else if (CHANNEL_TARGET_TEMPERATURE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + final Integer targetTemperature = room.getTargetTemperature(); + if (targetTemperature != null) { + updateState(channelUID, new QuantityType<>(targetTemperature, SIUnits.CELSIUS)); + } else { + updateState(channelUID, UnDefType.UNDEF); + } + } + } else if (CHANNEL_HEATING_ACTIVE.equals(channelUID.getId())) { + if (command instanceof RefreshType) { + updateState(channelUID, room.isHeatingActive() ? OnOffType.ON : OnOffType.OFF); + } + } else { + logger.debug("Received command {} on channel {}, but this channel is not handled or supported by {}", + channelUID.getId(), command.toString(), this.getThing().getUID()); + } + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE); + } + } + + @Override + public void initialize() { + config = getConfigAs(MillheatRoomConfiguration.class); + logger.debug("Initializing Millheat room using config {}", config); + final Optional<Room> room = getMillheatModel().findRoomById(config.roomId); + if (room.isPresent()) { + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE); + } + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Heater.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Heater.java new file mode 100644 index 0000000000000..97e25c6f3644f --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Heater.java @@ -0,0 +1,150 @@ +/** + * 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.millheat.internal.model; + +import org.openhab.binding.millheat.internal.dto.DeviceDTO; + +/** + * The {@link Heater} represents a heater, either connected to a room or independent + * + * @author Arne Seime - Initial contribution + */ +public class Heater { + private Room room; + private final Long id; + private final String name; + private final String macAddress; + private final boolean heatingActive; + private boolean canChangeTemp = true; + private final int subDomain; + private final int currentTemp; + private Integer targetTemp; + private boolean fanActive; + private boolean powerStatus; + private final boolean windowOpen; + + public Heater(final DeviceDTO dto) { + id = dto.deviceId; + name = dto.deviceName; + macAddress = dto.macAddress; + heatingActive = dto.heaterFlag; + canChangeTemp = dto.holiday; + subDomain = dto.subDomainId; + currentTemp = (int) dto.currentTemp; + setTargetTemp(dto.holidayTemp); + setFanActive(dto.fanStatus); + setPowerStatus(dto.powerStatus); + windowOpen = dto.openWindow; + } + + public Heater(final DeviceDTO dto, final Room room) { + this.room = room; + id = dto.deviceId; + name = dto.deviceName; + macAddress = dto.macAddress; + heatingActive = dto.heaterFlag; + canChangeTemp = dto.canChangeTemp; + subDomain = dto.subDomainId; + currentTemp = (int) dto.currentTemp; + if (room != null && room.getMode() != null) { + switch (room.getMode()) { + case COMFORT: + setTargetTemp(room.getComfortTemp()); + break; + case SLEEP: + setTargetTemp(room.getSleepTemp()); + break; + case AWAY: + setTargetTemp(room.getAwayTemp()); + break; + case OFF: + setTargetTemp(null); + break; + default: + // NOOP + } + } + setFanActive(dto.fanStatus); + setPowerStatus(dto.powerStatus); + windowOpen = dto.openWindow; + } + + @Override + public String toString() { + return "Heater [room=" + room + ", id=" + id + ", name=" + name + ", macAddress=" + macAddress + + ", heatingActive=" + heatingActive + ", canChangeTemp=" + canChangeTemp + ", subDomain=" + subDomain + + ", currentTemp=" + currentTemp + ", targetTemp=" + getTargetTemp() + ", fanActive=" + fanActive() + + ", powerStatus=" + powerStatus() + ", windowOpen=" + windowOpen + "]"; + } + + public Room getRoom() { + return room; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public String getMacAddress() { + return macAddress; + } + + public boolean isHeatingActive() { + return heatingActive; + } + + public boolean canChangeTemp() { + return canChangeTemp; + } + + public int getSubDomain() { + return subDomain; + } + + public int getCurrentTemp() { + return currentTemp; + } + + public Integer getTargetTemp() { + return targetTemp; + } + + public boolean fanActive() { + return fanActive; + } + + public boolean powerStatus() { + return powerStatus; + } + + public boolean windowOpen() { + return windowOpen; + } + + public void setTargetTemp(final Integer targetTemp) { + this.targetTemp = targetTemp; + } + + public void setFanActive(final boolean fanActive) { + this.fanActive = fanActive; + } + + public void setPowerStatus(final boolean powerStatus) { + this.powerStatus = powerStatus; + } + +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Home.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Home.java new file mode 100644 index 0000000000000..065ccc5bea630 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Home.java @@ -0,0 +1,163 @@ +/** + * 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.millheat.internal.model; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.openhab.binding.millheat.internal.dto.HomeDTO; + +/** + * The {@link Home} represents a home + * + * @author Arne Seime - Initial contribution + */ +public class Home { + private final long id; + private final String name; + private final int type; + private final String zoneOffset; + private int holidayTemp; + private Mode mode; + private final String program = null; + private final List<Room> rooms = new ArrayList<>(); + private final List<Heater> independentHeaters = new ArrayList<>(); + private LocalDateTime vacationModeStart; + private LocalDateTime vacationModeEnd; + private boolean advancedVacationMode; + + public Home(final HomeDTO dto) { + id = dto.homeId; + name = dto.name; + type = dto.homeType; + zoneOffset = dto.timeZone; + holidayTemp = dto.holidayTemp; + advancedVacationMode = dto.holidayTempType == 0; + if (dto.holidayStartTime != 0) { + vacationModeStart = convertFromEpoch(dto.holidayStartTime); + } + if (dto.holidayEndTime != 0) { + vacationModeEnd = convertFromEpoch(dto.holidayEndTime); + } + + if (dto.holiday) { + mode = new Mode(ModeType.VACATION, vacationModeStart, vacationModeEnd); + } else if (dto.alwaysHome) { + mode = new Mode(ModeType.ALWAYSHOME, null, null); + } else { + final LocalDateTime modeStart = LocalDateTime.ofEpochSecond(dto.modeStartTime, 0, + ZoneOffset.of(zoneOffset)); + final LocalDateTime modeEnd = modeStart.withHour(dto.modeHour).withMinute(dto.modeMinute); + mode = new Mode(ModeType.valueOf(dto.currentMode), modeStart, modeEnd); + } + } + + private LocalDateTime convertFromEpoch(long epoch) { + return LocalDateTime.ofEpochSecond(epoch, 0, ZoneOffset.of(zoneOffset)); + } + + public void addRoom(final Room room) { + rooms.add(room); + } + + public void addHeater(final Heater heater) { + independentHeaters.add(heater); + } + + @Override + public String toString() { + return "Home [id=" + id + ", name=" + name + ", type=" + type + ", zoneOffset=" + zoneOffset + ", holidayTemp=" + + holidayTemp + ", mode=" + mode + ", rooms=" + rooms + ", independentHeaters=" + independentHeaters + + ", program=" + program + "]"; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public int getType() { + return type; + } + + public String getTimezone() { + return zoneOffset; + } + + public int getHolidayTemp() { + return holidayTemp; + } + + public Mode getMode() { + return mode; + } + + public String getProgram() { + return program; + } + + public List<Room> getRooms() { + return rooms; + } + + public List<Heater> getIndependentHeaters() { + return independentHeaters; + } + + public LocalDateTime getVacationModeStart() { + return vacationModeStart; + } + + public LocalDateTime getVacationModeEnd() { + return vacationModeEnd; + } + + public void setVacationModeStart(long epoch) { + vacationModeStart = convertFromEpoch(epoch); + updateVacationMode(); + } + + public void setVacationModeEnd(long epoch) { + vacationModeEnd = convertFromEpoch(epoch); + updateVacationMode(); + } + + public void setHolidayTemp(int holidayTemp) { + this.holidayTemp = holidayTemp; + updateVacationMode(); + } + + private void updateVacationMode() { + if (mode.getMode() == ModeType.VACATION) { + mode = new Mode(ModeType.VACATION, vacationModeStart, vacationModeEnd); + } + } + + public void setVacationModeAdvanced(OnOffType command) { + advancedVacationMode = (OnOffType.ON == command); + } + + public boolean isAdvancedVacationMode() { + return advancedVacationMode; + } + + public void setAdvancedVacationMode(boolean advancedVacationMode) { + this.advancedVacationMode = advancedVacationMode; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/MillheatModel.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/MillheatModel.java new file mode 100644 index 0000000000000..e2b128f73ef10 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/MillheatModel.java @@ -0,0 +1,94 @@ +/** + * 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.millheat.internal.model; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link MillheatModel} represents the home structure as designed by the user in the Millheat app. + * + * @author Arne Seime - Initial contribution + */ +@NonNullByDefault +public class MillheatModel { + private final long lastUpdated; + private final List<Home> homes = new ArrayList<>(); + + public MillheatModel(final long lastUpdated) { + this.lastUpdated = lastUpdated; + } + + public void addHome(final Home home) { + homes.add(home); + } + + public List<Home> getHomes() { + return homes; + } + + public long getLastUpdated() { + return lastUpdated; + } + + public Optional<Heater> findHeaterById(final Long id) { + return findHeaters().filter(heater -> id.equals(heater.getId())).findFirst(); + } + + public Optional<Heater> findHeaterByMac(final String macAddress) { + return findHeaters().filter(heater -> macAddress.equals(heater.getMacAddress())).findFirst(); + } + + public Optional<Heater> findHeaterByMacOrId(@Nullable final String macAddress, @Nullable final Long id) { + Optional<Heater> heater = Optional.empty(); + + if (macAddress != null) { + heater = findHeaterByMac(macAddress); + } + if (!heater.isPresent() && id != null) { + heater = findHeaterById(id); + } + return heater; + } + + private Stream<Heater> findHeaters() { + return Stream.concat( + homes.stream().flatMap(home -> home.getRooms().stream()).flatMap(room -> room.getHeaters().stream()), + homes.stream().flatMap(room -> room.getIndependentHeaters().stream())); + } + + public Optional<Room> findRoomById(final Long id) { + return homes.stream().flatMap(home -> home.getRooms().stream()).filter(room -> id.equals(room.getId())) + .findFirst(); + } + + public Optional<Home> findHomeByRoomId(final Long id) { + for (final Home home : homes) { + for (final Room room : home.getRooms()) { + if (id.equals(room.getId())) { + return Optional.of(home); + } + } + } + return Optional.empty(); + } + + public Optional<Home> findHomeById(Long homeId) { + return homes.stream().filter(e -> e.getId().equals(homeId)).findFirst(); + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Mode.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Mode.java new file mode 100644 index 0000000000000..0f6e92bb0e2ab --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Mode.java @@ -0,0 +1,44 @@ +/** + * 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.millheat.internal.model; + +import java.time.LocalDateTime; + +/** + * The {@link Mode} represents a mode with start and end time + * + * @author Arne Seime - Initial contribution + */ +public class Mode { + private final ModeType mode; + private final LocalDateTime start; + private final LocalDateTime end; + + public Mode(final ModeType mode, final LocalDateTime start, final LocalDateTime end) { + this.mode = mode; + this.start = start; + this.end = end; + } + + public ModeType getMode() { + return mode; + } + + public LocalDateTime getStart() { + return start; + } + + public LocalDateTime getEnd() { + return end; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/ModeType.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/ModeType.java new file mode 100644 index 0000000000000..851a77b79b8b4 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/ModeType.java @@ -0,0 +1,46 @@ +/** + * 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.millheat.internal.model; + +/** + * The {@link ModeType} represents a type of mode the user can set in the app. + * + * @author Arne Seime - Initial contribution + */ +public enum ModeType { + ALWAYSHOME(-1), + COMFORT(1), + SLEEP(2), + AWAY(3), + VACATION(4), + OFF(5); + + public static ModeType valueOf(final int modeVal) { + for (final ModeType mode : ModeType.values()) { + if (mode.value == modeVal) { + return mode; + } + } + return null; + } + + private final int value; + + ModeType(final int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Room.java b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Room.java new file mode 100644 index 0000000000000..e7f801d6ec9e9 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/java/org/openhab/binding/millheat/internal/model/Room.java @@ -0,0 +1,123 @@ +/** + * 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.millheat.internal.model; + +import java.util.ArrayList; +import java.util.List; + +import org.openhab.binding.millheat.internal.dto.RoomDTO; + +/** + * The {@link Room} represents a room in a home as designed by the end user in the Millheat app. + * + * @author Arne Seime - Initial contribution + */ +public class Room { + private final Home home; + private final long id; + private final String name; + private final int currentTemp; + private final int comfortTemp; + private final int sleepTemp; + private final int awayTemp; + private final boolean heatingActive; + private final ModeType mode; + private final String roomProgramName; + private final List<Heater> heaters = new ArrayList<>(); + + public Room(final RoomDTO dto, final Home home) { + this.home = home; + id = dto.roomId; + name = dto.name; + currentTemp = (int) dto.currentTemp; + comfortTemp = dto.comfortTemp; + sleepTemp = dto.sleepTemp; + awayTemp = dto.awayTemp; + heatingActive = dto.heatStatus; + mode = ModeType.valueOf(dto.currentMode); + roomProgramName = dto.roomProgram; + } + + public void addHeater(final Heater h) { + heaters.add(h); + } + + public List<Heater> getHeaters() { + return heaters; + } + + public Integer getTargetTemperature() { + switch (mode) { + case VACATION: + return home.getHolidayTemp(); + case SLEEP: + return sleepTemp; + case COMFORT: + return comfortTemp; + case AWAY: + return awayTemp; + case OFF: + case ALWAYSHOME: + default: + return null; + } + } + + @Override + public String toString() { + return "Room [home=" + home.getId() + ", id=" + id + ", name=" + name + ", currentTemp=" + currentTemp + + ", comfortTemp=" + comfortTemp + ", sleepTemp=" + sleepTemp + ", awayTemp=" + awayTemp + + ", heatingActive=" + heatingActive + ", mode=" + mode + ", roomProgramName=" + roomProgramName + + ", heaters=" + heaters + "]"; + } + + public Home getHome() { + return home; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public int getCurrentTemp() { + return currentTemp; + } + + public int getComfortTemp() { + return comfortTemp; + } + + public int getSleepTemp() { + return sleepTemp; + } + + public int getAwayTemp() { + return awayTemp; + } + + public boolean isHeatingActive() { + return heatingActive; + } + + public ModeType getMode() { + return mode; + } + + public String getRoomProgramName() { + return roomProgramName; + } +} diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..03fe45fb77d49 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="millheat" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Millheat Binding</name> + <description>This is the binding for Mill Heat Wi-Fi enabled heaters. See https://www.millheat.com/mill-wifi/</description> + <author>Arne Seime</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/config/config.xml new file mode 100644 index 0000000000000..94baac1f1627e --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/config/config.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 + https://openhab.org/schemas/config-description-1.0.0.xsd"> + + <config-description uri="thing-type:millheat:account"> + <parameter name="username" type="text" required="true"> + <label>Username</label> + <description>Your Millheat app username (email)</description> + </parameter> + + <parameter name="password" type="text" required="true"> + <label>Password</label> + <description>Your Millheat app password</description> + <context>password</context> + </parameter> + + <parameter name="refreshInterval" type="integer" min="30" unit="s"> + <label>Refresh Interval</label> + <description>Specifies the refresh time in seconds for polling temperature updates from Millheat service</description> + <default>120</default> + </parameter> + + </config-description> + + <config-description uri="thing-type:millheat:heater"> + <parameter name="macAddress" type="text"> + <label>MAC Address</label> + <description>Either MAC address or heaterId is required</description> + </parameter> + <parameter name="heaterId" type="integer"> + <label>Heater ID</label> + <description>Either MAC address or heaterId is required</description> + </parameter> + <parameter name="power" type="integer"> + <label>Heating Power</label> + <description>Number of watts this heater is consuming when it is heating. This value is sent to the currentPower + channel when the heater is heating in order to track energy usage</description> + </parameter> + </config-description> + + <config-description uri="thing-type:millheat:room"> + <parameter name="roomId" type="integer" required="true"> + <label>Room ID</label> + </parameter> + </config-description> + + <config-description uri="thing-type:millheat:home"> + <parameter name="homeId" type="integer" required="true"> + <label>Home ID</label> + </parameter> + </config-description> + +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/account.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/account.xml new file mode 100644 index 0000000000000..7be0121466040 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/account.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="millheat" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <bridge-type id="account"> + <label>Mill Heating API</label> + <description>This bridge represents the gateway to Mill Heating API</description> + <config-description-ref uri="thing-type:millheat:account" /> + </bridge-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..1f77a939ba81c --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="millheat" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-type id="currentTemperature"> + <item-type>Number:Temperature</item-type> + <label>Current Temperature</label> + <category>Temperature</category> + <tags> + <tag>CurrentTemperature</tag> + </tags> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + <channel-type id="comfortTemperature"> + <item-type>Number:Temperature</item-type> + <label>Temperature Comfort Mode</label> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="sleepTemperature"> + <item-type>Number:Temperature</item-type> + <label>Temperature Sleep Mode</label> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="awayTemperature"> + <item-type>Number:Temperature</item-type> + <label>Temperature Away Mode</label> + <description>Set temperature away mode</description> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="targetTemperatureHeater"> + <item-type>Number:Temperature</item-type> + <label>Target Temperature</label> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="targetTemperatureRoom"> + <item-type>Number:Temperature</item-type> + <label>Target Temperature</label> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" readOnly="true" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="heatingActive"> + <item-type>Switch</item-type> + <label>Heating Active</label> + <description>Current state of the heater or heaters in room</description> + <category>Energy</category> + <state readOnly="true" /> + </channel-type> + <channel-type id="independent"> + <item-type>Switch</item-type> + <label>Independent Heater</label> + <description>ON if heater is an independent heater and not connected to a room</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="masterSwitch"> + <item-type>Switch</item-type> + <label>Master Switch</label> + <description>Master ON/OFF switch for independent heater</description> + </channel-type> + <channel-type id="fanActive"> + <item-type>Switch</item-type> + <label>Fan Active</label> + <description>Current state of heater fan (if available, OFF if not found)</description> + <category>Flow</category> + </channel-type> + <channel-type id="window"> + <item-type>Contact</item-type> + <label>Window State</label> + <description>Open window/cold air flow detection</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="currentEnergy"> + <item-type>Number:Power</item-type> + <label>Energy Usage</label> + <description>Actual energy usage in watts</description> + <category>Energy</category> + <state readOnly="true" pattern="%d W"></state> + </channel-type> + <channel-type id="currentMode"> + <item-type>String</item-type> + <label>Current Room Program Mode</label> + <state readOnly="true"> + <options> + <option value="Comfort">Comfort</option> + <option value="Sleep">Sleep</option> + <option value="Away">Away</option> + <option value="Off">Off</option> + <option value="AdvancedAway">Vacation away</option> + </options> + </state> + </channel-type> + <channel-type id="program"> + <item-type>String</item-type> + <label>Program</label> + <description>Program associated with room</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="vacationModeTargetTemperature"> + <item-type>Number:Temperature</item-type> + <label>Target Temperature Vacation</label> + <category>Heating</category> + <tags> + <tag>TargetTemperature</tag> + </tags> + <state pattern="%d %unit%" min="5" max="35" step="1" /> + </channel-type> + <channel-type id="vacationMode"> + <item-type>Switch</item-type> + <label>Vacation Mode</label> + <description>Toggles vacation mode. Start and end time must be preset before activating</description> + </channel-type> + <channel-type id="vacationModeAdvanced"> + <item-type>Switch</item-type> + <label>Advanced Vacation Mode</label> + <description>Use room Away mode temperatures instead of home global temperature</description> + </channel-type> + <channel-type id="vacationModeStart"> + <item-type>DateTime</item-type> + <label>Start of Vacation</label> + </channel-type> + <channel-type id="vacationModeEnd"> + <item-type>DateTime</item-type> + <label>End of Vacation</label> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/heater.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/heater.xml new file mode 100644 index 0000000000000..9ec2fcdb3def2 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/heater.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="millheat" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="heater"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Wi-Fi Enabled Heater</label> + + <channels> + <channel id="currentTemperature" typeId="currentTemperature" /> + <channel id="heatingActive" typeId="heatingActive" /> + <channel id="fanActive" typeId="fanActive" /> + <channel id="currentEnergy" typeId="currentEnergy" /> + <channel id="independent" typeId="independent" /> + <channel id="window" typeId="window" /> + </channels> + + <representation-property>macAddress</representation-property> + <config-description-ref uri="thing-type:millheat:heater" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/home.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/home.xml new file mode 100644 index 0000000000000..f6de2c87cce9e --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/home.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="millheat" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="home"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Home</label> + + <channels> + <channel id="vacationModeTargetTemperature" typeId="vacationModeTargetTemperature" /> + <channel id="vacationMode" typeId="vacationMode" /> + <channel id="vacationModeAdvanced" typeId="vacationModeAdvanced" /> + <channel id="vacationModeStart" typeId="vacationModeStart" /> + <channel id="vacationModeEnd" typeId="vacationModeEnd" /> + </channels> + + <representation-property>homeId</representation-property> + <config-description-ref uri="thing-type:millheat:home" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/room.xml b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/room.xml new file mode 100644 index 0000000000000..be21f67762d79 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/main/resources/ESH-INF/thing/room.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="millheat" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="room"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Room with one or more Wi-Fi enabled heaters</label> + + <channels> + <channel id="currentTemperature" typeId="currentTemperature" /> + <channel id="targetTemperature" typeId="targetTemperatureRoom" /> + <channel id="comfortTemperature" typeId="comfortTemperature" /> + <channel id="sleepTemperature" typeId="sleepTemperature" /> + <channel id="awayTemperature" typeId="awayTemperature" /> + <channel id="heatingActive" typeId="heatingActive" /> + <channel id="currentMode" typeId="currentMode" /> + <channel id="program" typeId="program" /> + </channels> + + <representation-property>roomId</representation-property> + <config-description-ref uri="thing-type:millheat:room" /> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.millheat/src/test/java/org/openhab/binding/millheat/internal/MillHeatAccountHandlerTest.java b/bundles/org.openhab.binding.millheat/src/test/java/org/openhab/binding/millheat/internal/MillHeatAccountHandlerTest.java new file mode 100644 index 0000000000000..1fa7da159fa97 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/java/org/openhab/binding/millheat/internal/MillHeatAccountHandlerTest.java @@ -0,0 +1,110 @@ +/** + * 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.millheat.internal; + +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +import java.io.IOException; + +import org.apache.commons.io.IOUtils; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openhab.binding.millheat.internal.config.MillheatAccountConfiguration; +import org.openhab.binding.millheat.internal.handler.MillheatAccountHandler; +import org.openhab.binding.millheat.internal.model.MillheatModel; +import org.osgi.framework.BundleContext; + +import com.github.tomakehurst.wiremock.core.WireMockConfiguration; +import com.github.tomakehurst.wiremock.junit.WireMockRule; + +/** + * @author Arne Seime - Initial contribution + */ +public class MillHeatAccountHandlerTest { + @Rule + public WireMockRule wireMockRule = new WireMockRule(WireMockConfiguration.options().dynamicPort()); + + @Mock + private Bridge millheatAccountMock; + + private HttpClient httpClient; + @Mock + private Configuration configuration; + + @Mock + private BundleContext bundleContext; + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + httpClient = new HttpClient(); + httpClient.start(); + MillheatAccountHandler.authEndpoint = "http://localhost:" + wireMockRule.port() + "/zc-account/v1/"; + MillheatAccountHandler.serviceEndpoint = "http://localhost:" + wireMockRule.port() + "/millService/v1/"; + } + + @After + public void shutdown() throws Exception { + httpClient.stop(); + } + + @Test + public void testUpdateModel() throws InterruptedException, IOException, MillheatCommunicationException { + + final String getHomesResponse = IOUtils.toString(getClass().getResourceAsStream("/select_home_list_ok.json")); + final String getRoomsByHomeResponse = IOUtils + .toString(getClass().getResourceAsStream("/get_rooms_by_home_ok.json")); + final String getDeviceByRoomResponse = IOUtils + .toString(getClass().getResourceAsStream("/get_device_by_room_ok.json")); + final String getIndependentDevicesResponse = IOUtils + .toString(getClass().getResourceAsStream("/get_independent_devices_ok.json")); + + stubFor(post(urlEqualTo("/millService/v1/selectHomeList")) + .willReturn(aResponse().withStatus(200).withBody(getHomesResponse))); + stubFor(post(urlEqualTo("/millService/v1/selectRoombyHome")) + .willReturn(aResponse().withStatus(200).withBody(getRoomsByHomeResponse))); + stubFor(post(urlEqualTo("/millService/v1/selectDevicebyRoom")) + .willReturn(aResponse().withStatus(200).withBody(getDeviceByRoomResponse))); + stubFor(post(urlEqualTo("/millService/v1/getIndependentDevices")) + .willReturn(aResponse().withStatus(200).withBody(getIndependentDevicesResponse))); + + when(millheatAccountMock.getConfiguration()).thenReturn(configuration); + when(millheatAccountMock.getUID()).thenReturn(new ThingUID("millheat:account:thinguid")); + + final MillheatAccountConfiguration accountConfig = new MillheatAccountConfiguration(); + accountConfig.username = "username"; + accountConfig.password = "password"; + when(configuration.as(eq(MillheatAccountConfiguration.class))).thenReturn(accountConfig); + + final MillheatAccountHandler subject = new MillheatAccountHandler(millheatAccountMock, httpClient, + bundleContext); + MillheatModel model = subject.refreshModel(); + Assert.assertEquals(1, model.getHomes().size()); + + verify(postRequestedFor(urlMatching("/millService/v1/selectHomeList"))); + verify(postRequestedFor(urlMatching("/millService/v1/selectRoombyHome"))); + verify(postRequestedFor(urlMatching("/millService/v1/selectDevicebyRoom"))); + verify(postRequestedFor(urlMatching("/millService/v1/getIndependentDevices"))); + } +} diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/get_device_by_room_ok.json b/bundles/org.openhab.binding.millheat/src/test/resources/get_device_by_room_ok.json new file mode 100644 index 0000000000000..d11f8a33341ad --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/get_device_by_room_ok.json @@ -0,0 +1,36 @@ +{ + "always": 0, + "backMinute": 0, + "roomProgramId": 3242342342324, + "controlSource": "0,0,0", + "comfortTemp": 20, + "roomProgram": "Kontor", + "awayTemp": 10, + "holidayTemp": 10, + "avgTemp": 15.0, + "roomId": 23423423423423, + "roomName": "Kontor", + "deviceInfo": [ + { + "heaterFlag": 0, + "subDomainId": 242424, + "controlType": 0, + "currentTemp": 15.0, + "canChangeTemp": 0, + "deviceId": 12334, + "deviceName": "Kontor", + "mac": "F0XXXXXXXXX", + "deviceStatus": 0 + } + ], + "backHour": 0, + "currentMode": 4, + "heatStatus": 0, + "offLineDeviceNum": 0, + "total": 1, + "independentCount": 0, + "sleepTemp": 13, + "onlineDeviceNum": 1, + "isOffline": 1, + "programMode": 0 +} diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/get_independent_devices_ok.json b/bundles/org.openhab.binding.millheat/src/test/resources/get_independent_devices_ok.json new file mode 100644 index 0000000000000..b099d240accc3 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/get_independent_devices_ok.json @@ -0,0 +1,3 @@ +{ + "deviceInfo": [] +} diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/get_rooms_by_home_ok.json b/bundles/org.openhab.binding.millheat/src/test/resources/get_rooms_by_home_ok.json new file mode 100644 index 0000000000000..16c24cebe6715 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/get_rooms_by_home_ok.json @@ -0,0 +1,81 @@ +{ + "backMinute": 0, + "offLineDeviceNum": 0, + "mode": 0, + "homeAlways": 0, + "homeName": "Hjemme", + "isHoliday": 0, + "onlineDeviceNum": 3, + "programList": [ + { + "programName": "Standard Program", + "homeId": 20190260000, + "programId": 20190260000 + }, + { + "programName": "Barnerom", + "homeId": 20190260000, + "programId": 20171231209984 + }, + { + "programName": "Kontor", + "homeId": 20190260000, + "programId": 2019129984 + } + ], + "homeType": 0, + "backHour": 0, + "roomInfo": [ + { + "controlSource": "0,0,0", + "comfortTemp": 20, + "roomProgram": "Barnerom", + "awayTemp": 10, + "avgTemp": 19.0, + "roomId": 201900000, + "roomName": "Bedroom1", + "currentMode": 2, + "heatStatus": 0, + "offLineDeviceNum": 0, + "total": 1, + "independentCount": 0, + "sleepTemp": 18, + "onlineDeviceNum": 1, + "isOffline": 1 + }, + { + "controlSource": "0,0,0", + "comfortTemp": 20, + "roomProgram": "Barnerom", + "awayTemp": 10, + "avgTemp": 19.0, + "roomId": 20190207000, + "roomName": "Bedroom2", + "currentMode": 2, + "heatStatus": 0, + "offLineDeviceNum": 0, + "total": 1, + "independentCount": 0, + "sleepTemp": 17, + "onlineDeviceNum": 1, + "isOffline": 1 + }, + { + "controlSource": "0,0,0", + "comfortTemp": 20, + "roomProgram": "Kontor", + "awayTemp": 10, + "avgTemp": 16.0, + "roomId": 20190000, + "roomName": "Kontor", + "currentMode": 5, + "heatStatus": 0, + "offLineDeviceNum": 0, + "total": 1, + "independentCount": 0, + "sleepTemp": 13, + "onlineDeviceNum": 1, + "isOffline": 1 + } + ] +} diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/login_response_error.json b/bundles/org.openhab.binding.millheat/src/test/resources/login_response_error.json new file mode 100644 index 0000000000000..5285fa9f7d539 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/login_response_error.json @@ -0,0 +1,5 @@ +{ + "description": "password is not set", + "error": "invalid param", + "errorCode": 3002 +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/login_response_ok.json b/bundles/org.openhab.binding.millheat/src/test/resources/login_response_ok.json new file mode 100644 index 0000000000000..d16a9956872d7 --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/login_response_ok.json @@ -0,0 +1,14 @@ +{ + "email": "email@gmail.com", + "nickName": "Nikky", + "phone": "", + "refreshToken": "refreshToken", + "refreshTokenExpire": "2019-03-20 18:13:30", + "token": "token", + "tokenExpire": "2019-02-18 20:13:30", + "userId": 234324, + "userProfile": { + "nick_name": "Nikky", + "privacyPolicy": 1 + } +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.millheat/src/test/resources/select_home_list_ok.json b/bundles/org.openhab.binding.millheat/src/test/resources/select_home_list_ok.json new file mode 100644 index 0000000000000..7e55cbc6f771d --- /dev/null +++ b/bundles/org.openhab.binding.millheat/src/test/resources/select_home_list_ok.json @@ -0,0 +1,21 @@ +{ + "hourSystem": 1, + "homeList": [ + { + "homeAlways": 0, + "homeName": "Hjemme", + "isHoliday": 0, + "holidayStartTime": 1549145440, + "timeZone": "+01:00", + "modeMinute": 0, + "modeStartTime": 0, + "holidayTemp": 10, + "modeHour": 0, + "currentMode": 0, + "holidayEndTime": 1549875200, + "homeType": 0, + "homeId": 2019000, + "programId": 201960000 + } + ] +} \ No newline at end of file diff --git a/bundles/org.openhab.binding.minecraft/NOTICE b/bundles/org.openhab.binding.minecraft/NOTICE index 3725a9db7ba7b..a0a9c302a8e33 100644 --- a/bundles/org.openhab.binding.minecraft/NOTICE +++ b/bundles/org.openhab.binding.minecraft/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.minecraft/pom.xml b/bundles/org.openhab.binding.minecraft/pom.xml index 4f422e5cc82ac..5cd0d5afc25e3 100644 --- a/bundles/org.openhab.binding.minecraft/pom.xml +++ b/bundles/org.openhab.binding.minecraft/pom.xml @@ -1,30 +1,33 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.minecraft</artifactId> <name>openHAB Add-ons :: Bundles :: Minecraft Binding</name> + <properties> + <bnd.importpackage>org.apache.http.conn.ssl;resolution:="optional"</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>io.reactivex</groupId> <artifactId>rxjava</artifactId> <version>1.1.7</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>com.firebase.tubesock</artifactId> + <groupId>com.firebase</groupId> + <artifactId>tubesock</artifactId> <version>0.0.1</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.minecraft/src/main/feature/feature.xml b/bundles/org.openhab.binding.minecraft/src/main/feature/feature.xml index 2349095af24ad..a18138eda5803 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.minecraft/src/main/feature/feature.xml @@ -1,12 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.minecraft-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-minecraft" description="Minecraft Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-mdns</feature> - <bundle dependency="true">mvn:io.reactivex/rxjava/1.1.7</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/com.firebase.tubesock/0.0.1</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.minecraft/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftBindingConstants.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftBindingConstants.java index e90497c72d666..18aea4c65a5ab 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftBindingConstants.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftHandlerFactory.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftHandlerFactory.java index a06e7dea20412..f077d652725ee 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftHandlerFactory.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/MinecraftHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/PlayerConfig.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/PlayerConfig.java index 3b2b2f6fa77e5..1e5a4f18998f4 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/PlayerConfig.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/PlayerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/ServerConfig.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/ServerConfig.java index 224e14b0b5ee5..b54424c5b11de 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/ServerConfig.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/ServerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/SignConfig.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/SignConfig.java index 1b74156591a2c..cf24db3bbbd05 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/SignConfig.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/config/SignConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftDiscoveryService.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftDiscoveryService.java index f88e32faeb4ad..fa2db12736356 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftDiscoveryService.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftMDNSDiscoveryParticipant.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftMDNSDiscoveryParticipant.java index 4d48a99f0f34a..ea782ee720e10 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftMDNSDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/discovery/MinecraftMDNSDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftPlayerHandler.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftPlayerHandler.java index 4f0edc9b344f9..c9ed0c03ee3c4 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftPlayerHandler.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftPlayerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftServerHandler.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftServerHandler.java index 10ae2fc91a192..355e956155519 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftServerHandler.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftServerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftSignHandler.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftSignHandler.java index 538cdf82de440..cba66207f530a 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftSignHandler.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/handler/MinecraftSignHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/OHMessage.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/OHMessage.java index 6b020fc8a7cf3..79624003c30ca 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/OHMessage.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/OHMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/LocationData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/LocationData.java index 5dac5fdffb64f..216b04a48d1a2 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/LocationData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/LocationData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/PlayerData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/PlayerData.java index a2c201a28a8fc..13c8468a524d7 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/PlayerData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/PlayerData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/ServerData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/ServerData.java index 7d532e199ec3c..7a47025f98756 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/ServerData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/ServerData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/SignData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/SignData.java index 4956707c01bf8..418b7162ff7e5 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/SignData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/SignData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/PlayerCommandData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/PlayerCommandData.java index 2c188905b0cb6..2706943cb2f6b 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/PlayerCommandData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/PlayerCommandData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/SignCommandData.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/SignCommandData.java index 38bc054e48f21..67e7f1bd3c429 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/SignCommandData.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/message/data/commands/SignCommandData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/MinecraftSocketHandler.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/MinecraftSocketHandler.java index 350d4c69a28b8..57ea85c80d457 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/MinecraftSocketHandler.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/MinecraftSocketHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/ServerConnection.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/ServerConnection.java index eff9650ac086e..91891b0fde663 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/ServerConnection.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/server/ServerConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/Pair.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/Pair.java index e12982425280f..b3bad225c8ffb 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/Pair.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/Pair.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/RetryWithDelay.java b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/RetryWithDelay.java index ec1c5d0dade82..0351e31326191 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/RetryWithDelay.java +++ b/bundles/org.openhab.binding.minecraft/src/main/java/org/openhab/binding/minecraft/internal/util/RetryWithDelay.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.minecraft/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.minecraft/src/main/resources/ESH-INF/thing/thing-types.xml index eeeaf7a42bfea..02e7676b258fc 100644 --- a/bundles/org.openhab.binding.minecraft/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.minecraft/src/main/resources/ESH-INF/thing/thing-types.xml @@ -53,7 +53,7 @@ <config-description> <parameter name="playerName" type="text" required="true"> - <label>Player name</label> + <label>Player Name</label> <description>The name of the player.</description> </parameter> </config-description> @@ -73,7 +73,7 @@ <config-description> <parameter name="signName" type="text" required="true"> - <label>Sign name</label> + <label>Sign Name</label> <description>The text on the sign.</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.modbus/DEVELOPERS.md b/bundles/org.openhab.binding.modbus/DEVELOPERS.md index 560ae7be9cd24..6ea2a20ec21a6 100644 --- a/bundles/org.openhab.binding.modbus/DEVELOPERS.md +++ b/bundles/org.openhab.binding.modbus/DEVELOPERS.md @@ -1,11 +1,38 @@ # For Developers +## Debugging an addon + +Please follow IDE setup guide at https://www.openhab.org/docs/developer/ide/eclipse.html. + +When configuring dependencies in `openhab-distro/launch/app/pom.xml`, add all dependencies, including the transitive dependencies: + +```xml +<dependency> + <groupId>org.openhab.addons.bundles</groupId> + <artifactId>org.openhab.binding.modbus</artifactId> + <version>${project.version}</version> + <scope>runtime</scope> +</dependency> +<dependency> + <groupId>org.openhab.addons.bundles</groupId> + <artifactId>org.openhab.io.transport.modbus</artifactId> + <version>${project.version}</version> + <scope>runtime</scope> +</dependency> +<dependency> + <groupId>org.openhab.osgiify</groupId> + <artifactId>net.wimpi.jamod</artifactId> + <version>1.2.3.OH</version> + <scope>runtime</scope> +</dependency> +``` + ## Testing Serial Implementation -You can use test serial slaves without any hardware on linux using these steps: +You can use test serial slaves without any hardware on Linux using these steps: 1. Set-up virtual null modem emulator using [tty0tty](https://github.com/freemed/tty0tty) -2. Download [diagslave](http://www.modbusdriver.com/diagslave.html) and start modbus serial slave up using this command: +2. Download [diagslave](https://www.modbusdriver.com/diagslave.html) and start modbus serial slave up using this command: ``` ./diagslave -m rtu -a 1 -b 38400 -d 8 -s 1 -p none -4 10 /dev/pts/7 @@ -23,7 +50,7 @@ Naturally this is not the same thing as the real thing but helps to identify sim ## Testing TCP Implementation -1. Download [diagslave](http://www.modbusdriver.com/diagslave.html) and start modbus tcp server (slave) using this command: +1. Download [diagslave](https://www.modbusdriver.com/diagslave.html) and start modbus tcp server (slave) using this command: ``` ./diagslave -m tcp -a 1 -p 55502 @@ -50,9 +77,14 @@ You can also use `modpoll` to write data: ## Extending Modbus binding -This Modbus binding can be extended by other OSGi bundles to add more specific support for Modbus enabled devices. To do so to you have to create a new OSGi bundle which has the same binding id as this binding. The best way is to use the `ModbusBindingConstants.BINDING_ID` constant. +This Modbus binding can be extended by other OSGi bundles to add more specific support for Modbus enabled devices. +To do so to you have to create a new OSGi bundle which has the same binding id as this binding. +The best way is to use the `ModbusBindingConstants.BINDING_ID` constant. -You'll have to create one or more handler classes for the devices you want to support. For the modbus connection setup and handling you can use the Modbus TCP Slave or Modbus Serial Slave handlers. Your handler should use these handlers as bridges and you can set up your regular or one shot modbus requests to read from the slave. This is done by by creating a `BasicPollTaskImpl` and submitting it using the `ModbusManager` `submitOneTimePoll` and `registerRegularPoll` methods. +You will have to create one or more handler classes for the devices you want to support. +For the modbus connection setup and handling you can use the Modbus TCP Slave or Modbus Serial Slave handlers. +Your handler should use these handlers as bridges and you can set up your regular or one shot modbus requests to read from the slave. +This is done by by creating a `BasicPollTaskImpl` and submitting it using the `ModbusManager` `submitOneTimePoll` and `registerRegularPoll` methods. Please keep in mind that these reads are asynchronous and they will call your callback once the read is done. @@ -60,7 +92,8 @@ Once you have your data read from the modbus device you can parse and transform ### Discovery -If you write a device specific handler then adding discovery for this device is very welcome. You will have to write a discovery participant class which implements the `ModbusDiscoveryParticipant` interface and registers itself as a component. Example: +If you write a device specific handler then adding discovery for this device is very welcome. +You will have to write a discovery participant class which implements the `ModbusDiscoveryParticipant` interface and registers itself as a component. Example: ```java @@ -83,9 +116,12 @@ There are two methods you have to implement: Please try to avoid write requests to the endpoint because it could be some unknown device that write requests could misconfigure. -When a known device is found a `DiscoveryResult` object has to be created then the `thingDiscovered` method has to be called. The `DiscoveryResult` supports properties, and you should use this to store any data that will be useful when the actual thing will be created. For example you could store the start Modbus address of the device or vendor/model informations. +When a known device is found a `DiscoveryResult` object has to be created then the `thingDiscovered` method has to be called. +The `DiscoveryResult` supports properties, and you should use this to store any data that will be useful when the actual thing will be created. +For example you could store the start Modbus address of the device or vendor/model informations. -When the discovery process is finished either by detecting a device or by realizing it is not supported you should call the `discoveryFinished` method. This will tear down any resources allocated for the discovery process. +When the discovery process is finished either by detecting a device or by realizing it is not supported you should call the `discoveryFinished` method. +This will tear down any resources allocated for the discovery process. ### Discovery Architecture @@ -94,12 +130,16 @@ The following diagram shows the concept how discovery is implemented in this bin ![Discovery architecture](doc/images/ModbusExtensibleDiscovery.png) -As stated above the discovery process can be extended by OSGi bundles. For this they have to define their own `ModbusDisvoceryParticipant` that gets registered at the `ModbusDiscoveryService`. This object also keeps track of any of the Modbus handlers. Handler level discovery logic is implemented in the `ModbusEndpointDiscoveryService` which gets instantiated for each Modbus `BridgeHandler`. +As stated above the discovery process can be extended by OSGi bundles. +For this they have to define their own `ModbusDisvoceryParticipant` that gets registered at the `ModbusDiscoveryService`. +This object also keeps track of any of the Modbus handlers. +Handler level discovery logic is implemented in the `ModbusEndpointDiscoveryService` which gets instantiated for each Modbus `BridgeHandler`. The communication flow is detailed in the diagram below: ![Discovery process](doc/images/DiscoveryProcess.png) -As can be seen the process is initiated by the `ModbusDiscoveryService` which calls each of the `ModbusEndpointDiscoveryService` instances to start the discovery on the available participants. Then a reference to the `ThingHandler` is passed to each of the participants who can use this to do the actual discovery. +As can be seen the process is initiated by the `ModbusDiscoveryService` which calls each of the `ModbusEndpointDiscoveryService` instances to start the discovery on the available participants. +Then a reference to the `ThingHandler` is passed to each of the participants who can use this to do the actual discovery. Any things discovered are reported back in this chain and ultimately sent to openHAB core. diff --git a/bundles/org.openhab.binding.modbus/NOTICE b/bundles/org.openhab.binding.modbus/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.modbus/NOTICE +++ b/bundles/org.openhab.binding.modbus/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.modbus/README.md b/bundles/org.openhab.binding.modbus/README.md index c079b14063026..5ef549152d0c1 100644 --- a/bundles/org.openhab.binding.modbus/README.md +++ b/bundles/org.openhab.binding.modbus/README.md @@ -33,12 +33,12 @@ Reader of the documentation should understand the basics of Modbus protocol. Good sources for further information: * [Wikipedia article](https://en.wikipedia.org/wiki/Modbus): good read on modbus basics and addressing. -* [Simplymodbus.ca](http://www.simplymodbus.ca/): good reference as well as excellent tutorial like explanation of the protocol +* [Simplymodbus.ca](https://www.simplymodbus.ca/): good reference as well as excellent tutorial like explanation of the protocol Useful tools -* [binaryconvert.com](http://www.binaryconvert.com/): tool to convert numbers between different binary presentations -* [rapidscada.net Modbus parser](http://modbus.rapidscada.net/): tool to parse Modbus requests and responses. Useful for debugging purposes when you want to understand the message sent / received. +* [binaryconvert.com](https://www.binaryconvert.com/): tool to convert numbers between different binary presentations +* [rapidscada.net Modbus parser](https://modbus.rapidscada.net/): tool to parse Modbus requests and responses. Useful for debugging purposes when you want to understand the message sent / received. * [JSFiddle tool](https://jsfiddle.net/rgypuuxq/) to test JavaScript (JS) transformations interactively ## Supported Things @@ -114,7 +114,8 @@ Advanced parameters **Note:** Advanced parameters must be equal for all `tcp` things sharing the same `host` and `port`. The advanced parameters have conservative defaults, meaning that they should work for most users. -In some cases when extreme performance is required (e.g. poll period below 10 ms), one might want to decrease the delay parameters, especially `timeBetweenTransactionsMillis`. Similarly, with some slower devices on might need to increase the values. +In some cases when extreme performance is required (e.g. poll period below 10 ms), one might want to decrease the delay parameters, especially `timeBetweenTransactionsMillis`. +Similarly, with some slower devices on might need to increase the values. ### `serial` Thing @@ -125,7 +126,7 @@ Basic parameters | Parameter | Type | Required | Default if omitted | Description | | | --------- | ------- | -------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | | port | text | ✓ | | Serial port to use, for example `"/dev/ttyS0"` or `"COM1"` | | -| id | integer | | `1` | Slave id. Also known as station address or unit identifier. See [Wikipedia](https://en.wikipedia.org/wiki/Modbus) and [simplymodbus](http://www.simplymodbus.ca/index.html) articles for more information | | +| id | integer | | `1` | Slave id. Also known as station address or unit identifier. See [Wikipedia](https://en.wikipedia.org/wiki/Modbus) and [simplymodbus](https://www.simplymodbus.ca/index.html) articles for more information | | | baud | integer | ✓ | | Baud of the connection. Valid values are: `75`, `110`, `300`, `1200`, `2400`, `4800`, `9600`, `19200`, `38400`, `57600`, `115200`. | | | stopBits | text | ✓ | | Stop bits. Valid values are: `"1.0"`, `"1.5"`, `"2.0"`. | | | parity | text | ✓ | | Parity. Valid values are: `"none"`, `"even"`, `"odd"`. | | @@ -535,7 +536,7 @@ There are three different format to specify the configuration: 1. `"SERVICENAME(ARG)"` for calling a transformation service. The transformation receives the extracted number as input. This is useful for example scaling (divide by x) the polled data before it is used in openHAB. See examples for more details. 1. Any other value is interpreted as static text, in which case the actual content of the polled value is ignored. Transformation result is always the same. The transformation output is converted to best-effort-basis to the states accepted by the item. -Consult [background documentation on items](http://docs.openhab.org/concepts/items.html) to understand accepted data types (state) by each item. +Consult [background documentation on items](https://www.openhab.org/docs/concepts/items.html) to understand accepted data types (state) by each item. #### Transform On Write @@ -544,8 +545,8 @@ Consult [background documentation on items](http://docs.openhab.org/concepts/ite There are three different format to specify the configuration: 1. String `"default"`, in which case the default transformation is used. The default is to do no conversion to the command. -2. `"SERVICENAME(ARG)"` for calling a transformation service. The transformation receives the command as input. This is useful for example scaling ("multiply by x") commands before the data is written to Modbus. See examples for more details. -3. Any other value is interpreted as static text, in which case the actual command is ignored. Transformation result is always the same. +1. `"SERVICENAME(ARG)"` for calling a transformation service. The transformation receives the command as input. This is useful for example scaling ("multiply by x") commands before the data is written to Modbus. See examples for more details. +1. Any other value is interpreted as static text, in which case the actual command is ignored. Transformation result is always the same. #### Transformation Example: Scaling @@ -556,7 +557,7 @@ The data in Modbus slaves is quite commonly encoded as integers, and thus scalin ```javascript // Wrap everything in a function (no global variable pollution) -// variable "input" contains data passed by openhab +// variable "input" contains data passed by openHAB (function(inputData) { // on read: the polled number as string // on write: openHAB command as string @@ -569,7 +570,7 @@ The data in Modbus slaves is quite commonly encoded as integers, and thus scalin ```javascript // Wrap everything in a function (no global variable pollution) -// variable "input" contains data passed by openhab +// variable "input" contains data passed by openHAB (function(inputData) { // on read: the polled number as string // on write: openHAB command as string @@ -587,7 +588,7 @@ In this case, boolean input is considered to be either number `0`/`1`, `ON`/`OFF ```javascript // function to invert Modbus binary states -// variable "input" contains data passed by OpenHAB binding +// variable "input" contains data passed by openHAB (function(inputData) { var out = inputData ; // allow UNDEF to pass through if (inputData == '1' || inputData == 'ON' || inputData == 'OPEN') { @@ -980,8 +981,8 @@ Please be aware that `REFRESH` commands are "throttled" (to be exact, responses ## Changes From Modbus 1.x Binding -The older Modbus binding is quite different to the new binding. -Major difference is the thing structure introduced in new openHAB2 binding which allows configuration uisng the PaperUI. +The openHAB 1 Modbus binding is quite different from the openHAB 2 binding. +The biggest difference is that the openHAB 2 binding uses things which can be configured using Paper UI. Unfortunately there is no conversion tool to convert old configurations to new thing structure. @@ -1033,7 +1034,7 @@ The new binding supports 32 and 64 bit values types when writing. ### How to manually migrate -Here is a step by step example for a migration from a 1.x configuration to a equivalent 2.x configuration. +Here is a step by step example for a migration from a 1.x configuration to an equivalent 2.x configuration. It does not cover all features the 1.x configuration offers, but it should serve as an example on how to get it done. Please note that although you can do all this stuff also using PaperUI, the file based approach is strongly recommended if you need to migrate more than only a handful of Items. @@ -1069,7 +1070,7 @@ The 1.x modbus configuration to be updated defined 4 slaves: tcp.slave4.updateunchangeditems=false ``` -As you can see, all the slaves poll the same modbus device (actually a Wago 750-841 controller). +As you can see, all the slaves poll the same modbus device (actually a Wago 750-841 controller). We now have to create `Things` for this slaves. The 2.x modbus binding uses a three-level definition. @@ -1233,7 +1234,7 @@ Enable `DEBUG` or `TRACE` (even more verbose) logging for the loggers named: * `org.openhab.io.transport.modbus` * `net.wimpi.modbus` -Consult [openHAB2 logging documentation](http://docs.openhab.org/administration/logging.html#defining-what-to-log) for more information. +Consult [openHAB logging documentation](https://www.openhab.org/docs/administration/logging.html#defining-what-to-log) for more information. ## For Developers diff --git a/bundles/org.openhab.binding.modbus/pom.xml b/bundles/org.openhab.binding.modbus/pom.xml index 714cf66bc1f1c..6cc10a27623fd 100644 --- a/bundles/org.openhab.binding.modbus/pom.xml +++ b/bundles/org.openhab.binding.modbus/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.modbus</artifactId> @@ -20,12 +19,6 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>net.wimpi</groupId> - <artifactId>jamod</artifactId> - <version>1.2.3.OH</version> - <scope>provided</scope> - </dependency> </dependencies> </project> diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/ModbusBindingConstants.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/ModbusBindingConstants.java index f941688c176c6..8a83f0c8eca23 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/ModbusBindingConstants.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/ModbusBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryListener.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryListener.java index f6dd5d1c33f81..247e1f082f7eb 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryListener.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryParticipant.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryParticipant.java index b0e7f8c5b6c87..2992a1acdcc34 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/ModbusDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusDiscoveryService.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusDiscoveryService.java index aea8ba9e940a0..1b3596f8aa31e 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusDiscoveryService.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusEndpointDiscoveryService.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusEndpointDiscoveryService.java index 252c16f7907e0..bd73a4e08d48c 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusEndpointDiscoveryService.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusEndpointDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusThingHandlerDiscoveryService.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusThingHandlerDiscoveryService.java index aa7a246e1bda9..882d44f4b4e5e 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusThingHandlerDiscoveryService.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/discovery/internal/ModbusThingHandlerDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/EndpointNotInitializedException.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/EndpointNotInitializedException.java index 0f813361421ec..bf05979a5ef5e 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/EndpointNotInitializedException.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/EndpointNotInitializedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/ModbusEndpointThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/ModbusEndpointThingHandler.java index 05fd0fb1c5373..b91977e5f1066 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/ModbusEndpointThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/handler/ModbusEndpointThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValue.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValue.java index 6d679a83a765d..cf01a902d2db7 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValue.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusBindingConstantsInternal.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusBindingConstantsInternal.java index 8d56aa783e691..5f3717a9544e5 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusBindingConstantsInternal.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusBindingConstantsInternal.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusConfigurationException.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusConfigurationException.java index ac08d29a6dc5e..eecbfe067cf98 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusConfigurationException.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusHandlerFactory.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusHandlerFactory.java index 6401017f46c2d..23f4f5b2494d5 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusHandlerFactory.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/ModbusHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/Transformation.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/Transformation.java index e0666edb27458..94137115566a3 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/Transformation.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/Transformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusDataConfiguration.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusDataConfiguration.java index f4a181ec4ea68..d0326113ca8d5 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusDataConfiguration.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusDataConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusPollerConfiguration.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusPollerConfiguration.java index 0e1f931463ee2..0c0e74d1174d3 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusPollerConfiguration.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusPollerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusSerialConfiguration.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusSerialConfiguration.java index d56f305d7f806..016d569da01c0 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusSerialConfiguration.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusSerialConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusTcpConfiguration.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusTcpConfiguration.java index 0121d1e4576f7..adcdff3b7754e 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusTcpConfiguration.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/config/ModbusTcpConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/AbstractModbusEndpointThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/AbstractModbusEndpointThingHandler.java index 13648b36a17bf..6778b6b6fc737 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/AbstractModbusEndpointThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/AbstractModbusEndpointThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java index e5b06518b27ef..8b9083adbfcfa 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusDataThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,6 +80,8 @@ import org.openhab.io.transport.modbus.PollTask; import org.openhab.io.transport.modbus.endpoint.ModbusSlaveEndpoint; import org.openhab.io.transport.modbus.json.WriteRequestJsonUtilities; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -99,6 +101,8 @@ public class ModbusDataThingHandler extends BaseThingHandler implements ModbusRe private final Logger logger = LoggerFactory.getLogger(ModbusDataThingHandler.class); + private final BundleContext bundleContext; + private static final Duration MIN_STATUS_INFO_UPDATE_INTERVAL = Duration.ofSeconds(1); private static final Map<String, List<Class<? extends State>>> CHANNEL_ID_TO_ACCEPTED_TYPES = new HashMap<>(); @@ -140,7 +144,7 @@ public class ModbusDataThingHandler extends BaseThingHandler implements ModbusRe private volatile @Nullable PollTask pollTask; private volatile boolean isWriteEnabled; private volatile boolean isReadEnabled; - private volatile boolean transformationOnlyInWrite; + private volatile boolean writeParametersHavingTransformationOnly; private volatile boolean childOfEndpoint; private volatile @Nullable ModbusPollerThingHandler pollerHandler; private volatile Map<String, ChannelUID> channelCache = new HashMap<>(); @@ -153,6 +157,7 @@ public class ModbusDataThingHandler extends BaseThingHandler implements ModbusRe public ModbusDataThingHandler(Thing thing) { super(thing); + this.bundleContext = FrameworkUtil.getBundle(ModbusDataThingHandler.class).getBundleContext(); } @Override @@ -247,7 +252,7 @@ public synchronized void handleCommand(ChannelUID channelUID, Command command) { if (transformOutput.contains("[")) { processJsonTransform(command, transformOutput); return null; - } else if (transformationOnlyInWrite) { + } else if (writeParametersHavingTransformationOnly) { logger.error( "Thing {} seems to have writeTransformation but no other write parameters. Since the transformation did not return a JSON for command '{}' (channel {}), this is a configuration error.", getThing().getUID(), command, channelUID); @@ -406,7 +411,7 @@ public synchronized void dispose() { pollTask = null; isWriteEnabled = false; isReadEnabled = false; - transformationOnlyInWrite = false; + writeParametersHavingTransformationOnly = false; childOfEndpoint = false; pollerHandler = null; channelCache = new HashMap<>(); @@ -513,28 +518,31 @@ private void validateAndParseWriteParameters() throws ModbusConfigurationExcepti boolean writeValueTypeMissing = StringUtils.isBlank(config.getWriteValueType()); boolean writeTransformationMissing = StringUtils.isBlank(config.getWriteTransform()); writeTransformation = new Transformation(config.getWriteTransform()); - boolean writingCoil = WRITE_TYPE_COIL.equals(config.getWriteType()); - transformationOnlyInWrite = (writeTypeMissing && writeStartMissing && writeValueTypeMissing - && !writeTransformationMissing); - boolean allMissingOrAllPresentOrOnlyTransform = (writeTypeMissing && writeStartMissing && writeValueTypeMissing) - || (!writeTypeMissing && !writeStartMissing && (!writeValueTypeMissing || writingCoil)) - || transformationOnlyInWrite; - if (!allMissingOrAllPresentOrOnlyTransform) { + writeParametersHavingTransformationOnly = (writeTypeMissing && writeStartMissing + && writeValueTypeMissing && !writeTransformationMissing); + boolean allMissingOrAllPresentOrOnlyNonDefaultTransform = // + // read-only thing, no write specified + (writeTypeMissing && writeStartMissing && writeValueTypeMissing) + // mandatory write parameters provided. With coils one can drop value type + || (!writeTypeMissing && !writeStartMissing && (!writeValueTypeMissing || writingCoil)) + // only transformation provided + || writeParametersHavingTransformationOnly; + if (!allMissingOrAllPresentOrOnlyNonDefaultTransform) { String errmsg = String.format( "writeType=%s, writeStart=%s, and writeValueType=%s should be all present, or all missing! Alternatively, you can provide just writeTransformation, and use transformation returning JSON.", config.getWriteType(), config.getWriteStart(), config.getWriteValueType()); throw new ModbusConfigurationException(errmsg); - } else if (!writeTypeMissing || transformationOnlyInWrite) { + } else if (!writeTypeMissing || writeParametersHavingTransformationOnly) { isWriteEnabled = true; // all write values are present - if (!transformationOnlyInWrite && !WRITE_TYPE_HOLDING.equals(config.getWriteType()) + if (!writeParametersHavingTransformationOnly && !WRITE_TYPE_HOLDING.equals(config.getWriteType()) && !WRITE_TYPE_COIL.equals(config.getWriteType())) { String errmsg = String.format("Invalid writeType=%s. Expecting %s or %s!", config.getWriteType(), WRITE_TYPE_HOLDING, WRITE_TYPE_COIL); throw new ModbusConfigurationException(errmsg); } - if (transformationOnlyInWrite) { + if (writeParametersHavingTransformationOnly) { // Placeholder for further checks writeValueType = ModbusConstants.ValueType.INT16; } else if (writingCoil && writeValueTypeMissing) { @@ -562,7 +570,7 @@ private void validateAndParseWriteParameters() throws ModbusConfigurationExcepti } try { - if (!transformationOnlyInWrite) { + if (!writeParametersHavingTransformationOnly) { writeStart = Integer.parseInt(config.getWriteStart().trim()); } } catch (IllegalArgumentException e) { diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandler.java index 354d5b3e4ec6d..3dbe887e83c1a 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandlerImpl.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandlerImpl.java index e2bbc9608d6f7..497fd04347b4b 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandlerImpl.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusPollerThingHandlerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusSerialThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusSerialThingHandler.java index d19e782c0632f..57b66b582ceac 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusSerialThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusSerialThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusTcpThingHandler.java b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusTcpThingHandler.java index d6eb6fb5a10fb..258ab7198d467 100644 --- a/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusTcpThingHandler.java +++ b/bundles/org.openhab.binding.modbus/src/main/java/org/openhab/binding/modbus/internal/handler/ModbusTcpThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-poller.xml b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-poller.xml index f93ee6176be95..81713385dff9a 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-poller.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-poller.xml @@ -8,11 +8,11 @@ <bridge-type-ref id="serial" /> </supported-bridge-type-refs> - <label>Regular poll</label> + <label>Regular Poll</label> <description>Regular poll of data from Modbus slaves</description> <config-description> - <parameter name="refresh" type="integer" min="0"> - <label>Poll interval (ms)</label> + <parameter name="refresh" type="integer" min="0" unit="ms"> + <label>Poll Interval</label> <description>Poll interval in milliseconds. Use zero to disable automatic polling.</description> <default>500</default> </parameter> @@ -38,12 +38,12 @@ </options> </parameter> <parameter name="maxTries" type="integer" min="1"> - <label>Maximum tries when reading</label> + <label>Maximum Tries When Reading</label> <default>3</default> <description>Number of tries when reading data, if some of the reading fail. For single try, enter 1.</description> </parameter> - <parameter name="cacheMillis" type="integer" min="0"> - <label>Cache duration (ms)</label> + <parameter name="cacheMillis" type="integer" min="0" unit="ms"> + <label>Cache Duration</label> <default>50</default> <description><![CDATA[Duration for data cache to be valid, in milliseconds. This cache is used only to serve REFRESH commands. <br /> diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-serial.xml b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-serial.xml index cac6df880fec5..7ff20bff89b4a 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-serial.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-serial.xml @@ -3,11 +3,11 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="serial"> - <label>Modbus serial slave</label> + <label>Modbus Serial Slave</label> <description>Endpoint for Modbus serial slaves</description> <config-description> <parameter name="port" type="text" required="true"> - <label>Serial port</label> + <label>Serial Port</label> <context>serial-port</context> <description>Serial port to use, for example /dev/ttyS0 or COM1</description> <default>/dev/ttyS0</default> @@ -39,7 +39,7 @@ </options> </parameter> <parameter name="stopBits" type="text" multiple="false"> - <label>Stop bits</label> + <label>Stop Bits</label> <description>Stop bits</description> <default>1.0</default> <options> @@ -59,7 +59,7 @@ </options> </parameter> <parameter name="dataBits" type="integer" multiple="false"> - <label>Data bits</label> + <label>Data Bits</label> <description>Data bits</description> <default>8</default> <options> @@ -80,12 +80,12 @@ </options> </parameter> <parameter name="enableDiscovery" type="boolean"> - <label>Discovery enabled</label> + <label>Discovery Enabled</label> <description>When enabled we try to find a device specific handler. Turn this on if you're using one of the supported devices.</description> <default>false</default> </parameter> <parameter name="echo" type="boolean"> - <label>RS485 echo mode</label> + <label>RS485 Echo Mode</label> <description><![CDATA[Flag for setting the RS485 echo mode <br/> <br/>This controls whether we should try to read back whatever we send on the line, before reading the response. @@ -93,49 +93,49 @@ <default>false</default> <advanced>true</advanced> </parameter> - <parameter name="receiveTimeoutMillis" type="integer" min="0"> - <label>Read operation timeout (ms)</label> + <parameter name="receiveTimeoutMillis" type="integer" min="0" unit="ms"> + <label>Read Operation Timeout</label> <description>Timeout for read operations. In milliseconds.</description> <default>1500</default> <advanced>true</advanced> </parameter> <parameter name="flowControlIn" type="text" multiple="false"> - <label>Flow control in</label> + <label>Flow Control In</label> <description>Type of flow control for receiving</description> <default>none</default> <!-- values here match SerialPort.FLOWCONTROL_* constants --> <options> <option value="none">None</option> - <option value="xon/xoff in">RTS/CTS</option> - <option value="rts/cts in">XON/XOFF</option> + <option value="xon/xoff in">XON/XOFF</option> + <option value="rts/cts in">RTS/CTS</option> </options> </parameter> <parameter name="flowControlOut" type="text" multiple="false"> - <label>Flow control out</label> + <label>Flow Control Out</label> <description>Type of flow control for sending</description> <default>none</default> <!-- values here match SerialPort.FLOWCONTROL_* constants --> <options> <option value="none">None</option> - <option value="xon/xoff out">RTS/CTS</option> - <option value="rts/cts out">XON/XOFF</option> + <option value="xon/xoff out">XON/XOFF</option> + <option value="rts/cts out">RTS/CTS</option> </options> </parameter> <!-- connection handling --> - <parameter name="timeBetweenTransactionsMillis" type="integer" min="0"> - <label>Time between transactions (ms)</label> + <parameter name="timeBetweenTransactionsMillis" type="integer" min="0" unit="ms"> + <label>Time Between Transactions</label> <description>How long to delay we must have at minimum between two consecutive MODBUS transactions. In milliseconds.</description> <default>35</default> </parameter> <parameter name="connectMaxTries" type="integer" min="1"> - <label>Maximum connection tries</label> + <label>Maximum Connection Tries</label> <description>How many times we try to establish the connection. Should be at least 1.</description> <default>1</default> <advanced>true</advanced> </parameter> - <parameter name="connectTimeoutMillis" type="integer" min="0"> - <label>Timeout for establishing the connection (ms)</label> + <parameter name="connectTimeoutMillis" type="integer" min="0" unit="ms"> + <label>Timeout for Establishing the Connection</label> <description>The maximum time that is waited when establishing the connection. Value of zero means that system/OS default is respected. In milliseconds.</description> <default>10000</default> diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-tcp.xml b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-tcp.xml index aea219d97b868..c9c48809060fb 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-tcp.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/bridge-tcp.xml @@ -3,11 +3,11 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="tcp"> - <label>Modbus TCP slave</label> + <label>Modbus TCP Slave</label> <description>Endpoint for Modbus TCP slaves</description> <config-description> <parameter name="host" type="text" required="true"> - <label>IP Address or hostname</label> + <label>IP Address or Hostname</label> <description>Network address of the device</description> <default>localhost</default> <context>network-address</context> @@ -25,40 +25,40 @@ </parameter> <parameter name="enableDiscovery" type="boolean"> - <label>Discovery enabled</label> + <label>Discovery Enabled</label> <description>When enabled we try to find a device specific handler. Turn this on if you're using one of the supported devices.</description> <default>false</default> </parameter> <!-- connection handling --> - <parameter name="timeBetweenTransactionsMillis" type="integer" min="0"> - <label>Time between transactions (ms)</label> + <parameter name="timeBetweenTransactionsMillis" type="integer" min="0" unit="ms"> + <label>Time Between Transactions</label> <description>How long to delay we must have at minimum between two consecutive MODBUS transactions. In milliseconds. </description> <default>60</default> </parameter> - <parameter name="timeBetweenReconnectMillis" type="integer" min="0"> - <label>Time between reconnections (ms)</label> + <parameter name="timeBetweenReconnectMillis" type="integer" min="0" unit="ms"> + <label>Time Between Reconnections</label> <description>How long to wait to before trying to establish a new connection after the previous one has been disconnected. In milliseconds.</description> <default>0</default> <advanced>true</advanced> </parameter> <parameter name="connectMaxTries" type="integer" min="1"> - <label>Maximum connection tries</label> + <label>Maximum Connection Tries</label> <description>How many times we try to establish the connection. Should be at least 1.</description> <default>1</default> <advanced>true</advanced> </parameter> - <parameter name="reconnectAfterMillis" type="integer" min="0"> - <label>Disconnect and establish the connection again after this time (ms)</label> + <parameter name="reconnectAfterMillis" type="integer" min="0" unit="ms"> + <label>Reconnect Again After</label> <description>The connection is kept open at least the time specified here. Value of zero means that connection is disconnected after every MODBUS transaction. In milliseconds.</description> <default>0</default> <advanced>true</advanced> </parameter> - <parameter name="connectTimeoutMillis" type="integer" min="0"> - <label>Timeout for establishing the connection (ms)</label> + <parameter name="connectTimeoutMillis" type="integer" min="0" unit="ms"> + <label>Timeout for Establishing the Connection</label> <description>The maximum time that is waited when establishing the connection. Value of zero means that system/OS default is respected. In milliseconds.</description> <default>10000</default> diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-data.xml b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-data.xml index 9efb348caef7b..934f7b65c477c 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-data.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-data.xml @@ -7,7 +7,7 @@ <bridge-type-ref id="tcp" /> <bridge-type-ref id="serial" /> </supported-bridge-type-refs> - <label>Modbus data</label> + <label>Modbus Data</label> <description>Data thing extracts values from binary data received from Modbus slave. Similarly, it it responsible of tranlating openHAB commands to Modbus write requests</description> <channels> @@ -26,7 +26,7 @@ <config-description> <!-- what to read --> <parameter name="readStart" type="text" pattern="^(0|[1-9][0-9]*(\.[0-9]{1,2})?)?$"> - <label>Read address</label> + <label>Read Address</label> <description><![CDATA[Start address to start reading the value. Use empty for write-only things. <br /> <br />Input as zero-based index number, e.g. in place of 400001 (first holding register), use the address 0. Must be between (poller start) and (poller start + poller length - 1) (inclusive). @@ -40,7 +40,7 @@ </description> </parameter> <parameter name="readTransform" type="text"> - <label>Read transform</label> + <label>Read Transform</label> <description><![CDATA[Transformation to apply to polled data, after it has been converted to number using readValueType <br /><br />Use "default" to communicate that no transformation is done and value should be passed as is. <br />Use SERVICENAME(ARG) to use transformation service. @@ -49,7 +49,7 @@ <default>default</default> </parameter> <parameter name="readValueType" type="text"> - <label>Read value type</label> + <label>Read Value Type</label> <description><![CDATA[How data is read from modbus. Use empty for write-only things. <br /><br />With registers all value types are applicable.]]></description> @@ -77,12 +77,12 @@ </options> </parameter> <parameter name="writeStart" type="text"> - <label>Write address</label> + <label>Write Address</label> <description><![CDATA[Start address of the first holding register or coil in the write. Use empty for read-only things. <br />Use zero based address, e.g. in place of 400001 (first holding register), use the address 0. This address is passed to data frame as is.]]></description> </parameter> <parameter name="writeType" type="text"> - <label>Write type</label> + <label>Write Type</label> <description><![CDATA[Type of data to write. Leave empty for read-only things. <br /> <br /> @@ -93,7 +93,7 @@ </options> </parameter> <parameter name="writeTransform" type="text"> - <label>Write transform</label> + <label>Write Transform</label> <description><![CDATA[Transformation to apply to received commands. <br /><br />Use "default" to communicate that no transformation is done and value should be passed as is. <br />Use SERVICENAME(ARG) to use transformation service. @@ -102,7 +102,7 @@ <default>default</default> </parameter> <parameter name="writeValueType" type="text"> - <label>Write value type</label> + <label>Write Value Type</label> <description>How data is written to modbus. Only applicable to registers, you can leave this undefined for coil. </description> <options> @@ -117,19 +117,19 @@ </options> </parameter> <parameter name="writeMultipleEvenWithSingleRegisterOrCoil" type="boolean"> - <label>Write multiple even with single register or coil</label> + <label>Write Multiple Even with Single Register or Coil</label> <default>false</default> <description><![CDATA[Whether single register / coil of data is written using FC16 ("Write Multiple Holding Registers") / FC15 ("Write Multiple Coils"), respectively. <br /> <br />If false, FC6/FC5 are used with single register and single coil, respectively.]]></description> </parameter> <parameter name="writeMaxTries" type="integer" min="1"> - <label>Maximum tries when writing</label> + <label>Maximum Tries When Writing</label> <default>3</default> <description>Number of tries when writing data, if some of the writes fail. For single try, enter 1.</description> </parameter> - <parameter name="updateUnchangedValuesEveryMillis" type="integer" min="0"> - <label>Interval for updating unchanged values (ms)</label> + <parameter name="updateUnchangedValuesEveryMillis" type="integer" min="0" unit="ms"> + <label>Interval for Updating Unchanged Values</label> <default>1000</default> <description>Interval to update unchanged values. Normally unchanged values are not updated. In milliseconds.</description> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-types.xml index 8532a579ca9eb..df02bc8071694 100644 --- a/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.modbus/src/main/resources/ESH-INF/thing/thing-types.xml @@ -40,25 +40,25 @@ </channel-type> <channel-type id="last-successful-read-type"> <item-type>DateTime</item-type> - <label>Last successful read</label> + <label>Last Successful Read</label> <description>Date of last read</description> <config-description></config-description> </channel-type> <channel-type id="last-erroring-read-type"> <item-type>DateTime</item-type> - <label>Last erroring read</label> + <label>Last Erroring Read</label> <description>Date of last read error</description> <config-description></config-description> </channel-type> <channel-type id="last-successful-write-type"> <item-type>DateTime</item-type> - <label>Last successful write</label> + <label>Last Successful Write</label> <description>Date of last write</description> <config-description></config-description> </channel-type> <channel-type id="last-erroring-write-type"> <item-type>DateTime</item-type> - <label>Last erroring write</label> + <label>Last Erroring Write</label> <description>Date of last write error</description> <config-description></config-description> </channel-type> diff --git a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java index 1c32041338d2b..68375e21f5532 100644 --- a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java +++ b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/AtomicStampedKeyValueTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,6 +19,9 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(MockitoJUnitRunner.class) public class AtomicStampedKeyValueTest { diff --git a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusDataHandlerTest.java b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusDataHandlerTest.java index e4e40649e0d83..13ba04025faf7 100644 --- a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusDataHandlerTest.java +++ b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusDataHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,7 +33,7 @@ import java.util.function.Function; import java.util.function.Supplier; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.common.registry.AbstractRegistry; @@ -84,6 +84,7 @@ import org.eclipse.smarthome.test.storage.VolatileStorageService; import org.hamcrest.Matcher; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentMatchers; @@ -116,7 +117,12 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(MockitoJUnitRunner.class) +@Ignore("Tests fail because the thingRegistry field has been removed from BaseThingHandler, " + + "see: https://github.com/openhab/openhab-addons/issues/6171") public class ModbusDataHandlerTest extends JavaTest { private class ItemChannelLinkRegistryTestImpl extends ItemChannelLinkRegistry { @@ -134,6 +140,7 @@ public ItemChannelLinkRegistryTestImpl() { } } + @NonNullByDefault private class ItemRegisteryTestImpl extends AbstractRegistry<Item, String, ItemProvider> implements ItemRegistry { private Map<String, Item> items = new ConcurrentHashMap<>(); @@ -145,12 +152,12 @@ public ManagedProviderTestImpl() { } public ItemRegisteryTestImpl() { - super(null); + super(ItemProvider.class); setManagedProvider(new ManagedProviderTestImpl()); } @Override - public @NonNull Item getItem(String name) throws ItemNotFoundException { + public Item getItem(String name) throws ItemNotFoundException { Item item = super.get(name); if (item == null) { throw new ItemNotFoundException(name); @@ -159,38 +166,37 @@ public ItemRegisteryTestImpl() { } @Override - public @NonNull Item getItemByPattern(@NonNull String name) - throws ItemNotFoundException, ItemNotUniqueException { + public Item getItemByPattern(String name) throws ItemNotFoundException, ItemNotUniqueException { throw new IllegalStateException(); } @Override - public @NonNull Collection<@NonNull Item> getItems() { + public Collection<Item> getItems() { return items.values(); } @Override - public @NonNull Collection<Item> getItemsOfType(@NonNull String type) { + public Collection<Item> getItemsOfType(String type) { throw new IllegalStateException(); } @Override - public @NonNull Collection<@NonNull Item> getItems(@NonNull String pattern) { + public Collection<Item> getItems(String pattern) { throw new IllegalStateException(); } @Override - public @NonNull Collection<Item> getItemsByTag(@NonNull String... tags) { + public Collection<Item> getItemsByTag(String... tags) { throw new IllegalStateException(); } @Override - public @NonNull Collection<Item> getItemsByTagAndType(@NonNull String type, @NonNull String... tags) { + public Collection<Item> getItemsByTagAndType(String type, String... tags) { throw new IllegalStateException(); } @Override - public @Nullable Item remove(@NonNull String itemName, boolean recursive) { + public @Nullable Item remove(String itemName, boolean recursive) { if (recursive) { throw new IllegalStateException(); } @@ -208,8 +214,7 @@ public void removeRegistryHook(RegistryHook<Item> hook) { } @Override - public <T extends Item> @NonNull Collection<T> getItemsByTag(@NonNull Class<T> typeFilter, - @NonNull String... tags) { + public <T extends Item> Collection<T> getItemsByTag(Class<T> typeFilter, String... tags) { throw new IllegalStateException(); } @@ -415,9 +420,6 @@ private ModbusDataThingHandler createDataHandler(String id, Bridge bridge, hookLinkRegistry(dataThingHandler); dataThing.setHandler(dataThingHandler); dataThingHandler.setCallback(thingCallback); - if (context != null) { - dataThingHandler.setBundleContext(context); - } dataThingHandler.initialize(); return dataThingHandler; } diff --git a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusPollerThingHandlerTest.java b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusPollerThingHandlerTest.java index 9bf696b7a2875..8f96f963a310c 100644 --- a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusPollerThingHandlerTest.java +++ b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusPollerThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,6 +42,7 @@ import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -61,7 +62,12 @@ import org.openhab.io.transport.modbus.ModbusRegisterArray; import org.openhab.io.transport.modbus.PollTask; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(MockitoJUnitRunner.class) +@Ignore("Tests fail because the thingRegistry field has been removed from BaseThingHandler, " + + "see: https://github.com/openhab/openhab-addons/issues/6171") public class ModbusPollerThingHandlerTest { @Mock diff --git a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusTcpThingHandlerTest.java b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusTcpThingHandlerTest.java index ef7a6e9dc193f..f59d31a7700d8 100644 --- a/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusTcpThingHandlerTest.java +++ b/bundles/org.openhab.binding.modbus/src/test/java/org/openhab/binding/modbus/internal/ModbusTcpThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -38,6 +38,9 @@ import org.openhab.io.transport.modbus.endpoint.ModbusSlaveEndpoint; import org.openhab.io.transport.modbus.endpoint.ModbusTCPSlaveEndpoint; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(MockitoJUnitRunner.class) public class ModbusTcpThingHandlerTest { diff --git a/bundles/org.openhab.binding.mqtt.generic/README.md b/bundles/org.openhab.binding.mqtt.generic/README.md index 0f96ec50d5681..17cbef3291e94 100644 --- a/bundles/org.openhab.binding.mqtt.generic/README.md +++ b/bundles/org.openhab.binding.mqtt.generic/README.md @@ -41,7 +41,7 @@ binding can unfortunately not provide any auto-discovery means. If you use an open source IoT device, the chances are high, that it has the MQTT convention Homie or HomeAssistant implemented. Those conventions specify the topic -topology and allow auto discovery. Please have a look at the specific openHAB bindings. +topology and allow auto discovery. Please have a look at the specific openHAB bindings. ## Supported Things @@ -59,8 +59,8 @@ You can add the following channels: * **string**: This channel can show the received text on the given topic and can send text to a given topic. * **number**: This channel can show the received number on the given topic and can send a number to a given topic. It can have a min, max and step values. * **dimmer**: This channel handles numeric values as percentages. It can have min, max and step values. -* **contact**: This channel represents a open/close state of a given topic. -* **switch**: This channel represents a on/off state of a given topic and can send an on/off value to a given topic. +* **contact**: This channel represents an open/close state of a given topic. +* **switch**: This channel represents an on/off state of a given topic and can send an on/off value to a given topic. * **colorRGB**: This channel handles color values in RGB format. * **colorHSB**: This channel handles color values in HSB format. * **location**: This channel handles a location. @@ -74,11 +74,12 @@ You can add the following channels: * __transformationPattern__: An optional transformation pattern like [JSONPath](http://goessner.net/articles/JsonPath/index.html#e2) that is applied to all incoming MQTT values. * __transformationPatternOut__: An optional transformation pattern like [JSONPath](http://goessner.net/articles/JsonPath/index.html#e2) that is applied before publishing a value to MQTT. * __commandTopic__: The MQTT topic that commands are send to. This can be empty, the thing channel will be read-only then. Transformations are not applied for sending data. -* __formatBeforePublish__: Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". +* __formatBeforePublish__: Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". Currently only "%s" is supported. * __postCommand__: If `true`, the received MQTT value will not only update the state of linked items, but command it. The default is `false`. You usually need this to be `true` if your item is also linked to another channel, say a KNX actor, and you want a received MQTT payload to command that KNX actor. * __retained__: The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time. +* __qos__: QoS of this channel. Overrides the connection QoS (defined in broker connection). * __trigger__: If `true`, the state topic will not update a state, but trigger a channel instead. ### Channel Type "string" @@ -92,6 +93,7 @@ You can connect this channel to a String item. * __min__: An optional minimum value. * __max__: An optional maximum value. * __step__: For decrease, increase commands the step needs to be known +* __unit__: Unit of measurement (optional). For supported units see [OpenHAB: List of Units](https://www.openhab.org/docs/concepts/units-of-measurement.html#list-of-units). Examples: "°C", "°F" A decimal value (like 0.2) is send to the MQTT topic if the number has a fractional part. If you always require an integer, please use the formatter. @@ -100,8 +102,8 @@ You can connect this channel to a Number item. ### Channel Type "dimmer" -* __on__: A optional string (like "ON"/"Open") that is recognized as minimum. -* __off__: A optional string (like "OFF"/"Close") that is recognized as maximum. +* __on__: An optional string (like "ON"/"Open") that is recognized as minimum. +* __off__: An optional string (like "OFF"/"Close") that is recognized as maximum. * __min__: A required minimum value. * __max__: A required maximum value. * __step__: For decrease, increase commands the step needs to be known @@ -114,8 +116,8 @@ You can connect this channel to a Rollershutter or Dimmer item. ### Channel Type "contact", "switch" -* __on__: A optional number (like 1, 10) or a string (like "ON"/"Open") that is recognized as on/open state. -* __off__: A optional number (like 0, -10) or a string (like "OFF"/"Close") that is recognized as off/closed state. +* __on__: An optional number (like 1, 10) or a string (like "ON"/"Open") that is recognized as on/open state. +* __off__: An optional number (like 0, -10) or a string (like "OFF"/"Close") that is recognized as off/closed state. The contact channel by default recognizes `"OPEN"` and `"CLOSED"`. You can connect this channel to a Contact item. The switch channel by default recognizes `"ON"` and `"OFF"`. You can connect this channel to a Switch item. @@ -167,15 +169,19 @@ The channel expects values on the corresponding MQTT topic to be in this format ### Channel Type "rollershutter" -* __on__: An optional string (like "Open") that is recognized as UP state. -* __off__: An optional string (like "Close") that is recognized as DOWN state. -* __stop__: An optional string (like "Stop") that is recognized as STOP state. +* __on__: An optional string (like "Open") that is recognized as `UP` state. +* __off__: An optional string (like "Close") that is recognized as `DOWN` state. +* __stop__: An optional string (like "Stop") that is recognized as `STOP` state. + +Internally `UP` is converted to 0%, `DOWN` to 100%. +If strings are defined for these values, they are used for sending commands to the broker, too. You can connect this channel to a Rollershutter or Dimmer item. + ## Rule Actions -This binding includes a rule action, which allows to publish MQTT messages from within rules. +This binding includes a rule action, which allows one to publish MQTT messages from within rules. There is a separate instance for each MQTT broker (i.e. bridge), which can be retrieved through ``` @@ -183,12 +189,14 @@ val mqttActions = getActions("mqtt","mqtt:systemBroker:embedded-mqtt-broker") ``` where the first parameter always has to be `mqtt` and the second (`mqtt:systemBroker:embedded-mqtt-broker`) is the Thing UID of the broker that should be used. -Once this action instance is retrieved, you can invoke the `publishMQTT(String topic, String value)` method on it: +Once this action instance is retrieved, you can invoke the `publishMQTT(String topic, String value, Boolean retained)` method on it: ``` -mqttActions.publishMQTT("mytopic","myvalue") +mqttActions.publishMQTT("mytopic","myvalue", true) ``` +The retained argument is optional and if not supplied defaults to `false`. + ## Limitations * The HomeAssistant Fan Components only support ON/OFF. @@ -211,17 +219,19 @@ Here are a few examples to unwrap a value from a complex response: | `THEVALUE:23.2°C` | REGEX | `REGEX::(.*?)°` | Transformations can be chained by separating them with the mathematical intersection character "∩". +Please note that the incoming value will be discarded if one transformation fails (e.g. REGEX did not match). ## Outgoing Value Transformation All mentioned channels allow an optional transformation for outgoing values. Please prefer formatting as described in the next section whenever possible. +Please note that value will be discarded and not sent if one transformation fails (e.g. REGEX did not match). ## Format before Publish This feature is quite powerful in transforming an item state before it is published to the MQTT broker. It has the syntax: `%[flags][width]conversion`. -Find the full documentation on the [Java](https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html) web page. +Find the full documentation on the [Java](https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html) web page. The default is "%s" which means: Output the item state as string. @@ -240,6 +250,4 @@ Here are a few examples: ## Troubleshooting * If you get the error "No MQTT client": Please update your installation. -* If you use the Mosquitto broker: Please be aware that there is a relatively low setting -for retained messages. At some point messages will just not being delivered anymore: -Change the setting +* If you use the Mosquitto broker: Please be aware that there is a relatively low setting for retained messages. At some point messages will just not being delivered anymore: Change the setting. diff --git a/bundles/org.openhab.binding.mqtt.generic/pom.xml b/bundles/org.openhab.binding.mqtt.generic/pom.xml index 810d4f103517e..01f4b2b0119d7 100644 --- a/bundles/org.openhab.binding.mqtt.generic/pom.xml +++ b/bundles/org.openhab.binding.mqtt.generic/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mqtt.generic</artifactId> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/feature/feature.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/feature/feature.xml index b78a7de79ed6f..0bf36db2ae748 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mqtt.generic-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mqtt-generic" description="MQTT Binding Generic" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/AbstractMQTTThingHandler.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/AbstractMQTTThingHandler.java index 96d7261d59845..424a0d1b9ee79 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/AbstractMQTTThingHandler.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/AbstractMQTTThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -79,7 +79,7 @@ public AbstractMQTTThingHandler(Thing thing, int subscribeTimeout) { * @param channelUID The channelUID * @return A channel state. May be null. */ - abstract public @Nullable ChannelState getChannelState(ChannelUID channelUID); + public abstract @Nullable ChannelState getChannelState(ChannelUID channelUID); /** * Start the topic discovery and subscribe to all channel state topics on all {@link ChannelState}s. @@ -88,7 +88,7 @@ public AbstractMQTTThingHandler(Thing thing, int subscribeTimeout) { * @param connection A started broker connection * @return A future that completes normal on success and exceptionally on any errors. */ - abstract protected CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection); + protected abstract CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection); /** * Called when the MQTT connection disappeared. @@ -106,23 +106,36 @@ public void handleCommand(ChannelUID channelUID, Command command) { final @Nullable ChannelState data = getChannelState(channelUID); if (data == null) { - logger.warn("Channel {} not supported", channelUID.getId()); - if (command instanceof RefreshType) { - updateState(channelUID.getId(), UnDefType.UNDEF); + logger.warn("Channel {} not supported!", channelUID); + return; + } + + if (command instanceof RefreshType) { + State state = data.getCache().getChannelState(); + if (state instanceof UnDefType) { + logger.debug("Channel {} received REFRESH but no value cached, ignoring", channelUID); + } else { + updateState(channelUID, state); } return; } - if (command instanceof RefreshType || data.isReadOnly()) { - updateState(channelUID.getId(), data.getCache().getChannelState()); + if (data.isReadOnly()) { + logger.trace("Channel {} is a read-only channel, ignoring command {}", channelUID, command); return; } final CompletableFuture<Boolean> future = data.publishValue(command); - future.exceptionally(e -> { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getLocalizedMessage()); - return false; - }).thenRun(() -> logger.debug("Successfully published value {} to topic {}", command, data.getCommandTopic())); + future.handle((v, ex) -> { + if (ex != null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, ex.getLocalizedMessage()); + logger.debug("Failed publishing value {} to topic {}: {}", command, data.getCommandTopic(), + ex.getMessage()); + } else { + logger.debug("Successfully published value {} to topic {}", command, data.getCommandTopic()); + } + return null; + }); } @Override @@ -209,7 +222,7 @@ public void dispose() { try { unsubscribeAll().get(500, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { - logger.warn("unsubcription on disposal failed for {}: ", thing.getUID(), e); + logger.warn("unsubscription on disposal failed for {}: ", thing.getUID(), e); } connection = null; super.dispose(); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfig.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfig.java index 94e3462a02ca8..cf34fe1a55a78 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfig.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -37,7 +37,7 @@ public class ChannelConfig { * Instead a postCommand() call is performed. */ public boolean postCommand = false; - /** If true publishes messages as retained messages */ + public @Nullable Integer qos; public boolean retained = false; /** If true, the state topic will not update a state, but trigger a channel instead. */ public boolean trigger = false; diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfigBuilder.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfigBuilder.java index e699293302714..5f9a8309c4c87 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfigBuilder.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelConfigBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -64,6 +64,11 @@ public ChannelConfigBuilder withRetain(boolean retain) { return this; } + public ChannelConfigBuilder withQos(@Nullable Integer qos) { + config.qos = qos; + return this; + } + public ChannelConfigBuilder makeTrigger(boolean trigger) { config.trigger = trigger; return this; diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java index f83eebbb5f164..4c9baa1b7ac3b 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -53,8 +53,7 @@ public class ChannelState implements MqttMessageSubscriber { protected final Value cachedValue; // Runtime variables - @Nullable - private MqttBrokerConnection connection; + private @Nullable MqttBrokerConnection connection; protected final List<ChannelStateTransformation> transformationsIn = new ArrayList<>(); protected final List<ChannelStateTransformation> transformationsOut = new ArrayList<>(); private @Nullable ChannelStateUpdateListener channelStateUpdateListener; @@ -153,21 +152,29 @@ public void processMessage(String topic, byte[] payload) { } // String value: Apply transformations - String strvalue = new String(payload, StandardCharsets.UTF_8); + String strValue = new String(payload, StandardCharsets.UTF_8); for (ChannelStateTransformation t : transformationsIn) { - strvalue = t.processValue(strvalue); + String transformedValue = t.processValue(strValue); + if (transformedValue != null) { + strValue = transformedValue; + } else { + logger.debug("Transformation '{}' returned null on '{}', discarding message", strValue, + t.serviceName); + receivedOrTimeout(); + return; + } } // Is trigger?: Special handling if (config.trigger) { - channelStateUpdateListener.triggerChannel(channelUID, strvalue); + channelStateUpdateListener.triggerChannel(channelUID, strValue); receivedOrTimeout(); return; } - Command command = TypeParser.parseCommand(cachedValue.getSupportedCommandTypes(), strvalue); + Command command = TypeParser.parseCommand(cachedValue.getSupportedCommandTypes(), strValue); if (command == null) { - logger.warn("Incoming payload '{}' not supported by type '{}'", strvalue, + logger.warn("Incoming payload '{}' not supported by type '{}'", strValue, cachedValue.getClass().getSimpleName()); receivedOrTimeout(); return; @@ -184,7 +191,7 @@ public void processMessage(String topic, byte[] payload) { try { cachedValue.update(command); } catch (IllegalArgumentException | IllegalStateException e) { - logger.warn("Command '{}' not supported by type '{}': {}", strvalue, cachedValue.getClass().getSimpleName(), + logger.warn("Command '{}' not supported by type '{}': {}", strValue, cachedValue.getClass().getSimpleName(), e.getMessage()); receivedOrTimeout(); return; @@ -243,6 +250,7 @@ public boolean isStateful() { } private void internalStop() { + logger.debug("Unsubscribed channel {} form topic: {}", this.channelUID, config.stateTopic); this.connection = null; this.channelStateUpdateListener = null; hasSubscribed = false; @@ -274,14 +282,16 @@ private void receivedOrTimeout() { * @param connection A broker connection * @param scheduler A scheduler to realize the timeout * @param timeout A timeout in milliseconds. Can be 0 to disable the timeout and let the future return earlier. - * @param channelStateUpdateListener An update listener * @return A future that completes with true if the subscribing worked, with false if the stateTopic is not set * and exceptionally otherwise. */ public CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection, ScheduledExecutorService scheduler, int timeout) { - if (hasSubscribed) { + // if the connection is still the same, the subscription is still present, otherwise we need to renew + if (hasSubscribed && connection.equals(this.connection)) { return CompletableFuture.completedFuture(null); + } else { + hasSubscribed = false; } this.connection = connection; @@ -342,7 +352,14 @@ public CompletableFuture<Boolean> publishValue(Command command) { // Outgoing transformations for (ChannelStateTransformation t : transformationsOut) { - mqttCommandValue = t.processValue(mqttCommandValue); + String transformedValue = t.processValue(mqttCommandValue); + if (transformedValue != null) { + mqttCommandValue = transformedValue; + } else { + logger.debug("Transformation '{}' returned null on '{}', discarding message", mqttCommandValue, + t.serviceName); + return CompletableFuture.completedFuture(false); + } } // Formatter: Applied before the channel state value is published to the MQTT broker. @@ -355,8 +372,9 @@ public CompletableFuture<Boolean> publishValue(Command command) { } } - // Send retained messages if this is a stateful channel - return connection.publish(config.commandTopic, mqttCommandValue.getBytes(), 1, config.retained); + int qos = (config.qos != null) ? config.qos : connection.getQos(); + + return connection.publish(config.commandTopic, mqttCommandValue.getBytes(), qos, config.retained); } /** diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateTransformation.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateTransformation.java index 681872d4ac136..6ce1487633e43 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateTransformation.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateTransformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -58,7 +58,7 @@ public ChannelStateTransformation(String pattern, TransformationServiceProvider /** * Creates a new channel state transformer. * - * @param type A transformation service name. + * @param serviceName A transformation service name. * @param pattern A transformation. An Example: * $.device.status.temperature for a json {device: {status: { * temperature: 23.2 }}} (for type <code>JSONPATH</code>). @@ -76,7 +76,7 @@ public ChannelStateTransformation(String serviceName, String pattern, Transforma * @param value The incoming value * @return The transformed value */ - protected String processValue(String value) { + protected @Nullable String processValue(String value) { TransformationService transformationService = this.transformationService.get(); if (transformationService == null) { transformationService = provider.getTransformationService(serviceName); @@ -86,12 +86,12 @@ protected String processValue(String value) { } this.transformationService = new WeakReference<>(transformationService); } - String temp = null; + String returnValue = null; try { - temp = transformationService.transform(pattern, value); + returnValue = transformationService.transform(pattern, value); } catch (TransformationException e) { logger.warn("Executing the {}-transformation failed: {}", serviceName, e.getMessage()); } - return (temp != null) ? temp : value; + return returnValue; } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateUpdateListener.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateUpdateListener.java index ac1ab09c4c059..15e4ef2651293 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateUpdateListener.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/ChannelStateUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelStateDescriptionProvider.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelStateDescriptionProvider.java index 731d4f877d926..e5632768fd8a4 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -48,10 +48,8 @@ public class MqttChannelStateDescriptionProvider implements DynamicStateDescript * Set a state description for a channel. This description will be used when preparing the channel state by * the framework for presentation. A previous description, if existed, will be replaced. * - * @param channelUID - * channel UID - * @param description - * state description for the channel + * @param channelUID channel UID + * @param description state description for the channel */ public void setDescription(ChannelUID channelUID, StateDescription description) { logger.debug("Adding state description for channel {}", channelUID); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelTypeProvider.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelTypeProvider.java index 4d5868c52adfd..0c55e79285979 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelTypeProvider.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/MqttChannelTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,7 +19,6 @@ import java.util.Map; import java.util.Set; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.ThingTypeUID; @@ -65,32 +64,32 @@ public MqttChannelTypeProvider(@Reference ThingTypeRegistry typeRegistry) { } @Override - public @Nullable Collection<@NonNull ChannelType> getChannelTypes(@Nullable Locale locale) { + public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { return types.values(); } @Override - public @Nullable ChannelType getChannelType(@NonNull ChannelTypeUID channelTypeUID, @Nullable Locale locale) { + public @Nullable ChannelType getChannelType(ChannelTypeUID channelTypeUID, @Nullable Locale locale) { return types.get(channelTypeUID); } @Override - public @Nullable ChannelGroupType getChannelGroupType(@NonNull ChannelGroupTypeUID channelGroupTypeUID, + public @Nullable ChannelGroupType getChannelGroupType(ChannelGroupTypeUID channelGroupTypeUID, @Nullable Locale locale) { return groups.get(channelGroupTypeUID); } @Override - public @Nullable Collection<@NonNull ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { + public Collection<ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { return groups.values(); } @Override - public Collection<@NonNull ThingType> getThingTypes(@Nullable Locale locale) { + public Collection<ThingType> getThingTypes(@Nullable Locale locale) { return things.values(); } - public Set<@NonNull ThingTypeUID> getThingTypeUIDs() { + public Set<ThingTypeUID> getThingTypeUIDs() { return things.keySet(); } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/TransformationServiceProvider.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/TransformationServiceProvider.java index bc44376ca23bc..efa7a70d58e50 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/TransformationServiceProvider.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/TransformationServiceProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttBindingConstants.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttBindingConstants.java index 121c5baeeba97..c54c2f6c16065 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttBindingConstants.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttThingHandlerFactory.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttThingHandlerFactory.java index af900f2a20408..3e02d45e50b79 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttThingHandlerFactory.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/MqttThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/handler/GenericMQTTThingHandler.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/handler/GenericMQTTThingHandler.java index b52f6b48e4d49..471ca32b14c7a 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/handler/GenericMQTTThingHandler.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/internal/handler/GenericMQTTThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -99,14 +99,16 @@ protected void stop() { public void dispose() { // Remove all state descriptions of this handler channelStateByChannelUID.forEach((uid, state) -> stateDescProvider.remove(uid)); - channelStateByChannelUID.clear(); super.dispose(); + // there is a design flaw, we can't clean up our stuff because it is needed by the super-class on disposal for + // unsubscribing + channelStateByChannelUID.clear(); } @Override public CompletableFuture<Void> unsubscribeAll() { - return CompletableFuture.allOf(channelStateByChannelUID.values().stream().map(channel -> channel.stop()) - .toArray(CompletableFuture[]::new)); + return CompletableFuture.allOf( + channelStateByChannelUID.values().stream().map(ChannelState::stop).toArray(CompletableFuture[]::new)); } /** @@ -152,9 +154,12 @@ public void initialize() { Value value = ValueFactory.createValueState(channelConfig, channelTypeUID.getId()); ChannelState channelState = createChannelState(channelConfig, channel.getUID(), value); channelStateByChannelUID.put(channel.getUID(), channelState); - StateDescription description = value.createStateDescription(channelConfig.unit, - StringUtils.isBlank(channelConfig.commandTopic)); - stateDescProvider.setDescription(channel.getUID(), description); + StateDescription description = value + .createStateDescription(StringUtils.isBlank(channelConfig.commandTopic)).build() + .toStateDescription(); + if (description != null) { + stateDescProvider.setDescription(channel.getUID(), description); + } } catch (IllegalArgumentException e) { logger.warn("Channel configuration error", e); configErrors.add(channel.getUID()); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/AbstractMqttAttributeClass.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/AbstractMqttAttributeClass.java index d109d6d5d7bb0..79d395b1f002a 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/AbstractMqttAttributeClass.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/AbstractMqttAttributeClass.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -170,7 +170,6 @@ protected AbstractMqttAttributeClass() { public CompletableFuture<@Nullable Void> subscribeAndReceive(MqttBrokerConnection connection, ScheduledExecutorService scheduler, String basetopic, @Nullable AttributeChanged attributeChangedListener, int timeout) { - // We first need to unsubscribe old subscriptions if any final CompletableFuture<@Nullable Void> startFuture; if (subscriptions.size() > 0) { diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MQTTvalueTransform.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MQTTvalueTransform.java index bacc4a39eb3d5..4462893455602 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MQTTvalueTransform.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MQTTvalueTransform.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,8 +47,6 @@ @Target(FIELD) public @interface MQTTvalueTransform { String suffix() default ""; - String prefix() default ""; - String splitCharacter() default ""; } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MandatoryField.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MandatoryField.java index 11fa5b899d534..b3a86a2aa32b4 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MandatoryField.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/MandatoryField.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopic.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopic.java index 69f29c3f28307..9ead0afad3fa5 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopic.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopic.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,7 +20,6 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; @@ -128,7 +127,7 @@ static Object numberConvert(Object value, Class<?> type) throws IllegalArgumentE */ @SuppressWarnings({ "null", "unused" }) @Override - public void processMessage(@NonNull String topic, byte @NonNull [] payload) { + public void processMessage(String topic, byte [] payload) { final ScheduledFuture<?> scheduledFuture = this.scheduledFuture; if (scheduledFuture != null) { // Cancel timeout scheduledFuture.cancel(false); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/TopicPrefix.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/TopicPrefix.java index 58462f8428b19..f544bf1b3b091 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/TopicPrefix.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/mapping/TopicPrefix.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/ChildMap.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/ChildMap.java index dd4da36fed7bf..fb1b4bca3827f 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/ChildMap.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/ChildMap.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -81,7 +81,6 @@ public Stream<T> stream() { public CompletableFuture<@Nullable Void> apply(String[] childIDs, final Function<T, CompletableFuture<Void>> addedAction, final Function<String, T> supplyNewChild, final Consumer<T> removedCallback) { - Set<String> arrayValues = Stream.of(childIDs).collect(Collectors.toSet()); // Add all entries to the map, that are not in there yet. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/DelayedBatchProcessing.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/DelayedBatchProcessing.java index a5a3a66e78241..e85fec7180d06 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/DelayedBatchProcessing.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/DelayedBatchProcessing.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/JsonReaderDelegate.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/JsonReaderDelegate.java index 2bee9d967c3f5..aa6376e0d646f 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/JsonReaderDelegate.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/JsonReaderDelegate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/WaitForTopicValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/WaitForTopicValue.java index 4733e3b3a187f..c258617cc23df 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/WaitForTopicValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/tools/WaitForTopicValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ColorValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ColorValue.java index 713c007cce54a..fca6383d31691 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ColorValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ColorValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/DateTimeValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/DateTimeValue.java index 2d9e85f9357bb..afd2f21ff3ecf 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/DateTimeValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/DateTimeValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ImageValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ImageValue.java index 143b5acf80326..8aba1aff6e9b1 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ImageValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ImageValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/LocationValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/LocationValue.java index a319cc0705232..5bd37927035d5 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/LocationValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/LocationValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/NumberValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/NumberValue.java index dc2a9bfb275c5..c0052375c50d2 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/NumberValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/NumberValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,6 @@ package org.openhab.binding.mqtt.generic.values; import java.math.BigDecimal; -import java.util.Collections; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -22,13 +21,16 @@ import org.eclipse.smarthome.core.library.CoreItemFactory; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; +import org.eclipse.smarthome.core.library.types.QuantityType; import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.UnDefType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import tec.uom.se.AbstractUnit; + /** * Implements a number value. * @@ -46,13 +48,16 @@ public class NumberValue extends Value { private final @Nullable BigDecimal min; private final @Nullable BigDecimal max; private final BigDecimal step; + private final String unit; - public NumberValue(@Nullable BigDecimal min, @Nullable BigDecimal max, @Nullable BigDecimal step) { - super(CoreItemFactory.NUMBER, Stream.of(DecimalType.class, IncreaseDecreaseType.class, UpDownType.class) + public NumberValue(@Nullable BigDecimal min, @Nullable BigDecimal max, @Nullable BigDecimal step, + @Nullable String unit) { + super(CoreItemFactory.NUMBER, Stream.of(QuantityType.class, IncreaseDecreaseType.class, UpDownType.class) .collect(Collectors.toList())); this.min = min; this.max = max; - this.step = step == null ? new BigDecimal(1.0) : step; + this.step = step == null ? BigDecimal.ONE : step; + this.unit = unit == null ? "" : unit; } protected boolean checkConditions(BigDecimal newValue, DecimalType oldvalue) { @@ -71,7 +76,7 @@ protected boolean checkConditions(BigDecimal newValue, DecimalType oldvalue) { @Override public void update(Command command) throws IllegalArgumentException { DecimalType oldvalue = (state == UnDefType.UNDEF) ? new DecimalType() : (DecimalType) state; - BigDecimal newValue; + BigDecimal newValue = null; if (command instanceof DecimalType) { if (!checkConditions(((DecimalType) command).toBigDecimal(), oldvalue)) { return; @@ -87,6 +92,23 @@ public void update(Command command) throws IllegalArgumentException { return; } state = new DecimalType(newValue); + } else if (command instanceof QuantityType<?>) { + QuantityType<?> qType = (QuantityType<?>) command; + + if (qType.getUnit().isCompatible(AbstractUnit.ONE)) { + newValue = qType.toBigDecimal(); + } else { + qType = qType.toUnit(unit); + if (qType != null) { + newValue = qType.toBigDecimal(); + } + } + if (newValue != null) { + if (!checkConditions(newValue, oldvalue)) { + return; + } + state = new DecimalType(newValue); + } } else { newValue = new BigDecimal(command.toString()); if (!checkConditions(newValue, oldvalue)) { @@ -97,7 +119,20 @@ public void update(Command command) throws IllegalArgumentException { } @Override - public StateDescription createStateDescription(String unit, boolean readOnly) { - return new StateDescription(min, max, step, "%s " + unit.replace("%", "%%"), readOnly, Collections.emptyList()); + public StateDescriptionFragmentBuilder createStateDescription(boolean readOnly) { + StateDescriptionFragmentBuilder builder = super.createStateDescription(readOnly); + BigDecimal max = this.max; + if (max != null) { + builder = builder.withMaximum(max); + } + BigDecimal min = this.min; + if (min != null) { + builder = builder.withMinimum(min); + } + builder = builder.withStep(step); + if (this.unit.length() > 0) { + builder = builder.withPattern("%s " + this.unit.replace("%", "%%")); + } + return builder; } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OnOffValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OnOffValue.java index 4363ed8aa5456..967c806ce3621 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OnOffValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OnOffValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OpenCloseValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OpenCloseValue.java index c2e5369792a33..7e809cf865fca 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OpenCloseValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/OpenCloseValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/PercentageValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/PercentageValue.java index 993510719f8ac..57f34ee1996e7 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/PercentageValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/PercentageValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,6 @@ package org.openhab.binding.mqtt.generic.values; import java.math.BigDecimal; -import java.util.Collections; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -24,12 +23,15 @@ import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.QuantityType; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.UnDefType; +import tec.uom.se.unit.Units; + /** * Implements a percentage value. Minimum and maximum are definable. * @@ -54,9 +56,8 @@ public class PercentageValue extends Value { public PercentageValue(@Nullable BigDecimal min, @Nullable BigDecimal max, @Nullable BigDecimal step, @Nullable String onValue, @Nullable String offValue) { - super(CoreItemFactory.DIMMER, Stream - .of(DecimalType.class, IncreaseDecreaseType.class, OnOffType.class, UpDownType.class, StringType.class) - .collect(Collectors.toList())); + super(CoreItemFactory.DIMMER, Stream.of(DecimalType.class, QuantityType.class, IncreaseDecreaseType.class, + OnOffType.class, UpDownType.class, StringType.class).collect(Collectors.toList())); this.onValue = onValue; this.offValue = offValue; this.min = min == null ? 0.0 : min.doubleValue(); @@ -80,6 +81,15 @@ public void update(Command command) throws IllegalArgumentException { double v = ((DecimalType) command).doubleValue(); v = (v - min) * 100.0 / (max - min); state = new PercentType(new BigDecimal(v)); + } else // + // A quantity type need to be converted according to the current min/max values + if (command instanceof QuantityType) { + QuantityType<?> qty = ((QuantityType<?>) command).toUnit(Units.PERCENT); + if (qty != null) { + double v = qty.doubleValue(); + v = (v - min) * 100.0 / (max - min); + state = new PercentType(new BigDecimal(v)); + } } else // // Increase or decrease by "step" if (command instanceof IncreaseDecreaseType) { @@ -133,8 +143,8 @@ public String getMQTTpublishValue() { } @Override - public StateDescription createStateDescription(String unit, boolean readOnly) { - return new StateDescription(new BigDecimal(min), new BigDecimal(max), new BigDecimal(step), - "%s " + unit.replace("%", "%%"), readOnly, Collections.emptyList()); + public StateDescriptionFragmentBuilder createStateDescription(boolean readOnly) { + return super.createStateDescription(readOnly).withMaximum(new BigDecimal(max)).withMinimum(new BigDecimal(min)) + .withStep(new BigDecimal(step)).withPattern("%s %%"); } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/RollershutterValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/RollershutterValue.java index f43bc722e7bc1..090d841dc4f3c 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/RollershutterValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/RollershutterValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,7 +23,6 @@ import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.UnDefType; /** * Implements an rollershutter value. @@ -115,10 +114,21 @@ public void update(Command command) throws IllegalArgumentException { @Override public String getMQTTpublishValue() { + final String upString = this.upString; + final String downString = this.downString; if (this.nextIsStop) { this.nextIsStop = false; return stopString; + } else if (state instanceof PercentType) { + if (state.equals(PercentType.HUNDRED) && downString != null) { + return downString; + } else if (state.equals(PercentType.ZERO) && upString != null) { + return upString; + } else { + return String.valueOf(((PercentType) state).intValue()); + } + } else { + return "UNDEF"; } - return (state == UnDefType.UNDEF) ? "0" : String.valueOf(((PercentType) state).intValue()); } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/TextValue.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/TextValue.java index 6f51f5c9287e1..cc8d7cb2532b4 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/TextValue.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/TextValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,9 +12,7 @@ */ package org.openhab.binding.mqtt.generic.values; -import java.util.ArrayList; import java.util.Collections; -import java.util.List; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -25,7 +23,7 @@ import org.eclipse.smarthome.core.library.CoreItemFactory; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.StateOption; /** @@ -76,14 +74,14 @@ public void update(Command command) throws IllegalArgumentException { } @Override - public StateDescription createStateDescription(String unit, boolean readOnly) { - List<StateOption> stateOptions = new ArrayList<>(); + public StateDescriptionFragmentBuilder createStateDescription(boolean readOnly) { + StateDescriptionFragmentBuilder builder = super.createStateDescription(readOnly); final Set<String> states = this.states; if (states != null) { for (String state : states) { - stateOptions.add(new StateOption(state, state)); + builder = builder.withOption(new StateOption(state, state)); } } - return new StateDescription(null, null, null, "%s " + unit.replace("%", "%%"), readOnly, stateOptions); + return builder; } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/Value.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/Value.java index 95218507cfe88..c35c59411fb0a 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/Value.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/Value.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.URLConnection; -import java.util.Collections; import java.util.List; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -26,7 +25,7 @@ import org.eclipse.smarthome.core.library.types.RawType; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; -import org.eclipse.smarthome.core.types.StateDescription; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; import org.eclipse.smarthome.core.types.UnDefType; /** @@ -159,14 +158,12 @@ public void update(byte data[]) throws IllegalArgumentException { } /** - * Return the state description for this value state. + * Return the state description fragment builder for this value state. * - * @param unit An optional unit string. Might be an empty string. * @param readOnly True if this is a read-only value. - * @return A state description + * @return A state description fragment builder */ - public StateDescription createStateDescription(String unit, boolean readOnly) { - return new StateDescription(null, null, null, "%s " + unit.replace("%", "%%"), readOnly, - Collections.emptyList()); + public StateDescriptionFragmentBuilder createStateDescription(boolean readOnly) { + return StateDescriptionFragmentBuilder.create().withReadOnly(readOnly).withPattern("%s"); } } diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ValueFactory.java b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ValueFactory.java index 843e60a8fa38b..8eff012f6c3a7 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ValueFactory.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/java/org/openhab/binding/mqtt/generic/values/ValueFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,7 +47,7 @@ public static Value createValueState(ChannelConfig config, String channelTypeID) value = new LocationValue(); break; case MqttBindingConstants.NUMBER: - value = new NumberValue(config.min, config.max, config.step); + value = new NumberValue(config.min, config.max, config.step, config.unit); break; case MqttBindingConstants.DIMMER: value = new PercentageValue(config.min, config.max, config.step, config.on, config.off); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/color-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/color-channel-config.xml index 6d7327c1ddd69..c17c8f137eb01 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/color-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/color-channel-config.xml @@ -6,82 +6,98 @@ <config-description uri="thing-type:mqtt:color_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="on" type="text"> - <label>On/Open value</label> - <description>A number (like 1, 10) or a string (like "enabled") that is recognised as on/open state. You can use this parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> + <label>On/Open Value</label> + <description>A number (like 1, 10) or a string (like "enabled") that is recognised as on/open state. You can use this + parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> <default>1</default> <advanced>true</advanced> </parameter> <parameter name="off" type="text"> - <label>Off/Closed value</label> - <description>A number (like 0, -10) or a string (like "disabled") that is recognised as off/closed state. You can use this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> + <label>Off/Closed Value</label> + <description>A number (like 0, -10) or a string (like "disabled") that is recognised as off/closed state. You can use + this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> <default>0</default> <advanced>true</advanced> </parameter> <parameter name="onBrightness" type="integer" min="1" max="100"> - <label>Initial brightness</label> + <label>Initial Brightness</label> <description>If you connect this channel to a Switch item and turn it on, - color and saturation are preserved from the last state, but - the brightness will be set to this configured initial brightness percentage.</description> + color and saturation are preserved from the last state, but + the brightness will be set to this configured initial brightness percentage.</description> <default>10</default> <advanced>true</advanced> </parameter> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/dimmer-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/dimmer-channel-config.xml index af3d4dcfc8f43..b5cc03cd843ed 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/dimmer-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/dimmer-channel-config.xml @@ -6,87 +6,106 @@ <config-description uri="thing-type:mqtt:dimmer_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="min" type="decimal"> - <label>Absolute minimum</label> - <description>This configuration represents the minimum of the allowed range. For a percentage channel that equals zero percent.</description> + <label>Absolute Minimum</label> + <description>This configuration represents the minimum of the allowed range. For a percentage channel that equals + zero percent.</description> </parameter> <parameter name="max" type="decimal"> - <label>Absolute maximum</label> - <description>This configuration represents the maximum of the allowed range. For a percentage channel that equals one-hundred percent.</description> + <label>Absolute Maximum</label> + <description>This configuration represents the maximum of the allowed range. For a percentage channel that equals + one-hundred percent.</description> </parameter> <parameter name="step" type="decimal"> - <label>Delta value</label> - <description>A number/dimmer channel can receive INCREASE/DECREASE commands and computes the target number by adding or subtracting this delta value.</description> + <label>Delta Value</label> + <description>A number/dimmer channel can receive INCREASE/DECREASE commands and computes the target number by adding + or subtracting this delta value.</description> <default>1.0</default> <advanced>true</advanced> </parameter> <parameter name="on" type="text"> - <label>Custom On/Open value</label> - <description>A number (like 1, 10) or a string (like "enabled") that is additionally recognised as on/open state. You can use this parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> + <label>Custom On/Open Value</label> + <description>A number (like 1, 10) or a string (like "enabled") that is additionally recognised as on/open state. You + can use this parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> <default>1</default> </parameter> <parameter name="off" type="text"> - <label>Custom Off/Closed value</label> - <description>A number (like 0, -10) or a string (like "disabled") that is additionally recognised as off/closed state. You can use this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> + <label>Custom Off/Closed Value</label> + <description>A number (like 0, -10) or a string (like "disabled") that is additionally recognised as off/closed + state. You can use this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> <default>0</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/number-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/number-channel-config.xml index d431bca0716e6..be146d14c5813 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/number-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/number-channel-config.xml @@ -6,78 +6,101 @@ <config-description uri="thing-type:mqtt:number_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="min" type="decimal"> - <label>Absolute minimum</label> - <description>This configuration represents the minimum of the allowed range. For a percentage channel that equals zero percent.</description> + <label>Absolute Minimum</label> + <description>This configuration represents the minimum of the allowed range. For a percentage channel that equals + zero percent.</description> </parameter> <parameter name="max" type="decimal"> - <label>Absolute maximum</label> - <description>This configuration represents the maximum of the allowed range. For a percentage channel that equals one-hundred percent.</description> + <label>Absolute Maximum</label> + <description>This configuration represents the maximum of the allowed range. For a percentage channel that equals + one-hundred percent.</description> </parameter> <parameter name="step" type="decimal"> - <label>Delta value</label> - <description>A number/dimmer channel can receive INCREASE/DECREASE commands and computes the target number by adding or subtracting this delta value.</description> + <label>Delta Value</label> + <description>A number/dimmer channel can receive INCREASE/DECREASE commands and computes the target number by adding + or subtracting this delta value.</description> <default>1.0</default> <advanced>true</advanced> </parameter> + <parameter name="unit" type="text"> + <label>Unit Of Measurement</label> + <description>Unit of measurement (optional). The unit is used for representing the value in the GUI as well as for + converting incoming values (like from '°F' to '°C'). Examples: "°C", "°F"</description> + <advanced>true</advanced> + </parameter> </config-description> </config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/rollershutter-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/rollershutter-channel-config.xml index 3aa852acd76ad..a081caa4e55fb 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/rollershutter-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/rollershutter-channel-config.xml @@ -6,78 +6,94 @@ <config-description uri="thing-type:mqtt:rollershutter_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> - <parameter name="on" type="text"> - <label>Up value</label> - <description>A string (like "OPEN") that is recognised as UP state. You can use this parameter for a second keyword, next to UP.</description> + <label>Up Value</label> + <description>A string (like "OPEN") that is recognised as UP state. You can use this parameter for a second keyword, + next to UP.</description> <advanced>true</advanced> </parameter> <parameter name="off" type="text"> - <label>Down value</label> - <description>A string (like "CLOSE") that is recognised as DOWN state. You can use this parameter for a second keyword, next to DOWN.</description> + <label>Down Value</label> + <description>A string (like "CLOSE") that is recognised as DOWN state. You can use this parameter for a second + keyword, next to DOWN.</description> <advanced>true</advanced> </parameter> <parameter name="stop" type="text"> - <label>Stop value</label> - <description>A string (like "STOP") that is recognised as stop state. Will set the rollershutter state to undefined, because the current position is unknown at that point.</description> + <label>Stop Value</label> + <description>A string (like "STOP") that is recognised as stop state. Will set the rollershutter state to undefined, + because the current position is unknown at that point.</description> <default>STOP</default> <advanced>true</advanced> </parameter> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/string-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/string-channel-config.xml index 67490d9d1c3a2..238c15de671df 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/string-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/string-channel-config.xml @@ -6,68 +6,83 @@ <config-description uri="thing-type:mqtt:string_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="allowedStates" type="text"> - <label>Allowed states</label> - <description>If your MQTT topic is limited to a set of one or more specific commands or specific states, define those states here. Separate multiple states with commas. An example for a light bulb state set: ON,DIMMED,OFF</description> + <label>Allowed States</label> + <description>If your MQTT topic is limited to a set of one or more specific commands or specific states, define those + states here. Separate multiple states with commas. An example for a light bulb state set: ON,DIMMED,OFF</description> <advanced>true</advanced> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/switch-channel-config.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/switch-channel-config.xml index f2e9550b9f86f..ae15f7e9a2049 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/switch-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/config/switch-channel-config.xml @@ -6,73 +6,89 @@ <config-description uri="thing-type:mqtt:switch_channel"> <parameter-group name="transformations"> - <label>Transform values</label> - <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a received value is assigned to an item.</description> + <label>Transform Values</label> + <description>These configuration parameters allow you to alter a value before it is published to MQTT or before a + received value is assigned to an item.</description> <advanced>true</advanced> </parameter-group> <parameter name="stateTopic" type="text"> - <label>MQTT state topic</label> - <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the channel will be state-less command-only channel.</description> + <label>MQTT State Topic</label> + <description>An MQTT topic that this thing will subscribe to, to receive the state. This can be left empty, the + channel will be state-less command-only channel.</description> </parameter> <parameter name="commandTopic" type="text"> - <label>MQTT command topic</label> + <label>MQTT Command Topic</label> <description>An MQTT topic that this thing will send a command to. If not set, this will be a read-only switch.</description> </parameter> <parameter name="transformationPattern" type="text" groupName="transformations"> - <label>Incoming value transformations</label> + <label>Incoming Value Transformations</label> <description><![CDATA[ Applies transformations to an incoming MQTT topic value. A transformation example for a received JSON would be "JSONPATH:$.device.status.temperature" for a json {device: {status: { temperature: 23.2 }}}. - + You can chain transformations by separating them with the intersection character ∩. ]]></description> <advanced>true</advanced> </parameter> <parameter name="transformationPatternOut" type="text" groupName="transformations"> - <label>Outgoing value transformation</label> + <label>Outgoing Value Transformation</label> <description><![CDATA[ Applies a transformation before publishing a MQTT topic value. - + Transformations are specialised in extracting a value, but some transformations like the MAP one could be useful. ]]></description> <advanced>true</advanced> </parameter> <parameter name="formatBeforePublish" type="text" groupName="transformations"> - <label>Outgoing value format</label> + <label>Outgoing Value Format</label> <description><![CDATA[ Format a value before it is published to the MQTT broker. The default is to just pass the channel/item state. - + If you want to apply a prefix, say "MYCOLOR,", you would use "MYCOLOR,%s". If you want to adjust the precision of a number to for example 4 digits, you would use "%.4f". ]]></description> <advanced>true</advanced> <default>%s</default> </parameter> + <parameter name="qos" type="integer" min="0" max="2" required="false"> + <label>QoS</label> + <description>MQTT QoS of this channel (0, 1, 2). Default is QoS of the broker connection.</description> + <options> + <option value="0">At most once (best effort delivery "fire and forget")</option> + <option value="1">At least once (guaranteed that a message will be delivered at least once)</option> + <option value="2">Exactly once (guarantees that each message is received only once by the counterpart)</option> + </options> + <advanced>true</advanced> + </parameter> <parameter name="retained" type="boolean"> <label>Retained</label> - <description>The value will be published to the command topic as retained message. A retained value stays on the broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> + <description>The value will be published to the command topic as retained message. A retained value stays on the + broker and can even be seen by MQTT clients that are subscribing at a later point in time.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="postCommand" type="boolean"> - <label>Is command</label> - <description>If the received MQTT value should not only update the state of linked items, but command them, enable this option.</description> + <label>Is Command</label> + <description>If the received MQTT value should not only update the state of linked items, but command them, enable + this option.</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="on" type="text"> - <label>Custom On/Open value</label> - <description>A number (like 1, 10) or a string (like "enabled") that is additionally recognised as on/open state. You can use this parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> + <label>Custom On/Open Value</label> + <description>A number (like 1, 10) or a string (like "enabled") that is additionally recognised as on/open state. You + can use this parameter for a second keyword, next to ON (OPEN respectively on a Contact).</description> <default>1</default> </parameter> <parameter name="off" type="text"> - <label>Custom Off/Closed value</label> - <description>A number (like 0, -10) or a string (like "disabled") that is additionally recognised as off/closed state. You can use this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> + <label>Custom Off/Closed Value</label> + <description>A number (like 0, -10) or a string (like "disabled") that is additionally recognised as off/closed + state. You can use this parameter for a second keyword, next to OFF (CLOSED respectively on a Contact).</description> <default>0</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/channels.xml index 042bff9dba864..ebf6062fe98ef 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/channels.xml @@ -6,13 +6,13 @@ <channel-type id="string"> <item-type>String</item-type> - <label>Text value</label> + <label>Text Value</label> <config-description-ref uri="thing-type:mqtt:string_channel" /> </channel-type> <channel-type id="datetime"> <item-type>DateTime</item-type> - <label>Date/Time value</label> + <label>Date/Time Value</label> <description>Current date and/or time</description> <config-description-ref uri="thing-type:mqtt:string_channel" /> </channel-type> @@ -34,25 +34,25 @@ <channel-type id="number"> <item-type>Number</item-type> - <label>Number value</label> + <label>Number Value</label> <config-description-ref uri="thing-type:mqtt:number_channel"></config-description-ref> </channel-type> <channel-type id="dimmer"> <item-type>Dimmer</item-type> - <label>Percentage value</label> + <label>Percentage Value</label> <config-description-ref uri="thing-type:mqtt:dimmer_channel"></config-description-ref> </channel-type> <channel-type id="switch"> <item-type>Switch</item-type> - <label>On/Off switch</label> + <label>On/Off Switch</label> <config-description-ref uri="thing-type:mqtt:switch_channel"></config-description-ref> </channel-type> <channel-type id="contact"> <item-type>Contact</item-type> - <label>Open/Close contact</label> + <label>Open/Close Contact</label> <config-description-ref uri="thing-type:mqtt:switch_channel"></config-description-ref> </channel-type> @@ -64,14 +64,14 @@ <channel-type id="colorRGB"> <item-type>Color</item-type> - <label>Color value (Red,Green,Blue)</label> + <label>Color Value (Red,Green,Blue)</label> <description></description> <config-description-ref uri="thing-type:mqtt:color_channel"></config-description-ref> </channel-type> <channel-type id="colorHSB"> <item-type>Color</item-type> - <label>Color value (Hue,Saturation,Brightness)</label> + <label>Color Value (Hue,Saturation,Brightness)</label> <description></description> <config-description-ref uri="thing-type:mqtt:color_channel"></config-description-ref> </channel-type> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/generic-thing.xml b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/generic-thing.xml index 0114d6eedb28c..e34809b5a647c 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/generic-thing.xml +++ b/bundles/org.openhab.binding.mqtt.generic/src/main/resources/ESH-INF/thing/generic-thing.xml @@ -4,13 +4,15 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <thing-type id="topic" extensible="string,number,dimmer,switch,contact,colorRGB,colorHSB,datetime,image,location,rollershutter"> + <thing-type id="topic" + extensible="string,number,dimmer,switch,contact,colorRGB,colorHSB,datetime,image,location,rollershutter"> <supported-bridge-type-refs> <bridge-type-ref id="broker" /> <bridge-type-ref id="systemBroker" /> </supported-bridge-type-refs> <label>Generic MQTT Thing</label> - <description>You need a configured Broker first. Dynamically add channels of various types to this Thing. Link different MQTT topics to each channel.</description> + <description>You need a configured Broker first. Dynamically add channels of various types to this Thing. Link + different MQTT topics to each channel.</description> </thing-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateHelper.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateHelper.java index 3fd3f2fafba7c..63951bf3dcac3 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateHelper.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,8 +14,10 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; -import org.openhab.binding.mqtt.generic.ChannelState; +/** + * @author David Graeff - Initial contribution + */ @NonNullByDefault public class ChannelStateHelper { public static void setConnection(ChannelState cs, MqttBrokerConnection connection) { diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTests.java index 4d8b62a6b8a86..b7b46e676c24c 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,8 +13,7 @@ package org.openhab.binding.mqtt.generic; import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -158,7 +157,7 @@ public void receiveStringTest() throws InterruptedException, ExecutionException, @Test public void receiveDecimalTest() { - NumberValue value = new NumberValue(null, null, new BigDecimal(10)); + NumberValue value = new NumberValue(null, null, new BigDecimal(10), null); ChannelState c = spy(new ChannelState(config, channelUID, value, channelStateUpdateListener)); c.start(connection, mock(ScheduledExecutorService.class), 100); @@ -176,7 +175,7 @@ public void receiveDecimalTest() { @Test public void receiveDecimalFractionalTest() { - NumberValue value = new NumberValue(null, null, new BigDecimal(10.5)); + NumberValue value = new NumberValue(null, null, new BigDecimal(10.5), null); ChannelState c = spy(new ChannelState(config, channelUID, value, channelStateUpdateListener)); c.start(connection, mock(ScheduledExecutorService.class), 100); @@ -290,7 +289,7 @@ public void receiveImageTest() { ChannelState c = spy(new ChannelState(config, channelUID, value, channelStateUpdateListener)); c.start(connection, mock(ScheduledExecutorService.class), 100); - byte[] payload = new byte[]{(byte) 0xFF, (byte) 0xD8, 0x01, 0x02, (byte) 0xFF, (byte) 0xD9}; + byte[] payload = new byte[] { (byte) 0xFF, (byte) 0xD8, 0x01, 0x02, (byte) 0xFF, (byte) 0xD9 }; c.processMessage("state", payload); assertThat(value.getChannelState(), is(instanceOf(RawType.class))); assertThat(((RawType) value.getChannelState()).getMimeType(), is("image/jpeg")); diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTransformationTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTransformationTests.java index 9055e9e5be977..5d71651ac6906 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTransformationTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ChannelStateTransformationTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ThingHandlerHelper.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ThingHandlerHelper.java index 427deb83cf868..5ec6870dbf50d 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ThingHandlerHelper.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/ThingHandlerHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,8 +14,10 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; -import org.openhab.binding.mqtt.generic.AbstractMQTTThingHandler; +/** + * @author David Graeff - Initial contribution + */ @NonNullByDefault public class ThingHandlerHelper { public static void setConnection(AbstractMQTTThingHandler h, MqttBrokerConnection connection) { diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/GenericThingHandlerTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/GenericThingHandlerTests.java index 5b58f15b995e0..7d0f3eaad74f3 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/GenericThingHandlerTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/GenericThingHandlerTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/ThingChannelConstants.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/ThingChannelConstants.java index 7a983766d6882..15268982f4932 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/ThingChannelConstants.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/internal/handler/ThingChannelConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/MqttTopicClassMapperTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/MqttTopicClassMapperTests.java index 7ea6263006f94..070a89215b222 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/MqttTopicClassMapperTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/MqttTopicClassMapperTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopicTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopicTests.java index 0115f90f35edd..56657a3af2e6f 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopicTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/mapping/SubscribeFieldToMQTTtopicTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/values/ValueTests.java b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/values/ValueTests.java index 5c4013c12b0d5..5de9a19575150 100644 --- a/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/values/ValueTests.java +++ b/bundles/org.openhab.binding.mqtt.generic/src/test/java/org/openhab/binding/mqtt/generic/values/ValueTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,14 +27,6 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.TypeParser; import org.junit.Test; -import org.openhab.binding.mqtt.generic.values.ColorValue; -import org.openhab.binding.mqtt.generic.values.NumberValue; -import org.openhab.binding.mqtt.generic.values.OnOffValue; -import org.openhab.binding.mqtt.generic.values.OpenCloseValue; -import org.openhab.binding.mqtt.generic.values.PercentageValue; -import org.openhab.binding.mqtt.generic.values.RollershutterValue; -import org.openhab.binding.mqtt.generic.values.TextValue; -import org.openhab.binding.mqtt.generic.values.Value; /** * Test cases for the value classes. They should throw exceptions if the wrong command type is used @@ -85,7 +77,7 @@ public void illegalColorUpdate() { @Test(expected = IllegalArgumentException.class) public void illegalNumberCommand() { - NumberValue v = new NumberValue(null, null, null); + NumberValue v = new NumberValue(null, null, null, null); v.update(OnOffType.OFF); } @@ -164,10 +156,33 @@ public void openCloseUpdate() { } @Test - public void rollershutterUpdate() { + public void rollershutterUpdateWithStrings() { RollershutterValue v = new RollershutterValue("fancyON", "fancyOff", "fancyStop"); // Test with command v.update(UpDownType.UP); + assertThat(v.getMQTTpublishValue(), is("fancyON")); + assertThat(v.getChannelState(), is(PercentType.ZERO)); + v.update(UpDownType.DOWN); + assertThat(v.getMQTTpublishValue(), is("fancyOff")); + assertThat(v.getChannelState(), is(PercentType.HUNDRED)); + + // Test with custom string + v.update(new StringType("fancyON")); + assertThat(v.getMQTTpublishValue(), is("fancyON")); + assertThat(v.getChannelState(), is(PercentType.ZERO)); + v.update(new StringType("fancyOff")); + assertThat(v.getMQTTpublishValue(), is("fancyOff")); + assertThat(v.getChannelState(), is(PercentType.HUNDRED)); + v.update(new PercentType(27)); + assertThat(v.getMQTTpublishValue(), is("27")); + assertThat(v.getChannelState(), is(new PercentType(27))); + } + + @Test + public void rollershutterUpdateWithOutStrings() { + RollershutterValue v = new RollershutterValue(null, null, "fancyStop"); + // Test with command + v.update(UpDownType.UP); assertThat(v.getMQTTpublishValue(), is("0")); assertThat(v.getChannelState(), is(PercentType.ZERO)); v.update(UpDownType.DOWN); @@ -175,10 +190,10 @@ public void rollershutterUpdate() { assertThat(v.getChannelState(), is(PercentType.HUNDRED)); // Test with custom string - v.update(new StringType("fancyON")); + v.update(PercentType.ZERO); assertThat(v.getMQTTpublishValue(), is("0")); assertThat(v.getChannelState(), is(PercentType.ZERO)); - v.update(new StringType("fancyOff")); + v.update(PercentType.HUNDRED); assertThat(v.getMQTTpublishValue(), is("100")); assertThat(v.getChannelState(), is(PercentType.HUNDRED)); v.update(new PercentType(27)); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/pom.xml b/bundles/org.openhab.binding.mqtt.homeassistant/pom.xml index 29fe21e10830b..a87f9fdc2df40 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/pom.xml +++ b/bundles/org.openhab.binding.mqtt.homeassistant/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mqtt.homeassistant</artifactId> diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/feature/feature.xml b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/feature/feature.xml index 743229764c18d..d7ad564331dcf 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mqtt.homeassistant-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mqtt-homeassistant" description="MQTT Binding Homeassistant" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java index 1ebd042e0c20f..b634b97c75af8 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttThingHandlerFactory.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttThingHandlerFactory.java index bb80171c97160..d2d09a7e577e7 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttThingHandlerFactory.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/generic/internal/MqttThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/AbstractComponent.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/AbstractComponent.java index d1c4096710415..5532d33e36f9e 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/AbstractComponent.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/AbstractComponent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,12 +30,14 @@ import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeBuilder; import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; +import org.openhab.binding.mqtt.generic.ChannelStateUpdateListener; import org.openhab.binding.mqtt.generic.MqttChannelTypeProvider; import org.openhab.binding.mqtt.generic.values.OnOffValue; import org.openhab.binding.mqtt.generic.values.Value; import org.openhab.binding.mqtt.homeassistant.generic.internal.MqttBindingConstants; import org.openhab.binding.mqtt.homeassistant.internal.CFactory.ComponentConfiguration; import org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler; +import org.openhab.binding.mqtt.homeassistant.internal.util.FutureCollector; /** * A HomeAssistant component is comparable to an ESH channel group. @@ -92,14 +94,16 @@ public AbstractComponent(CFactory.ComponentConfiguration componentConfiguration, this.channelConfiguration.payload_not_available); availablityChannel = buildChannel(HomeAssistantThingHandler.AVAILABILITY_CHANNEL, value, - channelConfiguration.name + " availability").listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name + " availability", componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.availability_topic)// .build(false); } } - protected CChannel.Builder buildChannel(String channelID, Value valueState, String label) { - return new CChannel.Builder(this, componentConfiguration, channelID, valueState, label); + protected CChannel.Builder buildChannel(String channelID, Value valueState, String label, + ChannelStateUpdateListener channelStateUpdateListener) { + return new CChannel.Builder(this, componentConfiguration, channelID, valueState, label, + channelStateUpdateListener); } public void setConfigSeen() { @@ -129,10 +133,8 @@ public boolean isActive() { */ public CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection, ScheduledExecutorService scheduler, int timeout) { - CompletableFuture<@Nullable Void> all = CompletableFuture.completedFuture(null); - - all = channels.values().stream().map(v -> v.start(connection, scheduler, timeout)).reduce(all, - (f, v) -> f.thenCompose(b -> v)); + CompletableFuture<@Nullable Void> all = channels.values().parallelStream() + .map(v -> v.start(connection, scheduler, timeout)).collect(FutureCollector.allOf()); if (availablityChannel != null) { all = all.thenCompose(v -> availablityChannel.start(connection, scheduler, timeout)); @@ -148,9 +150,8 @@ public boolean isActive() { * exceptionally on errors. */ public CompletableFuture<@Nullable Void> stop() { - CompletableFuture<@Nullable Void> all = CompletableFuture.completedFuture(null); - - all = channels.values().stream().map(v -> v.stop()).reduce(all, (f, v) -> f.thenCompose(b -> v)); + CompletableFuture<@Nullable Void> all = channels.values().parallelStream().map(v -> v.stop()) + .collect(FutureCollector.allOf()); if (availablityChannel != null) { all = all.thenCompose(v -> availablityChannel.stop()); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/BaseChannelConfiguration.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/BaseChannelConfiguration.java index 195c6c99a17f5..993dab61588d7 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/BaseChannelConfiguration.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/BaseChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -108,6 +108,7 @@ public String getId() { } } + @JsonAdapter(ConnectionDeserializer.class) static class Connection { protected @Nullable String type; protected @Nullable String identifier; diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java index a4cc5b99a5bac..f9cb2ebc9184b 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -28,6 +28,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.core.types.StateDescription; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.openhab.binding.mqtt.generic.ChannelConfigBuilder; import org.openhab.binding.mqtt.generic.ChannelState; @@ -63,15 +64,17 @@ public class CChannel { private final Channel channel; // ESH Channel private final ChannelType type; private final ChannelTypeUID channelTypeUID; + private final ChannelStateUpdateListener channelStateUpdateListener; private CChannel(ChannelUID channelUID, ChannelState channelState, Channel channel, ChannelType type, - ChannelTypeUID channelTypeUID) { + ChannelTypeUID channelTypeUID, ChannelStateUpdateListener channelStateUpdateListener) { super(); this.channelUID = channelUID; this.channelState = channelState; this.channel = channel; this.type = type; this.channelTypeUID = channelTypeUID; + this.channelStateUpdateListener = channelStateUpdateListener; } public ChannelUID getChannelUID() { @@ -92,6 +95,9 @@ public ChannelState getState() { public CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection, ScheduledExecutorService scheduler, int timeout) { + // Make sure we set the callback again which might have been nulled during an stop + channelState.setChannelStateUpdateListener(this.channelStateUpdateListener); + return channelState.start(connection, scheduler, timeout); } @@ -120,23 +126,19 @@ public static class Builder { private @Nullable String state_topic; private @Nullable String command_topic; private boolean retain; - private String unit = ""; - private @Nullable ChannelStateUpdateListener channelStateUpdateListener; + private @Nullable Integer qos; + private ChannelStateUpdateListener channelStateUpdateListener; private @Nullable String templateIn; public Builder(AbstractComponent<?> component, ComponentConfiguration componentConfiguration, String channelID, - Value valueState, String label) { + Value valueState, String label, ChannelStateUpdateListener channelStateUpdateListener) { this.component = component; this.componentConfiguration = componentConfiguration; this.channelID = channelID; this.valueState = valueState; this.label = label; - } - - public Builder listener(@Nullable ChannelStateUpdateListener channelStateUpdateListener) { this.channelStateUpdateListener = channelStateUpdateListener; - return this; } public Builder stateTopic(@Nullable String state_topic) { @@ -157,14 +159,23 @@ public Builder stateTopic(@Nullable String state_topic, @Nullable String... temp return this; } - public Builder unit(String unit) { - this.unit = unit; + /** + * @deprecated use commandTopic(String, boolean, int) + * @param command_topic + * @param retain + * @return + */ + @Deprecated + public Builder commandTopic(@Nullable String command_topic, boolean retain) { + this.command_topic = command_topic; + this.retain = retain; return this; } - public Builder commandTopic(@Nullable String command_topic, boolean retain) { + public Builder commandTopic(@Nullable String command_topic, boolean retain, int qos) { this.command_topic = command_topic; this.retain = retain; + this.qos = qos; return this; } @@ -183,7 +194,7 @@ public CChannel build(boolean addToComponent) { channelTypeUID = new ChannelTypeUID(MqttBindingConstants.BINDING_ID, channelUID.getGroupId() + "_" + channelID); channelState = new ChannelState( - ChannelConfigBuilder.create().withRetain(retain).withStateTopic(state_topic) + ChannelConfigBuilder.create().withRetain(retain).withQos(qos).withStateTopic(state_topic) .withCommandTopic(command_topic).build(), channelUID, valueState, channelStateUpdateListener); @@ -191,9 +202,11 @@ public CChannel build(boolean addToComponent) { type = ChannelTypeBuilder.trigger(channelTypeUID, label) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HA_CHANNEL)).build(); } else { + StateDescription description = valueState.createStateDescription(command_topic == null).build() + .toStateDescription(); type = ChannelTypeBuilder.state(channelTypeUID, label, channelState.getItemType()) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HA_CHANNEL)) - .withStateDescription(valueState.createStateDescription(unit, command_topic == null)).build(); + .withStateDescription(description).build(); } Configuration configuration = new Configuration(); @@ -203,7 +216,8 @@ public CChannel build(boolean addToComponent) { channel = ChannelBuilder.create(channelUID, channelState.getItemType()).withType(channelTypeUID) .withKind(type.getKind()).withLabel(label).withConfiguration(configuration).build(); - CChannel result = new CChannel(channelUID, channelState, channel, type, channelTypeUID); + CChannel result = new CChannel(channelUID, channelState, channel, type, channelTypeUID, + channelStateUpdateListener); @Nullable TransformationServiceProvider transformationProvider = componentConfiguration diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CFactory.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CFactory.java index de1b2a96034aa..04ae358c643da 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CFactory.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/CFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -44,11 +44,10 @@ public class CFactory { * @return A HA MQTT Component */ public static @Nullable AbstractComponent<?> createComponent(ThingUID thingUID, HaID haID, - String channelConfigurationJSON, @Nullable ChannelStateUpdateListener updateListener, Gson gson, + String channelConfigurationJSON, ChannelStateUpdateListener updateListener, Gson gson, TransformationServiceProvider transformationServiceProvider) { ComponentConfiguration componentConfiguration = new ComponentConfiguration(thingUID, haID, - channelConfigurationJSON, gson).listener(updateListener) - .transformationProvider(transformationServiceProvider); + channelConfigurationJSON, gson, updateListener).transformationProvider(transformationServiceProvider); try { switch (haID.component) { case "alarm_control_panel": @@ -83,19 +82,16 @@ protected static class ComponentConfiguration { private HaID haID; private String configJSON; private @Nullable TransformationServiceProvider transformationServiceProvider; - private @Nullable ChannelStateUpdateListener updateListener; + private ChannelStateUpdateListener updateListener; private Gson gson; - protected ComponentConfiguration(ThingUID thingUID, HaID haID, String configJSON, Gson gson) { + protected ComponentConfiguration(ThingUID thingUID, HaID haID, String configJSON, Gson gson, + ChannelStateUpdateListener updateListener) { this.thingUID = thingUID; this.haID = haID; this.configJSON = configJSON; this.gson = gson; - } - - public ComponentConfiguration listener(@Nullable ChannelStateUpdateListener updateListener) { this.updateListener = updateListener; - return this; } public ComponentConfiguration transformationProvider( @@ -116,7 +112,6 @@ public String getConfigJSON() { return configJSON; } - @Nullable public ChannelStateUpdateListener getUpdateListener() { return updateListener; } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ChannelConfigurationTypeAdapterFactory.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ChannelConfigurationTypeAdapterFactory.java index 13446b2868340..52f0e398b2590 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ChannelConfigurationTypeAdapterFactory.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ChannelConfigurationTypeAdapterFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentAlarmControlPanel.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentAlarmControlPanel.java index 1191dc3aaf5a2..604e067682eb3 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentAlarmControlPanel.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentAlarmControlPanel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -61,25 +61,25 @@ public ComponentAlarmControlPanel(CFactory.ComponentConfiguration componentConfi final String[] state_enum = { channelConfiguration.state_disarmed, channelConfiguration.state_armed_home, channelConfiguration.state_armed_away, channelConfiguration.state_pending, channelConfiguration.state_triggered }; - buildChannel(stateChannelID, new TextValue(state_enum), channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener()) - .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// - .build(); + buildChannel(stateChannelID, new TextValue(state_enum), channelConfiguration.name, + componentConfiguration.getUpdateListener()) + .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// + .build(); String command_topic = channelConfiguration.command_topic; if (command_topic != null) { buildChannel(switchDisarmChannelID, new TextValue(new String[] { channelConfiguration.payload_disarm }), - channelConfiguration.name).listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name, componentConfiguration.getUpdateListener())// .commandTopic(command_topic, channelConfiguration.retain)// .build(); buildChannel(switchArmHomeChannelID, new TextValue(new String[] { channelConfiguration.payload_arm_home }), - channelConfiguration.name).listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name, componentConfiguration.getUpdateListener())// .commandTopic(command_topic, channelConfiguration.retain)// .build(); buildChannel(switchArmAwayChannelID, new TextValue(new String[] { channelConfiguration.payload_arm_away }), - channelConfiguration.name).listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name, componentConfiguration.getUpdateListener())// .commandTopic(command_topic, channelConfiguration.retain)// .build(); } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentBinarySensor.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentBinarySensor.java index a64802706fde4..313a14078c925 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentBinarySensor.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentBinarySensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,7 +33,6 @@ static class ChannelConfiguration extends BaseChannelConfiguration { super("MQTT Binary Sensor"); } - protected String unit_of_measurement = ""; protected @Nullable String device_class; protected boolean force_update = false; protected int expire_after = 0; @@ -51,9 +50,8 @@ public ComponentBinarySensor(CFactory.ComponentConfiguration componentConfigurat } buildChannel(sensorChannelID, new OnOffValue(channelConfiguration.payload_on, channelConfiguration.payload_off), - channelConfiguration.name).listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// - .unit(channelConfiguration.unit_of_measurement)// .build(); } } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCamera.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCamera.java index ca4f07696ea73..1548742268734 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCamera.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCamera.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,8 +42,7 @@ public ComponentCamera(CFactory.ComponentConfiguration componentConfiguration) { ImageValue value = new ImageValue(); - buildChannel(cameraChannelID, value, channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener())// + buildChannel(cameraChannelID, value, channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.topic)// .build(); } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentClimate.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentClimate.java index e761caa95a291..caab26ddf8d45 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentClimate.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentClimate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCover.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCover.java index 807c2126908b7..b732455a5b89e 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCover.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentCover.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -48,8 +48,7 @@ public ComponentCover(CFactory.ComponentConfiguration componentConfiguration) { RollershutterValue value = new RollershutterValue(channelConfiguration.payload_open, channelConfiguration.payload_close, channelConfiguration.payload_stop); - buildChannel(switchChannelID, value, channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener())// + buildChannel(switchChannelID, value, channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain)// .build(); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentFan.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentFan.java index 4576e26c35406..b77869d686724 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentFan.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentFan.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,8 +45,7 @@ public ComponentFan(CFactory.ComponentConfiguration componentConfiguration) { super(componentConfiguration, ChannelConfiguration.class); OnOffValue value = new OnOffValue(channelConfiguration.payload_on, channelConfiguration.payload_off); - buildChannel(switchChannelID, value, channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener())// + buildChannel(switchChannelID, value, channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain)// .build(); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLight.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLight.java index 4861e0eac1a86..fc9e915425272 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLight.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLight.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -103,17 +103,17 @@ public ComponentLight(CFactory.ComponentConfiguration builder) { ColorValue value = new ColorValue(true, channelConfiguration.payload_on, channelConfiguration.payload_off, 100); // Create three MQTT subscriptions and use this class object as update listener - switchChannel = buildChannel(switchChannelID, value, channelConfiguration.name).listener(this)// + switchChannel = buildChannel(switchChannelID, value, channelConfiguration.name, this)// .stateTopic(channelConfiguration.state_topic, channelConfiguration.state_value_template)// .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain)// .build(false); - colorChannel = buildChannel(colorChannelID, value, channelConfiguration.name).listener(this)// + colorChannel = buildChannel(colorChannelID, value, channelConfiguration.name, this)// .stateTopic(channelConfiguration.rgb_state_topic, channelConfiguration.rgb_value_template)// .commandTopic(channelConfiguration.rgb_command_topic, channelConfiguration.retain)// .build(false); - brightnessChannel = buildChannel(brightnessChannelID, value, channelConfiguration.name).listener(this)// + brightnessChannel = buildChannel(brightnessChannelID, value, channelConfiguration.name, this)// .stateTopic(channelConfiguration.brightness_state_topic, channelConfiguration.brightness_value_template)// .commandTopic(channelConfiguration.brightness_command_topic, channelConfiguration.retain)// .build(false); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLock.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLock.java index b15b1c403879e..81316989c60f2 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLock.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentLock.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -52,7 +52,7 @@ public ComponentLock(CFactory.ComponentConfiguration componentConfiguration) { buildChannel(switchChannelID, new OnOffValue(channelConfiguration.payload_lock, channelConfiguration.payload_unlock), - channelConfiguration.name).listener(componentConfiguration.getUpdateListener())// + channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain)// .build(); diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSensor.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSensor.java index d6e2a21d9d927..d3429ebc2d4ca 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSensor.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,9 +12,12 @@ */ package org.openhab.binding.mqtt.homeassistant.internal; +import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.mqtt.generic.values.NumberValue; import org.openhab.binding.mqtt.generic.values.TextValue; +import org.openhab.binding.mqtt.generic.values.Value; /** * A MQTT sensor, following the https://www.home-assistant.io/components/sensor.mqtt/ specification. @@ -33,7 +36,7 @@ static class ChannelConfiguration extends BaseChannelConfiguration { super("MQTT Sensor"); } - protected String unit_of_measurement = ""; + protected @Nullable String unit_of_measurement; protected @Nullable String device_class; protected boolean force_update = false; protected int expire_after = 0; @@ -48,10 +51,18 @@ public ComponentSensor(CFactory.ComponentConfiguration componentConfiguration) { throw new UnsupportedOperationException("Component:Sensor does not support forced updates"); } - buildChannel(sensorChannelID, new TextValue(), channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener())// + Value value; + + String uom = channelConfiguration.unit_of_measurement; + + if (uom != null && StringUtils.isNotBlank(uom)) { + value = new NumberValue(null, null, null, uom); + } else { + value = new TextValue(); + } + + buildChannel(sensorChannelID, value, channelConfiguration.name, componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// - .unit(channelConfiguration.unit_of_measurement)// .build(); } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSwitch.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSwitch.java index 8c522f671798a..95a808896a001 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSwitch.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSwitch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -34,31 +34,41 @@ static class ChannelConfiguration extends BaseChannelConfiguration { super("MQTT Switch"); } - protected boolean optimistic = false; + protected @Nullable Boolean optimistic; - protected String state_topic = ""; - protected String state_on = "true"; - protected String state_off = "false"; protected @Nullable String command_topic; - protected String payload_on = "true"; - protected String payload_off = "false"; + protected String state_topic = ""; + + protected @Nullable String state_on; + protected @Nullable String state_off; + protected String payload_on = "ON"; + protected String payload_off = "OFF"; + + protected @Nullable String json_attributes_topic; + protected @Nullable String json_attributes_template; } public ComponentSwitch(CFactory.ComponentConfiguration componentConfiguration) { super(componentConfiguration, ChannelConfiguration.class); - // We do not support all HomeAssistant quirks - if (channelConfiguration.optimistic && StringUtils.isNotBlank(channelConfiguration.state_topic)) { + boolean optimistic = channelConfiguration.optimistic != null ? channelConfiguration.optimistic + : StringUtils.isBlank(channelConfiguration.state_topic); + + if (optimistic && StringUtils.isNotBlank(channelConfiguration.state_topic)) { throw new UnsupportedOperationException("Component:Switch does not support forced optimistic mode"); } - OnOffValue value = new OnOffValue(channelConfiguration.state_on, channelConfiguration.state_off, - channelConfiguration.payload_on, channelConfiguration.payload_off); + String state_on = channelConfiguration.state_on != null ? channelConfiguration.state_on + : channelConfiguration.payload_on; + String state_off = channelConfiguration.state_off != null ? channelConfiguration.state_off + : channelConfiguration.payload_off; + + OnOffValue value = new OnOffValue(state_on, state_off, channelConfiguration.payload_on, + channelConfiguration.payload_off); - buildChannel(switchChannelID, value, channelConfiguration.name) - .listener(componentConfiguration.getUpdateListener())// + buildChannel(switchChannelID, value, "state", componentConfiguration.getUpdateListener())// .stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)// - .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain)// + .commandTopic(channelConfiguration.command_topic, channelConfiguration.retain, channelConfiguration.qos)// .build(); } } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ConnectionDeserializer.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ConnectionDeserializer.java new file mode 100644 index 0000000000000..491a072080df0 --- /dev/null +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ConnectionDeserializer.java @@ -0,0 +1,36 @@ +/** + * 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.mqtt.homeassistant.internal; + +import com.google.gson.*; + +import java.lang.reflect.Type; + +/** + * The {@link ConnectionDeserializer} will de-serialize a connection-list + * + * see: https://www.home-assistant.io/integrations/sensor.mqtt/#connections + * + * @author Jan N. Klug - Initial contribution + */ +public class ConnectionDeserializer implements JsonDeserializer<BaseChannelConfiguration.Connection> { + @Override + public BaseChannelConfiguration.Connection deserialize(JsonElement json, Type typeOfT, + JsonDeserializationContext context) throws JsonParseException { + JsonArray list = json.getAsJsonArray(); + BaseChannelConfiguration.Connection conn = new BaseChannelConfiguration.Connection(); + conn.type = list.get(0).getAsString(); + conn.identifier = list.get(1).getAsString(); + return conn; + } +} diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/DiscoverComponents.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/DiscoverComponents.java index 062a4e3535a14..8b27a30e2ffc0 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/DiscoverComponents.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/DiscoverComponents.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,7 +45,7 @@ public class DiscoverComponents implements MqttMessageSubscriber { private final Logger logger = LoggerFactory.getLogger(DiscoverComponents.class); private final ThingUID thingUID; private final ScheduledExecutorService scheduler; - private final @Nullable ChannelStateUpdateListener updateListener; + private final ChannelStateUpdateListener updateListener; private final TransformationServiceProvider transformationServiceProvider; protected final CompletableFuture<@Nullable Void> discoverFinishedFuture = new CompletableFuture<>(); @@ -72,7 +72,7 @@ public static interface ComponentDiscovered { * @param channelStateUpdateListener Channel update listener. Usually the handler. */ public DiscoverComponents(ThingUID thingUID, ScheduledExecutorService scheduler, - @Nullable ChannelStateUpdateListener channelStateUpdateListener, Gson gson, + ChannelStateUpdateListener channelStateUpdateListener, Gson gson, TransformationServiceProvider transformationServiceProvider) { this.thingUID = thingUID; this.scheduler = scheduler; diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HaID.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HaID.java index 5298ddc3277ec..00a37ca251c4d 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HaID.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HaID.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HandlerConfiguration.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HandlerConfiguration.java index 065fda88d6507..d7508ad37f083 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HandlerConfiguration.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/HandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ListOrStringDeserializer.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ListOrStringDeserializer.java index c9746b40759b9..df5aadfa3f410 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ListOrStringDeserializer.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ListOrStringDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/MappingJsonReader.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/MappingJsonReader.java index c2b2dd2d3c28d..79514abf4dd83 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/MappingJsonReader.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/MappingJsonReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/discovery/HomeAssistantDiscovery.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/discovery/HomeAssistantDiscovery.java index 9ad84582ac22c..293ddd034363d 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/discovery/HomeAssistantDiscovery.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/discovery/HomeAssistantDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,6 +13,8 @@ package org.openhab.binding.mqtt.homeassistant.internal.discovery; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -27,6 +29,7 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; @@ -62,6 +65,8 @@ public class HomeAssistantDiscovery extends AbstractMQTTDiscovery { private final Logger logger = LoggerFactory.getLogger(HomeAssistantDiscovery.class); protected final Map<String, Set<HaID>> componentsPerThingID = new TreeMap<>(); protected final Map<String, ThingUID> thingIDPerTopic = new TreeMap<>(); + protected final Map<String, DiscoveryResult> results = new TreeMap<>(); + private @Nullable ScheduledFuture<?> future; private final Gson gson; @@ -124,6 +129,8 @@ protected void unsetTypeProvider(MqttChannelTypeProvider provider) { @Override public void receivedMessage(ThingUID connectionBridge, MqttBrokerConnection connection, String topic, byte[] payload) { + resetTimeout(); + // For HomeAssistant we need to subscribe to a wildcard topic, because topics can either be: // homeassistant/<component>/<node_id>/<object_id>/config OR // homeassistant/<component>/<object_id>/config. @@ -138,7 +145,7 @@ public void receivedMessage(ThingUID connectionBridge, MqttBrokerConnection conn if (future != null) { future.cancel(false); } - this.future = scheduler.schedule(componentsPerThingID::clear, 2, TimeUnit.SECONDS); + this.future = scheduler.schedule(this::publishResults, 2, TimeUnit.SECONDS); BaseChannelConfiguration config = BaseChannelConfiguration .fromString(new String(payload, StandardCharsets.UTF_8), gson); @@ -153,9 +160,6 @@ public void receivedMessage(ThingUID connectionBridge, MqttBrokerConnection conn final ThingTypeUID typeID = new ThingTypeUID(MqttBindingConstants.BINDING_ID, MqttBindingConstants.HOMEASSISTANT_MQTT_THING.getId() + "_" + thingID); - ThingType type = typeProvider.derive(typeID, MqttBindingConstants.HOMEASSISTANT_MQTT_THING).build(); - typeProvider.setThingTypeIfAbsent(typeID, type); - final ThingUID thingUID = new ThingUID(typeID, connectionBridge, thingID); thingIDPerTopic.put(topic, thingUID); @@ -173,12 +177,31 @@ public void receivedMessage(ThingUID connectionBridge, MqttBrokerConnection conn HandlerConfiguration handlerConfig = new HandlerConfiguration(haID.baseTopic, topics); properties = handlerConfig.appendToProperties(properties); properties = config.appendToProperties(properties); - // First remove an already discovered thing with the same ID - thingRemoved(thingUID); - // Because we need the new properties map with the updated "components" list - thingDiscovered(DiscoveryResultBuilder.create(thingUID).withProperties(properties) - .withRepresentationProperty("objectid").withBridge(connectionBridge) - .withLabel(config.getThingName() + " (" + componentNames + ")").build()); + + synchronized (results) { + // Because we need the new properties map with the updated "components" list + results.put(thingUID.getAsString(), + DiscoveryResultBuilder.create(thingUID).withProperties(properties) + .withRepresentationProperty("objectid").withBridge(connectionBridge) + .withLabel(config.getThingName() + " (" + componentNames + ")").build()); + } + } + + protected void publishResults() { + Collection<DiscoveryResult> localResults; + + synchronized (results) { + localResults = new ArrayList<>(results.values()); + results.clear(); + componentsPerThingID.clear(); + } + for (DiscoveryResult result : localResults) { + final ThingTypeUID typeID = result.getThingTypeUID(); + ThingType type = typeProvider.derive(typeID, MqttBindingConstants.HOMEASSISTANT_MQTT_THING).build(); + typeProvider.setThingTypeIfAbsent(typeID, type); + + thingDiscovered(result); + } } @Override diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/handler/HomeAssistantThingHandler.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/handler/HomeAssistantThingHandler.java index 199d1c7a524ca..494a70121213b 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/handler/HomeAssistantThingHandler.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/handler/HomeAssistantThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,8 +22,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Channel; @@ -36,6 +34,7 @@ import org.eclipse.smarthome.core.thing.type.ChannelDefinition; import org.eclipse.smarthome.core.thing.type.ChannelGroupDefinition; import org.eclipse.smarthome.core.thing.type.ThingType; +import org.eclipse.smarthome.core.thing.util.ThingHelper; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.openhab.binding.mqtt.generic.AbstractMQTTThingHandler; @@ -52,6 +51,7 @@ import org.openhab.binding.mqtt.homeassistant.internal.DiscoverComponents.ComponentDiscovered; import org.openhab.binding.mqtt.homeassistant.internal.HaID; import org.openhab.binding.mqtt.homeassistant.internal.HandlerConfiguration; +import org.openhab.binding.mqtt.homeassistant.internal.util.FutureCollector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,6 +94,8 @@ public class HomeAssistantThingHandler extends AbstractMQTTThingHandler protected final TransformationServiceProvider transformationServiceProvider; + private boolean started; + /** * Create a new thing handler for HomeAssistant MQTT components. * A channel type provider and a topic value receive timeout must be provided. @@ -119,8 +121,10 @@ public HomeAssistantThingHandler(Thing thing, MqttChannelTypeProvider channelTyp @SuppressWarnings({ "null", "unused" }) @Override public void initialize() { + started = false; + config = getConfigAs(HandlerConfiguration.class); - if (CollectionUtils.isEmpty(config.topics)) { + if (config.topics == null || config.topics.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Device topics unknown"); return; } @@ -182,6 +186,8 @@ public CompletableFuture<Void> unsubscribeAll() { */ @Override protected CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection) { + started = true; + connection.setRetain(true); connection.setQos(1); @@ -189,7 +195,7 @@ public CompletableFuture<Void> unsubscribeAll() { // Start all known components and channels within the components and put the Thing offline // if any subscribing failed ( == broker connection lost) - CompletableFuture<@Nullable Void> future = haComponents.values().stream() + CompletableFuture<@Nullable Void> future = haComponents.values().parallelStream() .map(e -> e.start(connection, scheduler, attributeReceiveTimeout)) .reduce(CompletableFuture.completedFuture(null), (a, v) -> a.thenCompose(b -> v)) // reduce to one .exceptionally(e -> { @@ -203,10 +209,16 @@ public CompletableFuture<Void> unsubscribeAll() { @Override protected void stop() { - discoverComponents.stopDiscovery(); - delayedProcessing.join(); - // haComponents does not need to be synchronised -> the discovery thread is disabled - haComponents.values().stream().map(e -> e.stop()); + if (started) { + discoverComponents.stopDiscovery(); + delayedProcessing.join(); + // haComponents does not need to be synchronised -> the discovery thread is disabled + haComponents.values().parallelStream().map(e -> e.stop()) // + // we need to join all the stops, otherwise they might not be done when start is called + .collect(FutureCollector.allOf()).join(); + + started = false; + } } @SuppressWarnings({ "null", "unused" }) @@ -250,7 +262,6 @@ public void accept(List<AbstractComponent<?>> discoveredComponentsList) { return; } - List<Channel> channels; synchronized (haComponents) { // sync whenever discoverComponents is started for (AbstractComponent<?> discovered : discoveredComponentsList) { AbstractComponent<?> known = haComponents.get(discovered.uid().getId()); @@ -275,28 +286,25 @@ public void accept(List<AbstractComponent<?>> discoveredComponentsList) { logger.warn("Failed to start component {}", discovered.uid(), e); return null; }); + + Collection<Channel> channels = discovered.channelTypes().values().stream().map(c -> c.getChannel()) + .collect(Collectors.toList()); + ThingHelper.addChannelsToThing(thing, channels); } - // Add channels to Thing - channels = haComponents.values().stream().map(c -> c.channelTypes().values()).flatMap(Collection::stream) - .map(c -> c.getChannel()).collect(Collectors.toList()); } updateThingType(); - updateThing(editThing().withChannels(channels).build()); updateThingStatus(); } private void updateThingStatus() { - - boolean allActive; synchronized (haComponents) { // sync whenever discoverComponents is started - allActive = haComponents.values().stream().allMatch(comp -> comp.isActive()); - } - - if (allActive) { - updateStatus(ThingStatus.ONLINE); - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE, "At least one component not active"); + boolean allActive = haComponents.values().stream().allMatch(comp -> comp.isActive()); + if (allActive) { + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.GONE, "At least one component not active"); + } } } @@ -323,7 +331,7 @@ private void updateThingType() { @Override public void updateChannelState(ChannelUID channelUID, State value) { - if (StringUtils.equals(channelUID.getIdWithoutGroup(), AVAILABILITY_CHANNEL)) { + if (AVAILABILITY_CHANNEL.equals(channelUID.getIdWithoutGroup())) { updateThingStatus(); return; } diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/util/FutureCollector.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/util/FutureCollector.java index 27a4580db9e2c..947d769336b55 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/util/FutureCollector.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/util/FutureCollector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,4 +35,4 @@ public static <X> Collector<CompletableFuture<X>, Set<CompletableFuture<X>>, Com return CompletableFuture.allOf(a.toArray(new CompletableFuture[a.size()])); }, Collector.Characteristics.UNORDERED); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/config/homeassistant-channel-config.xml b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/config/homeassistant-channel-config.xml index bb88886864ce2..d1c27cced9c93 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/config/homeassistant-channel-config.xml +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/config/homeassistant-channel-config.xml @@ -7,14 +7,9 @@ <config-description uri="mqtt:ha_channel"> <parameter name="component" type="text" readOnly="true" required="true"> <label>Component</label> - <description>Type of the channel group.</description> + <description>HomeAssistant component type (e.g. binary_sensor, switch, light)</description> <default></default> </parameter> - <parameter name="component" type="text" readOnly="true" required="true"> - <label>Component</label> - <description>HomeAssistant component type (e.g. binary_sensor, switch, light)</description> - <default></default> - </parameter> <parameter name="nodeid" type="text" readOnly="true"> <label>Node ID</label> <description>Optional node name of the component</description> diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/thing/homeassistant-thing.xml b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/thing/homeassistant-thing.xml index 641a36e5c4874..fa18f92376844 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/thing/homeassistant-thing.xml +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/main/resources/ESH-INF/thing/homeassistant-thing.xml @@ -13,12 +13,12 @@ <description>You need a configured Broker first. This Thing represents a device, that follows the "HomeAssistant MQTT Component" specification.</description> <config-description> <parameter name="topics" type="text" required="true" multiple="true"> - <label>MQTT config topic</label> + <label>MQTT Config Topic</label> <description>List of HomeAssistant configuration topics (e.g. /homeassistant/switch/4711/config)</description> </parameter> <parameter name="basetopic" type="text" required="true"> - <label>MQTT base prefix</label> + <label>MQTT Base Prefix</label> <description>MQTT base prefix</description> <default>homeassistant</default> </parameter> diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HAConfigurationTests.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HAConfigurationTests.java index a6c2be5080c2e..374d7584874f4 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HAConfigurationTests.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HAConfigurationTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +/** + * @author Jochen Klein - Initial contribution + */ public class HAConfigurationTests { private Gson gson = new GsonBuilder().registerTypeAdapterFactory(new ChannelConfigurationTypeAdapterFactory()) diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HaIDTests.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HaIDTests.java index 16403475e758b..161d0965de362 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HaIDTests.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/HaIDTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,9 @@ import org.eclipse.smarthome.config.core.Configuration; import org.junit.Test; +/** + * @author Jochen Klein - Initial contribution + */ public class HaIDTests { @Test diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/handler/ThingChannelConstants.java b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/handler/ThingChannelConstants.java index 98046b91f6e99..44ca59041cfc6 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/handler/ThingChannelConstants.java +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/java/org/openhab/binding/mqtt/homeassistant/internal/handler/ThingChannelConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configA.json b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configA.json index 59cd69a304aa1..e832de078166e 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configA.json +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configA.json @@ -13,10 +13,10 @@ "H" ], "cns": [ - { - "type": "I1", - "identifier": "I2" - } + [ + "I1", + "I2" + ] ], "name": "J", "mdl": "K", @@ -24,4 +24,4 @@ "mf": "M" }, "~": "D/" -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configB.json b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configB.json index 8b3a6fd2d3d96..b0404181ca9c3 100644 --- a/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configB.json +++ b/bundles/org.openhab.binding.mqtt.homeassistant/src/test/resources/org/openhab/binding/mqtt/homeassistant/internal/configB.json @@ -14,10 +14,10 @@ "device": { "ids": "H", "cns": [ - { - "type": "I1", - "identifier": "I2" - } + [ + "I1", + "I2" + ] ], "name": "J", "mdl": "K", diff --git a/bundles/org.openhab.binding.mqtt.homie/pom.xml b/bundles/org.openhab.binding.mqtt.homie/pom.xml index 22b7024db14af..01347cdc158c4 100644 --- a/bundles/org.openhab.binding.mqtt.homie/pom.xml +++ b/bundles/org.openhab.binding.mqtt.homie/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mqtt.homie</artifactId> diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/feature/feature.xml b/bundles/org.openhab.binding.mqtt.homie/src/main/feature/feature.xml index f803453db2584..f0fccb1c0a4a3 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mqtt.homie-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mqtt-homie" description="MQTT Binding Homie" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttBindingConstants.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttBindingConstants.java index 56a1f40735ca2..fb18a55edd2e9 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttBindingConstants.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttThingHandlerFactory.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttThingHandlerFactory.java index 0a694c877a0e4..2004b179755d9 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttThingHandlerFactory.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/generic/internal/MqttThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/discovery/Homie300Discovery.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/discovery/Homie300Discovery.java index 7d1a5538c00ad..f964c0644c4c2 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/discovery/Homie300Discovery.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/discovery/Homie300Discovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,6 +80,8 @@ public static boolean checkVersion(byte[] payload) { @Override public void receivedMessage(ThingUID connectionBridge, MqttBrokerConnection connection, String topic, byte[] payload) { + resetTimeout(); + if (!checkVersion(payload)) { logger.trace("Found homie device. But version {} is out of range.", new String(payload, StandardCharsets.UTF_8)); diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandler.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandler.java index ca000b5fcdb31..50a350075382c 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandler.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -116,9 +116,12 @@ public void handleRemoval() { @Override protected CompletableFuture<@Nullable Void> start(MqttBrokerConnection connection) { logger.debug("About to start Homie device {}", device.attributes.name); - // We have mostly retained messages for Homie. QoS 1 is required. - connection.setRetain(true); - connection.setQos(1); + if (connection.getQos() != 1) { + // QoS 1 is required. + logger.warn( + "Homie devices require QoS 1 but Qos 0/2 is configured. Using override. Please check the configuration"); + connection.setQos(1); + } return device.subscribe(connection, scheduler, attributeReceiveTimeout).thenCompose((Void v) -> { return device.startChannels(connection, scheduler, attributeReceiveTimeout, this); }).thenRun(() -> { diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Device.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Device.java index cb4793b37d581..ee84584874fb3 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Device.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,6 +26,7 @@ import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.util.UIDUtils; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; +import org.openhab.binding.mqtt.generic.ChannelConfig; import org.openhab.binding.mqtt.generic.mapping.AbstractMqttAttributeClass; import org.openhab.binding.mqtt.generic.tools.ChildMap; import org.openhab.binding.mqtt.homie.internal.handler.HomieThingHandler; @@ -158,11 +159,15 @@ public Device(ThingUID thingUID, DeviceCallback callback, DeviceAttributes attri */ @SuppressWarnings({ "null", "unused" }) public @Nullable Property getProperty(ChannelUID channelUID) { - Node node = nodes.get(channelUID.getGroupId()); + final String groupId = channelUID.getGroupId(); + if (groupId == null) { + return null; + } + Node node = nodes.get(UIDUtils.decode(groupId)); if (node == null) { return null; } - return node.properties.get(channelUID.getIdWithoutGroup()); + return node.properties.get(UIDUtils.decode(channelUID.getIdWithoutGroup())); } /** @@ -198,6 +203,11 @@ public void initialize(String baseTopic, String deviceID, List<Channel> channels this.deviceID = deviceID; nodes.clear(); for (Channel channel : channels) { + final ChannelConfig channelConfig = channel.getConfiguration().as(ChannelConfig.class); + if (!channelConfig.commandTopic.isEmpty() && channelConfig.retained != true) { + logger.warn("Channel {} in device {} is missing the 'retained' flag. Check your configuration.", + channel.getUID(), deviceID); + } final String channelGroupId = channel.getUID().getGroupId(); if (channelGroupId == null) { continue; diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceAttributes.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceAttributes.java index 9ec0e38d24344..ba03aaa5548e2 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceAttributes.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceAttributes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceCallback.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceCallback.java index 754121d07c3c4..d95cd95fbbbe9 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceCallback.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/DeviceCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/HandlerConfiguration.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/HandlerConfiguration.java index c6db62072260f..3f0a901edbb7d 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/HandlerConfiguration.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/HandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Node.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Node.java index a28b60720b3aa..0093b4e34d790 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Node.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Node.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/NodeAttributes.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/NodeAttributes.java index 573d206ce5f73..4eefc2c8089ff 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/NodeAttributes.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/NodeAttributes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java index fd5910ba9b6de..6dc1fdf7e53d5 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -138,8 +138,8 @@ private ChannelType createChannelType(PropertyAttributes attributes, ChannelStat if (attributes.retained) { return ChannelTypeBuilder.state(channelTypeUID, attributes.name, channelState.getItemType()) .withConfigDescriptionURI(URI.create(MqttBindingConstants.CONFIG_HOMIE_CHANNEL)) - .withStateDescription( - channelState.getCache().createStateDescription(attributes.unit, !attributes.settable)) + .withStateDescription(channelState.getCache().createStateDescription(!attributes.settable).build() + .toStateDescription()) .build(); } else { if (attributes.datatype.equals(DataTypeEnum.enum_)) { @@ -193,7 +193,7 @@ public void createChannelFromAttribute() { step = new BigDecimal(1); } - value = new NumberValue(min, max, step); + value = new NumberValue(min, max, step, attributes.unit); break; case string_: case unknown: @@ -210,7 +210,7 @@ public void createChannelFromAttribute() { } if (attributes.settable) { - b = b.withCommandTopic(commandTopic); + b = b.withCommandTopic(commandTopic).withRetain(true); } final ChannelState channelState = new ChannelState(b.build(), channelUID, value, callback); diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyAttributes.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyAttributes.java index d418e36de12f6..fc90f5c52c37a 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyAttributes.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyAttributes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/resources/ESH-INF/thing/homie-thing.xml b/bundles/org.openhab.binding.mqtt.homie/src/main/resources/ESH-INF/thing/homie-thing.xml index 5815d80e1128c..cc3ae1ea45f49 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/resources/ESH-INF/thing/homie-thing.xml +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/resources/ESH-INF/thing/homie-thing.xml @@ -9,7 +9,7 @@ <bridge-type-ref id="broker" /> <bridge-type-ref id="systemBroker" /> </supported-bridge-type-refs> - <label>Homie MQTT device</label> + <label>Homie MQTT Device</label> <description>You need a configured Broker first. This thing represents a device, that follows the "MQTT Homie Convention" (Version 3.x).</description> <properties> <property name="homieversion" /> @@ -20,12 +20,12 @@ <description>Homie Device ID. This is part of the MQTT topic, e.g. "homie/deviceid/$homie".</description> </parameter> <parameter name="basetopic" type="text" required="true"> - <label>MQTT base prefix</label> + <label>MQTT Base Prefix</label> <description>MQTT base prefix</description> <default>homie</default> </parameter> <parameter name="removetopics" type="boolean"> - <label>Remove retained topics</label> + <label>Remove Retained Topics</label> <description>Remove retained topics when thing is deleted</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ChannelStateHelper.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ChannelStateHelper.java index fd30efafd8af0..a5d23de7c48d2 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ChannelStateHelper.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ChannelStateHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,9 @@ import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.openhab.binding.mqtt.generic.ChannelState; +/** + * @author David Graeff - Initial contribution + */ @NonNullByDefault public class ChannelStateHelper { public static void setConnection(ChannelState cs, MqttBrokerConnection connection) { diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ThingHandlerHelper.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ThingHandlerHelper.java index e94ac888ed264..89b7629a25785 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ThingHandlerHelper.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/ThingHandlerHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,9 @@ import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.openhab.binding.mqtt.generic.AbstractMQTTThingHandler; +/** + * @author David Graeff - Initial contribution + */ @NonNullByDefault public class ThingHandlerHelper { public static void setConnection(AbstractMQTTThingHandler h, MqttBrokerConnection connection) { diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/generic/internal/mapping/HomieChildMapTests.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/generic/internal/mapping/HomieChildMapTests.java index ab0ee3a56e9e7..fc218b0df3980 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/generic/internal/mapping/HomieChildMapTests.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/generic/internal/mapping/HomieChildMapTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,7 +39,7 @@ public class HomieChildMapTests { private @Mock DeviceCallback callback; - private final String deviceID = ThingChannelConstants.testHomieThing.getId(); + private final String deviceID = ThingChannelConstants.TEST_HOMIE_THING.getId(); private final String deviceTopic = "homie/" + deviceID; // A completed future is returned for a subscribe call to the attributes @@ -48,7 +48,7 @@ public class HomieChildMapTests { ChildMap<Node> subject = new ChildMap<>(); private Node createNode(String id) { - Node node = new Node(deviceTopic, id, ThingChannelConstants.testHomieThing, callback, + Node node = new Node(deviceTopic, id, ThingChannelConstants.TEST_HOMIE_THING, callback, spy(new NodeAttributes())); doReturn(future).when(node.attributes).subscribeAndReceive(any(), any(), anyString(), any(), anyInt()); doReturn(future).when(node.attributes).unsubscribe(); diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandlerTests.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandlerTests.java index efb0a97660e16..3f7023554c7bd 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandlerTests.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/HomieThingHandlerTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,7 @@ import static org.junit.Assert.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; -import static org.openhab.binding.mqtt.homie.internal.handler.ThingChannelConstants.testHomieThing; +import static org.openhab.binding.mqtt.homie.internal.handler.ThingChannelConstants.TEST_HOMIE_THING; import java.lang.reflect.Field; import java.util.ArrayList; @@ -45,7 +45,9 @@ import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.TypeParser; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; +import org.eclipse.smarthome.test.java.JavaTest; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -100,7 +102,7 @@ public class HomieThingHandlerTests { private final MqttChannelTypeProvider channelTypeProvider = new MqttChannelTypeProvider(thingTypeRegistry); - private final String deviceID = ThingChannelConstants.testHomieThing.getId(); + private final String deviceID = ThingChannelConstants.TEST_HOMIE_THING.getId(); private final String deviceTopic = "homie/" + deviceID; // A completed future is returned for a subscribe call to the attributes @@ -116,7 +118,7 @@ public void setUp() { config.put("basetopic", "homie"); config.put("deviceid", deviceID); - thing = ThingBuilder.create(MqttBindingConstants.HOMIE300_MQTT_THING, testHomieThing.getId()) + thing = ThingBuilder.create(MqttBindingConstants.HOMIE300_MQTT_THING, TEST_HOMIE_THING.getId()) .withConfiguration(config).build(); thing.setStatusInfo(thingStatus); @@ -230,8 +232,10 @@ public void handleCommandRefresh() { thingHandler.device.nodes.put(node.nodeID, node); ThingHandlerHelper.setConnection(thingHandler, connection); - thingHandler.handleCommand(property.channelUID, RefreshType.REFRESH); + // we need to set a channel value first, undefined values ignored on REFRESH + property.getChannelState().getCache().update(new StringType("testString")); + thingHandler.handleCommand(property.channelUID, RefreshType.REFRESH); verify(callback).stateUpdated(argThat(arg -> property.channelUID.equals(arg)), argThat(arg -> property.getChannelState().getCache().getChannelState().equals(arg))); } diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/ThingChannelConstants.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/ThingChannelConstants.java index dee5282882a6d..202876593107c 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/ThingChannelConstants.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/handler/ThingChannelConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,15 +32,15 @@ */ public class ThingChannelConstants { // Common ThingUID and ChannelUIDs - final public static ThingUID testHomieThing = new ThingUID(HOMIE300_MQTT_THING, "device123"); + public static final ThingUID TEST_HOMIE_THING = new ThingUID(HOMIE300_MQTT_THING, "device123"); - final public static ChannelTypeUID unknownChannel = new ChannelTypeUID(BINDING_ID, "unknown"); + public static final ChannelTypeUID UNKNOWN_CHANNEL = new ChannelTypeUID(BINDING_ID, "unknown"); - final public static String jsonPathJSON = "{ \"device\": { \"status\": { \"temperature\": 23.2 }}}"; - final public static String jsonPathPattern = "$.device.status.temperature"; + public static final String JSON_PATH_JSON = "{ \"device\": { \"status\": { \"temperature\": 23.2 }}}"; + public static final String JSON_PATH_PATTERN = "$.device.status.temperature"; - final public static List<Channel> thingChannelList = new ArrayList<>(); - final public static List<Channel> thingChannelListWithJson = new ArrayList<>(); + public static final List<Channel> THING_CHANNEL_LIST = new ArrayList<>(); + public static final List<Channel> THING_CHANNEL_LIST_WITH_JSON = new ArrayList<>(); static Configuration textConfiguration() { Map<String, Object> data = new HashMap<>(); @@ -53,7 +53,7 @@ static Configuration textConfigurationWithJson() { Map<String, Object> data = new HashMap<>(); data.put("stateTopic", "test/state"); data.put("commandTopic", "test/command"); - data.put("transformationPattern", "JSONPATH:" + jsonPathPattern); + data.put("transformationPattern", "JSONPATH:" + JSON_PATH_PATTERN); return new Configuration(data); } diff --git a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyHelper.java b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyHelper.java index 2d345c8f31957..6bb5070172163 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyHelper.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/test/java/org/openhab/binding/mqtt/homie/internal/homie300/PropertyHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/NOTICE b/bundles/org.openhab.binding.mqtt/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.mqtt/NOTICE +++ b/bundles/org.openhab.binding.mqtt/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.mqtt/README.md b/bundles/org.openhab.binding.mqtt/README.md index 3d72875457b2a..6fa804485baf9 100644 --- a/bundles/org.openhab.binding.mqtt/README.md +++ b/bundles/org.openhab.binding.mqtt/README.md @@ -7,7 +7,7 @@ MQTT is a server/client architecture. A server, also called broker is not provided within this binding. You can use any of the freely available MQTT Brokers like [Mosquitto](https://mosquitto.org/) -or [Moquette](https://moquette-io.github.io/moquette/) or install the [included Moquette broker](https://www.openhab.org/addons/integrations/mqttembeddedbroker/) as addon. +or [Moquette](https://moquette-io.github.io/moquette/) or install the [included Moquette broker](https://www.openhab.org/addons/integrations/mqttembeddedbroker/) as add-on. This particular binding allows to configure connections to brokers via openHAB Things. This binding does NOT allow you to link Channels to MQTT topics or perform auto-discovery of available @@ -32,12 +32,11 @@ Additionally the following parameters can be set: * __qos__: Quality of Service. Can be 0, 1 or 2. Please read the MQTT specification for details. Defaults to 0. * __clientID__: Use a fixed client ID. Defaults to empty which means a user ID is generated for this connection. -* __retainMessages__: Retain messages. Defaults to false. Reconnect parameters are: * __reconnectTime__: Reconnect time in ms. If a connection is lost, the binding will wait this time before it tries to reconnect. Defaults to 60000 (60s). -* __keepAlive__: Keep alive / heartbeat timer in ms. It can take up to this time to determine if a server connection is lost. A lower value may keep the broker unnecessarily busy for no or little additional value. Defaults to 60000 (60s). +* __keepAlive__: Keep alive / heartbeat timer in s. It can take up to this time to determine if a server connection is lost. A lower value may keep the broker unnecessarily busy for no or little additional value. Defaults to 60s. An MQTT last will and testament can be configured: diff --git a/bundles/org.openhab.binding.mqtt/pom.xml b/bundles/org.openhab.binding.mqtt/pom.xml index cbeea62081b6d..538c3a4fb21fc 100644 --- a/bundles/org.openhab.binding.mqtt/pom.xml +++ b/bundles/org.openhab.binding.mqtt/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.mqtt</artifactId> diff --git a/bundles/org.openhab.binding.mqtt/src/main/feature/feature.xml b/bundles/org.openhab.binding.mqtt/src/main/feature/feature.xml index 48874782fe1e7..24b80f2b292fb 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.mqtt/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.mqtt-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-mqtt" description="MQTT Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/MqttBindingConstants.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/MqttBindingConstants.java index ca7104bc98ad0..273ef74175b83 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/MqttBindingConstants.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/MqttBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.mqtt; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ThingTypeUID; /** @@ -20,6 +21,7 @@ * * @author David Graeff - Initial contribution */ +@NonNullByDefault public class MqttBindingConstants { private static final String BINDING_ID = "mqtt"; diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/action/MQTTActions.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/action/MQTTActions.java index 93c4066924fbb..a0d6a7a6d175a 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/action/MQTTActions.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/action/MQTTActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java index 2ea8c02270da3..034df79d0a4cd 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,11 +14,15 @@ import java.util.Date; import java.util.Set; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base MQTT discovery class. Responsible for connecting to the {@link MQTTTopicDiscoveryService}. @@ -36,12 +40,19 @@ */ @NonNullByDefault public abstract class AbstractMQTTDiscovery extends AbstractDiscoveryService implements MQTTTopicDiscoveryParticipant { - final protected String subscribeTopic; + private final Logger logger = LoggerFactory.getLogger(AbstractMQTTDiscovery.class); + + protected final String subscribeTopic; + + private int timeout; + + private @Nullable ScheduledFuture<?> scheduledStop; public AbstractMQTTDiscovery(@Nullable Set<ThingTypeUID> supportedThingTypes, int timeout, boolean backgroundDiscoveryEnabledByDefault, String baseTopic) { - super(supportedThingTypes, timeout, backgroundDiscoveryEnabledByDefault); + super(supportedThingTypes, 0, backgroundDiscoveryEnabledByDefault); this.subscribeTopic = baseTopic; + this.timeout = timeout; } /** @@ -49,12 +60,40 @@ public AbstractMQTTDiscovery(@Nullable Set<ThingTypeUID> supportedThingTypes, in */ protected abstract MQTTTopicDiscoveryService getDiscoveryService(); + private synchronized void stopTimeout() { + if (scheduledStop != null) { + scheduledStop.cancel(false); + scheduledStop = null; + } + } + + protected synchronized void resetTimeout() { + stopTimeout(); + + // schedule an automatic call of stopScan when timeout is reached + if (timeout > 0) { + Runnable runnable = new Runnable() { + @Override + public void run() { + try { + stopScan(); + } catch (Exception e) { + logger.debug("Exception occurred during execution: {}", e.getMessage(), e); + } + } + }; + + scheduledStop = scheduler.schedule(runnable, timeout, TimeUnit.SECONDS); + } + } + @Override protected void startScan() { if (isBackgroundDiscoveryEnabled()) { super.stopScan(); return; } + resetTimeout(); getDiscoveryService().subscribe(this, subscribeTopic); } @@ -64,10 +103,17 @@ protected synchronized void stopScan() { super.stopScan(); return; } + stopTimeout(); getDiscoveryService().unsubscribe(this); super.stopScan(); } + @Override + public synchronized void abortScan() { + stopTimeout(); + super.abortScan(); + } + @Override protected void startBackgroundDiscovery() { // Remove results that are restored after a restart diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryParticipant.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryParticipant.java index b7213fe782219..4095cd2d53409 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryService.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryService.java index 26c958df1bd41..b2ed4e6a6cd05 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryService.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/MQTTTopicDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/TopicSubscribe.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/TopicSubscribe.java index 996bad36576f6..99b51d4b7cc20 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/TopicSubscribe.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/TopicSubscribe.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import java.util.concurrent.CompletableFuture; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.eclipse.smarthome.io.transport.mqtt.MqttMessageSubscriber; @@ -26,7 +27,7 @@ */ @NonNullByDefault public class TopicSubscribe implements MqttMessageSubscriber { - final MqttBrokerConnection connection; + final @Nullable MqttBrokerConnection connection; final ThingUID thing; final String topic; final MQTTTopicDiscoveryParticipant topicDiscoveredListener; @@ -39,7 +40,7 @@ public class TopicSubscribe implements MqttMessageSubscriber { * @param topicDiscoveredListener A listener * @param thing A thing, used as an argument to the listener callback. */ - public TopicSubscribe(MqttBrokerConnection connection, String topic, + public TopicSubscribe(@Nullable MqttBrokerConnection connection, String topic, MQTTTopicDiscoveryParticipant topicDiscoveredListener, ThingUID thing) { this.connection = connection; this.thing = thing; @@ -49,6 +50,9 @@ public TopicSubscribe(MqttBrokerConnection connection, String topic, @Override public void processMessage(String topic, byte[] payload) { + final MqttBrokerConnection connection = this.connection; + if (connection == null) + return; if (payload.length > 0) { topicDiscoveredListener.receivedMessage(thing, connection, topic, payload); } else { @@ -62,7 +66,7 @@ public void processMessage(String topic, byte[] payload) { * @return Completes with true if successful. Completes with false if not connected yet. Exceptionally otherwise. */ public CompletableFuture<Boolean> start() { - return connection.subscribe(topic, this); + return connection == null ? CompletableFuture.completedFuture(true) : connection.subscribe(topic, this); } /** @@ -71,6 +75,6 @@ public CompletableFuture<Boolean> start() { * @return Completes with true if successful. Exceptionally otherwise. */ public CompletableFuture<Boolean> stop() { - return connection.unsubscribe(topic, this); + return connection == null ? CompletableFuture.completedFuture(true) : connection.unsubscribe(topic, this); } } diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java index 06b48ac6f6afe..9e4d68b95a0b4 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,20 +12,9 @@ */ package org.openhab.binding.mqtt.handler; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeoutException; - import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.Channel; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.ThingStatus; -import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.*; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; @@ -34,9 +23,18 @@ import org.eclipse.smarthome.io.transport.mqtt.MqttConnectionState; import org.eclipse.smarthome.io.transport.mqtt.MqttService; import org.openhab.binding.mqtt.action.MQTTActions; +import org.openhab.binding.mqtt.discovery.MQTTTopicDiscoveryParticipant; +import org.openhab.binding.mqtt.discovery.TopicSubscribe; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeoutException; + /** * This base implementation handles connection changes of the {@link MqttBrokerConnection} * and puts the Thing on or offline. It also handles adding/removing notifications of the @@ -46,10 +44,11 @@ */ @NonNullByDefault public abstract class AbstractBrokerHandler extends BaseBridgeHandler implements MqttConnectionObserver { - public static int TIMEOUT_DEFAULT = 1200; /* timeout in milliseconds */ + public static final int TIMEOUT_DEFAULT = 1200; /* timeout in milliseconds */ private final Logger logger = LoggerFactory.getLogger(AbstractBrokerHandler.class); final Map<ChannelUID, PublishTriggerChannel> channelStateByChannelUID = new HashMap<>(); + private final Map<String, @Nullable Map<MQTTTopicDiscoveryParticipant, @Nullable TopicSubscribe>> discoveryTopics = new HashMap<>(); protected @Nullable MqttBrokerConnection connection; protected CompletableFuture<MqttBrokerConnection> connectionFuture = new CompletableFuture<>(); @@ -116,6 +115,23 @@ public void initialize() { } }); connectionFuture.complete(connection); + + discoveryTopics.forEach((topic, listenerMap) -> { + listenerMap.replaceAll((listener, oldTopicSubscribe) -> { + TopicSubscribe topicSubscribe = new TopicSubscribe(connection, topic, listener, thing.getUID()); + topicSubscribe.start().handle((result, ex) -> { + if (ex != null) { + logger.warn("Failed to subscribe {} to discovery topic {} on broker {}", listener, topic, + thing.getUID()); + } else { + logger.trace("Subscribed {} to discovery topic {} on broker {}", listener, topic, + thing.getUID()); + } + return null; + }); + return topicSubscribe; + }); + }); } @Override @@ -145,6 +161,14 @@ protected void triggerChannel(ChannelUID channelUID, String event) { public void dispose() { channelStateByChannelUID.values().forEach(c -> c.stop()); channelStateByChannelUID.clear(); + + // keep topics, but stop subscriptions + discoveryTopics.forEach((topic, listenerMap) -> { + listenerMap.forEach((listener, topicSubscribe) -> { + topicSubscribe.stop(); + }); + }); + if (connection != null) { connection.removeConnectionObserver(this); } else { @@ -155,4 +179,65 @@ public void dispose() { connectionFuture = new CompletableFuture<>(); super.dispose(); } + + /** + * register a discovery listener to a specified topic on this broker (used by the handler factory) + * + * @param listener the discovery participant that wishes to be notified about this topic + * @param topic the topic (wildcards supported) + */ + public final void registerDiscoveryListener(MQTTTopicDiscoveryParticipant listener, String topic) { + Map<MQTTTopicDiscoveryParticipant, @Nullable TopicSubscribe> topicListeners = discoveryTopics + .computeIfAbsent(topic, t -> new HashMap<>()); + topicListeners.compute(listener, (k, v) -> { + if (v != null) { + logger.warn("Duplicate subscription for {} to discovery topic {} on broker {}. Check discovery logic!", + listener, topic, thing.getUID()); + v.stop(); + } + + TopicSubscribe topicSubscribe = new TopicSubscribe(connection, topic, listener, thing.getUID()); + topicSubscribe.start().handle((result, ex) -> { + if (ex != null) { + logger.warn("Failed to subscribe {} to discovery topic {} on broker {}", listener, topic, + thing.getUID()); + } else { + logger.trace("Subscribed {} to discovery topic {} on broker {}", listener, topic, thing.getUID()); + } + return null; + }); + return topicSubscribe; + }); + } + + /** + * unregisters a discovery listener from a specified topic on this broker (used by the handler factory) + * + * @param listener the discovery participant that wishes no notifications about this topic + * @param topic the topic (as specified during registration) + */ + public final void unregisterDiscoveryListener(MQTTTopicDiscoveryParticipant listener, String topic) { + Map<MQTTTopicDiscoveryParticipant, @Nullable TopicSubscribe> topicListeners = discoveryTopics + .compute(topic, (k, v) -> { + if (v == null) { + logger.warn( + "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered at all. Check discovery logic!", + listener, topic, thing.getUID()); + return null; + } + v.compute(listener, (l, w) -> { + if (w == null) { + logger.warn( + "Tried to unsubscribe {} from discovery topic {} on broker {} but topic not registered for listener. Check discovery logic!", + listener, topic, thing.getUID()); + } else { + w.stop(); + logger.trace("Unsubscribed {} from discovery topic {} on broker {}", listener, topic, + thing.getUID()); + } + return null; + }); + return v.isEmpty() ? null : v; + }); + } } diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandler.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandler.java index 9dadf8462457b..21a6000b2c893 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandler.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.net.ssl.TrustManager; + import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -33,7 +35,6 @@ import org.openhab.binding.mqtt.internal.ssl.PinTrustManager; import org.openhab.binding.mqtt.internal.ssl.PinType; import org.openhab.binding.mqtt.internal.ssl.PinnedCallback; -import org.openhab.binding.mqtt.internal.ssl.PinningSSLContextProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -135,7 +136,7 @@ protected void assignSSLContextProvider(BrokerHandlerConfig config, MqttBrokerCo PinnedCallback callback) throws IllegalArgumentException { final PinTrustManager trustManager = new PinTrustManager(); - connection.setSSLContextProvider(new PinningSSLContextProvider(trustManager)); + connection.setTrustManagers(new TrustManager[] { trustManager }); trustManager.setCallback(callback); if (config.certificatepin) { diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandlerConfig.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandlerConfig.java index a2648277e8b09..77744ae079974 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandlerConfig.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/BrokerHandlerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannel.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannel.java index 375fa3c0c7c6e..4288056e4d29a 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannel.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannelConfig.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannelConfig.java index 3913439062d05..371f5fcc2dbb9 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannelConfig.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/PublishTriggerChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/SystemBrokerHandler.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/SystemBrokerHandler.java index cb046de6af13d..9d3ff2d65e7e6 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/SystemBrokerHandler.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/handler/SystemBrokerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -105,7 +105,7 @@ public void brokerAdded(String connectionName, MqttBrokerConnection addedConnect @Override public void brokerRemoved(String connectionName, MqttBrokerConnection removedConnection) { final MqttBrokerConnection connection = this.connection; - if (removedConnection == connection) { + if (removedConnection.equals(connection)) { connection.removeConnectionObserver(this); this.connection = null; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.sharedremoved"); diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java index 7d6c8e9da09ec..1cfab3857e164 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,14 +12,6 @@ */ package org.openhab.binding.mqtt.internal; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.WeakHashMap; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Bridge; @@ -35,8 +27,15 @@ import org.openhab.binding.mqtt.handler.AbstractBrokerHandler; import org.openhab.binding.mqtt.handler.BrokerHandler; import org.openhab.binding.mqtt.handler.SystemBrokerHandler; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** * The {@link MqttBrokerHandlerFactory} is responsible for creating things and thing @@ -52,35 +51,21 @@ public class MqttBrokerHandlerFactory extends BaseThingHandlerFactory implements private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream .of(MqttBindingConstants.BRIDGE_TYPE_SYSTEMBROKER, MqttBindingConstants.BRIDGE_TYPE_BROKER) .collect(Collectors.toSet()); - protected final Map<MQTTTopicDiscoveryParticipant, TopicSubscribeMultiConnection> subscriber = Collections - .synchronizedMap(new WeakHashMap<>()); + private final Logger logger = LoggerFactory.getLogger(MqttBrokerHandlerFactory.class); + protected final Map<String, List<MQTTTopicDiscoveryParticipant>> discoveryTopics = new HashMap<>(); protected final Set<AbstractBrokerHandler> handlers = Collections .synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); - @NonNullByDefault({}) private MqttService mqttService; - @Override - public boolean supportsThingType(ThingTypeUID thingTypeUID) { - return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + @Activate + public MqttBrokerHandlerFactory(@Reference MqttService mqttService) { + this.mqttService = mqttService; } - @Reference - public void setMqttService(MqttService service) { - mqttService = service; - } - - public void unsetMqttService(MqttService service) { - mqttService = null; - } - - /** - * Remove the given broker connection from all listeners. - */ @Override - protected void removeHandler(@NonNull ThingHandler thingHandler) { - handlers.remove(thingHandler); - subscriber.forEach((receiver, multiConnection) -> multiConnection.remove((AbstractBrokerHandler) thingHandler)); + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); } /** @@ -88,7 +73,11 @@ protected void removeHandler(@NonNull ThingHandler thingHandler) { */ protected void createdHandler(AbstractBrokerHandler handler) { handlers.add(handler); - subscriber.forEach((receiver, multiConnection) -> multiConnection.add(handler)); + discoveryTopics.forEach((topic, listenerList) -> { + listenerList.forEach(listener -> { + handler.registerDiscoveryListener(listener, topic); + }); + }); } @Override @@ -119,12 +108,10 @@ protected void createdHandler(AbstractBrokerHandler handler) { */ @Override public void subscribe(MQTTTopicDiscoveryParticipant listener, String topic) { - if (subscriber.containsKey(listener)) { - return; - } - final TopicSubscribeMultiConnection multiSubscriber = new TopicSubscribeMultiConnection(listener, topic); - handlers.forEach(multiSubscriber::add); - subscriber.put(listener, multiSubscriber); + List<MQTTTopicDiscoveryParticipant> listenerList = discoveryTopics + .computeIfAbsent(topic, t -> new ArrayList<>()); + listenerList.add(listener); + handlers.forEach(broker -> broker.registerDiscoveryListener(listener, topic)); } /** @@ -133,9 +120,9 @@ public void subscribe(MQTTTopicDiscoveryParticipant listener, String topic) { @Override @SuppressWarnings("null") public void unsubscribe(MQTTTopicDiscoveryParticipant listener) { - TopicSubscribeMultiConnection multiSubscriber = subscriber.remove(listener); - if (multiSubscriber != null) { - multiSubscriber.stop(); - } + discoveryTopics.forEach((topic, listenerList) -> { + listenerList.remove(listener); + handlers.forEach(broker -> broker.unregisterDiscoveryListener(listener, topic)); + }); } } diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttThingID.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttThingID.java index 0e56ad3248107..9f7edec9bf1b2 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttThingID.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttThingID.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/TopicSubscribeMultiConnection.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/TopicSubscribeMultiConnection.java deleted file mode 100644 index d76ea255e2ac2..0000000000000 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/TopicSubscribeMultiConnection.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.mqtt.internal; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.openhab.binding.mqtt.discovery.MQTTTopicDiscoveryParticipant; -import org.openhab.binding.mqtt.discovery.TopicSubscribe; -import org.openhab.binding.mqtt.handler.AbstractBrokerHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Use this for MQTT topic subscriptions on all available broker connections. - * - * @author David Graeff - Initial contribution - */ -@NonNullByDefault -public class TopicSubscribeMultiConnection { - private final Logger logger = LoggerFactory.getLogger(TopicSubscribeMultiConnection.class); - protected final Map<ThingUID, TopicSubscribe> observedBrokerHandlers = new HashMap<>(); - protected final MQTTTopicDiscoveryParticipant messageReceivedListener; - protected final String topic; - - /** - * Creates a topic subscription object. - * - * @param messageReceivedListener A callback to get notified of results. - * @param topic A topic, most likely with a wildcard like this: "house/+/main-light" to match - * "house/room1/main-light", "house/room2/main-light" etc. - */ - public TopicSubscribeMultiConnection(MQTTTopicDiscoveryParticipant messageReceivedListener, String topic) { - this.messageReceivedListener = messageReceivedListener; - this.topic = topic; - } - - /** - * Add thing if it is a bridge and has a handler that inherits from {@link AbstractBrokerHandler}. - */ - public void add(AbstractBrokerHandler handler) { - final ThingUID bridgeUid = handler.getThing().getUID(); - - handler.getConnectionAsync().thenAccept(connection -> { - final TopicSubscribe o = new TopicSubscribe(connection, topic, messageReceivedListener, bridgeUid); - observedBrokerHandlers.put(bridgeUid, o); - o.start().exceptionally(e -> { - logger.warn("Failed to MQTT subscribe for {} on topic {}", bridgeUid, topic); - return false; - }).thenRun(() -> { - logger.trace("Found suitable bridge {} for listing to topic {}", bridgeUid, topic); - }); - }); - } - - /** - * Removes the thing from observed connections, if it exists in there, and stops any MQTT subscriptions. - */ - @SuppressWarnings("null") - public void remove(AbstractBrokerHandler handler) { - final TopicSubscribe observedBrokerHandler = observedBrokerHandlers.remove(handler.getThing().getUID()); - if (observedBrokerHandler != null) { - observedBrokerHandler.stop(); - } - } - - /** - * Unsubscribes from the topic on all connections. - * - * @return Completes with true if successful. Exceptionally otherwise. - */ - public CompletableFuture<Boolean> stop() { - return observedBrokerHandlers.values().stream().map(v -> v.stop()) - .reduce(CompletableFuture.completedFuture(true), (a, v) -> a.thenCompose(b -> v)); - } -} diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/discovery/MqttServiceDiscoveryService.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/discovery/MqttServiceDiscoveryService.java index 2abffa80f0406..9ce5046d2d461 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/discovery/MqttServiceDiscoveryService.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/discovery/MqttServiceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/Pin.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/Pin.java index 4c3d8983b59d3..32f8f6aec7cfc 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/Pin.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/Pin.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -113,4 +113,4 @@ public String toString() { return type.name(); } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinMessageDigest.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinMessageDigest.java index a20e25365d665..a639804ee4c6b 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinMessageDigest.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinMessageDigest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinTrustManager.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinTrustManager.java index 50667e3d7c96b..f9c5b26efa31c 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinTrustManager.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinTrustManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinType.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinType.java index b5f09c79fbace..b8a166fab0ab8 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinType.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,4 +20,4 @@ public enum PinType { PUBLIC_KEY_TYPE, CERTIFICATE_TYPE -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinnedCallback.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinnedCallback.java index d2fbbb7a3cfbc..7f849b3c8ef55 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinnedCallback.java +++ b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinnedCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -41,4 +41,4 @@ public interface PinnedCallback { * @param pin The pin object that denied the connection */ void pinnedConnectionDenied(Pin pin); -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProvider.java b/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProvider.java deleted file mode 100644 index c203261b117e2..0000000000000 --- a/bundles/org.openhab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.mqtt.internal.ssl; - -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.io.transport.mqtt.sslcontext.SSLContextProvider; -import org.osgi.service.cm.ConfigurationException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This is an implementation of the {@link SSLContextProvider}. The {@link PinTrustManager} - * will be used for the SSLContext. This implementation forces a TLS 1.2 context. - * - * @author David Graeff - Initial contribution - */ -@NonNullByDefault -public class PinningSSLContextProvider implements SSLContextProvider { - private final Logger logger = LoggerFactory.getLogger(PinningSSLContextProvider.class); - final PinTrustManager trustManager; - - public PinningSSLContextProvider(PinTrustManager pinTrustManager) { - this.trustManager = pinTrustManager; - } - - @Override - public SSLContext getContext() throws ConfigurationException { - try { - SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); - sslContext.init(null, new TrustManager[] { trustManager }, new java.security.SecureRandom()); - return sslContext; - } catch (KeyManagementException | NoSuchAlgorithmException e) { - logger.warn("SSL configuration failed", e); - throw new ConfigurationException("ssl", e.getMessage()); - } - } -} diff --git a/bundles/org.openhab.binding.mqtt/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.mqtt/src/main/resources/ESH-INF/thing/thing-types.xml index ea854bc7a54c0..d4ec5e1431bcc 100644 --- a/bundles/org.openhab.binding.mqtt/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.mqtt/src/main/resources/ESH-INF/thing/thing-types.xml @@ -24,7 +24,7 @@ </parameter> <parameter name="secure" type="boolean" required="true"> - <label>Secure connection</label> + <label>Secure Connection</label> <description>Uses TLS/SSL to establish a secure connection to the broker.</description> <default>false</default> </parameter> @@ -47,46 +47,38 @@ <advanced>true</advanced> </parameter> - <parameter name="retain" type="boolean"> - <label>Retain messages</label> - <description>Retained messages are stored on the MQTT broker and - other clients can retrieve the value at any time</description> - <default>true</default> - <advanced>true</advanced> - </parameter> - - <parameter name="reconnect_time" type="integer"> - <label>Reconnect time</label> + <parameter name="reconnectTime" type="integer"> + <label>Reconnect Time</label> <description>Reconnect time in ms. If a connection is lost, the binding will wait this time before it tries to reconnect.</description> <default>60000</default> <advanced>true</advanced> </parameter> - <parameter name="keep_alive_time" type="integer"> + <parameter name="keepAlive" type="integer"> <label>Heartbeat</label> - <description>Keep alive / heartbeat timer in ms. It can take up to + <description>Keep alive / heartbeat timer in s. It can take up to this time to determine if a server connection is lost. A lower value may keep the broker unnecessarily busy for no or little additional value.</description> - <default>60000</default> + <default>60</default> <advanced>true</advanced> </parameter> - <parameter name="lastwill_message" type="text"> - <label>Last will message</label> + <parameter name="lwtMessage" type="text"> + <label>Last Will Message</label> <description>The last will message.</description> <advanced>true</advanced> </parameter> - <parameter name="lastwill_topic" type="text"> - <label>Last will topic</label> + <parameter name="lwtTopic" type="text"> + <label>Last Will Topic</label> <description>Defaults to empty and therefore disables the last will.</description> <advanced>true</advanced> </parameter> - <parameter name="lastwill_qos" type="integer"> - <label>Last will QoS</label> + <parameter name="lwtQos" type="integer"> + <label>Last Will QoS</label> <description>The quality of service parameter of the last will.</description> <options> <option value="0">At most once (0)</option> @@ -97,6 +89,13 @@ <advanced>true</advanced> </parameter> + <parameter name="lwtRetain" type="boolean"> + <label>Last Will Retain</label> + <description>True if last Will should be retained (defaults to false)</description> + <default>true</default> + <advanced>true</advanced> + </parameter> + <parameter name="username" type="text"> <label>Username</label> <description>The MQTT username</description> @@ -109,7 +108,7 @@ <advanced>true</advanced> </parameter> <parameter name="certificatepin" type="boolean"> - <label>Certificate pinning</label> + <label>Certificate Pinning</label> <description>If this and SSL is set: After the next connection has been successfully established, the certificate is pinned. The connection will be refused if another certificate is used. Clear @@ -119,7 +118,7 @@ <advanced>true</advanced> </parameter> <parameter name="certificate" type="text"> - <label>Certificate hash</label> + <label>Certificate Hash</label> <description>If **certificatepin** is set this hash is used to verify the connection. Clear to allow a new certificate pinning on the next connection attempt. If empty will be filled automatically @@ -128,7 +127,7 @@ <advanced>true</advanced> </parameter> <parameter name="publickeypin" type="boolean"> - <label>Public key pinning</label> + <label>Public Key Pinning</label> <description>If this and SSL is set: After the next connection has been successfully established, the public key of the broker is pinned. The connection will be refused if another public key is @@ -176,7 +175,7 @@ <channel-type id="publishTrigger"> <kind>trigger</kind> - <label>Publish trigger</label> + <label>Publish Trigger</label> <description>This channel is triggered when a value is published to the configured MQTT topic on this broker connection. The event payload will be the received MQTT topic value.</description> <event></event> <config-description> @@ -185,11 +184,11 @@ <description>This channel will trigger on this MQTT topic. This topic can contain wildcards like + and # for example "all/in/#" or "sensors/+/config".</description> </parameter> <parameter name="payload" type="text" required="false"> - <label>Payload condition</label> + <label>Payload Condition</label> <description>An optional condition on the value of the MQTT topic that must match before this channel is triggered.</description> </parameter> <parameter name="separator" type="text" required="false"> - <label>Separator character</label> + <label>Separator Character</label> <description>The trigger channel payload usually only contains the received MQTT topic value. If you define a separator character, for example '#', the topic and received value will be in the trigger channel payload. For example: my_topic#my_received_value.</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandlerTest.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandlerTest.java index 456feba3c8f33..982874d9b2d84 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandlerTest.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/AbstractBrokerHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerEx.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerEx.java index 3e581e0b547eb..93ba58cd0f12b 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerEx.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerEx.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,4 +42,4 @@ public BrokerHandlerEx(Bridge thing, MqttBrokerConnectionEx e) { public static void verifyCreateBrokerConnection(BrokerHandler handler, int times) { verify(handler, Mockito.times(times)).createBrokerConnection(); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerTest.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerTest.java index 1507e41719ced..7e2c38c1a7d76 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerTest.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/BrokerHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,7 +19,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.thing.Bridge; @@ -37,7 +36,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.openhab.binding.mqtt.handler.BrokerHandler; import org.openhab.binding.mqtt.internal.MqttThingID; import org.osgi.service.cm.ConfigurationException; @@ -134,13 +132,12 @@ boolean initializeHandlerWaitForTimeout() handler.initialize(); verify(connection, times(2)).addConnectionObserver(any()); verify(connection, times(1)).start(); - boolean s = o.semaphore.tryAcquire(300, TimeUnit.MILLISECONDS); // First we expect a CONNECTING state and then a CONNECTED unique state change assertThat(o.counter, is(2)); // First we expect a CONNECTING state and then a CONNECTED state change // (and other CONNECTED after the future completes) verify(handler, times(3)).connectionStateChanged(any(), any()); - return s; + return true; } } diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttAsyncClientEx.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttAsyncClientEx.java deleted file mode 100644 index d14782f7c9f71..0000000000000 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttAsyncClientEx.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.mqtt.handler; - -import static org.mockito.Mockito.*; - -import java.util.Collections; - -import org.eclipse.paho.client.mqttv3.IMqttActionListener; -import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; -import org.eclipse.paho.client.mqttv3.IMqttToken; -import org.eclipse.paho.client.mqttv3.MqttAsyncClient; -import org.eclipse.paho.client.mqttv3.MqttClientPersistence; -import org.eclipse.paho.client.mqttv3.MqttConnectOptions; -import org.eclipse.paho.client.mqttv3.MqttException; -import org.eclipse.paho.client.mqttv3.MqttPersistenceException; -import org.eclipse.paho.client.mqttv3.MqttSecurityException; -import org.eclipse.smarthome.io.transport.mqtt.MqttConnectionState; - -/** - * We need an extended MqttAsyncClientEx to overwrite the connection state. - * - * In respect to the success flags the operations publish, subscribe, unsubscribe, connect, - * and disconnect immediately succeed or fail. - * - * @author David Graeff - Initial contribution - */ -public class MqttAsyncClientEx extends MqttAsyncClient { - public MqttBrokerConnectionEx connection; - - public MqttAsyncClientEx(String serverURI, String clientId, MqttClientPersistence dataStore, - MqttBrokerConnectionEx connection) throws MqttException { - super(serverURI, clientId, dataStore); - this.connection = connection; - } - - IMqttToken getToken(Object userContext, IMqttActionListener callback, String topic) { - IMqttToken t = mock(IMqttToken.class); - doReturn(userContext).when(t).getUserContext(); - doReturn(true).when(t).isComplete(); - doReturn(Collections.singletonList(topic).toArray(new String[1])).when(t).getTopics(); - doReturn(MqttAsyncClientEx.this).when(t).getClient(); - doReturn(callback).when(t).getActionCallback(); - doReturn(null).when(t).getException(); - return t; - } - - IMqttDeliveryToken getDeliveryToken(Object userContext, IMqttActionListener callback, String topic) { - IMqttDeliveryToken t = mock(IMqttDeliveryToken.class); - doReturn(userContext).when(t).getUserContext(); - doReturn(true).when(t).isComplete(); - doReturn(Collections.singletonList(topic).toArray(new String[1])).when(t).getTopics(); - doReturn(MqttAsyncClientEx.this).when(t).getClient(); - doReturn(callback).when(t).getActionCallback(); - doReturn(null).when(t).getException(); - return t; - } - - @Override - public boolean isConnected() { - return connection.connectionStateOverwrite == MqttConnectionState.CONNECTED; - } - - @Override - public IMqttDeliveryToken publish(String topic, byte[] payload, int qos, boolean retained, Object userContext, - IMqttActionListener callback) throws MqttException, MqttPersistenceException { - - if (connection.publishSuccess) { - callback.onSuccess(getToken(userContext, callback, topic)); - } else { - callback.onFailure(getToken(userContext, callback, topic), new MqttException(0)); - } - return getDeliveryToken(userContext, callback, topic); - } - - @Override - public IMqttToken subscribe(String topic, int qos, Object userContext, IMqttActionListener callback) - throws MqttException { - if (connection.publishSuccess) { - callback.onSuccess(getToken(userContext, callback, topic)); - } else { - callback.onFailure(getToken(userContext, callback, topic), new MqttException(0)); - } - return getToken(userContext, callback, topic); - } - - @Override - public IMqttToken unsubscribe(String topic, Object userContext, IMqttActionListener callback) throws MqttException { - if (connection.unsubscribeSuccess) { - callback.onSuccess(getToken(userContext, callback, topic)); - } else { - callback.onFailure(getToken(userContext, callback, topic), new MqttException(0)); - } - return getToken(userContext, callback, topic); - } - - @Override - public IMqttToken disconnect(long quiesceTimeout, Object userContext, IMqttActionListener callback) - throws MqttException { - connection.connectionStateOverwrite = MqttConnectionState.DISCONNECTED; - if (connection.disconnectSuccess) { - callback.onSuccess(getToken(userContext, callback, null)); - } else { - callback.onFailure(getToken(userContext, callback, null), new MqttException(0)); - } - return getToken(userContext, callback, null); - } - - @Override - public IMqttToken connect(MqttConnectOptions options, Object userContext, IMqttActionListener callback) - throws MqttException, MqttSecurityException { - if (!connection.connectTimeout) { - connection.connectionStateOverwrite = MqttConnectionState.CONNECTED; - if (connection.connectSuccess) { - callback.onSuccess(getToken(userContext, callback, null)); - } else { - callback.onFailure(getToken(userContext, callback, null), new MqttException(0)); - } - } else { - connection.connectionStateOverwrite = MqttConnectionState.DISCONNECTED; - } - return getToken(userContext, callback, null); - } -} diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttBrokerConnectionEx.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttBrokerConnectionEx.java index 1bafd145a0b94..8f0819704d6c7 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttBrokerConnectionEx.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttBrokerConnectionEx.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,15 +12,21 @@ */ package org.openhab.binding.mqtt.handler; -import static org.mockito.Mockito.spy; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +import java.util.Map; +import java.util.concurrent.CompletableFuture; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.paho.client.mqttv3.MqttAsyncClient; -import org.eclipse.paho.client.mqttv3.MqttClientPersistence; import org.eclipse.smarthome.io.transport.mqtt.MqttBrokerConnection; import org.eclipse.smarthome.io.transport.mqtt.MqttConnectionState; +import org.eclipse.smarthome.io.transport.mqtt.internal.TopicSubscribers; +import org.eclipse.smarthome.io.transport.mqtt.internal.client.MqttAsyncClientWrapper; + +import com.hivemq.client.mqtt.MqttClientState; /** * We need an extended MqttBrokerConnection to overwrite the protected `connectionCallbacks` with @@ -41,7 +47,7 @@ public class MqttBrokerConnectionEx extends MqttBrokerConnection { public boolean connectSuccess = true; public boolean connectTimeout = false; - public MqttBrokerConnectionEx(String host, @Nullable Integer port, boolean secure, @Nullable String clientId) { + public MqttBrokerConnectionEx(String host, @Nullable Integer port, boolean secure, String clientId) { super(host, port, secure, clientId); } @@ -49,14 +55,60 @@ public void setConnectionCallback(MqttBrokerConnectionEx o) { connectionCallback = spy(new ConnectionCallback(o)); } + public Map<String, TopicSubscribers> getSubscribers() { + return subscribers; + } + @Override - protected MqttAsyncClient createClient(String serverURI, String clientId, MqttClientPersistence dataStore) - throws org.eclipse.paho.client.mqttv3.MqttException { - return spy(new MqttAsyncClientEx(serverURI, clientId, dataStore, this)); + protected MqttAsyncClientWrapper createClient() { + MqttAsyncClientWrapper mockedClient = mock(MqttAsyncClientWrapper.class); + // connect + doAnswer(i -> { + if (!connectTimeout) { + connectionCallback.onConnected(null); + connectionStateOverwrite = MqttConnectionState.CONNECTED; + return CompletableFuture.completedFuture(null); + } + return new CompletableFuture<Boolean>(); + }).when(mockedClient).connect(any(), anyInt(), any(), any()); + doAnswer(i -> { + if (disconnectSuccess) { + connectionCallback.onDisconnected(new Throwable("disconnect called")); + connectionStateOverwrite = MqttConnectionState.DISCONNECTED; + return CompletableFuture.completedFuture(null); + } + return new CompletableFuture<Boolean>(); + }).when(mockedClient).disconnect(); + // subscribe + doAnswer(i -> { + if (subscribeSuccess) { + return CompletableFuture.completedFuture(null); + } else { + CompletableFuture<Void> future = new CompletableFuture<>(); + future.completeExceptionally(new Throwable("subscription failed")); + return future; + } + }).when(mockedClient).subscribe(any(), anyInt(), any()); + // unsubscribe + doAnswer(i -> { + if (unsubscribeSuccess) { + return CompletableFuture.completedFuture(null); + } else { + CompletableFuture<Void> future = new CompletableFuture<>(); + future.completeExceptionally(new Throwable("unsubscription failed")); + return future; + } + }).when(mockedClient).unsubscribe(any()); + // state + doAnswer(i -> { + return MqttClientState.CONNECTED; + }).when(mockedClient).getState(); + return mockedClient; } @Override public @NonNull MqttConnectionState connectionState() { return connectionStateOverwrite; } + } diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttConnectionObserverEx.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttConnectionObserverEx.java index ceefac03adcca..7b269d25cefd7 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttConnectionObserverEx.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/handler/MqttConnectionObserverEx.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -44,4 +44,4 @@ public void connectionStateChanged(@NonNull MqttConnectionState state, @Nullable counter = 2; } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/MQTTTopicDiscoveryServiceTest.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/MQTTTopicDiscoveryServiceTest.java index 59913b1911533..76d1984d39611 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/MQTTTopicDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/MQTTTopicDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,9 +14,11 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; +import java.util.HashMap; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; @@ -24,13 +26,17 @@ import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.binding.ThingHandlerCallback; import org.eclipse.smarthome.io.transport.mqtt.MqttException; +import org.eclipse.smarthome.io.transport.mqtt.MqttService; +import org.eclipse.smarthome.io.transport.mqtt.internal.TopicSubscribers; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.openhab.binding.mqtt.discovery.MQTTTopicDiscoveryParticipant; import org.openhab.binding.mqtt.discovery.MQTTTopicDiscoveryService; +import org.openhab.binding.mqtt.discovery.TopicSubscribe; import org.openhab.binding.mqtt.handler.BrokerHandler; import org.openhab.binding.mqtt.handler.BrokerHandlerEx; import org.openhab.binding.mqtt.handler.MqttBrokerConnectionEx; @@ -48,6 +54,9 @@ public class MQTTTopicDiscoveryServiceTest { private MqttBrokerHandlerFactory subject; + @Mock + private MqttService mqttService; + @Mock private Bridge thing; @@ -79,7 +88,7 @@ public void setUp() throws ConfigurationException, MqttException { handler = spy(new BrokerHandlerEx(thing, connection)); handler.setCallback(callback); - subject = new MqttBrokerHandlerFactory(); + subject = new MqttBrokerHandlerFactory(mqttService); } @After @@ -94,10 +103,10 @@ public void firstSubscribeThenHandler() { subject.subscribe(listener, "topic"); subject.createdHandler(handler); - assertThat(subject.subscriber.get(listener).topic, is("topic")); + assertTrue(subject.discoveryTopics.get("topic").contains(listener)); // Simulate receiving final byte[] bytes = "TEST".getBytes(); - subject.subscriber.get(listener).observedBrokerHandlers.get(thing.getUID()).processMessage("topic", bytes); + connection.getSubscribers().get("topic").forEach(s -> s.processMessage("topic", bytes)); verify(listener).receivedMessage(eq(thing.getUID()), eq(connection), eq("topic"), eq(bytes)); } @@ -108,11 +117,11 @@ public void firstHandlerThanSubscribe() { subject.createdHandler(handler); subject.subscribe(listener, "topic"); - assertThat(subject.subscriber.get(listener).topic, is("topic")); + assertTrue(subject.discoveryTopics.get("topic").contains(listener)); // Simulate receiving final byte[] bytes = "TEST".getBytes(); - subject.subscriber.get(listener).observedBrokerHandlers.get(thing.getUID()).processMessage("topic", bytes); + connection.getSubscribers().get("topic").forEach(s -> s.processMessage("topic", bytes)); verify(listener).receivedMessage(eq(thing.getUID()), eq(connection), eq("topic"), eq(bytes)); } @@ -120,10 +129,7 @@ public void firstHandlerThanSubscribe() { public void handlerInitializeAfterSubscribe() { subject.createdHandler(handler); subject.subscribe(listener, "topic"); - assertThat(subject.subscriber.get(listener).topic, is("topic")); - - // No observed broker handler, because no connection created yet within the handler - assertThat(subject.subscriber.get(listener).observedBrokerHandlers.size(), is(0)); + assertTrue(subject.discoveryTopics.get("topic").contains(listener)); // Init handler -> create connection handler.initialize(); @@ -131,7 +137,9 @@ public void handlerInitializeAfterSubscribe() { // Simulate receiving final byte[] bytes = "TEST".getBytes(); - subject.subscriber.get(listener).observedBrokerHandlers.get(thing.getUID()).processMessage("topic", bytes); + + connection.getSubscribers().getOrDefault("topic", new TopicSubscribers("topic")) + .forEach(s -> s.processMessage("topic", bytes)); verify(listener).receivedMessage(eq(thing.getUID()), eq(connection), eq("topic"), eq(bytes)); } @@ -142,11 +150,12 @@ public void topicVanished() { subject.createdHandler(handler); subject.subscribe(listener, "topic"); - assertThat(subject.subscriber.get(listener).topic, is("topic")); + assertTrue(subject.discoveryTopics.get("topic").contains(listener)); // Simulate receiving final byte[] bytes = "".getBytes(); - subject.subscriber.get(listener).observedBrokerHandlers.get(thing.getUID()).processMessage("topic", bytes); + connection.getSubscribers().getOrDefault("topic", new TopicSubscribers("topic")) + .forEach(s -> s.processMessage("topic", bytes)); verify(listener).topicVanished(eq(thing.getUID()), eq(connection), eq("topic")); } diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/discovery/ServiceDiscoveryServiceTest.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/discovery/ServiceDiscoveryServiceTest.java index da6cf649c6156..301925f02aeda 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/discovery/ServiceDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/discovery/ServiceDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProviderTest.java b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProviderTest.java index 8291a7b0faec5..144d687ea71ac 100644 --- a/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProviderTest.java +++ b/bundles/org.openhab.binding.mqtt/src/test/java/org/openhab/binding/mqtt/internal/ssl/PinningSSLContextProviderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -28,15 +28,9 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; -import org.openhab.binding.mqtt.internal.ssl.Pin; -import org.openhab.binding.mqtt.internal.ssl.PinMessageDigest; -import org.openhab.binding.mqtt.internal.ssl.PinTrustManager; -import org.openhab.binding.mqtt.internal.ssl.PinType; -import org.openhab.binding.mqtt.internal.ssl.PinnedCallback; -import org.openhab.binding.mqtt.internal.ssl.PinningSSLContextProvider; /** - * Tests cases for {@link PinningSSLContextProvider}. + * Tests cases for {@link PinTrustManager}. * * @author David Graeff - Initial contribution */ diff --git a/bundles/org.openhab.binding.nanoleaf/NOTICE b/bundles/org.openhab.binding.nanoleaf/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nanoleaf/NOTICE +++ b/bundles/org.openhab.binding.nanoleaf/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nanoleaf/README.md b/bundles/org.openhab.binding.nanoleaf/README.md index 7cf0994b1716a..02128f52eed89 100644 --- a/bundles/org.openhab.binding.nanoleaf/README.md +++ b/bundles/org.openhab.binding.nanoleaf/README.md @@ -5,7 +5,7 @@ This binding integrates the [Nanoleaf Light Panels](https://nanoleaf.me/en/consu ![Image](doc/Nanoleaf.jpg) It enables you to authenticate, control, and obtain information of a Light Panels device. -The binding uses the [Nanoleaf OpenAPI](http://forum.nanoleaf.me/docs/openapi), which requires firmware version [1.5.0](https://helpdesk.nanoleaf.me/hc/en-us/articles/214006129-Light-Panels-Firmware-Release-Notes) or higher. +The binding uses the [Nanoleaf OpenAPI](https://forum.nanoleaf.me/docs/openapi), which requires firmware version [1.5.0](https://helpdesk.nanoleaf.me/hc/en-us/articles/214006129-Light-Panels-Firmware-Release-Notes) or higher. ![Image](doc/LightPanels2.jpg) @@ -22,7 +22,7 @@ You can set the color for each panel or turn it on (white) or off (black). ## Discovery A controller (bridge) device is discovered automatically through mDNS in the local network. -Alternatively, you can also provide a things file (see below for more details). +Alternatively, you can also provide the usual files to configure the binding (see [Full Example](#full-example) below for more details). After the device is discovered and added as a thing, it needs a valid authentication token that must be obtained by pairing it with your openHAB instance. Without the token the light panels remain in status OFFLINE. @@ -96,6 +96,14 @@ Bridge nanoleaf:controller:MyLightPanels [ address="192.168.1.100", port=16021, } ``` +Note: To generate the `authToken`: +* On the Nanoleaf controller, hold the on-off button for 5-7 seconds until the LED starts flashing. +* Send a POST request to the authorization endpoint within 30 seconds of activating pairing, like this: + +`http://<address>:16021/api/v1/new` + +e.g. via command line `curl --location --request POST 'http://<address>:16021/api/v1/new'` + ### nanoleaf.items ``` @@ -112,7 +120,6 @@ Switch NanoleafRhythmState "Rhythm connected [MAP(nanoleaf.map):%s]" { channel=" Switch NanoleafRhythmActive "Rhythm active [MAP(nanoleaf.map):%s]" { channel="nanoleaf:controller:MyLightPanels:rhythmActive" } Number NanoleafRhythmSource "Rhythm source [%s]" { channel="nanoleaf:controller:MyLightPanels:rhythmMode" } Color Panel1Color "Panel 1" { channel="nanoleaf:lightpanel:MyLightPanels:135:panelColor" } -Dimmer Panel1Brightness "Panel 1" { channel="nanoleaf:lightpanel:MyLightPanels:135:panelColor" } Color Panel2Color "Panel 2" { channel="nanoleaf:lightpanel:MyLightPanels:158:panelColor" } Switch NanoleafRainbowScene "Show Rainbow Scene" ``` @@ -139,7 +146,6 @@ sitemap nanoleaf label="Nanoleaf" Frame label="Panels" { Colorpicker item=Panel1Color - Slider item=Panel1Brightness Colorpicker item=Panel2Color } diff --git a/bundles/org.openhab.binding.nanoleaf/pom.xml b/bundles/org.openhab.binding.nanoleaf/pom.xml index 9803922557f7f..93a0e1978e998 100644 --- a/bundles/org.openhab.binding.nanoleaf/pom.xml +++ b/bundles/org.openhab.binding.nanoleaf/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nanoleaf</artifactId> diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/feature/feature.xml b/bundles/org.openhab.binding.nanoleaf/src/main/feature/feature.xml index b9a5f092c93ba..403c6ee0c8ce7 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nanoleaf/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nanoleaf-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nanoleaf" description="Nanoleaf Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafBindingConstants.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafBindingConstants.java index e58ec1a7800af..89c994fabf803 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafBindingConstants.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafControllerListener.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafControllerListener.java index 622b9fea79a30..4d5deccf3f7f7 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafControllerListener.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafControllerListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafException.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafException.java index 2d5efb087a4b6..1c1082f6bc96f 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafException.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafHandlerFactory.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafHandlerFactory.java index 9b6655ad517e8..d2171b1034baa 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafHandlerFactory.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafUnauthorizedException.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafUnauthorizedException.java index 01e7673e37dea..d646fdf3edd3b 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafUnauthorizedException.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/NanoleafUnauthorizedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/OpenAPIUtils.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/OpenAPIUtils.java index 4f95daae8baf8..8c62f2dbf01e5 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/OpenAPIUtils.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/OpenAPIUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -68,7 +68,7 @@ public static Request requestBuilder(HttpClient httpClient, NanoleafControllerCo try { requestURI = new URI(HttpScheme.HTTP.asString(), null, address, port, path, null, null); } catch (URISyntaxException use) { - logger.warn("URI could not be parsed with path '{}'", path); + logger.warn("URI could not be parsed with path {}", path); throw new NanoleafException("Wrong URI format for API request"); } return httpClient.newRequest(requestURI).method(method); diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafControllerConfig.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafControllerConfig.java index 12baf8ab9569c..0735f50c08a2d 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafControllerConfig.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafControllerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafPanelConfig.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafPanelConfig.java index ad255569bee32..1e84fc25794ba 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafPanelConfig.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/config/NanoleafPanelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafMDNSDiscoveryParticipant.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafMDNSDiscoveryParticipant.java index 6d7f6b1d39bff..de5bf6ca22860 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafMDNSDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafMDNSDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafPanelsDiscoveryService.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafPanelsDiscoveryService.java index a37dd53297514..bde3f0372115b 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafPanelsDiscoveryService.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/discovery/NanoleafPanelsDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -84,7 +84,7 @@ public void onControllerInfoFetched(ThingUID bridge, ControllerInfo controllerIn PositionDatum panel = iterator.next(); panel.getPanelId(); ThingUID newPanelThingUID = new ThingUID(NanoleafBindingConstants.THING_TYPE_LIGHT_PANEL, bridge, - panel.getPanelId().toString()); + Integer.toString(panel.getPanelId())); final Map<String, Object> properties = new HashMap<>(1); properties.put(CONFIG_PANEL_ID, panel.getPanelId()); diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java index 2a460fae86e94..1ecdfa35c763e 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafControllerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -432,25 +432,26 @@ private void updateFromControllerInfo() throws NanoleafException, NanoleafUnauth boolean isOn = controllerInfo.getState().getOn().getValue(); updateState(CHANNEL_POWER, isOn ? OnOffType.ON : OnOffType.OFF); updateState(CHANNEL_COLOR_TEMPERATURE_ABS, - new DecimalType(controllerInfo.getState().getColorTemperature().getValue().intValue())); - Float colorTempPercent = (controllerInfo.getState().getColorTemperature().getValue().floatValue() - - controllerInfo.getState().getColorTemperature().getMin().floatValue()) - / (controllerInfo.getState().getColorTemperature().getMax().floatValue() - - controllerInfo.getState().getColorTemperature().getMin().floatValue()) + new DecimalType(controllerInfo.getState().getColorTemperature().getValue())); + float colorTempPercent = (controllerInfo.getState().getColorTemperature().getValue() + - controllerInfo.getState().getColorTemperature().getMin()) + / (controllerInfo.getState().getColorTemperature().getMax() + - controllerInfo.getState().getColorTemperature().getMin()) * PercentType.HUNDRED.intValue(); - updateState(CHANNEL_COLOR_TEMPERATURE, new PercentType(colorTempPercent.intValue())); + updateState(CHANNEL_COLOR_TEMPERATURE, new PercentType(Float.toString(colorTempPercent))); updateState(CHANNEL_EFFECT, new StringType(controllerInfo.getEffects().getSelect())); updateState(CHANNEL_COLOR, new HSBType(new DecimalType(controllerInfo.getState().getHue().getValue()), new PercentType(controllerInfo.getState().getSaturation().getValue()), new PercentType(isOn ? controllerInfo.getState().getBrightness().getValue() : 0))); updateState(CHANNEL_COLOR_MODE, new StringType(controllerInfo.getState().getColorMode())); - updateState(CHANNEL_RHYTHM_ACTIVE, - controllerInfo.getRhythm().getRhythmActive().booleanValue() ? OnOffType.ON : OnOffType.OFF); - updateState(CHANNEL_RHYTHM_MODE, new DecimalType(controllerInfo.getRhythm().getRhythmMode().intValue())); - updateState(CHANNEL_RHYTHM_STATE, - controllerInfo.getRhythm().getRhythmConnected().booleanValue() ? OnOffType.ON : OnOffType.OFF); - + if (controllerInfo.getRhythm() != null) { + updateState(CHANNEL_RHYTHM_ACTIVE, + controllerInfo.getRhythm().getRhythmActive() ? OnOffType.ON : OnOffType.OFF); + updateState(CHANNEL_RHYTHM_MODE, new DecimalType(controllerInfo.getRhythm().getRhythmMode())); + updateState(CHANNEL_RHYTHM_STATE, + controllerInfo.getRhythm().getRhythmConnected() ? OnOffType.ON : OnOffType.OFF); + } // update bridge properties which may have changed, or are not present during discovery Map<String, String> properties = editProperties(); properties.put(Thing.PROPERTY_SERIAL_NUMBER, controllerInfo.getSerialNo()); @@ -515,10 +516,10 @@ private void sendStateCommand(String channel, Command command) throws NanoleafEx if (controllerInfo != null) { Brightness brightness = controllerInfo.getState().getBrightness(); if (command.equals(IncreaseDecreaseType.INCREASE)) { - brightness.setValue(Math.min(brightness.getMax().intValue(), + brightness.setValue(Math.min(brightness.getMax(), brightness.getValue() + BRIGHTNESS_STEP_SIZE)); } else { - brightness.setValue(Math.max(brightness.getMin().intValue(), + brightness.setValue(Math.max(brightness.getMin(), brightness.getValue() - BRIGHTNESS_STEP_SIZE)); } stateObject.setState(brightness); diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java index b98b8139a640c..94d0e747424cf 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/handler/NanoleafPanelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/AuthToken.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/AuthToken.java index dac4747b1517c..f631ee2e7dd6e 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/AuthToken.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/AuthToken.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/BooleanState.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/BooleanState.java index b44821f74e7e3..235f73c2c621c 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/BooleanState.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/BooleanState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,7 +19,7 @@ */ public interface BooleanState { - public Boolean getValue(); + public boolean getValue(); - public void setValue(Boolean value); + public void setValue(boolean value); } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Brightness.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Brightness.java index 358739b7872b8..fbc54632ffbb8 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Brightness.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Brightness.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,20 +16,20 @@ * Represents brightness setting of the light panels * * @author Martin Raepple - Initial contribution - */ + */ public class Brightness implements IntegerState { - private Integer value; + private int value; private Integer max; private Integer min; @Override - public Integer getValue() { + public int getValue() { return value; } @Override - public void setValue(Integer value) { + public void setValue(int value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Command.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Command.java index 90f4aaa4465d0..872a161a1394c 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Command.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/ControllerInfo.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/ControllerInfo.java index 43feff4dddebd..804a93fc978b8 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/ControllerInfo.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/ControllerInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Ct.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Ct.java index 63bbf312d1983..1958cfd526f53 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Ct.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Ct.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,17 +19,17 @@ */ public class Ct implements IntegerState { - private Integer value; + private int value; private Integer max; private Integer min; @Override - public Integer getValue() { + public int getValue() { return value; } @Override - public void setValue(Integer value) { + public void setValue(int value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Effects.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Effects.java index 376d1ceed6bdd..eb67577b7b675 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Effects.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Effects.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/GlobalOrientation.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/GlobalOrientation.java index e935f27471a25..57a335c5c3c59 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/GlobalOrientation.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/GlobalOrientation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,15 +19,15 @@ */ public class GlobalOrientation { - private Integer value; + private int value; private Integer max; private Integer min; - public Integer getValue() { + public int getValue() { return value; } - public void setValue(Integer value) { + public void setValue(int value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Hue.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Hue.java index a3d7651def410..f72003cefffe7 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Hue.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Hue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,17 +19,17 @@ */ public class Hue implements IntegerState { - private Integer value; + private int value; private Integer max; private Integer min; @Override - public Integer getValue() { + public int getValue() { return value; } @Override - public void setValue(Integer value) { + public void setValue(int value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/IntegerState.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/IntegerState.java index 920ef4ea02978..74d0c7a62542c 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/IntegerState.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/IntegerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,7 +19,7 @@ */ public interface IntegerState { - void setValue(Integer value); + void setValue(int value); - Integer getValue(); + int getValue(); } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Layout.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Layout.java index b0b56e362a358..5488ab9b8a480 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Layout.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Layout.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,23 +21,23 @@ */ public class Layout { - private Integer numPanels; - private Integer sideLength; + private int numPanels; + private int sideLength; private List<PositionDatum> positionData = null; - public Integer getNumPanels() { + public int getNumPanels() { return numPanels; } - public void setNumPanels(Integer numPanels) { + public void setNumPanels(int numPanels) { this.numPanels = numPanels; } - public Integer getSideLength() { + public int getSideLength() { return sideLength; } - public void setSideLength(Integer sideLength) { + public void setSideLength(int sideLength) { this.sideLength = sideLength; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/On.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/On.java index 305f95fec84e6..bc7839f2b3eaf 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/On.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/On.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,15 +19,15 @@ */ public class On implements BooleanState { - private Boolean value; + private boolean value; @Override - public Boolean getValue() { + public boolean getValue() { return value; } @Override - public void setValue(Boolean value) { + public void setValue(boolean value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Palette.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Palette.java index bbf5e0a3384b8..fa2a198a82208 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Palette.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Palette.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,31 +19,31 @@ */ public class Palette { - private Integer hue; - private Integer saturation; - private Integer brightness; + private int hue; + private int saturation; + private int brightness; - public Integer getHue() { + public int getHue() { return hue; } - public void setHue(Integer hue) { + public void setHue(int hue) { this.hue = hue; } - public Integer getSaturation() { + public int getSaturation() { return saturation; } - public void setSaturation(Integer saturation) { + public void setSaturation(int saturation) { this.saturation = saturation; } - public Integer getBrightness() { + public int getBrightness() { return brightness; } - public void setBrightness(Integer brightness) { + public void setBrightness(int brightness) { this.brightness = brightness; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PanelLayout.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PanelLayout.java index f79db4febdc45..a95656175194d 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PanelLayout.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PanelLayout.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PositionDatum.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PositionDatum.java index be45631206423..8c036e66ca52e 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PositionDatum.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/PositionDatum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,43 +21,43 @@ */ public class PositionDatum { - private Integer panelId; + private int panelId; @SerializedName("x") - private Integer posX; + private int posX; @SerializedName("y") - private Integer posY; + private int posY; @SerializedName("o") - private Integer orientation; + private int orientation; - public Integer getPanelId() { + public int getPanelId() { return panelId; } - public void setPanelId(Integer panelId) { + public void setPanelId(int panelId) { this.panelId = panelId; } - public Integer getPosX() { + public int getPosX() { return posX; } - public void setPosX(Integer x) { + public void setPosX(int x) { this.posX = x; } - public Integer getPosY() { + public int getPosY() { return posY; } - public void setPosY(Integer y) { + public void setPosY(int y) { this.posY = y; } - public Integer getOrientation() { + public int getOrientation() { return orientation; } - public void setOrientation(Integer o) { + public void setOrientation(int o) { this.orientation = o; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Rhythm.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Rhythm.java index 9a6be21cddd6b..679077c131b69 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Rhythm.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Rhythm.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,41 +19,41 @@ */ public class Rhythm { - private Boolean rhythmConnected; - private Boolean rhythmActive; - private Integer rhythmId; + private boolean rhythmConnected; + private boolean rhythmActive; + private int rhythmId; private String hardwareVersion; private String firmwareVersion; - private Boolean auxAvailable; - private Integer rhythmMode; + private boolean auxAvailable; + private int rhythmMode; private RhythmPos rhythmPos; - public Boolean getRhythmConnected() { + public boolean getRhythmConnected() { return rhythmConnected; } - public void setRhythmConnected(Boolean rhythmConnected) { + public void setRhythmConnected(boolean rhythmConnected) { this.rhythmConnected = rhythmConnected; } - public Boolean getRhythmActive() { + public boolean getRhythmActive() { return rhythmActive; } - public void setRhythmActive(Boolean rhythmActive) { + public void setRhythmActive(boolean rhythmActive) { this.rhythmActive = rhythmActive; } - public Integer getRhythmId() { + public int getRhythmId() { return rhythmId; } - public void setRhythmId(Integer rhythmId) { + public void setRhythmId(int rhythmId) { this.rhythmId = rhythmId; } public String getHardwareVersion() { - return hardwareVersion; + return hardwareVersion == null ? "" : this.hardwareVersion; } public void setHardwareVersion(String hardwareVersion) { @@ -61,26 +61,26 @@ public void setHardwareVersion(String hardwareVersion) { } public String getFirmwareVersion() { - return firmwareVersion; + return firmwareVersion == null ? "" : this.firmwareVersion; } public void setFirmwareVersion(String firmwareVersion) { this.firmwareVersion = firmwareVersion; } - public Boolean getAuxAvailable() { + public boolean getAuxAvailable() { return auxAvailable; } - public void setAuxAvailable(Boolean auxAvailable) { + public void setAuxAvailable(boolean auxAvailable) { this.auxAvailable = auxAvailable; } - public Integer getRhythmMode() { + public int getRhythmMode() { return rhythmMode; } - public void setRhythmMode(Integer rhythmMode) { + public void setRhythmMode(int rhythmMode) { this.rhythmMode = rhythmMode; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/RhythmPos.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/RhythmPos.java index 268593b86d0f7..702564a3bdc3a 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/RhythmPos.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/RhythmPos.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,33 +22,33 @@ public class RhythmPos { @SerializedName("x") - private Integer posX; + private float posX; @SerializedName("y") - private Integer posY; + private float posY; @SerializedName("o") - private Integer orientation; + private float orientation; - public Integer getPosX() { + public float getPosX() { return posX; } - public void setPosX(Integer x) { + public void setPosX(float x) { this.posX = x; } - public Integer getPosY() { + public float getPosY() { return posY; } - public void setPosY(Integer y) { + public void setPosY(float y) { this.posY = y; } - public Integer getOrientation() { + public float getOrientation() { return orientation; } - public void setOrientation(Integer o) { + public void setOrientation(float o) { this.orientation = o; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Sat.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Sat.java index a86e65df601cd..20ae4b7bbbddf 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Sat.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Sat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,17 +19,17 @@ */ public class Sat implements IntegerState { - private Integer value; + private int value; private Integer max; private Integer min; @Override - public Integer getValue() { + public int getValue() { return value; } @Override - public void setValue(Integer value) { + public void setValue(int value) { this.value = value; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/State.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/State.java index d858dc0ac7323..fe21ef265f08f 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/State.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/State.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Write.java b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Write.java index 4bc34ecb16f6a..7479bf48cccc1 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Write.java +++ b/bundles/org.openhab.binding.nanoleaf/src/main/java/org/openhab/binding/nanoleaf/internal/model/Write.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,7 +27,7 @@ public class Write { private List<Palette> palette = null; private String colorType; private String animData; - private Boolean loop; + private boolean loop; public String getCommand() { return command; @@ -69,11 +69,11 @@ public void setAnimData(String animData) { this.animData = animData; } - public Boolean getLoop() { + public boolean getLoop() { return loop; } - public void setLoop(Boolean loop) { + public void setLoop(boolean loop) { this.loop = loop; } diff --git a/bundles/org.openhab.binding.nanoleaf/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.nanoleaf/src/main/resources/ESH-INF/config/config.xml index 631171a56f51e..b8c74d3f5055d 100644 --- a/bundles/org.openhab.binding.nanoleaf/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.nanoleaf/src/main/resources/ESH-INF/config/config.xml @@ -10,7 +10,7 @@ <label>@text/thing-type.config.nanoleaf.controller.address.label</label> <description>@text/thing-type.config.nanoleaf.controller.address.description</description> </parameter> - <parameter name="port" type="integer" required="true" min="1" max="65335"> + <parameter name="port" type="integer" required="true" min="1" max="65535"> <label>@text/thing-type.config.nanoleaf.controller.port.label</label> <description>@text/thing-type.config.nanoleaf.controller.port.description</description> <default>16021</default> diff --git a/bundles/org.openhab.binding.neato/NOTICE b/bundles/org.openhab.binding.neato/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.neato/NOTICE +++ b/bundles/org.openhab.binding.neato/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.neato/pom.xml b/bundles/org.openhab.binding.neato/pom.xml index 39a9c7452bc30..c15a90311a598 100644 --- a/bundles/org.openhab.binding.neato/pom.xml +++ b/bundles/org.openhab.binding.neato/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.neato</artifactId> diff --git a/bundles/org.openhab.binding.neato/src/main/feature/feature.xml b/bundles/org.openhab.binding.neato/src/main/feature/feature.xml index 7e19c66065877..f9c68b923b907 100644 --- a/bundles/org.openhab.binding.neato/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.neato/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.neato-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-neato" description="Neato Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/CouldNotFindRobotException.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/CouldNotFindRobotException.java index 8a3575133695a..8619cd4a89c8c 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/CouldNotFindRobotException.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/CouldNotFindRobotException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoBindingConstants.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoBindingConstants.java index 714273c456803..8010deeb9175d 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoBindingConstants.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoCommunicationException.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoCommunicationException.java index b0bf2d55863ef..41e23b722efb9 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoCommunicationException.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoHandlerFactory.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoHandlerFactory.java index 22125a1245130..4deb5c792ac3f 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoHandlerFactory.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoRobot.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoRobot.java index 2074dbdd6d0a6..e1743e282a772 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoRobot.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/NeatoRobot.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableCommands.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableCommands.java index 65a6f25c9d4d2..9fbd79280b94d 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableCommands.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableCommands.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableServices.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableServices.java index cd177ee40ebb6..426b4b65a3822 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableServices.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/AvailableServices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Battery.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Battery.java index 2037e838bc323..c162763727f82 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Battery.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Battery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/BeehiveAuthentication.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/BeehiveAuthentication.java index fbbf65fbf3a8f..f5e0f7d4f1c57 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/BeehiveAuthentication.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/BeehiveAuthentication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Cleaning.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Cleaning.java index 9ce4b6f2f3f26..2368797ffdec5 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Cleaning.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Cleaning.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Details.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Details.java index b8b48bbe11c0d..7c18a991a5a42 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Details.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Details.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/ErrorMessage.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/ErrorMessage.java index 457b084cc1464..88e9f51188f85 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/ErrorMessage.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/ErrorMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Meta.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Meta.java index a090d5bd11059..aee944bb32e78 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Meta.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Meta.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoAccountInformation.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoAccountInformation.java index fb5b4bfc438f2..98e7f87357e18 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoAccountInformation.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoAccountInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoGeneralInfo.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoGeneralInfo.java index 9eb9d483534e8..f98bd07cc4f75 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoGeneralInfo.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoGeneralInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoRobotInfo.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoRobotInfo.java index c086a8f548019..223ab180bf3c9 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoRobotInfo.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoRobotInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoState.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoState.java index 134c10dfb3381..1d43389d8c85b 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoState.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/NeatoState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RecentFirmwares.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RecentFirmwares.java index fe929eebdf682..753e81af4330f 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RecentFirmwares.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RecentFirmwares.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Robot.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Robot.java index cf436a103084c..7cc4670bbcc87 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Robot.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/Robot.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RobotInfoData.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RobotInfoData.java index e9dc6acea2d56..fdac7f09b4f69 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RobotInfoData.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/classes/RobotInfoData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoAccountConfig.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoAccountConfig.java index eba72189e6052..7fac442feb4d7 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoAccountConfig.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoAccountConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoRobotConfig.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoRobotConfig.java index 1b2a01d9090d9..a74a4e473c1c0 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoRobotConfig.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/config/NeatoRobotConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/discovery/NeatoAccountDiscoveryService.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/discovery/NeatoAccountDiscoveryService.java index e8417da439cc7..39279d007b044 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/discovery/NeatoAccountDiscoveryService.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/discovery/NeatoAccountDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoAccountHandler.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoAccountHandler.java index 76a5703e9362e..a58d4b4d83772 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoAccountHandler.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoAccountHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoHandler.java b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoHandler.java index 58b1de5e0c789..f9a54e036df1d 100644 --- a/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoHandler.java +++ b/bundles/org.openhab.binding.neato/src/main/java/org/openhab/binding/neato/internal/handler/NeatoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neato/src/main/resources/ESH-INF/thing/vacuumcleaner.xml b/bundles/org.openhab.binding.neato/src/main/resources/ESH-INF/thing/vacuumcleaner.xml index 2529d61b3e347..612bbf8ffd4ec 100644 --- a/bundles/org.openhab.binding.neato/src/main/resources/ESH-INF/thing/vacuumcleaner.xml +++ b/bundles/org.openhab.binding.neato/src/main/resources/ESH-INF/thing/vacuumcleaner.xml @@ -10,7 +10,7 @@ <config-description> <parameter name="email" type="text"> - <label>E-mail address</label> + <label>E-mail Address</label> <description>E-mail address for your Neato Cloud account.</description> <required>true</required> <context>email</context> @@ -62,7 +62,7 @@ </parameter> <parameter name="refresh" type="integer"> - <label>Refresh time interval</label> + <label>Refresh Time Interval</label> <description>Refresh time interval in seconds for updates from the Neato Web Service.</description> <default>60</default> </parameter> @@ -112,21 +112,21 @@ <channel-type id="dock-has-been-seen"> <item-type>Switch</item-type> - <label>Dock has been seen</label> + <label>Dock Has Been Seen</label> <description>True or False value if the dock has been seen</description> <state readOnly="true" pattern="%s" /> </channel-type> <channel-type id="is-docked"> <item-type>Switch</item-type> - <label>Is docked</label> + <label>Is Docked</label> <description>Is the vacuum cleaner in the docking station?</description> <state readOnly="true" pattern="%s" /> </channel-type> <channel-type id="is-scheduled"> <item-type>Switch</item-type> - <label>Is scheduled enabled</label> + <label>Is Scheduled Enabled</label> <description>True or False value if the vacuum cleaner is scheduled for cleaning.</description> <state readOnly="true" pattern="%s" /> </channel-type> diff --git a/bundles/org.openhab.binding.neeo/NOTICE b/bundles/org.openhab.binding.neeo/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.neeo/NOTICE +++ b/bundles/org.openhab.binding.neeo/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.neeo/README.md b/bundles/org.openhab.binding.neeo/README.md index 82834767aa786..5ce37a4bf9a34 100644 --- a/bundles/org.openhab.binding.neeo/README.md +++ b/bundles/org.openhab.binding.neeo/README.md @@ -18,9 +18,9 @@ Likewise, starting a Recipe/Scenario in openHAB will change the status on the Br This binding has been designed to compliment the NEEO Transport (which will expose openHAB Devices to the Brain[s] and expose each Brains Device to the other Brains). The Room/Scenario/Recipe/Device information is read at startup time. -If you make changes to any Room/Scenario/Recipe/Device, you'll need to delete the item in question and re-discover the item (see discovery section below). +If you make changes to any Room/Scenario/Recipe/Device, you will need to delete the item in question and re-discover the item (see discovery section below). -Since this binding allows you to trigger actions on NEEO Devices, this allows you to use the NEEO Brain as a IR solution to openHAB. +Since this binding allows you to trigger actions on NEEO Devices, this allows you to use the NEEO Brain as an IR solution to openHAB. In other words, if the NEEO Brain supports a Device over IR - then openHAB can use the NEEO Brain to control that Device regardless if there is an openHAB binding for it or not. ## openHAB Primary Address @@ -60,7 +60,7 @@ Represents a Device within the NEEO Room. ## Discover -NEEO Brains will be automatically discovered if MDNS/bonjour/zeroconf is installed on the local machine: +NEEO Brains will be automatically discovered if mDNS/bonjour/zeroconf is installed on the local machine: 1. On Windows - installing iTunes will install bonjour. 2. On Linux - please install zeroconf (see vendor documentation on how to do that). @@ -71,20 +71,20 @@ When you add a Room, all Devices should be auto discovered and placed in the inb If you remove any discovered thing either from the inbox or from the added things, simply re-trigger a NEEO binding scan to rediscover it. If you have the Brain both wired and wireless, the Brain will NOT be discovered twice (only once) and which interface is discovered depends on the timing of the beacon discover message (first one wins). -If you discovered the wired first but want to use the wireless (or in the reverse), add the Brain and then modify it's configuration to the IP address you want to use. +If you discovered the wired first but want to use the wireless (or in the reverse), add the Brain and then modify its configuration to the IP address you want to use. If the Brain is not discovered, here is list of the most common issues: 1. You can generally trigger discovery by starting up the NEEO APP on your mobile device, press MENU->NEEO Brain->Change Brain. -This will generally send out the necessary MDNS broadcast messages to discovery the Brain. -2. You didn't wait long enough. -I've noticed that it will take up to 5 minutes for the discovery to find the Brain. -3. Local firewall is blocking the MDNS broadcast messages. -Modify the firewall to allow MDNS packets - typically port 5353 and/or IP address 224.0.0.251 +This will generally send out the necessary mDNS broadcast messages to discovery the Brain. +2. You did not wait long enough. +I have noticed that it will take up to 5 minutes for the discovery to find the Brain. +3. Local firewall is blocking the mDNS broadcast messages. +Modify the firewall to allow mDNS packets - typically port 5353 and/or IP address 224.0.0.251 4. The Brain is on a different subnet. Unless you have special routing rules, having the Brain on a different subnet than the openHAB instance will prevent discovery. Either add routing rules or move one of them to the same subnet. -5. Bug in the MDNS library. +5. Bug in the mDNS library. Occasionally a broadcast will be missed and a simple openHAB restart will fix the issue. 6. Brain isn't reachable. @@ -93,8 +93,8 @@ Ping the Brain's address from the openHAB machine and see if it responds. If none of the above work, there are a few more things you can try: 1. Use your local dns-sd command to see if you find the instance ("dns-sd -B _neeo._tcp"). -2. Manually configure the Brain and specify it's IP address. -3. Look in the issues forum on the NEEO SDK Github - specifically the [Brain Discovery not working](https://github.com/NEEOInc/neeo-sdk/issues/36). +2. Manually configure the Brain and specify its IP address. +3. Look in the issues forum on the NEEO SDK GitHub - specifically the [Brain Discovery not working](https://github.com/NEEOInc/neeo-sdk/issues/36). ## Forward Actions @@ -191,7 +191,7 @@ The following properties are available at the time of this writing: |---------------|---------------------------------------------------------------------------------------------------------------------| | AirKey | Unknown (hints at a future airplay feature) | | Version | The software (not firmware) version of the NEEO Brain | -| Is Configured | Whether the Brain has gone through it's initial setup (true) or not (false) | +| Is Configured | Whether the Brain has gone through its initial setup (true) or not (false) | | Label | Internal label assigned to the Brain | | Last Change | The time (in milliseconds) that the Brain was last updated (Recipe/Devices/etc change - again not firmware) | | Key | The unique identifier of the Brain | diff --git a/bundles/org.openhab.binding.neeo/pom.xml b/bundles/org.openhab.binding.neeo/pom.xml index a087a66025394..f58d596ddeaac 100644 --- a/bundles/org.openhab.binding.neeo/pom.xml +++ b/bundles/org.openhab.binding.neeo/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.neeo</artifactId> diff --git a/bundles/org.openhab.binding.neeo/src/main/feature/feature.xml b/bundles/org.openhab.binding.neeo/src/main/feature/feature.xml index d1be871fc53b9..3ec1eb20e490f 100644 --- a/bundles/org.openhab.binding.neeo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.neeo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.neeo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-neeo" description="NEEO Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainApi.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainApi.java index 1b1fea6c83f6b..099ec5adeed8c 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainApi.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainConfig.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainConfig.java index 2bd507cc9911b..555ee0c0e7f72 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainConfig.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoBrainConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoConstants.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoConstants.java index a6984e4a45a6e..259fedeb30de5 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoConstants.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceConfig.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceConfig.java index 1d2147901cfad..355ead9be72d6 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceConfig.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceProtocol.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceProtocol.java index b5ec7ccdf8407..124d3b5a99f0a 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceProtocol.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoDeviceProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoHandlerCallback.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoHandlerCallback.java index 6e30a51bd6cdf..e80778217fba2 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoHandlerCallback.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomConfig.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomConfig.java index 1e79823c320f2..4a4fbc70f9dac 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomConfig.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomProtocol.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomProtocol.java index 41da953438086..60cc8439a60d8 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomProtocol.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoRoomProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoUtil.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoUtil.java index f9253e42488c8..c393276da0721 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoUtil.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/NeeoUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/UidUtils.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/UidUtils.java index 84dda92aa42d8..331b749e96dc4 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/UidUtils.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/UidUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoBrainDiscovery.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoBrainDiscovery.java index 185ff50f054fa..dbb8be70845ae 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoBrainDiscovery.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoBrainDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoDeviceDiscoveryService.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoDeviceDiscoveryService.java index 405bd17a213ed..7a85b292bf110 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoRoomDiscoveryService.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoRoomDiscoveryService.java index ecca99f7d53a1..f2879b2482a10 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoRoomDiscoveryService.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/discovery/NeeoRoomDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/ChannelUtils.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/ChannelUtils.java index 3a61bb82064c3..012ab6bad475d 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/ChannelUtils.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/ChannelUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoBrainHandler.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoBrainHandler.java index 0f4ba2888f5ad..53a6efbe0cd51 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoBrainHandler.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoBrainHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoDeviceHandler.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoDeviceHandler.java index 1b6310cbbb45e..adedea0de3d34 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoDeviceHandler.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoForwardActionsServlet.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoForwardActionsServlet.java index 55429c75dc62b..064cd273f198b 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoForwardActionsServlet.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoForwardActionsServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoHandlerFactory.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoHandlerFactory.java index 974410af77868..97973ddb5505a 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoHandlerFactory.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoRoomHandler.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoRoomHandler.java index 5c9b99946a34f..e4b3e11603b46 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoRoomHandler.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/handler/NeeoRoomHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ErrorResponse.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ErrorResponse.java index 65cf8a458d08f..a677dd6aca1ee 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ErrorResponse.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ErrorResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteResult.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteResult.java index 09d84d470ebd9..1e13926497f38 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteResult.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteStep.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteStep.java index a4247b823c66e..a812057ff0452 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteStep.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/ExecuteStep.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoAction.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoAction.java index dd79c2493ab4e..6ff02c2a916ba 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoAction.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoBrain.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoBrain.java index 2e9b8e5b7c4bb..a4a1cab1fad5d 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoBrain.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoBrain.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevice.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevice.java index 1f209b632b0a9..aa38944cbff37 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevice.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetails.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetails.java index 13f7b6ac4d7df..b5b38593596d7 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetails.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetails.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetailsTiming.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetailsTiming.java index 322d7118f2e8c..d40391bfdbe2c 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetailsTiming.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDeviceDetailsTiming.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevices.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevices.java index 90b419dbd44f0..31c7e62d94303 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevices.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevicesDeserializer.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevicesDeserializer.java index 036e8d16d2702..214e393aae5c2 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevicesDeserializer.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoDevicesDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoForwardActions.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoForwardActions.java index b7aa776a4db3b..42f5548f87b42 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoForwardActions.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoForwardActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacro.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacro.java index b3b3f7178de0f..06dfe633ca60d 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacro.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacro.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacros.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacros.java index 0e86b2e3ddba7..9c73342332dfb 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacros.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacros.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacrosDeserializer.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacrosDeserializer.java index 1713a23401f96..cc8606f0cd39f 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacrosDeserializer.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoMacrosDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipe.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipe.java index e65931bdf47f9..547924096ba9b 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipe.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipe.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipes.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipes.java index 98165782125f7..bbaa183dbae99 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipes.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipesDeserializer.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipesDeserializer.java index 5e941ab104551..7d4eb000467a4 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipesDeserializer.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRecipesDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoom.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoom.java index 5818f23ad1d88..ecbe21df39bb6 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoom.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoom.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRooms.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRooms.java index 520a5c84d0967..877c6ff721588 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRooms.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRooms.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoomsDeserializer.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoomsDeserializer.java index b73e03a6cfeb1..dc6f6e5ace7bf 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoomsDeserializer.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoRoomsDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenario.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenario.java index 3018f2d28f221..7d83df4c86f72 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenario.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenario.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenarios.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenarios.java index cfb97dfef59b0..e854bcbd129c3 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenarios.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenarios.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenariosDeserializer.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenariosDeserializer.java index 593ee06063100..37f0e47ef643e 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenariosDeserializer.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/models/NeeoScenariosDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpRequest.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpRequest.java index c5dc7680450ad..0e2a5743e8b69 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpRequest.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpResponse.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpResponse.java index 3cefd990db203..5f1f958d60274 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpResponse.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/HttpResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,7 +14,7 @@ import java.io.IOException; import java.io.InputStream; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -101,8 +101,7 @@ public String getContent() { return ""; } - final Charset charSet = Charset.forName("utf-8"); - return new String(localContents, charSet); + return new String(localContents, StandardCharsets.UTF_8); } /** diff --git a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/Slf4LoggingAdapter.java b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/Slf4LoggingAdapter.java index b4c82a858bdd8..9d5257e213fb2 100644 --- a/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/Slf4LoggingAdapter.java +++ b/bundles/org.openhab.binding.neeo/src/main/java/org/openhab/binding/neeo/internal/net/Slf4LoggingAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neeo/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.neeo/src/main/resources/ESH-INF/thing/thing-types.xml index 5d5172c3d4cc2..f1bc5369f78db 100644 --- a/bundles/org.openhab.binding.neeo/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.neeo/src/main/resources/ESH-INF/thing/thing-types.xml @@ -122,25 +122,25 @@ </channel-group-type> <channel-type id="room-recipe-name" advanced="true"> <item-type>String</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>The recipe name</description> <state readOnly="true" /> </channel-type> <channel-type id="room-recipe-type" advanced="true"> <item-type>String</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>The type of recipe</description> <state readOnly="true" /> </channel-type> <channel-type id="room-recipe-enabled" advanced="true"> <item-type>Switch</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>Whether the recipe is enabled or not.</description> <state readOnly="true" /> </channel-type> <channel-type id="room-recipe-status"> <item-type>Switch</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>Send ON to execute the recipe</description> </channel-type> <channel-group-type id="room-scenario"> @@ -154,19 +154,19 @@ </channel-group-type> <channel-type id="room-scenario-name" advanced="true"> <item-type>String</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>The scenario name</description> <state readOnly="true" /> </channel-type> <channel-type id="room-scenario-configured" advanced="true"> <item-type>Switch</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>Whether the scenario is configured or not</description> <state readOnly="true" /> </channel-type> <channel-type id="room-scenario-status"> <item-type>Switch</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>Whether the scenario is running or not (send ON to turn on the scenario, OFF to turn off the scenario)</description> </channel-type> <channel-group-type id="device-macros"> @@ -178,7 +178,7 @@ </channel-group-type> <channel-type id="device-macros-status"> <item-type>Switch</item-type> - <label>Label dynamically generated</label> + <label>Label Dynamically Generated</label> <description>Send ON to trigger the macro</description> </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.neohub/NOTICE b/bundles/org.openhab.binding.neohub/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.neohub/NOTICE +++ b/bundles/org.openhab.binding.neohub/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.neohub/pom.xml b/bundles/org.openhab.binding.neohub/pom.xml index c91d7146a2644..4d0d4da2e2c6f 100644 --- a/bundles/org.openhab.binding.neohub/pom.xml +++ b/bundles/org.openhab.binding.neohub/pom.xml @@ -1,14 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.neohub</artifactId> diff --git a/bundles/org.openhab.binding.neohub/src/main/feature/feature.xml b/bundles/org.openhab.binding.neohub/src/main/feature/feature.xml index 40faeba0407ef..460a41af31659 100644 --- a/bundles/org.openhab.binding.neohub/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.neohub/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.neohub-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-neohub" description="NeoHub Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseConfiguration.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseConfiguration.java index 7bc4537d4a9ff..35e6a14bb370a 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseConfiguration.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseHandler.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseHandler.java index 55ea40868825e..fa04ac819ad25 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseHandler.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubBindingConstants.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubBindingConstants.java index d0d94c6d3b7c9..6704b406b222a 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubBindingConstants.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubConfiguration.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubConfiguration.java index 3874d244272b0..8dee34554eafd 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubConfiguration.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDebouncer.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDebouncer.java index 8effdc49dfbae..552ccba856bc3 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDebouncer.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDebouncer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDiscoveryService.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDiscoveryService.java index 364f8d8ebc74e..d59d846829a51 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDiscoveryService.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubException.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubException.java index 3cead5ce1a23f..203ec4457361b 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubException.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandler.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandler.java index 24cf156a29e4d..a0a10f37f8189 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandler.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandlerFactory.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandlerFactory.java index 0fe8418c884e6..1305f15c02f39 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandlerFactory.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubInfoResponse.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubInfoResponse.java index 9a268b10d1d70..e051b58d78f5f 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubInfoResponse.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubSocket.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubSocket.java index af74fe685cc1a..0c27ba800b5f8 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubSocket.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoHubSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoPlugHandler.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoPlugHandler.java index 0bff3f0468f26..fa63af744a999 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoPlugHandler.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoPlugHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoStatHandler.java b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoStatHandler.java index e8da339215632..780bd974c44aa 100644 --- a/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoStatHandler.java +++ b/bundles/org.openhab.binding.neohub/src/main/java/org/openhab/binding/neohub/internal/NeoStatHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.neohub/src/test/java/org/openhab/binding/neohub/test/NeoHubTestData.java b/bundles/org.openhab.binding.neohub/src/test/java/org/openhab/binding/neohub/test/NeoHubTestData.java index f6fc4849a502f..b5fbd6bcfef0a 100644 --- a/bundles/org.openhab.binding.neohub/src/test/java/org/openhab/binding/neohub/test/NeoHubTestData.java +++ b/bundles/org.openhab.binding.neohub/src/test/java/org/openhab/binding/neohub/test/NeoHubTestData.java @@ -1,6 +1,5 @@ -package org.openhab.binding.neohub.test; /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -11,7 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ - +package org.openhab.binding.neohub.test; /** * The {@link NeoHubTestData} class defines common constants, which are diff --git a/bundles/org.openhab.binding.nest/NOTICE b/bundles/org.openhab.binding.nest/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nest/NOTICE +++ b/bundles/org.openhab.binding.nest/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nest/README.md b/bundles/org.openhab.binding.nest/README.md index e35a5466652f7..627b2058f9d11 100644 --- a/bundles/org.openhab.binding.nest/README.md +++ b/bundles/org.openhab.binding.nest/README.md @@ -5,6 +5,11 @@ The Nest binding integrates devices by [Nest](https://nest.com) using the [Nest Because the Nest API runs on Nest's servers a connection with the Internet is required for sending and receiving information. The binding uses HTTPS to connect to the Nest API using ports 443 and 9553. Make sure outbound connections to these ports are not blocked by a firewall. +> Note: This binding can only be used with Nest devices if you have an existing Nest developer account signed up for the Works with Nest (WWN) program. +New integrations using the WWN program are no longer accepted because WWN is being retired. +To keep using this binding do **NOT** migrate your Nest Account to a Google Account. +For more information see [What's happening at Nest?](https://nest.com/whats-happening/). + ## Supported Things The table below lists the Nest binding thing types: @@ -20,7 +25,7 @@ The table below lists the Nest binding thing types: ## Authorization The Nest API uses OAuth for authorization. -Therefor the binding needs some authorization parameters before it can access your Nest account via the Nest API. +Therefore the binding needs some authorization parameters before it can access your Nest account via the Nest API. To get these authorization parameters you first need to sign up as a [Nest Developer](https://developer.nest.com) and [register a new Product](https://developer.nest.com/products/new) (free and instant). @@ -117,7 +122,7 @@ Information about the last camera event (requires Nest Aware subscription). | rush_hour_rewards_enrollment | Switch | If rush hour rewards system is enabled or not | R | | security_state | String | Security state of the structure (OK, DETER) | R | | smoke_alarm_state | String | Smoke alarm state (OK, EMERGENCY, WARNING) | R | -| time_zone | String | The time zone for the structure ([IANA time zone format](http://www.iana.org/time-zones)) | R | +| time_zone | String | The time zone for the structure ([IANA time zone format](https://www.iana.org/time-zones)) | R | ### Thermostat Channels diff --git a/bundles/org.openhab.binding.nest/pom.xml b/bundles/org.openhab.binding.nest/pom.xml index 0e738dc5d0eb3..74afea0d0d8e2 100644 --- a/bundles/org.openhab.binding.nest/pom.xml +++ b/bundles/org.openhab.binding.nest/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nest</artifactId> diff --git a/bundles/org.openhab.binding.nest/src/main/feature/feature.xml b/bundles/org.openhab.binding.nest/src/main/feature/feature.xml index 37e0f66c5fbaf..dbb5872b15a80 100644 --- a/bundles/org.openhab.binding.nest/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nest/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nest-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nest" description="Nest Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestBindingConstants.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestBindingConstants.java index 79c08c735bcc9..0d1da7f905890 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestBindingConstants.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestHandlerFactory.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestHandlerFactory.java index 21650bf563440..07b30f4397d29 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestHandlerFactory.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestUtils.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestUtils.java index 1eef3fdc61a2a..fd0d4f4005244 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestUtils.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/NestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestBridgeConfiguration.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestBridgeConfiguration.java index 53e7c575d5454..f4addfe861db4 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestBridgeConfiguration.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestDeviceConfiguration.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestDeviceConfiguration.java index 78c0f4c3fa320..b05978548bdb3 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestDeviceConfiguration.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestStructureConfiguration.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestStructureConfiguration.java index b52f0495bab74..02eb2122c6b39 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestStructureConfiguration.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/config/NestStructureConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/AccessTokenData.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/AccessTokenData.java index 3f221384a916d..78331284dcc7b 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/AccessTokenData.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/AccessTokenData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ActivityZone.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ActivityZone.java index e0320cb91656b..a1ac682559f30 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ActivityZone.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ActivityZone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/BaseNestDevice.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/BaseNestDevice.java index 8eb774a976e41..5f6ae14085064 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/BaseNestDevice.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/BaseNestDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Camera.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Camera.java index 31d5a0f56c5c2..ad2e3ed0addc7 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Camera.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Camera.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/CameraEvent.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/CameraEvent.java index 9325f3739ac27..230d0a6600236 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/CameraEvent.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/CameraEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ETA.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ETA.java index 2230e74c67f38..48cbddf4e78e4 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ETA.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ETA.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ErrorData.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ErrorData.java index f14f1ddbab1f8..8cc5269d71894 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ErrorData.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/ErrorData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestDevices.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestDevices.java index a029ccb0e47f9..7332cb601001e 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestDevices.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestDevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestIdentifiable.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestIdentifiable.java index d668f6ffe0617..0a0e55a04e749 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestIdentifiable.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestIdentifiable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestMetadata.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestMetadata.java index b609161ffc301..15477bfabae25 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestMetadata.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/NestMetadata.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/SmokeDetector.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/SmokeDetector.java index 2a193cdb2af47..e94ea6e911e7c 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/SmokeDetector.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/SmokeDetector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Structure.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Structure.java index 3b57785ee38d2..655b57b709e84 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Structure.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Structure.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Thermostat.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Thermostat.java index 223e0cbfbc027..99d35dbfaa2ff 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Thermostat.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Thermostat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelData.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelData.java index e171f1497dcf4..96fe541b831e8 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelData.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelStreamingData.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelStreamingData.java index cccaaf5b85026..bdfb9410ec5bd 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelStreamingData.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/TopLevelStreamingData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Where.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Where.java index 0924e6bb4b087..17f7c5ad797d3 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Where.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/data/Where.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/discovery/NestDiscoveryService.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/discovery/NestDiscoveryService.java index 577fdd12a422f..4b72f1d65eca6 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/discovery/NestDiscoveryService.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/discovery/NestDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedResolvingNestUrlException.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedResolvingNestUrlException.java index e35237a069846..5ea60dcb33107 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedResolvingNestUrlException.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedResolvingNestUrlException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedRetrievingNestDataException.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedRetrievingNestDataException.java index f476336224913..26bcf94768ff8 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedRetrievingNestDataException.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedRetrievingNestDataException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedSendingNestDataException.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedSendingNestDataException.java index 4ff83993295e7..d73fdc66126e5 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedSendingNestDataException.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/FailedSendingNestDataException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/InvalidAccessTokenException.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/InvalidAccessTokenException.java index fc1e948c67edb..6c2ec963d1395 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/InvalidAccessTokenException.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/exceptions/InvalidAccessTokenException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBaseHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBaseHandler.java index 717da9919d605..079d5715e4365 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBaseHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBridgeHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBridgeHandler.java index 580b112cbc5f9..480685cedd018 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBridgeHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestCameraHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestCameraHandler.java index c42ec913e3eb2..b2905c0e17f60 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestCameraHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestCameraHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestRedirectUrlSupplier.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestRedirectUrlSupplier.java index ac9e749dae6b6..f56a11add8619 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestRedirectUrlSupplier.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestRedirectUrlSupplier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestSmokeDetectorHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestSmokeDetectorHandler.java index 5d1861e88b133..848d856b180a4 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestSmokeDetectorHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestSmokeDetectorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestStructureHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestStructureHandler.java index e45dc2bda8099..5e9d845df2c56 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestStructureHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestStructureHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestThermostatHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestThermostatHandler.java index ecfaf3f69374f..4ecde558cea0e 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestThermostatHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/handler/NestThermostatHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestStreamingDataListener.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestStreamingDataListener.java index 01a4457b2fdd8..d310c648b505e 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestStreamingDataListener.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestStreamingDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestThingDataListener.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestThingDataListener.java index 3cbda332d7e7e..a080232fdb370 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestThingDataListener.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/listener/NestThingDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestAuthorizer.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestAuthorizer.java index eb7d129d55f3d..8f804ee924b7e 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestAuthorizer.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestAuthorizer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRequestFilter.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRequestFilter.java index 8957a430de8ce..d18312c1fc283 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRequestFilter.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRequestFilter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRestClient.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRestClient.java index 8d9cb122174d8..e5397fea46e0a 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRestClient.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestStreamingRestClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestUpdateRequest.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestUpdateRequest.java index a8557e477a9a2..2c340c2c66273 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestUpdateRequest.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/rest/NestUpdateRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestCompositeUpdateHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestCompositeUpdateHandler.java index 2588373646d8f..823703703480d 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestCompositeUpdateHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestCompositeUpdateHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestUpdateHandler.java b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestUpdateHandler.java index 1e887b0936e91..a7f5c0f8a79a0 100644 --- a/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestUpdateHandler.java +++ b/bundles/org.openhab.binding.nest/src/main/java/org/openhab/binding/nest/internal/update/NestUpdateHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nest/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.nest/src/main/resources/ESH-INF/thing/channels.xml index 181ff0e012c0c..eb60efabc9352 100644 --- a/bundles/org.openhab.binding.nest/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.nest/src/main/resources/ESH-INF/thing/channels.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="nest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Common --> <channel-type id="LastConnection" advanced="true"> @@ -430,7 +430,7 @@ <channel-type id="TimeToTarget"> <item-type>Number:Time</item-type> - <label>Time To Target</label> + <label>Time to Target</label> <description>Time left to the target temperature approximately</description> <state pattern="%d %unit%" readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.netatmo/.classpath b/bundles/org.openhab.binding.netatmo/.classpath index b2f9e3cdf8905..a5d95095ccaaf 100644 --- a/bundles/org.openhab.binding.netatmo/.classpath +++ b/bundles/org.openhab.binding.netatmo/.classpath @@ -28,6 +28,5 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/netatmo-java-retrofit-1.1.3.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.netatmo/NOTICE b/bundles/org.openhab.binding.netatmo/NOTICE index ec10605bb71af..d843d599a8177 100644 --- a/bundles/org.openhab.binding.netatmo/NOTICE +++ b/bundles/org.openhab.binding.netatmo/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.netatmo/README.md b/bundles/org.openhab.binding.netatmo/README.md index 8fcb60e8fea67..fc7e579fcfb2a 100644 --- a/bundles/org.openhab.binding.netatmo/README.md +++ b/bundles/org.openhab.binding.netatmo/README.md @@ -11,14 +11,14 @@ See http://www.netatmo.com/ for details on their product. ## Binding Configuration -The binding has no configuration options itself, all configuration is done at 'Things' level but before, you'll have to grant openHAB to access Netatmo API. +The binding has no configuration options itself, all configuration is done at 'Things' level but before, you will have to grant openHAB to access Netatmo API. Here is the procedure: ### 1. Application Creation Create an application at https://dev.netatmo.com/dev/createapp -The variables you'll need to get to setup the binding are: +The variables you will need to get to setup the binding are: * `<CLIENT_ID>` Your client ID taken from your App at https://dev.netatmo.com/dev/listapps * `<CLIENT_SECRET>` A token provided along with the `<CLIENT_ID>`. @@ -28,7 +28,7 @@ The variables you'll need to get to setup the binding are: ### 2. Bridge and Things Configuration -Once you'll get needed informations from the Netatmo API, you'll be able to configure bridge and things. +Once you will get needed informations from the Netatmo API, you will be able to configure bridge and things. E.g. @@ -51,7 +51,7 @@ Bridge netatmo:netatmoapi:home [ clientId="<CLIENT_ID>", clientSecret="<CLIENT_S For Welcome or Presence Camera, Netatmo servers can send push notifications to the Netatmo Binding by using a callback URL. The webhook URL is setup at bridge level using "Webhook Address" parameter. -You'll define here public way to access your OH2 server: +You will define here public way to access your openHAB server: ``` http(s)://xx.yy.zz.ww:8080 @@ -73,7 +73,10 @@ Please be aware of Netatmo own limits regarding webhook usage that lead to a 24h The IDs for the modules can be extracted from the developer documentation on the netatmo site. First login with your user. Then some examples of the documentation contain the **real results** of your weather station. -Get the IDs of your devices (indoor, outdoor, rain gauge) [here](https://dev.netatmo.com/doc/methods/devicelist). +In order to try the examples, you need the `device_id` of your Netatmo station. +You can find it in the configuration menu of the app (android or apple). +Get the IDs of your devices (indoor, outdoor, rain gauge) +[here](https://dev.netatmo.com/resources/technical/reference/weather/getstationsdata). `main_device` is the ID of the "main device", the indoor sensor. This is equal to the MAC address of the Netatmo. @@ -96,7 +99,7 @@ For example your serial number "h00bcdc" should end up as "02:00:00:00:bc:dc". ## Discovery -If you don't manually create things in the *.things file, the Netatmo Binding is able to discover automatically all depending modules and devices from Netatmo website. +If you did not manually create things in the *.things file, the Netatmo Binding is able to discover automatically all depending modules and devices from Netatmo website. ## Channels @@ -535,7 +538,7 @@ After you set the environment variable, try: ls -l $JAVA_HOME/jre/lib/security/cacerts ``` -If it's set correctly then you should see something similar to: +If it is set correctly then you should see something similar to: ``` -rw-r--r-- 1 root root 101992 Nov 4 10:54 /usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts @@ -574,32 +577,32 @@ The following icons are used by original Netatmo web app: ## Modules -- http://my.netatmo.com/img/my/app/module_int.png -- http://my.netatmo.com/img/my/app/module_ext.png -- http://my.netatmo.com/img/my/app/module_rain.png +- https://my.netatmo.com/images/my/app/module_int.png +- https://my.netatmo.com/images/my/app/module_ext.png +- https://my.netatmo.com/images/my/app/module_rain.png ## Battery status -- http://my.netatmo.com/img/my/app/battery_verylow.png -- http://my.netatmo.com/img/my/app/battery_low.png -- http://my.netatmo.com/img/my/app/battery_medium.png -- http://my.netatmo.com/img/my/app/battery_high.png -- http://my.netatmo.com/img/my/app/battery_full.png +- https://my.netatmo.com/images/my/app/battery_verylow.png +- https://my.netatmo.com/images/my/app/battery_low.png +- https://my.netatmo.com/images/my/app/battery_medium.png +- https://my.netatmo.com/images/my/app/battery_high.png +- https://my.netatmo.com/images/my/app/battery_full.png ## Signal status -- http://my.netatmo.com/img/my/app/signal_verylow.png -- http://my.netatmo.com/img/my/app/signal_low.png -- http://my.netatmo.com/img/my/app/signal_medium.png -- http://my.netatmo.com/img/my/app/signal_high.png -- http://my.netatmo.com/img/my/app/signal_full.png +- https://my.netatmo.com/images/my/app/signal_verylow.png +- https://my.netatmo.com/images/my/app/signal_low.png +- https://my.netatmo.com/images/my/app/signal_medium.png +- https://my.netatmo.com/images/my/app/signal_high.png +- https://my.netatmo.com/images/my/app/signal_full.png ## Wifi status -- http://my.netatmo.com/img/my/app/wifi_low.png -- http://my.netatmo.com/img/my/app/wifi_medium.png -- http://my.netatmo.com/img/my/app/wifi_high.png -- http://my.netatmo.com/img/my/app/wifi_full.png +- https://my.netatmo.com/images/my/app/wifi_low.png +- https://my.netatmo.com/images/my/app/wifi_medium.png +- https://my.netatmo.com/images/my/app/wifi_high.png +- https://my.netatmo.com/images/my/app/wifi_full.png diff --git a/bundles/org.openhab.binding.netatmo/lib/netatmo-java-retrofit-1.1.3.jar b/bundles/org.openhab.binding.netatmo/lib/netatmo-java-retrofit-1.1.3.jar deleted file mode 100644 index 325f009a975fc..0000000000000 Binary files a/bundles/org.openhab.binding.netatmo/lib/netatmo-java-retrofit-1.1.3.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.netatmo/pom.xml b/bundles/org.openhab.binding.netatmo/pom.xml index 956261f9ff3a8..54167672260a1 100644 --- a/bundles/org.openhab.binding.netatmo/pom.xml +++ b/bundles/org.openhab.binding.netatmo/pom.xml @@ -1,54 +1,63 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.netatmo</artifactId> <name>openHAB Add-ons :: Bundles :: Netatmo Binding</name> + <properties> + <dep.noembedding>com.squareup.okhttp.okhttp,com.squareup.okio.okio-1.3.0,com.squareup.retrofit.retrofit,org.apache.oltu.oauth2.client,org.apache.oltu.oauth2.common</dep.noembedding> + </properties> + <dependencies> + <dependency> + <groupId>com.github.cbornet.netatmo-swagger-api</groupId> + <artifactId>netatmo-java-retrofit</artifactId> + <version>1.1.3</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>org.openhab.osgiify</groupId> <artifactId>org.json.json</artifactId> <version>20131018</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.openhab.osgiify</groupId> <artifactId>com.squareup.okhttp.okhttp</artifactId> <version>2.3.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.openhab.osgiify</groupId> <artifactId>com.squareup.okio.okio-1.3.0</artifactId> <version>1.3.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.openhab.osgiify</groupId> <artifactId>com.squareup.retrofit.retrofit</artifactId> <version>1.9.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.oltu.oauth2</groupId> <artifactId>org.apache.oltu.oauth2.client</artifactId> <version>1.0.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.oltu.oauth2</groupId> <artifactId>org.apache.oltu.oauth2.common</artifactId> <version>1.0.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.netatmo/src/main/feature/feature.xml b/bundles/org.openhab.binding.netatmo/src/main/feature/feature.xml index e13aba74cc1a2..3a31036556a62 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.netatmo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-netatmo" description="Netatmo Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java index 1a4062222b106..2b11702fe745c 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/ChannelTypeUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NATherm1StateDescriptionProvider.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NATherm1StateDescriptionProvider.java index 71883a95d4717..8be33fc4b2ef4 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NATherm1StateDescriptionProvider.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NATherm1StateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java index ab9995b6fe96a..e575b05764bf7 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoHandlerFactory.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoHandlerFactory.java index c7af834a6c650..d1b5c22c85f9f 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoHandlerFactory.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/NetatmoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/RefreshStrategy.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/RefreshStrategy.java index f1d73bffcfa19..f3467ec8c1088 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/RefreshStrategy.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/RefreshStrategy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/WeatherUtils.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/WeatherUtils.java index 867f0914ad982..fec924f23177e 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/WeatherUtils.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/WeatherUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/BatteryHelper.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/BatteryHelper.java index 4859494d27161..2c3f68859106d 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/BatteryHelper.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/BatteryHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/RadioHelper.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/RadioHelper.java index abcff44201043..77fe2a4bab07b 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/RadioHelper.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/channelhelper/RadioHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/config/NetatmoBridgeConfiguration.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/config/NetatmoBridgeConfiguration.java index 6e0168a7acd21..bb0d00ee8e8cc 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/config/NetatmoBridgeConfiguration.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/config/NetatmoBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/discovery/NetatmoModuleDiscoveryService.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/discovery/NetatmoModuleDiscoveryService.java index a05a5436f95e6..14aef3ddcc037 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/discovery/NetatmoModuleDiscoveryService.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/discovery/NetatmoModuleDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java index ccfc9f8019514..5c6424ca538e4 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/AbstractNetatmoThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/MeasurableChannels.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/MeasurableChannels.java index 3732d08db325a..53770c941e503 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/MeasurableChannels.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/MeasurableChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java index 4cc81dc6979a9..57397e6d23c8f 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDataListener.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDataListener.java index 5a48b152e849d..f030750e28d81 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDataListener.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDeviceHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDeviceHandler.java index 3ab00ca54f246..103c66ff3189b 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDeviceHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoModuleHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoModuleHandler.java index 2336d10f3439d..d5a286bcdec10 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoModuleHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/NetatmoModuleHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/TrustingOkHttpClient.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/TrustingOkHttpClient.java index 2bea634061b65..2344afe2f2df6 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/TrustingOkHttpClient.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/handler/TrustingOkHttpClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/homecoach/NAHealthyHomeCoachHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/homecoach/NAHealthyHomeCoachHandler.java index ad9b4e18829f0..b08123553a93a 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/homecoach/NAHealthyHomeCoachHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/homecoach/NAHealthyHomeCoachHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java index 34f3c42e011d1..9be83c2a3355f 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAMainHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java index 87c0eebd662da..3f883d790e2eb 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule1Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule2Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule2Handler.java index 53f3e4dc6ae19..76376aec66157 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule2Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule2Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java index 774770bdad2f0..65e9d23e0eae9 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule3Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java index 63da99b621eb1..4cd92c068aae8 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/station/NAModule4Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NAPlugHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NAPlugHandler.java index ab317b79df0b4..d3845a8a0f92d 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NAPlugHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NAPlugHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NATherm1Handler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NATherm1Handler.java index cc3af045ccaa9..b004f32012366 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NATherm1Handler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/thermostat/NATherm1Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEvent.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEvent.java index 54a2c886ae49e..1c39abd905589 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEvent.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEventPerson.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEventPerson.java index 39d8ba91756ab..927a19b90f2d2 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEventPerson.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/NAWebhookCameraEventPerson.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/WelcomeWebHookServlet.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/WelcomeWebHookServlet.java index 2ba32e5a83964..a57edb2ad5c9d 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/WelcomeWebHookServlet.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/webhook/WelcomeWebHookServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeCameraHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeCameraHandler.java index bebe168f5a284..8eecffbfb2170 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeCameraHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeCameraHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeHomeHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeHomeHandler.java index 063a337a4faa0..ea41e70ab2923 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeHomeHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomeHomeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomePersonHandler.java b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomePersonHandler.java index 3c8f77aaa3afb..436f93aeaeee2 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomePersonHandler.java +++ b/bundles/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/internal/welcome/NAWelcomePersonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/config/config.xml index f30535a046425..be947333380d8 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/config/config.xml @@ -49,13 +49,13 @@ </parameter> <parameter name="readWelcome" type="boolean" required="true"> - <label>Access Welcome camera</label> + <label>Access Welcome Camera</label> <description>Read and Access Welcome camera's data.</description> <default>false</default> </parameter> <parameter name="webHookUrl" type="text" required="false"> - <label>Webhook address</label> + <label>Webhook Address</label> <description>Protocol, public IP and port to access OH2 server from Internet.</description> <advanced>true</advanced> </parameter> @@ -120,7 +120,7 @@ </parameter> <parameter name="setpointDefaultDuration" type="integer" required="false"> - <label>Setpoint duration</label> + <label>Setpoint Duration</label> <description>Default duration of thermostat change when force to max or manual.</description> <default>60</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml index cfe81ca3fc272..f0a91f7d47853 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/channels.xml @@ -81,7 +81,7 @@ <channel-type id="ThermRelayCmd" advanced="false"> <item-type>Switch</item-type> - <label>Heating status</label> + <label>Heating Status</label> <description>Indicates whether the furnace is heating or not</description> <state readOnly="true" /> </channel-type> @@ -143,7 +143,7 @@ <channel-type id="setpointEndTime" advanced="true"> <item-type>DateTime</item-type> - <label>Setpoint end</label> + <label>Setpoint End</label> <description>Thermostat goes back to schedule after that timestamp.</description> <state readOnly="true" pattern="%1$td.%1$tm.%1$tY %1$tH:%1$tM" /> </channel-type> @@ -334,7 +334,7 @@ <channel-type id="homeEvent"> <kind>trigger</kind> - <label>Home event</label> + <label>Home Event</label> <description>Home event</description> <event> <options> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml index e4daa681faeb7..1f37077a063d1 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/station.xml @@ -9,7 +9,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Main indoor station</label> + <label>Main Indoor Station</label> <description>This represents the main indoor module capable of reporting temperature,humidity,pressure,air quality and sound level</description> <channels> @@ -50,7 +50,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Outdoor module</label> + <label>Outdoor Module</label> <description>This represents the outdoor module capable of reporting temperature and humidity</description> <channels> @@ -87,7 +87,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Wind gauge module</label> + <label>Wind Gauge Module</label> <description>This represents the wind module capable of reporting wind angle and strength</description> <channels> @@ -148,7 +148,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Additional module</label> + <label>Additional Module</label> <description>This represents an additional indoor module capable of reporting temperature, humidity and CO2 level</description> <channels> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/thermostat.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/thermostat.xml index 1319afa2f27ca..3b128154cf58e 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/thermostat.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/thermostat.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Thermostat relay/plug</label> + <label>Thermostat Relay/Plug</label> <description>This represents the thermostat relay</description> <channels> @@ -37,7 +37,7 @@ <bridge-type-ref id="netatmoapi" /> </supported-bridge-type-refs> - <label>Thermostat module</label> + <label>Thermostat Module</label> <description>This represents the thermostat module itself</description> <channels> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomecamera.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomecamera.xml index b7b0e62332c6d..d47ff042ad4de 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomecamera.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomecamera.xml @@ -50,14 +50,14 @@ <channel-type id="is_locale" advanced="true"> <item-type>Switch</item-type> - <label>Is local</label> + <label>Is Local</label> <description>Only for scope access_camera. If Camera and application requesting the information are on the same network (true/false)</description> <state readOnly="true"></state> </channel-type> <channel-type id="live_picture_url" advanced="true"> <item-type>String</item-type> - <label>Live snapshot URL</label> + <label>Live Snapshot URL</label> <description>Url of the live snapshot for this camera (need scope access_camera)</description> <state readOnly="true"></state> </channel-type> @@ -71,7 +71,7 @@ <channel-type id="live_stream_url" advanced="true"> <item-type>String</item-type> - <label>Live stream URL</label> + <label>Live Stream URL</label> <description>Url of the live stream for this camera</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomehome.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomehome.xml index 3c2b93eaa8a20..0a63138853b17 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomehome.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomehome.xml @@ -57,13 +57,13 @@ </channel-type> <channel-type id="homepersoncount" advanced="false"> <item-type>Number</item-type> - <label>Person counter</label> + <label>Person Counter</label> <description>Total number of Persons that are at home</description> <state readOnly="true" pattern="%d"></state> </channel-type> <channel-type id="homeunknowncount" advanced="true"> <item-type>Number</item-type> - <label>Unknown Person counter</label> + <label>Unknown Person Counter</label> <description>Count how many Unknown Persons are at home</description> <state readOnly="true" pattern="%d"></state> </channel-type> @@ -114,13 +114,13 @@ </channel-type> <channel-type id="video_status"> <item-type>String</item-type> - <label>Video status</label> + <label>Video Status</label> <description>Status of the video (recording, deleted or available)</description> <state readOnly="true"></state> </channel-type> <channel-type id="is_arrival"> <item-type>Switch</item-type> - <label>Is arrival</label> + <label>Is Arrival</label> <description>If person was considered "away" before being seen during this event</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomeperson.xml b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomeperson.xml index 04b9cfea1e11c..dd1b3066ac2c5 100644 --- a/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomeperson.xml +++ b/bundles/org.openhab.binding.netatmo/src/main/resources/ESH-INF/thing/welcomeperson.xml @@ -29,34 +29,34 @@ <channel-type id="last_seen"> <item-type>DateTime</item-type> - <label>Last seen</label> + <label>Last Seen</label> <description>Time when this person was last seen</description> <state readOnly="true"></state> </channel-type> <channel-type id="person_athome"> <item-type>Switch</item-type> - <label>At home</label> + <label>At Home</label> <description>Indicates if this person is known to be at home or not</description> </channel-type> <channel-type id="person_eventmsg"> <item-type>String</item-type> - <label>Last Event message</label> + <label>Last Event Message</label> <description>Last Event message from this person</description> <state readOnly="true"></state> </channel-type> <channel-type id="person_eventtime"> <item-type>DateTime</item-type> - <label>Last Event time</label> + <label>Last Event Time</label> <description>Last Event message time for this person</description> <state readOnly="true"></state> </channel-type> <channel-type id="person_avatar_url" advanced="true"> <item-type>String</item-type> - <label>Avatar URL </label> + <label>Avatar URL</label> <description>URL for the avatar of this person</description> <state readOnly="true"></state> </channel-type> @@ -77,7 +77,7 @@ <channel-type id="person_event_url" advanced="true"> <item-type>String</item-type> - <label>Last event URL</label> + <label>Last Event URL</label> <description>URL for the picture of the last event for this person</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.network/NOTICE b/bundles/org.openhab.binding.network/NOTICE index 4c20ef446c1e4..dd8442e7e3a5a 100644 --- a/bundles/org.openhab.binding.network/NOTICE +++ b/bundles/org.openhab.binding.network/NOTICE @@ -10,4 +10,16 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content + +jspeedtest +* License: MIT License +* Project: https://github.com/bertrandmartel/speed-test-lib +* Source: https://github.com/bertrandmartel/speed-test-lib + +http-endec +* License: MIT License +* Project: https://github.com/bertrandmartel/http-endec +* Source: https://github.com/bertrandmartel/http-endec diff --git a/bundles/org.openhab.binding.network/README.md b/bundles/org.openhab.binding.network/README.md index 7dfaac4c6fbcd..c2bddf56234d0 100644 --- a/bundles/org.openhab.binding.network/README.md +++ b/bundles/org.openhab.binding.network/README.md @@ -13,6 +13,7 @@ The binding has the following configuration options: - **allowDHCPlisten:** If devices leave and reenter a network, they usually request their last IPv4 address by using DHCP requests. By listening for those messages, the status update can be more "real-time" without having to wait for the next refresh cycle. Default is true. - **arpPingToolPath:** If the arp ping tool is not called `arping` and cannot be found in the PATH environment variable, the absolute path can be configured here. Default is `arping`. - **cacheDeviceStateTimeInMS:** The result of a device presence detection is cached for a small amount of time. Set this time here in milliseconds. Be aware that no new pings will be issued within this time frame, even if explicitly requested. Default is 2000. +- **preferResponseTimeAsLatency:** If enabled, an attempt will be made to extract the latency from the output of the ping command. If no such latency value is found in the ping command output, the time to execute the ping command is used as fallback latency. If disabled, the time to execute the ping command is always used as latency value. This is disabled by default to be backwards-compatible and to not break statistics and monitoring which existed before this feature. Create a `<openHAB-conf>/services/network.cfg` file and use the above options like this: @@ -130,11 +131,11 @@ Linux has three different tools: * arping by Thomas Habets (Ubuntu/Debian: `apt-get install arping`) * arp-ping by Eli Fulkerson (Windows: https://www.elifulkerson.com/projects/arp-ping.php) -arping by Thomas Habets runs on Windows and MacOS as well. +arping by Thomas Habets runs on Windows and macOS as well. Make sure the tool is available in the PATH, or in the same path as the openHAB executable. -On Linux and MacOS elevated access permissions may be needed, for instance by making the executable a suid executable (`chmod u+s /usr/sbin/arping`). +On Linux and macOS elevated access permissions may be needed, for instance by making the executable a suid executable (`chmod u+s /usr/sbin/arping`). Just test the executable on the command line; if `sudo` is required, grant elevated permissions. ### DHCP Listen @@ -156,6 +157,18 @@ iptables -A PREROUTING -t mangle -p udp ! -s 127.0.0.1 --dport 67 -j TEE --gatew iptables -A OUTPUT -t nat -p udp -s 127.0.0.1/32 --dport 67 -j DNAT --to 127.0.0.1:6767 ``` +Above iptables solutions to check *dhcp_state* are not working when OpenHAB is started in Docker. Use another workaround + +```shell +iptables -I PREROUTING -t nat -p udp --src 0.0.0.0 --dport 67 -j DNAT --to 0.0.0.0:6767 +``` + +To verify PREROUTING list use below command + +```shell +iptables -L -n -t nat +``` + ## Channels Things support the following channels: diff --git a/bundles/org.openhab.binding.network/pom.xml b/bundles/org.openhab.binding.network/pom.xml index 464429cd866d9..deade085570c4 100644 --- a/bundles/org.openhab.binding.network/pom.xml +++ b/bundles/org.openhab.binding.network/pom.xml @@ -1,31 +1,40 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.network</artifactId> <name>openHAB Add-ons :: Bundles :: Network Binding</name> - + + <properties> + <dep.noembedding>commons-net</dep.noembedding> + </properties> + <dependencies> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>fr.bmartel.jspeedtest</artifactId> - <version>1.32.1</version> - <scope>provided</scope> + <groupId>fr.bmartel</groupId> + <artifactId>jspeedtest</artifactId> + <version>1.32.1</version> + <scope>compile</scope> </dependency> <dependency> - <groupId>org.openhab.osgiify</groupId> - <artifactId>fr.bmartel.http-endec</artifactId> - <version>1.04</version> - <scope>provided</scope> + <groupId>fr.bmartel</groupId> + <artifactId>http-endec</artifactId> + <version>1.04</version> + <scope>compile</scope> </dependency> + <dependency> + <groupId>commons-net</groupId> + <artifactId>commons-net</artifactId> + <version>3.6</version> + <scope>compile</scope> + </dependency> </dependencies> </project> diff --git a/bundles/org.openhab.binding.network/src/main/feature/feature.xml b/bundles/org.openhab.binding.network/src/main/feature/feature.xml index 9e59c06a301f0..5479ba232903d 100644 --- a/bundles/org.openhab.binding.network/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.network/src/main/feature/feature.xml @@ -1,13 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.network-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-network" description="Network Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-core-model-script</feature> <bundle dependency="true">mvn:commons-net/commons-net/3.6</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/fr.bmartel.jspeedtest/1.32.1</bundle> - <bundle dependency="true">mvn:org.openhab.osgiify/fr.bmartel.http-endec/1.04</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.network/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfiguration.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfiguration.java index 4f1b377c14f27..edb4e82c817c3 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfiguration.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,6 +13,8 @@ package org.openhab.binding.network.internal; import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.network.internal.utils.NetworkUtils; @@ -26,19 +28,47 @@ */ @NonNullByDefault public class NetworkBindingConfiguration { + public Boolean allowSystemPings = true; public Boolean allowDHCPlisten = true; public BigDecimal cacheDeviceStateTimeInMS = BigDecimal.valueOf(2000); public String arpPingToolPath = "arping"; public @NonNullByDefault({}) ArpPingUtilEnum arpPingUtilMethod; + // For backwards compatibility reasons, the default is to use the ping method execution time as latency value + public boolean preferResponseTimeAsLatency = false; + + private List<NetworkBindingConfigurationListener> listeners = new ArrayList<>(); public void update(NetworkBindingConfiguration newConfiguration) { this.allowSystemPings = newConfiguration.allowSystemPings; this.allowDHCPlisten = newConfiguration.allowDHCPlisten; this.cacheDeviceStateTimeInMS = newConfiguration.cacheDeviceStateTimeInMS; this.arpPingToolPath = newConfiguration.arpPingToolPath; + this.preferResponseTimeAsLatency = newConfiguration.preferResponseTimeAsLatency; NetworkUtils networkUtils = new NetworkUtils(); this.arpPingUtilMethod = networkUtils.determineNativeARPpingMethod(arpPingToolPath); + + notifyListeners(); + } + + public void addNetworkBindingConfigurationListener(NetworkBindingConfigurationListener listener) { + listeners.add(listener); + } + + private void notifyListeners() { + listeners.forEach(NetworkBindingConfigurationListener::bindingConfigurationChanged); + } + + @Override + public String toString() { + return "NetworkBindingConfiguration{" + + "allowSystemPings=" + allowSystemPings + + ", allowDHCPlisten=" + allowDHCPlisten + + ", cacheDeviceStateTimeInMS=" + cacheDeviceStateTimeInMS + + ", arpPingToolPath='" + arpPingToolPath + '\'' + + ", arpPingUtilMethod=" + arpPingUtilMethod + + ", preferResponseTimeAsLatency=" + preferResponseTimeAsLatency + + '}'; } } diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfigurationListener.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfigurationListener.java new file mode 100644 index 0000000000000..bbd5ca6f5130a --- /dev/null +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConfigurationListener.java @@ -0,0 +1,23 @@ +/** + * 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.network.internal; + +/** + * Listener for binding configuration changes. + * + * @author Andreas Hirsch - Initial contribution + */ +public interface NetworkBindingConfigurationListener { + + void bindingConfigurationChanged(); +} diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConstants.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConstants.java index 88cd63c20450a..012f6ee40b811 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConstants.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerConfiguration.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerConfiguration.java index a5a496afd3ba4..92427455c7cc6 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerConfiguration.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerFactory.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerFactory.java index a02b64ec76dd5..dbac3942e6100 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerFactory.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/NetworkHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,8 @@ import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Deactivate; import org.osgi.service.component.annotations.Modified; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The handler factory retrieves the binding configuration and is responsible for creating @@ -41,6 +43,8 @@ public class NetworkHandlerFactory extends BaseThingHandlerFactory { final NetworkBindingConfiguration configuration = new NetworkBindingConfiguration(); + private final Logger logger = LoggerFactory.getLogger(NetworkHandlerFactory.class); + @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { return NetworkBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); @@ -65,6 +69,7 @@ protected void modified(Map<String, Object> config) { // configuration, the values are automatically available in all handlers. Because they all // share the same instance. configuration.update(new Configuration(config).as(NetworkBindingConfiguration.class)); + logger.debug("Updated binding configuration to {}", configuration); } @Override diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetection.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetection.java index 4fd7c6cd6d746..847e1988b4f69 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetection.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,20 +12,6 @@ */ package org.openhab.binding.network.internal; -import java.io.IOException; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.SocketException; -import java.net.UnknownHostException; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; - import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.cache.ExpiringCache; @@ -35,9 +21,20 @@ import org.openhab.binding.network.internal.utils.NetworkUtils; import org.openhab.binding.network.internal.utils.NetworkUtils.ArpPingUtilEnum; import org.openhab.binding.network.internal.utils.NetworkUtils.IpPingMethodEnum; +import org.openhab.binding.network.internal.utils.PingResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.SocketException; +import java.net.UnknownHostException; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.*; +import java.util.function.Consumer; + /** * The {@link PresenceDetection} handles the connection to the Device * @@ -47,6 +44,7 @@ */ @NonNullByDefault public class PresenceDetection implements IPRequestReceivedCallback { + public static final double NOT_REACHABLE = -1; public static final int DESTINATION_TTL = 300 * 1000; // in ms, 300 s @@ -71,6 +69,8 @@ public class PresenceDetection implements IPRequestReceivedCallback { private @NonNullByDefault({}) ExpiringCache<@Nullable InetAddress> destination; private @Nullable InetAddress cachedDestination = null; + public boolean preferResponseTimeAsLatency; + /// State variables (cannot be final because of test dependency injections) ExpiringCacheAsync<PresenceDetectionValue> cache; private final PresenceDetectionListener updateListener; @@ -148,6 +148,10 @@ public void setTimeout(int timeout) { this.timeoutInMS = timeout; } + public void setPreferResponseTimeAsLatency(boolean preferResponseTimeAsLatency) { + this.preferResponseTimeAsLatency = preferResponseTimeAsLatency; + } + /** * Sets the ping method. This method will perform a feature test. If SYSTEM_PING * does not work on this system, JAVA_PING will be used instead. @@ -339,13 +343,13 @@ public boolean performPresenceDetection(boolean waitForDetectionToFinish) { performARPping(""); checkIfFinished(); }); - } else if (interfaceNames != null) { + } else if (interfaceNames != null) { for (final String interfaceName : interfaceNames) { executorService.execute(() -> { Thread.currentThread().setName("presenceDetectionARP_" + hostname + " " + interfaceName); performARPping(interfaceName); checkIfFinished(); - }); + }); } } @@ -468,15 +472,15 @@ synchronized PresenceDetectionValue updateReachableValue(PresenceDetectionType t protected void performServicePing(int tcpPort) { logger.trace("Perform TCP presence detection for {} on port: {}", hostname, tcpPort); try { - double pingTime = System.nanoTime(); InetAddress destinationAddress = destination.getValue(); - if (destinationAddress != null - && networkUtils.servicePing(destinationAddress.getHostAddress(), tcpPort, timeoutInMS)) { - final double latency = Math.round((System.nanoTime() - pingTime) / 1000000.0f); - PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.TCP_CONNECTION, latency); - v.addReachableTcpService(tcpPort); - updateListener.partialDetectionResult(v); - } + + networkUtils.servicePing(destinationAddress.getHostAddress(), tcpPort, timeoutInMS).ifPresent(o -> { + if(o.isSuccess()) { + PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.TCP_CONNECTION, getLatency(o, preferResponseTimeAsLatency)); + v.addReachableTcpService(tcpPort); + updateListener.partialDetectionResult(v); + } + }); } catch (IOException e) { // This should not happen and might be a user configuration issue, we log a warning message therefore. logger.warn("Could not create a socket connection", e); @@ -502,13 +506,14 @@ protected void performARPping(String interfaceName) { networkUtils.wakeUpIOS(destinationAddress); Thread.sleep(50); } - double pingTime = System.nanoTime(); - if (networkUtils.nativeARPPing(arpPingMethod, arpPingUtilPath, interfaceName, - destinationAddress.getHostAddress(), timeoutInMS)) { - final double latency = Math.round((System.nanoTime() - pingTime) / 1000000.0f); - PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ARP_PING, latency); - updateListener.partialDetectionResult(v); - } + + networkUtils.nativeARPPing(arpPingMethod, arpPingUtilPath, interfaceName, + destinationAddress.getHostAddress(), timeoutInMS).ifPresent(o -> { + if (o.isSuccess()) { + PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ARP_PING, getLatency(o, preferResponseTimeAsLatency)); + updateListener.partialDetectionResult(v); + } + }); } catch (IOException e) { logger.trace("Failed to execute an arp ping for ip {}", hostname, e); } catch (InterruptedException ignored) { @@ -523,36 +528,37 @@ protected void performARPping(String interfaceName) { * (http://docs.oracle.com/javase/7/docs/api/java/net/InetAddress.html#isReachable%28int%29) */ protected void performJavaPing() { - try { - logger.trace("Perform java ping presence detection for {}", hostname); - double pingTime = System.nanoTime(); - InetAddress destinationAddress = destination.getValue(); - if (destinationAddress == null) { - return; - } - if (destinationAddress.isReachable(timeoutInMS)) { - final double latency = Math.round((System.nanoTime() - pingTime) / 1000000.0f); - PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ICMP_PING, latency); + logger.trace("Perform java ping presence detection for {}", hostname); + + InetAddress destinationAddress = destination.getValue(); + if (destinationAddress == null) { + return; + } + + networkUtils.javaPing(timeoutInMS, destinationAddress).ifPresent(o -> { + if (o.isSuccess()) { + PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ICMP_PING, getLatency(o, preferResponseTimeAsLatency)); updateListener.partialDetectionResult(v); } - } catch (IOException e) { - logger.trace("Failed to execute a java ping for ip {}", hostname, e); - } + }); } protected void performSystemPing() { try { logger.trace("Perform native ping presence detection for {}", hostname); - double pingTime = System.nanoTime(); InetAddress destinationAddress = destination.getValue(); if (destinationAddress == null) { return; } - if (networkUtils.nativePing(pingMethod, destinationAddress.getHostAddress(), timeoutInMS)) { - final double latency = Math.round((System.nanoTime() - pingTime) / 1000000.0f); - PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ICMP_PING, latency); - updateListener.partialDetectionResult(v); - } + + networkUtils.nativePing(pingMethod, destinationAddress.getHostAddress(), timeoutInMS).ifPresent(o -> { + if (o.isSuccess()) { + PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.ICMP_PING, getLatency(o, preferResponseTimeAsLatency)); + updateListener.partialDetectionResult(v); + } + }); + + } catch (IOException e) { logger.trace("Failed to execute a native ping for ip {}", hostname, e); } catch (InterruptedException e) { @@ -560,6 +566,18 @@ protected void performSystemPing() { } } + private double getLatency(PingResult pingResult, boolean preferResponseTimeAsLatency) { + logger.debug("Getting latency from ping result {} using latency mode {}", pingResult, preferResponseTimeAsLatency); + // Execution time is always set and this value is also the default. So lets use it first. + double latency = pingResult.getExecutionTimeInMS(); + + if (preferResponseTimeAsLatency && pingResult.getResponseTimeInMS().isPresent()) { + latency = pingResult.getResponseTimeInMS().get(); + } + + return latency; + } + @Override public void dhcpRequestReceived(String ipAddress) { PresenceDetectionValue v = updateReachableValue(PresenceDetectionType.DHCP_REQUEST, 0); diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionListener.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionListener.java index 05294a753b7c7..66de18e780c29 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionListener.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionType.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionType.java index 78be4d17a910c..5655a52ac20dc 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionType.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionValue.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionValue.java index d18faa8102812..91cf2221a1816 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionValue.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/PresenceDetectionValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/SpeedTestConfiguration.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/SpeedTestConfiguration.java index 7bc7ddba24627..7103c1e205e5e 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/SpeedTestConfiguration.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/SpeedTestConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPListenService.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPListenService.java index 22a1e2035378a..1e8e5c55fc560 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPListenService.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPListenService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacket.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacket.java index 734e51524d72e..c363bc0712ba2 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacket.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacketListenerServer.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacketListenerServer.java index 897ca3fcfd34e..cc5b9416244d3 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacketListenerServer.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/DHCPPacketListenerServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/IPRequestReceivedCallback.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/IPRequestReceivedCallback.java index e22224ba2869f..d3838365b9dd4 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/IPRequestReceivedCallback.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/dhcp/IPRequestReceivedCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/discovery/NetworkDiscoveryService.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/discovery/NetworkDiscoveryService.java index d53e4dc1a5dea..78728a0ffd917 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/discovery/NetworkDiscoveryService.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/discovery/NetworkDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/NetworkHandler.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/NetworkHandler.java index ca95fb834358e..16902d98394ec 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/NetworkHandler.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/NetworkHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,12 +35,7 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.UnDefType; -import org.openhab.binding.network.internal.NetworkBindingConfiguration; -import org.openhab.binding.network.internal.NetworkBindingConstants; -import org.openhab.binding.network.internal.NetworkHandlerConfiguration; -import org.openhab.binding.network.internal.PresenceDetection; -import org.openhab.binding.network.internal.PresenceDetectionListener; -import org.openhab.binding.network.internal.PresenceDetectionValue; +import org.openhab.binding.network.internal.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +47,7 @@ * @author David Graeff - Rewritten */ @NonNullByDefault -public class NetworkHandler extends BaseThingHandler implements PresenceDetectionListener { +public class NetworkHandler extends BaseThingHandler implements PresenceDetectionListener, NetworkBindingConfigurationListener { private final Logger logger = LoggerFactory.getLogger(NetworkHandler.class); private @NonNullByDefault({}) PresenceDetection presenceDetection; @@ -72,6 +67,7 @@ public NetworkHandler(Thing thing, boolean isTCPServiceDevice, NetworkBindingCon super(thing); this.isTCPServiceDevice = isTCPServiceDevice; this.configuration = configuration; + this.configuration.addNetworkBindingConfigurationListener(this); } private void refreshValue(ChannelUID channelUID) { @@ -165,6 +161,7 @@ void initialize(PresenceDetection presenceDetection) { this.presenceDetection = presenceDetection; presenceDetection.setHostname(handlerConfiguration.hostname); + presenceDetection.setPreferResponseTimeAsLatency(configuration.preferResponseTimeAsLatency); if (isTCPServiceDevice) { Integer port = handlerConfiguration.port; @@ -218,4 +215,10 @@ public void initialize() { public boolean isTCPServiceDevice() { return isTCPServiceDevice; } + + @Override + public void bindingConfigurationChanged() { + // Make sure that changed binding configuration is reflected + presenceDetection.setPreferResponseTimeAsLatency(configuration.preferResponseTimeAsLatency); + } } diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/SpeedTestHandler.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/SpeedTestHandler.java index dd96bb170afc2..15efd97a472e0 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/SpeedTestHandler.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/handler/SpeedTestHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsync.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsync.java index c4e7e8dc8c3f2..534c2db122f4b 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsync.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsync.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java new file mode 100644 index 0000000000000..70db4dc062523 --- /dev/null +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java @@ -0,0 +1,59 @@ +/** + * 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.network.internal.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Examines output lines of the ping command and tries to extract the contained latency value. + * + * @author Andreas Hirsch - Initial contribution + */ +public class LatencyParser { + + private final Logger logger = LoggerFactory.getLogger(LatencyParser.class); + + // This is how the input looks like on Mac and Linux: + // ping -c 1 192.168.1.1 + // PING 192.168.1.1 (192.168.1.1): 56 data bytes + // 64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.225 ms + // + // --- 192.168.1.1 ping statistics --- + // 1 packets transmitted, 1 packets received, 0.0% packet loss + // round-trip min/avg/max/stddev = 1.225/1.225/1.225/0.000 ms + + /** + * Examine a single ping command output line and try to extract the latency value if it is contained. + * + * @param inputLine Single output line of the ping command. + * @return Latency value provided by the ping command. Optional is empty if the provided line did not contain a + * latency value which matches the known patterns. + */ + public Optional<Double> parseLatency(String inputLine) { + logger.debug("Parsing latency from input {}", inputLine); + + String pattern = ".*time=(.*) ms"; + Matcher m = Pattern.compile(pattern).matcher(inputLine); + if(m.find() && m.groupCount() == 1) { + return Optional.of(Double.parseDouble(m.group(1))); + } + + logger.debug("Did not find a latency value"); + return Optional.empty(); + } +} diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java index 863f3d195301a..e612d4663e77b 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/NetworkUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,28 +12,6 @@ */ package org.openhab.binding.network.internal.utils; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.ConnectException; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.Inet4Address; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.NetworkInterface; -import java.net.NoRouteToHostException; -import java.net.PortUnreachableException; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.SocketException; -import java.net.SocketTimeoutException; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.stream.Collectors; - import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; import org.apache.commons.net.util.SubnetUtils; @@ -45,6 +23,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.*; +import java.util.*; +import java.util.stream.Collectors; + /** * Network utility functions for pinging and for determining all interfaces and assigned IP addresses. * @@ -54,6 +39,8 @@ public class NetworkUtils { private final Logger logger = LoggerFactory.getLogger(NetworkUtils.class); + private LatencyParser latencyParser = new LatencyParser(); + /** * Gets every IPv4 Address on each Interface except the loopback * The Address format is ip/subnet @@ -75,7 +62,7 @@ public Set<String> getInterfaceNames() { try { // For each interface ... - for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { + for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) { NetworkInterface networkInterface = en.nextElement(); if (!networkInterface.isLoopback()) { result.add(networkInterface.getName()); @@ -101,7 +88,7 @@ public Set<String> getNetworkIPs(int maximumPerInterface) { /** * Takes the interfaceIPs and fetches every IP which can be assigned on their network * - * @param networkIPs The IPs which are assigned to the Network Interfaces + * @param interfaceIPs The IPs which are assigned to the Network Interfaces * @param maximumPerInterface The maximum of IP addresses per interface or 0 to get all. * @return Every single IP which can be assigned on the Networks the computer is connected to */ @@ -150,17 +137,18 @@ public Set<String> getNetworkIPs(Set<CidrAddress> interfaceIPs, int maximumPerIn * @param host The IP or hostname * @param port The tcp port. Must be not 0. * @param timeout Timeout in ms - * @param logger A slf4j logger instance to log IOException - * @return + * @return Ping result information. Optional is empty if ping command was not executed. * @throws IOException */ - public boolean servicePing(String host, int port, int timeout) throws IOException { + public Optional<PingResult> servicePing(String host, int port, int timeout) throws IOException { + double execStartTimeInMS = System.currentTimeMillis(); + SocketAddress socketAddress = new InetSocketAddress(host, port); try (Socket socket = new Socket()) { socket.connect(socketAddress, timeout); - return true; + return Optional.of(new PingResult(true, System.currentTimeMillis() - execStartTimeInMS)); } catch (ConnectException | SocketTimeoutException | NoRouteToHostException ignored) { - return false; + return Optional.of(new PingResult(false, System.currentTimeMillis() - execStartTimeInMS)); } } @@ -182,7 +170,8 @@ public IpPingMethodEnum determinePingMethod() { } try { - if (nativePing(method, "127.0.0.1", 1000)) { + Optional<PingResult> pingResult = nativePing(method, "127.0.0.1", 1000); + if (pingResult.isPresent() && pingResult.get().isSuccess()) { return method; } } catch (IOException ignored) { @@ -225,14 +214,16 @@ public enum IpPingMethodEnum { * * @param hostname The DNS name, IPv4 or IPv6 address. Must not be null. * @param timeoutInMS Timeout in milliseconds. Be aware that DNS resolution is not part of this timeout. - * @return Returns true if the device responded + * @return Ping result information. Optional is empty if ping command was not executed. * @throws IOException The ping command could probably not be found */ - public boolean nativePing(@Nullable IpPingMethodEnum method, String hostname, int timeoutInMS) + public Optional<PingResult> nativePing(@Nullable IpPingMethodEnum method, String hostname, int timeoutInMS) throws IOException, InterruptedException { + double execStartTimeInMS = System.currentTimeMillis(); + Process proc; if (method == null) { - return false; + return Optional.empty(); } // Yes, all supported operating systems have their own ping utility with a different command line switch (method) { @@ -250,7 +241,7 @@ public boolean nativePing(@Nullable IpPingMethodEnum method, String hostname, in case JAVA_PING: default: // We cannot estimate the command line for any other operating system and just return false - return false; + return Optional.empty(); } // The return code is 0 for a successful ping, 1 if device didn't @@ -258,13 +249,10 @@ public boolean nativePing(@Nullable IpPingMethodEnum method, String hostname, in // not ready. // Exception: return code is also 0 in Windows for all requests on the local subnet. // see https://superuser.com/questions/403905/ping-from-windows-7-get-no-reply-but-sets-errorlevel-to-0 - if (method != IpPingMethodEnum.WINDOWS_PING) { - return proc.waitFor() == 0; - } int result = proc.waitFor(); if (result != 0) { - return false; + return Optional.of(new PingResult(false, System.currentTimeMillis() - execStartTimeInMS)); } try (BufferedReader r = new BufferedReader(new InputStreamReader(proc.getInputStream()))) { @@ -273,13 +261,17 @@ public boolean nativePing(@Nullable IpPingMethodEnum method, String hostname, in throw new IOException("Received no output from ping process."); } do { - if (line.contains("TTL=")) { - return true; + // Because of the Windows issue, we need to check this. We assume that the ping was successful whenever + // this specific string is contained in the output + if (line.contains("TTL=") || line.contains("ttl=")) { + PingResult pingResult = new PingResult(true, System.currentTimeMillis() - execStartTimeInMS); + latencyParser.parseLatency(line).ifPresent(pingResult::setResponseTimeInMS); + return Optional.of(pingResult); } line = r.readLine(); } while (line != null); - return false; + return Optional.of(new PingResult(false, System.currentTimeMillis() - execStartTimeInMS)); } } @@ -302,13 +294,15 @@ public enum ArpPingUtilEnum { * @param interfaceName An interface name, on linux for example "wlp58s0", shown by ifconfig. Must not be null. * @param ipV4address The ipV4 address. Must not be null. * @param timeoutInMS A timeout in milliseconds - * @return Return true if the device responded + * @return Ping result information. Optional is empty if ping command was not executed. * @throws IOException The ping command could probably not be found */ - public boolean nativeARPPing(@Nullable ArpPingUtilEnum arpingTool, @Nullable String arpUtilPath, - String interfaceName, String ipV4address, int timeoutInMS) throws IOException, InterruptedException { + public Optional<PingResult> nativeARPPing(@Nullable ArpPingUtilEnum arpingTool, @Nullable String arpUtilPath, + String interfaceName, String ipV4address, int timeoutInMS) throws IOException, InterruptedException { + double execStartTimeInMS = System.currentTimeMillis(); + if (arpUtilPath == null || arpingTool == null || arpingTool == ArpPingUtilEnum.UNKNOWN_TOOL) { - return false; + return Optional.empty(); } Process proc; if (arpingTool == ArpPingUtilEnum.THOMAS_HABERT_ARPING_WITHOUT_TIMEOUT) { @@ -325,7 +319,28 @@ public boolean nativeARPPing(@Nullable ArpPingUtilEnum arpingTool, @Nullable Str // The return code is 0 for a successful ping. 1 if device didn't respond and 2 if there is another error like // network interface not ready. - return proc.waitFor() == 0; + return Optional.of(new PingResult(proc.waitFor() == 0, System.currentTimeMillis() - execStartTimeInMS)); + } + + /** + * Execute a Java ping. + * + * @param timeoutInMS A timeout in milliseconds + * @param destinationAddress The address to check + * @return Ping result information. Optional is empty if ping command was not executed. + */ + public Optional<PingResult> javaPing(int timeoutInMS, InetAddress destinationAddress) { + double execStartTimeInMS = System.currentTimeMillis(); + + try { + if(destinationAddress.isReachable(timeoutInMS)) { + return Optional.of(new PingResult(true, System.currentTimeMillis() - execStartTimeInMS)); + } else { + return Optional.of(new PingResult(false, System.currentTimeMillis() - execStartTimeInMS)); + } + } catch (IOException e) { + return Optional.of(new PingResult(false, System.currentTimeMillis() - execStartTimeInMS)); + } } /** diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/PingResult.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/PingResult.java new file mode 100644 index 0000000000000..46169bef2f062 --- /dev/null +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/PingResult.java @@ -0,0 +1,74 @@ +/** + * 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.network.internal.utils; + +import java.util.Optional; + +/** + * Information about the ping result. + * + * @author Andreas Hirsch - Initial contribution + */ +public class PingResult { + + private boolean success; + private Double responseTimeInMS; + private double executionTimeInMS; + + /** + * @param success <code>true</code> if the device was reachable, <code>false</code> if not. + * @param executionTimeInMS Execution time of the ping command in ms. + */ + public PingResult(boolean success, double executionTimeInMS) { + this.success = success; + this.executionTimeInMS = executionTimeInMS; + } + + /** + * @return <code>true</code> if the device was reachable, <code>false</code> if not. + */ + public boolean isSuccess() { + return success; + } + + /** + * @return Response time in ms which was returned by the ping command. Optional is empty if response time provided + * by ping command is not available. + */ + public Optional<Double> getResponseTimeInMS() { + return responseTimeInMS == null ? Optional.empty() : Optional.of(responseTimeInMS); + } + + /** + * @param responseTimeInMS Response time in ms which was returned by the ping command. + */ + public void setResponseTimeInMS(double responseTimeInMS) { + this.responseTimeInMS = responseTimeInMS; + } + + @Override + public String toString() { + return "PingResult{" + + "success=" + success + + ", responseTimeInMS=" + responseTimeInMS + + ", executionTimeInMS=" + executionTimeInMS + + '}'; + } + + /** + * @return Execution time of the ping command in ms. + */ + public double getExecutionTimeInMS() { + return executionTimeInMS; + } +} diff --git a/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/binding/binding.xml index ee1cf1207cc45..89628e8b919d7 100644 --- a/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/binding/binding.xml @@ -10,26 +10,31 @@ <config-description> <parameter name="allowSystemPings" type="boolean"> <default>true</default> - <label>Allow system pings</label> + <label>Allow System Pings</label> <description>Allows or disallows to use system pings next to the java integrated ping functionality. On windows the system ping works more reliable most of the time.</description> </parameter> <parameter name="allowDHCPlisten" type="boolean"> <default>true</default> - <label>Listen for dhcp requests</label> + <label>Listen for DHCP Requests</label> <description>Usually a device requests an IP address in an IPv4 network with the help of DHCP as soon as it enters a network. If we listen to those packets, we can detect a device presence even faster. You need elevated access rights (see readme) for this to work.</description> </parameter> - <parameter name="cacheDeviceStateTimeInMS" type="integer"> + <parameter name="cacheDeviceStateTimeInMS" type="integer" unit="ms"> <default>2000</default> - <label>Cache time in ms</label> + <label>Cache Time</label> <description>The result of a device presence detection is cached for a small amount of time. Be aware that no new pings will be issued within this time frame, even if explicitly requested.</description> <advanced>true</advanced> </parameter> <parameter name="arpPingToolPath" type="text"> <default>arping</default> - <label>ARP ping tool path</label> - <description>If your arp ping tool is not called arping and cannot be found in the PATH environment, you can configure the absolute path / tool name here</description> + <label>ARP Ping Tool Path</label> + <description>If your arp ping tool is not called arping and cannot be found in the PATH environment, you can configure the absolute path / tool name here.</description> + </parameter> + <parameter name="preferResponseTimeAsLatency" type="boolean"> + <default>false</default> + <label>Use Response Time as Latency</label> + <description>If enabled, an attempt will be made to extract the latency from the output of the ping command. If no such latency value is found in the ping command output, the time to execute the ping command is used as fallback latency. If disabled, the time to execute the ping command is always used as latency value.</description> </parameter> </config-description> </binding:binding> diff --git a/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/thing/thing-types.xml index 9a90fd5e88f0b..6e08b53dd5002 100644 --- a/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.network/src/main/resources/ESH-INF/thing/thing-types.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"><!--Network Binding --> <thing-type id="pingdevice"> - <label>Pingable network device</label> + <label>Pingable Network Device</label> <description>The presence detection is performed by using ICMP and, if available, ARP pings. You can change the arping tool path in the binding configuration. DHCP sniffing is performed for faster network reentry discovery.</description> @@ -41,9 +41,9 @@ <default>1</default> </parameter> - <parameter name="timeout" type="integer"> - <label>Timeout in ms</label> - <description>States how long to wait for a response (in MS), before if a device is stated as offline</description> + <parameter name="timeout" type="integer" unit="ms"> + <label>Timeout</label> + <description>States how long to wait for a response (in ms), before if a device is stated as offline</description> <default>5000</default> <advanced>true</advanced> </parameter> @@ -51,7 +51,7 @@ </thing-type> <thing-type id="servicedevice"> - <label>Network device with running service</label> + <label>Network Device with Running Service</label> <description>A device which reachable state is detected by connecting to a TCP port. DHCP sniffing is performed for faster network reentry discovery.</description> @@ -89,7 +89,7 @@ <parameter name="timeout" type="integer"> <label>Timeout</label> - <description>States how long to wait for a response (in MS), before if a device is stated as offline</description> + <description>States how long to wait for a response (in ms), before if a device is stated as offline</description> <default>5000</default> </parameter> @@ -100,7 +100,7 @@ </parameter> </config-description> </thing-type> - + <thing-type id="speedtest"> <label>SpeedTest</label> <description>Provides information about bandwidth speed.</description> @@ -113,14 +113,14 @@ <channel id="testStart" typeId="Timestamp"> <label>Test Start</label> </channel> - <channel id="testEnd" typeId="Timestamp"> + <channel id="testEnd" typeId="Timestamp"> <label>Test End</label> </channel> </channels> <config-description> <parameter name="refreshInterval" type="integer" min="2"> - <label>Refresh time interval</label> + <label>Refresh Time Interval</label> <description>Refresh time interval in minutes.</description> <default>20</default> </parameter> @@ -128,15 +128,15 @@ <label>Initial Delay</label> <description>Delay before starting the first speed test (minutes) after initialization of the binding.</description> <default>5</default> - <advanced>true</advanced> + <advanced>true</advanced> </parameter> <parameter name="uploadSize" type="integer" min="5000"> - <label>Upload size</label> + <label>Upload Size</label> <description>Size of the file to be uploaded (bytes).</description> <default>1000000</default> </parameter> <parameter name="url" type="text" required="true"> - <label>Test server URL</label> + <label>Test Server URL</label> <description>Url of the speed test server</description> </parameter> <parameter name="fileName" type="text" required="true"> @@ -145,21 +145,21 @@ </parameter> </config-description> </thing-type> - + <channel-type id="isRunning"> <item-type>Switch</item-type> <label>Test Running</label> <description>Indicates if a test is currently ongoing</description> <state readOnly="false"></state> </channel-type> - + <channel-type id="progress"> <item-type>Number:Dimensionless</item-type> <label>Progress</label> <description>Current Test progression</description> <state readOnly="true" min="0" max="100" pattern="%.0f %unit%" /> </channel-type> - + <channel-type id="rateUp"> <item-type>Number:DataTransferRate</item-type> <label>Upload Rate</label> @@ -173,7 +173,7 @@ <description>Current download rate</description> <state readOnly="true" pattern="%d %unit%" /> </channel-type> - + <channel-type id="Timestamp"> <item-type>DateTime</item-type> <label>Timestamp</label> @@ -195,7 +195,7 @@ </channel-type> <channel-type id="lastseen"> <item-type>DateTime</item-type> - <label>Last seen</label> + <label>Last Seen</label> <description>States the last seen date/time</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionTest.java index 3bbfd26d51838..0ae4eca25ed7d 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,7 @@ import java.io.IOException; import java.net.UnknownHostException; import java.util.Collections; +import java.util.Optional; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; @@ -35,6 +36,7 @@ import org.openhab.binding.network.internal.utils.NetworkUtils; import org.openhab.binding.network.internal.utils.NetworkUtils.ArpPingUtilEnum; import org.openhab.binding.network.internal.utils.NetworkUtils.IpPingMethodEnum; +import org.openhab.binding.network.internal.utils.PingResult; /** * Tests cases for {@see PresenceDetectionValue} @@ -113,10 +115,10 @@ public void threadCountTest() { @Test public void partialAndFinalCallbackTests() throws InterruptedException, IOException { - doReturn(true).when(networkUtils).nativePing(eq(IpPingMethodEnum.WINDOWS_PING), anyString(), anyInt()); - doReturn(true).when(networkUtils).nativeARPPing(eq(ArpPingUtilEnum.IPUTILS_ARPING), anyString(), anyString(), + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).nativePing(eq(IpPingMethodEnum.WINDOWS_PING), anyString(), anyInt()); + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).nativeARPPing(eq(ArpPingUtilEnum.IPUTILS_ARPING), anyString(), anyString(), any(), anyInt()); - doReturn(true).when(networkUtils).servicePing(anyString(), anyInt(), anyInt()); + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).servicePing(anyString(), anyInt(), anyInt()); assertTrue(subject.performPresenceDetection(false)); subject.waitForPresenceDetection(); @@ -135,10 +137,10 @@ public void partialAndFinalCallbackTests() throws InterruptedException, IOExcept @Test public void cacheTest() throws InterruptedException, IOException { - doReturn(true).when(networkUtils).nativePing(eq(IpPingMethodEnum.WINDOWS_PING), anyString(), anyInt()); - doReturn(true).when(networkUtils).nativeARPPing(eq(ArpPingUtilEnum.IPUTILS_ARPING), anyString(), anyString(), + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).nativePing(eq(IpPingMethodEnum.WINDOWS_PING), anyString(), anyInt()); + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).nativeARPPing(eq(ArpPingUtilEnum.IPUTILS_ARPING), anyString(), anyString(), any(), anyInt()); - doReturn(true).when(networkUtils).servicePing(anyString(), anyInt(), anyInt()); + doReturn(Optional.of(new PingResult(true, 10))).when(networkUtils).servicePing(anyString(), anyInt(), anyInt()); doReturn(executorService).when(subject).getThreadsFor(anyInt()); diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionValuesTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionValuesTest.java index 9be36fbcc8b80..d1284dcc49945 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionValuesTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/PresenceDetectionValuesTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/dhcp/DHCPTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/dhcp/DHCPTest.java index 19b4d802e61fb..19172cbd267af 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/dhcp/DHCPTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/dhcp/DHCPTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/discovery/DiscoveryTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/discovery/DiscoveryTest.java index 07b24813417eb..830f80f9b465a 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/discovery/DiscoveryTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/discovery/DiscoveryTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/handler/NetworkHandlerTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/handler/NetworkHandlerTest.java index 6f9e4043e5fa8..670278201a418 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/handler/NetworkHandlerTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/handler/NetworkHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsyncTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsyncTest.java index 195a24167e93a..cd71cf209e099 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsyncTest.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheAsyncTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheHelper.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheHelper.java index a0df85e1b5fdd..2e851b69b9261 100644 --- a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheHelper.java +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/toberemoved/cache/ExpiringCacheHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/utils/LatencyParserTest.java b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/utils/LatencyParserTest.java new file mode 100644 index 0000000000000..5758c96023ac9 --- /dev/null +++ b/bundles/org.openhab.binding.network/src/test/java/org/openhab/binding/network/internal/utils/LatencyParserTest.java @@ -0,0 +1,64 @@ +/** + * 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.network.internal.utils; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.Optional; + +/** + * Tests the parser which extracts latency values from the output of the ping command. + * + * @author Andreas Hirsch - Initial contribution + */ +public class LatencyParserTest { + + @Test + public void parseLinuxAndMacResultFoundTest() { + // Arrange + LatencyParser latencyParser = new LatencyParser(); + String input = "64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.225 ms"; + + // Act + Optional<Double> resultLatency = latencyParser.parseLatency(input); + + // Assert + Assert.assertTrue(resultLatency.isPresent()); + Assert.assertEquals(1.225, resultLatency.get(), 0); + } + + @Test + public void parseLinuxAndMacResultNotFoundTest() { + // Arrange + LatencyParser latencyParser = new LatencyParser(); + // This is the output of the command. We exclude the line which contains the latency, because here we want + // to test that no latency is returned for all other lines. + String[] inputLines = { + "ping -c 1 192.168.1.1", + "PING 192.168.1.1 (192.168.1.1): 56 data bytes", + // "64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1.225 ms", + "--- 192.168.1.1 ping statistics ---", + "1 packets transmitted, 1 packets received, 0.0% packet loss", + "round-trip min/avg/max/stddev = 1.225/1.225/1.225/0.000 ms" + }; + + for (String inputLine : inputLines) { + // Act + Optional<Double> resultLatency = latencyParser.parseLatency(inputLine); + + // Assert + Assert.assertFalse(resultLatency.isPresent()); + } + } +} diff --git a/bundles/org.openhab.binding.networkupstools/.classpath b/bundles/org.openhab.binding.networkupstools/.classpath new file mode 100644 index 0000000000000..28eb6e75a21bb --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/.classpath @@ -0,0 +1,43 @@ +<?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="test" value="true"/> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" 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="src" path="target/generated-sources/annotations"> + <attributes> + <attribute name="optional" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/bundles/org.openhab.binding.networkupstools/.project b/bundles/org.openhab.binding.networkupstools/.project new file mode 100644 index 0000000000000..bce3cc3c260d7 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.networkupstools</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> diff --git a/bundles/org.openhab.binding.networkupstools/NOTICE b/bundles/org.openhab.binding.networkupstools/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.networkupstools/README.md b/bundles/org.openhab.binding.networkupstools/README.md new file mode 100644 index 0000000000000..342ee2631a878 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/README.md @@ -0,0 +1,125 @@ +# Network UPS Tools Binding + +The primary goal of the [Network UPS Tools](https://networkupstools.org/) (NUT) project is to provide support for power devices, such as uninterruptible power supplies (UPS), Power Distribution Units and Solar Controllers. + +Network UPS Tools (NUT) provides many control and monitoring features, with a uniform control and management interface. +More than 100 different manufacturers, and several thousands of models are compatible. + +This binding lets you integrate NUT servers with openHAB. + +## Supported Things + +The binding can connect to multiple NUT instances. +The thing is an `ups` thing. +The thing supports a number of NUT features out-of-the-box and supports the option to configure additional channels to get other NUT variables. +The thing queries the NUT server for the status of the UPS approximate every 3 seconds and updates the status when a change happens. +When a change of the UPS status happens it will query the NUT server to update all linked channels. +Outside the status change updates, all linked channels are updated at the user configured refresh time. + +Some NUT variables are static in nature and are not suited for a channel. +Some of these could change, like of firmware version. +Therefore these properties are updated with a 1 hour frequency. +The following NUT variables are read and added to the thing as properties: + +| Property | Description +|------------------|---------------------------------------- +| ups.firmware | UPS firmware +| ups.firmware.aux | Auxiliary device firmware +| ups.id | UPS system identifier +| ups.mfr | UPS manufacturer +| ups.mfr.date | UPS manufacturing date +| ups.model | UPS model +| ups.serial | UPS serial number + + +## Discovery + +Discovery is not supported. + +## Thing Configuration + +The thing configuration requires the name of the UPS device as configured on the NUT server. +If the NUT service isn't running locally the ip address or domain name (FDQN) of the server running NUT must be configured. +Optional, port, username and password might need to be configured if required. + +| Parameter | Default | Mandatory | Description +|-----------|-----------|----------|------------- +| device | | Yes | UPS device name, `ups` for example +| host | localhost | Yes | UPS server hostname +| port | 3493 | No | UPS server port, 3493 for example +| username | | No | UPS server username +| password | | No | UPS server password +| refresh | 60 | No | Refresh interval for channel updates in seconds + +## Channels + +The following channels are available: + +| Channel Name | Item Type | Unit | Description | Advanced | +|----------------------------|--------------------------|------|------------------------------------------------------------------------------------|---------------| +| upsAlarm | String | | UPS alarms | no | +| upsLoad | Number:Dimensionless | % | Load on UPS (percent) | yes | +| upsPower | Number:Power | VA | Current value of apparent power (Volt-Amps) | yes | +| upsRealpower | Number:Power | W | Current value of real power (Watts) | no | +| upsStatus | String | | Status of the UPS: OFF, OL,OB,LB,RB,OVER,TRIM,BOOST,CAL,BYPASS,NULL | no | +| upsTemperature | Number:Temperature | °C | UPS temperature (degrees C) | yes | +| upsTestResult | String | | Results of last self test (opaque string) | yes | +| inputCurrent | Number:ElectricCurrent | A | Input current (A) | yes | +| inputCurrentStatus | String | | Status relative to the thresholds | yes | +| inputLoad | Number:Dimensionless | % | Load on (ePDU) input (percent of full) | no | +| inputRealpower | Number:Power | W | Current sum value of all (ePDU) phases real power (W) | yes | +| inputQuality | String | | Input power quality (*** opaque) | yes | +| inputTransferReason | String | | Reason for last transfer to battery (*** opaque) | yes | +| inputVoltage | Number:ElectricPotential | V | Input voltage (V) | yes | +| inputVoltageStatus | String | | Status relative to the thresholds | yes | +| outputCurrent | Number:ElectricCurrent | A | Output current (A) | yes | +| outputVoltage | Number:ElectricPotential | V | Output voltage (V) | yes | +| batteryCharge | Number:Dimensionless | % | Battery charge (percent) | no | +| batteryRuntime | Number:Time | s | Battery runtime (seconds) | no | +| batteryVoltage | Number:ElectricPotential | V | Battery voltage (V) | yes | + +### Dynamic Channels + +Because there is a lot of variation in UPS features, the binding supports dynamically adding channels for features, not supported out-of-the-box. +To get data from another NUT variable the channel needs to configured. +Channels can be created with as type: `Number`, `Number:<Quantity>`, `String` or `Switch`. + +The following channel properties are needed: + +| Property | Description | Example +|-----------------|--------------------------------|----------------- +| networkupstools | Links to NUT variable | `networkupstools="input.voltage.low.warning"` +| unit | The unit of Quantity Type data | `unit="V"` + +## Full Example + + +ups.things: + +``` +Thing networkupstools:ups:ups1 [ device="ups", host="localhost", refresh=60 ] +``` + +ups-with-channels.things: + +``` +Thing networkupstools:ups:ups2 [ device="ups", host="localhost", refresh=60 ] { + Channels: + String : testResult "Test Result" [networkupstools="ups.test.result"] + Number:Frequency : upsOutFreq "Output Frequency" [networkupstools="output.frequency", unit="Hz"] + Number:ElectricPotential : upsLowVoltage "Low Voltage" [networkupstools="input.voltage.low.warning", unit="V"] + Number:ElectricCurrent : upsLowCurrent "Low Current" [networkupstools="input.current.low.warning", unit="A"] +} +``` + +ups.items + +``` +Number:Dimensionless ups_battery_charge "Battery Charge [%d %%]" {channel="networkupstools:ups:ups1:batteryCharge"} +Number:ElectricCurrent ups_current "Input Current [%d mA]"{channel="networkupstools:ups:ups1:inputCurrent"} + +String test_result "Test Result" {channel="networkupstools:ups:ups2:testResult"} +Number:Frequency ups_out_freq "Output Frequency" {channel="networkupstools:ups:ups2:upsOutFreq"} +Number:ElectricPotential ups_low_voltage "Low Voltage [%.1f V]" {channel="networkupstools:ups:ups2:upsLowVoltage"} +Number:ElectricCurrent ups_low_current "Input Current [%d A]" {channel="networkupstools:ups:ups2:upsLowCurrent"} +``` diff --git a/bundles/org.openhab.binding.networkupstools/pom.xml b/bundles/org.openhab.binding.networkupstools/pom.xml new file mode 100644 index 0000000000000..30dfa2aa7f538 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/pom.xml @@ -0,0 +1,15 @@ +<?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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.networkupstools</artifactId> + + <name>openHAB Add-ons :: Bundles :: Network UPS Tools Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/feature/feature.xml b/bundles/org.openhab.binding.networkupstools/src/main/feature/feature.xml new file mode 100644 index 0000000000000..d0de2604754e0 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.networkupstools-${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-networkupstools" description="Network UPS Tools Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.networkupstools/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTBindingConstants.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTBindingConstants.java new file mode 100644 index 0000000000000..2cff4c79c71e9 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTBindingConstants.java @@ -0,0 +1,82 @@ +/** + * 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.networkupstools.internal; + +import java.net.URI; + +import javax.measure.Unit; +import javax.measure.quantity.Power; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; + +import tec.uom.se.format.SimpleUnitFormat; +import tec.uom.se.unit.ProductUnit; +import tec.uom.se.unit.Units; + +/** + * The {@link NUTBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NUTBindingConstants { + + public static final String BINDING_ID = "networkupstools"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_UPS = new ThingTypeUID(BINDING_ID, "ups"); + + public static final String METADATA_NETWORKUPSTOOLS = "networkupstools"; + public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_NUMBER = new ChannelTypeUID(BINDING_ID, "number"); + public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_STRING = new ChannelTypeUID(BINDING_ID, "string"); + public static final ChannelTypeUID CHANNEL_TYPE_DYNAMIC_SWITCH = new ChannelTypeUID(BINDING_ID, "switch"); + public static final URI DYNAMIC_CHANNEL_CONFIG_QUANTITY_TYPE = URI + .create("channel-type:ups:dynamic-channel-config-quantity-type"); + + public static final Unit<Power> AMPERE_PER_HOUR = new ProductUnit<>(Units.AMPERE.divide(Units.HOUR)); + public static final Unit<Power> VOLT_AMPERE = new ProductUnit<>(Units.VOLT.multiply(Units.AMPERE)); + + static { + SimpleUnitFormat.getInstance().label(AMPERE_PER_HOUR, "Ah"); + SimpleUnitFormat.getInstance().label(VOLT_AMPERE, "VA"); + } + + private static final String PARAMETER_PREFIX_UPS = "ups."; + + /** + * Enum with nut names which value will be set a parameter on the thing. + * These are values that don't change at all (e.g. type of ups) or not very often (e.g. firmware version). + */ + public enum Parameters { + UPS_FIRMWARE(PARAMETER_PREFIX_UPS + "firmware"), + UPS_FIRMWARE_AUX(PARAMETER_PREFIX_UPS + "firmware.aux"), + UPS_ID(PARAMETER_PREFIX_UPS + "id"), + UPS_MFR(PARAMETER_PREFIX_UPS + "mfr"), + UPS_MFR_DATE(PARAMETER_PREFIX_UPS + "mfr.date"), + UPS_MODEL(PARAMETER_PREFIX_UPS + "model"), + UPS_SERIAL(PARAMETER_PREFIX_UPS + "serial"); + + private final String nutName; + + private Parameters(final String nutName) { + this.nutName = nutName; + } + + public String getNutName() { + return nutName; + } + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTChannelTypeProvider.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTChannelTypeProvider.java new file mode 100644 index 0000000000000..8d581a7f9c012 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTChannelTypeProvider.java @@ -0,0 +1,71 @@ +/** + * 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.networkupstools.internal; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.thing.type.ChannelType; +import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; + +/** + * Provider class to provide channel types for user configured channels. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NUTChannelTypeProvider implements ChannelTypeProvider, ThingHandlerService { + + private final Map<ChannelTypeUID, ChannelType> map = new HashMap<>(); + private @Nullable ThingHandler handler; + + @Override + public Collection<ChannelType> getChannelTypes(@Nullable final Locale locale) { + return Collections.unmodifiableCollection(map.values()); + } + + @Override + public @Nullable ChannelType getChannelType(final ChannelTypeUID channelTypeUID, @Nullable final Locale locale) { + return map.get(channelTypeUID); + } + + /** + * Add a channel type for a user configured channel. + * + * @param channelType channelType + */ + public void addChannelType(final ChannelType channelType) { + map.put(channelType.getUID(), channelType); + } + + @Override + public void setThingHandler(@Nullable final ThingHandler handler) { + if (handler instanceof NUTHandler) { + this.handler = handler; + ((NUTHandler) handler).setChannelTypeProvider(this); + } + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return handler; + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTConfiguration.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTConfiguration.java new file mode 100644 index 0000000000000..a3d66134b1388 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTConfiguration.java @@ -0,0 +1,34 @@ +/** + * 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.networkupstools.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link NUTConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NUTConfiguration { + + /** + * the refresh interval which is used to poll values from the NetworkUpsTools server. + */ + public int refresh = 60; + public String device = ""; + public String host = "localhost"; + public String username = ""; + public String password = ""; + public int port = 3493; +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelConfiguration.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelConfiguration.java new file mode 100644 index 0000000000000..52d95b7474d73 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelConfiguration.java @@ -0,0 +1,28 @@ +/** + * 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.networkupstools.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Configuration class for dynamic created channels. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NUTDynamicChannelConfiguration { + public String networkupstools = ""; + public @Nullable String unit; + +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java new file mode 100644 index 0000000000000..db5c92f612402 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTDynamicChannelFactory.java @@ -0,0 +1,121 @@ +/** + * 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.networkupstools.internal; + +import static org.openhab.binding.networkupstools.internal.NUTBindingConstants.BINDING_ID; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.CoreItemFactory; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.binding.builder.ChannelBuilder; +import org.eclipse.smarthome.core.thing.type.ChannelType; +import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; +import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.core.types.StateDescriptionFragmentBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Factory class to enrich dynamic created channels with additional configurations. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +class NUTDynamicChannelFactory { + + private static final String QUANTITY_ITEM_TYPE_PREFIX = CoreItemFactory.NUMBER + ':'; + + private final Logger logger = LoggerFactory.getLogger(NUTDynamicChannelFactory.class); + + private final NUTChannelTypeProvider channelTypeProvider; + + public NUTDynamicChannelFactory(final NUTChannelTypeProvider channelTypeProvider) { + this.channelTypeProvider = channelTypeProvider; + } + + /** + * Enriches the channel from the given channel and returns the newly created channel. + * + * @param channel Channel to enrich + * @param channelConfig channel configuration + * @return new created channel or null if it was not possible to create a new channel due to missing information or + * otherwise + */ + public @Nullable Channel createChannel(final Channel channel, final NUTDynamicChannelConfiguration channelConfig) { + final String acceptedItemType = channel.getAcceptedItemType(); + + if (acceptedItemType == null) { + return null; + } + final ChannelTypeUID channelTypeUID; + + if (acceptedItemType.startsWith(QUANTITY_ITEM_TYPE_PREFIX)) { + channelTypeUID = createQuantityTypeChannel(channel, acceptedItemType, channelConfig); + } else { + channelTypeUID = getChannelTypeUID(acceptedItemType, channel.getUID()); + } + return channelTypeUID == null ? null : ChannelBuilder.create(channel).withType(channelTypeUID).build(); + } + + /** + * Returns the {@link ChannelTypeUID} for channels types that are supported and have a channel-type definition in + * the binding thing xml. + * + * @param itemType item type to get the channel type for + * @param channelUID ChannelUID for which the channel type is determined + * @return channel type or null if not supported + */ + private @Nullable ChannelTypeUID getChannelTypeUID(final String itemType, final ChannelUID channelUID) { + switch (itemType) { + case CoreItemFactory.NUMBER: + return NUTBindingConstants.CHANNEL_TYPE_DYNAMIC_NUMBER; + case CoreItemFactory.STRING: + return NUTBindingConstants.CHANNEL_TYPE_DYNAMIC_STRING; + case CoreItemFactory.SWITCH: + return NUTBindingConstants.CHANNEL_TYPE_DYNAMIC_SWITCH; + default: + logger.info("Dynamic channel '{}' is ignored because the type '{}' is not supported.", channelUID, + itemType); + return null; + } + } + + /** + * Creates a new {@link ChannelTypeUID} for dynamically created {@link QuantityType} channels. + * It registers the new channel type with the channel type provider. + * + * @param channel Channel to enrich + * @param itemType item type to get the channel type for + * @param channelConfig channel configuration + * @return channel type or null if not supported + */ + private @Nullable ChannelTypeUID createQuantityTypeChannel(final Channel channel, final String itemType, + final NUTDynamicChannelConfiguration channelConfig) { + if (channelConfig.unit == null || channelConfig.unit.isEmpty()) { + logger.info("Dynamic Channel '{}' is ignored because it's a QuantityType without a 'unit' property.", + channel.getUID()); + return null; + } + final StateDescriptionFragmentBuilder sdb = StateDescriptionFragmentBuilder.create(); + final ChannelTypeUID channelTypeUID = new ChannelTypeUID(BINDING_ID, channel.getUID().getId() + "Type"); + final String label = channel.getLabel(); + final ChannelType channelType = ChannelTypeBuilder.state(channelTypeUID, label == null ? "" : label, itemType) + .withStateDescription(sdb.withReadOnly(Boolean.TRUE).build().toStateDescription()) + .withConfigDescriptionURI(NUTBindingConstants.DYNAMIC_CHANNEL_CONFIG_QUANTITY_TYPE).build(); + channelTypeProvider.addChannelType(channelType); + return channelTypeUID; + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandler.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandler.java new file mode 100644 index 0000000000000..c28da996483c7 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandler.java @@ -0,0 +1,410 @@ +/** + * 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.networkupstools.internal; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.cache.ExpiringCache; +import org.eclipse.smarthome.core.library.CoreItemFactory; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.networkupstools.internal.NUTBindingConstants.Parameters; +import org.openhab.binding.networkupstools.internal.nut.NutApi; +import org.openhab.binding.networkupstools.internal.nut.NutException; +import org.openhab.binding.networkupstools.internal.nut.NutFunction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NUTHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NUTHandler extends BaseThingHandler { + private static final int REFRESH_RATE_SECONDS = 3; + + private final Logger logger = LoggerFactory.getLogger(NUTHandler.class); + /** + * Map to cache user configured channels with their configuration. Channels are dynamically created at + * initialization phase of the thing. + */ + private final Map<ChannelUID, @Nullable NUTDynamicChannelConfiguration> userChannelToNutMap = new HashMap<>(); + /** + * Cache of the UPS status. When expired makes a call to the NUT server is done to get the actual status. Expires at + * the + * short time refresh rate. Used to avoid triggering multiple calls to the server in a short time frame. + */ + private final ExpiringCache<String> upsStatusCache = new ExpiringCache<>(Duration.ofSeconds(REFRESH_RATE_SECONDS), + this::retrieveUpsStatus); + /** + * Cache of the NUT variables. When expired makes a call to the NUT server is done to get the variables. Expires at + * the short time refresh rate. Used to avoid triggering multiple calls to the server in a short time frame. + */ + private final ExpiringCache<Map<String, String>> variablesCache = new ExpiringCache<>( + Duration.ofSeconds(REFRESH_RATE_SECONDS), this::retrieveVariables); + /** + * Cache used to manage update frequency of the thing properties. The properties are NUT variables that don't + * change much or not at all. So updating can be done on a larger time frame. A call to get this cache will trigger + * updating the properties when the cache is expired. + */ + private final ExpiringCache<Boolean> refreshPropertiesCache = new ExpiringCache<>(Duration.ofHours(1), + this::updateProperties); + private final ChannelUID upsStatusChannelUID; + + private @Nullable NUTChannelTypeProvider channelTypeProvider; + private @Nullable NUTDynamicChannelFactory dynamicChannelFactory; + private @Nullable NUTConfiguration config; + private @Nullable ScheduledFuture<?> poller; + /** + * Cache used to manage the update frequency of the thing channels. The channels are updated based on the user + * configured refresh rate. The cache is called in the status update scheduled task and when the cache expires at + * the user configured refresh rate it will trigger an update of the channels. This way no separate scheduled task + * is needed. + */ + private @Nullable ExpiringCache<Boolean> refreshVariablesCache; + private @Nullable NutApi nutApi; + + /** + * Keep track of the last ups status to avoid updating the status every 3 seconds when nothing changed. + */ + private String lastUpsStatus = ""; + + public NUTHandler(final Thing thing) { + super(thing); + upsStatusChannelUID = new ChannelUID(getThing().getUID(), NutName.UPS_STATUS.getChannelId()); + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(NUTChannelTypeProvider.class); + } + + public void setChannelTypeProvider(final NUTChannelTypeProvider channelTypeProvider) { + this.channelTypeProvider = channelTypeProvider; + dynamicChannelFactory = new NUTDynamicChannelFactory(channelTypeProvider); + } + + @Override + public void handleCommand(final ChannelUID channelUID, final Command command) { + if (command instanceof RefreshType) { + final Channel channel = getThing().getChannel(channelUID); + + if (channel == null) { + logger.info("Trying to update a none existing channel: {}", channelUID); + } else { + updateChannel(channel, variablesCache.getValue()); + } + } + } + + @Override + public void initialize() { + final NUTConfiguration config = getConfigAs(NUTConfiguration.class); + + this.config = config; + updateStatus(ThingStatus.UNKNOWN); + initDynamicChannels(); + poller = scheduler.scheduleWithFixedDelay(this::refreshStatus, 0, REFRESH_RATE_SECONDS, TimeUnit.SECONDS); + refreshVariablesCache = new ExpiringCache<>(Duration.ofSeconds(config.refresh), this::updateRefreshVariables); + nutApi = new NutApi(config.host, config.port, config.username, config.password); + } + + @Override + public void dispose() { + if (nutApi != null) { + nutApi.close(); + } + final ScheduledFuture<?> localPoller = poller; + + if (localPoller != null && !localPoller.isCancelled()) { + localPoller.cancel(true); + poller = null; + } + } + + /** + * Initializes any channels configured by the user by creating complementary channel types and recreate the channels + * of the thing. + */ + private void initDynamicChannels() { + final NUTChannelTypeProvider localChannelTypeProvider = channelTypeProvider; + final NUTDynamicChannelFactory localDynamicChannelFactory = dynamicChannelFactory; + + if (localChannelTypeProvider == null || localDynamicChannelFactory == null) { + return; + } + final List<Channel> updatedChannels = new ArrayList<>(); + boolean rebuildChannels = false; + + for (final Channel channel : thing.getChannels()) { + if (channel.getConfiguration().getProperties().isEmpty()) { + updatedChannels.add(channel); + } else { + // If the channel has a custom created channel type id the channel should be recreated. + // This is specific for Quantity type channels created in thing files. + final boolean customChannel = channel.getChannelTypeUID() == null; + final NUTDynamicChannelConfiguration channelConfig = channel.getConfiguration() + .as(NUTDynamicChannelConfiguration.class); + final Channel dynamicChannel; + + rebuildChannels = customChannel; + if (customChannel) { + dynamicChannel = localDynamicChannelFactory.createChannel(channel, channelConfig); + + if (dynamicChannel == null) { + logger.debug("Could not initialize the dynamic channel '{}'. This channel will be ignored ", + channel.getUID()); + continue; + } else { + logger.debug("Updating channel '{}' with dynamic channelType settings: {}", channel.getUID(), + dynamicChannel.getChannelTypeUID()); + } + } else { + logger.debug("Mapping standard dynamic channel '{}' with dynamic channelType settings: {}", + channel.getUID(), channel.getChannelTypeUID()); + dynamicChannel = channel; + } + userChannelToNutMap.put(channel.getUID(), channelConfig); + updatedChannels.add(dynamicChannel); + } + } + if (rebuildChannels) { + final ThingBuilder thingBuilder = editThing(); + thingBuilder.withChannels(updatedChannels); + updateThing(thingBuilder.build()); + } + } + + /** + * Method called by the scheduled task that checks for the active status of the ups. + */ + private void refreshStatus() { + try { + final String state = upsStatusCache.getValue(); + final ExpiringCache<Boolean> localVariablesRefreshCache = refreshVariablesCache; + + if (!lastUpsStatus.equals(state)) { + if (isLinked(upsStatusChannelUID)) { + updateState(upsStatusChannelUID, state == null ? UnDefType.UNDEF : new StringType(state)); + } + lastUpsStatus = state == null ? "" : state; + if (localVariablesRefreshCache != null) { + localVariablesRefreshCache.invalidateValue(); + } + } + // Just call a get on variables. If the cache is expired it will trigger an update of the channels. + if (localVariablesRefreshCache != null) { + localVariablesRefreshCache.getValue(); + } + } catch (final RuntimeException e) { + logger.debug("Updating ups status failed: ", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + + /** + * This method is triggered when the cache {@link #refreshVariablesCache} is expired. + * + * @return returns true if success and false on error + */ + private boolean updateRefreshVariables() { + logger.trace("Calling updateRefreshVariables {}", thing.getUID()); + try { + final Map<String, String> variables = variablesCache.getValue(); + + if (variables == null) { + logger.trace("No data from NUT server received."); + return false; + } + logger.trace("Updating status of linked channels."); + for (final Channel channel : getThing().getChannels()) { + final ChannelUID uid = channel.getUID(); + + if (isLinked(uid)) { + updateChannel(channel, variables); + } + } + // Call getValue to trigger cache refreshing + refreshPropertiesCache.getValue(); + if ((thing.getStatus() == ThingStatus.OFFLINE || thing.getStatus() == ThingStatus.UNKNOWN) + && thing.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + return true; + } catch (final RuntimeException e) { + logger.debug("Refresh Network UPS Tools failed: ", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + return false; + } + } + + /** + * Method that retrieves the ups status from the NUT server. + * + * @return status of the UPS or null if it couldn't be determined + */ + private @Nullable String retrieveUpsStatus() { + final NutApi localNutApi = nutApi; + + if (localNutApi == null) { + return null; + } + return wrappedNutApiCall(device -> localNutApi.getVariable(device, NutName.UPS_STATUS.getName()), "UPS status"); + } + + /** + * Method that retrieves all variables from the NUT server. + * + * @return variables retrieved send by the NUT server or null if it couldn't be determined + */ + private @Nullable Map<String, String> retrieveVariables() { + final NutApi localNutApi = nutApi; + + if (localNutApi == null) { + return null; + } + return wrappedNutApiCall(localNutApi::getVariables, "NUT variables"); + } + + /** + * Convenience method that wraps the call to the api and handles exceptions. + * + * @param <T> Return type of the call to the api + * @param nutApiFunction function that will be called + * @return the value returned by the api call or null in case of an error + */ + private <T> T wrappedNutApiCall(final NutFunction<String, T> nutApiFunction, String logging) { + try { + final NUTConfiguration localConfig = config; + + if (localConfig == null) { + return null; + } + logger.trace("Get {} from server for thing: {}({})", logging, thing.getLabel(), thing.getUID()); + return nutApiFunction.apply(localConfig.device); + } catch (final NutException e) { + logger.debug("Refresh Network UPS Tools failed: ", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + return null; + } + } + + /** + * Updates the thing properties when the cache {@link #refreshPropertiesCache} is expired. + * + * @return returns true if success and false on error + */ + private Boolean updateProperties() { + try { + final Map<String, String> variables = variablesCache.getValue(); + + if (variables != null) { + final Map<String, String> properties = editProperties(); + + for (final Parameters param : NUTBindingConstants.Parameters.values()) { + final String value = variables.get(param.getNutName()); + + if (value == null) { + logger.debug( + "Variable '{}' intented as property for thing {}({}) is not available in the NUT data.", + param.getNutName(), thing.getLabel(), thing.getUID()); + } else { + properties.put(param.getNutName(), value); + } + } + updateProperties(properties); + } + return Boolean.TRUE; + } catch (final RuntimeException e) { + logger.debug("Updating parameters failed: ", e); + return Boolean.FALSE; + } + } + + private void updateChannel(final Channel channel, @Nullable final Map<String, String> variables) { + try { + if (variables == null) { + return; + } + final State state; + final String id = channel.getUID().getId(); + final NutName fixedChannel = NutName.channelIdToNutName(id); + + if (fixedChannel == null) { + state = getDynamicChannelState(channel, variables); + } else { + state = fixedChannel.toState(variables); + } + updateState(channel.getUID(), state); + } catch (final NutException | RuntimeException e) { + logger.debug("Refresh Network UPS Tools failed: ", e); + } + } + + private State getDynamicChannelState(final Channel channel, @Nullable final Map<String, String> variables) + throws NutException { + final NUTDynamicChannelConfiguration nutConfig = userChannelToNutMap.get(channel.getUID()); + final String acceptedItemType = channel.getAcceptedItemType(); + + if (variables == null || acceptedItemType == null || nutConfig == null) { + return UnDefType.UNDEF; + } + final String value = variables.get(nutConfig.networkupstools); + + if (value == null) { + logger.info("Variable '{}' queried for thing {}({}) is not available in the NUT data.", + nutConfig.networkupstools, thing.getLabel(), thing.getUID()); + return UnDefType.UNDEF; + } + switch (acceptedItemType) { + case CoreItemFactory.NUMBER: + return new DecimalType(value); + case CoreItemFactory.STRING: + return StringType.valueOf(value); + case CoreItemFactory.SWITCH: + return OnOffType.from(value); + default: + if (acceptedItemType.startsWith(CoreItemFactory.NUMBER + ':')) { + logger.debug("nut:{}, unit:{}, value:{}", nutConfig.networkupstools, nutConfig.unit, value); + return new QuantityType<>(value + nutConfig.unit); + } + return UnDefType.UNDEF; + } + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandlerFactory.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandlerFactory.java new file mode 100644 index 0000000000000..5aebbe8def1f9 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NUTHandlerFactory.java @@ -0,0 +1,51 @@ +/** + * 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.networkupstools.internal; + +import static org.openhab.binding.networkupstools.internal.NUTBindingConstants.THING_TYPE_UPS; + +import java.util.Collections; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.osgi.service.component.annotations.Component; + +/** + * The {@link NUTHandlerFactory} is responsible for creating things and thing handlers. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.networkupstools", service = ThingHandlerFactory.class) +public class NUTHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_UPS); + + @Override + public boolean supportsThingType(final ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(final Thing thing) { + final ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + return THING_TYPE_UPS.equals(thingTypeUID) ? new NUTHandler(thing) : null; + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NutName.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NutName.java new file mode 100644 index 0000000000000..68dc8be7f596a --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/NutName.java @@ -0,0 +1,172 @@ +/** + * 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.networkupstools.internal; + +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import javax.measure.Unit; + +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; + +/** + * Supported NUT variables. Any NUT enum members have a complimentary channel definition in the XML thing definition. + * + * @author Hilbrand Bouwkamp - Initial contribution + * @see https://github.com/networkupstools/nut/blob/master/docs/nut-names.txt + */ +enum NutName { + // UPS + UPS_ALARM("upsAlarm", "ups.alarm", StringType.class), + UPS_LOAD("upsLoad", "ups.load", SmartHomeUnits.PERCENT), + UPS_POWER("upsPower", "ups.power", NUTBindingConstants.VOLT_AMPERE), + UPS_REALPOWER("upsRealpower", "ups.realpower", SmartHomeUnits.WATT), + UPS_STATUS("upsStatus", "ups.status", StringType.class), + UPS_TEMPERATURE("upsTemperature", "ups.temperature", SIUnits.CELSIUS), + UPS_TEST_RESULT("upsTestResult", "ups.test.result", StringType.class), + + // Input + INPUT_CURRENT("inputCurrent", "input.current", SmartHomeUnits.AMPERE), + INPUT_CURRENT_STATUS("inputCurrentStatus", "input.current.status", StringType.class), + INPUT_LOAD("inputLoad", "input.load", SmartHomeUnits.PERCENT), + INPUT_REALPOWER("inputRealpower", "input.realpower", SmartHomeUnits.WATT), + INPUT_QUALITY("inputQuality", "input.quality", StringType.class), + INPUT_TRANSFER_REASON("inputTransferReason", "input.transfer.reason", StringType.class), + INPUT_VOLTAGE("inputVoltage", "input.voltage", SmartHomeUnits.VOLT), + INPUT_VOLTAGE_STATUS("inputVoltageStatus", "input.voltage.status", StringType.class), + + // Output + OUTPUT_CURRENT("outputCurrent", "output.current", SmartHomeUnits.AMPERE), + OUTPUT_VOLTAGE("outputVoltage", "output.voltage", SmartHomeUnits.VOLT), + + // Battery + BATTERY_CHARGE("batteryCharge", "battery.charge", SmartHomeUnits.PERCENT), + BATTERY_RUNTIME("batteryRuntime", "battery.runtime", SmartHomeUnits.SECOND), + BATTERY_VOLTAGE("batteryVoltage", "battery.voltage", SmartHomeUnits.VOLT); + + private static final Map<String, NutName> NUT_NAME_MAP = Stream.of(NutName.values()) + .collect(Collectors.toMap(NutName::getChannelId, Function.identity())); + + private final String channelId; + private final String name; + private final Class<? extends State> stateClass; + private final Unit<?> unit; + + NutName(final String channelId, final String name, final Class<? extends State> stateClass) { + this(channelId, name, stateClass, null); + } + + NutName(final String channelId, final String name, final Unit<?> unit) { + this(channelId, name, QuantityType.class, unit); + } + + NutName(final String channelId, final String name, final Class<? extends State> stateClass, final Unit<?> unit) { + this.channelId = channelId; + this.name = name; + this.stateClass = stateClass; + this.unit = unit; + } + + /** + * Returns the NUT enum for the given channel id or null if there is no NUT enum available for the given channel. + * + * @param channelId Channel to find the NUT enum for + * @return The NUT enum or null if there is none. + */ + public static @Nullable NutName channelIdToNutName(final String channelId) { + return NUT_NAME_MAP.get(channelId); + } + + /** + * Returns the {@link State} value of the variable for this NUT as is found in the given map of variables. + * + * @param channelId + * @param variables Map of variables that contain a value for this NUT (or doesn't contain it if not available) + * @return The {@link State} value or UNDEF if not available in the variables map or if it can't be determined. + */ + public static State toState(final String channelId, final Map<String, String> variables) { + final NutName nutName = channelIdToNutName(channelId); + + if (nutName instanceof NutName) { + return nutName.toState(variables); + } else { + throw new IllegalArgumentException("Channel name '" + channelId + "'is not a known data name"); + } + } + + /** + * Returns the {@link State} value of the variable for this NUT as is found in the given map of variables. + * + * @param variables Map of variables that contain a value for this NUT (or doesn't contain it if not available) + * @return The {@link State} value or UNDEF if not available in the variables map or if it can't be determined. + */ + public State toState(final @Nullable Map<String, String> variables) { + final State state; + final String value = variables == null ? null : variables.get(name); + + if (value == null) { + state = UnDefType.UNDEF; + } else { + if (stateClass == StringType.class) { + state = StringType.valueOf(value); + } else if (stateClass == DecimalType.class) { + state = DecimalType.valueOf(value); + } else if (stateClass == PercentType.class) { + state = PercentType.valueOf(value); + } else if (stateClass == QuantityType.class) { + state = QuantityType.valueOf(Double.valueOf(value), unit); + } else { + state = UnDefType.UNDEF; + } + } + return state; + } + + /** + * @return The name of the Channel for this NUT variable as specified in the Thing + */ + String getChannelId() { + return channelId; + } + + /** + * @return The variable name as used by the NUT server + */ + String getName() { + return name; + } + + /** + * @return The {@link State} class type of this NUT variable + */ + Class<? extends State> getStateType() { + return stateClass; + } + + /** + * @return The {@link Unit} for this NUT variable if the type is a {@link QuantityType} + */ + Unit<?> getUnit() { + return unit; + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutApi.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutApi.java new file mode 100644 index 0000000000000..1269d5fd15e39 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutApi.java @@ -0,0 +1,96 @@ +/** + * 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.networkupstools.internal.nut; + +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * API implementation handling communicating with the NUT server. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NutApi { + + private static final String LIST_VAR = "LIST VAR %s"; + private static final String VAR = "VAR %s"; + private static final String LIST_UPS = "LIST UPS"; + private static final String UPS = "UPS "; + private static final String GET_VAR = "GET VAR %s %s"; + + private final NutResponseReader responseReader = new NutResponseReader(); + private final NutConnector connector; + + /** + * Constructor. + * + * @param host host + * @param port port + * @param username username + * @param password password + */ + public NutApi(final String host, final int port, final String username, final String password) { + this.connector = new NutConnector(host, port, username, password); + } + + /** + * Constructor for unit tests to inject mock connector. + * + * @param connector Connector. + */ + NutApi(final NutConnector connector) { + this.connector = connector; + } + + /** + * Closes the connector. + */ + public void close() { + connector.close(); + } + + /** + * Retrieves a list of the UPS devices available from the NUT server. + * + * @return List of UPS devices + * @throws NutException Exception in case of any error related to the API. + */ + public Map<String, String> getUpsList() throws NutException { + return connector.read(LIST_UPS, r -> responseReader.parseList(UPS, r)); + } + + /** + * Retrieves a list of the variables available for the given UPS. + * + * @param ups UPS to get the variables for + * @return List of variables for the given UPS + * @throws NutException Exception in case of any error related to the API. + */ + public Map<String, String> getVariables(final String ups) throws NutException { + return connector.read(String.format(LIST_VAR, ups), r -> responseReader.parseList(String.format(VAR, ups), r)); + } + + /** + * Retrieves the value of the given nut variable for the given UPS. + * + * @param ups UPS to get the variables for + * @param nut The variable to the value for + * @return Returns the value for the given nut + * @throws NutException Exception when the variable could not retrieved + */ + public String getVariable(final String ups, final String nut) throws NutException { + return connector.read(String.format(GET_VAR, ups, nut), r -> responseReader.parseVariable(ups, nut, r)); + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutConnector.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutConnector.java new file mode 100644 index 0000000000000..e0cfb129692e2 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutConnector.java @@ -0,0 +1,196 @@ +/** + * 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.networkupstools.internal.nut; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.nio.charset.StandardCharsets; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Connector class manages the socket connection to the NUT server. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +class NutConnector { + + private static final String USERNAME = "USERNAME %s"; + private static final String PASSWORD = "PASSWORD %s"; + private static final String OK = "OK"; + private static final String ERR = "ERR"; + private static final int TIME_OUT_MILLISECONDS = 10_000; + private static final int MAX_RETRIES = 3; + + private final Logger logger = LoggerFactory.getLogger(NutConnector.class); + + private final String login; + private final String password; + private final InetSocketAddress inetSocketAddress; + private @Nullable Socket socket; + private @Nullable BufferedReader reader; + private @Nullable PrintWriter writer; + + /** + * Constructor. + * + * @param host host + * @param port port + * @param username username + * @param password password + */ + public NutConnector(final String host, final int port, final String username, final String password) { + this.login = username.isEmpty() ? "" : String.format(USERNAME, username); + this.password = password.isEmpty() ? "" : String.format(PASSWORD, password); + inetSocketAddress = new InetSocketAddress(host, port); + } + + /** + * Communicates to read the data to the NUT server. It handles the connection and authentication. Sends the command + * to the NUT server and passes the reading of the values to the readFunction argument. + * + * @param <R> The type of the returned data + * @param command The command to send to the NUT server + * @param readFunction Function called to handle the lines read from the NUT server + * @return the data read from the NUT server + * @throws NutException Exception thrown related to the NUT server connection and/or data. + */ + public synchronized <R> R read(final String command, final NutFunction<NutSupplier<String>, R> readFunction) + throws NutException { + int retry = 0; + + while (true) { + try { + connectIfClosed(); + final PrintWriter localWriter = writer; + final BufferedReader localReader = reader; + + if (localWriter == null) { + throw new NutException("Writer closed."); + } else { + localWriter.println(command); + } + if (localReader == null) { + throw new NutException("Reader closed."); + } else { + return readFunction.apply(() -> readLine(localReader)); + } + } catch (final NutException | RuntimeException e) { + retry++; + close(); + if (retry < MAX_RETRIES) { + logger.debug("Error during command retry {}:", retry, e); + } else { + throw e; + } + } + } + } + + /** + * Opens a Socket connection if there is no connection or if the connection is closed. Authenticates if + * username/password is provided. + * + * @throws NutException Exception thrown if no connection to NUT server could be made successfully. + */ + public void connectIfClosed() throws NutException { + if (socket == null || socket.isClosed() || !socket.isConnected()) { + try { + closeStreams(); + socket = newSocket(); + socket.connect(inetSocketAddress, TIME_OUT_MILLISECONDS); + final BufferedReader localReader = new BufferedReader( + new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8)); + reader = localReader; + final PrintWriter localWriter = new PrintWriter(socket.getOutputStream(), true); + writer = localWriter; + writeCommand(login, localReader, localWriter); + writeCommand(password, localReader, localWriter); + } catch (final IOException e) { + throw new NutException(e); + } + } + } + + /** + * Closes the socket. + */ + public synchronized void close() { + try { + if (socket != null) { + socket.close(); + socket = null; + } + } catch (final IOException e) { + logger.debug("Closing socket failed", e); + } + } + + private void closeStreams() { + try { + if (reader != null && socket != null && !socket.isInputShutdown()) { + reader.close(); + } + if (writer != null && socket != null && !socket.isOutputShutdown()) { + writer.close(); + } + } catch (final IOException e) { + logger.debug("Closing streams failed", e); + } + } + + /** + * Protected method to be able to mock the Socket connection in unit tests. + * + * @return a new Socket object + */ + protected Socket newSocket() { + return new Socket(); + } + + private @Nullable String readLine(final BufferedReader reader) throws NutException { + try { + final String line = reader.readLine(); + + if (line != null && line.startsWith(ERR)) { + throw new NutException(line); + } + return line; + } catch (final IOException e) { + throw new NutException(e); + } + } + + private void writeCommand(final String argument, final BufferedReader reader, final PrintWriter writer) + throws IOException, NutException { + if (!argument.isEmpty()) { + writer.println(argument); + final String result = reader.readLine(); + + logger.trace("Command result: {}", result); + if (result == null) { + throw new NutException("No data read after sending command"); + } else if (!result.startsWith(OK)) { + throw new NutException(result); + } + } + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutException.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutException.java new file mode 100644 index 0000000000000..8f57259e6b29d --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutException.java @@ -0,0 +1,34 @@ +/** + * 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.networkupstools.internal.nut; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Exception thrown in case of errors related to NUT data reading/writing. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class NutException extends Exception { + + private static final long serialVersionUID = 1L; + + public NutException(final String message) { + super(message); + } + + public NutException(final Exception e) { + super(e); + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutFunction.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutFunction.java new file mode 100644 index 0000000000000..db9cbcdc42e7a --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutFunction.java @@ -0,0 +1,38 @@ +/** + * 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.networkupstools.internal.nut; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Function interface that can throw a {@link NutException}. + * + * @author Hilbrand Bouwkamp - Initial contribution + * + * @param <T> The type returned by the function + * @param <R> The type of the input value of the function + */ +@FunctionalInterface +@NonNullByDefault +public interface NutFunction<T, R> { + + /** + * Applies this function to the given argument. + * + * @param t the function argument + * @return the function result + */ + @Nullable + R apply(T t) throws NutException; +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutResponseReader.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutResponseReader.java new file mode 100644 index 0000000000000..1b5b76af7043c --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutResponseReader.java @@ -0,0 +1,144 @@ +/** + * 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.networkupstools.internal.nut; + +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Util class to process NUT List results. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +final class NutResponseReader { + + private static final String BEGIN_LIST = "BEGIN LIST %s"; + private static final String END_LIST = "END LIST %s"; + private static final Pattern LIST_ROW_RESPONSE_PATTERN = Pattern.compile("([^\"]+)\"(.+)\"$"); + private static final Pattern GET_VAR_RESPONSE_PATTERN = Pattern.compile("VAR ([^\\s]+) ([^\"]+)\"(.+)\"$"); + + private final Logger logger = LoggerFactory.getLogger(NutResponseReader.class); + + /** + * Parses a NUT returned VAR. + * + * @param ups The ups the variable is for + * @param nut The name of the variable + * @param reader The reader containing the data + * @return variable value for given nut variable name + * @throws NutException Exception thrown in case of read errors + */ + public String parseVariable(final String ups, final String nut, final NutSupplier<String> reader) + throws NutException { + final String line = reader.get(); + + if (line == null) { + throw new NutException( + String.format("Variable '%s' for ups '%s' could not be read because nothing received", nut, ups)); + } + logger.trace("Line read:{}", line); + final Matcher matcher = GET_VAR_RESPONSE_PATTERN.matcher(line); + + if (matcher.find() && matcher.groupCount() == 3) { + final String matchedUps = matcher.group(1).trim(); + final String matchedNut = matcher.group(2).trim(); + final String value = stripVariable(matcher.group(3)); + + if (!ups.equals(matchedUps)) { + throw new NutException( + String.format("Returned value '%s' didn't match expected ups '%s'", matchedUps, ups)); + } + if (!nut.equals(matchedNut)) { + throw new NutException( + String.format("Returned value '%s' didn't match expected nut '%s'", matchedNut, nut)); + } + return value; + } + throw new NutException(String.format("Variable '%s' for ups '%s' could not be read: %s", nut, ups, line)); + } + + /** + * Parses a NUT returned LIST. + * + * @param type nut data type to expect in the data + * @param reader The reader containing the data + * @param variables The map to store the read nut variables + * @return Map of variable name and variable value pairs + * @throws NutException Exception thrown in case of read errors + */ + public Map<String, String> parseList(final String type, final NutSupplier<String> reader) throws NutException { + final Map<String, String> variables = new HashMap<>(); + logger.trace("Reading {}", type); + validateBegin(type, reader); + final int stripBeginLength = type.length() + 1; + final String endString = String.format(END_LIST, type); + String line = null; + boolean endFound = false; + + while (!endFound) { + line = reader.get(); + if (line == null) { + throw new NutException("Unexpected end of data while reading " + type); + } + logger.trace("Line read:{}", line); + endFound = endString.equals(line); + if (!endFound) { + addRow(variables, line, stripBeginLength); + } + } + if (logger.isTraceEnabled()) { + logger.trace("List '{}' read. {} variables read", type, variables.size()); + } + return variables; + } + + private void validateBegin(final String type, final NutSupplier<String> reader) throws NutException { + final String beginString = String.format(BEGIN_LIST, type); + String line; + + do { + line = reader.get(); + logger.trace("Line read:{}", line); + if (line == null) { + throw new NutException("Could not find the begin string pattern in the data while reading " + type); + } + } while (!beginString.equals(line)); + logger.trace("Begin of list '{}' found", type); + } + + private void addRow(final Map<String, String> map, final String row, final int offset) { + final String substring = row.substring(offset); + final Matcher matcher = LIST_ROW_RESPONSE_PATTERN.matcher(substring); + + if (matcher.find() && matcher.groupCount() == 2) { + final String nut = matcher.group(1).trim(); + final String value = stripVariable(matcher.group(2)); + + map.put(nut, value); + logger.trace("Read nut variable '{}':{}", nut, value); + } else { + logger.debug("Unrecognized nut results: {}", row); + } + } + + private String stripVariable(final String rawVariable) { + return rawVariable.replaceAll("\\\\\"", "\"").replaceAll("\\\\\\\\", "\\\\").trim(); + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutSupplier.java b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutSupplier.java new file mode 100644 index 0000000000000..551c29b5076df --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/java/org/openhab/binding/networkupstools/internal/nut/NutSupplier.java @@ -0,0 +1,36 @@ +/** + * 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.networkupstools.internal.nut; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * Supplier interface that can throw a {@link NutException}. + * + * @author Hilbrand Bouwkamp - Initial contribution + * + * @param <T> The type returned by the supplier + */ +@FunctionalInterface +@NonNullByDefault +public interface NutSupplier<T> { + + /** + * Gets a result. + * + * @return a result + */ + @Nullable + T get() throws NutException; +} diff --git a/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..ae7143bdf91c0 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="networkupstools" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Network UPS Tools Binding</name> + <description>Binding for connecting to Network UPS Tools (NUT) servers</description> + <author>Hilbrand Bouwkamp</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/config/config.xml new file mode 100644 index 0000000000000..e359fc773f2f1 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/config/config.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> + + <config-description uri="thing-type:ups:config"> + <parameter name="device" type="text" required="true"> + <label>Device</label> + <description>UPS server name</description> + </parameter> + <parameter name="host" type="text" required="true"> + <context>network-address</context> + <label>Host</label> + <description>UPS server host or ip-address</description> + <default>localhost</default> + </parameter> + <parameter name="username" type="text"> + <label>Username</label> + <description>UPS server username to login</description> + </parameter> + <parameter name="password" type="text"> + <context>password</context> + <label>Password</label> + <description>UPS server password to login</description> + </parameter> + <parameter name="port" type="integer"> + <label>Port</label> + <description>UPS server port</description> + <default>3493</default> + </parameter> + <parameter name="refresh" type="integer" unit="s"> + <label>Refresh</label> + <description>Refresh interval for state updates in seconds</description> + <default>60</default> + </parameter> + </config-description> + + <config-description uri="channel-type:ups:dynamic-channel-config"> + <parameter name="networkupstools" type="text" required="true"> + <label>NUT Variable</label> + <description>The name of the NUT variable</description> + </parameter> + </config-description> + + <config-description uri="channel-type:ups:dynamic-channel-config-quantity-type"> + <parameter name="networkupstools" type="text" required="true"> + <label>NUT Variable</label> + <description>The name of the NUT variable</description> + </parameter> + <parameter name="unit" type="text" required="true"> + <label>Unit</label> + <description>The unit of the data</description> + </parameter> + </config-description> + +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..4159b0807185b --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="networkupstools" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-type id="ups-alarm"> + <item-type>String</item-type> + <label>UPS Alarm</label> + <description>UPS alarms</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="ups-load" advanced="true"> + <item-type>Number:Dimensionless</item-type> + <label>UPS Load</label> + <description>Load on UPS (percent)</description> + <state pattern="%.1f %%" readOnly="true" /> + </channel-type> + <channel-type id="ups-power" advanced="true"> + <item-type>Number:Power</item-type> + <label>UPS Power</label> + <description>Current value of apparent power (Volt-Amps)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="ups-realpower"> + <item-type>Number:Power</item-type> + <label>UPS Realpower</label> + <description>Current value of real power (Watts)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="ups-status"> + <item-type>String</item-type> + <label>UPS Status</label> + <description>Status of the UPS: OFF, OL,OB,LB,RB,OVER,TRIM,BOOST,CAL,BYPASS,NULL</description> + <state readOnly="true"> + <options> + <option value="OFF">Off</option> + <option value="OL">Online</option> + <option value="OB">On battery</option> + <option value="LB">Low battery</option> + <option value="RB">Replace battery</option> + <option value="OVER">Overload</option> + <option value="TRIM">Voltage trim</option> + <option value="BOOST">Voltage boost</option> + <option value="CAL">Calibration</option> + <option value="BYPASS">Bypass</option> + <option value="NULL">Null</option> + </options> + </state> + </channel-type> + <channel-type id="ups-temperature" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>UPS Temperature</label> + <description>UPS temperature (degrees C)</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="ups-test-result" advanced="true"> + <item-type>String</item-type> + <label>UPS Test Result</label> + <description>Results of last self test (opaque string)</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="input-current" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Input Current</label> + <description>Input current (A)</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="input-current-status" advanced="true"> + <item-type>String</item-type> + <label>Input Current Status</label> + <description>Status relative to the thresholds</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="input-load"> + <item-type>Number:Dimensionless</item-type> + <label>Input Load</label> + <description>Load on (ePDU) input (percent of full)</description> + <state pattern="%.1f %%" readOnly="true" /> + </channel-type> + <channel-type id="input-realpower" advanced="true"> + <item-type>Number:Power</item-type> + <label>Input Realpower</label> + <description>Current sum value of all (ePDU) phases real power (W)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="input-quality" advanced="true"> + <item-type>String</item-type> + <label>Input Quality</label> + <description>Input power quality (*** opaque)</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="input-transfer-reason" advanced="true"> + <item-type>String</item-type> + <label>Input Transfer Reason</label> + <description>Reason for last transfer to battery (*** opaque)</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="input-voltage" advanced="true"> + <item-type>Number:ElectricPotential</item-type> + <label>Input Voltage</label> + <description>Input voltage (V)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="input-voltage-status" advanced="true"> + <item-type>String</item-type> + <label>Input Voltage Status</label> + <description>Status relative to the thresholds</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="output-current" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Output Current</label> + <description>Output current (A)</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="output-voltage" advanced="true"> + <item-type>Number:ElectricPotential</item-type> + <label>Output Voltage</label> + <description>Output voltage (V)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + <channel-type id="battery-charge"> + <item-type>Number:Dimensionless</item-type> + <label>Battery Charge</label> + <description>Battery charge (percent)</description> + <state pattern="%.1f %%" readOnly="true" /> + </channel-type> + <channel-type id="battery-runtime"> + <item-type>Number:Time</item-type> + <label>Battery Runtime</label> + <description>Battery runtime (seconds)</description> + <state pattern="%d %unit%" readOnly="true" /> + </channel-type> + <channel-type id="battery-voltage" advanced="true"> + <item-type>Number:ElectricPotential</item-type> + <label>Battery Voltage</label> + <description>Battery voltage (V)</description> + <state pattern="%.0f %unit%" readOnly="true" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/dynamic-channels.xml b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/dynamic-channels.xml new file mode 100644 index 0000000000000..36d62ebd1f1ee --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/dynamic-channels.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="networkupstools" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-type id="string"> + <item-type>String</item-type> + <label>String</label> + <description>String channel</description> + <state readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config" /> + </channel-type> + <channel-type id="number"> + <item-type>Number</item-type> + <label>Number</label> + <description>Number channel</description> + <state readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config" /> + </channel-type> + <channel-type id="number-electric-current"> + <item-type>Number:ElectricCurrent</item-type> + <label>Electric Current</label> + <description>Electric Current channel</description> + <state pattern="%.1f %unit%" readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config-quantity-type" /> + </channel-type> + <channel-type id="number-electric-potential"> + <item-type>Number:ElectricPotential</item-type> + <label>Electric Potential</label> + <description>Electric Potential channel</description> + <state pattern="%.1f %unit%" readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config-quantity-type" /> + </channel-type> + <channel-type id="number-frequency"> + <item-type>Number:Frequency</item-type> + <label>Frequency</label> + <description>Frequency channel</description> + <state pattern="%.1f %unit%" readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config-quantity-type" /> + </channel-type> + <channel-type id="number-power"> + <item-type>Number:Power</item-type> + <label>Power</label> + <description>Power channel</description> + <state pattern="%.1f %unit%" readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config-quantity-type" /> + </channel-type> + <channel-type id="number-time"> + <item-type>Number:Time</item-type> + <label>Time</label> + <description>Time channel</description> + <state pattern="%d %unit%" readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config-quantity-type" /> + </channel-type> + <channel-type id="switch"> + <item-type>Switch</item-type> + <label>Switch</label> + <description>Switch channel</description> + <state readOnly="true" /> + <config-description-ref uri="channel-type:ups:dynamic-channel-config" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..323a08ccc9259 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="networkupstools" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="ups" + extensible="string,number,number-electric-current,number-electric-potential,number-frequency,number-power,number-time,switch"> + <label>Network UPS Tool</label> + <description>Network UPS Tool Thing</description> + + <channels> + <channel id="batteryCharge" typeId="battery-charge" /> + <channel id="batteryRuntime" typeId="battery-runtime" /> + <channel id="batteryVoltage" typeId="battery-voltage" /> + <channel id="inputRealpower" typeId="input-realpower" /> + <channel id="inputVoltageStatus" typeId="input-voltage-status" /> + <channel id="inputQuality" typeId="input-quality" /> + <channel id="inputCurrent" typeId="input-current" /> + <channel id="inputCurrentStatus" typeId="input-current-status" /> + <channel id="inputLoad" typeId="input-load" /> + <channel id="inputTransferReason" typeId="input-transfer-reason" /> + <channel id="inputVoltage" typeId="input-voltage" /> + <channel id="outputCurrent" typeId="output-current" /> + <channel id="outputVoltage" typeId="output-voltage" /> + <channel id="upsAlarm" typeId="ups-alarm" /> + <channel id="upsLoad" typeId="ups-load" /> + <channel id="upsPower" typeId="ups-power" /> + <channel id="upsRealpower" typeId="ups-realpower" /> + <channel id="upsStatus" typeId="ups-status" /> + <channel id="upsTemperature" typeId="ups-temperature" /> + <channel id="upsTestResult" typeId="ups-test-result" /> + </channels> + + <config-description-ref uri="thing-type:ups:config" /> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameChannelsTest.java b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameChannelsTest.java new file mode 100644 index 0000000000000..85adf07990812 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameChannelsTest.java @@ -0,0 +1,225 @@ +/** + * 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.networkupstools.internal; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.apache.commons.io.FileUtils; +import org.eclipse.smarthome.core.library.CoreItemFactory; +import org.junit.Test; + +/** + * Test class that reads the README.md and matches it with the ESH-INF thing channel definitions. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +public class NutNameChannelsTest { + + private static final String THING_TYPES_XML = "thing-types.xml"; + private static final String CHANNELS_XML = "channels.xml"; + + private static final int EXPECTED_NUMBER_OF_CHANNELS = 20; + private static final int EXPECTED_NUMMBER_OF_CHANNEL_XML_LINES = EXPECTED_NUMBER_OF_CHANNELS * 6; + + // README table is: | Channel Name | Item Type | Unit | Description | Advanced + private static final Pattern README_PATTERN = Pattern + .compile("^\\|\\s+([\\w\\.]+)\\s+\\|\\s+([:\\w]+)\\s+\\|\\s+([^\\|]+)\\|\\s+([^\\|]+)\\|\\s+([^\\s]+)"); + private static final Pattern CHANNEL_PATTERN = Pattern.compile("<channel id"); + private static final Pattern CHANNEL_TYPE_PATTERN = Pattern + .compile("(<channel-type|<item-type|<label|<description|<state|</channel-type)"); + + private static final String TEMPLATE_CHANNEL_TYPE = "<channel-type id=\"%s\"%s>"; + private static final String TEMPLATE_ADVANCED = " advanced=\"true\""; + private static final String TEMPLATE_ITEM_TYPE = "<item-type>%s</item-type>"; + private static final String TEMPLATE_LABEL = "<label>%s</label>"; + private static final String TEMPLATE_DESCRIPTION = "<description>%s</description>"; + private static final String TEMPLATE_STATE = "<state pattern=\"%s\" readOnly=\"true\" />"; + private static final String TEMPLATE_STATE_NO_PATTERN = "<state readOnly=\"true\" />"; + private static final String TEMPLATE_STATE_OPTIONS = "<state readOnly=\"true\">"; + private static final String TEMPLATE_CHANNEL_TYPE_END = "</channel-type>"; + private static final String TEMPLATE_CHANNEL = "<channel id=\"%s\" typeId=\"%s\" />"; + + private static final String README_IS_ADVANCED = "yes"; + + /** + * Test if README matches with the channels in the things xml. + */ + @Test + public void testReadmeMatchingChannels() { + final Map<NutName, String> readMeNutNames = readReadme(); + final List<String> list = new ArrayList<>(); + + for (final Entry<NutName, String> entry : readMeNutNames.entrySet()) { + final Matcher matcher = README_PATTERN.matcher(entry.getValue()); + + assertNotNull("Could not find NutName in readme for : " + entry.getValue(), entry.getKey()); + if (matcher.find()) { + list.add(String.format(TEMPLATE_CHANNEL, entry.getKey().getChannelId(), + nutNameToChannelType(entry.getKey()))); + } else { + fail("Could not match line from readme: " + entry.getValue()); + } + } + assertThat("Expected number created channels from readme doesn't match with source code", list.size(), + is(EXPECTED_NUMBER_OF_CHANNELS)); + final List<String> channelsFromXml = readThingsXml(CHANNEL_PATTERN, THING_TYPES_XML); + final List<String> channelsFromReadme = list.stream().map(String::trim).sorted().collect(Collectors.toList()); + for (int i = 0; i < channelsFromXml.size(); i++) { + assertThat(channelsFromXml.get(i), is(channelsFromReadme.get(i))); + } + } + + /** + * Test is the channel-type matches with the description in the README. + * This test is a little verbose as it generates the channel-type description as in the xml is specified. + * This is for easy adding more channels, by simply adding them to the readme and copy-paste the generated xml to + * the channels xml. + */ + @Test + public void testNutNameMatchingReadme() { + final Map<NutName, String> readMeNutNames = readReadme(); + final List<String> list = new ArrayList<>(); + + for (final NutName nn : NutName.values()) { + buildChannel(list, nn, readMeNutNames.get(nn)); + } + assertThat("Expected number created channel data from readme doesn't match with source code", list.size(), + is(EXPECTED_NUMMBER_OF_CHANNEL_XML_LINES)); + final List<String> channelsFromXml = readThingsXml(CHANNEL_TYPE_PATTERN, CHANNELS_XML); + final List<String> channelsFromReadme = list.stream().map(String::trim).sorted().collect(Collectors.toList()); + + for (int i = 0; i < channelsFromXml.size(); i++) { + assertThat(channelsFromXml.get(i), is(channelsFromReadme.get(i))); + } + } + + private Map<NutName, String> readReadme() { + final String path = getClass().getProtectionDomain().getClassLoader().getResource(".").getFile() + "../.."; + + try { + final List<String> lines = FileUtils.readLines(new File(path, "README.md")); + + return lines.stream().filter(line -> README_PATTERN.matcher(line).find()) + .collect(Collectors.toMap(this::lineToNutName, Function.identity())); + } catch (final IOException e) { + fail("Could not read README.md from: " + path); + return null; + } + } + + private List<String> readThingsXml(final Pattern pattern, final String filename) { + final String path = getClass().getProtectionDomain().getClassLoader().getResource(".").getFile() + + "../../src/main/resources/ESH-INF/thing"; + try { + final List<String> lines = FileUtils.readLines(new File(path, filename)); + return lines.stream().filter(line -> pattern.matcher(line).find()).map(String::trim).sorted() + .collect(Collectors.toList()); + } catch (final IOException e) { + fail("Could not read things xml from: " + path); + return null; + } + } + + private NutName lineToNutName(final String line) { + final Matcher matcher = README_PATTERN.matcher(line); + assertTrue("Could not match readme line: " + line, matcher.find()); + final String name = matcher.group(1); + final NutName channelIdToNutName = NutName.channelIdToNutName(name); + assertNotNull("Name should not match null: '" + name + "' ->" + line, channelIdToNutName); + return channelIdToNutName; + } + + private void buildChannel(final List<String> list, final NutName nn, final String readmeLine) { + if (readmeLine == null) { + fail("Readme line is null for: " + nn); + } else { + final Matcher matcher = README_PATTERN.matcher(readmeLine); + + if (matcher.find()) { + final String advanced = README_IS_ADVANCED.equals(matcher.group(5)) ? TEMPLATE_ADVANCED : ""; + + list.add(String.format(TEMPLATE_CHANNEL_TYPE, nutNameToChannelType(nn), advanced)); + final String itemType = matcher.group(2); + + list.add(String.format(TEMPLATE_ITEM_TYPE, itemType)); + list.add(String.format(TEMPLATE_LABEL, nutNameToLabel(nn))); + list.add(String.format(TEMPLATE_DESCRIPTION, matcher.group(4).trim())); + final String pattern = nutNameToPattern(itemType); + + list.add(pattern.isEmpty() + ? NutName.UPS_STATUS == nn ? TEMPLATE_STATE_OPTIONS : TEMPLATE_STATE_NO_PATTERN + : String.format(TEMPLATE_STATE, pattern)); + } else { + fail("Could not parse the line from README:" + readmeLine); + } + list.add(TEMPLATE_CHANNEL_TYPE_END); + } + } + + private String nutNameToLabel(final NutName nn) { + final String[] labelWords = nn.getName().replace("ups", "UPS").split("\\."); + return Stream.of(labelWords).map(w -> Character.toUpperCase(w.charAt(0)) + w.substring(1)) + .collect(Collectors.joining(" ")); + } + + private String nutNameToChannelType(final NutName nn) { + return nn.getName().replace('.', '-'); + } + + private String nutNameToPattern(final String itemType) { + final String pattern; + switch (itemType) { + case CoreItemFactory.STRING: + pattern = ""; + break; + case CoreItemFactory.NUMBER: + pattern = "%d"; + break; + case "Number:Dimensionless": + pattern = "%.1f %%"; + break; + case "Number:Time": + pattern = "%d %unit%"; + break; + case "Number:Power": + case "Number:ElectricPotential": + pattern = "%.0f %unit%"; + break; + case "Number:Temperature": + case "Number:ElectricCurrent": + case "Number:Frequency": + case "Number:Angle": + pattern = "%.1f %unit%"; + break; + default: + fail("itemType not supported:" + itemType); + pattern = ""; + break; + } + return pattern; + } + +} diff --git a/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameTest.java b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameTest.java new file mode 100644 index 0000000000000..204abb9a39f4c --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/NutNameTest.java @@ -0,0 +1,49 @@ +/** + * 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.networkupstools.internal; + +import static org.junit.Assert.*; + +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang.StringUtils; +import org.junit.Test; + +/** + * Test class to check the validity of the {@link NutName} enum. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +public class NutNameTest { + + private static final Pattern CHANNEL_PATTERN = Pattern.compile("(\\w+)\\.(\\w+)\\.?(\\w+)?\\.?(\\w+)?"); + + /** + * Tests if the name in {@link NutName} enum matches with the channelID in the enum. + */ + @Test + public void testChannelIdName() { + for (final NutName nn : NutName.values()) { + final Matcher matcher = CHANNEL_PATTERN.matcher(nn.getName()); + + assertTrue("NutName name '" + nn + "' could not be matched with expected pattern.", matcher.find()); + final String expectedChannelId = matcher.group(1) + + StringUtils.capitalize(Optional.ofNullable(matcher.group(2)).orElse("")) + + StringUtils.capitalize(Optional.ofNullable(matcher.group(3)).orElse("")) + + StringUtils.capitalize(Optional.ofNullable(matcher.group(4)).orElse("")); + assertEquals("Channel name not correct", expectedChannelId, nn.getChannelId()); + } + } +} diff --git a/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/nut/NutApiTest.java b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/nut/NutApiTest.java new file mode 100644 index 0000000000000..777b0b6c4f6c7 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/java/org/openhab/binding/networkupstools/internal/nut/NutApiTest.java @@ -0,0 +1,106 @@ +/** + * 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.networkupstools.internal.nut; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.MockitoAnnotations.initMocks; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNull; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; + +/** + * Unit test to test the {@link NutApi} using a mock Socket connection. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +public class NutApiTest { + + @Mock + private Socket socket; + private NutConnector connector; + + @Before + public void setUp() throws IOException { + initMocks(this); + connector = new NutConnector("localhost", 0, "test", "pwd") { + @Override + protected Socket newSocket() { + return socket; + }; + }; + } + + /** + * Test if retrieving a list of variables is correctly done. + */ + @Test + public void testListVariables() throws IOException, NutException, URISyntaxException { + final String expectedCommands = new String( + Files.readAllBytes(Paths.get(getClass().getResource("var_list_commands.txt").toURI()))); + final StringBuffer actualCommands = new StringBuffer(); + try (InputStream in = getClass().getResourceAsStream("var_list.txt"); OutputStream out = new OutputStream() { + @Override + public void write(int b) throws IOException { + actualCommands.append((char) b); + } + }) { + doReturn(in).when(socket).getInputStream(); + doReturn(out).when(socket).getOutputStream(); + + final NutApi api = new NutApi(connector); + final Map<@NonNull String, @NonNull String> variables = api.getVariables("ups1"); + + assertThat("Should have variables", variables.size(), is(4)); + assertThat("Should read variable correctly", variables.get("output.voltage.nominal"), is("115")); + assertThat("Should send commands correctly", actualCommands.toString(), is(expectedCommands)); + } + } + + /** + * Test if retrieving a single variable is correctly done. + */ + @Test + public void testGetVariable() throws IOException, NutException, URISyntaxException { + final String expectedCommands = new String( + Files.readAllBytes(Paths.get(getClass().getResource("var_get_commands.txt").toURI()))); + final StringBuffer actualCommands = new StringBuffer(); + try (InputStream in = getClass().getResourceAsStream("var_get.txt"); OutputStream out = new OutputStream() { + @Override + public void write(int b) throws IOException { + actualCommands.append((char) b); + } + }) { + doReturn(in).when(socket).getInputStream(); + doReturn(out).when(socket).getOutputStream(); + + final NutApi api = new NutApi(connector); + final String variable = api.getVariable("ups1", "ups.status"); + assertThat("Should read ups.status variable correctly", variable, is("OL")); + assertThat("Should send commands correctly", actualCommands.toString(), is(expectedCommands)); + } + } + +} diff --git a/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get.txt b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get.txt new file mode 100644 index 0000000000000..21f45e0c1ebe2 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get.txt @@ -0,0 +1,3 @@ +OK +OK +VAR ups1 ups.status "OL" diff --git a/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get_commands.txt b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get_commands.txt new file mode 100644 index 0000000000000..37a36a2dbed1a --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_get_commands.txt @@ -0,0 +1,3 @@ +USERNAME test +PASSWORD pwd +GET VAR ups1 ups.status diff --git a/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list.txt b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list.txt new file mode 100644 index 0000000000000..9cc3168a2421e --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list.txt @@ -0,0 +1,11 @@ +OK +OK +353fasa24 + +BEGIN LIST VAR ups1 +VAR ups1 ups.mfr "APC\\\"" +VAR ups1 ups.mfr.date "01/01/99" +VAR ups1 output.voltage.nominal "115" +VAR ups1 ups.delay.shutdown "020" +END LIST VAR ups1 +OK diff --git a/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list_commands.txt b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list_commands.txt new file mode 100644 index 0000000000000..ca8b348978fd2 --- /dev/null +++ b/bundles/org.openhab.binding.networkupstools/src/test/resources/org/openhab/binding/networkupstools/internal/nut/var_list_commands.txt @@ -0,0 +1,3 @@ +USERNAME test +PASSWORD pwd +LIST VAR ups1 diff --git a/bundles/org.openhab.binding.nibeheatpump/NOTICE b/bundles/org.openhab.binding.nibeheatpump/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nibeheatpump/NOTICE +++ b/bundles/org.openhab.binding.nibeheatpump/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nibeheatpump/README.md b/bundles/org.openhab.binding.nibeheatpump/README.md index 75a8773b1fe11..92b116b02b0b6 100644 --- a/bundles/org.openhab.binding.nibeheatpump/README.md +++ b/bundles/org.openhab.binding.nibeheatpump/README.md @@ -1,14 +1,16 @@ # Nibe Heatpump Binding -The Nibe Heatpump binding is used to get live data from from Nibe heat pumps without using expensive MODBUS40 adapter. -This binding should be compatible at least the F750, F1145, F1245, F1155, F1255 and F470 heat pump models. +The Nibe Heatpump binding is used to get live data from Nibe heat pumps without using an expensive MODBUS40 adapter. +This binding is compatible with the F750, F1145, F1245, F1155, F1255 and F470 heat pump models. -The binding support data telegrams (contains max 20 registers) from the heat pump, but binding can also read other registers from the pump. -It's recommend to add most changed variables to telegram, binding will then read all other registers automatically from the pump when channels are linked to item. -Register reading need to be enabled from the thing configuration. -Binding have also experimental support for register writing. -This can be used to configure heat pump. -Write mode need to enabled from thing configuration and for safety reason all register identifiers need to explicitly defined. +The binding supports data telegrams (containing a maximum of 20 registers) from the heat pump. +The binding can also read other registers from the pump. +It is recommended to add the most often updated variables to a telegram. +The binding will then read all other registers automatically from the pump when channels are linked to an item. +Register reading needs to be enabled in the thing configuration. +The binding also has experimental support for writing registers. +This can be used to configure the heat pump. +Write mode needs to be enabled in the thing configuration and for safety reasons all register identifiers need to be explicitly defined. ## Supported Things @@ -31,46 +33,49 @@ This binding supports direct serial port connection (RS-485 adapter needed) to h ## Discovery -Discovery is not supported, therefore binding and things need to be configured via Paper UI or thing files. +Discovery is not supported, therefore the binding and things need to be configured via Paper UI or thing files. ## Prerequisites -When Modbus adapter support is enabled from the heat pump UI, the heat pump will start to send telegrams every now and then. A telegram contains a maximum of 20 registers. +When Modbus adapter support is enabled from the heat pump UI, the heat pump will start to send telegrams every now and then. +A telegram contains a maximum of 20 registers. Those 20 registers can be configured via the Nibe ModbusManager application. -Unfortunately Nibe has made this tricky: telegram from heat pump should be acknowledged, otherwise heat pump will raise an alarm and go in alarm state. -Acknowledge (ACK or NAK) should be sent accurately. -Binding support also direct serial port connections to heat pump, but heat pump will raise an alarm when openHAB binding not running e.g. during openHAB updates. +Unfortunately Nibe has made this tricky. +A telegram from the heat pump must be acknowledged, otherwise the heat pump will raise an alarm and go into the alarm state. +Acknowledgement (ACK or NAK) responses should be sent correctly. +The binding also supports direct serial port connections to the heat pump, but the heat pump will raise an alarm when the openHAB binding is not running e.g. during openHAB updates. This problem can be resolved by using the `nibegw` program, which can be run on Unix/Linux (such as a Raspberry Pi) or Arduino-based boards. -If you are running openHAB on Raspberry Pi `nibegw` program can run also on the same machine, then when openHAB is not running `nibegw` will still acknowledge packets to heat pump. -Obviously, this doesn't solve the problem when whole Raspberry Pi is down, therefore Arduino based solution is recommended. +If you are running openHAB on a Raspberry Pi, the `nibegw` program can also run on the same machine. +Then when openHAB is not running , `nibegw` will acknowledge packets from the heat pump. +Obviously, this doesn't solve the problem when the Raspberry Pi is down, therefore an Arduino based solution is recommended. -`nibegw` is an application that read telegrams from a serial port (which requires an RS-485 adapter), sends ACK/NAK to the heat pump and relays untouched telegrams to openHAB via UDP packets. +`nibegw` is an application that reads telegrams from a serial port (which requires an RS-485 adapter), sends ACK/NAK to the heat pump and relays untouched telegrams to openHAB via UDP packets. The Nibe Heat Pump binding will listen to a UDP port and parse register data from UDP telegrams. ### Arduino -Arduino-based solution is tested with Arduino uno + RS485 and Ethernet shields. -Also [ProDiNo](https://www.kmpelectronics.eu/en-us/products/prodinoethernet.aspx) NetBoards are supported. -ProDiNo have both Ethernet and RS-485 ports on the board. +An Arduino-based solution has been tested with Arduino uno + RS485 and Ethernet shields. +The [ProDiNo](https://www.kmpelectronics.eu/en-us/products/prodinoethernet.aspx) NetBoards are also supported. +A ProDiNo has an Ethernet and RS-485 port on the board. -Arduino code is available [here](https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.nibeheatpump/NibeGW/Arduino/) +Arduino code is available [here](https://github.com/openhab/openhab-addons/tree/master/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW). -Arduino code can be builded via Arduino IDE. See more details from [www.arduino.cc](https://www.arduino.cc/en/Main/Software). -NibeGW configuration(such IP addresses, ports, etc) can be adapted directly editing the code files. +Arduino code can be build via Arduino IDE. +For more details see [www.arduino.cc](https://www.arduino.cc/en/Main/Software). +NibeGW configuration (such IP addresses, ports, etc) can be adapted directly by editing the code files. ### Raspberry Pi (or other Linux/Unix based boards) -C code is available on [here](https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.nibeheatpump/NibeGW/RasPi/) +C code is available [here](https://github.com/openhab/openhab-addons/tree/master/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/RasPi). -build C code: +To build the C code use: ```shell gcc -std=gnu99 -o nibegw nibegw.c ``` - -help: +For getting all command options execute the command using the help switch: ```shell nibegw -h @@ -94,7 +99,7 @@ nibegw -h ``` -run example: +Usage example: ```shell nibegw -v -d /dev/ttyUSB0 -a 192.168.1.10 @@ -106,7 +111,8 @@ No binding configuration required. ## Thing Configuration -Things can be fully configured via Paper Ui, but following information is usefull if you want to configure things via thing configuration files. +Things can be fully configured via Paper UI. +The following information is useful when configuring things via thing configuration files. ### UDP connection @@ -1879,4 +1885,4 @@ This binding currently supports following channels for F1x55 pump models: | 49379 | Switch | 0 | 1 | Setting | External ERS 4 accessory bypass at heat | | | 49380 | Switch | 0 | 1 | Setting | External ERS 3 accessory bypass at heat | | | 49381 | Switch | 0 | 1 | Setting | External ERS 2 accessory bypass at heat | | -| 49430 | Number | 0 | 255 | Setting | AUX ERS Fire Place Guard | | \ No newline at end of file +| 49430 | Number | 0 | 255 | Setting | AUX ERS Fire Place Guard | | diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGW.ino b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGW.ino index 3e654c1c5a056..ab6650c3bf580 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGW.ino +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGW.ino @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.cpp b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.cpp index b123bd16a16cb..1b4c3b22c57bd 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.cpp +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.h b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.h index 8348baa9637e2..d76a8a259e95b 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.h +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/Arduino/NibeGW/NibeGw.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/RasPi/nibegw.c b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/RasPi/nibegw.c index 9ceebd99ac2ce..237d8ff3d3e8f 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/RasPi/nibegw.c +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/NibeGW/RasPi/nibegw.c @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/README.md b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/README.md index 19955b9a53237..5e63e4daa09c2 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/README.md +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/README.md @@ -1,4 +1,4 @@ -# Usefull commands to create files used by the binding from Nibe ModbusManager CSV files +# Useful commands to create files used by the binding from Nibe ModbusManager CSV files Command to convert Nibe CSV file character set to UTF-8: ```iconv -f iso-8859-1 -t utf-8 F1X45.csv > F1X45_utf8.csv``` diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channel_types.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channel_types.awk index 361fde6191852..84a7dca604666 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channel_types.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channel_types.awk @@ -177,4 +177,4 @@ NR>5{ END{ print "" print "</thing:thing-descriptions>" -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channels.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channels.awk index c46878bfa90a6..2f22ec5fe721b 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channels.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_channels.awk @@ -27,4 +27,4 @@ NR>5{ printf(" <channel id=\"%s\" typeId=\"type-%s\"/>\n", id, id) } END{ -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_java_variable_information.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_java_variable_information.awk index 17cdcf6a281c9..d5694f66fb1b9 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_java_variable_information.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_java_variable_information.awk @@ -32,4 +32,4 @@ NR>5{ printf "put(%s, new VariableInformation(%4s, NibeDataType.%-3s, Type.%-8s, \"%s\"));\n", id, factor, toupper(size), type, title } END{ -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_readme_channel_table.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_readme_channel_table.awk index 06543ae7dc45b..a0551fe156289 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_readme_channel_table.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_readme_channel_table.awk @@ -156,4 +156,4 @@ NR>5{ printf("| %s | %s | %d | %d | %s | %s | %s |\n", id, channelType, min, max, type, title, vals) } END{ -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_sensor_channels.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_sensor_channels.awk index 800ee0518c5a1..b6ff854b27798 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_sensor_channels.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_sensor_channels.awk @@ -33,4 +33,4 @@ NR>5{ END{ print " </channels>" print "</channel-group-type>" -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_settings_channels.awk b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_settings_channels.awk index 9a696a67a2c72..fa80593fa78c5 100644 --- a/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_settings_channels.awk +++ b/bundles/org.openhab.binding.nibeheatpump/contrib/utils/create_settings_channels.awk @@ -33,4 +33,4 @@ NR>5{ END{ print " </channels>" print "</channel-group-type>" -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeheatpump/pom.xml b/bundles/org.openhab.binding.nibeheatpump/pom.xml index 2b3d86b17e8a3..3cc012a39e9d5 100644 --- a/bundles/org.openhab.binding.nibeheatpump/pom.xml +++ b/bundles/org.openhab.binding.nibeheatpump/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nibeheatpump</artifactId> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/feature/feature.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/feature/feature.xml index ee2f26cfcde46..51c50b1b34862 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nibeheatpump-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nibeheatpump" description="Nibe Heat Pump Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpBindingConstants.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpBindingConstants.java index 4120913f90982..c8ef22bc7b61e 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpBindingConstants.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpCommandResult.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpCommandResult.java index 2c0faf9c1c0c3..6146301ce0ecd 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpCommandResult.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpCommandResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpException.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpException.java index 548a8b54d49af..ce0b5578868e3 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpException.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpHandlerFactory.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpHandlerFactory.java index 8398d8cc1c645..a356b1b8e33bf 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpHandlerFactory.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/NibeHeatPumpHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/config/NibeHeatPumpConfiguration.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/config/NibeHeatPumpConfiguration.java index c424171b1d3a2..4e64074e968f6 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/config/NibeHeatPumpConfiguration.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/config/NibeHeatPumpConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,8 +39,8 @@ public String toString() { str += "hostName = " + hostName; str += ", port = " + port; - str += ", port4readCommands = " + readCommandsPort; - str += ", port4writeCommands = " + writeCommandsPort; + str += ", readCommandsPort = " + readCommandsPort; + str += ", writeCommandsPort = " + writeCommandsPort; str += ", serialPort = " + serialPort; str += ", refreshInterval = " + refreshInterval; str += ", enableReadCommands = " + enableReadCommands; @@ -48,7 +48,7 @@ public String toString() { str += ", sendAckToMODBUS40 = " + sendAckToMODBUS40; str += ", sendAckToRMU40 = " + sendAckToRMU40; str += ", sendAckToSMS40 = " + sendAckToSMS40; - str += ", enableCoilsForWriteCommands = " + enableWriteCommandsToRegisters; + str += ", enableWriteCommandsToRegisters = " + enableWriteCommandsToRegisters; str += ", throttleTime = " + throttleTime; return str; diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/ConnectorFactory.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/ConnectorFactory.java index d2c1546f9fe77..9c7db29dd7b0a 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/ConnectorFactory.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/ConnectorFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpBaseConnector.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpBaseConnector.java index 1dee710c72024..2ba1eca1081fd 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpBaseConnector.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpBaseConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -67,7 +67,7 @@ public void sendMsgToListeners(NibeHeatPumpMessage msg) { try { listener.msgReceived(msg); } catch (Exception e) { - logger.error("Event listener invoking error, exception {}", e); + logger.error("Event listener invoking error", e); } } } @@ -78,7 +78,7 @@ public void sendErrorToListeners(String error) { try { listener.errorOccurred(error); } catch (Exception e) { - logger.error("Event listener invoking error, exception {}", e); + logger.error("Event listener invoking error", e); } } } diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpConnector.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpConnector.java index db0a361a7b4e1..a533c902fd278 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpConnector.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpEventListener.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpEventListener.java index 270be238176aa..a9a4e41ace355 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpEventListener.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/NibeHeatPumpEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SerialConnector.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SerialConnector.java index 3f73e36f0913d..e9da07f984b5e 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SerialConnector.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,9 +21,8 @@ import java.util.List; import java.util.TooManyListenersException; -import org.eclipse.smarthome.core.util.HexUtils; - import org.apache.commons.io.IOUtils; +import org.eclipse.smarthome.core.util.HexUtils; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; import org.openhab.binding.nibeheatpump.internal.config.NibeHeatPumpConfiguration; import org.openhab.binding.nibeheatpump.internal.message.MessageFactory; @@ -246,7 +245,7 @@ public void sendReadMsg() { logger.error("Reading from serial port failed", e); sendErrorToListeners(e.getMessage()); } catch (Exception e) { - logger.debug("Error occurred during serial port read, reason: {}", e); + logger.debug("Error occurred during serial port read", e); } // run state machine to process all received data diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SimulatorConnector.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SimulatorConnector.java index 52bb550a69a9b..af034c84ffaf0 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SimulatorConnector.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/SimulatorConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/UDPConnector.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/UDPConnector.java index eb4f388f3c1fe..5d55527262da7 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/UDPConnector.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/connection/UDPConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/CommandTypeNotSupportedException.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/CommandTypeNotSupportedException.java index 618aac5949f2f..1a7d59bc4f32f 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/CommandTypeNotSupportedException.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/CommandTypeNotSupportedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandler.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandler.java index 8e9d45ded9a65..125cf81cb6505 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandler.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/MessageFactory.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/MessageFactory.java index 3c775fc19abf6..315c8f2e7d6aa 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/MessageFactory.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/MessageFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessage.java index 4ad59f3a27ccd..f7d96f82502aa 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessage.java index 3c0beea6e4b2f..8124598934bdf 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessage.java index 7c9359a6d8ca9..d9a068fb41301 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusValue.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusValue.java index 843764a0400a9..d439167112ec1 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusValue.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessage.java index a5ed3e2b0125b..5bc915bf3b35f 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessage.java index 2c561d0fd241c..a6a6463c420bc 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpBaseMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpBaseMessage.java index 7a1493521daee..540c2591dffa8 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpBaseMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpBaseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpMessage.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpMessage.java index 6ae08e8fb50ce..4036420d6b99c 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpMessage.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X45.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X45.java index 46ff9b4f12509..cc77afc9dd637 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X45.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X45.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X55.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X55.java index 3b9d23a5c2e29..b47c3f8a9cc05 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X55.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F1X55.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F470.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F470.java index 73ad25eabc244..c91f105807b1d 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F470.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F470.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F750.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F750.java index 7dd0126960a7e..6ea83fde56823 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F750.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/F750.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/PumpModel.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/PumpModel.java index 2a392886e03e5..5778d278b805e 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/PumpModel.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/PumpModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformation.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformation.java index e90f714dcec5c..bcdf7cdf0749f 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformation.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocol.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocol.java index 16dde61f95472..8ac807cbce79a 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocol.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolContext.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolContext.java index b38c9d7e64b2a..192b4acd3f0f4 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolContext.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolDefaultContext.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolDefaultContext.java index 6cb662ed9434e..bc39714b7688c 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolDefaultContext.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolDefaultContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolState.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolState.java index 65f6f5b31eaba..630f668aa87c4 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolState.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolStates.java b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolStates.java index fce106cf7c31a..d69c22609f590 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolStates.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/java/org/openhab/binding/nibeheatpump/internal/protocol/NibeHeatPumpProtocolStates.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45-types.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45-types.xml index 9bffe0b43caba..7e961f4327a9c 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45-types.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45-types.xml @@ -5,91 +5,91 @@ <channel-type id="f1x45-40004"> <item-type>Number</item-type> - <label>BT1 Outdoor temp</label> + <label>BT1 Outdoor Temp</label> <description>Outdoor temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40005" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT2 Supply temp S4</label> + <label>EP23-BT2 Supply Temp S4</label> <description>Supply temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40006" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT2 Supply temp S3</label> + <label>EP22-BT2 Supply Temp S3</label> <description>Supply temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40007"> <item-type>Number</item-type> - <label>EP21-BT2 Supply temp S2</label> + <label>EP21-BT2 Supply Temp S2</label> <description>Supply temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40008"> <item-type>Number</item-type> - <label>BT2 Supply temp S1</label> + <label>BT2 Supply Temp S1</label> <description>Supply temperature for system 1</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40012"> <item-type>Number</item-type> - <label>EB100-EP14-BT3 Return temp</label> + <label>EB100-EP14-BT3 Return Temp</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40013" advanced="true"> <item-type>Number</item-type> - <label>BT7 Hot Water top</label> + <label>BT7 Hot Water Top</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40014"> <item-type>Number</item-type> - <label>BT6 Hot Water load</label> + <label>BT6 Hot Water Load</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40015"> <item-type>Number</item-type> - <label>EB100-EP14-BT10 Brine in temp</label> + <label>EB100-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40016"> <item-type>Number</item-type> - <label>EB100-EP14-BT11 Brine out temp</label> + <label>EB100-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40017"> <item-type>Number</item-type> - <label>EB100-EP14-BT12 Cond. out</label> + <label>EB100-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40018"> <item-type>Number</item-type> - <label>EB100-EP14-BT14 Hot gas temp</label> + <label>EB100-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40019" advanced="true"> <item-type>Number</item-type> - <label>EB100-EP14-BT15 Liquid line</label> + <label>EB100-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -103,14 +103,14 @@ </channel-type> <channel-type id="f1x45-40025" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT20 Exhaust air temp. 1</label> + <label>EB100-BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40026" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT21 Vented air temp. 1</label> + <label>EB100-BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -194,7 +194,7 @@ </channel-type> <channel-type id="f1x45-40054" advanced="true"> <item-type>Number</item-type> - <label>EB100-FD1 Temperature limiter</label> + <label>EB100-FD1 Temperature Limiter</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -208,14 +208,14 @@ </channel-type> <channel-type id="f1x45-40070" advanced="true"> <item-type>Number</item-type> - <label>EM1-BT52 Boiler temperature</label> + <label>EM1-BT52 Boiler Temperature</label> <description>Temperature of Boiler</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40071"> <item-type>Number</item-type> - <label>BT25 external supply temp</label> + <label>BT25 External Supply Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -264,42 +264,42 @@ </channel-type> <channel-type id="f1x45-40107" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT20 Exhaust air temp. 4</label> + <label>EB100-BT20 Exhaust Air Temp. 4</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40108" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT20 Exhaust air temp. 3</label> + <label>EB100-BT20 Exhaust Air Temp. 3</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40109" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT20 Exhaust air temp. 2</label> + <label>EB100-BT20 Exhaust Air Temp. 2</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40110" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT21 Vented air temp. 4</label> + <label>EB100-BT21 Vented Air Temp. 4</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40111" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT21 Vented air temp. 3</label> + <label>EB100-BT21 Vented Air Temp. 3</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40112" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT21 Vented air temp. 2</label> + <label>EB100-BT21 Vented Air Temp. 2</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -348,42 +348,42 @@ </channel-type> <channel-type id="f1x45-40127" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT3 Return temp S4</label> + <label>EP23-BT3 Return Temp S4</label> <description>Return temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40128" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT3 Return temp S3</label> + <label>EP22-BT3 Return Temp S3</label> <description>Return temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40129" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT3 Return temp S2</label> + <label>EP21-BT3 Return Temp S2</label> <description>Return temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40155" advanced="true"> <item-type>Number</item-type> - <label>EQ1-BT57 Collector temp.</label> + <label>EQ1-BT57 Collector Temp.</label> <description>External collector temperature for ACS</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-40156" advanced="true"> <item-type>Number</item-type> - <label>EQ1-BT75 Heatdump temp.</label> + <label>EQ1-BT75 Heatdump Temp.</label> <description>Heating medium dump temperature for ACS</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43001" advanced="true"> <item-type>Number</item-type> - <label>Software version</label> + <label>Software Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -446,14 +446,14 @@ </channel-type> <channel-type id="f1x45-43081" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time add.</label> + <label>Tot. Op.time Add.</label> <description>Total electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43084" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. Power</label> + <label>Int. El.add. Power</label> <description>Current power from the internal electrical addition</description> <state pattern="%.2f kW" readOnly="true"> </state> @@ -476,14 +476,14 @@ </channel-type> <channel-type id="f1x45-43091" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. State</label> + <label>Int. El.add. State</label> <description>State of the internal electrical addition</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43097" advanced="true"> <item-type>String</item-type> - <label>Status of the shunt controlled additional heat accessory</label> + <label>Status of the Shunt Controlled Additional Heat Accessory</label> <description>10 = Off, 20 = Running, 30 = Passive</description> <state pattern="%d" readOnly="true"> <options> @@ -495,56 +495,56 @@ </channel-type> <channel-type id="f1x45-43103" advanced="true"> <item-type>Number</item-type> - <label>HPAC state</label> + <label>HPAC State</label> <description>State of the HPAC cooling accessory.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43108" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43152" advanced="true"> <item-type>Number</item-type> - <label>Internal cooling blocked</label> + <label>Internal Cooling Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43158" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S4</label> + <label>External Adjustment Activated Via Input S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43159" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S3</label> + <label>External Adjustment Activated Via Input S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43160" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S2</label> + <label>External Adjustment Activated Via Input S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43161" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S1</label> + <label>External Adjustment Activated Via Input S1</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43163" advanced="true"> <item-type>String</item-type> - <label>Blocking status of the shunt controlled add heat acc</label> + <label>Blocking Status of the Shunt Controlled Add Heat Acc</label> <description>0 = Unblocked, 1 = Blocked</description> <state pattern="%d" readOnly="true"> <options> @@ -555,14 +555,14 @@ </channel-type> <channel-type id="f1x45-43164" advanced="true"> <item-type>Number</item-type> - <label>Cooling blocked</label> + <label>Cooling Blocked</label> <description>Whether cooling is blocked</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43171" advanced="true"> <item-type>String</item-type> - <label>Blocking status of the step controlled add heat acc</label> + <label>Blocking Status of the Step Controlled Add Heat Acc</label> <description>0 = Unblocked, 1 = Blocked</description> <state pattern="%d" readOnly="true"> <options> @@ -584,14 +584,14 @@ </channel-type> <channel-type id="f1x45-43230" advanced="true"> <item-type>Number</item-type> - <label>Accumulated energy</label> + <label>Accumulated Energy</label> <description></description> <state pattern="%.1f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43239" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time add.</label> + <label>Tot. HW Op.time Add.</label> <description>Total electric additive operation time in hot water mode</description> <state pattern="%.1f h" readOnly="true"> </state> @@ -605,21 +605,21 @@ </channel-type> <channel-type id="f1x45-43416" advanced="true"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressorer starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43420" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43424" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time in hot water mode</description> <state pattern="%d h" readOnly="true"> </state> @@ -646,14 +646,14 @@ </channel-type> <channel-type id="f1x45-43433" advanced="true"> <item-type>Number</item-type> - <label>Brine pump state EP14</label> + <label>Brine Pump State EP14</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43435" advanced="true"> <item-type>String</item-type> - <label>Compressor status EP14</label> + <label>Compressor Status EP14</label> <description>Indicates if the compressor is supplied with power 0=Off 1=On</description> <state pattern="%d" readOnly="true"> <options> @@ -741,28 +741,28 @@ </channel-type> <channel-type id="f1x45-43560" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 blocked</label> + <label>Pool 2 Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43561" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 blocked</label> + <label>Pool 1 Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43563" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 valve</label> + <label>Pool 2 Valve</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43564" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 valve</label> + <label>Pool 1 Valve</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -797,42 +797,42 @@ </channel-type> <channel-type id="f1x45-43600" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT3 Return temp.</label> + <label>EB108-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43601" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT10 Brine in temp</label> + <label>EB108-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43602" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT11 Brine out temp</label> + <label>EB108-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43603" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT12 Cond. out</label> + <label>EB108-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43604" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT14 Hot gas temp</label> + <label>EB108-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43605" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT15 Liquid line</label> + <label>EB108-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -846,14 +846,14 @@ </channel-type> <channel-type id="f1x45-43607" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BT29 Compr. Oil. temp.</label> + <label>EB108-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43608" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15-BP8 Pressure transmitter</label> + <label>EB108-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -867,98 +867,98 @@ </channel-type> <channel-type id="f1x45-43610" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Compr. time to start</label> + <label>EB108-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43611" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Relay status</label> + <label>EB108-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43612" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Heat med. pump status</label> + <label>EB108-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43613" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Brine pump status</label> + <label>EB108-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43614" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Compressor starts</label> + <label>EB108-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43616" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Tot. op.time compr</label> + <label>EB108-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43618" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Tot. HW op.time compr</label> + <label>EB108-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43620" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP15 Alarm number</label> + <label>EB108-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43621" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT3 Return temp.</label> + <label>EB108-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43622" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT10 Brine in temp</label> + <label>EB108-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43623" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT11 Brine out temp</label> + <label>EB108-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43624" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT12 Cond. out</label> + <label>EB108-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43625" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT14 Hot gas temp</label> + <label>EB108-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43626" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT15 Liquid line</label> + <label>EB108-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -972,14 +972,14 @@ </channel-type> <channel-type id="f1x45-43628" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BT29 Compr. Oil. temp.</label> + <label>EB108-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43629" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14-BP8 Pressure transmitter</label> + <label>EB108-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -993,56 +993,56 @@ </channel-type> <channel-type id="f1x45-43631" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Compr. time to start</label> + <label>EB108-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43632" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Relay status</label> + <label>EB108-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43633" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Heat med. pump status</label> + <label>EB108-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43634" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Brine pump status</label> + <label>EB108-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43635" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Compressor starts</label> + <label>EB108-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43637" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Tot. op.time compr</label> + <label>EB108-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43639" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Tot. HW op.time compr</label> + <label>EB108-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43641" advanced="true"> <item-type>Number</item-type> - <label>EB108-EP14 Alarm number</label> + <label>EB108-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -1070,42 +1070,42 @@ </channel-type> <channel-type id="f1x45-43662" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT3 Return temp.</label> + <label>EB107-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43663" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT10 Brine in temp</label> + <label>EB107-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43664" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT11 Brine out temp</label> + <label>EB107-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43665" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT12 Cond. out</label> + <label>EB107-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43666" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT14 Hot gas temp</label> + <label>EB107-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43667" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT15 Liquid line</label> + <label>EB107-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1119,14 +1119,14 @@ </channel-type> <channel-type id="f1x45-43669" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BT29 Compr. Oil. temp.</label> + <label>EB107-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43670" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15-BP8 Pressure transmitter</label> + <label>EB107-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1140,98 +1140,98 @@ </channel-type> <channel-type id="f1x45-43672" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Compr. time to start</label> + <label>EB107-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43673" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Relay status</label> + <label>EB107-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43674" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Heat med. pump status</label> + <label>EB107-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43675" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Brine pump status</label> + <label>EB107-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43676" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Compressor starts</label> + <label>EB107-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43678" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Tot. op.time compr</label> + <label>EB107-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43680" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Tot. HW op.time compr</label> + <label>EB107-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43682" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP15 Alarm number</label> + <label>EB107-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43683" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT3 Return temp.</label> + <label>EB107-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43684" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT10 Brine in temp</label> + <label>EB107-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43685" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT11 Brine out temp</label> + <label>EB107-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43686" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT12 Cond. out</label> + <label>EB107-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43687" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT14 Hot gas temp</label> + <label>EB107-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43688" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT15 Liquid line</label> + <label>EB107-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1245,14 +1245,14 @@ </channel-type> <channel-type id="f1x45-43690" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BT29 Compr. Oil. temp.</label> + <label>EB107-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43691" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14-BP8 Pressure transmitter</label> + <label>EB107-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1266,56 +1266,56 @@ </channel-type> <channel-type id="f1x45-43693" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Compr. time to start</label> + <label>EB107-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43694" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Relay status</label> + <label>EB107-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43695" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Heat med. pump status</label> + <label>EB107-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43696" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Brine pump status</label> + <label>EB107-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43697" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Compressor starts</label> + <label>EB107-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43699" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Tot. op.time compr</label> + <label>EB107-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43701" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Tot. HW op.time compr</label> + <label>EB107-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43703" advanced="true"> <item-type>Number</item-type> - <label>EB107-EP14 Alarm number</label> + <label>EB107-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -1343,42 +1343,42 @@ </channel-type> <channel-type id="f1x45-43724" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT3 Return temp.</label> + <label>EB106-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43725" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT10 Brine in temp</label> + <label>EB106-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43726" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT11 Brine out temp</label> + <label>EB106-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43727" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT12 Cond. out</label> + <label>EB106-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43728" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT14 Hot gas temp</label> + <label>EB106-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43729" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT15 Liquid line</label> + <label>EB106-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1392,14 +1392,14 @@ </channel-type> <channel-type id="f1x45-43731" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BT29 Compr. Oil. temp.</label> + <label>EB106-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43732" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15-BP8 Pressure transmitter</label> + <label>EB106-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1413,98 +1413,98 @@ </channel-type> <channel-type id="f1x45-43734" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Compr. time to start</label> + <label>EB106-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43735" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Relay status</label> + <label>EB106-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43736" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Heat med. pump status</label> + <label>EB106-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43737" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Brine pump status</label> + <label>EB106-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43738" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Compressor starts</label> + <label>EB106-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43740" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Tot. op.time compr</label> + <label>EB106-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43742" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Tot. HW op.time compr</label> + <label>EB106-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43744" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP15 Alarm number</label> + <label>EB106-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43745" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT3 Return temp.</label> + <label>EB106-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43746" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT10 Brine in temp</label> + <label>EB106-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43747" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT11 Brine out temp</label> + <label>EB106-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43748" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT12 Cond. out</label> + <label>EB106-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43749" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT14 Hot gas temp</label> + <label>EB106-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43750" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT15 Liquid line</label> + <label>EB106-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1518,14 +1518,14 @@ </channel-type> <channel-type id="f1x45-43752" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BT29 Compr. Oil. temp.</label> + <label>EB106-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43753" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14-BP8 Pressure transmitter</label> + <label>EB106-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1539,56 +1539,56 @@ </channel-type> <channel-type id="f1x45-43755" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Compr. time to start</label> + <label>EB106-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43756" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Relay status</label> + <label>EB106-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43757" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Heat med. pump status</label> + <label>EB106-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43758" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Brine pump status</label> + <label>EB106-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43759" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Compressor starts</label> + <label>EB106-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43761" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Tot. op.time compr</label> + <label>EB106-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43763" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Tot. HW op.time compr</label> + <label>EB106-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43765" advanced="true"> <item-type>Number</item-type> - <label>EB106-EP14 Alarm number</label> + <label>EB106-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -1616,42 +1616,42 @@ </channel-type> <channel-type id="f1x45-43786" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT3 Return temp.</label> + <label>EB105-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43787" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT10 Brine in temp</label> + <label>EB105-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43788" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT11 Brine out temp</label> + <label>EB105-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43789" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT12 Cond. out</label> + <label>EB105-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43790" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT14 Hot gas temp</label> + <label>EB105-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43791" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT15 Liquid line</label> + <label>EB105-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1665,14 +1665,14 @@ </channel-type> <channel-type id="f1x45-43793" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BT29 Compr. Oil. temp.</label> + <label>EB105-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43794" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15-BP8 Pressure transmitter</label> + <label>EB105-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1686,98 +1686,98 @@ </channel-type> <channel-type id="f1x45-43796" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Compr. time to start</label> + <label>EB105-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43797" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Relay status</label> + <label>EB105-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43798" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Heat med. pump status</label> + <label>EB105-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43799" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Brine pump status</label> + <label>EB105-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43800" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Compressor starts</label> + <label>EB105-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43802" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Tot. op.time compr</label> + <label>EB105-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43804" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Tot. HW op.time compr</label> + <label>EB105-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43806" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP15 Alarm number</label> + <label>EB105-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43807" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT3 Return temp.</label> + <label>EB105-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43808" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT10 Brine in temp</label> + <label>EB105-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43809" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT11 Brine out temp</label> + <label>EB105-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43810" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT12 Cond. out</label> + <label>EB105-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43811" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT14 Hot gas temp</label> + <label>EB105-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43812" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT15 Liquid line</label> + <label>EB105-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1791,14 +1791,14 @@ </channel-type> <channel-type id="f1x45-43814" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BT29 Compr. Oil. temp.</label> + <label>EB105-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43815" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14-BP8 Pressure transmitter</label> + <label>EB105-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1812,56 +1812,56 @@ </channel-type> <channel-type id="f1x45-43817" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Compr. time to start</label> + <label>EB105-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43818" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Relay status</label> + <label>EB105-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43819" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Heat med. pump status</label> + <label>EB105-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43820" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Brine pump status</label> + <label>EB105-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43821" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Compressor starts</label> + <label>EB105-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43823" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Tot. op.time compr</label> + <label>EB105-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43825" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Tot. HW op.time compr</label> + <label>EB105-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43827" advanced="true"> <item-type>Number</item-type> - <label>EB105-EP14 Alarm number</label> + <label>EB105-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -1889,42 +1889,42 @@ </channel-type> <channel-type id="f1x45-43848" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT3 Return temp.</label> + <label>EB104-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43849" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT10 Brine in temp</label> + <label>EB104-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43850" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT11 Brine out temp</label> + <label>EB104-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43851" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT12 Cond. out</label> + <label>EB104-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43852" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT14 Hot gas temp</label> + <label>EB104-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43853" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT15 Liquid line</label> + <label>EB104-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1938,14 +1938,14 @@ </channel-type> <channel-type id="f1x45-43855" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BT29 Compr. Oil. temp.</label> + <label>EB104-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43856" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15-BP8 Pressure transmitter</label> + <label>EB104-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1959,98 +1959,98 @@ </channel-type> <channel-type id="f1x45-43858" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Compr. time to start</label> + <label>EB104-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43859" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Relay status</label> + <label>EB104-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43860" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Heat med. pump status</label> + <label>EB104-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43861" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Brine pump status</label> + <label>EB104-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43862" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Compressor starts</label> + <label>EB104-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43864" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Tot. op.time compr</label> + <label>EB104-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43866" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Tot. HW op.time compr</label> + <label>EB104-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43868" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP15 Alarm number</label> + <label>EB104-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43869" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT3 Return temp.</label> + <label>EB104-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43870" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT10 Brine in temp</label> + <label>EB104-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43871" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT11 Brine out temp</label> + <label>EB104-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43872" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT12 Cond. out</label> + <label>EB104-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43873" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT14 Hot gas temp</label> + <label>EB104-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43874" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT15 Liquid line</label> + <label>EB104-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2064,14 +2064,14 @@ </channel-type> <channel-type id="f1x45-43876" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BT29 Compr. Oil. temp.</label> + <label>EB104-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43877" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14-BP8 Pressure transmitter</label> + <label>EB104-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2085,56 +2085,56 @@ </channel-type> <channel-type id="f1x45-43879" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Compr. time to start</label> + <label>EB104-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43880" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Relay status</label> + <label>EB104-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43881" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Heat med. pump status</label> + <label>EB104-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43882" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Brine pump status</label> + <label>EB104-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43883" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Compressor starts</label> + <label>EB104-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43885" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Tot. op.time compr</label> + <label>EB104-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43887" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Tot. HW op.time compr</label> + <label>EB104-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43889" advanced="true"> <item-type>Number</item-type> - <label>EB104-EP14 Alarm number</label> + <label>EB104-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -2162,42 +2162,42 @@ </channel-type> <channel-type id="f1x45-43910" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT3 Return temp.</label> + <label>EB103-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43911" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT10 Brine in temp</label> + <label>EB103-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43912" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT11 Brine out temp</label> + <label>EB103-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43913" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT12 Cond. out</label> + <label>EB103-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43914" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT14 Hot gas temp</label> + <label>EB103-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43915" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT15 Liquid line</label> + <label>EB103-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2211,14 +2211,14 @@ </channel-type> <channel-type id="f1x45-43917" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BT29 Compr. Oil. temp.</label> + <label>EB103-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43918" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15-BP8 Pressure transmitter</label> + <label>EB103-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2232,98 +2232,98 @@ </channel-type> <channel-type id="f1x45-43920" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Compr. time to start</label> + <label>EB103-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43921" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Relay status</label> + <label>EB103-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43922" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Heat med. pump status</label> + <label>EB103-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43923" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Brine pump status</label> + <label>EB103-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43924" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Compressor starts</label> + <label>EB103-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43926" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Tot. op.time compr</label> + <label>EB103-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43928" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Tot. HW op.time compr</label> + <label>EB103-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43930" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP15 Alarm number</label> + <label>EB103-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43931" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT3 Return temp.</label> + <label>EB103-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43932" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT10 Brine in temp</label> + <label>EB103-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43933" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT11 Brine out temp</label> + <label>EB103-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43934" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT12 Cond. out</label> + <label>EB103-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43935" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT14 Hot gas temp</label> + <label>EB103-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43936" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT15 Liquid line</label> + <label>EB103-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2337,14 +2337,14 @@ </channel-type> <channel-type id="f1x45-43938" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BT29 Compr. Oil. temp.</label> + <label>EB103-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43939" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14-BP8 Pressure transmitter</label> + <label>EB103-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2358,56 +2358,56 @@ </channel-type> <channel-type id="f1x45-43941" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Compr. time to start</label> + <label>EB103-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43942" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Relay status</label> + <label>EB103-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43943" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Heat med. pump status</label> + <label>EB103-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43944" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Brine pump status</label> + <label>EB103-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43945" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Compressor starts</label> + <label>EB103-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43947" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Tot. op.time compr</label> + <label>EB103-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43949" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Tot. HW op.time compr</label> + <label>EB103-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43951" advanced="true"> <item-type>Number</item-type> - <label>EB103-EP14 Alarm number</label> + <label>EB103-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -2435,42 +2435,42 @@ </channel-type> <channel-type id="f1x45-43972" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT3 Return temp.</label> + <label>EB102-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43973" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT10 Brine in temp</label> + <label>EB102-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43974" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT11 Brine out temp</label> + <label>EB102-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43975" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT12 Cond. out</label> + <label>EB102-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43976" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT14 Hot gas temp</label> + <label>EB102-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43977" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT15 Liquid line</label> + <label>EB102-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2484,14 +2484,14 @@ </channel-type> <channel-type id="f1x45-43979" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BT29 Compr. Oil. temp.</label> + <label>EB102-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43980" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15-BP8 Pressure transmitter</label> + <label>EB102-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2505,98 +2505,98 @@ </channel-type> <channel-type id="f1x45-43982" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Compr. time to start</label> + <label>EB102-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43983" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Relay status</label> + <label>EB102-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43984" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Heat med. pump status</label> + <label>EB102-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43985" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Brine pump status</label> + <label>EB102-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43986" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Compressor starts</label> + <label>EB102-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43988" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Tot. op.time compr</label> + <label>EB102-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43990" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Tot. HW op.time compr</label> + <label>EB102-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43992" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP15 Alarm number</label> + <label>EB102-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43993" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT3 Return temp.</label> + <label>EB102-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43994" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT10 Brine in temp</label> + <label>EB102-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43995" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT11 Brine out temp</label> + <label>EB102-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43996" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT12 Cond. out</label> + <label>EB102-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43997" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT14 Hot gas temp</label> + <label>EB102-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-43998" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT15 Liquid line</label> + <label>EB102-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2610,14 +2610,14 @@ </channel-type> <channel-type id="f1x45-44000" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BT29 Compr. Oil. temp.</label> + <label>EB102-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44001" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14-BP8 Pressure transmitter</label> + <label>EB102-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2631,56 +2631,56 @@ </channel-type> <channel-type id="f1x45-44003" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Compr. time to start</label> + <label>EB102-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44004" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Relay status</label> + <label>EB102-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44005" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Heat med. pump status</label> + <label>EB102-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44006" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Brine pump status</label> + <label>EB102-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44007" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Compressor starts</label> + <label>EB102-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44009" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Tot. op.time compr</label> + <label>EB102-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44011" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Tot. HW op.time compr</label> + <label>EB102-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44013" advanced="true"> <item-type>Number</item-type> - <label>EB102-EP14 Alarm number</label> + <label>EB102-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -2708,42 +2708,42 @@ </channel-type> <channel-type id="f1x45-44034" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT3 Return temp.</label> + <label>EB101-EP15-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44035" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT10 Brine in temp</label> + <label>EB101-EP15-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44036" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT11 Brine out temp</label> + <label>EB101-EP15-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44037" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT12 Cond. out</label> + <label>EB101-EP15-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44038" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT14 Hot gas temp</label> + <label>EB101-EP15-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44039" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT15 Liquid line</label> + <label>EB101-EP15-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2757,14 +2757,14 @@ </channel-type> <channel-type id="f1x45-44041" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BT29 Compr. Oil. temp.</label> + <label>EB101-EP15-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44042" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15-BP8 Pressure transmitter</label> + <label>EB101-EP15-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2778,98 +2778,98 @@ </channel-type> <channel-type id="f1x45-44044" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Compr. time to start</label> + <label>EB101-EP15 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44045" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Relay status</label> + <label>EB101-EP15 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44046" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Heat med. pump status</label> + <label>EB101-EP15 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44047" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Brine pump status</label> + <label>EB101-EP15 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44048" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Compressor starts</label> + <label>EB101-EP15 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44050" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Tot. op.time compr</label> + <label>EB101-EP15 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44052" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Tot. HW op.time compr</label> + <label>EB101-EP15 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44054" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP15 Alarm number</label> + <label>EB101-EP15 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44055" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT3 Return temp.</label> + <label>EB101-EP14-BT3 Return Temp.</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44056" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT10 Brine in temp</label> + <label>EB101-EP14-BT10 Brine in Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44057" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT11 Brine out temp</label> + <label>EB101-EP14-BT11 Brine out Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44058" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT12 Cond. out</label> + <label>EB101-EP14-BT12 Cond. Out</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44059" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT14 Hot gas temp</label> + <label>EB101-EP14-BT14 Hot Gas Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44060" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT15 Liquid line</label> + <label>EB101-EP14-BT15 Liquid Line</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2883,14 +2883,14 @@ </channel-type> <channel-type id="f1x45-44062" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BT29 Compr. Oil. temp.</label> + <label>EB101-EP14-BT29 Compr. Oil. Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44063" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14-BP8 Pressure transmitter</label> + <label>EB101-EP14-BP8 Pressure Transmitter</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2904,56 +2904,56 @@ </channel-type> <channel-type id="f1x45-44065" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Compr. time to start</label> + <label>EB101-EP14 Compr. Time to Start</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44066" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Relay status</label> + <label>EB101-EP14 Relay Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44067" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Heat med. pump status</label> + <label>EB101-EP14 Heat Med. Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44068" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Brine pump status</label> + <label>EB101-EP14 Brine Pump Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44069" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Compressor starts</label> + <label>EB101-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44071" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Tot. op.time compr</label> + <label>EB101-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44073" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Tot. HW op.time compr</label> + <label>EB101-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44075" advanced="true"> <item-type>Number</item-type> - <label>EB101-EP14 Alarm number</label> + <label>EB101-EP14 Alarm Number</label> <description>The value indicates the most severe current alarm</description> <state pattern="%d" readOnly="true"> </state> @@ -3254,42 +3254,42 @@ </channel-type> <channel-type id="f1x45-44277" advanced="true"> <item-type>Number</item-type> - <label>State ACS heatdump</label> + <label>State ACS Heatdump</label> <description>The state of the heatdump in the ACS accessory</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44278" advanced="true"> <item-type>Number</item-type> - <label>State ACS cooldump</label> + <label>State ACS Cooldump</label> <description>The state of the cooldump in the ACS accessory</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44282" advanced="true"> <item-type>Number</item-type> - <label>Used cprs. HW</label> + <label>Used Cprs. HW</label> <description>The number of compressors that's currently producing hot water</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44283" advanced="true"> <item-type>Number</item-type> - <label>Used cprs. heat</label> + <label>Used Cprs. Heat</label> <description>The number of compressors that's currently producing heating</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44284" advanced="true"> <item-type>Number</item-type> - <label>Used cprs. pool 1</label> + <label>Used Cprs. Pool 1</label> <description>The number of compressors that's currently producing poolheating for pool 1</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44285" advanced="true"> <item-type>Number</item-type> - <label>Used cprs. pool 2</label> + <label>Used Cprs. Pool 2</label> <description>The number of compressors that's currently producing poolheating for pool 2</description> <state pattern="%d" readOnly="true"> </state> @@ -3338,14 +3338,14 @@ </channel-type> <channel-type id="f1x45-44320" advanced="true"> <item-type>Number</item-type> - <label>Used cprs. cool</label> + <label>Used Cprs. Cool</label> <description>The number of compressors that's currently producing active cooling</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44331" advanced="true"> <item-type>Number</item-type> - <label>Software release</label> + <label>Software Release</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -3366,21 +3366,21 @@ </channel-type> <channel-type id="f1x45-44411" advanced="true"> <item-type>Number</item-type> - <label>EB108-BT6 Hot water load temp.</label> + <label>EB108-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44412" advanced="true"> <item-type>Number</item-type> - <label>EB108-BT7 Hot water top temp.</label> + <label>EB108-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44413" advanced="true"> <item-type>Number</item-type> - <label>EB108-BT2 Supply temp.</label> + <label>EB108-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3394,21 +3394,21 @@ </channel-type> <channel-type id="f1x45-44417" advanced="true"> <item-type>Number</item-type> - <label>EB107-BT6 Hot water load temp.</label> + <label>EB107-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44418" advanced="true"> <item-type>Number</item-type> - <label>EB107-BT7 Hot water top temp.</label> + <label>EB107-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44419" advanced="true"> <item-type>Number</item-type> - <label>EB107-BT2 Supply temp.</label> + <label>EB107-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3422,21 +3422,21 @@ </channel-type> <channel-type id="f1x45-44423" advanced="true"> <item-type>Number</item-type> - <label>EB106-BT6 Hot water load temp.</label> + <label>EB106-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44424" advanced="true"> <item-type>Number</item-type> - <label>EB106-BT7 Hot water top temp.</label> + <label>EB106-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44425" advanced="true"> <item-type>Number</item-type> - <label>EB106-BT2 Supply temp.</label> + <label>EB106-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3450,21 +3450,21 @@ </channel-type> <channel-type id="f1x45-44429" advanced="true"> <item-type>Number</item-type> - <label>EB105-BT6 Hot water load temp.</label> + <label>EB105-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44430" advanced="true"> <item-type>Number</item-type> - <label>EB105-BT7 Hot water top temp.</label> + <label>EB105-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44431" advanced="true"> <item-type>Number</item-type> - <label>EB105-BT2 Supply temp.</label> + <label>EB105-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3478,21 +3478,21 @@ </channel-type> <channel-type id="f1x45-44435" advanced="true"> <item-type>Number</item-type> - <label>EB104-BT6 Hot water load temp.</label> + <label>EB104-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44436" advanced="true"> <item-type>Number</item-type> - <label>EB104-BT7 Hot water top temp.</label> + <label>EB104-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44437" advanced="true"> <item-type>Number</item-type> - <label>EB104-BT2 Supply temp.</label> + <label>EB104-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3506,21 +3506,21 @@ </channel-type> <channel-type id="f1x45-44441" advanced="true"> <item-type>Number</item-type> - <label>EB103-BT6 Hot water load temp.</label> + <label>EB103-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44442" advanced="true"> <item-type>Number</item-type> - <label>EB103-BT7 Hot water top temp.</label> + <label>EB103-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44443" advanced="true"> <item-type>Number</item-type> - <label>EB103-BT2 Supply temp.</label> + <label>EB103-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3534,21 +3534,21 @@ </channel-type> <channel-type id="f1x45-44447" advanced="true"> <item-type>Number</item-type> - <label>EB102-BT6 Hot water load temp.</label> + <label>EB102-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44448" advanced="true"> <item-type>Number</item-type> - <label>EB102-BT7 Hot water top temp.</label> + <label>EB102-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44449" advanced="true"> <item-type>Number</item-type> - <label>EB102-BT2 Supply temp.</label> + <label>EB102-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3562,21 +3562,21 @@ </channel-type> <channel-type id="f1x45-44453" advanced="true"> <item-type>Number</item-type> - <label>EB101-BT6 Hot water load temp.</label> + <label>EB101-BT6 Hot Water Load Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44454" advanced="true"> <item-type>Number</item-type> - <label>EB101-BT7 Hot water top temp.</label> + <label>EB101-BT7 Hot Water Top Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44455" advanced="true"> <item-type>Number</item-type> - <label>EB101-BT2 Supply temp.</label> + <label>EB101-BT2 Supply Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -3590,56 +3590,56 @@ </channel-type> <channel-type id="f1x45-44744" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S4</label> + <label>Extra Heating System Pump S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44745" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S3</label> + <label>Extra Heating System Pump S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44746" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S2</label> + <label>Extra Heating System Pump S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44748" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 pump</label> + <label>Pool 2 Pump</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44749" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 pump</label> + <label>Pool 1 Pump</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44753" advanced="true"> <item-type>Number</item-type> - <label>Passiv cool shunt</label> + <label>Passiv Cool Shunt</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44754" advanced="true"> <item-type>Number</item-type> - <label>Passiv cool pool</label> + <label>Passiv Cool Pool</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44756" advanced="true"> <item-type>Number</item-type> - <label>State ground water pump</label> + <label>State Ground Water Pump</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -3653,35 +3653,35 @@ </channel-type> <channel-type id="f1x45-44878" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input A</label> + <label>SG Ready Input A</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44879" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input B</label> + <label>SG Ready Input B</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44910" advanced="true"> <item-type>Number</item-type> - <label>Brine pump dT act.</label> + <label>Brine Pump DT Act.</label> <description>Current value between set and act value on brine pumps</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44911" advanced="true"> <item-type>Number</item-type> - <label>Brine pump dT act.</label> + <label>Brine Pump DT Act.</label> <description>set point delta T for the brine pumps</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-44912" advanced="true"> <item-type>Switch</item-type> - <label>Brine pump auto controlled</label> + <label>Brine Pump Auto Controlled</label> <description>Brine pump auto controlled</description> <state readOnly="true"></state> </channel-type> @@ -3694,42 +3694,42 @@ </channel-type> <channel-type id="f1x45-47291" advanced="true"> <item-type>Number</item-type> - <label>Floor drying timer</label> + <label>Floor Drying Timer</label> <description></description> <state pattern="%d hrs" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-47325" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. max. step</label> + <label>Step Controlled Add. Max. Step</label> <description>Maximum number of steps allowed in step controlled add.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x45-47004" advanced="true"> <item-type>Number</item-type> - <label>Heat curve S4</label> + <label>Heat Curve S4</label> <description>Heat curve to use see manual for the different curves.</description> <state min="0" max="15" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47005" advanced="true"> <item-type>Number</item-type> - <label>Heat curve S3</label> + <label>Heat Curve S3</label> <description>Heat curve to use see manual for the different curves.</description> <state min="0" max="15" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47006" advanced="true"> <item-type>Number</item-type> - <label>Heat curve S2</label> + <label>Heat Curve S2</label> <description>Heat curve to use see manual for the different curves.</description> <state min="0" max="15" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47007" advanced="true"> <item-type>Number</item-type> - <label>Heat curve S1</label> + <label>Heat Curve S1</label> <description>Heat curve to use see manual for the different curves.</description> <state min="0" max="15" step="1" pattern="%d" readOnly="false"> </state> @@ -3869,77 +3869,77 @@ </channel-type> <channel-type id="f1x45-47027" advanced="true"> <item-type>Number</item-type> - <label>Point offset outdoor temp.</label> + <label>Point Offset Outdoor Temp.</label> <description>Outdoor temperature point where the heat curve is offset</description> <state min="-40" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47028" advanced="true"> <item-type>Number</item-type> - <label>Point offset</label> + <label>Point Offset</label> <description>Amount of offset at the point offset temperature</description> <state min="-10" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47029" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S4</label> + <label>External Adjustment S4</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47030" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S3</label> + <label>External Adjustment S3</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47031" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S2</label> + <label>External Adjustment S2</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47032" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S1</label> + <label>External Adjustment S1</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47033" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S4</label> + <label>External Adjustment with Room Sensor S4</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47034" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S3</label> + <label>External Adjustment with Room Sensor S3</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47035" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S2</label> + <label>External Adjustment with Room Sensor S2</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47036" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S1</label> + <label>External Adjustment with Room Sensor S1</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47041" advanced="true"> <item-type>String</item-type> - <label>Hot water mode</label> + <label>Hot Water Mode</label> <description> 0=Economy 1=Normal 2=Luxury</description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -3951,49 +3951,49 @@ </channel-type> <channel-type id="f1x45-47043" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Luxury</label> + <label>Start Temperature HW Luxury</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47044" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Normal</label> + <label>Start Temperature HW Normal</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47045" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Economy</label> + <label>Start Temperature HW Economy</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47046" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature Periodic HW</label> + <label>Stop Temperature Periodic HW</label> <description>Temperature where hot water generation will stop</description> <state min="550" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47047" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Luxury</label> + <label>Stop Temperature HW Luxury</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47048" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Normal</label> + <label>Stop Temperature HW Normal</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47049" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Economy</label> + <label>Stop Temperature HW Economy</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> @@ -4013,14 +4013,14 @@ </channel-type> <channel-type id="f1x45-47054" advanced="true"> <item-type>Number</item-type> - <label>Run time HWC</label> + <label>Run Time HWC</label> <description>Run time for the hot water circulation system</description> <state min="1" max="60" step="1" pattern="%d min" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47055" advanced="true"> <item-type>Number</item-type> - <label>Still time HWC</label> + <label>Still Time HWC</label> <description>Still time for the hot water circulation system</description> <state min="0" max="60" step="1" pattern="%d min" readOnly="false"> </state> @@ -4072,7 +4072,7 @@ </channel-type> <channel-type id="f1x45-47138" advanced="true"> <item-type>String</item-type> - <label>Operational mode heat medium pump</label> + <label>Operational Mode Heat Medium Pump</label> <description> 10=Intermittent 20=Continous 30=Economy 40=Auto</description> <state min="10" max="40" step="1" pattern="%d" readOnly="false"> <options> @@ -4085,7 +4085,7 @@ </channel-type> <channel-type id="f1x45-47139" advanced="true"> <item-type>String</item-type> - <label>Operational mode brine medium pump</label> + <label>Operational Mode Brine Medium Pump</label> <description> 10=Intermittent 20=Continuous 30=Economy 40=Auto</description> <state min="10" max="30" step="1" pattern="%d" readOnly="false"> <options> @@ -4098,42 +4098,42 @@ </channel-type> <channel-type id="f1x45-47206" advanced="true"> <item-type>Number</item-type> - <label>DM start heating</label> + <label>DM Start Heating</label> <description>The value the degree minutes needed to be reached for the pump to start heating</description> <state min="-1000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47207" advanced="true"> <item-type>Number</item-type> - <label>DM start cooling</label> + <label>DM Start Cooling</label> <description>The value the degree minutes needed to be reached for the pump to start cooling</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47208" advanced="true"> <item-type>Number</item-type> - <label>DM start add.</label> + <label>DM Start Add.</label> <description>The value the degree minutes needed to be reached for the pump to start electric addition</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47209" advanced="true"> <item-type>Number</item-type> - <label>DM between add. steps</label> + <label>DM Between Add. Steps</label> <description>The number of degree minutes between start of each electric addition step</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47210" advanced="true"> <item-type>Number</item-type> - <label>DM start add. with shunt</label> + <label>DM Start Add. with Shunt</label> <description></description> <state min="-2000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47212" advanced="true"> <item-type>Number</item-type> - <label>Max int add. power</label> + <label>Max Int Add. Power</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f kW" readOnly="false"> </state> @@ -4147,373 +4147,373 @@ </channel-type> <channel-type id="f1x45-47261" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 4</label> + <label>Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47262" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 3</label> + <label>Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47263" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 2</label> + <label>Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47264" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 1</label> + <label>Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47265" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed normal</label> + <label>Exhaust Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47271" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 4</label> + <label>Fan Return Time 4</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47272" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 3</label> + <label>Fan Return Time 3</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47273" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 2</label> + <label>Fan Return Time 2</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47274" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 1</label> + <label>Fan Return Time 1</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47275" advanced="true"> <item-type>Number</item-type> - <label>Filter Reminder period</label> + <label>Filter Reminder Period</label> <description>Time between the reminder of filter replacement/cleaning.</description> <state min="1" max="24" step="1" pattern="%d Months" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47276" advanced="true"> <item-type>Switch</item-type> - <label>Floor drying</label> + <label>Floor Drying</label> <description> 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47277" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 7</label> + <label>Floor Drying Period 7</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47278" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 6</label> + <label>Floor Drying Period 6</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47279" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 5</label> + <label>Floor Drying Period 5</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47280" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 4</label> + <label>Floor Drying Period 4</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47281" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 3</label> + <label>Floor Drying Period 3</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47282" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 2</label> + <label>Floor Drying Period 2</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47283" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 1</label> + <label>Floor Drying Period 1</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47284" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 7</label> + <label>Floor Drying Temp. 7</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47285" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 6</label> + <label>Floor Drying Temp. 6</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47286" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 5</label> + <label>Floor Drying Temp. 5</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47287" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 4</label> + <label>Floor Drying Temp. 4</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47288" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 3</label> + <label>Floor Drying Temp. 3</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47289" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 2</label> + <label>Floor Drying Temp. 2</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47290" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 1</label> + <label>Floor Drying Temp. 1</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47302" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 2 accessory</label> + <label>Climate System 2 Accessory</label> <description>Activates the climate system 2 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47303" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 3 accessory</label> + <label>Climate System 3 Accessory</label> <description>Activates the climate system 3 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47304" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 4 accessory</label> + <label>Climate System 4 Accessory</label> <description>Activates the climate system 4 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47305" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 mixing valve amp.</label> + <label>Climate System 4 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47306" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 mixing valve amp.</label> + <label>Climate System 3 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47307" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 mixing valve amp.</label> + <label>Climate System 2 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47308" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 shunt wait</label> + <label>Climate System 4 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47309" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 shunt wait</label> + <label>Climate System 3 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47310" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 shunt wait</label> + <label>Climate System 2 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47312" advanced="true"> <item-type>Switch</item-type> - <label>FLM pump</label> + <label>FLM Pump</label> <description>Operating mode for the FLM pump 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47313" advanced="true"> <item-type>Number</item-type> - <label>FLM defrost</label> + <label>FLM Defrost</label> <description>Minimum time between defrost in FLM</description> <state min="1" max="30" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47317" advanced="true"> <item-type>Switch</item-type> - <label>Shunt controlled add. accessory</label> + <label>Shunt Controlled Add. Accessory</label> <description>Activates the shunt controlled addition accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47318" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. temp.</label> + <label>Shunt Controlled Add. Min. Temp.</label> <description></description> <state min="5" max="90" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47319" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. runtime</label> + <label>Shunt Controlled Add. Min. Runtime</label> <description></description> <state min="0" max="48" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47320" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve amp.</label> + <label>Shunt Controlled Add. Mixing Valve Amp.</label> <description>Mixing valve amplification for shunt controlled add.</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47321" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve wait</label> + <label>Shunt Controlled Add. Mixing Valve Wait</label> <description>Wait time between changes of the shunt in shunt controlled add.</description> <state min="10" max="300" step="1" pattern="%d secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47322" advanced="true"> <item-type>Switch</item-type> - <label>Step controlled add. accessory</label> + <label>Step Controlled Add. Accessory</label> <description>Activates the step controlled addition accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47323" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. start DM</label> + <label>Step Controlled Add. Start DM</label> <description>DM where the first step of step controlled add. starts</description> <state min="-2000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47324" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. diff. DM</label> + <label>Step Controlled Add. Diff. DM</label> <description>Difference in DM of each step in the step controlled add.</description> <state min="0" max="1000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47326" advanced="true"> <item-type>Switch</item-type> - <label>Step controlled add. mode</label> + <label>Step Controlled Add. Mode</label> <description>Binary or linear stepping method. 0=Linear 1=Binary</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47327" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump accessory</label> + <label>Ground Water Pump Accessory</label> <description>Ground water pump using AXC40 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47329" advanced="true"> <item-type>Switch</item-type> - <label>Cooling 2-pipe accessory</label> + <label>Cooling 2-pipe Accessory</label> <description>Activates the 2-pipe cooling accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47330" advanced="true"> <item-type>Switch</item-type> - <label>Cooling 4-pipe accessory</label> + <label>Cooling 4-pipe Accessory</label> <description>Activates the 4-pipe cooling accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47335" advanced="true"> <item-type>Number</item-type> - <label>Time betw. switch heat/cool</label> + <label>Time Betw. Switch Heat/cool</label> <description>Time between switching from heating to cooling or vice versa.</description> <state min="0" max="48" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47336" advanced="true"> <item-type>Number</item-type> - <label>Heat at room under temp.</label> + <label>Heat At Room Under Temp.</label> <description>This value indicates how many degrees under set room temp heating will be allowed</description> <state min="5" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47337" advanced="true"> <item-type>Number</item-type> - <label>Cool at room over temp.</label> + <label>Cool At Room over Temp.</label> <description>This value indicates how many degrees over set room temp cooling will be allowed</description> <state min="5" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47338" advanced="true"> <item-type>Number</item-type> - <label>Cooling mix. valve amp.</label> + <label>Cooling Mix. Valve Amp.</label> <description>Mixing valve amplification for the cooling valve</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47339" advanced="true"> <item-type>Number</item-type> - <label>Cooling mix. valve step delay</label> + <label>Cooling Mix. Valve Step Delay</label> <description></description> <state min="10" max="300" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47340" advanced="true"> <item-type>Switch</item-type> - <label>Cooling with room sensor</label> + <label>Cooling with Room Sensor</label> <description>Enables use of room sensor together with cooling 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47341" advanced="true"> <item-type>Switch</item-type> - <label>HPAC accessory</label> + <label>HPAC Accessory</label> <description>Activates the HPAC accessory</description> <state readOnly="false"></state> </channel-type> @@ -4533,7 +4533,7 @@ </channel-type> <channel-type id="f1x45-47352" advanced="true"> <item-type>Switch</item-type> - <label>SMS40 accessory</label> + <label>SMS40 Accessory</label> <description>Activates the SMS40 accessory</description> <state readOnly="false"></state> </channel-type> @@ -4581,47 +4581,47 @@ </channel-type> <channel-type id="f1x45-47378" advanced="true"> <item-type>Number</item-type> - <label>Max diff. comp.</label> + <label>Max Diff. Comp.</label> <description></description> <state min="10" max="250" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47379" advanced="true"> <item-type>Number</item-type> - <label>Max diff. add.</label> + <label>Max Diff. Add.</label> <description></description> <state min="10" max="240" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47380" advanced="true"> <item-type>Switch</item-type> - <label>Low brine out autoreset</label> + <label>Low Brine out Autoreset</label> <description> 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47381"> <item-type>Number</item-type> - <label>Low brine out temp.</label> + <label>Low Brine out Temp.</label> <description></description> <state min="-120" max="150" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47382" advanced="true"> <item-type>Switch</item-type> - <label>High brine in</label> + <label>High Brine In</label> <description>Activates the High brine in temperature alarm. 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47383" advanced="true"> <item-type>Number</item-type> - <label>High brine in temp.</label> + <label>High Brine in Temp.</label> <description>The brine in temperature that triggers the high brine in temperature alarm (if active).</description> <state min="100" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47384" advanced="true"> <item-type>String</item-type> - <label>Date format</label> + <label>Date Format</label> <description> 1=DD-MM-YY 2=YY-MM-DD</description> <state min="1" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -4632,7 +4632,7 @@ </channel-type> <channel-type id="f1x45-47385" advanced="true"> <item-type>String</item-type> - <label>Time format</label> + <label>Time Format</label> <description> 12=12 hours 24=24 Hours</description> <state min="12" max="24" step="1" pattern="%d" readOnly="false"> <options> @@ -4643,181 +4643,181 @@ </channel-type> <channel-type id="f1x45-47387" advanced="true"> <item-type>Switch</item-type> - <label>HW production</label> + <label>HW Production</label> <description>Activates hot water production where applicable 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47388" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower room temp.</label> + <label>Alarm Lower Room Temp.</label> <description>Lowers the room temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47389" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower HW temp.</label> + <label>Alarm Lower HW Temp.</label> <description>Lowers the hot water temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47391" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S4</label> + <label>Use Room Sensor S4</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47392" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S3</label> + <label>Use Room Sensor S3</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47393" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S2</label> + <label>Use Room Sensor S2</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47394" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47395" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S4</label> + <label>Room Sensor Setpoint S4</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47396" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S3</label> + <label>Room Sensor Setpoint S3</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47397" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S2</label> + <label>Room Sensor Setpoint S2</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47398" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S1</label> + <label>Room Sensor Setpoint S1</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47399" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S4</label> + <label>Room Sensor Factor S4</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47400" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S3</label> + <label>Room Sensor Factor S3</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47401" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S2</label> + <label>Room Sensor Factor S2</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47402" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47413" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump HW</label> + <label>Speed Circ.pump HW</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47414" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Heat</label> + <label>Speed Circ.pump Heat</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47415" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Pool</label> + <label>Speed Circ.pump Pool</label> <description></description> <state min="70" max="70" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47416" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Economy</label> + <label>Speed Circ.pump Economy</label> <description></description> <state min="0" max="255" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47417" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Cooling</label> + <label>Speed Circ.pump Cooling</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47418"> <item-type>Number</item-type> - <label>Speed brine pump</label> + <label>Speed Brine Pump</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47537" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-47538" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47539" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47540" advanced="true"> <item-type>Number</item-type> - <label>Heat DM diff</label> + <label>Heat DM Diff</label> <description>Difference in DM between compressor starts in heating mode</description> <state min="10" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47543" advanced="true"> <item-type>Number</item-type> - <label>Cooling DM diff</label> + <label>Cooling DM Diff</label> <description>Difference in DM between compressor starts in cooling mode</description> <state min="10" max="150" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-47570" advanced="true"> <item-type>String</item-type> - <label>Operational mode</label> + <label>Operational Mode</label> <description>The operational mode of the heat pump 0=Auto 1=Manual 2=Add. heat only</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> <options> @@ -4829,189 +4829,189 @@ </channel-type> <channel-type id="f1x45-48053" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 4</label> + <label>FLM 2 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48054" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 3</label> + <label>FLM 2 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48055" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 2</label> + <label>FLM 2 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48056" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 1</label> + <label>FLM 2 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48057" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed normal</label> + <label>FLM 2 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48058" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 4</label> + <label>FLM 3 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48059" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 3</label> + <label>FLM 3 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48060" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 2</label> + <label>FLM 3 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48061" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 1</label> + <label>FLM 3 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48062" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed normal</label> + <label>FLM 3 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48063" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 4</label> + <label>FLM 4 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48064" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 3</label> + <label>FLM 4 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48065" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 2</label> + <label>FLM 4 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48066" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 1</label> + <label>FLM 4 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48067" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed normal</label> + <label>FLM 4 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48068" advanced="true"> <item-type>Switch</item-type> - <label>FLM 4 accessory</label> + <label>FLM 4 Accessory</label> <description>Activates the FLM 4 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48069" advanced="true"> <item-type>Switch</item-type> - <label>FLM 3 accessory</label> + <label>FLM 3 Accessory</label> <description>Activates the FLM 3 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48070" advanced="true"> <item-type>Switch</item-type> - <label>FLM 2 accessory</label> + <label>FLM 2 Accessory</label> <description>Activates the FLM 2 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48071" advanced="true"> <item-type>Switch</item-type> - <label>FLM 1 accessory</label> + <label>FLM 1 Accessory</label> <description>Activates the FLM 1 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48072" advanced="true"> <item-type>Number</item-type> - <label>DM diff start add.</label> + <label>DM Diff Start Add.</label> <description>The value below the last compressor step the degree minutes needed to be reached for the pump to start electric addition</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48073" advanced="true"> <item-type>Switch</item-type> - <label>FLM cooling</label> + <label>FLM Cooling</label> <description>FLM cooling activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48074" advanced="true"> <item-type>Number</item-type> - <label>Set point for BT74</label> + <label>Set Point for BT74</label> <description>Set point for change between cooling and heating when using BT74</description> <state min="50" max="400" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48087" advanced="true"> <item-type>Switch</item-type> - <label>Pool 2 accessory</label> + <label>Pool 2 Accessory</label> <description>Activate the pool 2 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48088" advanced="true"> <item-type>Switch</item-type> - <label>Pool 1 accessory</label> + <label>Pool 1 Accessory</label> <description>Activates the pool 1 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48089" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 start temp.</label> + <label>Pool 2 Start Temp.</label> <description>The Temperature below which the pool heating should start</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48090" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 start temp.</label> + <label>Pool 1 Start Temp.</label> <description>The Temperature below which the pool heating should start</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48091" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 stop temp.</label> + <label>Pool 2 Stop Temp.</label> <description>The Temperature at which the pool heating will stop</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48092" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 stop temp.</label> + <label>Pool 1 Stop Temp.</label> <description>The Temperature at which the pool heating will stop</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> @@ -5037,245 +5037,245 @@ </channel-type> <channel-type id="f1x45-48174" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S4</label> + <label>Min Cooling Supply Temp S4</label> <description>Minimum allowed supply temperature during cooling</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48175" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S3</label> + <label>Min Cooling Supply Temp S3</label> <description>Minimum allowed supply temperature during cooling</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48176" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S2</label> + <label>Min Cooling Supply Temp S2</label> <description>Minimum allowed supply temperature during cooling</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48177" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S1</label> + <label>Min Cooling Supply Temp S1</label> <description>Minimum allowed supply temperature during cooling</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48178" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 20°C</label> + <label>Cooling Supply Temp. At 20°C</label> <description>Supply Temperature at 20°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48179" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 20°C</label> + <label>Cooling Supply Temp. At 20°C</label> <description>Supply Temperature at 20°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48180" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 20°C</label> + <label>Cooling Supply Temp. At 20°C</label> <description>Supply Temperature at 20°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48181" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 20°C</label> + <label>Cooling Supply Temp. At 20°C</label> <description>Supply Temperature at 20°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48182" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 40°C</label> + <label>Cooling Supply Temp. At 40°C</label> <description>Supply Temperature at 40°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48183" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 40°C</label> + <label>Cooling Supply Temp. At 40°C</label> <description>Supply Temperature at 40°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48184" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 40°C</label> + <label>Cooling Supply Temp. At 40°C</label> <description>Supply Temperature at 40°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48185" advanced="true"> <item-type>Number</item-type> - <label>Cooling supply temp. at 40°C</label> + <label>Cooling Supply Temp. At 40°C</label> <description>Supply Temperature at 40°C. Used to create cooling curve</description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48186" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valves</label> + <label>Cooling Use Mix. Valves</label> <description>Close use valves during cooling mode</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48187" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valves</label> + <label>Cooling Use Mix. Valves</label> <description>Close use valves during cooling mode</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48188" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valves</label> + <label>Cooling Use Mix. Valves</label> <description>Close use valves during cooling mode</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48189" advanced="true"> <item-type>Number</item-type> - <label>Cooling use mix. valves</label> + <label>Cooling Use Mix. Valves</label> <description>Close use valves during cooling mode</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48190" advanced="true"> <item-type>Number</item-type> - <label>Heatdump mix. valve delay</label> + <label>Heatdump Mix. Valve Delay</label> <description>Mixing valve step delay for the heatdump valve</description> <state min="10" max="500" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48191" advanced="true"> <item-type>Number</item-type> - <label>Heatdump mix. valve amp.</label> + <label>Heatdump Mix. Valve Amp.</label> <description>Mixing valve amplification for the heatdump valve</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48192" advanced="true"> <item-type>Number</item-type> - <label>Cooldump mix. valve delay</label> + <label>Cooldump Mix. Valve Delay</label> <description>Mixing valve step delay for the cooldump valve for the ACS-system</description> <state min="10" max="500" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48193" advanced="true"> <item-type>Number</item-type> - <label>Cooldump mix. valve amp.</label> + <label>Cooldump Mix. Valve Amp.</label> <description>Mixing valve amplification for the cooldump valve for the ACS-system</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48194" advanced="true"> <item-type>Switch</item-type> - <label>ACS accessory</label> + <label>ACS Accessory</label> <description>Activate the ACS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48195" advanced="true"> <item-type>Switch</item-type> - <label>ACS heat dump 24h-function</label> + <label>ACS Heat Dump 24h-function</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48196" advanced="true"> <item-type>Switch</item-type> - <label>ACS run brinepump in wait mode</label> + <label>ACS Run Brinepump in Wait Mode</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48197" advanced="true"> <item-type>Number</item-type> - <label>ACS closingtime for cool dump</label> + <label>ACS Closingtime for Cool Dump</label> <description></description> <state min="0" max="100" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48226" advanced="true"> <item-type>Number</item-type> - <label>Max charge pump reg speed</label> + <label>Max Charge Pump Reg Speed</label> <description>Max charge pump reg speed</description> <state min="80" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48282" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready heating</label> + <label>SG Ready Heating</label> <description>Sets whether or not SG Ready should affect heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48283" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready cooling</label> + <label>SG Ready Cooling</label> <description>Sets whether or not SG Ready should affect cooling</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48284" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready hot water</label> + <label>SG Ready Hot Water</label> <description>Sets whether or not SG Ready should affect hot water</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48285" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready pool</label> + <label>SG Ready Pool</label> <description>Sets whether or not SG Ready should affect pool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48452" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, hw</label> + <label>Auto Heat Medium Pump Speed, Hw</label> <description>Auto heat medium pump speed hw</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48453" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, heat</label> + <label>Auto Heat Medium Pump Speed, Heat</label> <description>Auto heat medium pump speed heat</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48454" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, pool</label> + <label>Auto Heat Medium Pump Speed, Pool</label> <description>Auto heat medium pump speed pool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48455" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, cool</label> + <label>Auto Heat Medium Pump Speed, Cool</label> <description>Auto heat medium pump speed cool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x45-48456" advanced="true"> <item-type>Number</item-type> - <label>Operational mode heat medium pump, cooling</label> + <label>Operational Mode Heat Medium Pump, Cooling</label> <description></description> <state min="10" max="20" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48458" advanced="true"> <item-type>Number</item-type> - <label>Max speed circ.pump Heat</label> + <label>Max Speed Circ.pump Heat</label> <description></description> <state min="50" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48459" advanced="true"> <item-type>Number</item-type> - <label>Speed brine pump cooling</label> + <label>Speed Brine Pump Cooling</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x45-48487" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Cooling</label> + <label>Speed Circ.pump Cooling</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45.xml index c71204762df9b..bb14023e3308b 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x45.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="f1x45-udp"> - <label>UDP connected Nibe F1145 and F1245 Heat Pumps</label> + <label>UDP Connected Nibe F1145 and F1245 Heat Pumps</label> <description></description> <channel-groups> @@ -24,12 +24,12 @@ <default>9999</default> </parameter> <parameter name="readCommandsPort" type="integer"> - <label>UDP Port For Read Commands</label> + <label>UDP Port for Read Commands</label> <description>UDP port to send read commands to the NibeGW.</description> <default>9999</default> </parameter> <parameter name="writeCommandsPort" type="integer"> - <label>UDP Port For Write Commands</label> + <label>UDP Port for Write Commands</label> <description>UDP port to send write commands to the NibeGW.</description> <default>10000</default> </parameter> @@ -51,7 +51,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Registers List For Write Commands</label> + <label>Registers List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> @@ -65,7 +65,7 @@ </thing-type> <thing-type id="f1x45-serial"> - <label>Serial port connected F1145 and F1245 Heat Pumps</label> + <label>Serial Port Connected F1145 and F1245 Heat Pumps</label> <description></description> <channel-groups> @@ -96,22 +96,22 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> <parameter name="sendAckToMODBUS40" type="boolean"> - <label>Enable Acknowledges To MODBUS40 Messages</label> + <label>Enable Acknowledges to MODBUS40 Messages</label> <description>Binding emulates MODBUS40 device and send protocol acknowledges to heat pump.</description> <default>true</default> </parameter> <parameter name="sendAckToRMU40" type="boolean"> - <label>Enable Acknowledges To RMU40 Messages</label> + <label>Enable Acknowledges to RMU40 Messages</label> <description>Binding emulates RMU40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> <parameter name="sendAckToSMS40" type="boolean"> - <label>Enable Acknowledges To SMS40 Messages</label> + <label>Enable Acknowledges to SMS40 Messages</label> <description>Binding emulates SMS40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> @@ -151,7 +151,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55-types.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55-types.xml index 852fad8175c90..31420fd6647cf 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55-types.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55-types.xml @@ -19,35 +19,35 @@ </channel-type> <channel-type id="f1x55-40005" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT2 Supply temp S4</label> + <label>EP23-BT2 Supply Temp S4</label> <description>Supply temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40006" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT2 Supply temp S3</label> + <label>EP22-BT2 Supply Temp S3</label> <description>Supply temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40007"> <item-type>Number</item-type> - <label>EP21-BT2 Supply temp S2</label> + <label>EP21-BT2 Supply Temp S2</label> <description>Supply temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40008"> <item-type>Number</item-type> - <label>BT2 Supply temp S1</label> + <label>BT2 Supply Temp S1</label> <description>Supply temperature for system 1</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40012"> <item-type>Number</item-type> - <label>EB100-EP14-BT3 Return temp</label> + <label>EB100-EP14-BT3 Return Temp</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -68,14 +68,14 @@ </channel-type> <channel-type id="f1x55-40015"> <item-type>Number</item-type> - <label>EB100-EP14-BT10 Brine In Temp</label> + <label>EB100-EP14-BT10 Brine in Temp</label> <description>Brine in temperature, BT10</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40016"> <item-type>Number</item-type> - <label>EB100-EP14-BT11 Brine Out Temp</label> + <label>EB100-EP14-BT11 Brine out Temp</label> <description>Brine out temperature, BT11</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -110,14 +110,14 @@ </channel-type> <channel-type id="f1x55-40025" advanced="true"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40026" advanced="true"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -201,7 +201,7 @@ </channel-type> <channel-type id="f1x55-40054" advanced="true"> <item-type>Number</item-type> - <label>EB100-FD1 Temperature limiter</label> + <label>EB100-FD1 Temperature Limiter</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -243,7 +243,7 @@ </channel-type> <channel-type id="f1x55-40075" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -278,42 +278,42 @@ </channel-type> <channel-type id="f1x55-40107" advanced="true"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 4</label> + <label>BT20 Exhaust Air Temp. 4</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40108" advanced="true"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 3</label> + <label>BT20 Exhaust Air Temp. 3</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40109" advanced="true"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 2</label> + <label>BT20 Exhaust Air Temp. 2</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40110" advanced="true"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 4</label> + <label>BT21 Vented Air Temp. 4</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40111" advanced="true"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 3</label> + <label>BT21 Vented Air Temp. 3</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40112" advanced="true"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 2</label> + <label>BT21 Vented Air Temp. 2</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -362,21 +362,21 @@ </channel-type> <channel-type id="f1x55-40127" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT3 Return temp S4</label> + <label>EP23-BT3 Return Temp S4</label> <description>Return temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40128" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT3 Return temp S3</label> + <label>EP22-BT3 Return Temp S3</label> <description>Return temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40129" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT3 Return temp S2</label> + <label>EP21-BT3 Return Temp S2</label> <description>Return temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -411,56 +411,56 @@ </channel-type> <channel-type id="f1x55-40159" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT2 Supply temp S8</label> + <label>EP47-BT2 Supply Temp S8</label> <description>Supply temperature for system 8</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40160" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT2 Supply temp S7</label> + <label>EP46-BT2 Supply Temp S7</label> <description>Supply temperature for system 7</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40161" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT2 Supply temp S6</label> + <label>EP45-BT2 Supply Temp S6</label> <description>Supply temperature for system 6</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40162" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT2 Supply temp S5</label> + <label>EP44-BT2 Supply Temp S5</label> <description>Supply temperature for system 5</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40163" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT3 Return temp S8</label> + <label>EP47-BT3 Return Temp S8</label> <description>Return temperature for system 8</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40164" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT3 Return temp S7</label> + <label>EP46-BT3 Return Temp S7</label> <description>Return temperature for system 7</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40165" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT3 Return temp S6</label> + <label>EP45-BT3 Return Temp S6</label> <description>Return temperature for system 6</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40166" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT3 Return temp S5</label> + <label>EP44-BT3 Return Temp S5</label> <description>Return temperature for system 5</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -495,7 +495,7 @@ </channel-type> <channel-type id="f1x55-40183" advanced="true"> <item-type>Number</item-type> - <label>AZ30-BT23 Outdoor temp. ERS 1</label> + <label>AZ30-BT23 Outdoor Temp. ERS 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -572,7 +572,7 @@ </channel-type> <channel-type id="f1x55-40216" advanced="true"> <item-type>Number</item-type> - <label>BT25 Ext. supply temp, cooling</label> + <label>BT25 Ext. Supply Temp, Cooling</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -663,7 +663,7 @@ </channel-type> <channel-type id="f1x55-40310" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory relays</label> + <label>External ERS 1 Accessory Relays</label> <description>Indicates the status of the relays on the ERS accessory. The information is binary encoded. b0: K1, b1: K2, b2: K3, b3: K4 </description> @@ -672,28 +672,28 @@ </channel-type> <channel-type id="f1x55-40311" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory GQ2 speed</label> + <label>External ERS 1 Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40312" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory GQ3 speed</label> + <label>External ERS 1 Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40316" advanced="true"> <item-type>Number</item-type> - <label>Inverter limit status</label> + <label>Inverter Limit Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40317" advanced="true"> <item-type>Number</item-type> - <label>Inverter drive status</label> + <label>Inverter Drive Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -714,35 +714,35 @@ </channel-type> <channel-type id="f1x55-40323" advanced="true"> <item-type>Number</item-type> - <label>Inverter alarm code</label> + <label>Inverter Alarm Code</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40324" advanced="true"> <item-type>Number</item-type> - <label>Inverter fault code</label> + <label>Inverter Fault Code</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40326" advanced="true"> <item-type>Number</item-type> - <label>Inverter drive command</label> + <label>Inverter Drive Command</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40327" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Pic version</label> + <label>NIBE Inverter Pic Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40328" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter 8051 version</label> + <label>NIBE Inverter 8051 Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -756,84 +756,84 @@ </channel-type> <channel-type id="f1x55-40330" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Mce version</label> + <label>NIBE Inverter Mce Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40331" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Hw version</label> + <label>NIBE Inverter Hw Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40332" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Hw type</label> + <label>NIBE Inverter Hw Type</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40339" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S8</label> + <label>External Adjustment Activated Via Input S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40340" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S7</label> + <label>External Adjustment Activated Via Input S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40341" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S6</label> + <label>External Adjustment Activated Via Input S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40342" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S5</label> + <label>External Adjustment Activated Via Input S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40365" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S8</label> + <label>Extra Heating System Pump S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40366" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S7</label> + <label>Extra Heating System Pump S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40367" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S6</label> + <label>Extra Heating System Pump S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40368" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S5</label> + <label>Extra Heating System Pump S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40369" advanced="true"> <item-type>Number</item-type> - <label>Extra cooling HPAC, ACS</label> + <label>Extra Cooling HPAC, ACS</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -854,7 +854,7 @@ </channel-type> <channel-type id="f1x55-40755" advanced="true"> <item-type>Number</item-type> - <label>Tot. ext. HW add op.time</label> + <label>Tot. Ext. HW Add Op.time</label> <description>Total external hw-electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> @@ -868,42 +868,42 @@ </channel-type> <channel-type id="f1x55-40792" advanced="true"> <item-type>Number</item-type> - <label>OPT state</label> + <label>OPT State</label> <description>Indicates the state of the boiler connected through the OPT accessory.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40793" advanced="true"> <item-type>Number</item-type> - <label>OPT version</label> + <label>OPT Version</label> <description>Version of the OPT PCBA software</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40801" advanced="true"> <item-type>Number</item-type> - <label>OPT rel. modulation level</label> + <label>OPT Rel. Modulation Level</label> <description>OPT relative modulation level</description> <state pattern="%.1f %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40802" advanced="true"> <item-type>Number</item-type> - <label>OPT boiler temperature</label> + <label>OPT Boiler Temperature</label> <description>OPT boiler temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40806" advanced="true"> <item-type>Number</item-type> - <label>OPT boiler op. time</label> + <label>OPT Boiler Op. Time</label> <description>OPT boiler operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40813" advanced="true"> <item-type>Number</item-type> - <label>Compressor slow down reason</label> + <label>Compressor Slow Down Reason</label> <description>Bitmap telling the reason to why the compressor slows down. b0:inverter b1:brine b2:current b3:high cond b4:hot gas b5:evaporator </description> @@ -919,7 +919,7 @@ </channel-type> <channel-type id="f1x55-40856" advanced="true"> <item-type>Number</item-type> - <label>BM1 BT50 Room temp.</label> + <label>BM1 BT50 Room Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -947,21 +947,21 @@ </channel-type> <channel-type id="f1x55-40870" advanced="true"> <item-type>Number</item-type> - <label>+Adjust OP mode</label> + <label>+Adjust OP Mode</label> <description>Tells if plusadjust system calls for heat or cool</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40871" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Comfort mode</label> + <label>+Adjust Comfort Mode</label> <description>Which comfort mode</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40872" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell adjustment</label> + <label>+Adjust Parallell Adjustment</label> <description>requested adjustment</description> <state pattern="%d" readOnly="true"> </state> @@ -975,14 +975,14 @@ </channel-type> <channel-type id="f1x55-40874" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp indoor</label> + <label>+Adjust Temp Indoor</label> <description>Average of all room sensors</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40875" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp outdoor</label> + <label>+Adjust Temp Outdoor</label> <description>Outdoor temp</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1041,21 +1041,21 @@ </channel-type> <channel-type id="f1x55-40940" advanced="true"> <item-type>Number</item-type> - <label>Degree Minutes (32 bit)</label> + <label>Degree Minutes (32 Bit)</label> <description>Degree minutes, 32bit value. Full resolution.</description> <state min="-30000" max="30000" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-40942" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory block status</label> + <label>External ERS 1 Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40943" advanced="true"> <item-type>String</item-type> - <label>External ERS 1 accessory EB17</label> + <label>External ERS 1 Accessory EB17</label> <description>Indicates if the status of ERS accessory EB17. I = closed, 0 = open.</description> <state pattern="%d" readOnly="true"> <options> @@ -1065,14 +1065,14 @@ </channel-type> <channel-type id="f1x55-40993" advanced="true"> <item-type>Number</item-type> - <label>Inverter min speed</label> + <label>Inverter Min Speed</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-40994" advanced="true"> <item-type>Number</item-type> - <label>Inverter max speed</label> + <label>Inverter Max Speed</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1093,14 +1093,14 @@ </channel-type> <channel-type id="f1x55-41027" advanced="true"> <item-type>Number</item-type> - <label>Humidity average</label> + <label>Humidity Average</label> <description>Humidity average</description> <state pattern="%.1f %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41186" advanced="true"> <item-type>Number</item-type> - <label>Set point OPT boiler</label> + <label>Set Point OPT Boiler</label> <description>Set point OPT boiler</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -1128,49 +1128,49 @@ </channel-type> <channel-type id="f1x55-41210" advanced="true"> <item-type>Number</item-type> - <label>AZ4-BT50 Room temp</label> + <label>AZ4-BT50 Room Temp</label> <description>AZ4-BT50 Room temp</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41211" advanced="true"> <item-type>Number</item-type> - <label>AZ3-BT50 Room temp</label> + <label>AZ3-BT50 Room Temp</label> <description>AZ3-BT50 Room temp</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41212" advanced="true"> <item-type>Number</item-type> - <label>AZ2-BT50 Room temp</label> + <label>AZ2-BT50 Room Temp</label> <description>AZ2-BT50 Room temp</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41213" advanced="true"> <item-type>Number</item-type> - <label>AZ1-BT50 Room temp</label> + <label>AZ1-BT50 Room Temp</label> <description>AZ1-BT50 Room temp</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41256" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41257" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41258" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> @@ -1189,154 +1189,154 @@ </channel-type> <channel-type id="f1x55-41266" advanced="true"> <item-type>Number</item-type> - <label>Offset to smart home system</label> + <label>Offset to Smart Home System</label> <description>Offset to smart home system</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41267" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 8</label> + <label>Smart Home Ctrl Syst 8</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41268" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 7</label> + <label>Smart Home Ctrl Syst 7</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41269" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 6</label> + <label>Smart Home Ctrl Syst 6</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41270" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 5</label> + <label>Smart Home Ctrl Syst 5</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41271" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 4</label> + <label>Smart Home Ctrl Syst 4</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41272" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 3</label> + <label>Smart Home Ctrl Syst 3</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41273" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 2</label> + <label>Smart Home Ctrl Syst 2</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41274" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 1</label> + <label>Smart Home Ctrl Syst 1</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41287" advanced="true"> <item-type>Number</item-type> - <label>OPT boiler has priority hot water</label> + <label>OPT Boiler Has Priority Hot Water</label> <description>OPT boiler has priority hot water</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41393" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 7, start DM</label> + <label>Smart Energy Source, Energy Source Prio 7, Start DM</label> <description>Energy source prio 7, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41395" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 6, start DM</label> + <label>Smart Energy Source, Energy Source Prio 6, Start DM</label> <description>Energy source prio 6, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41397" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 5, start DM</label> + <label>Smart Energy Source, Energy Source Prio 5, Start DM</label> <description>Energy source prio 5, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41399" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 4, start DM</label> + <label>Smart Energy Source, Energy Source Prio 4, Start DM</label> <description>Energy source prio 4, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41401" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 3, start DM</label> + <label>Smart Energy Source, Energy Source Prio 3, Start DM</label> <description>Energy source prio 3, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41403" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 2, start DM</label> + <label>Smart Energy Source, Energy Source Prio 2, Start DM</label> <description>Energy source prio 2, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41405" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, energy source prio 1, start DM</label> + <label>Smart Energy Source, Energy Source Prio 1, Start DM</label> <description>Energy source prio 1, start DM</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41421" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, degree minute min value</label> + <label>Smart Energy Source, Degree Minute Min Value</label> <description>Smart energy source, degree minute min value in Smart energy source system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41424" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, actual OPT10 addition price</label> + <label>Smart Energy Source, Actual OPT10 Addition Price</label> <description>Smart energy source, actual OPT10 addition price.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41425" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, actual shunt add price</label> + <label>Smart Energy Source, Actual Shunt Add Price</label> <description>Smart energy source, actual external step addition price.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41426" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, actual ext. step add price</label> + <label>Smart Energy Source, Actual Ext. Step Add Price</label> <description>Smart energy source, actual external step add price.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-41427" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, actual electricity price</label> + <label>Smart Energy Source, Actual Electricity Price</label> <description>Smart energy source, actual electricity price.</description> <state pattern="%d" readOnly="true"> </state> @@ -2036,56 +2036,56 @@ </channel-type> <channel-type id="f1x55-42101" advanced="true"> <item-type>Number</item-type> - <label>Used heating power average, 24h</label> + <label>Used Heating Power Average, 24h</label> <description>Used heating power average, 24h</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42136" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42137" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42138" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42139" advanced="true"> <item-type>Number</item-type> - <label>AZ30-BT23 Outdoor temp. ERS 4</label> + <label>AZ30-BT23 Outdoor Temp. ERS 4</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42140" advanced="true"> <item-type>Number</item-type> - <label>AZ30-BT23 Outdoor temp. ERS 3</label> + <label>AZ30-BT23 Outdoor Temp. ERS 3</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42141" advanced="true"> <item-type>Number</item-type> - <label>AZ30-BT23 Outdoor temp. ERS 2</label> + <label>AZ30-BT23 Outdoor Temp. ERS 2</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42150" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory relays</label> + <label>External ERS 4 Accessory Relays</label> <description>Indicates the status of the relays on the ERS accessory. The information is binary encoded. b0: K1, b1: K2, b2: K3, b3: K4 </description> @@ -2094,7 +2094,7 @@ </channel-type> <channel-type id="f1x55-42151" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory relays</label> + <label>External ERS 3 Accessory Relays</label> <description>Indicates the status of the relays on the ERS accessory. The information is binary encoded. b0: K1, b1: K2, b2: K3, b3: K4 </description> @@ -2103,7 +2103,7 @@ </channel-type> <channel-type id="f1x55-42152" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory relays</label> + <label>External ERS 2 Accessory Relays</label> <description>Indicates the status of the relays on the ERS accessory. The information is binary encoded. b0: K1, b1: K2, b2: K3, b3: K4 </description> @@ -2112,70 +2112,70 @@ </channel-type> <channel-type id="f1x55-42153" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory GQ2 speed</label> + <label>External ERS 4 Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42154" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory GQ2 speed</label> + <label>External ERS 3 Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42155" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory GQ2 speed</label> + <label>External ERS 2 Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42156" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory GQ3 speed</label> + <label>External ERS 4 Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42157" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory GQ3 speed</label> + <label>External ERS 3 Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42158" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory GQ3 speed</label> + <label>External ERS 2 Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42159" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory block status</label> + <label>External ERS 4 Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42160" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory block status</label> + <label>External ERS 3 Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42161" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory block status</label> + <label>External ERS 2 Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42162" advanced="true"> <item-type>String</item-type> - <label>External ERS 4 accessory EB17</label> + <label>External ERS 4 Accessory EB17</label> <description>Indicates if the status of ERS accessory EB17. I = closed, 0 = open.</description> <state pattern="%d" readOnly="true"> <options> @@ -2185,7 +2185,7 @@ </channel-type> <channel-type id="f1x55-42163" advanced="true"> <item-type>String</item-type> - <label>External ERS 3 accessory EB17</label> + <label>External ERS 3 Accessory EB17</label> <description>Indicates if the status of ERS accessory EB17. I = closed, 0 = open.</description> <state pattern="%d" readOnly="true"> <options> @@ -2195,7 +2195,7 @@ </channel-type> <channel-type id="f1x55-42164" advanced="true"> <item-type>String</item-type> - <label>External ERS 2 accessory EB17</label> + <label>External ERS 2 Accessory EB17</label> <description>Indicates if the status of ERS accessory EB17. I = closed, 0 = open.</description> <state pattern="%d" readOnly="true"> <options> @@ -2205,7 +2205,7 @@ </channel-type> <channel-type id="f1x55-42437" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - HW Cpr and Add - Total system</label> + <label>Heat Meter - HW Cpr and Add - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2214,7 +2214,7 @@ </channel-type> <channel-type id="f1x55-42439" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Heat Cpr and Add - Total system</label> + <label>Heat Meter - Heat Cpr and Add - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2223,7 +2223,7 @@ </channel-type> <channel-type id="f1x55-42441" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Cooling Cpr - Total system</label> + <label>Heat Meter - Cooling Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2232,7 +2232,7 @@ </channel-type> <channel-type id="f1x55-42443" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Pool Cpr - Total system</label> + <label>Heat Meter - Pool Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2241,7 +2241,7 @@ </channel-type> <channel-type id="f1x55-42445" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - HW Cpr - Total system</label> + <label>Heat Meter - HW Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2250,7 +2250,7 @@ </channel-type> <channel-type id="f1x55-42447" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Heat Cpr - Total system</label> + <label>Heat Meter - Heat Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system </description> @@ -2259,28 +2259,28 @@ </channel-type> <channel-type id="f1x55-42464" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 fire place guard</label> + <label>External ERS 4 Fire Place Guard</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42465" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 fire place guard</label> + <label>External ERS 3 Fire Place Guard</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42466" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 fire place guard</label> + <label>External ERS 2 Fire Place Guard</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-42467" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 fire place guard</label> + <label>External ERS 1 Fire Place Guard</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2294,14 +2294,14 @@ </channel-type> <channel-type id="f1x55-43001" advanced="true"> <item-type>Number</item-type> - <label>Software version</label> + <label>Software Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43005"> <item-type>Number</item-type> - <label>Degree Minutes (16 bit)</label> + <label>Degree Minutes (16 Bit)</label> <description>Degree minutes, 16bit value (-32768 < x < 32767). Values outside valid values are rounded to the closest valid value. </description> @@ -2359,28 +2359,28 @@ </channel-type> <channel-type id="f1x55-43064" advanced="true"> <item-type>Number</item-type> - <label>Heat Medium Flow dT Set Point</label> + <label>Heat Medium Flow DT Set Point</label> <description>Set point delta T for the heat medium flow</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43065" advanced="true"> <item-type>Number</item-type> - <label>Heat Medium Flow dT Actual</label> + <label>Heat Medium Flow DT Actual</label> <description>Current value of the delta T for the heat medium flow</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43081"> <item-type>Number</item-type> - <label>Tot. op.time add.</label> + <label>Tot. Op.time Add.</label> <description>Total electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43084" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. Power</label> + <label>Int. El.add. Power</label> <description>Current power from the internal electrical addition</description> <state pattern="%.2f kW" readOnly="true"> </state> @@ -2405,7 +2405,7 @@ </channel-type> <channel-type id="f1x55-43091" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. State</label> + <label>Int. El.add. State</label> <description>Number of steps active for internal step-controlled addition</description> <state pattern="%d" readOnly="true"> </state> @@ -2440,7 +2440,7 @@ </channel-type> <channel-type id="f1x55-43097" advanced="true"> <item-type>String</item-type> - <label>Status of the shunt controlled additional heat accessory</label> + <label>Status of the Shunt Controlled Additional Heat Accessory</label> <description>10 = Off, 20 = Running, 30 = Passive</description> <state pattern="%d" readOnly="true"> <options> @@ -2452,35 +2452,35 @@ </channel-type> <channel-type id="f1x55-43103" advanced="true"> <item-type>Number</item-type> - <label>HPAC state</label> + <label>HPAC State</label> <description>State of the HPAC cooling accessory.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43108" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43122" advanced="true"> <item-type>Number</item-type> - <label>Compr. current min.freq.</label> + <label>Compr. Current Min.freq.</label> <description>The current minimum frequency of the compressor</description> <state pattern="%d Hz" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43123" advanced="true"> <item-type>Number</item-type> - <label>Compr. current max.freq.</label> + <label>Compr. Current Max.freq.</label> <description>The current maximum frequency of the compressor</description> <state pattern="%d Hz" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43132" advanced="true"> <item-type>Number</item-type> - <label>Inverter com. timer</label> + <label>Inverter Com. Timer</label> <description>This value shows the time since last communication with the inverter</description> <state pattern="%d sec" readOnly="true"> </state> @@ -2501,56 +2501,56 @@ </channel-type> <channel-type id="f1x55-43141" advanced="true"> <item-type>Number</item-type> - <label>compr. in power</label> + <label>Compr. in Power</label> <description>The power delivered from the inverter to the compressor</description> <state pattern="%d W" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43147" advanced="true"> <item-type>Number</item-type> - <label>Compr. in current</label> + <label>Compr. in Current</label> <description>The current delivered from the inverter to the compressor</description> <state pattern="%d A" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43152" advanced="true"> <item-type>Number</item-type> - <label>Internal cooling blocked</label> + <label>Internal Cooling Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43158" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S4</label> + <label>External Adjustment Activated Via Input S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43159" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S3</label> + <label>External Adjustment Activated Via Input S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43160" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S2</label> + <label>External Adjustment Activated Via Input S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43161" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S1</label> + <label>External Adjustment Activated Via Input S1</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43163" advanced="true"> <item-type>String</item-type> - <label>Blocking status of the shunt controlled add heat acc</label> + <label>Blocking Status of the Shunt Controlled Add Heat Acc</label> <description>0 = Unblocked, 1 = Blocked</description> <state pattern="%d" readOnly="true"> <options> @@ -2561,14 +2561,14 @@ </channel-type> <channel-type id="f1x55-43164" advanced="true"> <item-type>Number</item-type> - <label>Cooling blocked</label> + <label>Cooling Blocked</label> <description>Whether cooling is blocked</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43171" advanced="true"> <item-type>String</item-type> - <label>Blocking status of the step controlled add heat acc</label> + <label>Blocking Status of the Step Controlled Add Heat Acc</label> <description>0 = Unblocked, 1 = Blocked</description> <state pattern="%d" readOnly="true"> <options> @@ -2597,14 +2597,14 @@ </channel-type> <channel-type id="f1x55-43239" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time add.</label> + <label>Tot. HW Op.time Add.</label> <description>Total electric additive operation time in hot water mode</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43375" advanced="true"> <item-type>Number</item-type> - <label>compr. in power mean</label> + <label>Compr. in Power Mean</label> <description>Mean power delivered from the inverter to the compressor. Mean is calculated every 10 seconds. </description> <state pattern="%d W" readOnly="true"> @@ -2619,21 +2619,21 @@ </channel-type> <channel-type id="f1x55-43416"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressorer starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43420"> <item-type>Number</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43424"> <item-type>Number</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time in hot water mode</description> <state pattern="%d h" readOnly="true"> </state> @@ -2772,7 +2772,7 @@ </channel-type> <channel-type id="f1x55-43542" advanced="true"> <item-type>Number</item-type> - <label>Calculated supply air temp.</label> + <label>Calculated Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -2802,14 +2802,14 @@ </channel-type> <channel-type id="f1x55-43560" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 blocked</label> + <label>Pool 2 Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-43561" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 blocked</label> + <label>Pool 1 Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2938,28 +2938,28 @@ </channel-type> <channel-type id="f1x55-44331" advanced="true"> <item-type>Number</item-type> - <label>Software release</label> + <label>Software Release</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44744" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S4</label> + <label>Extra Heating System Pump S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44745" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S3</label> + <label>Extra Heating System Pump S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44746" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S2</label> + <label>Extra Heating System Pump S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -3024,7 +3024,7 @@ </channel-type> <channel-type id="f1x55-44756" advanced="true"> <item-type>Number</item-type> - <label>State ground water pump</label> + <label>State Ground Water Pump</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -3038,14 +3038,14 @@ </channel-type> <channel-type id="f1x55-44878" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input A</label> + <label>SG Ready Input A</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44879" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input B</label> + <label>SG Ready Input B</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -3087,21 +3087,21 @@ </channel-type> <channel-type id="f1x55-44908" advanced="true"> <item-type>Number</item-type> - <label>State smart price adaption</label> + <label>State Smart Price Adaption</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44910" advanced="true"> <item-type>Number</item-type> - <label>Brine Pump dT Actual</label> + <label>Brine Pump DT Actual</label> <description>Current value between set and act value on brine pumps</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-44911" advanced="true"> <item-type>Number</item-type> - <label>Brine Pump dT Set Point</label> + <label>Brine Pump DT Set Point</label> <description>Set point delta T for the brine pumps</description> <state pattern="%.1f" readOnly="true"> </state> @@ -3115,14 +3115,14 @@ </channel-type> <channel-type id="f1x55-47291" advanced="true"> <item-type>Number</item-type> - <label>Floor drying timer</label> + <label>Floor Drying Timer</label> <description></description> <state pattern="%d hrs" readOnly="true"> </state> </channel-type> <channel-type id="f1x55-47325" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. max. step</label> + <label>Step Controlled Add. Max. Step</label> <description>Maximum number of steps allowed in step controlled add.</description> <state pattern="%d" readOnly="true"> </state> @@ -3135,69 +3135,69 @@ </channel-type> <channel-type id="f1x55-40879" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell factor</label> + <label>+Adjust Parallell Factor</label> <description></description> <state min="1" max="10" step="1" pattern="%d 1" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-40880" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Max change</label> + <label>+Adjust Max Change</label> <description>Largest allowed change</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-40881" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system8</label> + <label>+Adjust Affect System8</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40882" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system7</label> + <label>+Adjust Affect System7</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40883" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system6</label> + <label>+Adjust Affect System6</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40884" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system5</label> + <label>+Adjust Affect System5</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40885" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system4</label> + <label>+Adjust Affect System4</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40886" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system3</label> + <label>+Adjust Affect System3</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40887" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system2</label> + <label>+Adjust Affect System2</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-40888" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system1</label> + <label>+Adjust Affect System1</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-42097" advanced="true"> <item-type>Number</item-type> - <label>Ground water pump auto speed</label> + <label>Ground Water Pump Auto Speed</label> <description>Ground water pump auto speed</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> @@ -3372,77 +3372,77 @@ </channel-type> <channel-type id="f1x55-47027" advanced="true"> <item-type>Number</item-type> - <label>Point offset outdoor temp.</label> + <label>Point Offset Outdoor Temp.</label> <description>Outdoor temperature point where the heat curve is offset</description> <state min="-40" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47028" advanced="true"> <item-type>Number</item-type> - <label>Point offset</label> + <label>Point Offset</label> <description>Amount of offset at the point offset temperature</description> <state min="-10" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47029" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S4</label> + <label>External Adjustment S4</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47030" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S3</label> + <label>External Adjustment S3</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47031" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S2</label> + <label>External Adjustment S2</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47032" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S1</label> + <label>External Adjustment S1</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47033" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S4</label> + <label>External Adjustment with Room Sensor S4</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47034" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S3</label> + <label>External Adjustment with Room Sensor S3</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47035" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S2</label> + <label>External Adjustment with Room Sensor S2</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47036" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S1</label> + <label>External Adjustment with Room Sensor S1</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47041" advanced="true"> <item-type>String</item-type> - <label>Hot water comfort mode</label> + <label>Hot Water Comfort Mode</label> <description>Setting in menu 2.2. 0=Economy,1=Normal,2=Luxury,4=Smart Control 0=Economy 1=Normal 2=Luxury </description> <state min="0" max="4" step="1" pattern="%d" readOnly="false"> @@ -3456,49 +3456,49 @@ </channel-type> <channel-type id="f1x55-47043" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Luxury</label> + <label>Start Temperature HW Luxury</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47044" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Normal</label> + <label>Start Temperature HW Normal</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47045" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Economy</label> + <label>Start Temperature HW Economy</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47046" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature Periodic HW</label> + <label>Stop Temperature Periodic HW</label> <description>Temperature where hot water generation will stop</description> <state min="550" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47047" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Luxury</label> + <label>Stop Temperature HW Luxury</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47048" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Normal</label> + <label>Stop Temperature HW Normal</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47049" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Economy</label> + <label>Stop Temperature HW Economy</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> @@ -3518,14 +3518,14 @@ </channel-type> <channel-type id="f1x55-47054" advanced="true"> <item-type>Number</item-type> - <label>Run time HWC</label> + <label>Run Time HWC</label> <description>Run time for the hot water circulation system</description> <state min="1" max="60" step="1" pattern="%d min" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47055" advanced="true"> <item-type>Number</item-type> - <label>Still time HWC</label> + <label>Still Time HWC</label> <description>Still time for the hot water circulation system</description> <state min="0" max="60" step="1" pattern="%d min" readOnly="false"> </state> @@ -3539,35 +3539,35 @@ </channel-type> <channel-type id="f1x55-47100" advanced="true"> <item-type>Number</item-type> - <label>Max diff VBF-BerVBF</label> + <label>Max Diff VBF-BerVBF</label> <description>Largest allowed difference between Supply and calc supply</description> <state min="0" max="255" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47101" advanced="true"> <item-type>Number</item-type> - <label>Comp freq reg P</label> + <label>Comp Freq Reg P</label> <description>Compressor frequency regulator P</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47102" advanced="true"> <item-type>Number</item-type> - <label>Comp freq max delta F</label> + <label>Comp Freq Max Delta F</label> <description>Maximum change of copmpressor frequency in compressor frequency regulator</description> <state min="-128" max="127" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47103" advanced="true"> <item-type>Number</item-type> - <label>Min comp freq</label> + <label>Min Comp Freq</label> <description>Minimum allowed compressor frequency</description> <state min="-32767" max="32767" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47104" advanced="true"> <item-type>Number</item-type> - <label>Max comp freq</label> + <label>Max Comp Freq</label> <description>Maximum allowed compressor frequency</description> <state min="-32767" max="32767" step="1" pattern="%d Hz" readOnly="false"> </state> @@ -3621,7 +3621,7 @@ </channel-type> <channel-type id="f1x55-47137" advanced="true"> <item-type>String</item-type> - <label>Operational mode</label> + <label>Operational Mode</label> <description>The operational mode of the heat pump 0=Auto 1=Manual 2=Add. heat only</description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -3633,7 +3633,7 @@ </channel-type> <channel-type id="f1x55-47138" advanced="true"> <item-type>String</item-type> - <label>Operational mode heat medium pump</label> + <label>Operational Mode Heat Medium Pump</label> <description>10=Intermittent 20=Continous 30=Economy 40=Auto</description> <state min="10" max="40" step="1" pattern="%d" readOnly="false"> <options> @@ -3646,7 +3646,7 @@ </channel-type> <channel-type id="f1x55-47139" advanced="true"> <item-type>String</item-type> - <label>Operational mode brine medium pump</label> + <label>Operational Mode Brine Medium Pump</label> <description>10=Intermittent 20=Continuous 30=Economy 40=Auto</description> <state min="10" max="30" step="1" pattern="%d" readOnly="false"> <options> @@ -3659,28 +3659,28 @@ </channel-type> <channel-type id="f1x55-47206" advanced="true"> <item-type>Number</item-type> - <label>DM start heating</label> + <label>DM Start Heating</label> <description>The value the degree minutes needed to be reached for the pump to start heating</description> <state min="-1000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47209" advanced="true"> <item-type>Number</item-type> - <label>DM between add. steps</label> + <label>DM Between Add. Steps</label> <description>The number of degree minutes between start of each electric addition step</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47210" advanced="true"> <item-type>Number</item-type> - <label>DM start add. with shunt</label> + <label>DM Start Add. with Shunt</label> <description></description> <state min="-2000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47212" advanced="true"> <item-type>Number</item-type> - <label>Max int add. power</label> + <label>Max Int Add. Power</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f kW" readOnly="false"> </state> @@ -3694,174 +3694,174 @@ </channel-type> <channel-type id="f1x55-47261" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 4</label> + <label>Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47262" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 3</label> + <label>Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47263" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 2</label> + <label>Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47264" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 1</label> + <label>Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47265" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed normal</label> + <label>Exhaust Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47271" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 4</label> + <label>Fan Return Time 4</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47272" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 3</label> + <label>Fan Return Time 3</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47273" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 2</label> + <label>Fan Return Time 2</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47274" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 1</label> + <label>Fan Return Time 1</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47275" advanced="true"> <item-type>Number</item-type> - <label>Filter Reminder period</label> + <label>Filter Reminder Period</label> <description>Time between the reminder of filter replacement/cleaning.</description> <state min="1" max="24" step="1" pattern="%d Months" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47276" advanced="true"> <item-type>Switch</item-type> - <label>Floor drying</label> + <label>Floor Drying</label> <description>0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47277" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 7</label> + <label>Floor Drying Period 7</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47278" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 6</label> + <label>Floor Drying Period 6</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47279" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 5</label> + <label>Floor Drying Period 5</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47280" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 4</label> + <label>Floor Drying Period 4</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47281" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 3</label> + <label>Floor Drying Period 3</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47282" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 2</label> + <label>Floor Drying Period 2</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47283" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 1</label> + <label>Floor Drying Period 1</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47284" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 7</label> + <label>Floor Drying Temp. 7</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47285" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 6</label> + <label>Floor Drying Temp. 6</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47286" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 5</label> + <label>Floor Drying Temp. 5</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47287" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 4</label> + <label>Floor Drying Temp. 4</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47288" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 3</label> + <label>Floor Drying Temp. 3</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47289" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 2</label> + <label>Floor Drying Temp. 2</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47290" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 1</label> + <label>Floor Drying Temp. 1</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> @@ -3875,74 +3875,74 @@ </channel-type> <channel-type id="f1x55-47301" advanced="true"> <item-type>Number</item-type> - <label>delta T at DOT</label> + <label>Delta T At DOT</label> <description>Delta T (BT12-BT3)at dimensioning outdoor temperature</description> <state min="10" max="250" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47302" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 2 accessory</label> + <label>Climate System 2 Accessory</label> <description>Activates the climate system 2 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47303" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 3 accessory</label> + <label>Climate System 3 Accessory</label> <description>Activates the climate system 3 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47304" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 4 accessory</label> + <label>Climate System 4 Accessory</label> <description>Activates the climate system 4 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47305" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 mixing valve amp.</label> + <label>Climate System 4 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47306" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 mixing valve amp.</label> + <label>Climate System 3 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47307" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 mixing valve amp.</label> + <label>Climate System 2 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47308" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 shunt wait</label> + <label>Climate System 4 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47309" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 shunt wait</label> + <label>Climate System 3 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47310" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 shunt wait</label> + <label>Climate System 2 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47312" advanced="true"> <item-type>Switch</item-type> - <label>FLM pump 1</label> + <label>FLM Pump 1</label> <description>Operating mode for the FLM pump 1|Operating mode for the FLM pump 2|Operating mode for the FLM pump 3|Operating mode for the FLM pump 4 0=Off 1=On </description> @@ -3950,7 +3950,7 @@ </channel-type> <channel-type id="f1x55-47313" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 defrost</label> + <label>FLM 1 Defrost</label> <description>Minimum time between defrost in FLM 1|Minimum time between defrost in FLM 2|Minimum time between defrost in FLM 3|Minimum time between defrost in FLM 4 </description> @@ -3959,113 +3959,113 @@ </channel-type> <channel-type id="f1x55-47317" advanced="true"> <item-type>Switch</item-type> - <label>Shunt controlled add. accessory</label> + <label>Shunt Controlled Add. Accessory</label> <description>Activates the shunt controlled addition accessory. 1=on,0=off 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47318" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. temp.</label> + <label>Shunt Controlled Add. Min. Temp.</label> <description></description> <state min="5" max="90" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47319" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. runtime</label> + <label>Shunt Controlled Add. Min. Runtime</label> <description></description> <state min="0" max="48" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47320" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve amp.</label> + <label>Shunt Controlled Add. Mixing Valve Amp.</label> <description>Mixing valve amplification for shunt controlled add.</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47321" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve wait</label> + <label>Shunt Controlled Add. Mixing Valve Wait</label> <description>Wait time between changes of the shunt in shunt controlled add.</description> <state min="10" max="300" step="1" pattern="%d secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47322" advanced="true"> <item-type>Switch</item-type> - <label>Step controlled add. accessory</label> + <label>Step Controlled Add. Accessory</label> <description>Activates the step controlled addition accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47324" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. diff. DM</label> + <label>Step Controlled Add. Diff. DM</label> <description>Difference in DM of each step in the step controlled add.</description> <state min="0" max="1000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47326" advanced="true"> <item-type>Switch</item-type> - <label>Step controlled add. mode</label> + <label>Step Controlled Add. Mode</label> <description>Binary or linear stepping method. 0=Linear 1=Binary</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47327" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump accessory</label> + <label>Ground Water Pump Accessory</label> <description>Ground water pump using AXC40 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47329" advanced="true"> <item-type>Switch</item-type> - <label>Cooling 2-pipe accessory</label> + <label>Cooling 2-pipe Accessory</label> <description>Activates the 2-pipe cooling accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47330" advanced="true"> <item-type>Switch</item-type> - <label>Cooling 4-pipe accessory</label> + <label>Cooling 4-pipe Accessory</label> <description>Activates the 4-pipe cooling accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47335" advanced="true"> <item-type>Number</item-type> - <label>Time betw. switch heat/cool</label> + <label>Time Betw. Switch Heat/cool</label> <description>Time between switching from heating to cooling or vice versa.</description> <state min="0" max="48" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47336" advanced="true"> <item-type>Number</item-type> - <label>Heat at room under temp.</label> + <label>Heat At Room Under Temp.</label> <description>This value indicates how many degrees under set room temp heating will be allowed</description> <state min="5" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47337" advanced="true"> <item-type>Number</item-type> - <label>Cool at room over temp.</label> + <label>Cool At Room over Temp.</label> <description>This value indicates how many degrees over set room temp cooling will be allowed</description> <state min="5" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47338" advanced="true"> <item-type>Number</item-type> - <label>Cooling mix. valve amp.</label> + <label>Cooling Mix. Valve Amp.</label> <description>Mixing valve amplification for the cooling valve</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47339" advanced="true"> <item-type>Number</item-type> - <label>Cooling mix. valve step delay</label> + <label>Cooling Mix. Valve Step Delay</label> <description></description> <state min="10" max="300" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47340" advanced="true"> <item-type>String</item-type> - <label>Cooling with room sensor</label> + <label>Cooling with Room Sensor</label> <description>Enables use of room sensor together with cooling 0=Off 1=On</description> <state min="0" max="18" step="1" pattern="%.1f" readOnly="false"> <options> @@ -4076,7 +4076,7 @@ </channel-type> <channel-type id="f1x55-47341" advanced="true"> <item-type>Switch</item-type> - <label>HPAC accessory</label> + <label>HPAC Accessory</label> <description>Activates the HPAC accessory</description> <state readOnly="false"></state> </channel-type> @@ -4096,7 +4096,7 @@ </channel-type> <channel-type id="f1x55-47352" advanced="true"> <item-type>Switch</item-type> - <label>SMS40 accessory</label> + <label>SMS40 Accessory</label> <description>Activates the SMS40 accessory</description> <state readOnly="false"></state> </channel-type> @@ -4180,34 +4180,34 @@ </channel-type> <channel-type id="f1x55-47378" advanced="true"> <item-type>Number</item-type> - <label>Max diff. comp.</label> + <label>Max Diff. Comp.</label> <description></description> <state min="10" max="250" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47379" advanced="true"> <item-type>Number</item-type> - <label>Max diff. add.</label> + <label>Max Diff. Add.</label> <description></description> <state min="10" max="240" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47380" advanced="true"> <item-type>Switch</item-type> - <label>Low brine out autoreset</label> + <label>Low Brine out Autoreset</label> <description>0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47381" advanced="true"> <item-type>Number</item-type> - <label>Low brine out temp.EP14</label> + <label>Low Brine out Temp.EP14</label> <description></description> <state min="-120" max="150" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47382" advanced="true"> <item-type>String</item-type> - <label>High brine in</label> + <label>High Brine In</label> <description>Activates the High brine in temperature alarm. 0=Off 1=On</description> <state min="1" max="1" step="1" pattern="%d" readOnly="false"> <options> @@ -4218,7 +4218,7 @@ </channel-type> <channel-type id="f1x55-47383" advanced="true"> <item-type>Number</item-type> - <label>High brine in temp.</label> + <label>High Brine in Temp.</label> <description>The brine in temperature that triggers the high brine in temperature alarm (if active). </description> <state min="100" max="300" step="1" pattern="%.1f °C" readOnly="false"> @@ -4226,7 +4226,7 @@ </channel-type> <channel-type id="f1x55-47384" advanced="true"> <item-type>String</item-type> - <label>Date format</label> + <label>Date Format</label> <description>1=DD-MM-YY 2=YY-MM-DD</description> <state min="1" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -4237,7 +4237,7 @@ </channel-type> <channel-type id="f1x55-47385" advanced="true"> <item-type>String</item-type> - <label>Time format</label> + <label>Time Format</label> <description>12=12 hours 24=24 Hours</description> <state min="12" max="24" step="1" pattern="%d" readOnly="false"> <options> @@ -4248,13 +4248,13 @@ </channel-type> <channel-type id="f1x55-47387" advanced="true"> <item-type>Switch</item-type> - <label>HW production</label> + <label>HW Production</label> <description>Activates hot water production where applicable 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47388" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower room temp.</label> + <label>Alarm Lower Room Temp.</label> <description>Lowers the room temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On </description> @@ -4262,7 +4262,7 @@ </channel-type> <channel-type id="f1x55-47389" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower HW temp.</label> + <label>Alarm Lower HW Temp.</label> <description>Lowers the hot water temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On </description> @@ -4270,59 +4270,59 @@ </channel-type> <channel-type id="f1x55-47391" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S4</label> + <label>Use Room Sensor S4</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47392" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S3</label> + <label>Use Room Sensor S3</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47393" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S2</label> + <label>Use Room Sensor S2</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47394" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-47395" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S4</label> + <label>Room Sensor Setpoint S4</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47396" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S3</label> + <label>Room Sensor Setpoint S3</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47397" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S2</label> + <label>Room Sensor Setpoint S2</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47398" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S1</label> + <label>Room Sensor Setpoint S1</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47399" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S4</label> + <label>Room Sensor Factor S4</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -4331,7 +4331,7 @@ </channel-type> <channel-type id="f1x55-47400" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S3</label> + <label>Room Sensor Factor S3</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -4340,7 +4340,7 @@ </channel-type> <channel-type id="f1x55-47401" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S2</label> + <label>Room Sensor Factor S2</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -4349,7 +4349,7 @@ </channel-type> <channel-type id="f1x55-47402" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -4358,28 +4358,28 @@ </channel-type> <channel-type id="f1x55-47413" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump HW</label> + <label>Speed Circ.pump HW</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47414" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Heat</label> + <label>Speed Circ.pump Heat</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47415" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Pool</label> + <label>Speed Circ.pump Pool</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47416" advanced="true"> <item-type>Number</item-type> - <label>Speed circ.pump Economy</label> + <label>Speed Circ.pump Economy</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> @@ -4393,14 +4393,14 @@ </channel-type> <channel-type id="f1x55-47418"> <item-type>Number</item-type> - <label>Speed brine pump</label> + <label>Speed Brine Pump</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47442" advanced="true"> <item-type>String</item-type> - <label>preset flow clim. sys.</label> + <label>Preset Flow Clim. Sys.</label> <description>Preset flow setting for climate system. 0 = manual setting, 1 = radiator, 2 = floor heating, 3 = radiator + floor heating. </description> @@ -4422,7 +4422,7 @@ </channel-type> <channel-type id="f1x55-47537" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. 0=Off 1=On </description> @@ -4430,14 +4430,14 @@ </channel-type> <channel-type id="f1x55-47538" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-47539" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> @@ -4462,136 +4462,136 @@ </channel-type> <channel-type id="f1x55-48053" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 4</label> + <label>FLM 2 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48054" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 3</label> + <label>FLM 2 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48055" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 2</label> + <label>FLM 2 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48056" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed 1</label> + <label>FLM 2 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48057" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 speed normal</label> + <label>FLM 2 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48058" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 4</label> + <label>FLM 3 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48059" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 3</label> + <label>FLM 3 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48060" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 2</label> + <label>FLM 3 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48061" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed 1</label> + <label>FLM 3 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48062" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 speed normal</label> + <label>FLM 3 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48063" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 4</label> + <label>FLM 4 Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48064" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 3</label> + <label>FLM 4 Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48065" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 2</label> + <label>FLM 4 Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48066" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed 1</label> + <label>FLM 4 Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48067" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 speed normal</label> + <label>FLM 4 Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48068" advanced="true"> <item-type>Switch</item-type> - <label>FLM 4 accessory</label> + <label>FLM 4 Accessory</label> <description>Activates the FLM 4 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48069" advanced="true"> <item-type>Switch</item-type> - <label>FLM 3 accessory</label> + <label>FLM 3 Accessory</label> <description>Activates the FLM 3 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48070" advanced="true"> <item-type>Switch</item-type> - <label>FLM 2 accessory</label> + <label>FLM 2 Accessory</label> <description>Activates the FLM 2 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48071" advanced="true"> <item-type>Switch</item-type> - <label>FLM 1 accessory</label> + <label>FLM 1 Accessory</label> <description>Activates the FLM 1 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48072" advanced="true"> <item-type>Number</item-type> - <label>DM diff start add.</label> + <label>DM Diff Start Add.</label> <description>The value below the last compressor step the degree minutes needed to be reached for the pump to start electric addition </description> @@ -4600,7 +4600,7 @@ </channel-type> <channel-type id="f1x55-48073" advanced="true"> <item-type>Switch</item-type> - <label>FLM 1 cooling</label> + <label>FLM 1 Cooling</label> <description>FLM 1 cooling activated|FLM 2 cooling activated|FLM 3 cooling activated|FLM 4 cooling activated </description> <state readOnly="false"></state> @@ -4614,40 +4614,40 @@ </channel-type> <channel-type id="f1x55-48087" advanced="true"> <item-type>Switch</item-type> - <label>Pool 2 accessory</label> + <label>Pool 2 Accessory</label> <description>Activate the pool 2 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48088" advanced="true"> <item-type>Switch</item-type> - <label>Pool 1 accessory</label> + <label>Pool 1 Accessory</label> <description>Activates the pool 1 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48089" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 start temp.</label> + <label>Pool 2 Start Temp.</label> <description>The Temperature below which the pool heating should start</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48090" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 start temp.</label> + <label>Pool 1 Start Temp.</label> <description>The Temperature below which the pool heating should start</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48091" advanced="true"> <item-type>Number</item-type> - <label>Pool 2 stop temp.</label> + <label>Pool 2 Stop Temp.</label> <description>The Temperature at which the pool heating will stop</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48092" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 stop temp.</label> + <label>Pool 1 Stop Temp.</label> <description>The Temperature at which the pool heating will stop</description> <state min="50" max="800" step="1" pattern="%.1f °C" readOnly="false"> </state> @@ -4693,81 +4693,81 @@ </channel-type> <channel-type id="f1x55-48139" advanced="true"> <item-type>Number</item-type> - <label>DM startdiff add. with shunt</label> + <label>DM Startdiff Add. with Shunt</label> <description></description> <state min="0" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48142" advanced="true"> <item-type>Number</item-type> - <label>Step controlled add. start diff DM</label> + <label>Step Controlled Add. Start Diff DM</label> <description>DM diff from last compressor step where the first step of step controlled add. starts</description> <state min="0" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48144" advanced="true"> <item-type>Switch</item-type> - <label>HW Comfort add during Heat</label> + <label>HW Comfort Add During Heat</label> <description>Allows the HW Comfort addition to run during heating.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48145" advanced="true"> <item-type>Switch</item-type> - <label>HW Comfort mixing valve</label> + <label>HW Comfort Mixing Valve</label> <description>Activates the HW Comfort Shunt.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48146" advanced="true"> <item-type>Number</item-type> - <label>HW Comfort mixing valve amp.</label> + <label>HW Comfort Mixing Valve Amp.</label> <description>Mixing valve amplification for the HW Comfort Accessory</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48147" advanced="true"> <item-type>Number</item-type> - <label>HW Comfort mixing valve wait</label> + <label>HW Comfort Mixing Valve Wait</label> <description>Wait time between changes of the mixing valve for the HW Comfort Accessory</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48148" advanced="true"> <item-type>Number</item-type> - <label>HW Comfort hotwater temperature</label> + <label>HW Comfort Hotwater Temperature</label> <description>The desired hotwater temperature</description> <state min="40" max="65" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48157" advanced="true"> <item-type>Switch</item-type> - <label>HW Comfort add.</label> + <label>HW Comfort Add.</label> <description>Activates the HW Comfort Addition.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48174" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S4</label> + <label>Min Cooling Supply Temp S4</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48175" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S3</label> + <label>Min Cooling Supply Temp S3</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48176" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S2</label> + <label>Min Cooling Supply Temp S2</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48177" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S1</label> + <label>Min Cooling Supply Temp S1</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> @@ -4788,7 +4788,7 @@ </channel-type> <channel-type id="f1x55-48186" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S4</label> + <label>Cooling Use Mix. Valve S4</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -4796,7 +4796,7 @@ </channel-type> <channel-type id="f1x55-48187" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S3</label> + <label>Cooling Use Mix. Valve S3</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -4804,7 +4804,7 @@ </channel-type> <channel-type id="f1x55-48188" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S2</label> + <label>Cooling Use Mix. Valve S2</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -4812,7 +4812,7 @@ </channel-type> <channel-type id="f1x55-48189" advanced="true"> <item-type>Number</item-type> - <label>Cooling use mix. valve S1</label> + <label>Cooling Use Mix. Valve S1</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -4821,112 +4821,112 @@ </channel-type> <channel-type id="f1x55-48190" advanced="true"> <item-type>Number</item-type> - <label>Heatdump mix. valve delay</label> + <label>Heatdump Mix. Valve Delay</label> <description>Mixing valve step delay for the heatdump valve</description> <state min="10" max="500" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48191" advanced="true"> <item-type>Number</item-type> - <label>Heatdump mix. valve amp.</label> + <label>Heatdump Mix. Valve Amp.</label> <description>Mixing valve amplification for the heatdump valve</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48192" advanced="true"> <item-type>Number</item-type> - <label>Cooldump mix. valve delay</label> + <label>Cooldump Mix. Valve Delay</label> <description>Mixing valve step delay for the cooldump valve for the ACS-system</description> <state min="10" max="500" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48193" advanced="true"> <item-type>Number</item-type> - <label>Cooldump mix. valve amp.</label> + <label>Cooldump Mix. Valve Amp.</label> <description>Mixing valve amplification for the cooldump valve for the ACS-system</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48194" advanced="true"> <item-type>Switch</item-type> - <label>ACS accessory</label> + <label>ACS Accessory</label> <description>Activate the ACS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48195" advanced="true"> <item-type>Switch</item-type> - <label>ACS heat dump 24h-function</label> + <label>ACS Heat Dump 24h-function</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48197" advanced="true"> <item-type>Number</item-type> - <label>ACS closingtime for cool dump</label> + <label>ACS Closingtime for Cool Dump</label> <description></description> <state min="0" max="100" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48264" advanced="true"> <item-type>Switch</item-type> - <label>Brine shunt accessory</label> + <label>Brine Shunt Accessory</label> <description>Activates the Brine shunt accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48265" advanced="true"> <item-type>Number</item-type> - <label>Brine shunt amplication</label> + <label>Brine Shunt Amplication</label> <description>The Brine shunt accessory, shunt amplication</description> <state min="0" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48266" advanced="true"> <item-type>Number</item-type> - <label>Brine shunt wait time</label> + <label>Brine Shunt Wait Time</label> <description>The Brine shunt accessory, wait time</description> <state min="10" max="300" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48267" advanced="true"> <item-type>Number</item-type> - <label>Brine shunt, max brine temp</label> + <label>Brine Shunt, Max Brine Temp</label> <description>The Brine shunt accessory, max brine temperature</description> <state min="0" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48275" advanced="true"> <item-type>Number</item-type> - <label>Max charge pump reg speed</label> + <label>Max Charge Pump Reg Speed</label> <description>Max heat medium pump reg speed</description> <state min="50" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48281" advanced="true"> <item-type>Switch</item-type> - <label>Charge method HW</label> + <label>Charge Method HW</label> <description>Heating medium pump control when hot water is charged</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48282" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready heating</label> + <label>SG Ready Heating</label> <description>Sets whether or not SG Ready should affect heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48283" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready cooling</label> + <label>SG Ready Cooling</label> <description>Sets whether or not SG Ready should affect cooling</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48284" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready hot water</label> + <label>SG Ready Hot Water</label> <description>Sets whether or not SG Ready should affect hot water</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48285" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready pool</label> + <label>SG Ready Pool</label> <description>Sets whether or not SG Ready should affect pool</description> <state readOnly="false"></state> </channel-type> @@ -4953,45 +4953,45 @@ </channel-type> <channel-type id="f1x55-48452" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, hw</label> + <label>Auto Heat Medium Pump Speed, Hw</label> <description>Auto heat medium pump speed hw</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48453" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, heat</label> + <label>Auto Heat Medium Pump Speed, Heat</label> <description>Auto heat medium pump speed heat</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48454" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, pool</label> + <label>Auto Heat Medium Pump Speed, Pool</label> <description>Auto heat medium pump speed pool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48455" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, cool</label> + <label>Auto Heat Medium Pump Speed, Cool</label> <description>Auto heat medium pump speed cool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48456" advanced="true"> <item-type>Number</item-type> - <label>Operational mode heat medium pump, cooling</label> + <label>Operational Mode Heat Medium Pump, Cooling</label> <description></description> <state min="10" max="20" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48458" advanced="true"> <item-type>Number</item-type> - <label>Max speed circ.pump Heat</label> + <label>Max Speed Circ.pump Heat</label> <description></description> <state min="50" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48459" advanced="true"> <item-type>Number</item-type> - <label>Speed brine pump passive cooling</label> + <label>Speed Brine Pump Passive Cooling</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> @@ -5103,171 +5103,171 @@ </channel-type> <channel-type id="f1x55-48503" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S8</label> + <label>External Adjustment S8</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48504" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S7</label> + <label>External Adjustment S7</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48505" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S6</label> + <label>External Adjustment S6</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48506" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S5</label> + <label>External Adjustment S5</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48507" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S8</label> + <label>External Adjustment with Room Sensor S8</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48508" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S7</label> + <label>External Adjustment with Room Sensor S7</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48509" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S6</label> + <label>External Adjustment with Room Sensor S6</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48510" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S5</label> + <label>External Adjustment with Room Sensor S5</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48569" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 5 accessory</label> + <label>Climate System 5 Accessory</label> <description>Activates the climate system 5 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48570" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 6 accessory</label> + <label>Climate System 6 Accessory</label> <description>Activates the climate system 6 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48571" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 7 accessory</label> + <label>Climate System 7 Accessory</label> <description>Activates the climate system 7 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48572" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 8 accessory</label> + <label>Climate System 8 Accessory</label> <description>Activates the climate system 8 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48573" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 mixing valve amp.</label> + <label>Climate System 8 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48574" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 mixing valve amp.</label> + <label>Climate System 7 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48575" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 mixing valve amp.</label> + <label>Climate System 6 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48576" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 mixing valve amp.</label> + <label>Climate System 5 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48577" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 shunt wait</label> + <label>Climate System 8 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48578" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 shunt wait</label> + <label>Climate System 7 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48579" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 shunt wait</label> + <label>Climate System 6 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48580" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 shunt wait</label> + <label>Climate System 5 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48581" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S8</label> + <label>Min Cooling Supply Temp S8</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48582" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S7</label> + <label>Min Cooling Supply Temp S7</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48583" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S6</label> + <label>Min Cooling Supply Temp S6</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48584" advanced="true"> <item-type>Number</item-type> - <label>Min cooling supply temp S5</label> + <label>Min Cooling Supply Temp S5</label> <description>Minimum allowed supply temperature during cooling</description> <state min="-5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48593" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S8</label> + <label>Cooling Use Mix. Valve S8</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -5275,7 +5275,7 @@ </channel-type> <channel-type id="f1x55-48594" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S7</label> + <label>Cooling Use Mix. Valve S7</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -5283,7 +5283,7 @@ </channel-type> <channel-type id="f1x55-48595" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S6</label> + <label>Cooling Use Mix. Valve S6</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -5291,7 +5291,7 @@ </channel-type> <channel-type id="f1x55-48596" advanced="true"> <item-type>Switch</item-type> - <label>Cooling use mix. valve S5</label> + <label>Cooling Use Mix. Valve S5</label> <description>Sets if the valve should be used or not in cooling mode. Only applies if cooling is available in the system </description> @@ -5299,7 +5299,7 @@ </channel-type> <channel-type id="f1x55-48597" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S8</label> + <label>Heating Use Mix. Valve S8</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5307,7 +5307,7 @@ </channel-type> <channel-type id="f1x55-48598" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S7</label> + <label>Heating Use Mix. Valve S7</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5315,7 +5315,7 @@ </channel-type> <channel-type id="f1x55-48599" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S6</label> + <label>Heating Use Mix. Valve S6</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5323,7 +5323,7 @@ </channel-type> <channel-type id="f1x55-48600" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S5</label> + <label>Heating Use Mix. Valve S5</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5331,7 +5331,7 @@ </channel-type> <channel-type id="f1x55-48601" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S4</label> + <label>Heating Use Mix. Valve S4</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5339,7 +5339,7 @@ </channel-type> <channel-type id="f1x55-48602" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S3</label> + <label>Heating Use Mix. Valve S3</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5347,7 +5347,7 @@ </channel-type> <channel-type id="f1x55-48603" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S2</label> + <label>Heating Use Mix. Valve S2</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5355,7 +5355,7 @@ </channel-type> <channel-type id="f1x55-48604" advanced="true"> <item-type>Switch</item-type> - <label>Heating use mix. valve S1</label> + <label>Heating Use Mix. Valve S1</label> <description>Sets if the valve should be used or not in heating mode. Only applies if cooling is available in the system. Otherwise the valve is always used in heating mode. </description> @@ -5363,105 +5363,105 @@ </channel-type> <channel-type id="f1x55-48607" advanced="true"> <item-type>Switch</item-type> - <label>ERS 1 accessory</label> + <label>ERS 1 Accessory</label> <description>Activates the ERS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48659" advanced="true"> <item-type>Switch</item-type> - <label>Cut off frequency activated 2</label> + <label>Cut Off Frequency Activated 2</label> <description>Cut off frequency activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48660" advanced="true"> <item-type>Switch</item-type> - <label>Cut off frequency activated 1</label> + <label>Cut Off Frequency Activated 1</label> <description>Cut off frequency activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48661" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency start 2</label> + <label>Cut Off Frequency Start 2</label> <description>Cut off frequency start</description> <state min="17" max="115" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48662" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency start 1</label> + <label>Cut Off Frequency Start 1</label> <description>Cut off frequency start</description> <state min="17" max="115" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48663" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency stop 2</label> + <label>Cut Off Frequency Stop 2</label> <description>Cut off frequency stop</description> <state min="22" max="120" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48664" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency stop 1</label> + <label>Cut Off Frequency Stop 1</label> <description>Cut off frequency stop</description> <state min="22" max="120" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48675" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S8</label> + <label>Use Room Sensor S8</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48676" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S7</label> + <label>Use Room Sensor S7</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48677" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S6</label> + <label>Use Room Sensor S6</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48678" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S5</label> + <label>Use Room Sensor S5</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48680" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S8</label> + <label>Room Sensor Setpoint S8</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48681" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S7</label> + <label>Room Sensor Setpoint S7</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48682" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S6</label> + <label>Room Sensor Setpoint S6</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48683" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S5</label> + <label>Room Sensor Setpoint S5</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48685" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S8</label> + <label>Room Sensor Factor S8</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -5470,7 +5470,7 @@ </channel-type> <channel-type id="f1x55-48686" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S7</label> + <label>Room Sensor Factor S7</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -5479,7 +5479,7 @@ </channel-type> <channel-type id="f1x55-48687" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S6</label> + <label>Room Sensor Factor S6</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -5488,7 +5488,7 @@ </channel-type> <channel-type id="f1x55-48688" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S5</label> + <label>Room Sensor Factor S5</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature. </description> @@ -5497,112 +5497,112 @@ </channel-type> <channel-type id="f1x55-48724" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S8</label> + <label>Cool Curve S8</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48725" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S7</label> + <label>Cool Curve S7</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48726" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S6</label> + <label>Cool Curve S6</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48727" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S5</label> + <label>Cool Curve S5</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48728" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S4</label> + <label>Cool Curve S4</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48729" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S3</label> + <label>Cool Curve S3</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48730" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S2</label> + <label>Cool Curve S2</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48731" advanced="true"> <item-type>Number</item-type> - <label>Cool curve S1</label> + <label>Cool Curve S1</label> <description>Cool curve, see manual for more information</description> <state min="0" max="9" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48732" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S8</label> + <label>Cool Offset S8</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48733" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S7</label> + <label>Cool Offset S7</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48734" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S6</label> + <label>Cool Offset S6</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48735" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S5</label> + <label>Cool Offset S5</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48736" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S4</label> + <label>Cool Offset S4</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48737" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S3</label> + <label>Cool Offset S3</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48738" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S2</label> + <label>Cool Offset S2</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48739" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S1</label> + <label>Cool Offset S1</label> <description>Offset of the cool curve, see manual for more information</description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> @@ -5630,76 +5630,76 @@ </channel-type> <channel-type id="f1x55-48743" advanced="true"> <item-type>Switch</item-type> - <label>Hot water high power mode</label> + <label>Hot Water High Power Mode</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48755" advanced="true"> <item-type>Number</item-type> - <label>Transformer ratio</label> + <label>Transformer Ratio</label> <description>Ratio of the current measurement transformers</description> <state min="300" max="2500" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48778" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S8</label> + <label>Room Sensor Cool Setpoint S8</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48779" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S7</label> + <label>Room Sensor Cool Setpoint S7</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48780" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S6</label> + <label>Room Sensor Cool Setpoint S6</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48781" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S5</label> + <label>Room Sensor Cool Setpoint S5</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48782" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S4</label> + <label>Room Sensor Cool Setpoint S4</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48783" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S3</label> + <label>Room Sensor Cool Setpoint S3</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48784" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S2</label> + <label>Room Sensor Cool Setpoint S2</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48785" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool setpoint S1</label> + <label>Room Sensor Cool Setpoint S1</label> <description>Sets the room temperature setpoint for the system in cooling mode</description> <state min="50" max="350" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48786" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S8</label> + <label>Room Sensor Cool Factor S8</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5708,7 +5708,7 @@ </channel-type> <channel-type id="f1x55-48787" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S7</label> + <label>Room Sensor Cool Factor S7</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5717,7 +5717,7 @@ </channel-type> <channel-type id="f1x55-48788" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S6</label> + <label>Room Sensor Cool Factor S6</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5726,7 +5726,7 @@ </channel-type> <channel-type id="f1x55-48789" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S5</label> + <label>Room Sensor Cool Factor S5</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5735,7 +5735,7 @@ </channel-type> <channel-type id="f1x55-48790" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S4</label> + <label>Room Sensor Cool Factor S4</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5744,7 +5744,7 @@ </channel-type> <channel-type id="f1x55-48791" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S3</label> + <label>Room Sensor Cool Factor S3</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5753,7 +5753,7 @@ </channel-type> <channel-type id="f1x55-48792" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S2</label> + <label>Room Sensor Cool Factor S2</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5762,7 +5762,7 @@ </channel-type> <channel-type id="f1x55-48793" advanced="true"> <item-type>Number</item-type> - <label>Room sensor cool factor S1</label> + <label>Room Sensor Cool Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode. </description> @@ -5771,110 +5771,110 @@ </channel-type> <channel-type id="f1x55-48794" advanced="true"> <item-type>Number</item-type> - <label>RH set value</label> + <label>RH Set Value</label> <description>RH set value</description> <state min="30" max="90" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48808" advanced="true"> <item-type>Switch</item-type> - <label>HTS accessory</label> + <label>HTS Accessory</label> <description>HTS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48810" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S8</label> + <label>Prevent Humidity S8</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48811" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S7</label> + <label>Prevent Humidity S7</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48812" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S6</label> + <label>Prevent Humidity S6</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48813" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S5</label> + <label>Prevent Humidity S5</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48814" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S4</label> + <label>Prevent Humidity S4</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48815" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S3</label> + <label>Prevent Humidity S3</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48816" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S2</label> + <label>Prevent Humidity S2</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48817" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S1</label> + <label>Prevent Humidity S1</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48819" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S8</label> + <label>Limit Humidity in Room, Heating S8</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48820" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S7</label> + <label>Limit Humidity in Room, Heating S7</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48821" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S6</label> + <label>Limit Humidity in Room, Heating S6</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48822" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S5</label> + <label>Limit Humidity in Room, Heating S5</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48823" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S4</label> + <label>Limit Humidity in Room, Heating S4</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48824" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S3</label> + <label>Limit Humidity in Room, Heating S3</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48825" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S2</label> + <label>Limit Humidity in Room, Heating S2</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48826" advanced="true"> <item-type>Switch</item-type> - <label>Limit humidity in room, heating S1</label> + <label>Limit Humidity in Room, Heating S1</label> <description>Limit humidity in room, heating</description> <state readOnly="false"></state> </channel-type> @@ -5886,28 +5886,28 @@ </channel-type> <channel-type id="f1x55-48829" advanced="true"> <item-type>Number</item-type> - <label>OPT DM startdiff</label> + <label>OPT DM Startdiff</label> <description>The number of degree minutes below the last compressor the OPT is allowed to start</description> <state min="10" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48849" advanced="true"> <item-type>Number</item-type> - <label>Speed brine pump active cooling</label> + <label>Speed Brine Pump Active Cooling</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48850" advanced="true"> <item-type>Number</item-type> - <label>Delta brine pump active cooling</label> + <label>Delta Brine Pump Active Cooling</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48851" advanced="true"> <item-type>Number</item-type> - <label>Waiting speed brine pump cooling</label> + <label>Waiting Speed Brine Pump Cooling</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> @@ -5922,35 +5922,35 @@ </channel-type> <channel-type id="f1x55-48853" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Exhaust Fan speed 4</label> + <label>ERS 1 Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48854" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Exhaust Fan speed 3</label> + <label>ERS 1 Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48855" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Exhaust Fan speed 2</label> + <label>ERS 1 Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48856" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Exhaust Fan speed 1</label> + <label>ERS 1 Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48857" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Exhaust Fan speed normal</label> + <label>ERS 1 Exhaust Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> @@ -5965,49 +5965,49 @@ </channel-type> <channel-type id="f1x55-48896" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Supply Fan speed 4</label> + <label>ERS 1 Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48897" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Supply Fan speed 3</label> + <label>ERS 1 Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48898" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Supply Fan speed 2</label> + <label>ERS 1 Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48899" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Supply Fan speed 1</label> + <label>ERS 1 Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48900" advanced="true"> <item-type>Number</item-type> - <label>ERS 1 Supply Fan speed normal</label> + <label>ERS 1 Supply Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48901" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory min exhaust temp.</label> + <label>External ERS 1 Accessory Min Exhaust Temp.</label> <description></description> <state min="0" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48902" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory bypass temp.</label> + <label>External ERS 1 Accessory Bypass Temp.</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> @@ -6040,63 +6040,63 @@ </channel-type> <channel-type id="f1x55-48918" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S8</label> + <label>Limit Humidity in Room, Cooling S8</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48919" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S7</label> + <label>Limit Humidity in Room, Cooling S7</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48920" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S6</label> + <label>Limit Humidity in Room, Cooling S6</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48921" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S5</label> + <label>Limit Humidity in Room, Cooling S5</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48922" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S4</label> + <label>Limit Humidity in Room, Cooling S4</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48923" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S3</label> + <label>Limit Humidity in Room, Cooling S3</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48924" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S2</label> + <label>Limit Humidity in Room, Cooling S2</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48925" advanced="true"> <item-type>Number</item-type> - <label>Limit humidity in room, cooling S1</label> + <label>Limit Humidity in Room, Cooling S1</label> <description>Limit humidity in room, cooling</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48926" advanced="true"> <item-type>Number</item-type> - <label>Humidity factor</label> + <label>Humidity Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature. </description> @@ -6105,7 +6105,7 @@ </channel-type> <channel-type id="f1x55-48927" advanced="true"> <item-type>Number</item-type> - <label>Humidity cool factor</label> + <label>Humidity Cool Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature in cooling mode. </description> @@ -6139,186 +6139,186 @@ </channel-type> <channel-type id="f1x55-48948" advanced="true"> <item-type>Switch</item-type> - <label>FLM pump 4</label> + <label>FLM Pump 4</label> <description>Operating mode for the FLM pump 4</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48949" advanced="true"> <item-type>Switch</item-type> - <label>FLM pump 3</label> + <label>FLM Pump 3</label> <description>Operating mode for the FLM pump 3</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48950" advanced="true"> <item-type>Switch</item-type> - <label>FLM pump 2</label> + <label>FLM Pump 2</label> <description>Operating mode for the FLM pump 2</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48951" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 defrost</label> + <label>FLM 4 Defrost</label> <description>Minimum time between defrost in FLM 4</description> <state min="1" max="30" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48952" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 defrost</label> + <label>FLM 3 Defrost</label> <description>Minimum time between defrost in FLM 3</description> <state min="1" max="30" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48953" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 defrost</label> + <label>FLM 2 Defrost</label> <description>Minimum time between defrost in FLM 2</description> <state min="1" max="30" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48954" advanced="true"> <item-type>Switch</item-type> - <label>FLM 4 cooling</label> + <label>FLM 4 Cooling</label> <description>FLM 4 cooling activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48955" advanced="true"> <item-type>Switch</item-type> - <label>FLM 3 cooling</label> + <label>FLM 3 Cooling</label> <description>FLM 3 cooling activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48956" advanced="true"> <item-type>Switch</item-type> - <label>FLM 2 cooling</label> + <label>FLM 2 Cooling</label> <description>FLM 2 cooling activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48957" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 pump speed</label> + <label>FLM 4 Pump Speed</label> <description>FLM 4 pump speed</description> <state min="1" max="100" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48958" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 pump speed</label> + <label>FLM 3 Pump Speed</label> <description>FLM 3 pump speed</description> <state min="1" max="100" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48959" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 pump speed</label> + <label>FLM 2 Pump Speed</label> <description>FLM 2 pump speed</description> <state min="1" max="100" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48960" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 pump speed</label> + <label>FLM 1 Pump Speed</label> <description>FLM 1 pump speed</description> <state min="1" max="100" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48961" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 over temp</label> + <label>FLM 4 over Temp</label> <description>Over temp for cooling active, when using FLM cooling</description> <state min="10" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48962" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 over temp</label> + <label>FLM 3 over Temp</label> <description>Over temp for cooling active, when using FLM cooling</description> <state min="10" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48963" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 over temp</label> + <label>FLM 2 over Temp</label> <description>Over temp for cooling active, when using FLM cooling</description> <state min="10" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48964" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 over temp</label> + <label>FLM 1 over Temp</label> <description>Over temp for cooling active, when using FLM cooling</description> <state min="10" max="100" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48965" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 set point, cooling</label> + <label>FLM 4 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48966" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 set point, cooling</label> + <label>FLM 3 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48967" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 set point, cooling</label> + <label>FLM 2 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48968" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 set point, cooling</label> + <label>FLM 1 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48969" advanced="true"> <item-type>Number</item-type> - <label>AUX block OPT</label> + <label>AUX Block OPT</label> <description>AUX block OPT</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48970" advanced="true"> <item-type>Switch</item-type> - <label>Outdoor Air Mixing function</label> + <label>Outdoor Air Mixing Function</label> <description>Activates the Outdoor Air Mixing function.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48976" advanced="true"> <item-type>Switch</item-type> - <label>Smart home room control</label> + <label>Smart Home Room Control</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48977" advanced="true"> <item-type>Number</item-type> - <label>Speed brine pump wait mode</label> + <label>Speed Brine Pump Wait Mode</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48979" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source</label> + <label>Smart Energy Source</label> <description>Smart energy source activated.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48980" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source, ctrl method</label> + <label>Smart Energy Source, Ctrl Method</label> <description>Smart energy source, ctrl method. 0 = price. 1 = primary factor.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48981" advanced="true"> <item-type>String</item-type> - <label>Smart energy source, electricity price source</label> + <label>Smart Energy Source, Electricity Price Source</label> <description>Smart energy source, electricity price source. 0 = fixed price. 1 = tariff. 2= spot price. </description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> @@ -6331,14 +6331,14 @@ </channel-type> <channel-type id="f1x55-48982" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, electricity price</label> + <label>Smart Energy Source, Electricity Price</label> <description>Smart energy source, electricity fixed price.</description> <state min="0" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48983" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source, fixed elec. price from</label> + <label>Smart Energy Source, Fixed Elec. Price From</label> <description>Smart energy source, fixed electricity price part source, if spot electricity price are used. 0 = fixed price. 1 = tariff. </description> @@ -6346,14 +6346,14 @@ </channel-type> <channel-type id="f1x55-48984" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, fixed part electricity price</label> + <label>Smart Energy Source, Fixed Part Electricity Price</label> <description>Smart energy source, fixed part (if spot price are used) electricity price</description> <state min="0" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48985" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source, shunt add price source</label> + <label>Smart Energy Source, Shunt Add Price Source</label> <description>Smart energy source, shunted addition price part source. From tariff or fixed price. 0 = fixed price. 1 = tariff. </description> @@ -6361,14 +6361,14 @@ </channel-type> <channel-type id="f1x55-48986" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, shunt add price</label> + <label>Smart Energy Source, Shunt Add Price</label> <description>Smart energy source, shunted add price</description> <state min="0" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48987" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source, ext step add price from</label> + <label>Smart Energy Source, Ext Step Add Price From</label> <description>Smart energy source, external step add source. From tariff or fixed price. 0 = fixed price. 1 = tariff. </description> @@ -6376,180 +6376,180 @@ </channel-type> <channel-type id="f1x55-48988" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, ext step add price</label> + <label>Smart Energy Source, Ext Step Add Price</label> <description>Smart energy source, ext step add price</description> <state min="0" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48989" advanced="true"> <item-type>Switch</item-type> - <label>Smart energy source, OPT10 price source</label> + <label>Smart Energy Source, OPT10 Price Source</label> <description>Smart energy source, OPT10 addition price source. 0 = fixed price. 1 = tariff.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-48990" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, OPT10 price</label> + <label>Smart Energy Source, OPT10 Price</label> <description>Smart energy source, OPT10 addition price.</description> <state min="0" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48991" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, primary factor elec.</label> + <label>Smart Energy Source, Primary Factor Elec.</label> <description>Smart energy source, primary factor electricity</description> <state min="0" max="50" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48992" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, primary factor shunted add.</label> + <label>Smart Energy Source, Primary Factor Shunted Add.</label> <description>Smart energy source, primary factor shunted addition</description> <state min="0" max="50" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48993" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, primary factor ext step add</label> + <label>Smart Energy Source, Primary Factor Ext Step Add</label> <description>Smart energy source, primary factor external step addition</description> <state min="0" max="50" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48994" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, primary factor OPT10 add.</label> + <label>Smart Energy Source, Primary Factor OPT10 Add.</label> <description>Smart energy source, primary factor OPT10 addition</description> <state min="0" max="50" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48995" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, OPT10 high tariff price</label> + <label>Smart Energy Source, OPT10 High Tariff Price</label> <description>Smart energy source, OPT10 addition high tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48996" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, OPT10 low tariff price</label> + <label>Smart Energy Source, OPT10 Low Tariff Price</label> <description>Smart energy source, OPT10 addition low tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48997" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, ext step add high tariff price</label> + <label>Smart Energy Source, Ext Step Add High Tariff Price</label> <description>Smart energy source, external step addition high tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48998" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, ext step add low tariff price</label> + <label>Smart Energy Source, Ext Step Add Low Tariff Price</label> <description>Smart energy source, external step addition low tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-48999" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, shunt add high tariff price</label> + <label>Smart Energy Source, Shunt Add High Tariff Price</label> <description>Smart energy source, shunt addition high tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49000" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, shunt add low tariff price</label> + <label>Smart Energy Source, Shunt Add Low Tariff Price</label> <description>Smart energy source, shunt addition low tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49001" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, fixed elec. high tariff price</label> + <label>Smart Energy Source, Fixed Elec. High Tariff Price</label> <description>Smart energy source, fixed electricity part high tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49002" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, fixed elec. low tariff price</label> + <label>Smart Energy Source, Fixed Elec. Low Tariff Price</label> <description>Smart energy source, fixed electricity part low tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49003" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, electricity high tariff price</label> + <label>Smart Energy Source, Electricity High Tariff Price</label> <description>Smart energy source, electricity high tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49004" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, electricity high low price</label> + <label>Smart Energy Source, Electricity High Low Price</label> <description>Smart energy source, electricity low tariff price</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49005" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, DM diff source prio 5</label> + <label>Smart Energy Source, DM Diff Source Prio 5</label> <description>Smart energy source, DM diff source with prio 5</description> <state min="100" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49006" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, DM diff source prio 4</label> + <label>Smart Energy Source, DM Diff Source Prio 4</label> <description>Smart energy source, DM diff source with prio 4</description> <state min="100" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49007" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, DM diff source prio 3</label> + <label>Smart Energy Source, DM Diff Source Prio 3</label> <description>Smart energy source, DM diff source with prio 3</description> <state min="100" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49008" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, DM diff source prio 2</label> + <label>Smart Energy Source, DM Diff Source Prio 2</label> <description>Smart energy source, DM diff source with prio 2</description> <state min="100" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49009" advanced="true"> <item-type>Number</item-type> - <label>Smart energy source, DM start source prio 1</label> + <label>Smart Energy Source, DM Start Source Prio 1</label> <description>Smart energy source, DM start source with prio 1</description> <state min="-2000" max="-10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49190" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump temp alarm</label> + <label>Ground Water Pump Temp Alarm</label> <description>Ground water pump temperature alarm</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49191" advanced="true"> <item-type>Number</item-type> - <label>Ground water pump temp alarm level</label> + <label>Ground Water Pump Temp Alarm Level</label> <description>Ground water pump temperature alarm level</description> <state min="-15" max="20" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49192" advanced="true"> <item-type>Number</item-type> - <label>Fixed delta t, brine pump</label> + <label>Fixed Delta T, Brine Pump</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49193" advanced="true"> <item-type>String</item-type> - <label>Brine pump auto controlled</label> + <label>Brine Pump Auto Controlled</label> <description>Brine pump auto controlled, 0= manual, 1 = auto controlled, 2 = fixed delta controlled </description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> @@ -6562,106 +6562,106 @@ </channel-type> <channel-type id="f1x55-49221" advanced="true"> <item-type>Number</item-type> - <label>Delta brine pump passive cooling</label> + <label>Delta Brine Pump Passive Cooling</label> <description></description> <state min="1" max="15" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49241" advanced="true"> <item-type>Number</item-type> - <label>External ERS 1 accessory bypass set temp.</label> + <label>External ERS 1 Accessory Bypass Set Temp.</label> <description></description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49242" advanced="true"> <item-type>Switch</item-type> - <label>External ERS 1 accessory bypass at heat</label> + <label>External ERS 1 Accessory Bypass At Heat</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49277" advanced="true"> <item-type>Number</item-type> - <label>FLM 4 fan</label> + <label>FLM 4 Fan</label> <description>FLM 4 fan</description> <state min="6" max="6" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49278" advanced="true"> <item-type>Number</item-type> - <label>FLM 3 fan</label> + <label>FLM 3 Fan</label> <description>FLM 3 fan</description> <state min="6" max="6" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49279" advanced="true"> <item-type>Number</item-type> - <label>FLM 2 fan</label> + <label>FLM 2 Fan</label> <description>FLM 2 fan</description> <state min="6" max="6" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49280" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 fan</label> + <label>FLM 1 Fan</label> <description>FLM 1 fan</description> <state min="6" max="6" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49285" advanced="true"> <item-type>Number</item-type> - <label>Energy Meter pulses per kWh X23</label> + <label>Energy Meter Pulses Per KWh X23</label> <description>Energy meter factor X23, pulses per kWh</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49286" advanced="true"> <item-type>Number</item-type> - <label>Energy Meter pulses per kWh X22</label> + <label>Energy Meter Pulses Per KWh X22</label> <description>Energy meter factor X22, pulses per kWh</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49287" advanced="true"> <item-type>Switch</item-type> - <label>Energy Meter mode X23</label> + <label>Energy Meter Mode X23</label> <description>Energy meter X23 in mode Wh/pulse = 0 or pulses/kWh = 1</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49288" advanced="true"> <item-type>Switch</item-type> - <label>Energy Meter mode X22</label> + <label>Energy Meter Mode X22</label> <description>Energy meter X22 in mode Wh/pulse = 0 or pulses/kWh = 1</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49289" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump speed control</label> + <label>Ground Water Pump Speed Control</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49290" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump auto speed control</label> + <label>Ground Water Pump Auto Speed Control</label> <description>Ground water pump auto speed control</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49291" advanced="true"> <item-type>Number</item-type> - <label>Ground water pump manual speed</label> + <label>Ground Water Pump Manual Speed</label> <description>Ground water pump temperature alarm level</description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49292" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump control signal</label> + <label>Ground Water Pump Control Signal</label> <description>Ground water pump control signal (0 = 0V-10V; 1 = 10V-0V)</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49293" advanced="true"> <item-type>Number</item-type> - <label>Ground water pump min speed</label> + <label>Ground Water Pump Min Speed</label> <description>Ground water pump voltage at min speed</description> <state min="0" max="80" step="1" pattern="%d V" readOnly="false"> </state> @@ -6685,373 +6685,373 @@ </channel-type> <channel-type id="f1x55-49328" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Exhaust Fan speed 4</label> + <label>ERS 4 Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49329" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Exhaust Fan speed 4</label> + <label>ERS 3 Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49330" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Exhaust Fan speed 4</label> + <label>ERS 2 Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49331" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Exhaust Fan speed 3</label> + <label>ERS 4 Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49332" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Exhaust Fan speed 3</label> + <label>ERS 3 Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49333" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Exhaust Fan speed 3</label> + <label>ERS 2 Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49334" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Exhaust Fan speed 2</label> + <label>ERS 4 Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49335" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Exhaust Fan speed 2</label> + <label>ERS 3 Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49336" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Exhaust Fan speed 2</label> + <label>ERS 2 Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49337" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Exhaust Fan speed 1</label> + <label>ERS 4 Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49338" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Exhaust Fan speed 1</label> + <label>ERS 3 Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49339" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Exhaust Fan speed 1</label> + <label>ERS 2 Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49340" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Exhaust Fan speed normal</label> + <label>ERS 4 Exhaust Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49341" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Exhaust Fan speed normal</label> + <label>ERS 3 Exhaust Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49342" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Exhaust Fan speed normal</label> + <label>ERS 2 Exhaust Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49343" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Supply Fan speed 4</label> + <label>ERS 4 Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49344" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Supply Fan speed 4</label> + <label>ERS 3 Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49345" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Supply Fan speed 4</label> + <label>ERS 2 Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49346" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Supply Fan speed 3</label> + <label>ERS 4 Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49347" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Supply Fan speed 3</label> + <label>ERS 3 Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49348" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Supply Fan speed 3</label> + <label>ERS 2 Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49349" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Supply Fan speed 2</label> + <label>ERS 4 Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49350" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Supply Fan speed 2</label> + <label>ERS 3 Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49351" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Supply Fan speed 2</label> + <label>ERS 2 Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49352" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Supply Fan speed 1</label> + <label>ERS 4 Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49353" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Supply Fan speed 1</label> + <label>ERS 3 Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49354" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Supply Fan speed 1</label> + <label>ERS 2 Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49355" advanced="true"> <item-type>Number</item-type> - <label>ERS 4 Supply Fan speed normal</label> + <label>ERS 4 Supply Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49356" advanced="true"> <item-type>Number</item-type> - <label>ERS 3 Supply Fan speed normal</label> + <label>ERS 3 Supply Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49357" advanced="true"> <item-type>Number</item-type> - <label>ERS 2 Supply Fan speed normal</label> + <label>ERS 2 Supply Fan Speed Normal</label> <description></description> <state min="1" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49358" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. </description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49359" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. </description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49360" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. </description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49361" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49362" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49363" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49364" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49365" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49366" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49367" advanced="true"> <item-type>Switch</item-type> - <label>ERS 4 accessory</label> + <label>ERS 4 Accessory</label> <description>Activates the ERS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49368" advanced="true"> <item-type>Switch</item-type> - <label>ERS 3 accessory</label> + <label>ERS 3 Accessory</label> <description>Activates the ERS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49369" advanced="true"> <item-type>Switch</item-type> - <label>ERS 2 accessory</label> + <label>ERS 2 Accessory</label> <description>Activates the ERS accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49370" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory min exhaust temp.</label> + <label>External ERS 4 Accessory Min Exhaust Temp.</label> <description></description> <state min="0" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49371" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory min exhaust temp.</label> + <label>External ERS 3 Accessory Min Exhaust Temp.</label> <description></description> <state min="0" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49372" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory min exhaust temp.</label> + <label>External ERS 2 Accessory Min Exhaust Temp.</label> <description></description> <state min="0" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49373" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory bypass temp.</label> + <label>External ERS 4 Accessory Bypass Temp.</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49374" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory bypass temp.</label> + <label>External ERS 3 Accessory Bypass Temp.</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49375" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory bypass temp.</label> + <label>External ERS 2 Accessory Bypass Temp.</label> <description></description> <state min="2" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49376" advanced="true"> <item-type>Number</item-type> - <label>External ERS 4 accessory bypass set temp.</label> + <label>External ERS 4 Accessory Bypass Set Temp.</label> <description></description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49377" advanced="true"> <item-type>Number</item-type> - <label>External ERS 3 accessory bypass set temp.</label> + <label>External ERS 3 Accessory Bypass Set Temp.</label> <description></description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49378" advanced="true"> <item-type>Number</item-type> - <label>External ERS 2 accessory bypass set temp.</label> + <label>External ERS 2 Accessory Bypass Set Temp.</label> <description></description> <state min="5" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f1x55-49379" advanced="true"> <item-type>Switch</item-type> - <label>External ERS 4 accessory bypass at heat</label> + <label>External ERS 4 Accessory Bypass At Heat</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49380" advanced="true"> <item-type>Switch</item-type> - <label>External ERS 3 accessory bypass at heat</label> + <label>External ERS 3 Accessory Bypass At Heat</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f1x55-49381" advanced="true"> <item-type>Switch</item-type> - <label>External ERS 2 accessory bypass at heat</label> + <label>External ERS 2 Accessory Bypass At Heat</label> <description></description> <state readOnly="false"></state> </channel-type> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55.xml index f4dd004075aaf..10d11511c9895 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f1x55.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="f1x55-udp"> - <label>UDP connected Nibe F1155 and F1255 Heat Pumps</label> + <label>UDP Connected Nibe F1155 and F1255 Heat Pumps</label> <description></description> <channel-groups> @@ -24,12 +24,12 @@ <default>9999</default> </parameter> <parameter name="readCommandsPort" type="integer"> - <label>UDP Port For Read Commands</label> + <label>UDP Port for Read Commands</label> <description>UDP port to send read commands to the NibeGW.</description> <default>9999</default> </parameter> <parameter name="writeCommandsPort" type="integer"> - <label>UDP Port For Write Commands</label> + <label>UDP Port for Write Commands</label> <description>UDP port to send write commands to the NibeGW.</description> <default>10000</default> </parameter> @@ -51,7 +51,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Registers List For Write Commands</label> + <label>Registers List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> @@ -65,7 +65,7 @@ </thing-type> <thing-type id="f1x55-serial"> - <label>Serial port connected F1155 and F1255 Heat Pumps</label> + <label>Serial Port Connected F1155 and F1255 Heat Pumps</label> <description></description> <channel-groups> @@ -96,22 +96,22 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> <parameter name="sendAckToMODBUS40" type="boolean"> - <label>Enable Acknowledges To MODBUS40 Messages</label> + <label>Enable Acknowledges to MODBUS40 Messages</label> <description>Binding emulates MODBUS40 device and send protocol acknowledges to heat pump.</description> <default>true</default> </parameter> <parameter name="sendAckToRMU40" type="boolean"> - <label>Enable Acknowledges To RMU40 Messages</label> + <label>Enable Acknowledges to RMU40 Messages</label> <description>Binding emulates RMU40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> <parameter name="sendAckToSMS40" type="boolean"> - <label>Enable Acknowledges To SMS40 Messages</label> + <label>Enable Acknowledges to SMS40 Messages</label> <description>Binding emulates SMS40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> @@ -151,7 +151,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470-types.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470-types.xml index 4c92ad9216ce3..dd822c4443bd6 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470-types.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470-types.xml @@ -13,35 +13,35 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40005" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT2 Supply temp S4</label> + <label>EP23-BT2 Supply Temp S4</label> <description>Supply temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40006" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT2 Supply temp S3</label> + <label>EP22-BT2 Supply Temp S3</label> <description>Supply temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40007" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT2 Supply temp S2</label> + <label>EP21-BT2 Supply Temp S2</label> <description>Supply temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40008" advanced="true"> <item-type>Number</item-type> - <label>BT2 Supply temp S1</label> + <label>BT2 Supply Temp S1</label> <description>Supply temperature for system 1</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40012" advanced="true"> <item-type>Number</item-type> - <label>EB100-EP14-BT3 Return temp</label> + <label>EB100-EP14-BT3 Return Temp</label> <description>Return temperature</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -62,7 +62,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40020" advanced="false"> <item-type>Number</item-type> - <label>EB100-BT16 Evaporator temp</label> + <label>EB100-BT16 Evaporator Temp</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -76,28 +76,28 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40023" advanced="false"> <item-type>Number</item-type> - <label>EB100-BT18 Compressor temp.</label> + <label>EB100-BT18 Compressor Temp.</label> <description>Valid only for F3/470</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40024" advanced="false"> <item-type>Number</item-type> - <label>EB100-BT19 Addition temp.</label> + <label>EB100-BT19 Addition Temp.</label> <description>Valid only for F3/470</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40025" advanced="false"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40026" advanced="false"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -146,7 +146,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40054" advanced="true"> <item-type>Number</item-type> - <label>EB100-FD1 Temperature limiter</label> + <label>EB100-FD1 Temperature Limiter</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -174,7 +174,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40075" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -209,84 +209,84 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40122" advanced="true"> <item-type>Number</item-type> - <label>BT52 external water heater load temp.</label> + <label>BT52 External Water Heater Load Temp.</label> <description>Used in DEH and AHPS Docking accessories</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40127" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT3 Return temp S4</label> + <label>EP23-BT3 Return Temp S4</label> <description>Return temperature for system 4</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40128" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT3 Return temp S3</label> + <label>EP22-BT3 Return Temp S3</label> <description>Return temperature for system 3</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40129" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT3 Return temp S2</label> + <label>EP21-BT3 Return Temp S2</label> <description>Return temperature for system 2</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40159" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT2 Supply temp S8</label> + <label>EP47-BT2 Supply Temp S8</label> <description>Supply temperature for system 8</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40160" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT2 Supply temp S7</label> + <label>EP46-BT2 Supply Temp S7</label> <description>Supply temperature for system 7</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40161" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT2 Supply temp S6</label> + <label>EP45-BT2 Supply Temp S6</label> <description>Supply temperature for system 6</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40162" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT2 Supply temp S5</label> + <label>EP44-BT2 Supply Temp S5</label> <description>Supply temperature for system 5</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40163" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT3 Return temp S8</label> + <label>EP47-BT3 Return Temp S8</label> <description>Return temperature for system 8</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40164" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT3 Return temp S7</label> + <label>EP46-BT3 Return Temp S7</label> <description>Return temperature for system 7</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40165" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT3 Return temp S6</label> + <label>EP45-BT3 Return Temp S6</label> <description>Return temperature for system 6</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40166" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT3 Return temp S5</label> + <label>EP44-BT3 Return Temp S5</label> <description>Return temperature for system 5</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -447,63 +447,63 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40339" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S8</label> + <label>External Adjustment Activated Via Input S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40340" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S7</label> + <label>External Adjustment Activated Via Input S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40341" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S6</label> + <label>External Adjustment Activated Via Input S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40342" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S5</label> + <label>External Adjustment Activated Via Input S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40365" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S8</label> + <label>Extra Heating System Pump S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40366" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S7</label> + <label>Extra Heating System Pump S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40367" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S6</label> + <label>Extra Heating System Pump S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40368" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S5</label> + <label>Extra Heating System Pump S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40755" advanced="true"> <item-type>Number</item-type> - <label>Tot. ext. HW add op.time</label> + <label>Tot. Ext. HW Add Op.time</label> <description>Total external hw-electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> @@ -517,21 +517,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40870" advanced="true"> <item-type>Number</item-type> - <label>+Adjust OP mode</label> + <label>+Adjust OP Mode</label> <description>Tells if plusadjust system calls for heat or cool</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40871" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Comfort mode</label> + <label>+Adjust Comfort Mode</label> <description>Which comfort mode</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-40872" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell adjustment</label> + <label>+Adjust Parallell Adjustment</label> <description>requested adjustment</description> <state pattern="%d" readOnly="true"> </state> @@ -545,14 +545,14 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-40874" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp indoor</label> + <label>+Adjust Temp Indoor</label> <description>Average of all room sensors</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-40875" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp outdoor</label> + <label>+Adjust Temp Outdoor</label> <description>Outdoor temp</description> <state pattern="%.1f °C" readOnly="true"> </state> @@ -587,7 +587,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-41027" advanced="true"> <item-type>Number</item-type> - <label>Humidity average</label> + <label>Humidity Average</label> <description>Humidity average</description> <state pattern="%.1f %" readOnly="true"> </state> @@ -615,21 +615,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-41256" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f470-41257" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f470-41258" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> @@ -648,63 +648,63 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-41266" advanced="true"> <item-type>Number</item-type> - <label>Offset to smart home system</label> + <label>Offset to Smart Home System</label> <description>Offset to smart home system</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-41267" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 8</label> + <label>Smart Home Ctrl Syst 8</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41268" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 7</label> + <label>Smart Home Ctrl Syst 7</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41269" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 6</label> + <label>Smart Home Ctrl Syst 6</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41270" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 5</label> + <label>Smart Home Ctrl Syst 5</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41271" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 4</label> + <label>Smart Home Ctrl Syst 4</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41272" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 3</label> + <label>Smart Home Ctrl Syst 3</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41273" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 2</label> + <label>Smart Home Ctrl Syst 2</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-41274" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 1</label> + <label>Smart Home Ctrl Syst 1</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> @@ -1390,35 +1390,35 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-42101" advanced="true"> <item-type>Number</item-type> - <label>Used heating power average, 24h</label> + <label>Used Heating Power Average, 24h</label> <description>Used heating power average, 24h</description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-42136" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-42137" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-42138" advanced="true"> <item-type>Number</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f °C" readOnly="true"> </state> </channel-type> <channel-type id="f470-43001" advanced="true"> <item-type>Number</item-type> - <label>Software version</label> + <label>Software Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1463,14 +1463,14 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-43081" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time add.</label> + <label>Tot. Op.time Add.</label> <description>Total electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f470-43084" advanced="false"> <item-type>Number</item-type> - <label>Int. el.add. Power</label> + <label>Int. El.add. Power</label> <description>Current power from the internal electrical addition</description> <state pattern="%.2f kW" readOnly="true"> </state> @@ -1493,7 +1493,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-43091" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. State</label> + <label>Int. El.add. State</label> <description>Number of steps active for internal step-controlled addition</description> <state pattern="%d" readOnly="true"> </state> @@ -1535,35 +1535,35 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-43108" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f470-43158" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S4</label> + <label>External Adjustment Activated Via Input S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-43159" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S3</label> + <label>External Adjustment Activated Via Input S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-43160" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S2</label> + <label>External Adjustment Activated Via Input S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-43161" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S1</label> + <label>External Adjustment Activated Via Input S1</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1581,7 +1581,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-43239" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time add.</label> + <label>Tot. HW Op.time Add.</label> <description>Total electric additive operation time in hot water mode</description> <state pattern="%.1f h" readOnly="true"> </state> @@ -1595,21 +1595,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-43416" advanced="true"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressorer starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-43420" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f470-43424" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time in hot water mode</description> <state pattern="%d h" readOnly="true"> </state> @@ -1681,35 +1681,35 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-44331" advanced="true"> <item-type>Number</item-type> - <label>Software release</label> + <label>Software Release</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-44744" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S4</label> + <label>Extra Heating System Pump S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-44745" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S3</label> + <label>Extra Heating System Pump S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-44746" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S2</label> + <label>Extra Heating System Pump S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-44750" advanced="true"> <item-type>Number</item-type> - <label>FJVM pump</label> + <label>FJVM Pump</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1723,14 +1723,14 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-44878" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input A</label> + <label>SG Ready Input A</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f470-44879" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input B</label> + <label>SG Ready Input B</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1772,7 +1772,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-44908" advanced="true"> <item-type>Number</item-type> - <label>State smart price adaption</label> + <label>State Smart Price Adaption</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -1786,70 +1786,70 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47291" advanced="true"> <item-type>Number</item-type> - <label>Floor drying timer</label> + <label>Floor Drying Timer</label> <description></description> <state pattern="%d hrs" readOnly="true"> </state> </channel-type> <channel-type id="f470-40879" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell factor</label> + <label>+Adjust Parallell Factor</label> <description></description> <state min="1" max="10" step="1" pattern="%d 1" readOnly="false"> </state> </channel-type> <channel-type id="f470-40880" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Max change</label> + <label>+Adjust Max Change</label> <description>Largest allowed change</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-40881" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system8</label> + <label>+Adjust Affect System8</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40882" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system7</label> + <label>+Adjust Affect System7</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40883" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system6</label> + <label>+Adjust Affect System6</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40884" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system5</label> + <label>+Adjust Affect System5</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40885" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system4</label> + <label>+Adjust Affect System4</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40886" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system3</label> + <label>+Adjust Affect System3</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40887" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system2</label> + <label>+Adjust Affect System2</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-40888" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system1</label> + <label>+Adjust Affect System1</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> @@ -2023,77 +2023,77 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47027" advanced="true"> <item-type>Number</item-type> - <label>Point offset outdoor temp.</label> + <label>Point Offset Outdoor Temp.</label> <description>Outdoor temperature point where the heat curve is offset</description> <state min="-40" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47028" advanced="true"> <item-type>Number</item-type> - <label>Point offset</label> + <label>Point Offset</label> <description>Amount of offset at the point offset temperature</description> <state min="-10" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47029" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S4</label> + <label>External Adjustment S4</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-47030" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S3</label> + <label>External Adjustment S3</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-47031" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S2</label> + <label>External Adjustment S2</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-47032" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S1</label> + <label>External Adjustment S1</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-47033" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S4</label> + <label>External Adjustment with Room Sensor S4</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47034" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S3</label> + <label>External Adjustment with Room Sensor S3</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47035" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S2</label> + <label>External Adjustment with Room Sensor S2</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47036" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S1</label> + <label>External Adjustment with Room Sensor S1</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47041" advanced="true"> <item-type>String</item-type> - <label>Hot water comfort mode</label> + <label>Hot Water Comfort Mode</label> <description>Setting in menu 2.2. 0=Economy,1=Normal,2=Luxury,4=Smart Control 0=Economy 1=Normal 2=Luxury</description> <state min="0" max="4" step="1" pattern="%d" readOnly="false"> <options> @@ -2109,49 +2109,49 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47043" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Luxury</label> + <label>Start Temperature HW Luxury</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47044" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Normal</label> + <label>Start Temperature HW Normal</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47045" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Economy</label> + <label>Start Temperature HW Economy</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47046" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature Periodic HW</label> + <label>Stop Temperature Periodic HW</label> <description>Temperature where hot water generation will stop</description> <state min="550" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47047" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Luxury</label> + <label>Stop Temperature HW Luxury</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47048" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Normal</label> + <label>Stop Temperature HW Normal</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47049" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Economy</label> + <label>Stop Temperature HW Economy</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f °C" readOnly="false"> </state> @@ -2171,14 +2171,14 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47054" advanced="true"> <item-type>Number</item-type> - <label>Run time HWC</label> + <label>Run Time HWC</label> <description>Run time for the hot water circulation system</description> <state min="1" max="60" step="1" pattern="%d min" readOnly="false"> </state> </channel-type> <channel-type id="f470-47055" advanced="true"> <item-type>Number</item-type> - <label>Still time HWC</label> + <label>Still Time HWC</label> <description>Still time for the hot water circulation system</description> <state min="0" max="60" step="1" pattern="%d min" readOnly="false"> </state> @@ -2209,7 +2209,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47137" advanced="true"> <item-type>String</item-type> - <label>Operational mode</label> + <label>Operational Mode</label> <description>The operational mode of the heat pump 0=Auto 1=Manual 2=Add. heat only</description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -2221,7 +2221,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47138" advanced="true"> <item-type>String</item-type> - <label>Operational mode heat medium pump</label> + <label>Operational Mode Heat Medium Pump</label> <description> 10=Intermittent 20=Continous 30=Economy 40=Auto</description> <state min="10" max="40" step="1" pattern="%d" readOnly="false"> <options> @@ -2234,7 +2234,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47212" advanced="true"> <item-type>Number</item-type> - <label>Max int add. power</label> + <label>Max Int Add. Power</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f kW" readOnly="false"> </state> @@ -2248,223 +2248,223 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47261" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 4</label> + <label>Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47262" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 3</label> + <label>Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47263" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 2</label> + <label>Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47264" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 1</label> + <label>Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47265" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed normal</label> + <label>Exhaust Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47266" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 4</label> + <label>Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47267" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 3</label> + <label>Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47268" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 2</label> + <label>Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47269" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 1</label> + <label>Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47270" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed normal</label> + <label>Supply Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-47271" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 4</label> + <label>Fan Return Time 4</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f470-47272" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 3</label> + <label>Fan Return Time 3</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f470-47273" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 2</label> + <label>Fan Return Time 2</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f470-47274" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 1</label> + <label>Fan Return Time 1</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f470-47275" advanced="true"> <item-type>Number</item-type> - <label>Filter Reminder period</label> + <label>Filter Reminder Period</label> <description>Time between the reminder of filter replacement/cleaning.</description> <state min="1" max="24" step="1" pattern="%d Months" readOnly="false"> </state> </channel-type> <channel-type id="f470-47276" advanced="true"> <item-type>Switch</item-type> - <label>Floor drying</label> + <label>Floor Drying</label> <description> 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47277" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 7</label> + <label>Floor Drying Period 7</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47278" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 6</label> + <label>Floor Drying Period 6</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47279" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 5</label> + <label>Floor Drying Period 5</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47280" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 4</label> + <label>Floor Drying Period 4</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47281" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 3</label> + <label>Floor Drying Period 3</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47282" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 2</label> + <label>Floor Drying Period 2</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47283" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 1</label> + <label>Floor Drying Period 1</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f470-47284" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 7</label> + <label>Floor Drying Temp. 7</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47285" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 6</label> + <label>Floor Drying Temp. 6</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47286" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 5</label> + <label>Floor Drying Temp. 5</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47287" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 4</label> + <label>Floor Drying Temp. 4</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47288" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 3</label> + <label>Floor Drying Temp. 3</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47289" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 2</label> + <label>Floor Drying Temp. 2</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47290" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 1</label> + <label>Floor Drying Temp. 1</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47292" advanced="true"> <item-type>Number</item-type> - <label>Trend temperature</label> + <label>Trend Temperature</label> <description>Above the set outdoor temperature the addition activation time is limited to give the compressor more time to raise the hot water temperature.</description> <state min="0" max="200" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47293" advanced="true"> <item-type>Number</item-type> - <label>Transfer time HW-Heat</label> + <label>Transfer Time HW-Heat</label> <description>Time between hot water and heating operating mode</description> <state min="1" max="60" step="1" pattern="%d mins" readOnly="false"> </state> @@ -2478,80 +2478,80 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47301" advanced="true"> <item-type>Number</item-type> - <label>delta T at DOT</label> + <label>Delta T At DOT</label> <description>Delta T (BT12-BT3)at dimensioning outdoor temperature</description> <state min="10" max="250" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47302" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 2 accessory</label> + <label>Climate System 2 Accessory</label> <description>Activates the climate system 2 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47303" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 3 accessory</label> + <label>Climate System 3 Accessory</label> <description>Activates the climate system 3 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47304" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 4 accessory</label> + <label>Climate System 4 Accessory</label> <description>Activates the climate system 4 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47305" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 mixing valve amp.</label> + <label>Climate System 4 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47306" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 mixing valve amp.</label> + <label>Climate System 3 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47307" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 mixing valve amp.</label> + <label>Climate System 2 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47308" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 shunt wait</label> + <label>Climate System 4 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-47309" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 shunt wait</label> + <label>Climate System 3 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-47310" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 shunt wait</label> + <label>Climate System 2 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-47351" advanced="true"> <item-type>Switch</item-type> - <label>FJVM accessory</label> + <label>FJVM Accessory</label> <description>Activates the FJVM accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47352" advanced="true"> <item-type>Switch</item-type> - <label>SMS40 accessory</label> + <label>SMS40 Accessory</label> <description>Activates the SMS40 accessory</description> <state readOnly="false"></state> </channel-type> @@ -2635,21 +2635,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47378" advanced="true"> <item-type>Number</item-type> - <label>Max diff. comp.</label> + <label>Max Diff. Comp.</label> <description></description> <state min="10" max="250" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47379" advanced="true"> <item-type>Number</item-type> - <label>Max diff. add.</label> + <label>Max Diff. Add.</label> <description></description> <state min="10" max="240" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47384" advanced="true"> <item-type>String</item-type> - <label>Date format</label> + <label>Date Format</label> <description> 1=DD-MM-YY 2=YY-MM-DD</description> <state min="1" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -2660,7 +2660,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47385" advanced="true"> <item-type>String</item-type> - <label>Time format</label> + <label>Time Format</label> <description> 12=12 hours 24=24 Hours</description> <state min="12" max="24" step="1" pattern="%d" readOnly="false"> <options> @@ -2671,105 +2671,105 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47387" advanced="true"> <item-type>Switch</item-type> - <label>HW production</label> + <label>HW Production</label> <description>Activates hot water production where applicable 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47388" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower room temp.</label> + <label>Alarm Lower Room Temp.</label> <description>Lowers the room temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47389" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower HW temp.</label> + <label>Alarm Lower HW Temp.</label> <description>Lowers the hot water temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47391" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S4</label> + <label>Use Room Sensor S4</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47392" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S3</label> + <label>Use Room Sensor S3</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47393" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S2</label> + <label>Use Room Sensor S2</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47394" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47395" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S4</label> + <label>Room Sensor Setpoint S4</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47396" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S3</label> + <label>Room Sensor Setpoint S3</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47397" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S2</label> + <label>Room Sensor Setpoint S2</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47398" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S1</label> + <label>Room Sensor Setpoint S1</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47399" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S4</label> + <label>Room Sensor Factor S4</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47400" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S3</label> + <label>Room Sensor Factor S3</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47401" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S2</label> + <label>Room Sensor Factor S2</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47402" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-47442" advanced="true"> <item-type>String</item-type> - <label>preset flow clim. sys.</label> + <label>Preset Flow Clim. Sys.</label> <description>Preset flow setting for climate system. 0 = manual setting, 1 = radiator, 2 = floor heating, 3 = radiator + floor heating.</description> <state min="0" max="3" step="1" pattern="%d" readOnly="false"> <options> @@ -2789,33 +2789,33 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-47536" advanced="true"> <item-type>Switch</item-type> - <label>Fan synch mode</label> + <label>Fan Synch Mode</label> <description>If the fan should have a lower speed when the compressor is not running 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47537" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-47538" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47539" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-47556" advanced="true"> <item-type>Switch</item-type> - <label>DEH accessory</label> + <label>DEH Accessory</label> <description>Activates the DEH accessory</description> <state readOnly="false"></state> </channel-type> @@ -2865,25 +2865,25 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-48282" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready heating</label> + <label>SG Ready Heating</label> <description>Sets whether or not SG Ready should affect heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48283" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready cooling</label> + <label>SG Ready Cooling</label> <description>Sets whether or not SG Ready should affect cooling</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48284" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready hot water</label> + <label>SG Ready Hot Water</label> <description>Sets whether or not SG Ready should affect hot water</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48285" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready pool</label> + <label>SG Ready Pool</label> <description>Sets whether or not SG Ready should affect pool</description> <state readOnly="false"></state> </channel-type> @@ -2987,335 +2987,335 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-48503" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S8</label> + <label>External Adjustment S8</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-48504" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S7</label> + <label>External Adjustment S7</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-48505" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S6</label> + <label>External Adjustment S6</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-48506" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S5</label> + <label>External Adjustment S5</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-48507" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S8</label> + <label>External Adjustment with Room Sensor S8</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48508" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S7</label> + <label>External Adjustment with Room Sensor S7</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48509" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S6</label> + <label>External Adjustment with Room Sensor S6</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48510" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S5</label> + <label>External Adjustment with Room Sensor S5</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48569" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 5 accessory</label> + <label>Climate System 5 Accessory</label> <description>Activates the climate system 5 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48570" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 6 accessory</label> + <label>Climate System 6 Accessory</label> <description>Activates the climate system 6 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48571" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 7 accessory</label> + <label>Climate System 7 Accessory</label> <description>Activates the climate system 7 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48572" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 8 accessory</label> + <label>Climate System 8 Accessory</label> <description>Activates the climate system 8 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48573" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 mixing valve amp.</label> + <label>Climate System 8 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48574" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 mixing valve amp.</label> + <label>Climate System 7 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48575" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 mixing valve amp.</label> + <label>Climate System 6 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48576" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 mixing valve amp.</label> + <label>Climate System 5 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48577" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 shunt wait</label> + <label>Climate System 8 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-48578" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 shunt wait</label> + <label>Climate System 7 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-48579" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 shunt wait</label> + <label>Climate System 6 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-48580" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 shunt wait</label> + <label>Climate System 5 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f470-48675" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S8</label> + <label>Use Room Sensor S8</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48676" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S7</label> + <label>Use Room Sensor S7</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48677" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S6</label> + <label>Use Room Sensor S6</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48678" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S5</label> + <label>Use Room Sensor S5</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48680" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S8</label> + <label>Room Sensor Setpoint S8</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48681" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S7</label> + <label>Room Sensor Setpoint S7</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48682" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S6</label> + <label>Room Sensor Setpoint S6</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48683" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S5</label> + <label>Room Sensor Setpoint S5</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48685" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S8</label> + <label>Room Sensor Factor S8</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48686" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S7</label> + <label>Room Sensor Factor S7</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48687" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S6</label> + <label>Room Sensor Factor S6</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48688" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S5</label> + <label>Room Sensor Factor S5</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48732" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S8</label> + <label>Cool Offset S8</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48733" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S7</label> + <label>Cool Offset S7</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48734" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S6</label> + <label>Cool Offset S6</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48735" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S5</label> + <label>Cool Offset S5</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48736" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S4</label> + <label>Cool Offset S4</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48737" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S3</label> + <label>Cool Offset S3</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48738" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S2</label> + <label>Cool Offset S2</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48739" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S1</label> + <label>Cool Offset S1</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f470-48755" advanced="true"> <item-type>Number</item-type> - <label>Transformer ratio</label> + <label>Transformer Ratio</label> <description>Ratio of the current measurement transformers</description> <state min="300" max="2500" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f470-48794" advanced="true"> <item-type>Number</item-type> - <label>RH set value</label> + <label>RH Set Value</label> <description>RH set value</description> <state min="30" max="90" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f470-48810" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S8 </label> + <label>Prevent Humidity S8</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48811" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S7</label> + <label>Prevent Humidity S7</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48812" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S6</label> + <label>Prevent Humidity S6</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48813" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S5</label> + <label>Prevent Humidity S5</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48814" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S4</label> + <label>Prevent Humidity S4</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48815" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S3</label> + <label>Prevent Humidity S3</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48816" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S2</label> + <label>Prevent Humidity S2</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48817" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S1</label> + <label>Prevent Humidity S1</label> <description> </description> <state readOnly="false"></state> </channel-type> @@ -3327,14 +3327,14 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-48926" advanced="true"> <item-type>Number</item-type> - <label>Humidity factor</label> + <label>Humidity Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature.</description> <state min="5" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f470-48927" advanced="true"> <item-type>Number</item-type> - <label>Humidity cool factor</label> + <label>Humidity Cool Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature in cooling mode.</description> <state min="0" max="255" step="1" pattern="%.1f" readOnly="false"> </state> @@ -3359,26 +3359,26 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-48968" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 set point, cooling</label> + <label>FLM 1 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-48970" advanced="true"> <item-type>Switch</item-type> - <label>Outdoor Air Mixing function</label> + <label>Outdoor Air Mixing Function</label> <description>Activates the Outdoor Air Mixing function.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-48976" advanced="true"> <item-type>Switch</item-type> - <label>Smart home room control</label> + <label>Smart Home Room Control</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-49289" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump speed control </label> + <label>Ground Water Pump Speed Control</label> <description> </description> <state readOnly="false"></state> </channel-type> @@ -3401,60 +3401,60 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https:/ </channel-type> <channel-type id="f470-49358" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-49359" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-49360" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f470-49361" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-49362" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-49363" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-49364" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-49365" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> </channel-type> <channel-type id="f470-49366" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d °C" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470.xml index 73b1de29b077e..91a89b18bd493 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f470.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="f470-udp"> - <label>UDP connected Nibe F470 Heat Pumps</label> + <label>UDP Connected Nibe F470 Heat Pumps</label> <description></description> <channel-groups> @@ -24,12 +24,12 @@ <default>9999</default> </parameter> <parameter name="readCommandsPort" type="integer"> - <label>UDP Port For Read Commands</label> + <label>UDP Port for Read Commands</label> <description>UDP port to send read commands to the NibeGW.</description> <default>9999</default> </parameter> <parameter name="writeCommandsPort" type="integer"> - <label>UDP Port For Write Commands</label> + <label>UDP Port for Write Commands</label> <description>UDP port to send write commands to the NibeGW.</description> <default>10000</default> </parameter> @@ -51,7 +51,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Registers List For Write Commands</label> + <label>Registers List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> @@ -65,7 +65,7 @@ </thing-type> <thing-type id="f470-serial"> - <label>Serial port connected F470 Heat Pumps</label> + <label>Serial Port Connected F470 Heat Pumps</label> <description></description> <channel-groups> @@ -75,7 +75,7 @@ <config-description> <parameter name="serialPort" type="text" required="true"> - <label>Serial port</label> + <label>Serial Port</label> <description>Serial port to connect to the heat pump.</description> </parameter> <parameter name="refreshInterval" type="integer"> @@ -84,34 +84,34 @@ <default>60</default> </parameter> <parameter name="enableReadCommands" type="boolean"> - <label>Enable read commands</label> + <label>Enable Read Commands</label> <description>Enable read commands to read additional variable from heat pump which are not included to data readout messages. This is experimental feature, use it at your own risk!</description> <default>false</default> </parameter> <parameter name="enableWriteCommands" type="boolean"> - <label>Enable write commands</label> + <label>Enable Write Commands</label> <description>Enable write commands to change heat pump settings. This is experimental feature, use it at your own risk!</description> <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register list for write commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> <parameter name="sendAckToMODBUS40" type="boolean"> - <label>Enable acknowledges to MODBUS40 messages</label> + <label>Enable Acknowledges to MODBUS40 Messages</label> <description>Binding emulates MODBUS40 device and send protocol acknowledges to heat pump.</description> <default>true</default> </parameter> <parameter name="sendAckToRMU40" type="boolean"> - <label>Enable acknowledges to RMU40 messages</label> + <label>Enable Acknowledges to RMU40 Messages</label> <description>Binding emulates RMU40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> <parameter name="sendAckToSMS40" type="boolean"> - <label>Enable acknowledges to SMS40 messages</label> + <label>Enable Acknowledges to SMS40 Messages</label> <description>Binding emulates SMS40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> @@ -139,19 +139,19 @@ <default>60</default> </parameter> <parameter name="enableReadCommands" type="boolean"> - <label>Enable read commands</label> + <label>Enable Read Commands</label> <description>Enable read commands to read additional variable from heat pump which are not included to data readout messages. This is experimental feature, use it at your own risk!</description> <default>false</default> </parameter> <parameter name="enableWriteCommands" type="boolean"> - <label>Enable write commands</label> + <label>Enable Write Commands</label> <description>Enable write commands to change heat pump settings. This is experimental feature, use it at your own risk!</description> <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register list for write commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 44266, 47004</description> <default></default> </parameter> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750-types.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750-types.xml index 0d34e850aa185..48133727d8511 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750-types.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750-types.xml @@ -19,35 +19,35 @@ </channel-type> <channel-type id="f750-40005" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT2 Supply temp S4</label> + <label>EP23-BT2 Supply Temp S4</label> <description>Supply temperature for system 4</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40006" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT2 Supply temp S3</label> + <label>EP22-BT2 Supply Temp S3</label> <description>Supply temperature for system 3</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40007" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT2 Supply temp S2</label> + <label>EP21-BT2 Supply Temp S2</label> <description>Supply temperature for system 2</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40008" advanced="true"> <item-type>Number</item-type> - <label>BT2 Supply temp S1</label> + <label>BT2 Supply Temp S1</label> <description>Supply temperature for system 1</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40012" advanced="true"> <item-type>Number</item-type> - <label>EB100-EP14-BT3 Return temp</label> + <label>EB100-EP14-BT3 Return Temp</label> <description>Return temperature</description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -89,7 +89,7 @@ </channel-type> <channel-type id="f750-40020" advanced="true"> <item-type>Number</item-type> - <label>EB100-BT16 Evaporator temp</label> + <label>EB100-BT16 Evaporator Temp</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -103,14 +103,14 @@ </channel-type> <channel-type id="f750-40025"> <item-type>Number</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40026"> <item-type>Number</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -173,21 +173,21 @@ </channel-type> <channel-type id="f750-40050"> <item-type>Number</item-type> - <label>EB100-BS1 Air flow</label> + <label>EB100-BS1 Air Flow</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-40051" advanced="true"> <item-type>Number</item-type> - <label>EB100-BS1 Air flow unfiltered</label> + <label>EB100-BS1 Air Flow Unfiltered</label> <description>Unfiltered air flow value</description> <state pattern="%.2f" readOnly="true"> </state> </channel-type> <channel-type id="f750-40054" advanced="true"> <item-type>Number</item-type> - <label>EB100-FD1 Temperature limiter</label> + <label>EB100-FD1 Temperature Limiter</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -222,14 +222,14 @@ </channel-type> <channel-type id="f750-40077" advanced="true"> <item-type>Number</item-type> - <label>BT6 external water heater load temp.</label> + <label>BT6 External Water Heater Load Temp.</label> <description>Used in DEW, SCA and AHPS Docking accessories</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40078" advanced="true"> <item-type>Number</item-type> - <label>BT7 external water heater top temp.</label> + <label>BT7 External Water Heater Top Temp.</label> <description>Used in DEW, SCA and AHPS Docking accessories</description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -257,56 +257,56 @@ </channel-type> <channel-type id="f750-40122" advanced="true"> <item-type>Number</item-type> - <label>BT52 external water heater load temp.</label> + <label>BT52 External Water Heater Load Temp.</label> <description>Used in DEH and AHPS Docking accessories</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40127" advanced="true"> <item-type>Number</item-type> - <label>EP23-BT3 Return temp S4</label> + <label>EP23-BT3 Return Temp S4</label> <description>Return temperature for system 4</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40128" advanced="true"> <item-type>Number</item-type> - <label>EP22-BT3 Return temp S3</label> + <label>EP22-BT3 Return Temp S3</label> <description>Return temperature for system 3</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40129" advanced="true"> <item-type>Number</item-type> - <label>EP21-BT3 Return temp S2</label> + <label>EP21-BT3 Return Temp S2</label> <description>Return temperature for system 2</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40141" advanced="true"> <item-type>Number</item-type> - <label>AZ2-BT22 Supply air temp. SAM</label> + <label>AZ2-BT22 Supply Air Temp. SAM</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40142" advanced="true"> <item-type>Number</item-type> - <label>AZ2-BT23 Outdoor temp. SAM</label> + <label>AZ2-BT23 Outdoor Temp. SAM</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40143" advanced="true"> <item-type>Number</item-type> - <label>AZ2-BT68 Flow temp. SAM</label> + <label>AZ2-BT68 Flow Temp. SAM</label> <description>Heat medium flow temperature to SAM module</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40144" advanced="true"> <item-type>Number</item-type> - <label>AZ2-BT69 Return temp. SAM</label> + <label>AZ2-BT69 Return Temp. SAM</label> <description>Heat medium return temperature from SAM module</description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -327,56 +327,56 @@ </channel-type> <channel-type id="f750-40159" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT2 Supply temp S8</label> + <label>EP47-BT2 Supply Temp S8</label> <description>Supply temperature for system 8</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40160" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT2 Supply temp S7</label> + <label>EP46-BT2 Supply Temp S7</label> <description>Supply temperature for system 7</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40161" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT2 Supply temp S6</label> + <label>EP45-BT2 Supply Temp S6</label> <description>Supply temperature for system 6</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40162" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT2 Supply temp S5</label> + <label>EP44-BT2 Supply Temp S5</label> <description>Supply temperature for system 5</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40163" advanced="true"> <item-type>Number</item-type> - <label>EP47-BT3 Return temp S8</label> + <label>EP47-BT3 Return Temp S8</label> <description>Return temperature for system 8</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40164" advanced="true"> <item-type>Number</item-type> - <label>EP46-BT3 Return temp S7</label> + <label>EP46-BT3 Return Temp S7</label> <description>Return temperature for system 7</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40165" advanced="true"> <item-type>Number</item-type> - <label>EP45-BT3 Return temp S6</label> + <label>EP45-BT3 Return Temp S6</label> <description>Return temperature for system 6</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40166" advanced="true"> <item-type>Number</item-type> - <label>EP44-BT3 Return temp S5</label> + <label>EP44-BT3 Return Temp S5</label> <description>Return temperature for system 5</description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -537,14 +537,14 @@ </channel-type> <channel-type id="f750-40316" advanced="true"> <item-type>Number</item-type> - <label>Inverter limit status</label> + <label>Inverter Limit Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40317" advanced="true"> <item-type>Number</item-type> - <label>Inverter drive status</label> + <label>Inverter Drive Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -565,35 +565,35 @@ </channel-type> <channel-type id="f750-40323" advanced="true"> <item-type>Number</item-type> - <label>Inverter alarm code</label> + <label>Inverter Alarm Code</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40324" advanced="true"> <item-type>Number</item-type> - <label>Inverter fault code</label> + <label>Inverter Fault Code</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40326" advanced="true"> <item-type>Number</item-type> - <label>Inverter drive command</label> + <label>Inverter Drive Command</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40327" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Pic version</label> + <label>NIBE Inverter Pic Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40328" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter 8051 version</label> + <label>NIBE Inverter 8051 Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -607,56 +607,56 @@ </channel-type> <channel-type id="f750-40330" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Mce version</label> + <label>NIBE Inverter Mce Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40331" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Hw version</label> + <label>NIBE Inverter Hw Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40332" advanced="true"> <item-type>Number</item-type> - <label>NIBE Inverter Hw type</label> + <label>NIBE Inverter Hw Type</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40339" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S8</label> + <label>External Adjustment Activated Via Input S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40340" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S7</label> + <label>External Adjustment Activated Via Input S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40341" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S6</label> + <label>External Adjustment Activated Via Input S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40342" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S5</label> + <label>External Adjustment Activated Via Input S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40364" advanced="true"> <item-type>String</item-type> - <label>AHPS Docking blocked</label> + <label>AHPS Docking Blocked</label> <description>0 = unblocked, 1 = blocked</description> <state pattern="%d" readOnly="true"> <options> @@ -667,35 +667,35 @@ </channel-type> <channel-type id="f750-40365" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S8</label> + <label>Extra Heating System Pump S8</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40366" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S7</label> + <label>Extra Heating System Pump S7</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40367" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S6</label> + <label>Extra Heating System Pump S6</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40368" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S5</label> + <label>Extra Heating System Pump S5</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40370" advanced="true"> <item-type>String</item-type> - <label>AHPS Docking accessory relays</label> + <label>AHPS Docking Accessory Relays</label> <description>0=Off, 1=On. b0:EM1-GP4, b1:Cool need, b2:QN32, b3:QN11 close, b4:EP30-GP4, b5:QN11 open ,b6:Ext add</description> <state pattern="%d" readOnly="true"> <options> @@ -706,21 +706,21 @@ </channel-type> <channel-type id="f750-40755" advanced="true"> <item-type>Number</item-type> - <label>Tot. ext. HW add op.time</label> + <label>Tot. Ext. HW Add Op.time</label> <description>Total external hw-electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f750-40760" advanced="true"> <item-type>Number</item-type> - <label>Hz unlimited</label> + <label>Hz Unlimited</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40762" advanced="true"> <item-type>String</item-type> - <label>Reg. state AHPS Docking shunt</label> + <label>Reg. State AHPS Docking Shunt</label> <description>10 = Off, 20 = Running</description> <state pattern="%d" readOnly="true"> <options> @@ -731,7 +731,7 @@ </channel-type> <channel-type id="f750-40763" advanced="true"> <item-type>Number</item-type> - <label>AHPS Docking calc. supply temp.</label> + <label>AHPS Docking Calc. Supply Temp.</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> @@ -752,21 +752,21 @@ </channel-type> <channel-type id="f750-40870" advanced="true"> <item-type>Number</item-type> - <label>+Adjust OP mode</label> + <label>+Adjust OP Mode</label> <description>Tells if plusadjust system calls for heat or cool</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40871" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Comfort mode</label> + <label>+Adjust Comfort Mode</label> <description>Which comfort mode</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40872" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell adjustment</label> + <label>+Adjust Parallell Adjustment</label> <description>requested adjustment</description> <state pattern="%d" readOnly="true"> </state> @@ -780,14 +780,14 @@ </channel-type> <channel-type id="f750-40874" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp indoor</label> + <label>+Adjust Temp Indoor</label> <description>Average of all room sensors</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-40875" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Temp outdoor</label> + <label>+Adjust Temp Outdoor</label> <description>Outdoor temp</description> <state pattern="%.1f°C" readOnly="true"> </state> @@ -822,14 +822,14 @@ </channel-type> <channel-type id="f750-40918" advanced="true"> <item-type>Number</item-type> - <label>EB100-FD3 Temperature limiter</label> + <label>EB100-FD3 Temperature Limiter</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40932" advanced="true"> <item-type>String</item-type> - <label>Kind of defrost</label> + <label>Kind of Defrost</label> <description>Kind of defrost: 0 = No defrost, 1 = Passive defrost, 2 = Active defrost</description> <state pattern="%d" readOnly="true"> <options> @@ -841,35 +841,35 @@ </channel-type> <channel-type id="f750-40934" advanced="true"> <item-type>Number</item-type> - <label>Active defrosting time</label> + <label>Active Defrosting Time</label> <description>Calculated time for active defrosting of the compressor.</description> <state pattern="%d s" readOnly="true"> </state> </channel-type> <channel-type id="f750-40935" advanced="true"> <item-type>Number</item-type> - <label>Passive defrosting time</label> + <label>Passive Defrosting Time</label> <description>Calculated time for passive defrosting of the compressor.</description> <state pattern="%d s" readOnly="true"> </state> </channel-type> <channel-type id="f750-40940" advanced="true"> <item-type>Number</item-type> - <label>Degree Minutes (32 bit)</label> + <label>Degree Minutes (32 Bit)</label> <description>Degree minutes, 32bit value. Full resolution.</description> <state min="-30000" max="30000" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-40993" advanced="true"> <item-type>Number</item-type> - <label>Inverter min speed</label> + <label>Inverter Min Speed</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-40994" advanced="true"> <item-type>Number</item-type> - <label>Inverter max speed</label> + <label>Inverter Max Speed</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -890,14 +890,14 @@ </channel-type> <channel-type id="f750-41026" advanced="true"> <item-type>Number</item-type> - <label>EB100-Adjusted BS1 Air flow</label> + <label>EB100-Adjusted BS1 Air Flow</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-41027" advanced="true"> <item-type>Number</item-type> - <label>Humidity average</label> + <label>Humidity Average</label> <description>Humidity average</description> <state pattern="%.1f %" readOnly="true"> </state> @@ -925,28 +925,28 @@ </channel-type> <channel-type id="f750-41214" advanced="true"> <item-type>Number</item-type> - <label>OEK accessory block status</label> + <label>OEK Accessory Block Status</label> <description>Indicates if the OEK accessory is externally blocked.</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41256" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f750-41257" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f750-41258" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> @@ -965,63 +965,63 @@ </channel-type> <channel-type id="f750-41266" advanced="true"> <item-type>Number</item-type> - <label>Offset to smart home system</label> + <label>Offset to Smart Home System</label> <description>Offset to smart home system</description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-41267" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 8</label> + <label>Smart Home Ctrl Syst 8</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41268" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 7</label> + <label>Smart Home Ctrl Syst 7</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41269" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 6</label> + <label>Smart Home Ctrl Syst 6</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41270" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 5</label> + <label>Smart Home Ctrl Syst 5</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41271" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 4</label> + <label>Smart Home Ctrl Syst 4</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41272" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 3</label> + <label>Smart Home Ctrl Syst 3</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41273" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 2</label> + <label>Smart Home Ctrl Syst 2</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-41274" advanced="true"> <item-type>Number</item-type> - <label>Smart Home ctrl syst 1</label> + <label>Smart Home Ctrl Syst 1</label> <description>Smart Home is controlling the system</description> <state pattern="%d" readOnly="true"> </state> @@ -1700,7 +1700,7 @@ </channel-type> <channel-type id="f750-42093" advanced="true"> <item-type>Number</item-type> - <label>External SAM accessory GQ3 speed</label> + <label>External SAM Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed in the SAM accessory.</description> <state pattern="%d %" readOnly="true"> </state> @@ -1714,42 +1714,42 @@ </channel-type> <channel-type id="f750-42101" advanced="true"> <item-type>Number</item-type> - <label>Used heating power average, 24h</label> + <label>Used Heating Power Average, 24h</label> <description>Used heating power average, 24h</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-42437" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - HW Cpr and Add - Total system</label> + <label>Heat Meter - HW Cpr and Add - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system</description> <state pattern="%.1f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-42439" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Heat Cpr and Add - Total system</label> + <label>Heat Meter - Heat Cpr and Add - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system</description> <state pattern="%.1f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-42443" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Pool Cpr - Total system</label> + <label>Heat Meter - Pool Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system</description> <state pattern="%.1f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-42445" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - HW Cpr - Total system</label> + <label>Heat Meter - HW Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system</description> <state pattern="%.1f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-42447" advanced="true"> <item-type>Number</item-type> - <label>Heat Meter - Heat Cpr - Total system</label> + <label>Heat Meter - Heat Cpr - Total System</label> <description>Accumulated energy production as calculated by the heat meter, summaries of all heat pumps in system</description> <state pattern="%.1f kWh" readOnly="true"> </state> @@ -1763,14 +1763,14 @@ </channel-type> <channel-type id="f750-43001" advanced="true"> <item-type>Number</item-type> - <label>Software version</label> + <label>Software Version</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43005"> <item-type>Number</item-type> - <label>Degree Minutes (16 bit)</label> + <label>Degree Minutes (16 Bit)</label> <description>Degree minutes, 16bit value (-32768 < x < 32767). Values outside valid values are rounded to the closest valid value.</description> <state min="-30000" max="30000" step="1" pattern="%.1f" readOnly="false"> </state> @@ -1815,49 +1815,49 @@ </channel-type> <channel-type id="f750-43061" advanced="true"> <item-type>Number</item-type> - <label>t. after start timer</label> + <label>T. After Start Timer</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43062" advanced="true"> <item-type>Number</item-type> - <label>t. after mode change</label> + <label>T. After Mode Change</label> <description>Time after mode change</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43064" advanced="true"> <item-type>Number</item-type> - <label>Heat Medium Flow dT Set Point</label> + <label>Heat Medium Flow DT Set Point</label> <description>Set point delta T for the heat medium flow</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-43065" advanced="true"> <item-type>Number</item-type> - <label>Heat Medium Flow dT Actual</label> + <label>Heat Medium Flow DT Actual</label> <description>Current value of the delta T for the heat medium flow</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-43066" advanced="true"> <item-type>Number</item-type> - <label>Defrosting time</label> + <label>Defrosting Time</label> <description>Defrosting time</description> <state pattern="%d s" readOnly="true"> </state> </channel-type> <channel-type id="f750-43081" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time add.</label> + <label>Tot. Op.time Add.</label> <description>Total electric additive operation time</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f750-43084" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. Power</label> + <label>Int. El.add. Power</label> <description>Current power from the internal electrical addition</description> <state pattern="%.2f kW" readOnly="true"> </state> @@ -1880,7 +1880,7 @@ </channel-type> <channel-type id="f750-43091" advanced="true"> <item-type>Number</item-type> - <label>Int. el.add. State</label> + <label>Int. El.add. State</label> <description>Number of steps active for internal step-controlled addition</description> <state pattern="%d" readOnly="true"> </state> @@ -1915,7 +1915,7 @@ </channel-type> <channel-type id="f750-43097" advanced="true"> <item-type>String</item-type> - <label>Status of the shunt controlled additional heat accessory</label> + <label>Status of the Shunt Controlled Additional Heat Accessory</label> <description>10 = Off, 20 = Running, 30 = Passive</description> <state pattern="%d" readOnly="true"> <options> @@ -1927,35 +1927,35 @@ </channel-type> <channel-type id="f750-43108" advanced="true"> <item-type>Number</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed after scheduling and blocks are considered</description> <state pattern="%d %" readOnly="true"> </state> </channel-type> <channel-type id="f750-43122" advanced="true"> <item-type>Number</item-type> - <label>Compr. current min.freq.</label> + <label>Compr. Current Min.freq.</label> <description>The current minimum frequency of the compressor</description> <state pattern="%d Hz" readOnly="true"> </state> </channel-type> <channel-type id="f750-43123" advanced="true"> <item-type>Number</item-type> - <label>Compr. current max.freq.</label> + <label>Compr. Current Max.freq.</label> <description>The current maximum frequency of the compressor</description> <state pattern="%d Hz" readOnly="true"> </state> </channel-type> <channel-type id="f750-43124" advanced="true"> <item-type>Number</item-type> - <label>Airflow ref.</label> + <label>Airflow Ref.</label> <description>Reference value for the airflow.</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-43132" advanced="true"> <item-type>Number</item-type> - <label>Inverter com. timer</label> + <label>Inverter Com. Timer</label> <description>This value shows the time since last communication with the inverter</description> <state pattern="%d sec" readOnly="true"> </state> @@ -1976,49 +1976,49 @@ </channel-type> <channel-type id="f750-43141" advanced="true"> <item-type>Number</item-type> - <label>compr. in power</label> + <label>Compr. in Power</label> <description>The power delivered from the inverter to the compressor</description> <state pattern="%d W" readOnly="true"> </state> </channel-type> <channel-type id="f750-43144" advanced="true"> <item-type>Number</item-type> - <label>Compr. energy total</label> + <label>Compr. Energy Total</label> <description>Total compressor energy in kWh</description> <state pattern="%.2f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-43147" advanced="true"> <item-type>Number</item-type> - <label>Compr. in current</label> + <label>Compr. in Current</label> <description>The current delivered from the inverter to the compressor</description> <state pattern="%d A" readOnly="true"> </state> </channel-type> <channel-type id="f750-43158" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S4</label> + <label>External Adjustment Activated Via Input S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43159" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S3</label> + <label>External Adjustment Activated Via Input S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43160" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S2</label> + <label>External Adjustment Activated Via Input S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43161" advanced="true"> <item-type>Number</item-type> - <label>External adjustment activated via input S1</label> + <label>External Adjustment Activated Via Input S1</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2036,7 +2036,7 @@ </channel-type> <channel-type id="f750-43181" advanced="true"> <item-type>Number</item-type> - <label>Chargepump speed</label> + <label>Chargepump Speed</label> <description></description> <state pattern="%d %" readOnly="true"> </state> @@ -2050,63 +2050,63 @@ </channel-type> <channel-type id="f750-43239" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time add.</label> + <label>Tot. HW Op.time Add.</label> <description>Total electric additive operation time in hot water mode</description> <state pattern="%.1f h" readOnly="true"> </state> </channel-type> <channel-type id="f750-43305" advanced="true"> <item-type>Number</item-type> - <label>Compr. energy HW</label> + <label>Compr. Energy HW</label> <description>Compressor energy during hot water production in kWh</description> <state pattern="%.2f kWh" readOnly="true"> </state> </channel-type> <channel-type id="f750-43371" advanced="true"> <item-type>Number</item-type> - <label>Hot gas limit status</label> + <label>Hot Gas Limit Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43372" advanced="true"> <item-type>Number</item-type> - <label>Evaporater limit status</label> + <label>Evaporater Limit Status</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43375" advanced="true"> <item-type>Number</item-type> - <label>compr. in power mean</label> + <label>Compr. in Power Mean</label> <description>Mean power delivered from the inverter to the compressor. Mean is calculated every 10 seconds.</description> <state pattern="%d W" readOnly="true"> </state> </channel-type> <channel-type id="f750-43382" advanced="true"> <item-type>Number</item-type> - <label>Inverter mem error code</label> + <label>Inverter Mem Error Code</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43416" advanced="true"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressorer starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-43420" advanced="true"> <item-type>Number</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f750-43424" advanced="true"> <item-type>Number</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressorer operation time in hot water mode</description> <state pattern="%d h" readOnly="true"> </state> @@ -2185,21 +2185,21 @@ </channel-type> <channel-type id="f750-43542" advanced="true"> <item-type>Number</item-type> - <label>Calculated supply air temp.</label> + <label>Calculated Supply Air Temp.</label> <description></description> <state pattern="%.1f°C" readOnly="true"> </state> </channel-type> <channel-type id="f750-43561" advanced="true"> <item-type>Number</item-type> - <label>Pool 1 blocked</label> + <label>Pool 1 Blocked</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44258" advanced="true"> <item-type>Number</item-type> - <label>External supply air accessory relays</label> + <label>External Supply Air Accessory Relays</label> <description>Indicates the status of the relays on the external supply air accessory. The information is binary encoded. B0: relay K1 (QN40 close signal). B1: relay K2 (QN40 open signal)</description> <state pattern="%d" readOnly="true"> </state> @@ -2241,49 +2241,49 @@ </channel-type> <channel-type id="f750-44317" advanced="true"> <item-type>Number</item-type> - <label>SCA accessory relays</label> + <label>SCA Accessory Relays</label> <description>Indicates the status of the relays on the SCA accessory. The information is binary encoded. B0: relay K1 (Solar pump). B1: relay K2 (Solar Cooling Pump) B2: relay K3 (QN28)</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44331" advanced="true"> <item-type>Number</item-type> - <label>Software release</label> + <label>Software Release</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44744" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S4</label> + <label>Extra Heating System Pump S4</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44745" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S3</label> + <label>Extra Heating System Pump S3</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44746" advanced="true"> <item-type>Number</item-type> - <label>Extra heating system pump S2</label> + <label>Extra Heating System Pump S2</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44755" advanced="true"> <item-type>Number</item-type> - <label>DEW hot water valve</label> + <label>DEW Hot Water Valve</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44757" advanced="true"> <item-type>Number</item-type> - <label>SCA hot water valve</label> + <label>SCA Hot Water Valve</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2297,14 +2297,14 @@ </channel-type> <channel-type id="f750-44878" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input A</label> + <label>SG Ready Input A</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-44879" advanced="true"> <item-type>Number</item-type> - <label>SG Ready input B</label> + <label>SG Ready Input B</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2346,7 +2346,7 @@ </channel-type> <channel-type id="f750-44908" advanced="true"> <item-type>Number</item-type> - <label>State smart price adaption</label> + <label>State Smart Price Adaption</label> <description></description> <state pattern="%d" readOnly="true"> </state> @@ -2360,14 +2360,14 @@ </channel-type> <channel-type id="f750-47062" advanced="true"> <item-type>Number</item-type> - <label>HW charge offset</label> + <label>HW Charge Offset</label> <description>Offset of HW charge temperature from the stop temperature</description> <state min="-128" max="127" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47291" advanced="true"> <item-type>Number</item-type> - <label>Floor drying timer</label> + <label>Floor Drying Timer</label> <description></description> <state pattern="%d hrs" readOnly="true"> </state> @@ -2385,63 +2385,63 @@ </channel-type> <channel-type id="f750-40879" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Parallell factor</label> + <label>+Adjust Parallell Factor</label> <description></description> <state min="1" max="10" step="1" pattern="%d 1" readOnly="false"> </state> </channel-type> <channel-type id="f750-40880" advanced="true"> <item-type>Number</item-type> - <label>+Adjust Max change</label> + <label>+Adjust Max Change</label> <description>Largest allowed change</description> <state min="-128" max="127" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-40881" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system8</label> + <label>+Adjust Affect System8</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40882" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system7</label> + <label>+Adjust Affect System7</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40883" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system6</label> + <label>+Adjust Affect System6</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40884" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system5</label> + <label>+Adjust Affect System5</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40885" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system4</label> + <label>+Adjust Affect System4</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40886" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system3</label> + <label>+Adjust Affect System3</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40887" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system2</label> + <label>+Adjust Affect System2</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-40888" advanced="true"> <item-type>Switch</item-type> - <label>+Adjust Affect system1</label> + <label>+Adjust Affect System1</label> <description>System affected by paralell change</description> <state readOnly="false"></state> </channel-type> @@ -2615,77 +2615,77 @@ </channel-type> <channel-type id="f750-47027" advanced="true"> <item-type>Number</item-type> - <label>Point offset outdoor temp.</label> + <label>Point Offset Outdoor Temp.</label> <description>Outdoor temperature point where the heat curve is offset</description> <state min="-40" max="30" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47028" advanced="true"> <item-type>Number</item-type> - <label>Point offset</label> + <label>Point Offset</label> <description>Amount of offset at the point offset temperature</description> <state min="-10" max="10" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47029" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S4</label> + <label>External Adjustment S4</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47030" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S3</label> + <label>External Adjustment S3</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47031" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S2</label> + <label>External Adjustment S2</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47032" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S1</label> + <label>External Adjustment S1</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47033" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S4</label> + <label>External Adjustment with Room Sensor S4</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47034" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S3</label> + <label>External Adjustment with Room Sensor S3</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47035" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S2</label> + <label>External Adjustment with Room Sensor S2</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47036" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S1</label> + <label>External Adjustment with Room Sensor S1</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47041" advanced="true"> <item-type>String</item-type> - <label>Hot water comfort mode</label> + <label>Hot Water Comfort Mode</label> <description>Setting in menu 2.2. 0=Economy,1=Normal,2=Luxury,4=Smart Control 0=Economy 1=Normal 2=Luxury</description> <state min="0" max="4" step="1" pattern="%d" readOnly="false"> <options> @@ -2701,49 +2701,49 @@ </channel-type> <channel-type id="f750-47043" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Luxury</label> + <label>Start Temperature HW Luxury</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47044" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Normal</label> + <label>Start Temperature HW Normal</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47045" advanced="true"> <item-type>Number</item-type> - <label>Start temperature HW Economy</label> + <label>Start Temperature HW Economy</label> <description>Start temperature for heating water</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47046" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature Periodic HW</label> + <label>Stop Temperature Periodic HW</label> <description>Temperature where hot water generation will stop</description> <state min="550" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47047" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Luxury</label> + <label>Stop Temperature HW Luxury</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47048" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Normal</label> + <label>Stop Temperature HW Normal</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47049" advanced="true"> <item-type>Number</item-type> - <label>Stop temperature HW Economy</label> + <label>Stop Temperature HW Economy</label> <description>Temperature where hot water generation will stop</description> <state min="50" max="700" step="1" pattern="%.1f°C" readOnly="false"> </state> @@ -2763,63 +2763,63 @@ </channel-type> <channel-type id="f750-47054" advanced="true"> <item-type>Number</item-type> - <label>Run time HWC</label> + <label>Run Time HWC</label> <description>Run time for the hot water circulation system</description> <state min="1" max="60" step="1" pattern="%d min" readOnly="false"> </state> </channel-type> <channel-type id="f750-47055" advanced="true"> <item-type>Number</item-type> - <label>Still time HWC</label> + <label>Still Time HWC</label> <description>Still time for the hot water circulation system</description> <state min="0" max="60" step="1" pattern="%d min" readOnly="false"> </state> </channel-type> <channel-type id="f750-47092" advanced="true"> <item-type>Number</item-type> - <label>Manual compfreq HW</label> + <label>Manual Compfreq HW</label> <description>Should the compressor frequency be manual set in HW?</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47093" advanced="true"> <item-type>Number</item-type> - <label>Manual compfreq speed HW</label> + <label>Manual Compfreq Speed HW</label> <description>Manual compressor frequency in HW?</description> <state min="0" max="65535" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-47094" advanced="true"> <item-type>Number</item-type> - <label>Sec per compfreq step</label> + <label>Sec Per Compfreq Step</label> <description>Time between changes of the copmpressor frequency</description> <state min="0" max="255" step="1" pattern="%d s" readOnly="false"> </state> </channel-type> <channel-type id="f750-47095" advanced="true"> <item-type>Number</item-type> - <label>Max compfreq step</label> + <label>Max Compfreq Step</label> <description>Largest allowed change of compressor frequency in normal run</description> <state min="0" max="255" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-47096" advanced="true"> <item-type>Number</item-type> - <label>Manual compfreq Heating</label> + <label>Manual Compfreq Heating</label> <description>Should the compressor frequency be manual set in Heating?</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47097" advanced="true"> <item-type>Number</item-type> - <label>Min speed after start</label> + <label>Min Speed After Start</label> <description>Time with minimum compressor frequency when heating demand occurs</description> <state min="0" max="255" step="1" pattern="%d Min" readOnly="false"> </state> </channel-type> <channel-type id="f750-47098" advanced="true"> <item-type>Number</item-type> - <label>Min speed after HW</label> + <label>Min Speed After HW</label> <description>Should the compressor frequency be manual set in HW?</description> <state min="0" max="255" step="1" pattern="%d Min" readOnly="false"> </state> @@ -2833,42 +2833,42 @@ </channel-type> <channel-type id="f750-47100" advanced="true"> <item-type>Number</item-type> - <label>Max diff VBF-BerVBF</label> + <label>Max Diff VBF-BerVBF</label> <description>Largest allowed difference between Supply and calc supply</description> <state min="0" max="255" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47101" advanced="true"> <item-type>Number</item-type> - <label>Comp freq reg P</label> + <label>Comp Freq Reg P</label> <description>Compressor frequency regulator P</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47102" advanced="true"> <item-type>Number</item-type> - <label>Comp freq max delta F</label> + <label>Comp Freq Max Delta F</label> <description>Maximum change of copmpressor frequency in compressor frequency regulator</description> <state min="-128" max="127" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-47103" advanced="true"> <item-type>Number</item-type> - <label>Min comp freq</label> + <label>Min Comp Freq</label> <description>Minimum allowed compressor frequency</description> <state min="-32767" max="32767" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-47104" advanced="true"> <item-type>Number</item-type> - <label>Max comp freq</label> + <label>Max Comp Freq</label> <description>Maximum allowed compressor frequency</description> <state min="-32767" max="32767" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-47105" advanced="true"> <item-type>Number</item-type> - <label>Comp freq heating</label> + <label>Comp Freq Heating</label> <description>Compressor frequency used in heating mode</description> <state min="-32767" max="32767" step="1" pattern="%d Hz" readOnly="false"> </state> @@ -2913,7 +2913,7 @@ </channel-type> <channel-type id="f750-47137" advanced="true"> <item-type>String</item-type> - <label>Operational mode</label> + <label>Operational Mode</label> <description>The operational mode of the heat pump 0=Auto 1=Manual 2=Add. heat only</description> <state min="0" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -2925,7 +2925,7 @@ </channel-type> <channel-type id="f750-47138" advanced="true"> <item-type>String</item-type> - <label>Operational mode heat medium pump</label> + <label>Operational Mode Heat Medium Pump</label> <description> 10=Intermittent 20=Continous 30=Economy 40=Auto</description> <state min="10" max="40" step="1" pattern="%d" readOnly="false"> <options> @@ -2938,28 +2938,28 @@ </channel-type> <channel-type id="f750-47206" advanced="true"> <item-type>Number</item-type> - <label>DM start heating</label> + <label>DM Start Heating</label> <description>The value the degree minutes needed to be reached for the pump to start heating</description> <state min="-1000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47209" advanced="true"> <item-type>Number</item-type> - <label>DM between add. steps</label> + <label>DM Between Add. Steps</label> <description>The number of degree minutes between start of each electric addition step</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47210" advanced="true"> <item-type>Number</item-type> - <label>DM start add. with shunt</label> + <label>DM Start Add. with Shunt</label> <description></description> <state min="-2000" max="-30" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47212" advanced="true"> <item-type>Number</item-type> - <label>Max int add. power</label> + <label>Max Int Add. Power</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f kW" readOnly="false"> </state> @@ -2973,237 +2973,237 @@ </channel-type> <channel-type id="f750-47261" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 4</label> + <label>Exhaust Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47262" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 3</label> + <label>Exhaust Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47263" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 2</label> + <label>Exhaust Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47264" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed 1</label> + <label>Exhaust Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47265" advanced="true"> <item-type>Number</item-type> - <label>Exhaust Fan speed normal</label> + <label>Exhaust Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47266" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 4</label> + <label>Supply Fan Speed 4</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47267" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 3</label> + <label>Supply Fan Speed 3</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47268" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 2</label> + <label>Supply Fan Speed 2</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47269" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed 1</label> + <label>Supply Fan Speed 1</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47270" advanced="true"> <item-type>Number</item-type> - <label>Supply Fan speed normal</label> + <label>Supply Fan Speed Normal</label> <description></description> <state min="0" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47271" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 4</label> + <label>Fan Return Time 4</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f750-47272" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 3</label> + <label>Fan Return Time 3</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f750-47273" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 2</label> + <label>Fan Return Time 2</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f750-47274" advanced="true"> <item-type>Number</item-type> - <label>Fan return time 1</label> + <label>Fan Return Time 1</label> <description>Time from a changed fan speed until it returns to normal speed</description> <state min="1" max="99" step="1" pattern="%d h" readOnly="false"> </state> </channel-type> <channel-type id="f750-47275" advanced="true"> <item-type>Number</item-type> - <label>Filter Reminder period</label> + <label>Filter Reminder Period</label> <description>Time between the reminder of filter replacement/cleaning.</description> <state min="1" max="24" step="1" pattern="%d Months" readOnly="false"> </state> </channel-type> <channel-type id="f750-47276" advanced="true"> <item-type>Switch</item-type> - <label>Floor drying</label> + <label>Floor Drying</label> <description> 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47277" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 7</label> + <label>Floor Drying Period 7</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47278" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 6</label> + <label>Floor Drying Period 6</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47279" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 5</label> + <label>Floor Drying Period 5</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47280" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 4</label> + <label>Floor Drying Period 4</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47281" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 3</label> + <label>Floor Drying Period 3</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47282" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 2</label> + <label>Floor Drying Period 2</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47283" advanced="true"> <item-type>Number</item-type> - <label>Floor drying period 1</label> + <label>Floor Drying Period 1</label> <description>Days each period is active</description> <state min="0" max="30" step="1" pattern="%d days" readOnly="false"> </state> </channel-type> <channel-type id="f750-47284" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 7</label> + <label>Floor Drying Temp. 7</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47285" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 6</label> + <label>Floor Drying Temp. 6</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47286" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 5</label> + <label>Floor Drying Temp. 5</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47287" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 4</label> + <label>Floor Drying Temp. 4</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47288" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 3</label> + <label>Floor Drying Temp. 3</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47289" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 2</label> + <label>Floor Drying Temp. 2</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47290" advanced="true"> <item-type>Number</item-type> - <label>Floor drying temp. 1</label> + <label>Floor Drying Temp. 1</label> <description>Supply temperature each period</description> <state min="15" max="70" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47294" advanced="true"> <item-type>Number</item-type> - <label>Use airflow defrost</label> + <label>Use Airflow Defrost</label> <description>If reduced airflow should start defrost</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-47295" advanced="true"> <item-type>Number</item-type> - <label>Airflow reduction trig</label> + <label>Airflow Reduction Trig</label> <description>How much the airflow is allowed to be reduced before a defrost is trigged</description> <state min="0" max="255" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47296" advanced="true"> <item-type>Number</item-type> - <label>Airflow defrost done</label> + <label>Airflow Defrost Done</label> <description>How much the airflow has to raise before a defrost is ended</description> <state min="0" max="255" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-47299" advanced="true"> <item-type>Number</item-type> - <label>Min time defrost</label> + <label>Min Time Defrost</label> <description>Minimum duration of the defrost</description> <state min="0" max="255" step="1" pattern="%d min" readOnly="false"> </state> @@ -3217,108 +3217,108 @@ </channel-type> <channel-type id="f750-47301" advanced="true"> <item-type>Number</item-type> - <label>delta T at DOT</label> + <label>Delta T At DOT</label> <description>Delta T (BT12-BT3)at dimensioning outdoor temperature</description> <state min="10" max="250" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47302" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 2 accessory</label> + <label>Climate System 2 Accessory</label> <description>Activates the climate system 2 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47303" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 3 accessory</label> + <label>Climate System 3 Accessory</label> <description>Activates the climate system 3 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47304" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 4 accessory</label> + <label>Climate System 4 Accessory</label> <description>Activates the climate system 4 accessory 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47305" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 mixing valve amp.</label> + <label>Climate System 4 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47306" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 mixing valve amp.</label> + <label>Climate System 3 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47307" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 mixing valve amp.</label> + <label>Climate System 2 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47308" advanced="true"> <item-type>Number</item-type> - <label>Climate system 4 shunt wait</label> + <label>Climate System 4 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-47309" advanced="true"> <item-type>Number</item-type> - <label>Climate system 3 shunt wait</label> + <label>Climate System 3 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-47310" advanced="true"> <item-type>Number</item-type> - <label>Climate system 2 shunt wait</label> + <label>Climate System 2 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-47317" advanced="true"> <item-type>Switch</item-type> - <label>Shunt controlled add. accessory</label> + <label>Shunt Controlled Add. Accessory</label> <description>Activates the shunt controlled addition accessory. 1=on,0=off 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47318" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. temp.</label> + <label>Shunt Controlled Add. Min. Temp.</label> <description></description> <state min="5" max="90" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47319" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. min. runtime</label> + <label>Shunt Controlled Add. Min. Runtime</label> <description></description> <state min="0" max="48" step="1" pattern="%d hrs" readOnly="false"> </state> </channel-type> <channel-type id="f750-47320" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve amp.</label> + <label>Shunt Controlled Add. Mixing Valve Amp.</label> <description>Mixing valve amplification for shunt controlled add.</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47321" advanced="true"> <item-type>Number</item-type> - <label>Shunt controlled add. mixing valve wait</label> + <label>Shunt Controlled Add. Mixing Valve Wait</label> <description>Wait time between changes of the shunt in shunt controlled add.</description> <state min="10" max="300" step="1" pattern="%d secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-47352" advanced="true"> <item-type>Switch</item-type> - <label>SMS40 accessory</label> + <label>SMS40 Accessory</label> <description>Activates the SMS40 accessory</description> <state readOnly="false"></state> </channel-type> @@ -3396,21 +3396,21 @@ </channel-type> <channel-type id="f750-47378" advanced="true"> <item-type>Number</item-type> - <label>Max diff. comp.</label> + <label>Max Diff. Comp.</label> <description></description> <state min="10" max="250" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47379" advanced="true"> <item-type>Number</item-type> - <label>Max diff. add.</label> + <label>Max Diff. Add.</label> <description></description> <state min="10" max="240" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47384" advanced="true"> <item-type>String</item-type> - <label>Date format</label> + <label>Date Format</label> <description> 1=DD-MM-YY 2=YY-MM-DD</description> <state min="1" max="2" step="1" pattern="%d" readOnly="false"> <options> @@ -3421,7 +3421,7 @@ </channel-type> <channel-type id="f750-47385" advanced="true"> <item-type>String</item-type> - <label>Time format</label> + <label>Time Format</label> <description> 12=12 hours 24=24 Hours</description> <state min="12" max="24" step="1" pattern="%d" readOnly="false"> <options> @@ -3432,105 +3432,105 @@ </channel-type> <channel-type id="f750-47387" advanced="true"> <item-type>Switch</item-type> - <label>HW production</label> + <label>HW Production</label> <description>Activates hot water production where applicable 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47388" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower room temp.</label> + <label>Alarm Lower Room Temp.</label> <description>Lowers the room temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47389" advanced="true"> <item-type>Switch</item-type> - <label>Alarm lower HW temp.</label> + <label>Alarm Lower HW Temp.</label> <description>Lowers the hot water temperature during red light alarms to notify the occupants of the building that something is the matter 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47391" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S4</label> + <label>Use Room Sensor S4</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47392" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S3</label> + <label>Use Room Sensor S3</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47393" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S2</label> + <label>Use Room Sensor S2</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47394" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47395" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S4</label> + <label>Room Sensor Setpoint S4</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47396" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S3</label> + <label>Room Sensor Setpoint S3</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47397" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S2</label> + <label>Room Sensor Setpoint S2</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47398" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S1</label> + <label>Room Sensor Setpoint S1</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47399" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S4</label> + <label>Room Sensor Factor S4</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47400" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S3</label> + <label>Room Sensor Factor S3</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47401" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S2</label> + <label>Room Sensor Factor S2</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47402" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-47442" advanced="true"> <item-type>String</item-type> - <label>preset flow clim. sys.</label> + <label>Preset Flow Clim. Sys.</label> <description>Preset flow setting for climate system. 0 = manual setting, 1 = radiator, 2 = floor heating, 3 = radiator + floor heating.</description> <state min="0" max="3" step="1" pattern="%d" readOnly="false"> <options> @@ -3543,7 +3543,7 @@ </channel-type> <channel-type id="f750-47473" advanced="true"> <item-type>Number</item-type> - <label>Max time defrost</label> + <label>Max Time Defrost</label> <description>Maximum duration of the defrost</description> <state min="0" max="255" step="1" pattern="%d min" readOnly="false"> </state> @@ -3557,27 +3557,27 @@ </channel-type> <channel-type id="f750-47537" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp. 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-47538" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47539" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-47555" advanced="true"> <item-type>Switch</item-type> - <label>DEW accessory</label> + <label>DEW Accessory</label> <description>Activates the DEW accessory</description> <state readOnly="false"></state> </channel-type> @@ -3601,7 +3601,7 @@ </channel-type> <channel-type id="f750-48072" advanced="true"> <item-type>Number</item-type> - <label>DM diff start add.</label> + <label>DM Diff Start Add.</label> <description>The value below the last compressor step the degree minutes needed to be reached for the pump to start electric addition</description> <state min="-32767" max="32767" step="1" pattern="%d" readOnly="false"> </state> @@ -3622,111 +3622,111 @@ </channel-type> <channel-type id="f750-48139" advanced="true"> <item-type>Number</item-type> - <label>DM startdiff add. with shunt</label> + <label>DM Startdiff Add. with Shunt</label> <description></description> <state min="0" max="2000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48158" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: outdoor temp T3</label> + <label>SAM Supply Air Curve: Outdoor Temp T3</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="-400" max="200" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48159" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: outdoor temp T2</label> + <label>SAM Supply Air Curve: Outdoor Temp T2</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="-390" max="190" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48160" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: outdoor temp T1</label> + <label>SAM Supply Air Curve: Outdoor Temp T1</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="-400" max="200" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48161" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: supply air temp at T3</label> + <label>SAM Supply Air Curve: Supply Air Temp At T3</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="160" max="520" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48162" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: supply air temp at T2</label> + <label>SAM Supply Air Curve: Supply Air Temp At T2</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="160" max="520" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48163" advanced="true"> <item-type>Number</item-type> - <label>SAM supply air curve: supply air temp at T1</label> + <label>SAM Supply Air Curve: Supply Air Temp At T1</label> <description>The supply air curve is defined by 3 supply air temperatures at 3 different outdoor temperatures T1, T2 and T3.</description> <state min="160" max="520" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48201" advanced="true"> <item-type>Switch</item-type> - <label>SCA accessory</label> + <label>SCA Accessory</label> <description>Activates the SCA accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48275" advanced="true"> <item-type>Number</item-type> - <label>Max charge pump reg speed</label> + <label>Max Charge Pump Reg Speed</label> <description>Max heat medium pump reg speed</description> <state min="50" max="100" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-48282" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready heating</label> + <label>SG Ready Heating</label> <description>Sets whether or not SG Ready should affect heating</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48283" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready cooling</label> + <label>SG Ready Cooling</label> <description>Sets whether or not SG Ready should affect cooling</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48284" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready hot water</label> + <label>SG Ready Hot Water</label> <description>Sets whether or not SG Ready should affect hot water</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48285" advanced="true"> <item-type>Switch</item-type> - <label>SG Ready pool</label> + <label>SG Ready Pool</label> <description>Sets whether or not SG Ready should affect pool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48452" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, hw</label> + <label>Auto Heat Medium Pump Speed, Hw</label> <description>Auto heat medium pump speed hw</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48453" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, heat</label> + <label>Auto Heat Medium Pump Speed, Heat</label> <description>Auto heat medium pump speed heat</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48454" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, pool</label> + <label>Auto Heat Medium Pump Speed, Pool</label> <description>Auto heat medium pump speed pool</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48455" advanced="true"> <item-type>Switch</item-type> - <label>Auto heat medium pump speed, cool</label> + <label>Auto Heat Medium Pump Speed, Cool</label> <description>Auto heat medium pump speed cool</description> <state readOnly="false"></state> </channel-type> @@ -3830,425 +3830,425 @@ </channel-type> <channel-type id="f750-48503" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S8</label> + <label>External Adjustment S8</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48504" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S7</label> + <label>External Adjustment S7</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48505" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S6</label> + <label>External Adjustment S6</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48506" advanced="true"> <item-type>Number</item-type> - <label>External adjustment S5</label> + <label>External Adjustment S5</label> <description>Change of the offset of the heat curve when closing the external adjustment input</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48507" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S8</label> + <label>External Adjustment with Room Sensor S8</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48508" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S7</label> + <label>External Adjustment with Room Sensor S7</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48509" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S6</label> + <label>External Adjustment with Room Sensor S6</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48510" advanced="true"> <item-type>Number</item-type> - <label>External adjustment with room sensor S5</label> + <label>External Adjustment with Room Sensor S5</label> <description>Room temperature setting when closing the external adjustment input</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48567" advanced="true"> <item-type>Number</item-type> - <label>Initiate inverter</label> + <label>Initiate Inverter</label> <description>Start initiation process of the inverter</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48568" advanced="true"> <item-type>Number</item-type> - <label>Force inverter init</label> + <label>Force Inverter Init</label> <description>Force inverter initiation process of the inverter</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48569" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 5 accessory</label> + <label>Climate System 5 Accessory</label> <description>Activates the climate system 5 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48570" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 6 accessory</label> + <label>Climate System 6 Accessory</label> <description>Activates the climate system 6 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48571" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 7 accessory</label> + <label>Climate System 7 Accessory</label> <description>Activates the climate system 7 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48572" advanced="true"> <item-type>Switch</item-type> - <label>Climate system 8 accessory</label> + <label>Climate System 8 Accessory</label> <description>Activates the climate system 8 accessory</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48573" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 mixing valve amp.</label> + <label>Climate System 8 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48574" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 mixing valve amp.</label> + <label>Climate System 7 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48575" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 mixing valve amp.</label> + <label>Climate System 6 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48576" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 mixing valve amp.</label> + <label>Climate System 5 Mixing Valve Amp.</label> <description>Mixing valve amplification for extra climate systems</description> <state min="1" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48577" advanced="true"> <item-type>Number</item-type> - <label>Climate system 8 shunt wait</label> + <label>Climate System 8 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-48578" advanced="true"> <item-type>Number</item-type> - <label>Climate system 7 shunt wait</label> + <label>Climate System 7 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-48579" advanced="true"> <item-type>Number</item-type> - <label>Climate system 6 shunt wait</label> + <label>Climate System 6 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-48580" advanced="true"> <item-type>Number</item-type> - <label>Climate system 5 shunt wait</label> + <label>Climate System 5 Shunt Wait</label> <description>Wait time between changes of the shunt in extra climate systems</description> <state min="10" max="300" step="1" pattern="%.1f secs" readOnly="false"> </state> </channel-type> <channel-type id="f750-48637" advanced="true"> <item-type>Switch</item-type> - <label>AHPS docking accessory</label> + <label>AHPS Docking Accessory</label> <description>0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48638" advanced="true"> <item-type>Switch</item-type> - <label>AHPS docking: solar heating</label> + <label>AHPS Docking: Solar Heating</label> <description>The specific AHPS docking: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48639" advanced="true"> <item-type>Switch</item-type> - <label>AHPS docking: prioritized add.</label> + <label>AHPS Docking: Prioritized Add.</label> <description>The specific AHPS docking: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48640" advanced="true"> <item-type>Switch</item-type> - <label>AHPS docking: ext. addition</label> + <label>AHPS Docking: Ext. Addition</label> <description>The specific AHPS docking: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48641" advanced="true"> <item-type>Switch</item-type> - <label>AHPS docking: ext. hot water</label> + <label>AHPS Docking: Ext. Hot Water</label> <description>The specific AHPS docking: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48659" advanced="true"> <item-type>Switch</item-type> - <label>Cut off frequency activated 2</label> + <label>Cut Off Frequency Activated 2</label> <description>Cut off frequency activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48660" advanced="true"> <item-type>Switch</item-type> - <label>Cut off frequency activated 1</label> + <label>Cut Off Frequency Activated 1</label> <description>Cut off frequency activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48661" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency start 2</label> + <label>Cut Off Frequency Start 2</label> <description>Cut off frequency start</description> <state min="17" max="115" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-48662" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency start 1</label> + <label>Cut Off Frequency Start 1</label> <description>Cut off frequency start</description> <state min="17" max="115" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-48663" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency stop 2</label> + <label>Cut Off Frequency Stop 2</label> <description>Cut off frequency stop</description> <state min="22" max="120" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-48664" advanced="true"> <item-type>Number</item-type> - <label>Cut off frequency stop 1</label> + <label>Cut Off Frequency Stop 1</label> <description>Cut off frequency stop</description> <state min="22" max="120" step="1" pattern="%d Hz" readOnly="false"> </state> </channel-type> <channel-type id="f750-48675" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S8</label> + <label>Use Room Sensor S8</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48676" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S7</label> + <label>Use Room Sensor S7</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48677" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S6</label> + <label>Use Room Sensor S6</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48678" advanced="true"> <item-type>Switch</item-type> - <label>Use room sensor S5</label> + <label>Use Room Sensor S5</label> <description>When activated the system uses the room sensor</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48680" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S8</label> + <label>Room Sensor Setpoint S8</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48681" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S7</label> + <label>Room Sensor Setpoint S7</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48682" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S6</label> + <label>Room Sensor Setpoint S6</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48683" advanced="true"> <item-type>Number</item-type> - <label>Room sensor setpoint S5</label> + <label>Room Sensor Setpoint S5</label> <description>Sets the room temperature setpoint for the system</description> <state min="50" max="300" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48685" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S8</label> + <label>Room Sensor Factor S8</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48686" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S7</label> + <label>Room Sensor Factor S7</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48687" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S6</label> + <label>Room Sensor Factor S6</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48688" advanced="true"> <item-type>Number</item-type> - <label>Room sensor factor S5</label> + <label>Room Sensor Factor S5</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48732" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S8</label> + <label>Cool Offset S8</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48733" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S7</label> + <label>Cool Offset S7</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48734" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S6</label> + <label>Cool Offset S6</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48735" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S5</label> + <label>Cool Offset S5</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48736" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S4</label> + <label>Cool Offset S4</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48737" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S3</label> + <label>Cool Offset S3</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48738" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S2</label> + <label>Cool Offset S2</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48739" advanced="true"> <item-type>Number</item-type> - <label>Cool offset S1</label> + <label>Cool Offset S1</label> <description>Offset of the cool curve, see manual for more information </description> <state min="-10" max="10" step="1" pattern="%d " readOnly="false"> </state> </channel-type> <channel-type id="f750-48743" advanced="true"> <item-type>Switch</item-type> - <label>Hot water high power mode</label> + <label>Hot Water High Power Mode</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48755" advanced="true"> <item-type>Number</item-type> - <label>Transformer ratio</label> + <label>Transformer Ratio</label> <description>Ratio of the current measurement transformers</description> <state min="300" max="2500" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48794" advanced="true"> <item-type>Number</item-type> - <label>RH set value</label> + <label>RH Set Value</label> <description>RH set value</description> <state min="30" max="90" step="1" pattern="%d %" readOnly="false"> </state> </channel-type> <channel-type id="f750-48810" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S8 </label> + <label>Prevent Humidity S8</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48811" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S7</label> + <label>Prevent Humidity S7</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48812" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S6</label> + <label>Prevent Humidity S6</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48813" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S5</label> + <label>Prevent Humidity S5</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48814" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S4</label> + <label>Prevent Humidity S4</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48815" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S3</label> + <label>Prevent Humidity S3</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48816" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S2</label> + <label>Prevent Humidity S2</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48817" advanced="true"> <item-type>Switch</item-type> - <label>Prevent humidity S1</label> + <label>Prevent Humidity S1</label> <description> </description> <state readOnly="false"></state> </channel-type> @@ -4266,7 +4266,7 @@ </channel-type> <channel-type id="f750-48891" advanced="true"> <item-type>Number</item-type> - <label>Setting up ventilation</label> + <label>Setting up Ventilation</label> <description>Setting up ventilation for normal speed.</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> @@ -4299,28 +4299,28 @@ </channel-type> <channel-type id="f750-48914" advanced="true"> <item-type>Number</item-type> - <label>Max int add. power, SG Ready</label> + <label>Max Int Add. Power, SG Ready</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f kW" readOnly="false"> </state> </channel-type> <channel-type id="f750-48915" advanced="true"> <item-type>Number</item-type> - <label>Real air flow</label> + <label>Real Air Flow</label> <description>Externally measured air flow during ventilation adjustments.</description> <state min="70" max="400" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48926" advanced="true"> <item-type>Number</item-type> - <label>Humidity factor</label> + <label>Humidity Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature.</description> <state min="5" max="100" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="f750-48927" advanced="true"> <item-type>Number</item-type> - <label>Humidity cool factor</label> + <label>Humidity Cool Factor</label> <description>Setting of how much the difference between set and actual room humidity should affect the supply temperature in cooling mode.</description> <state min="0" max="255" step="1" pattern="%.1f" readOnly="false"> </state> @@ -4345,70 +4345,70 @@ </channel-type> <channel-type id="f750-48968" advanced="true"> <item-type>Number</item-type> - <label>FLM 1 set point, cooling</label> + <label>FLM 1 Set Point, Cooling</label> <description>Set point, cooling, when using FLM cooling</description> <state min="50" max="400" step="1" pattern="%.1f°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-48969" advanced="true"> <item-type>Number</item-type> - <label>AUX block OPT</label> + <label>AUX Block OPT</label> <description>AUX block OPT</description> <state min="0" max="255" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48970" advanced="true"> <item-type>Switch</item-type> - <label>Outdoor Air Mixing function</label> + <label>Outdoor Air Mixing Function</label> <description>Activates the Outdoor Air Mixing function.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48972" advanced="true"> <item-type>Number</item-type> - <label>Outdoor air min. temp.</label> + <label>Outdoor Air Min. Temp.</label> <description>Minimum outdoor air temperature set.</description> <state min="-10" max="10" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-48973" advanced="true"> <item-type>Switch</item-type> - <label>Reduced ventilation</label> + <label>Reduced Ventilation</label> <description>Outdoor air reduced ventilation. 0 = deactivated, 1 = activated.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48975" advanced="true"> <item-type>Switch</item-type> - <label>OEK accessory</label> + <label>OEK Accessory</label> <description>Activates the OEK Accessory.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-48976" advanced="true"> <item-type>Switch</item-type> - <label>Smart home room control</label> + <label>Smart Home Room Control</label> <description></description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49223" advanced="true"> <item-type>Switch</item-type> - <label>SCA solar heating</label> + <label>SCA Solar Heating</label> <description>SCA solar heating: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49224" advanced="true"> <item-type>Switch</item-type> - <label>SCA ext. hot water</label> + <label>SCA Ext. Hot Water</label> <description>SCA external hot water: 0=not activated, 1=activated</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49227" advanced="true"> <item-type>Switch</item-type> - <label>Block top frequencies</label> + <label>Block Top Frequencies</label> <description>Block compressor top frequencies</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49281" advanced="true"> <item-type>Number</item-type> - <label>SAM fan model</label> + <label>SAM Fan Model</label> <description>SAM fan model</description> <state min="6" max="6" step="1" pattern="%d" readOnly="false"> </state> @@ -4422,46 +4422,46 @@ </channel-type> <channel-type id="f750-49285" advanced="true"> <item-type>Number</item-type> - <label>Energy Meter pulses per kWh X23</label> + <label>Energy Meter Pulses Per KWh X23</label> <description>Energy meter factor X23, pulses per kWh</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-49286" advanced="true"> <item-type>Number</item-type> - <label>Energy Meter pulses per kWh X22</label> + <label>Energy Meter Pulses Per KWh X22</label> <description>Energy meter factor X22, pulses per kWh</description> <state min="1" max="10000" step="1" pattern="%d" readOnly="false"> </state> </channel-type> <channel-type id="f750-49287" advanced="true"> <item-type>Switch</item-type> - <label>Energy Meter mode X23</label> + <label>Energy Meter Mode X23</label> <description>Energy meter X23 in mode Wh/pulse = 0 or pulses/kWh = 1</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49288" advanced="true"> <item-type>Switch</item-type> - <label>Energy Meter mode X22</label> + <label>Energy Meter Mode X22</label> <description>Energy meter X22 in mode Wh/pulse = 0 or pulses/kWh = 1</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49289" advanced="true"> <item-type>Switch</item-type> - <label>Ground water pump speed control </label> + <label>Ground Water Pump Speed Control</label> <description> </description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49295" advanced="true"> <item-type>Number</item-type> - <label>AHPS External Addition start temperature.</label> + <label>AHPS External Addition Start Temperature.</label> <description></description> <state min="40" max="55" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49296" advanced="true"> <item-type>Number</item-type> - <label>AHPS External Addition stop temperature.</label> + <label>AHPS External Addition Stop Temperature.</label> <description></description> <state min="44" max="59" step="1" pattern="%d°C" readOnly="false"> </state> @@ -4485,60 +4485,60 @@ </channel-type> <channel-type id="f750-49358" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49359" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49360" advanced="true"> <item-type>Switch</item-type> - <label>Night cooling</label> + <label>Night Cooling</label> <description>If the fan should have a higher speed when there is a high room temp and a low outdoor temp.</description> <state readOnly="false"></state> </channel-type> <channel-type id="f750-49361" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49362" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49363" advanced="true"> <item-type>Number</item-type> - <label>Start room temp. night cooling</label> + <label>Start Room Temp. Night Cooling</label> <description></description> <state min="20" max="30" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49364" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49365" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d°C" readOnly="false"> </state> </channel-type> <channel-type id="f750-49366" advanced="true"> <item-type>Number</item-type> - <label>Night Cooling Min. diff.</label> + <label>Night Cooling Min. Diff.</label> <description>Minimum difference between room temp and outdoor temp to start night cooling</description> <state min="3" max="10" step="1" pattern="%d°C" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750.xml b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750.xml index d8b68c389d673..9526c0bc672c4 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750.xml +++ b/bundles/org.openhab.binding.nibeheatpump/src/main/resources/ESH-INF/thing/f750.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="f750-udp"> - <label>UDP connected Nibe F750 Heat Pump</label> + <label>UDP Connected Nibe F750 Heat Pump</label> <description></description> <channel-groups> @@ -24,12 +24,12 @@ <default>9999</default> </parameter> <parameter name="readCommandsPort" type="integer"> - <label>UDP Port For Read Commands</label> + <label>UDP Port for Read Commands</label> <description>UDP port to send read commands to the NibeGW.</description> <default>9999</default> </parameter> <parameter name="writeCommandsPort" type="integer"> - <label>UDP Port For Write Commands</label> + <label>UDP Port for Write Commands</label> <description>UDP port to send write commands to the NibeGW.</description> <default>10000</default> </parameter> @@ -51,7 +51,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Registers List For Write Commands</label> + <label>Registers List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 40940, 45171</description> <default></default> </parameter> @@ -65,7 +65,7 @@ </thing-type> <thing-type id="f750-serial"> - <label>Serial port connected F750 Heat Pump</label> + <label>Serial Port Connected F750 Heat Pump</label> <description></description> <channel-groups> @@ -96,22 +96,22 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 40940, 45171</description> <default></default> </parameter> <parameter name="sendAckToMODBUS40" type="boolean"> - <label>Enable Acknowledges To MODBUS40 Messages</label> + <label>Enable Acknowledges to MODBUS40 Messages</label> <description>Binding emulates MODBUS40 device and send protocol acknowledges to heat pump.</description> <default>true</default> </parameter> <parameter name="sendAckToRMU40" type="boolean"> - <label>Enable Acknowledges To RMU40 Messages</label> + <label>Enable Acknowledges to RMU40 Messages</label> <description>Binding emulates RMU40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> <parameter name="sendAckToSMS40" type="boolean"> - <label>Enable Acknowledges To SMS40 Messages</label> + <label>Enable Acknowledges to SMS40 Messages</label> <description>Binding emulates SMS40 device and send protocol acknowledges to heat pump.</description> <default>false</default> </parameter> @@ -151,7 +151,7 @@ <default>false</default> </parameter> <parameter name="enableWriteCommandsToRegisters" type="text"> - <label>Register List For Write Commands</label> + <label>Register List for Write Commands</label> <description>Comma separated list of registers, which are allowed to write to heat pump. E.g. 40940, 45171</description> <default></default> </parameter> diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerCommand2NibeTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerCommand2NibeTest.java index 16977fc72525b..3998850d3322c 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerCommand2NibeTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerCommand2NibeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerNibe2StateTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerNibe2StateTest.java index 5d7dd9ab5c1e4..f40efb7f0dc53 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerNibe2StateTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/handler/NibeHeatPumpHandlerNibe2StateTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessageTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessageTest.java index 8e7bf3584e82a..25ae41d82732a 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessageTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusDataReadOutMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,14 +17,13 @@ import java.util.ArrayList; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; /** * Tests cases for {@link ModbusDataReadOutMessage}. * - * @author Pauli Anttila + * @author Pauli Anttila - Initial contribution */ public class ModbusDataReadOutMessageTest { diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessageTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessageTest.java index 59cb7870885af..da2ba2db8c07c 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessageTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadRequestMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,14 +15,13 @@ import static org.junit.Assert.assertEquals; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; /** * Tests cases for {@link ModbusReadRequestMessage}. * - * @author Pauli Anttila + * @author Pauli Anttila - Initial contribution */ public class ModbusReadRequestMessageTest { diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessageTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessageTest.java index b835c037c3ffe..cbdcba30132d4 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessageTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusReadResponseMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,14 +15,13 @@ import static org.junit.Assert.assertEquals; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; /** * Tests cases for {@link ModbusReadRequestMessage}. * - * @author Pauli Anttila + * @author Pauli Anttila - Initial contribution */ public class ModbusReadResponseMessageTest { diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessageTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessageTest.java index 54d0bd507f46d..21d5220d6769f 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessageTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteRequestMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,6 @@ import static org.junit.Assert.assertEquals; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Before; import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; @@ -23,7 +22,7 @@ /** * Tests cases for {@link ModbusReadRequestMessage}. * - * @author Pauli Anttila + * @author Pauli Anttila - Initial contribution */ public class ModbusWriteRequestMessageTest { diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessageTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessageTest.java index 3d27d3a1b121c..14deed3ce8f4a 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessageTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/ModbusWriteResponseMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,6 @@ import static org.junit.Assert.assertEquals; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Before; import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.NibeHeatPumpException; @@ -23,7 +22,7 @@ /** * Tests cases for {@link ModbusReadRequestMessage}. * - * @author Pauli Anttila + * @author Pauli Anttila - Initial contribution */ public class ModbusWriteResponseMessageTest { diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpProtocolTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpProtocolTest.java index 6e45e4da36b82..7e1e79cfc8269 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpProtocolTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/message/NibeHeatPumpProtocolTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,13 +19,15 @@ import java.util.List; import org.eclipse.smarthome.core.util.HexUtils; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openhab.binding.nibeheatpump.internal.protocol.NibeHeatPumpProtocolContext; import org.openhab.binding.nibeheatpump.internal.protocol.NibeHeatPumpProtocolDefaultContext; +/** + * @author Pauli Anttila - Initial contribution + */ public class NibeHeatPumpProtocolTest { int ackRequestCount = 0; diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/PumpModelTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/PumpModelTest.java index 16761a2cafabf..f5d26dea1de55 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/PumpModelTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/PumpModelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,9 @@ import org.junit.Before; import org.junit.Test; +/** + * @author Pauli Anttila - Initial contribution + */ public class PumpModelTest { @Before diff --git a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformationTest.java b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformationTest.java index e36716f3c469d..e5cf957ee3c06 100644 --- a/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformationTest.java +++ b/bundles/org.openhab.binding.nibeheatpump/src/test/java/org/openhab/binding/nibeheatpump/internal/models/VariableInformationTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,9 @@ import org.junit.Before; import org.junit.Test; +/** + * @author Pauli Anttila - Initial contribution + */ public class VariableInformationTest { @Before diff --git a/bundles/org.openhab.binding.nibeuplink/NOTICE b/bundles/org.openhab.binding.nibeuplink/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nibeuplink/NOTICE +++ b/bundles/org.openhab.binding.nibeuplink/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nibeuplink/README.md b/bundles/org.openhab.binding.nibeuplink/README.md index e3c46230bd69e..06b408e7a3f1f 100644 --- a/bundles/org.openhab.binding.nibeuplink/README.md +++ b/bundles/org.openhab.binding.nibeuplink/README.md @@ -23,23 +23,23 @@ Auto-Discovery is not supported, as credentials are necessary to login into Nibe The syntax for a heat pump thing is: ``` -nibeuplink:<MODEL>:<NAME> +nibeuplink:<THING TYPE>:<NAME> ``` - **nibeuplink** the binding id, fixed -- **model** the heatpump model (Binding Model) +- **thing type** the heatpump thing type - **name** the name of the heatpump (choose any name) Following models (indoor / main units) are currently supported: -| Nibe Model(s) | Openhab Model | Description | -|-------------------|-------------------|-------------------------------------------------------| -| VVM310 / 500 | vvm310 | reduced set of channels based on NibeUplink website | -| VVM320 / 325 | vvm320 | reduced set of channels based on NibeUplink website | -| F730 | f730 | reduced set of channels based on NibeUplink website | -| F750 | f750 | reduced set of channels based on NibeUplink website | -| F1145 / 1245 | f1145 | reduced set of channels based on NibeUplink website | -| F1155 / 1255 | f1155 | reduced set of channels based on NibeUplink website | +| Nibe Model(s) | Thing Type | Description | +|-------------------|------------|-----------------------------------------------------| +| VVM310 / 500 | vvm310 | reduced set of channels based on NibeUplink website | +| VVM320 / 325 | vvm320 | reduced set of channels based on NibeUplink website | +| F730 | f730 | reduced set of channels based on NibeUplink website | +| F750 | f750 | reduced set of channels based on NibeUplink website | +| F1145 / 1245 | f1145 | reduced set of channels based on NibeUplink website | +| F1155 / 1255 | f1155 | reduced set of channels based on NibeUplink website | The following configuration parameters are available for this thing: diff --git a/bundles/org.openhab.binding.nibeuplink/pom.xml b/bundles/org.openhab.binding.nibeuplink/pom.xml index 0a18572750422..1e8311a4c2d01 100644 --- a/bundles/org.openhab.binding.nibeuplink/pom.xml +++ b/bundles/org.openhab.binding.nibeuplink/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nibeuplink</artifactId> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/feature/feature.xml b/bundles/org.openhab.binding.nibeuplink/src/main/feature/feature.xml index a80848a0dded7..7ebd19dd08391 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nibeuplink-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nibeuplink" description="NibeUplink Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/AtomicReferenceTrait.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/AtomicReferenceTrait.java index 8d8914eac5edd..abeea81c8501f 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/AtomicReferenceTrait.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/AtomicReferenceTrait.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkBindingConstants.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkBindingConstants.java index 68455f0532ff1..aa3a44a48e607 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkBindingConstants.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkHandlerFactory.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkHandlerFactory.java index fe217d85d8a4f..078058f2047e6 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkHandlerFactory.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/NibeUplinkHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/callback/AbstractUplinkCommandCallback.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/callback/AbstractUplinkCommandCallback.java index 4525dd54b40ca..c01bfa5c7c467 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/callback/AbstractUplinkCommandCallback.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/callback/AbstractUplinkCommandCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/GenericStatusUpdate.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/GenericStatusUpdate.java index 192018b09ed84..36350d364e035 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/GenericStatusUpdate.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/GenericStatusUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/Login.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/Login.java index 061617350090a..ba3b3ca6572db 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/Login.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/Login.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/NibeUplinkCommand.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/NibeUplinkCommand.java index 87e0d9f0b1d0b..3fd077d803b81 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/NibeUplinkCommand.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/NibeUplinkCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/UpdateSetting.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/UpdateSetting.java index b72d1c897dd67..c55deee57701b 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/UpdateSetting.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/command/UpdateSetting.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/config/NibeUplinkConfiguration.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/config/NibeUplinkConfiguration.java index 7bfd9fef2d0c7..798241e7df0c5 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/config/NibeUplinkConfiguration.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/config/NibeUplinkConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/CommunicationStatus.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/CommunicationStatus.java index 2d224807a5065..1f81dec49c891 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/CommunicationStatus.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/CommunicationStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/StatusUpdateListener.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/StatusUpdateListener.java index 31bb0ae284e20..9414a9662e4b3 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/StatusUpdateListener.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/StatusUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/UplinkWebInterface.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/UplinkWebInterface.java index bd9894c765dc8..9d2632d14a4cc 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/UplinkWebInterface.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/connector/UplinkWebInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/ChannelProvider.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/ChannelProvider.java index 7b193172b4aab..f730af072d435 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/ChannelProvider.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/ChannelProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/GenericHandler.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/GenericHandler.java index 2f4ad4d63e63a..97019603150d2 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/GenericHandler.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/GenericHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/NibeUplinkHandler.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/NibeUplinkHandler.java index 03d8de79f6bb6..6604e439fa9ad 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/NibeUplinkHandler.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/NibeUplinkHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkBaseHandler.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkBaseHandler.java index c1a6158b285f5..49e9550ce0291 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkBaseHandler.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkPolling.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkPolling.java index 366566076377b..d94ebe4074844 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkPolling.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/handler/UplinkPolling.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/AbstractChannels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/AbstractChannels.java index 2ad442113fd57..ed05280ff7c5d 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/AbstractChannels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/AbstractChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/BaseChannels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/BaseChannels.java index 169190e51d75a..0ab2718e6f6c5 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/BaseChannels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/BaseChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/Channel.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/Channel.java index a299f4edbb978..275afa9691b65 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/Channel.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/Channel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelGroup.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelGroup.java index 77a24cd53b136..77d6c5236ad49 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelGroup.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelList.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelList.java index 163271d4f80dd..4f961b77bc1a1 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelList.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ChannelList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannel.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannel.java index cc1273f90f8df..9593862568782 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannel.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannels.java index b466ea4e83dbb..bfb0c130504a9 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/CustomChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponse.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponse.java index 7a717fb027e19..ed609543e744a 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponse.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponseTransformer.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponseTransformer.java index f83da2e042215..19c99154a684a 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponseTransformer.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/DataResponseTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1145Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1145Channels.java index f670140af1596..de01c89af5574 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1145Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1145Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1155Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1155Channels.java index b64b5ae415e8a..84db09a27827e 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1155Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F1155Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F730Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F730Channels.java index a1b9ae8e8d802..18082e4140487 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F730Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F730Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F750Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F750Channels.java index 0c009803768b0..865f30b1e5344 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F750Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/F750Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/GenericDataResponse.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/GenericDataResponse.java index 4fcb180f8ca08..b489195b5468b 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/GenericDataResponse.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/GenericDataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/QuantityChannel.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/QuantityChannel.java index 23f4a804f8bd1..9039762689cec 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/QuantityChannel.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/QuantityChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ScaledChannel.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ScaledChannel.java index 72278cdd061ac..b3ffaaa73430d 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ScaledChannel.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ScaledChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/SwitchChannel.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/SwitchChannel.java index af63412aa3d29..eabff98df9de2 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/SwitchChannel.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/SwitchChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -99,4 +99,4 @@ public String mapValue(OnOffType value) { } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM310Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM310Channels.java index 6279c3860f254..3a44330ffbc49 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM310Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM310Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM320Channels.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM320Channels.java index efd8c36cda2b3..14c79989724c1 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM320Channels.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/VVM320Channels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ValidationException.java b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ValidationException.java index 9f4c91d1f5e6c..cafae67295c22 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ValidationException.java +++ b/bundles/org.openhab.binding.nibeuplink/src/main/java/org/openhab/binding/nibeuplink/internal/model/ValidationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-groups.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-groups.xml index eff932aea72a6..6cf7c16a94d58 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-groups.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-groups.xml @@ -33,7 +33,7 @@ </channels> </channel-group-type> <channel-group-type id="base-hotwater"> - <label>Hot water Channels</label> + <label>Hot Water Channels</label> <channels> <channel id="40013" typeId="base-type-40013" /> <channel id="40014" typeId="base-type-40014" /> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-types.xml index b0b518ff3d50b..e088b84955291 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/base-channel-types.xml @@ -5,13 +5,13 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="base-type-10012"> <item-type>Switch</item-type> - <label>Compressor blocked</label> + <label>Compressor Blocked</label> <description>states if the compressor is blocked</description> <state readOnly="true"></state> </channel-type> <channel-type id="base-type-10033"> <item-type>Switch</item-type> - <label>Int. el.add. blocked</label> + <label>Int. El.add. Blocked</label> <description>states if internal electric additional heater is blocked</description> <state readOnly="true"></state> </channel-type> @@ -24,14 +24,14 @@ </channel-type> <channel-type id="base-type-40008"> <item-type>Number:Temperature</item-type> - <label>BT2 Supply temp S1</label> + <label>BT2 Supply Temp S1</label> <description>Supply temperature for system 1</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-40012"> <item-type>Number:Temperature</item-type> - <label>EB100-EP14-BT3 Return temp</label> + <label>EB100-EP14-BT3 Return Temp</label> <description>Return temperature</description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -101,7 +101,7 @@ </channel-type> <channel-type id="base-type-43005"> <item-type>Number</item-type> - <label>Degree Minutes (16 bit)</label> + <label>Degree Minutes (16 Bit)</label> <description>Degree minutes, 16bit value (-32768 < x < 32767). Values outside valid values are rounded to the closest valid value.</description> <state min="-30000" max="30000" step="1" pattern="%d °*min" readOnly="false"> </state> @@ -115,21 +115,21 @@ </channel-type> <channel-type id="base-type-43081"> <item-type>Number:Time</item-type> - <label>Tot. op.time add.</label> + <label>Tot. Op.time Add.</label> <description>Total electric additive operation time</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-43084"> <item-type>Number:Power</item-type> - <label>Int. el.add. Power</label> + <label>Int. El.add. Power</label> <description>Current power from the internal electrical addition</description> <state pattern="%.2f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-43161"> <item-type>Switch</item-type> - <label>External adjustment activated via input S1</label> + <label>External Adjustment Activated Via Input S1</label> <description></description> <state readOnly="true"></state> </channel-type> @@ -177,7 +177,7 @@ </channel-type> <channel-type id="base-type-47041"> <item-type>Number</item-type> - <label>Hot water mode</label> + <label>Hot Water Mode</label> <description>The currently active hotwater mode</description> <state readOnly="false"> <options> @@ -189,56 +189,56 @@ </channel-type> <channel-type id="base-type-47043"> <item-type>Number:Temperature</item-type> - <label>Start temperature HW Luxury</label> + <label>Start Temperature HW Luxury</label> <description>Start temperature for heating water in Luxury mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47044"> <item-type>Number:Temperature</item-type> - <label>Start temperature HW Normal</label> + <label>Start Temperature HW Normal</label> <description>Start temperature for heating water in Normal mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47045"> <item-type>Number:Temperature</item-type> - <label>Start temperature HW Economy</label> + <label>Start Temperature HW Economy</label> <description>Start temperature for heating water in Economy mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47046"> <item-type>Number:Temperature</item-type> - <label>Stop temperature Periodic HW</label> + <label>Stop Temperature Periodic HW</label> <description>Stop temperature for heating water in periodic heating</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47047"> <item-type>Number:Temperature</item-type> - <label>Stop temperature HW Luxury</label> + <label>Stop Temperature HW Luxury</label> <description>Stop temperature for heating water in Luxory mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47048"> <item-type>Number:Temperature</item-type> - <label>Stop temperature HW Normal</label> + <label>Stop Temperature HW Normal</label> <description>Stop temperature for heating water in Normal mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47049"> <item-type>Number:Temperature</item-type> - <label>Stop temperature HW Economy</label> + <label>Stop Temperature HW Economy</label> <description>Stop temperature for heating water in Economy mode</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="base-type-47212"> <item-type>Number:Power</item-type> - <label>Max int add. power</label> + <label>Max Int Add. Power</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f %unit%" readOnly="false"> </state> @@ -264,7 +264,7 @@ </channel-type> <channel-type id="base-type-48914"> <item-type>Number:Power</item-type> - <label>Max int add. power, SG Ready</label> + <label>Max Int Add. Power, SG Ready</label> <description></description> <state min="0" max="4500" step="1" pattern="%.2f %unit%" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1145-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1145-channel-types.xml index a2a51e54ad977..f07a86c2b531e 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1145-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1145-channel-types.xml @@ -33,28 +33,28 @@ </channel-type> <channel-type id="f1145-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1145-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1145-type-40015"> <item-type>Number:Temperature</item-type> - <label>EB100-EP14-BT10 Brine In Temperature</label> + <label>EB100-EP14-BT10 Brine in Temperature</label> <description>Brine in temperature, BT10</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1145-type-40016"> <item-type>Number:Temperature</item-type> - <label>EB100-EP14-BT11 Brine Out Temperature</label> + <label>EB100-EP14-BT11 Brine out Temperature</label> <description>Brine out temperature, BT11</description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -68,14 +68,14 @@ </channel-type> <channel-type id="f1145-type-43416"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressor starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1145-type-43103"> <item-type>Number</item-type> - <label>HPAC state</label> + <label>HPAC State</label> <description>State of the HPAC accessory</description> <state pattern="%d" readOnly="true"> <options> @@ -98,14 +98,14 @@ </channel-type> <channel-type id="f1145-type-43420"> <item-type>Number:Time</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressor operation time</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1145-type-43424"> <item-type>Number:Time</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressor operation time in hot water mode</description> <state pattern="%d %unit%" readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1155-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1155-channel-types.xml index 646be3c81a79a..465441d03f982 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1155-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f1155-channel-types.xml @@ -33,28 +33,28 @@ </channel-type> <channel-type id="f1155-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-43122"> <item-type>Number:Frequency</item-type> - <label>Compr. current min.freq.</label> + <label>Compr. Current Min.freq.</label> <description>The current minimum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-43123"> <item-type>Number:Frequency</item-type> - <label>Compr. current max.freq.</label> + <label>Compr. Current Max.freq.</label> <description>The current maximum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> @@ -68,21 +68,21 @@ </channel-type> <channel-type id="f1155-type-43416"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressor starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-43420"> <item-type>Number:Time</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressor operation time</description> <state pattern="%d h" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-43424"> <item-type>Number:Time</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressor operation time in hot water mode</description> <state pattern="%d h" readOnly="true"> </state> @@ -103,14 +103,14 @@ </channel-type> <channel-type id="f1155-type-40015"> <item-type>Number:Temperature</item-type> - <label>EB100-EP14-BT10 Brine In Temperature</label> + <label>EB100-EP14-BT10 Brine in Temperature</label> <description>Brine in temperature, BT10</description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f1155-type-40016"> <item-type>Number:Temperature</item-type> - <label>EB100-EP14-BT11 Brine Out Temperature</label> + <label>EB100-EP14-BT11 Brine out Temperature</label> <description>Brine out temperature, BT11</description> <state pattern="%.1f %unit%" readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f730-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f730-channel-types.xml index 34f219024e636..c2381392307d3 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f730-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f730-channel-types.xml @@ -5,7 +5,7 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="f730-type-10001"> <item-type>Number:Dimensionless</item-type> - <label>Fan speed current</label> + <label>Fan Speed Current</label> <description>The current fan speed</description> <state pattern="%d %%" readOnly="true"> </state> @@ -33,7 +33,7 @@ </channel-type> <channel-type id="f730-type-40020"> <item-type>Number:Temperature</item-type> - <label>EB100-BT16 Evaporator temp</label> + <label>EB100-BT16 Evaporator Temp</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -47,14 +47,14 @@ </channel-type> <channel-type id="f730-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -68,49 +68,49 @@ </channel-type> <channel-type id="f730-type-40919"> <item-type>Number</item-type> - <label>Air mix</label> + <label>Air Mix</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-41026"> <item-type>Number</item-type> - <label>EB100-Adjusted BS1 Air flow</label> + <label>EB100-Adjusted BS1 Air Flow</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43066"> <item-type>Number:Time</item-type> - <label>Defrosting time</label> + <label>Defrosting Time</label> <description>Defrosting time, no defrosting heater in the product</description> <state pattern="%d s" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43122"> <item-type>Number:Frequency</item-type> - <label>Compr. current min.freq.</label> + <label>Compr. Current Min.freq.</label> <description>The current minimum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43123"> <item-type>Number:Frequency</item-type> - <label>Compr. current max.freq.</label> + <label>Compr. Current Max.freq.</label> <description>The current maximum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43124"> <item-type>Number</item-type> - <label>Airflow ref.</label> + <label>Airflow Ref.</label> <description>Reference value for the airflow.</description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43125"> <item-type>Number</item-type> - <label>Airflow reduction</label> + <label>Airflow Reduction</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> @@ -124,28 +124,28 @@ </channel-type> <channel-type id="f730-type-43181"> <item-type>Number:Dimensionless</item-type> - <label>Chargepump speed</label> + <label>Chargepump Speed</label> <description></description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43416"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressor starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43420"> <item-type>Number:Time</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressor operation time</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f730-type-43424"> <item-type>Number:Time</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressor operation time in hot water mode</description> <state pattern="%d %unit%" readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f750-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f750-channel-types.xml index 19f626bc6bf62..84d25f2723b64 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f750-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/f750-channel-types.xml @@ -26,7 +26,7 @@ </channel-type> <channel-type id="f750-type-40020"> <item-type>Number:Temperature</item-type> - <label>EB100-BT16 Evaporator temp</label> + <label>EB100-BT16 Evaporator Temp</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -40,28 +40,28 @@ </channel-type> <channel-type id="f750-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-41026"> <item-type>Number</item-type> - <label>EB100-Adjusted BS1 Air flow</label> + <label>EB100-Adjusted BS1 Air Flow</label> <description></description> <state pattern="%.1f" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-47260"> <item-type>Number</item-type> - <label>Current Fan speed</label> + <label>Current Fan Speed</label> <description>Currently selected fan speed</description> <state readOnly="false"> <options> @@ -75,21 +75,21 @@ </channel-type> <channel-type id="f750-type-43122"> <item-type>Number:Frequency</item-type> - <label>Compr. current min.freq.</label> + <label>Compr. Current Min.freq.</label> <description>The current minimum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-43123"> <item-type>Number:Frequency</item-type> - <label>Compr. current max.freq.</label> + <label>Compr. Current Max.freq.</label> <description>The current maximum frequency of the compressor</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-43124"> <item-type>Number</item-type> - <label>Airflow ref.</label> + <label>Airflow Ref.</label> <description>Reference value for the airflow.</description> <state pattern="%.1f" readOnly="true"> </state> @@ -103,28 +103,28 @@ </channel-type> <channel-type id="f750-type-43181"> <item-type>Number:Dimensionless</item-type> - <label>Chargepump speed</label> + <label>Chargepump Speed</label> <description></description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-43416"> <item-type>Number</item-type> - <label>Compressor starts EB100-EP14</label> + <label>Compressor Starts EB100-EP14</label> <description>Number of compressor starts</description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-43420"> <item-type>Number:Time</item-type> - <label>Tot. op.time compr. EB100-EP14</label> + <label>Tot. Op.time Compr. EB100-EP14</label> <description>Total compressor operation time</description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="f750-type-43424"> <item-type>Number:Time</item-type> - <label>Tot. HW op.time compr. EB100-EP14</label> + <label>Tot. HW Op.time Compr. EB100-EP14</label> <description>Total compressor operation time in hot water mode</description> <state pattern="%d %unit%" readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm310-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm310-channel-types.xml index 9e877c6c64534..e72dfc2fa9c71 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm310-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm310-channel-types.xml @@ -5,21 +5,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="vvm310-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-40075"> <item-type>Number:Temperature</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -33,21 +33,21 @@ </channel-type> <channel-type id="vvm310-type-40311"> <item-type>Number:Dimensionless</item-type> - <label>External ERS accessory GQ2 speed</label> + <label>External ERS Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-40312"> <item-type>Number:Dimensionless</item-type> - <label>External ERS accessory GQ3 speed</label> + <label>External ERS Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-40737"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. Cooling op.time compr</label> + <label>EB101-EP14 Tot. Cooling Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> @@ -61,14 +61,14 @@ </channel-type> <channel-type id="vvm310-type-40183"> <item-type>Number:Temperature</item-type> - <label>AZ30-BT23 Outdoor temp. ERS</label> + <label>AZ30-BT23 Outdoor Temp. ERS</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-40942"> <item-type>Switch</item-type> - <label>External ERS accessory block status</label> + <label>External ERS Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state readOnly="true"></state> </channel-type> @@ -109,21 +109,21 @@ </channel-type> <channel-type id="vvm310-type-44069"> <item-type>Number</item-type> - <label>EB101-EP14 Compressor starts</label> + <label>EB101-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-44071"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. op.time compr</label> + <label>EB101-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm310-type-44073"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. HW op.time compr</label> + <label>EB101-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> @@ -158,7 +158,7 @@ </channel-type> <channel-type id="vvm310-type-44396"> <item-type>Number:Dimensionless</item-type> - <label>EB101 Speed charge pump</label> + <label>EB101 Speed Charge Pump</label> <description></description> <state pattern="%d %%" readOnly="true"> </state> @@ -218,7 +218,7 @@ </channel-type> <channel-type id="vvm310-type-47260"> <item-type>Number</item-type> - <label>Selected Fan speed</label> + <label>Selected Fan Speed</label> <description>Currently selected fan speed</description> <state readOnly="false"> <options> @@ -232,20 +232,20 @@ </channel-type> <channel-type id="vvm310-type-47394"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="vvm310-type-47402"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="vvm310-type-48793"> <item-type>Number</item-type> - <label>Room sensor cool factor S1</label> + <label>Room Sensor Cool Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode.</description> <state min="0" max="60" step="1" pattern="%.1f" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm320-channel-types.xml b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm320-channel-types.xml index f9f63bcffc520..ae163af65cb86 100644 --- a/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm320-channel-types.xml +++ b/bundles/org.openhab.binding.nibeuplink/src/main/resources/ESH-INF/thing/vvm320-channel-types.xml @@ -5,21 +5,21 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="vvm320-type-40025"> <item-type>Number:Temperature</item-type> - <label>BT20 Exhaust air temp. 1</label> + <label>BT20 Exhaust Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-40026"> <item-type>Number:Temperature</item-type> - <label>BT21 Vented air temp. 1</label> + <label>BT21 Vented Air Temp. 1</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-40075"> <item-type>Number:Temperature</item-type> - <label>BT22 Supply air temp.</label> + <label>BT22 Supply Air Temp.</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> @@ -33,21 +33,21 @@ </channel-type> <channel-type id="vvm320-type-40311"> <item-type>Number:Dimensionless</item-type> - <label>External ERS accessory GQ2 speed</label> + <label>External ERS Accessory GQ2 Speed</label> <description>Indicates the speed of the GQ2 fan speed on the ERS accessory.</description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-40312"> <item-type>Number:Dimensionless</item-type> - <label>External ERS accessory GQ3 speed</label> + <label>External ERS Accessory GQ3 Speed</label> <description>Indicates the speed of the GQ3 fan speed on the ERS accessory.</description> <state pattern="%d %%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-40737"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. Cooling op.time compr</label> + <label>EB101-EP14 Tot. Cooling Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> @@ -61,14 +61,14 @@ </channel-type> <channel-type id="vvm320-type-40183"> <item-type>Number:Temperature</item-type> - <label>AZ30-BT23 Outdoor temp. ERS</label> + <label>AZ30-BT23 Outdoor Temp. ERS</label> <description></description> <state pattern="%.1f %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-40942"> <item-type>Switch</item-type> - <label>External ERS accessory block status</label> + <label>External ERS Accessory Block Status</label> <description>Indicates if the ERS accessory is externaly blocked.</description> <state readOnly="true"></state> </channel-type> @@ -109,21 +109,21 @@ </channel-type> <channel-type id="vvm320-type-44069"> <item-type>Number</item-type> - <label>EB101-EP14 Compressor starts</label> + <label>EB101-EP14 Compressor Starts</label> <description></description> <state pattern="%d" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-44071"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. op.time compr</label> + <label>EB101-EP14 Tot. Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> </channel-type> <channel-type id="vvm320-type-44073"> <item-type>Number:Time</item-type> - <label>EB101-EP14 Tot. HW op.time compr</label> + <label>EB101-EP14 Tot. HW Op.time Compr</label> <description></description> <state pattern="%d %unit%" readOnly="true"> </state> @@ -158,7 +158,7 @@ </channel-type> <channel-type id="vvm320-type-44396"> <item-type>Number:Dimensionless</item-type> - <label>EB101 Speed charge pump</label> + <label>EB101 Speed Charge Pump</label> <description></description> <state pattern="%d %%" readOnly="true"> </state> @@ -218,7 +218,7 @@ </channel-type> <channel-type id="vvm320-type-47260"> <item-type>Number</item-type> - <label>Selected Fan speed</label> + <label>Selected Fan Speed</label> <description>Currently selected fan speed</description> <state readOnly="false"> <options> @@ -260,20 +260,20 @@ </channel-type> <channel-type id="vvm320-type-47394"> <item-type>Switch</item-type> - <label>Use room sensor S1</label> + <label>Use Room Sensor S1</label> <description>When activated the system uses the room sensor 0=Off 1=On</description> <state readOnly="false"></state> </channel-type> <channel-type id="vvm320-type-47402"> <item-type>Number</item-type> - <label>Room sensor factor S1</label> + <label>Room Sensor Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature.</description> <state min="0" max="6" step="1" pattern="%.1f" readOnly="false"> </state> </channel-type> <channel-type id="vvm320-type-48793"> <item-type>Number</item-type> - <label>Room sensor cool factor S1</label> + <label>Room Sensor Cool Factor S1</label> <description>Setting of how much the difference between set and actual room temperature should affect the supply temperature in cooling mode.</description> <state min="0" max="6" step="1" pattern="%.1f" readOnly="false"> </state> diff --git a/bundles/org.openhab.binding.nikobus/.classpath b/bundles/org.openhab.binding.nikobus/.classpath new file mode 100644 index 0000000000000..a5d95095ccaaf --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/.classpath @@ -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> diff --git a/bundles/org.openhab.binding.nikobus/.project b/bundles/org.openhab.binding.nikobus/.project new file mode 100644 index 0000000000000..70c413e1c86e3 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.nikobus</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> diff --git a/bundles/org.openhab.binding.nikobus/NOTICE b/bundles/org.openhab.binding.nikobus/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.nikobus/README.md b/bundles/org.openhab.binding.nikobus/README.md new file mode 100644 index 0000000000000..48aa0065795c6 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/README.md @@ -0,0 +1,229 @@ +# Nikobus Binding + +This binding allows openHAB to interact with the Nikobus home automation system. + +[![Demo Video Nikobus](https://img.youtube.com/vi/QiNb-8QxXpo/0.jpg)](https://www.youtube.com/watch?v=QiNb-8QxXpo) + +More specifically, it allows openHAB to: + +* send (simulated) button presses to the Nikobus, +* react to button presses which occur on the Nikobus, +* change the status of switch channels on a Nikobus switch module, +* request the status of switch channels on a Nikobus switch module, +* change the status of dimmer channels on a Nikobus dimmer module, +* request the status of dimmer channels on a Nikobus dimmer module, +* send commands to the Nikobus roller shutter module. + +This binding works with at least the following hardware: + +* PC-link module (05-200), +* Push buttons (05-060-01, 05-064-01), RF Transmitter (05-314), PIR Sensor (430-00500), +* 4 channel switch module (05-002-02), +* 12 channel switch module (05-000-02), +* 12 channel dimmer module. + +## Supported Things + +The binding supports a serial connection via `nikobus:pc-link` bridge to the Nikobus installation (PC-Link module): + +The bridge enables communication with other Nikobus components: + +* `switch-module` - Nikobus switch module, i.e. `05-000-02`, +* `dimmer-module` - Nikobus dim-controller module, i.e. `05-007-02`, +* `rollershutter-module` - Nikobus roller shutter module, +* `push-button` - Nikobus physical push button. + +## Discovery + +The binding does not support any automatic discovery of Things. + +## Bridge Configuration + +The binding can connect to the PC-Link via serial interface. + +``` +Bridge nikobus:pc-link:mypclink [ port="<serial port>", refreshInterval=<interval> ] { +} +``` + +where: + +* `port` is the name of the serial port used to connect to the Nikobus installation +* `refreshInterval` defines how often the binding reads Nikobus module's status, so having i.e. 30 as above, the binding will read one module’s status each 30s, iterating through all modules, one by one. If one does not specify `refreshInterval`, a default value of 60s is used. + +## Thing Configuration + +Once connected to the Nikobus installation using a bridge, one can communicate with: + +* `switch-module`, +* `dimmer-module`, +* `rollershutter-module`, +* `push-button`. + +### Modules + +Each module is defined by its address and contains 12 outputs (channels), where `output-1` corresponds to module's first output, `output-2` to module's second output and so on. +If physical module has less outputs, only those channels can be used (i.e. `05-002-02` has only 4 outputs, so only channels 1-4 can be used). + +Large module contains 2 channel groups, where the first group controls channels 1-6 and the second one controls channels 7-12. +The small module contains only a single channel group controlling all 4 channels. + +All commands sent to/received from the Nikobus switch module are for a single channel group. + +In order to be able to read the status of a Nikobus module channel or to switch a channel directly on the module without mimicking a button press, items for each channel of a module needs to be configured. + +#### switch-module + +``` +Thing switch-module s1 [ address = "BC00" ] +``` + +Defines a `switch-module` with address `BC00`. + +| channel | type | description | +|-----------|--------|--------------| +| output-1 | Switch | Output 1 | +| output-2 | Switch | Output 2 | +| output-3 | Switch | Output 3 | +| output-4 | Switch | Output 4 | +| output-5 | Switch | Output 5 | +| output-6 | Switch | Output 6 | +| output-7 | Switch | Output 7 | +| output-8 | Switch | Output 8 | +| output-9 | Switch | Output 9 | +| output-10 | Switch | Output 10 | +| output-11 | Switch | Output 11 | +| output-12 | Switch | Output 12 | + +#### dimmer-module + +``` +Thing dimmer-module d1 [ address = "D969" ] +``` + +Defines a `dimmer-module` with address `D969`. + +| channel | type | description | +|-----------|--------|--------------| +| output-1 | Dimmer | Output 1 | +| output-2 | Dimmer | Output 2 | +| output-3 | Dimmer | Output 3 | +| output-4 | Dimmer | Output 4 | +| output-5 | Dimmer | Output 5 | +| output-6 | Dimmer | Output 6 | +| output-7 | Dimmer | Output 7 | +| output-8 | Dimmer | Output 8 | +| output-9 | Dimmer | Output 9 | +| output-10 | Dimmer | Output 10 | +| output-11 | Dimmer | Output 11 | +| output-12 | Dimmer | Output 12 | + +#### rollershutter-module + +``` +Thing rollershutter-module r1 [ address = "4C6C" ] +``` + +Defines a `rollershutter-module` with address `4C6C`. + +| channel | type | description | +|-----------|---------------|--------------| +| output-1 | Rollershutter | Output 1 | +| output-2 | Rollershutter | Output 2 | +| output-3 | Rollershutter | Output 3 | +| output-4 | Rollershutter | Output 4 | +| output-5 | Rollershutter | Output 5 | +| output-6 | Rollershutter | Output 6 | + +### Buttons + +Once an openHAB item has been configured as a Nikobus button, it will receive a status update to ON when the physical button is pressed. +When an item receives the ON command from openHAB, it will send a simulated button press to the Nikobus. +This means one could also define virtual buttons in openHAB with non-existing addresses (e.g., `000001`) and use those in the programming of Nikobus installation. + +To configure an item for a button in openHAB with address `28092A`, use the following format: + +``` +Thing push-button pb1 [ address = "28092A" ] +``` + +Since all the channels in the entire channel group are switched to their new state, it is important that openHAB knows the current state of all the channels in that group. +Otherwise a channel which was switched on by a button, may be switched off again by the command. + +In order to keep an up to date state of the channels in openHAB, button configurations can be extended to include detail on which channel groups the button press affects. + +When configured, the status of the channel groups to which the button is linked, will be queried every time the button is pressed. +Every status query takes between ~300 ms, so to get the best performance, only add the affected channel groups in the configuration, which has the following format: + +``` +Thing push-button <id> [ address = "<address>", impactedModules = "<moduleType>:<moduleId>:<channelGroup>, <moduleType>:<moduleId>:<channelGroup>, ..." ] +``` + +where: + +* `moduleType` represents module's type, +* `moduleId` represents module's id, +* `channelGroup` represents the first (1) or second (2) channel group in the module. + + Example configurations may look like: + +``` +Thing switch-module s1 [ address = "FF2A" ] +Thing push-button pb1 [ address = "28092A", impactedModules = "switch-module:s1:1" ] +``` + +In addition to the status requests triggered by button presses, there is also a scheduled status update interval defined by the `refreshInterval` parameter and explained above. + +## Full Example + +### nikobus.things + +``` +Bridge nikobus:pc-link:mypclink [ port = "/dev/ttyUSB0", refreshInterval = 10 ] { + Thing dimmer-module d1 [ address = "0700" ] + Thing dimmer-module d2 [ address = "6B00" ] + + Thing switch-module s1 [ address = "FF2A" ] + Thing switch-module s2 [ address = "4C6C" ] + Thing switch-module s3 [ address = "A063" ] + + Thing rollershutter-module r1 [ address = "D769" ] + + Thing push-button 92092A "S_2_1_2A" [ address = "92092A", impactedModules = "switch-module:s1:1" ] + Thing push-button D2092A "S_2_1_2B" [ address = "D2092A", impactedModules = "switch-module:s1:1" ] + Thing push-button 12092A "S_2_1_2C" [ address = "12092A", impactedModules = "dimmer-module:d1:1" ] + Thing push-button 52092A "S_2_1_2D" [ address = "52092A", impactedModules = "dimmer-module:d1:1" ] + + Thing push-button 1EE5F2 "S_2_3_A" [ address = "1EE5F2", impactedModules = "dimmer-module:d1:2" ] + Thing push-button 5EE5F2 "S_2_3_B" [ address = "5EE5F2", impactedModules = "dimmer-module:d1:2" ] + + Thing push-button 0C274A "S_2_4_A" [ address = "0C274A", impactedModules = "dimmer-module:d1:2" ] + Thing push-button 4C274A "S_2_4_B" [ address = "4C274A", impactedModules = "dimmer-module:d1:2" ] + + Thing push-button 1D1FF2 "S_2_5_A" [ address = "1D1FF2", impactedModules = "switch-module:s1:1" ] + Thing push-button 5D1FF2 "S_2_5_B" [ address = "5D1FF2", impactedModules = "switch-module:s1:1" ] +} +``` + +### nikobus.items + +``` +Dimmer Light_FF_Gallery_Ceiling "Ceiling" (FF_Gallery, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-1" } +Dimmer Light_FF_Bed_Ceiling "Ceiling" (FF_Bed, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-7" } +Dimmer Light_FF_Child_Ceiling "Ceiling" (FF_Child, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d2:output-10" } +Dimmer Light_FF_Child_Wall_Left "Wall Left" (FF_Child, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-11" } +Dimmer Light_FF_Child_Wall_Right "Wall Right" (FF_Child, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-12" } +Dimmer Light_FF_PlayRoom_Ceiling "Ceiling" (FF_PlayRoom, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-6" } +Dimmer Light_FF_PlayRoom_Wall "Wall" (FF_PlayRoom, Lights) [ "Lighting" ] { channel="nikobus:dimmer-module:mypclink:d1:output-4" } + +Switch Light_FF_Gallery_Wall "Wall" (FF_Gallery, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s1:output-4" } +Switch Light_FF_Bath_Ceiling "Ceiling" (FF_Bath, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s3:output-2" } +Switch Light_FF_Wardrobe_Ceiling "Ceiling" (FF_Wardrobe, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s1:output-1" } +Switch Light_FF_Corridor_Ceiling "Ceiling" (FF_Corridor, Lights) [ "Lighting" ] { channel="nikobus:switch-module:mypclink:s2:output-3" } + +Rollershutter Shutter_GF_Corridor "Corridor" (GF_Corridor, gShuttersGF) { channel="nikobus:rollershutter-module:mypclink:r1:output-1" } +Rollershutter Shutter_GF_Bed "Bedroom" (GF_Bed, gShuttersGF) { channel="nikobus:rollershutter-module:mypclink:r1:output-3" } +Rollershutter Shutter_GF_Bath "Bathroom" (GF_Bath, gShuttersGF) { channel="nikobus:rollershutter-module:mypclink:r1:output-2" } +Rollershutter Shutter_FF_Child "Child's room" (FF_Child, gShuttersFF) { channel="nikobus:rollershutter-module:mypclink:r1:output-4" } +Rollershutter Shutter_FF_Gallery "Gallery" (FF_Gallery, gShuttersFF) { channel="nikobus:rollershutter-module:mypclink:r1:output-5" } +``` diff --git a/bundles/org.openhab.binding.nikobus/pom.xml b/bundles/org.openhab.binding.nikobus/pom.xml new file mode 100644 index 0000000000000..25654d57dd19f --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/pom.xml @@ -0,0 +1,15 @@ +<?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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.nikobus</artifactId> + + <name>openHAB Add-ons :: Bundles :: Nikobus Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.nikobus/src/main/feature/feature.xml b/bundles/org.openhab.binding.nikobus/src/main/feature/feature.xml new file mode 100644 index 0000000000000..33cc08cfaf512 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/feature/feature.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.nikobus-${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-nikobus" description="Nikobus Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <feature>openhab-transport-serial</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.nikobus/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusBindingConstants.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusBindingConstants.java new file mode 100644 index 0000000000000..bb52708ed396a --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusBindingConstants.java @@ -0,0 +1,48 @@ +/** + * 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.nikobus.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link NikobusBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusBindingConstants { + + private static final String BINDING_ID = "nikobus"; + + // List of all Thing Type UIDs + public static final ThingTypeUID BRIDGE_TYPE_PCLINK = new ThingTypeUID(BINDING_ID, "pc-link"); + + public static final ThingTypeUID THING_TYPE_PUSH_BUTTON = new ThingTypeUID(BINDING_ID, "push-button"); + public static final ThingTypeUID THING_TYPE_SWITCH_MODULE = new ThingTypeUID(BINDING_ID, "switch-module"); + public static final ThingTypeUID THING_TYPE_DIMMER_MODULE = new ThingTypeUID(BINDING_ID, "dimmer-module"); + public static final ThingTypeUID THING_TYPE_ROLLERSHUTTER_MODULE = new ThingTypeUID(BINDING_ID, + "rollershutter-module"); + + // List of all Channel ids + public static final String CHANNEL_BUTTON = "button"; + public static final String CHANNEL_OUTPUT_PREFIX = "output-"; + + // Configuration parameters + public static final String CONFIG_REFRESH_INTERVAL = "refreshInterval"; + public static final String CONFIG_IMPACTED_MODULES = "impactedModules"; + public static final String CONFIG_ADDRESS = "address"; + public static final String CONFIG_PORT_NAME = "port"; + +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusHandlerFactory.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusHandlerFactory.java new file mode 100644 index 0000000000000..8e2a92340ded4 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/NikobusHandlerFactory.java @@ -0,0 +1,95 @@ +/** + * 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.nikobus.internal; + +import static org.openhab.binding.nikobus.internal.NikobusBindingConstants.*; + +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.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.transport.serial.SerialPortManager; +import org.openhab.binding.nikobus.internal.handler.NikobusDimmerModuleHandler; +import org.openhab.binding.nikobus.internal.handler.NikobusPcLinkHandler; +import org.openhab.binding.nikobus.internal.handler.NikobusPushButtonHandler; +import org.openhab.binding.nikobus.internal.handler.NikobusRollershutterModuleHandler; +import org.openhab.binding.nikobus.internal.handler.NikobusSwitchModuleHandler; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link NikobusHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.nikobus", service = ThingHandlerFactory.class) +public class NikobusHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections + .unmodifiableSet(Stream.of(BRIDGE_TYPE_PCLINK, THING_TYPE_PUSH_BUTTON, THING_TYPE_SWITCH_MODULE, + THING_TYPE_DIMMER_MODULE, THING_TYPE_ROLLERSHUTTER_MODULE).collect(Collectors.toSet())); + + private @NonNullByDefault({}) SerialPortManager serialPortManager; + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (BRIDGE_TYPE_PCLINK.equals(thingTypeUID)) { + return new NikobusPcLinkHandler((Bridge) thing, serialPortManager); + } + + if (THING_TYPE_PUSH_BUTTON.equals(thingTypeUID)) { + return new NikobusPushButtonHandler(thing); + } + + if (THING_TYPE_SWITCH_MODULE.equals(thingTypeUID)) { + return new NikobusSwitchModuleHandler(thing); + } + + if (THING_TYPE_DIMMER_MODULE.equals(thingTypeUID)) { + return new NikobusDimmerModuleHandler(thing); + } + + if (THING_TYPE_ROLLERSHUTTER_MODULE.equals(thingTypeUID)) { + return new NikobusRollershutterModuleHandler(thing); + } + + return null; + } + + @Reference + protected void setSerialPortManager(final SerialPortManager serialPortManager) { + this.serialPortManager = serialPortManager; + } + + protected void unsetSerialPortManager(final SerialPortManager serialPortManager) { + this.serialPortManager = null; + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusBaseThingHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusBaseThingHandler.java new file mode 100644 index 0000000000000..442a7cae29116 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusBaseThingHandler.java @@ -0,0 +1,63 @@ +/** + * 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.nikobus.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.openhab.binding.nikobus.internal.NikobusBindingConstants; + +/** + * The {@link NikobusBaseThingHandler} class defines utility logic to be consumed by Nikobus thing(s). + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +abstract class NikobusBaseThingHandler extends BaseThingHandler { + private @Nullable String address; + + protected NikobusBaseThingHandler(Thing thing) { + super(thing); + } + + @Override + public void initialize() { + address = (String) getConfig().get(NikobusBindingConstants.CONFIG_ADDRESS); + if (address == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Address must be set!"); + return; + } + + updateStatus(ThingStatus.UNKNOWN); + } + + protected @Nullable NikobusPcLinkHandler getPcLink() { + Bridge bridge = getBridge(); + if (bridge != null) { + return (NikobusPcLinkHandler) bridge.getHandler(); + } + return null; + } + + protected String getAddress() { + String address = this.address; + if (address == null) { + throw new IllegalStateException(); + } + return address; + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusDimmerModuleHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusDimmerModuleHandler.java new file mode 100644 index 0000000000000..9491ffadae8f7 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusDimmerModuleHandler.java @@ -0,0 +1,69 @@ +/** + * 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.nikobus.internal.handler; + +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.nikobus.internal.protocol.SwitchModuleGroup; +import org.openhab.binding.nikobus.internal.utils.Utils; + +/** + * The {@link NikobusDimmerModuleHandler} is responsible for communication between Nikobus dim-controller and binding. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusDimmerModuleHandler extends NikobusSwitchModuleHandler { + private @Nullable Future<?> requestUpdateFuture; + + public NikobusDimmerModuleHandler(Thing thing) { + super(thing); + } + + @Override + public void dispose() { + Utils.cancel(requestUpdateFuture); + requestUpdateFuture = null; + + super.dispose(); + } + + @Override + public void requestStatus(SwitchModuleGroup group) { + Utils.cancel(requestUpdateFuture); + super.requestStatus(group); + requestUpdateFuture = scheduler.schedule(() -> super.requestStatus(group), 1, TimeUnit.SECONDS); + } + + @Override + protected int valueFromCommand(Command command) { + if (command instanceof PercentType) { + return Math.round(((PercentType) command).floatValue() / 100f * 255f); + } + + return super.valueFromCommand(command); + } + + @Override + protected State stateFromValue(int value) { + int result = Math.round(value * 100f / 255f); + return new PercentType(result); + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusModuleHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusModuleHandler.java new file mode 100644 index 0000000000000..df77c76b21cb0 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusModuleHandler.java @@ -0,0 +1,242 @@ +/** + * 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.nikobus.internal.handler; + +import static org.openhab.binding.nikobus.internal.NikobusBindingConstants.CHANNEL_OUTPUT_PREFIX; + +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.nikobus.internal.protocol.NikobusCommand; +import org.openhab.binding.nikobus.internal.protocol.SwitchModuleCommandFactory; +import org.openhab.binding.nikobus.internal.protocol.SwitchModuleGroup; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NikobusSwitchModuleHandler} is responsible for communication between Nikobus modules and binding. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +abstract class NikobusModuleHandler extends NikobusBaseThingHandler { + private final EnumSet<SwitchModuleGroup> pendingRefresh = EnumSet.noneOf(SwitchModuleGroup.class); + private final Logger logger = LoggerFactory.getLogger(NikobusModuleHandler.class); + private final Map<String, Integer> cachedStates = new HashMap<>(); + private final List<ChannelUID> linkedChannels = new ArrayList<>(); + + protected NikobusModuleHandler(Thing thing) { + super(thing); + } + + @Override + public void dispose() { + super.dispose(); + + synchronized (cachedStates) { + cachedStates.clear(); + } + + synchronized (pendingRefresh) { + pendingRefresh.clear(); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + if (command instanceof RefreshType) { + refreshChannel(channelUID); + } else { + processWrite(channelUID, command); + } + } + + private void refreshChannel(ChannelUID channelUID) { + logger.debug("Refreshing channel '{}'", channelUID.getId()); + + if (!isLinked(channelUID)) { + logger.debug("Refreshing channel '{}' skipped since it is not linked", channelUID.getId()); + return; + } + + updateGroup(SwitchModuleGroup.mapFromChannel(channelUID)); + } + + @Override + public void channelLinked(ChannelUID channelUID) { + synchronized (linkedChannels) { + linkedChannels.add(channelUID); + } + super.channelLinked(channelUID); + } + + @Override + public void channelUnlinked(ChannelUID channelUID) { + synchronized (linkedChannels) { + linkedChannels.remove(channelUID); + } + super.channelUnlinked(channelUID); + } + + public void refreshModule() { + Set<SwitchModuleGroup> groups = new HashSet<>(); + synchronized (linkedChannels) { + for (ChannelUID channelUID : linkedChannels) { + groups.add(SwitchModuleGroup.mapFromChannel(channelUID)); + } + } + + if (groups.isEmpty()) { + logger.debug("Nothing to refresh for '{}'", thing.getUID()); + return; + } + + logger.debug("Refreshing {} - {}", thing.getUID(), groups); + + for (SwitchModuleGroup group : groups) { + updateGroup(group); + } + } + + public void requestStatus(SwitchModuleGroup group) { + updateGroup(group); + } + + private void updateGroup(SwitchModuleGroup group) { + synchronized (pendingRefresh) { + if (pendingRefresh.contains(group)) { + logger.debug("Refresh already scheduled for group {} of module '{}'", group, getAddress()); + return; + } + + pendingRefresh.add(group); + } + + logger.debug("Refreshing group {} of switch module '{}'", group, getAddress()); + + NikobusPcLinkHandler pcLink = getPcLink(); + if (pcLink != null) { + NikobusCommand command = SwitchModuleCommandFactory.createReadCommand(getAddress(), group, + result -> processStatusUpdate(result, group)); + pcLink.sendCommand(command); + } + } + + private void processStatusUpdate(NikobusCommand.Result result, SwitchModuleGroup group) { + try { + String responsePayload = result.get(); + + logger.debug("processStatusUpdate '{}' for group {} in module '{}'", responsePayload, group, getAddress()); + + if (thing.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + + // Update channel's statuses based on response. + for (int i = 0; i < group.getCount(); i++) { + String channelId = CHANNEL_OUTPUT_PREFIX + (i + group.getOffset()); + String responseDigits = responsePayload.substring(9 + (i * 2), 11 + (i * 2)); + + int value = Integer.parseInt(responseDigits, 16); + + updateStateAndCacheValue(channelId, value); + } + } catch (Exception e) { + logger.warn("Processing response for '{}'-{} failed with {}", getAddress(), group, e.getMessage(), e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } finally { + synchronized (pendingRefresh) { + pendingRefresh.remove(group); + } + } + } + + private void updateStateAndCacheValue(String channelId, int value) { + if (value < 0x00 || value > 0xff) { + throw new IllegalArgumentException("Invalid range. 0x00 - 0xff expected but got value " + value); + } + + logger.debug("setting channel '{}' to {}", channelId, value); + + synchronized (cachedStates) { + cachedStates.put(channelId, value); + } + + updateState(channelId, stateFromValue(value)); + } + + @SuppressWarnings({ "unused", "null" }) + private void processWrite(ChannelUID channelUID, Command command) { + StringBuilder commandPayload = new StringBuilder(); + SwitchModuleGroup group = SwitchModuleGroup.mapFromChannel(channelUID); + + for (int i = group.getOffset(); i < group.getOffset() + group.getCount(); i++) { + String channelId = CHANNEL_OUTPUT_PREFIX + i; + Integer digits; + + if (channelId.equals(channelUID.getId())) { + digits = valueFromCommand(command); + updateStateAndCacheValue(channelId, digits.intValue()); + } else { + synchronized (cachedStates) { + digits = cachedStates.get(channelId); + } + } + + if (digits == null) { + commandPayload.append("00"); + logger.warn("no cached value found for '{}' in module '{}'", channelId, getAddress()); + } else { + commandPayload.append(String.format("%02X", digits.intValue())); + } + } + + NikobusPcLinkHandler pcLink = getPcLink(); + if (pcLink != null) { + pcLink.sendCommand(SwitchModuleCommandFactory.createWriteCommand(getAddress(), group, + commandPayload.toString(), this::processWriteCommandResponse)); + } + } + + private void processWriteCommandResponse(NikobusCommand.Result result) { + try { + String responsePayload = result.get(); + + logger.debug("processWriteCommandResponse '{}'", responsePayload); + + if (thing.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + } catch (Exception e) { + logger.warn("Processing write confirmation failed with {}", e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + + protected abstract int valueFromCommand(Command command); + + protected abstract State stateFromValue(int value); +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPcLinkHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPcLinkHandler.java new file mode 100644 index 0000000000000..13e08cf762cea --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPcLinkHandler.java @@ -0,0 +1,337 @@ +/** + * 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.nikobus.internal.handler; + +import static org.openhab.binding.nikobus.internal.NikobusBindingConstants.CONFIG_REFRESH_INTERVAL; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.io.transport.serial.SerialPortManager; +import org.openhab.binding.nikobus.internal.NikobusBindingConstants; +import org.openhab.binding.nikobus.internal.protocol.NikobusCommand; +import org.openhab.binding.nikobus.internal.protocol.NikobusConnection; +import org.openhab.binding.nikobus.internal.utils.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NikobusPcLinkHandler} is responsible for handling commands, which are + * sent or received from the PC-Link Nikobus component. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusPcLinkHandler extends BaseBridgeHandler { + private final Logger logger = LoggerFactory.getLogger(NikobusPcLinkHandler.class); + private final Map<String, Runnable> commandListeners = Collections.synchronizedMap(new HashMap<>()); + private final LinkedList<NikobusCommand> pendingCommands = new LinkedList<>(); + private final StringBuilder stringBuilder = new StringBuilder(); + private final SerialPortManager serialPortManager; + private @Nullable NikobusConnection connection; + private @Nullable NikobusCommand currentCommand; + private @Nullable ScheduledFuture<?> scheduledRefreshFuture; + private @Nullable ScheduledFuture<?> scheduledSendCommandWatchdogFuture; + private @Nullable String ack; + private int refreshThingIndex = 0; + + public NikobusPcLinkHandler(Bridge bridge, SerialPortManager serialPortManager) { + super(bridge); + this.serialPortManager = serialPortManager; + } + + @Override + public void initialize() { + ack = null; + stringBuilder.setLength(0); + + updateStatus(ThingStatus.UNKNOWN); + + String portName = (String) getConfig().get(NikobusBindingConstants.CONFIG_PORT_NAME); + if (portName == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR, "Port must be set!"); + return; + } + + connection = new NikobusConnection(serialPortManager, portName, this::processReceivedValue); + + int refreshInterval = ((Number) getConfig().get(CONFIG_REFRESH_INTERVAL)).intValue(); + scheduledRefreshFuture = scheduler.scheduleWithFixedDelay(this::refresh, refreshInterval, refreshInterval, + TimeUnit.SECONDS); + } + + @Override + public void dispose() { + super.dispose(); + + Utils.cancel(scheduledSendCommandWatchdogFuture); + scheduledSendCommandWatchdogFuture = null; + + Utils.cancel(scheduledRefreshFuture); + scheduledRefreshFuture = null; + + NikobusConnection connection = this.connection; + this.connection = null; + + if (connection != null) { + connection.close(); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + // Noop. + } + + @SuppressWarnings("null") + private void processReceivedValue(byte value) { + logger.trace("Received {}", value); + + if (value == 13) { + String command = stringBuilder.toString(); + stringBuilder.setLength(0); + + logger.debug("Received command '{}', ack = '{}'", command, ack); + + try { + if (command.startsWith("$")) { + String ack = this.ack; + this.ack = null; + + processResponse(command, ack); + } else { + Runnable listener = commandListeners.get(command); + if (listener != null) { + listener.run(); + } + } + } catch (RuntimeException e) { + logger.debug("Processing command '{}' failed due {}", command, e.getMessage(), e); + } + } else { + stringBuilder.append((char) value); + + // Take ACK part, i.e. "$0512" + if (stringBuilder.length() == 5) { + String payload = stringBuilder.toString(); + if (payload.startsWith("$05")) { + ack = payload; + logger.debug("Received ack '{}'", ack); + stringBuilder.setLength(0); + } + } else if (stringBuilder.length() > 128) { + // Fuse, if for some reason we don't receive \r don't fill buffer. + stringBuilder.setLength(0); + logger.warn("Resetting read buffer, should not happen, am I connected to Nikobus?"); + } + } + } + + @SuppressWarnings("null") + public void addListener(String command, Runnable listener) { + if (commandListeners.put(command, listener) != null) { + logger.warn("Multiple registrations for '{}'", command); + } + } + + public void removeListener(String command) { + commandListeners.remove(command); + } + + private void processResponse(String commandPayload, @Nullable String ack) { + NikobusCommand command; + synchronized (pendingCommands) { + command = currentCommand; + } + + if (command == null) { + logger.debug("Processing response but no command pending"); + return; + } + + NikobusCommand.ResponseHandler responseHandler = command.getResponseHandler(); + if (responseHandler == null) { + logger.debug("No response expected for current command"); + return; + } + + if (ack == null) { + logger.debug("No ack received"); + return; + } + + String requestCommandId = command.getPayload().substring(3, 5); + String ackCommandId = ack.substring(3, 5); + if (!ackCommandId.equals(requestCommandId)) { + logger.debug("Unexpected command's ack '{}' != '{}'", requestCommandId, ackCommandId); + return; + } + + // Check if response has expected length. + if (commandPayload.length() != responseHandler.getResponseLength()) { + logger.debug("Unexpected response length"); + return; + } + + if (!commandPayload.startsWith(responseHandler.getResponseCode())) { + logger.debug("Unexpected response command code"); + return; + } + + String requestCommandAddress = command.getPayload().substring(5, 9); + String ackCommandAddress = commandPayload.substring(responseHandler.getAddressStart(), + responseHandler.getAddressStart() + 4); + if (!requestCommandAddress.equals(ackCommandAddress)) { + logger.debug("Unexpected response address"); + return; + } + + if (responseHandler.complete(commandPayload)) { + resetProcessingAndProcessNext(); + } + } + + public void sendCommand(NikobusCommand command) { + synchronized (pendingCommands) { + pendingCommands.addLast(command); + } + + scheduler.submit(this::processCommand); + } + + @SuppressWarnings({ "unused", "null" }) + private void processCommand() { + NikobusCommand command; + synchronized (pendingCommands) { + if (currentCommand != null) { + return; + } + + command = pendingCommands.pollFirst(); + if (command == null) { + return; + } + + currentCommand = command; + } + sendCommand(command, 3); + } + + private void sendCommand(NikobusCommand command, int retry) { + logger.debug("Sending retry = {}, command '{}'", retry, command.getPayload()); + + NikobusConnection connection = this.connection; + if (connection == null) { + return; + } + + try { + connectIfNeeded(connection); + + OutputStream outputStream = connection.getOutputStream(); + if (outputStream == null) { + return; + } + outputStream.write(command.getPayload().getBytes()); + outputStream.flush(); + } catch (IOException e) { + logger.debug("Sending command failed due {}", e.getMessage(), e); + connection.close(); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } finally { + NikobusCommand.ResponseHandler responseHandler = command.getResponseHandler(); + if (responseHandler == null) { + resetProcessingAndProcessNext(); + } else if (retry > 0) { + scheduleSendCommandTimeout(() -> { + if (!responseHandler.isCompleted()) { + sendCommand(command, retry - 1); + } + }); + } else { + scheduleSendCommandTimeout(() -> processTimeout(responseHandler)); + } + } + } + + private void scheduleSendCommandTimeout(Runnable command) { + scheduledSendCommandWatchdogFuture = scheduler.schedule(command, 2, TimeUnit.SECONDS); + } + + private void processTimeout(NikobusCommand.ResponseHandler responseHandler) { + if (responseHandler.completeExceptionally(new TimeoutException("Waiting for response timed-out."))) { + resetProcessingAndProcessNext(); + } + } + + private void resetProcessingAndProcessNext() { + Utils.cancel(scheduledSendCommandWatchdogFuture); + synchronized (pendingCommands) { + currentCommand = null; + } + scheduler.submit(this::processCommand); + } + + private void refresh() { + List<Thing> things = getThing().getThings().stream() + .filter(thing -> thing.getHandler() instanceof NikobusModuleHandler).collect(Collectors.toList()); + + if (things.isEmpty()) { + logger.debug("Nothing to refresh"); + return; + } + + refreshThingIndex = (refreshThingIndex + 1) % things.size(); + + ThingHandler thingHandler = things.get(refreshThingIndex).getHandler(); + if (thingHandler == null) { + return; + } + + NikobusModuleHandler handler = (NikobusModuleHandler) thingHandler; + handler.refreshModule(); + } + + private synchronized void connectIfNeeded(NikobusConnection connection) throws IOException { + if (!connection.isConnected()) { + connection.connect(); + + // Send connection sequence, mimicking the Nikobus software. If this is not send, PC-Link + // sometimes does not forward button presses via serial interface. + Stream.of(new String[] { "++++", "ATH0", "ATZ", "$10110000B8CF9D", "#L0", "#E0", "#L0", "#E1" }) + .map(NikobusCommand::new).forEach(this::sendCommand); + + updateStatus(ThingStatus.ONLINE); + } + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPushButtonHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPushButtonHandler.java new file mode 100644 index 0000000000000..32166b9351337 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusPushButtonHandler.java @@ -0,0 +1,222 @@ +/** + * 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.nikobus.internal.handler; + +import static org.openhab.binding.nikobus.internal.NikobusBindingConstants.*; +import static org.openhab.binding.nikobus.internal.protocol.SwitchModuleGroup.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.common.AbstractUID; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.nikobus.internal.protocol.NikobusCommand; +import org.openhab.binding.nikobus.internal.protocol.SwitchModuleGroup; +import org.openhab.binding.nikobus.internal.utils.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NikobusPushButtonHandler} is responsible for handling Nikobus push buttons. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusPushButtonHandler extends NikobusBaseThingHandler { + private static class ImpactedModule { + private final ThingUID thingUID; + private final SwitchModuleGroup group; + + ImpactedModule(ThingUID thingUID, SwitchModuleGroup group) { + this.thingUID = thingUID; + this.group = group; + } + + public ThingUID getThingUID() { + return thingUID; + } + + public SwitchModuleGroup getGroup() { + return group; + } + + @Override + public String toString() { + return "'" + thingUID + "'-" + group; + } + } + + private static class ImpactedModuleUID extends AbstractUID { + ImpactedModuleUID(String uid) { + super(uid); + } + + String getThingTypeId() { + return getSegment(0); + } + + String getThingId() { + return getSegment(1); + } + + SwitchModuleGroup getGroup() { + if (getSegment(2).equals("1")) { + return FIRST; + } + if (getSegment(2).equals("2")) { + return SECOND; + } + throw new IllegalArgumentException("Unexpected group found " + getSegment(2)); + } + + @Override + protected int getMinimalNumberOfSegments() { + return 3; + } + + } + + private static final String END_OF_TRANSMISSION = "\r#E1"; + private final Logger logger = LoggerFactory.getLogger(NikobusPushButtonHandler.class); + private final List<ImpactedModule> impactedModules = Collections.synchronizedList(new ArrayList<>()); + private @Nullable Future<?> requestUpdateFuture; + + public NikobusPushButtonHandler(Thing thing) { + super(thing); + } + + @Override + public void initialize() { + super.initialize(); + + if (thing.getStatus() == ThingStatus.OFFLINE) { + return; + } + + impactedModules.clear(); + + try { + ThingUID bridgeUID = thing.getBridgeUID(); + if (bridgeUID == null) { + throw new IllegalArgumentException("Bridge does not exist!"); + } + + String[] impactedModulesString = getConfig().get(CONFIG_IMPACTED_MODULES).toString().split(","); + for (String impactedModuleString : impactedModulesString) { + ImpactedModuleUID impactedModuleUID = new ImpactedModuleUID(impactedModuleString.trim()); + ThingTypeUID thingTypeUID = new ThingTypeUID(bridgeUID.getBindingId(), + impactedModuleUID.getThingTypeId()); + ThingUID thingUID = new ThingUID(thingTypeUID, bridgeUID, impactedModuleUID.getThingId()); + impactedModules.add(new ImpactedModule(thingUID, impactedModuleUID.getGroup())); + } + } catch (RuntimeException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); + return; + } + + logger.debug("Impacted modules for {} = {}", thing.getUID(), impactedModules); + + NikobusPcLinkHandler pcLink = getPcLink(); + if (pcLink != null) { + pcLink.addListener(getAddress(), this::commandReceived); + } + } + + @Override + public void dispose() { + super.dispose(); + + Utils.cancel(requestUpdateFuture); + requestUpdateFuture = null; + + NikobusPcLinkHandler pcLink = getPcLink(); + if (pcLink != null) { + pcLink.removeListener(getAddress()); + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("handleCommand '{}' '{}'", channelUID, command); + + if (!CHANNEL_BUTTON.equals(channelUID.getId())) { + return; + } + + // Whenever the button receives an ON command, + // we send a simulated button press to the Nikobus. + if (command == OnOffType.ON) { + NikobusPcLinkHandler pcLink = getPcLink(); + if (pcLink != null) { + pcLink.sendCommand(new NikobusCommand(getAddress() + END_OF_TRANSMISSION)); + } + } + } + + private void commandReceived() { + if (thing.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + + updateState(CHANNEL_BUTTON, OnOffType.ON); + + Utils.cancel(requestUpdateFuture); + requestUpdateFuture = scheduler.schedule(this::update, 400, TimeUnit.MILLISECONDS); + } + + private void update() { + for (ImpactedModule module : impactedModules) { + NikobusModuleHandler switchModule = getModuleWithId(module.getThingUID()); + if (switchModule != null) { + switchModule.requestStatus(module.getGroup()); + } + } + } + + private @Nullable NikobusModuleHandler getModuleWithId(ThingUID thingUID) { + Bridge bridge = getBridge(); + if (bridge == null) { + return null; + } + + Thing thing = bridge.getThing(thingUID); + if (thing == null) { + return null; + } + + ThingHandler thingHandler = thing.getHandler(); + if (thingHandler instanceof NikobusModuleHandler) { + return (NikobusModuleHandler) thingHandler; + } + return null; + } + + @Override + protected String getAddress() { + return "#N" + super.getAddress(); + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusRollershutterModuleHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusRollershutterModuleHandler.java new file mode 100644 index 0000000000000..b2e3e6f49439a --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusRollershutterModuleHandler.java @@ -0,0 +1,63 @@ +/** + * 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.nikobus.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StopMoveType; +import org.eclipse.smarthome.core.library.types.UpDownType; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; + +/** + * The {@link NikobusRollershutterModuleHandler} is responsible for communication between Nikobus + * rollershutter-controller and binding. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusRollershutterModuleHandler extends NikobusModuleHandler { + public NikobusRollershutterModuleHandler(Thing thing) { + super(thing); + } + + @Override + protected int valueFromCommand(Command command) { + if (command == UpDownType.DOWN || command == StopMoveType.MOVE) { + return 0x02; + } + if (command == UpDownType.UP) { + return 0x01; + } + if (command == StopMoveType.STOP) { + return 0x00; + } + + throw new IllegalArgumentException("Command '" + command + "' not supported"); + } + + @Override + protected State stateFromValue(int value) { + if (value == 0x00) { + return OnOffType.OFF; + } + if (value == 0x01) { + return UpDownType.UP; + } + if (value == 0x02) { + return UpDownType.DOWN; + } + throw new IllegalArgumentException("Unexpected value " + value + " received"); + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusSwitchModuleHandler.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusSwitchModuleHandler.java new file mode 100644 index 0000000000000..dc3baafbb4658 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/handler/NikobusSwitchModuleHandler.java @@ -0,0 +1,49 @@ +/** + * 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.nikobus.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; + +/** + * The {@link NikobusSwitchModuleHandler} is responsible for communication between Nikobus switch module and binding. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusSwitchModuleHandler extends NikobusModuleHandler { + public NikobusSwitchModuleHandler(Thing thing) { + super(thing); + } + + @Override + protected int valueFromCommand(Command command) { + if (command == OnOffType.ON) { + return 0xff; + } + + if (command == OnOffType.OFF) { + return 0x00; + } + + throw new IllegalArgumentException("Command '" + command + "' not supported"); + } + + @Override + protected State stateFromValue(int value) { + return value != 0 ? OnOffType.ON : OnOffType.OFF; + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusCommand.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusCommand.java new file mode 100644 index 0000000000000..5a64295145aa0 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusCommand.java @@ -0,0 +1,125 @@ +/** + * 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.nikobus.internal.protocol; + +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NikobusCommand} class holds a command that can be send to Nikobus installation. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusCommand { + public static class Result { + private final Callable<String> callable; + + private Result(String result) { + callable = () -> result; + } + + private Result(Exception exception) { + callable = () -> { + throw exception; + }; + } + + public String get() throws Exception { + return callable.call(); + } + } + + public static class ResponseHandler { + private final Logger logger = LoggerFactory.getLogger(ResponseHandler.class); + private final Consumer<Result> resultConsumer; + private final int responseLength; + private final int addressStart; + private final String responseCode; + private final AtomicBoolean isCompleted = new AtomicBoolean(); + + private ResponseHandler(int responseLength, int addressStart, String responseCode, + Consumer<Result> resultConsumer) { + this.responseLength = responseLength; + this.addressStart = addressStart; + this.responseCode = responseCode; + this.resultConsumer = resultConsumer; + } + + public boolean isCompleted() { + return isCompleted.get(); + } + + public boolean complete(String result) { + return complete(new Result(result)); + } + + public boolean completeExceptionally(Exception exception) { + return complete(new Result(exception)); + } + + private boolean complete(Result result) { + if (isCompleted.getAndSet(true)) { + return false; + } + + try { + resultConsumer.accept(result); + } catch (RuntimeException e) { + logger.warn("Processing result {} failed with {}", result, e.getMessage(), e); + } + + return true; + } + + public int getResponseLength() { + return responseLength; + } + + public int getAddressStart() { + return addressStart; + } + + public String getResponseCode() { + return responseCode; + } + } + + private final String payload; + private final @Nullable ResponseHandler responseHandler; + + public NikobusCommand(String payload) { + this.payload = payload + '\r'; + this.responseHandler = null; + } + + public NikobusCommand(String payload, int responseLength, int addressStart, String responseCode, + Consumer<Result> resultConsumer) { + this.payload = payload + '\r'; + this.responseHandler = new ResponseHandler(responseLength, addressStart, responseCode, resultConsumer); + } + + public String getPayload() { + return payload; + } + + public @Nullable ResponseHandler getResponseHandler() { + return responseHandler; + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusConnection.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusConnection.java new file mode 100644 index 0000000000000..a0185d2099461 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/NikobusConnection.java @@ -0,0 +1,152 @@ +/** + * 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.nikobus.internal.protocol; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.TooManyListenersException; +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.io.transport.serial.PortInUseException; +import org.eclipse.smarthome.io.transport.serial.SerialPort; +import org.eclipse.smarthome.io.transport.serial.SerialPortEvent; +import org.eclipse.smarthome.io.transport.serial.SerialPortEventListener; +import org.eclipse.smarthome.io.transport.serial.SerialPortIdentifier; +import org.eclipse.smarthome.io.transport.serial.SerialPortManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link NikobusConnection } is responsible for creating connections to clients. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class NikobusConnection implements SerialPortEventListener { + private final Logger logger = LoggerFactory.getLogger(NikobusConnection.class); + private final SerialPortManager serialPortManager; + private final String portName; + private final Consumer<Byte> processData; + private @Nullable SerialPort serialPort; + + public NikobusConnection(SerialPortManager serialPortManager, String portName, Consumer<Byte> processData) { + this.serialPortManager = serialPortManager; + this.portName = portName; + this.processData = processData; + } + + /** + * Return true if this manager is connected. + * + * @return + */ + public boolean isConnected() { + return serialPort != null; + } + + /** + * Connect to the receiver. + * + **/ + public void connect() throws IOException { + if (isConnected()) { + return; + } + + SerialPortIdentifier portId = serialPortManager.getIdentifier(portName); + if (portId == null) { + throw new IOException(String.format("Port '%s' is not known!", portName)); + } + + logger.info("Connecting to {}", portName); + + try { + SerialPort serialPort = portId.open("org.openhab.binding.nikobus.pc-link", 2000); + serialPort.addEventListener(this); + serialPort.notifyOnDataAvailable(true); + this.serialPort = serialPort; + logger.info("Connected to {}", portName); + } catch (PortInUseException e) { + throw new IOException(String.format("Port '%s' is in use!", portName), e); + } catch (TooManyListenersException e) { + throw new IOException(String.format("Cannot attach listener to port '%s'!", portName), e); + } + } + + /** + * Closes the connection. + **/ + public void close() { + SerialPort serialPort = this.serialPort; + this.serialPort = null; + + if (serialPort != null) { + try { + serialPort.removeEventListener(); + OutputStream outputStream = serialPort.getOutputStream(); + if (outputStream != null) { + outputStream.close(); + } + InputStream inputStream = serialPort.getInputStream(); + if (inputStream != null) { + inputStream.close(); + } + } catch (IOException e) { + logger.debug("Error closing serial port.", e); + } finally { + serialPort.close(); + logger.debug("Closed serial port."); + } + } + } + + /** + * Returns an output stream for this connection. + */ + public @Nullable OutputStream getOutputStream() throws IOException { + SerialPort serialPort = this.serialPort; + if (serialPort == null) { + return null; + } + return serialPort.getOutputStream(); + } + + @Override + public void serialEvent(SerialPortEvent event) { + if (event.getEventType() != SerialPortEvent.DATA_AVAILABLE) { + return; + } + SerialPort serialPort = this.serialPort; + if (serialPort == null) { + return; + } + try { + InputStream inputStream = serialPort.getInputStream(); + if (inputStream == null) { + return; + } + byte[] readBuffer = new byte[64]; + while (inputStream.available() > 0) { + int length = inputStream.read(readBuffer); + for (int i = 0; i < length; ++i) { + processData.accept(readBuffer[i]); + } + } + } catch (IOException e) { + logger.debug("Error reading from serial port: {}", e.getMessage(), e); + } + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleCommandFactory.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleCommandFactory.java new file mode 100644 index 0000000000000..f9ca1eaa8ac01 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleCommandFactory.java @@ -0,0 +1,53 @@ +/** + * 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.nikobus.internal.protocol; + +import java.util.function.Consumer; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.nikobus.internal.protocol.NikobusCommand.Result; +import org.openhab.binding.nikobus.internal.utils.CRCUtil; + +/** + * The {@link NikobusCommand} class defines factory functions to create commands that can be send to Nikobus + * installation. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public class SwitchModuleCommandFactory { + public static NikobusCommand createReadCommand(String address, SwitchModuleGroup group, + Consumer<Result> resultConsumer) { + checkAddress(address); + + String commandPayload = CRCUtil.appendCRC2("$10" + CRCUtil.appendCRC(group.getStatusRequest() + address)); + return new NikobusCommand(commandPayload, 27, 3, "$1C", resultConsumer); + } + + public static NikobusCommand createWriteCommand(String address, SwitchModuleGroup group, String value, + Consumer<Result> resultConsumer) { + checkAddress(address); + if (value.length() != 12) { + throw new IllegalArgumentException(String.format("Value must have 12 chars but got '%s'", value)); + } + + String payload = group.getStatusUpdate() + address + value + "FF"; + return new NikobusCommand(CRCUtil.appendCRC2("$1E" + CRCUtil.appendCRC(payload)), 13, 5, "$0E", resultConsumer); + } + + private static void checkAddress(String address) { + if (address.length() != 4) { + throw new IllegalArgumentException(String.format("Address must have 4 chars but got '%s'", address)); + } + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleGroup.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleGroup.java new file mode 100644 index 0000000000000..9b4883bfe5ab5 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/protocol/SwitchModuleGroup.java @@ -0,0 +1,75 @@ +/** + * 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.nikobus.internal.protocol; + +import static org.openhab.binding.nikobus.internal.NikobusBindingConstants.CHANNEL_OUTPUT_PREFIX; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ChannelUID; + +/** + * The {@link SwitchModuleGroup} class defines Nikobus module group used for reading status or set its new value. + * Nikobus module can always operate only in groups and not per-channel. + * + * @author Boris Krivonog - Initial contribution + */ +@NonNullByDefault +public enum SwitchModuleGroup { + + FIRST("12", "15", 1), + SECOND("17", "16", 7); + + private final String statusRequest; + private final String statusUpdate; + private final int offset; + + private SwitchModuleGroup(String statusRequest, String statusUpdate, int offset) { + this.statusRequest = statusRequest; + this.statusUpdate = statusUpdate; + this.offset = offset; + } + + public String getStatusRequest() { + return statusRequest; + } + + public String getStatusUpdate() { + return statusUpdate; + } + + public int getOffset() { + return offset; + } + + public int getCount() { + return 6; + } + + public static SwitchModuleGroup mapFromChannel(ChannelUID channelUID) { + if (!channelUID.getIdWithoutGroup().startsWith(CHANNEL_OUTPUT_PREFIX)) { + throw new IllegalArgumentException("Unexpected channel " + channelUID.getId()); + } + + String channelNumber = channelUID.getIdWithoutGroup().substring(CHANNEL_OUTPUT_PREFIX.length()); + return mapFromChannel(Integer.parseInt(channelNumber)); + } + + public static SwitchModuleGroup mapFromChannel(int channelNumber) { + int max = SECOND.getOffset() + SECOND.getCount(); + if (channelNumber < FIRST.getOffset() || channelNumber > max) { + throw new IllegalArgumentException(String.format("Channel number should be between [%d, %d], but got %d", + FIRST.getOffset(), max, channelNumber)); + } + return channelNumber >= SECOND.getOffset() ? SECOND : FIRST; + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/CRCUtil.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/CRCUtil.java new file mode 100644 index 0000000000000..8ba5fe89f1880 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/CRCUtil.java @@ -0,0 +1,90 @@ +/** + * 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.nikobus.internal.utils; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.smarthome.core.util.HexUtils; + +/** + * The {@link CRCUtil} class defines utility functions to calculate CRC used by the Nikobus communication protocol. + * + * @author Davy Vanherbergen - Initial contribution + * @author Boris Krivonog - Removed dependency to javax.xml.bind.DatatypeConverter + */ +public class CRCUtil { + + private static final int CRC_INIT = 0xFFFF; + + private static final int POLYNOMIAL = 0x1021; + + /** + * Calculate the CRC16-CCITT checksum on the input string and return the + * input string with the checksum appended. + * + * @param input + * String representing hex numbers. + * @return input string + CRC. + */ + public static String appendCRC(String input) { + if (input == null) { + return null; + } + + int check = CRC_INIT; + + for (byte b : HexUtils.hexToBytes(input)) { + for (int i = 0; i < 8; i++) { + if (((b >> (7 - i) & 1) == 1) ^ ((check >> 15 & 1) == 1)) { + check = check << 1; + check = check ^ POLYNOMIAL; + } else { + check = check << 1; + } + } + } + + check = check & CRC_INIT; + String checksum = StringUtils.leftPad(Integer.toHexString(check), 4, "0"); + return (input + checksum).toUpperCase(); + } + + /** + * Calculate the second checksum on the input string and return the + * input string with the checksum appended. + * + * @param input + * String representing a nikobus command. + * @return input string + CRC. + */ + public static String appendCRC2(String input) { + int check = 0; + + for (byte b : input.getBytes()) { + + check = check ^ b; + + for (int i = 0; i < 8; i++) { + + if (((check & 0xff) >> 7) != 0) { + check = check << 1; + check = check ^ 0x99; + } else { + check = check << 1; + } + check = check & 0xff; + } + } + + return input + StringUtils.leftPad(Integer.toHexString(check), 2, "0").toUpperCase(); + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java new file mode 100644 index 0000000000000..6a5f710eb66aa --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/java/org/openhab/binding/nikobus/internal/utils/Utils.java @@ -0,0 +1,28 @@ +/** + * 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.nikobus.internal.utils; + +import java.util.concurrent.Future; + +/** + * The {@link Utils} class defines commonly used utility functions. + * + * @author Boris Krivonog - Initial contribution + */ +public class Utils { + public static void cancel(Future<?> future) { + if (future != null) { + future.cancel(true); + } + } +} diff --git a/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..b692af7f3865f --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="nikobus" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Nikobus Binding</name> + <description>This is the binding for Nikobus.</description> + <author>Boris Krivonog</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..10cccf2538347 --- /dev/null +++ b/bundles/org.openhab.binding.nikobus/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,227 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="nikobus" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <bridge-type id="pc-link"> + <label>PC-Link</label> + <description>PC-Link via serial connection</description> + + <config-description> + <parameter name="port" type="text" required="true"> + <label>Port</label> + <context>serial-port</context> + <description>The serial port used to connect to the Nikobus PC Link.</description> + </parameter> + <parameter name="refreshInterval" type="integer" max="65535" min="10" required="false"> + <default>60</default> + <label>Refresh Interval</label> + <description>Refresh interval in seconds.</description> + </parameter> + </config-description> + </bridge-type> + + <thing-type id="push-button"> + <supported-bridge-type-refs> + <bridge-type-ref id="pc-link" /> + </supported-bridge-type-refs> + + <label>Push Button</label> + <description>A single push button</description> + + <channels> + <channel id="button" typeId="button" /> + </channels> + + <config-description> + <parameter name="address" type="text"> + <label>Address</label> + <description>The Nikobus address of the module</description> + </parameter> + <parameter name="impactedModules" type="text"> + <label>Impacted Modules</label> + <description>Comma separated list of impacted modules, i.e. 4C6C-1,4C6C-2</description> + </parameter> + </config-description> + </thing-type> + + <channel-type id="button"> + <item-type>Switch</item-type> + <label>Button Event</label> + <description>Fires when the button is pressed</description> + + <config-description> + <parameter name="address" type="text"> + <label>Address</label> + <description>The Nikobus address of the module</description> + </parameter> + </config-description> + </channel-type> + + <thing-type id="switch-module"> + <supported-bridge-type-refs> + <bridge-type-ref id="pc-link" /> + </supported-bridge-type-refs> + + <label>Switch Module</label> + <description>Nikobus Switch module</description> + + <channels> + <channel id="output-1" typeId="switch-output"> + <label>Output 1</label> + </channel> + <channel id="output-2" typeId="switch-output"> + <label>Output 2</label> + </channel> + <channel id="output-3" typeId="switch-output"> + <label>Output 3</label> + </channel> + <channel id="output-4" typeId="switch-output"> + <label>Output 4</label> + </channel> + <channel id="output-5" typeId="switch-output"> + <label>Output 5</label> + </channel> + <channel id="output-6" typeId="switch-output"> + <label>Output 6</label> + </channel> + <channel id="output-7" typeId="switch-output"> + <label>Output 7</label> + </channel> + <channel id="output-8" typeId="switch-output"> + <label>Output 8</label> + </channel> + <channel id="output-9" typeId="switch-output"> + <label>Output 9</label> + </channel> + <channel id="output-10" typeId="switch-output"> + <label>Output 10</label> + </channel> + <channel id="output-11" typeId="switch-output"> + <label>Output 11</label> + </channel> + <channel id="output-12" typeId="switch-output"> + <label>Output 12</label> + </channel> + </channels> + + <config-description> + <parameter name="address" type="text"> + <label>Address</label> + <description>The Nikobus address of the module</description> + </parameter> + </config-description> + </thing-type> + + <thing-type id="dimmer-module"> + <supported-bridge-type-refs> + <bridge-type-ref id="pc-link" /> + </supported-bridge-type-refs> + + <label>Dimmer Module</label> + <description>Nikobus Dimmer module</description> + + <channels> + <channel id="output-1" typeId="dimmer-output"> + <label>Output 1</label> + </channel> + <channel id="output-2" typeId="dimmer-output"> + <label>Output 2</label> + </channel> + <channel id="output-3" typeId="dimmer-output"> + <label>Output 3</label> + </channel> + <channel id="output-4" typeId="dimmer-output"> + <label>Output 4</label> + </channel> + <channel id="output-5" typeId="dimmer-output"> + <label>Output 5</label> + </channel> + <channel id="output-6" typeId="dimmer-output"> + <label>Output 6</label> + </channel> + <channel id="output-7" typeId="dimmer-output"> + <label>Output 7</label> + </channel> + <channel id="output-8" typeId="dimmer-output"> + <label>Output 8</label> + </channel> + <channel id="output-9" typeId="dimmer-output"> + <label>Output 9</label> + </channel> + <channel id="output-10" typeId="dimmer-output"> + <label>Output 10</label> + </channel> + <channel id="output-11" typeId="dimmer-output"> + <label>Output 11</label> + </channel> + <channel id="output-12" typeId="dimmer-output"> + <label>Output 12</label> + </channel> + </channels> + + <config-description> + <parameter name="address" type="text"> + <label>Address</label> + <description>The Nikobus address of the module</description> + </parameter> + </config-description> + </thing-type> + + <thing-type id="rollershutter-module"> + <supported-bridge-type-refs> + <bridge-type-ref id="pc-link" /> + </supported-bridge-type-refs> + + <label>Rollershutter Module</label> + <description>Nikobus Rollershutter module</description> + + <channels> + <channel id="output-1" typeId="rollershutter-output"> + <label>Output 1</label> + </channel> + <channel id="output-2" typeId="rollershutter-output"> + <label>Output 2</label> + </channel> + <channel id="output-3" typeId="rollershutter-output"> + <label>Output 3</label> + </channel> + <channel id="output-4" typeId="rollershutter-output"> + <label>Output 4</label> + </channel> + <channel id="output-5" typeId="rollershutter-output"> + <label>Output 5</label> + </channel> + <channel id="output-6" typeId="rollershutter-output"> + <label>Output 6</label> + </channel> + </channels> + + <config-description> + <parameter name="address" type="text"> + <label>Address</label> + <description>The Nikobus address of the module</description> + </parameter> + </config-description> + </thing-type> + + <channel-type id="switch-output"> + <item-type>Switch</item-type> + <label>Output</label> + <description>Switch Module's Output</description> + </channel-type> + + <channel-type id="dimmer-output"> + <item-type>Dimmer</item-type> + <label>Output</label> + <description>Dimmer Module's Output</description> + </channel-type> + + <channel-type id="rollershutter-output"> + <item-type>Rollershutter</item-type> + <label>Output</label> + <description>Rollershutter Module's Output</description> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.nikohomecontrol/NOTICE b/bundles/org.openhab.binding.nikohomecontrol/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/NOTICE +++ b/bundles/org.openhab.binding.nikohomecontrol/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nikohomecontrol/README.md b/bundles/org.openhab.binding.nikohomecontrol/README.md index 30c022212555a..3f7d1a0973057 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/README.md +++ b/bundles/org.openhab.binding.nikohomecontrol/README.md @@ -1,6 +1,6 @@ # Niko Home Control Binding -The Niko Home Control binding integrates with a [Niko Home Control](http://www.nikohomecontrol.be/) system through a Niko Home Control IP-interface or Niko Home Control Connected Controller. +The Niko Home Control binding integrates with a [Niko Home Control](https://www.niko.eu/) system through a Niko Home Control IP-interface or Niko Home Control Connected Controller. The binding supports both Niko Home Control I and Niko Home Control II. @@ -59,12 +59,12 @@ It is possible to trigger a manual scan for things on the Niko Home Control brid Note that Niko Home Control II will require the touch profile and password parameters to be set on the bridge before the scan for actions can succeed. The bridge will remain offline as long as these parameters are not set. -If the Niko Home Control system has locations configured, these will be copied to thing locations and grouped as such in PaperUI. -Locations can subsequently be changed through the thing location parameter in PaperUI. +If the Niko Home Control system has locations configured, these will be copied to thing locations and grouped as such in Paper UI. +Locations can subsequently be changed through the thing location parameter in Paper UI. ## Thing Configuration -Besides using PaperUI to manually configure things or adding automatically discovered things through PaperUI, you can add thing definitions in the things file. +Besides using Paper UI to manually configure things or adding automatically discovered things through Paper UI, you can add thing definitions in the things file. The Thing configuration for the **bridge** uses the following syntax: @@ -130,7 +130,7 @@ Discovery will identify All Off actions and map them to `pushButton` things. For Niko Home Control I, the `actionId` parameter is the unique IP Interface Object ID (`ipInterfaceObjectId`) as automatically assigned in the Niko Home Control Controller when programming the Niko Home Control system using the Niko Home Control I programming software. It is not directly visible in the Niko Home Control programming or user software, but will be detected and automatically set by openHAB discovery. For textual configuration, you can manually retrieve it from the content of the .nhcp configuration file created by the programming software. -Open the file with an unzip tool to read it's content. +Open the file with an unzip tool to read its content. For Niko Home Control II, the `actionId` parameter is a unique ID for the action in the controller. It can only be auto-discovered. If you want to define the action through textual configuration, the easiest way is to first do discovery on the bridge to get the correct `actionId` to use in the textual configuration. diff --git a/bundles/org.openhab.binding.nikohomecontrol/pom.xml b/bundles/org.openhab.binding.nikohomecontrol/pom.xml index d4fd82972dfbc..8d7acd4f9ceb0 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/pom.xml +++ b/bundles/org.openhab.binding.nikohomecontrol/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nikohomecontrol</artifactId> diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/feature/feature.xml b/bundles/org.openhab.binding.nikohomecontrol/src/main/feature/feature.xml index 3a80ecdaeafc2..c4c61bff03583 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nikohomecontrol-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nikohomecontrol" description="Niko Home Control Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlBindingConstants.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlBindingConstants.java index 756a10e8f9250..08ab2d5ec1b62 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlBindingConstants.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlHandlerFactory.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlHandlerFactory.java index 47a235c14a4fe..78ae7eb59aa58 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlHandlerFactory.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/NikoHomeControlHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlBridgeDiscoveryService.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlBridgeDiscoveryService.java index bbca57328815b..c0f29420d7c39 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlBridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlBridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlDiscoveryService.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlDiscoveryService.java index 5308c7c472d32..a801e391e1e29 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlDiscoveryService.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/discovery/NikoHomeControlDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionConfig.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionConfig.java index 525f795b51ffb..f0e54e6f910f0 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionConfig.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionDimmerConfig.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionDimmerConfig.java index 050ec6c8e53fe..7781cc4b5c036 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionDimmerConfig.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionDimmerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionHandler.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionHandler.java index fb2cfc785446f..b8b212e1a9c90 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionHandler.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig.java index 71e6ebcaac8c1..2a981161e6dad 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig2.java index 3efff873763d7..f18aefe113e54 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeConfig2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler.java index 0f3a78aef5127..e0e620d75f515 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler1.java index ef30ae847c59e..8d3d699948744 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler2.java index 6903528686edf..0795bb0a8cf39 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlBridgeHandler2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatConfig.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatConfig.java index 4e48b2cf1fd8c..0450c7a7ce121 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatConfig.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatHandler.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatHandler.java index 30311c9db9c9d..de7d357f1711a 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatHandler.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/handler/NikoHomeControlThermostatHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcAction.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcAction.java index e131bb51a32c1..ed36477567f0f 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcAction.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcActionEvent.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcActionEvent.java index a88978807bd95..bb0b531f17462 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcActionEvent.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcActionEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcControllerEvent.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcControllerEvent.java index 35d5e34c14dfe..36ecf55f471b3 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcControllerEvent.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcControllerEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostat.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostat.java index 1d59cfc85ad7d..d12f40e9bb265 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostat.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostat.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostatEvent.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostatEvent.java index 2b00b92fce248..4cb05cfd8c34d 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostatEvent.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NhcThermostatEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlCommunication.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlCommunication.java index f2af169641d38..07bc2eee19e76 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlCommunication.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlCommunication.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlConstants.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlConstants.java index 80a19dd140e6f..5cb8d4ef388b8 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlConstants.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlDiscover.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlDiscover.java index 8e14c2e97272c..ab533bb3dc837 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlDiscover.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/NikoHomeControlDiscover.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcAction1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcAction1.java index 3cd546920ed0a..3a02cb323a6d7 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcAction1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcAction1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcLocation1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcLocation1.java index be4e249144719..ce2d71cffa733 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcLocation1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcLocation1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageBase1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageBase1.java index 15b478b065dd5..f44235c3d8d21 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageBase1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageBase1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageCmd1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageCmd1.java index c5e364ebb29b1..a8baa3887a124 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageCmd1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageCmd1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageListMap1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageListMap1.java index 8e199bf983e81..494dc9ca91f96 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageListMap1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageListMap1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageMap1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageMap1.java index 47af6a8aafde8..37532091ff758 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageMap1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcMessageMap1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcSystemInfo1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcSystemInfo1.java index 9ae878586b295..3458242db3007 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcSystemInfo1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcSystemInfo1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcThermostat1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcThermostat1.java index fe85ef3337d5f..7554cecdf47d9 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcThermostat1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NhcThermostat1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlCommunication1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlCommunication1.java index be6b820b38f0b..c84d7ab028977 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlCommunication1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlCommunication1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlMessageDeserializer1.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlMessageDeserializer1.java index a0d207469db07..76da8e65decde 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlMessageDeserializer1.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc1/NikoHomeControlMessageDeserializer1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcAction2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcAction2.java index 77868c48f8d71..c71910e8108af 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcAction2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcAction2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcDevice2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcDevice2.java index 16a9641026e76..36e9d560c26c8 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcDevice2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcDevice2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcLocation2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcLocation2.java index 25d60f13eefb7..10739b4d546f9 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcLocation2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcLocation2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMessage2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMessage2.java index d22d7d14f908b..185d5e6f5a799 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMessage2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMessage2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMqttConnection2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMqttConnection2.java index e398a5853abc1..6680ea553b076 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMqttConnection2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcMqttConnection2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -41,7 +41,6 @@ import org.eclipse.smarthome.io.transport.mqtt.MqttConnectionState; import org.eclipse.smarthome.io.transport.mqtt.MqttException; import org.eclipse.smarthome.io.transport.mqtt.MqttMessageSubscriber; -import org.eclipse.smarthome.io.transport.mqtt.sslcontext.SSLContextProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,7 +71,7 @@ public class NhcMqttConnection2 implements MqttActionCallback { private MqttConnectionObserver connectionObserver; private Path persistenceBasePath; - private SSLContextProvider sslContextProvider; + private TrustManager trustManagers[]; private @Nullable String clientId; private volatile String cocoAddress = ""; @@ -81,13 +80,13 @@ public class NhcMqttConnection2 implements MqttActionCallback { NhcMqttConnection2(String clientId, String persistencePath, MqttMessageSubscriber messageSubscriber, MqttConnectionObserver connectionObserver) throws CertificateException { persistenceBasePath = Paths.get(persistencePath).resolve("nikohomecontrol"); - sslContextProvider = getSSLContext(); + trustManagers = getTrustManagers(); this.clientId = clientId; this.messageSubscriber = messageSubscriber; this.connectionObserver = connectionObserver; } - private SSLContextProvider getSSLContext() throws CertificateException { + private TrustManager[] getTrustManagers() throws CertificateException { ResourceBundle certificatesBundle = ResourceBundle.getBundle("nikohomecontrol/certificates"); try { @@ -108,11 +107,7 @@ private SSLContextProvider getSSLContext() throws CertificateException { // Create trust managers used to validate server TrustManagerFactory tmFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); tmFactory.init(keyStore); - TrustManager[] trustManagers = tmFactory.getTrustManagers(); - - // Return the SSL context provider - return new NhcSSLContextProvider2(trustManagers); - + return tmFactory.getTrustManagers(); } catch (CertificateException | KeyStoreException | NoSuchAlgorithmException | IOException e) { logger.warn("Niko Home Control: error with SSL context creation: {} ", e.getMessage()); throw new CertificateException("SSL context creation exception", e); @@ -162,7 +157,7 @@ synchronized void startPublicConnection(String cocoAddress, int port) throws Mqt logger.debug("Niko Home Control: public connection interrupted exception"); throw new MqttException(0); } catch (ExecutionException e) { - logger.debug("Niko Home Control: public connection execution exception for {}", e.getCause()); + logger.debug("Niko Home Control: public connection execution exception", e.getCause()); throw new MqttException(32103); } catch (TimeoutException e) { logger.debug("Niko Home Control: public connection timeout exception"); @@ -216,7 +211,7 @@ synchronized void startProfileConnection(String username, String password) throw logger.debug("Niko Home Control: profile connection interrupted exception "); throw new MqttException(0); } catch (ExecutionException e) { - logger.debug("Niko Home Control: profile connection execution exception for {}", e.getCause()); + logger.debug("Niko Home Control: profile connection execution exception", e.getCause()); throw new MqttException(32103); } catch (TimeoutException e) { logger.debug("Niko Home Control: public connection timeout exception"); @@ -229,7 +224,7 @@ private MqttBrokerConnection createMqttConnection(@Nullable String username, @Nu Path persistencePath = persistenceBasePath.resolve(clientId); MqttBrokerConnection connection = new MqttBrokerConnection(cocoAddress, port, true, clientId); connection.setPersistencePath(persistencePath); - connection.setSSLContextProvider(sslContextProvider); + connection.setTrustManagers(trustManagers); connection.setCredentials(username, password); connection.setQos(1); return connection; diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcNotification2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcNotification2.java index 09070ee694147..6673623bf8b8d 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcNotification2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcNotification2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcProfile2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcProfile2.java index a0330fc6ff957..0edadb5f485bf 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcProfile2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcProfile2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSSLContextProvider2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSSLContextProvider2.java index 633894a823aeb..347d46f483b89 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSSLContextProvider2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSSLContextProvider2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcService2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcService2.java index efb7a7b94b65b..1ec8114d1500b 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcService2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcService2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSystemInfo2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSystemInfo2.java index 1834e60776331..100358e1ddc69 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSystemInfo2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcSystemInfo2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcThermostat2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcThermostat2.java index 6c0aa2d9c031b..9a1131fa2060d 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcThermostat2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcThermostat2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcTimeInfo2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcTimeInfo2.java index 846a115b78ffa..a4940fed5caec 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcTimeInfo2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NhcTimeInfo2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NikoHomeControlCommunication2.java b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NikoHomeControlCommunication2.java index 7bb4fad876d2d..a827d22f2fb2f 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NikoHomeControlCommunication2.java +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/java/org/openhab/binding/nikohomecontrol/internal/protocol/nhc2/NikoHomeControlCommunication2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nikohomecontrol/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.nikohomecontrol/src/main/resources/ESH-INF/thing/thing-types.xml index 417607f649e21..cf3f021e9fb22 100644 --- a/bundles/org.openhab.binding.nikohomecontrol/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.nikohomecontrol/src/main/resources/ESH-INF/thing/thing-types.xml @@ -19,13 +19,13 @@ <context>network-address</context> </parameter> <parameter name="port" type="integer" required="false"> - <label>Bridge port</label> + <label>Bridge Port</label> <description>Port to communicate with Niko Home Control IP-interface, default 8000</description> <default>8000</default> <advanced>true</advanced> </parameter> <parameter name="refresh" type="integer" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for connection with Niko Home Control IP-interface (min), default 300. If set to 0 or left empty, no refresh will be scheduled</description> <default>300</default> <advanced>true</advanced> @@ -47,7 +47,7 @@ <context>network-address</context> </parameter> <parameter name="port" type="integer" required="false"> - <label>Bridge port</label> + <label>Bridge Port</label> <description>Port for secure MQTT communication with Connected Controller, default 8883</description> <default>8883</default> <advanced>true</advanced> @@ -62,7 +62,7 @@ <context>password</context> </parameter> <parameter name="refresh" type="integer" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for connection with Connected Controller (min), default 300. If set to 0 or left empty, no refresh will be scheduled</description> <default>300</default> <advanced>true</advanced> @@ -123,7 +123,7 @@ <advanced>false</advanced> </parameter> <parameter name="step" type="integer" required="true"> - <label>Step value</label> + <label>Step Value</label> <description>Step value used for increase/decrease of dimmer brightness, default 10%</description> <default>10</default> <advanced>true</advanced> @@ -167,7 +167,7 @@ <advanced>false</advanced> </parameter> <parameter name="overruleTime" type="integer" required="false"> - <label>Overrule time</label> + <label>Overrule Time</label> <description>Default overrule duration in minutes when an overrule temperature is set without providing overrule time, 60 minutes by default</description> <default>60</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.ntp/NOTICE b/bundles/org.openhab.binding.ntp/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.ntp/NOTICE +++ b/bundles/org.openhab.binding.ntp/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.ntp/pom.xml b/bundles/org.openhab.binding.ntp/pom.xml index 44f373a63b463..9e292540a0991 100644 --- a/bundles/org.openhab.binding.ntp/pom.xml +++ b/bundles/org.openhab.binding.ntp/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.ntp</artifactId> diff --git a/bundles/org.openhab.binding.ntp/src/main/feature/feature.xml b/bundles/org.openhab.binding.ntp/src/main/feature/feature.xml index 1f544ad379eca..732776f8ae1f4 100644 --- a/bundles/org.openhab.binding.ntp/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.ntp/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.ntp-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-ntp" description="NTP Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpBindingConstants.java b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpBindingConstants.java index 5e35d08508fc5..b7957e20eafce 100644 --- a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpBindingConstants.java +++ b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpHandlerFactory.java b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpHandlerFactory.java index 0e79540c5e220..98fa35a67b2db 100644 --- a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpHandlerFactory.java +++ b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/NtpHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/discovery/NtpDiscovery.java b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/discovery/NtpDiscovery.java index dcb5e7b8a8553..54cbcbca793fc 100644 --- a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/discovery/NtpDiscovery.java +++ b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/discovery/NtpDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/handler/NtpHandler.java b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/handler/NtpHandler.java index 8cb6aed76dcd4..c2d4369a097d0 100644 --- a/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/handler/NtpHandler.java +++ b/bundles/org.openhab.binding.ntp/src/main/java/org/openhab/binding/ntp/internal/handler/NtpHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.ntp/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.ntp/src/main/resources/ESH-INF/thing/thing-types.xml index 4d0b184113405..7ab3b456380d7 100644 --- a/bundles/org.openhab.binding.ntp/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.ntp/src/main/resources/ESH-INF/thing/thing-types.xml @@ -19,21 +19,21 @@ <default>0.pool.ntp.org</default> </parameter> <parameter name="refreshInterval" type="integer" required="true" unit="s"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description> Interval that new time updates are posted to the event bus in seconds. </description> <default>60</default> </parameter> <parameter name="refreshNtp" type="integer" required="true"> - <label>NTP refresh frequency</label> + <label>NTP Refresh Frequency</label> <description> Number of updates before querying the NTP server. </description> <default>30</default> </parameter> <parameter name="serverPort" type="integer"> - <label>Server port</label> + <label>Server Port</label> <description>The port that the NTP server could use.</description> <default>123</default> </parameter> diff --git a/bundles/org.openhab.binding.nuki/NOTICE b/bundles/org.openhab.binding.nuki/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.nuki/NOTICE +++ b/bundles/org.openhab.binding.nuki/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.nuki/pom.xml b/bundles/org.openhab.binding.nuki/pom.xml index dfc25f111994b..1527b36c44146 100644 --- a/bundles/org.openhab.binding.nuki/pom.xml +++ b/bundles/org.openhab.binding.nuki/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.nuki</artifactId> diff --git a/bundles/org.openhab.binding.nuki/src/main/feature/feature.xml b/bundles/org.openhab.binding.nuki/src/main/feature/feature.xml index 3ce0656f1abfc..a62823a42c65f 100644 --- a/bundles/org.openhab.binding.nuki/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.nuki/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.nuki-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-nuki" description="Nuki Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiBindingConstants.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiBindingConstants.java index 423922d2d92a4..4ce675eca5e92 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiBindingConstants.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiHandlerFactory.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiHandlerFactory.java index 677810edfc335..204f3e27401cb 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiHandlerFactory.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/NukiHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/converter/LockActionConverter.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/converter/LockActionConverter.java index 6549189f8ddda..ce1f9c2c860e8 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/converter/LockActionConverter.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/converter/LockActionConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackAddResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackAddResponse.java index 4edef4a3b7ba3..02b22b841d3bd 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackAddResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackAddResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackListResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackListResponse.java index 42d3561355467..61abedf070611 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackListResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackListResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackRemoveResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackRemoveResponse.java index 1ba34d5df42dc..a6cd8b26483e4 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackRemoveResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeCallbackRemoveResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeInfoResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeInfoResponse.java index cbce351d1d813..aff974e7a26fa 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeInfoResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeInfoResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockActionResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockActionResponse.java index b3b30028a7bf1..56842afc40f51 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockActionResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockActionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockStateResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockStateResponse.java index 4bffcf8b50e28..922e5dfa31ba7 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockStateResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/BridgeLockStateResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiApiServlet.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiApiServlet.java index 528342ab72aa5..1dced7d4f8326 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiApiServlet.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiApiServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiBaseResponse.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiBaseResponse.java index 7f28b2f08083a..90929f1d3fbd2 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiBaseResponse.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiBaseResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiHttpClient.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiHttpClient.java index 723e94a40fbbc..f84c332d1a1cf 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiHttpClient.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dataexchange/NukiHttpClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -60,7 +60,7 @@ public NukiHttpClient(HttpClient httpClient, Configuration configuration) { gson = new Gson(); } - private synchronized String prepareUri(String uriTemplate, String... additionalArguments) { + private String prepareUri(String uriTemplate, String... additionalArguments) { String configIp = (String) configuration.get(NukiBindingConstants.CONFIG_IP); BigDecimal configPort = (BigDecimal) configuration.get(NukiBindingConstants.CONFIG_PORT); String configApiToken = (String) configuration.get(NukiBindingConstants.CONFIG_API_TOKEN); @@ -80,8 +80,13 @@ private synchronized String prepareUri(String uriTemplate, String... additionalA private synchronized ContentResponse executeRequest(String uri) throws InterruptedException, ExecutionException, TimeoutException { + logger.debug("executeRequest({})", uri); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + } ContentResponse contentResponse = httpClient.GET(uri); - logger.trace("contentResponseAsString[{}]", contentResponse.getContentAsString()); + logger.debug("contentResponseAsString[{}]", contentResponse.getContentAsString()); return contentResponse; } @@ -111,15 +116,17 @@ private NukiBaseResponse handleException(Exception e) { return new NukiBaseResponse(HttpStatus.INTERNAL_SERVER_ERROR_500, e.getMessage()); } - public synchronized BridgeInfoResponse getBridgeInfo() { - logger.debug("getBridgeInfo()"); + public BridgeInfoResponse getBridgeInfo() { + logger.debug("getBridgeInfo() in thread {}", Thread.currentThread().getId()); String uri = prepareUri(NukiBindingConstants.URI_INFO); try { ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeInfo status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiInfoDto bridgeApiInfoDto = gson.fromJson(response, BridgeApiInfoDto.class); + logger.debug("getBridgeInfo OK"); return new BridgeInfoResponse(status, contentResponse.getReason(), bridgeApiInfoDto); } else { logger.debug("Could not get Bridge Info! Status[{}] - Response[{}]", status, response); @@ -131,8 +138,8 @@ public synchronized BridgeInfoResponse getBridgeInfo() { } } - public synchronized BridgeLockStateResponse getBridgeLockState(String nukiId) { - logger.debug("getBridgeLockState({})", nukiId); + public BridgeLockStateResponse getBridgeLockState(String nukiId) { + logger.debug("getBridgeLockState({}) in thread {}", nukiId, Thread.currentThread().getId()); long timestampSecs = Instant.now().getEpochSecond(); if (this.bridgeLockStateResponseCache != null && timestampSecs < this.bridgeLockStateResponseCache.getCreated().getEpochSecond() + CACHE_PERIOD) { @@ -147,8 +154,10 @@ public synchronized BridgeLockStateResponse getBridgeLockState(String nukiId) { ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeLockState status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiLockStateDto bridgeApiLockStateDto = gson.fromJson(response, BridgeApiLockStateDto.class); + logger.debug("getBridgeLockState OK"); return bridgeLockStateResponseCache = new BridgeLockStateResponse(status, contentResponse.getReason(), bridgeApiLockStateDto); } else { @@ -161,15 +170,17 @@ public synchronized BridgeLockStateResponse getBridgeLockState(String nukiId) { } } - public synchronized BridgeLockActionResponse getBridgeLockAction(String nukiId, int lockAction) { - logger.debug("getBridgeLockAction({}, {})", nukiId, lockAction); + public BridgeLockActionResponse getBridgeLockAction(String nukiId, int lockAction) { + logger.debug("getBridgeLockAction({}, {}) in thread {}", nukiId, lockAction, Thread.currentThread().getId()); String uri = prepareUri(NukiBindingConstants.URI_LOCKACTION, nukiId, Integer.toString(lockAction)); try { ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeLockAction status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiLockActionDto bridgeApiLockActionDto = gson.fromJson(response, BridgeApiLockActionDto.class); + logger.debug("getBridgeLockAction OK"); return new BridgeLockActionResponse(status, contentResponse.getReason(), bridgeApiLockActionDto); } else { logger.debug("Could not execute Lock Action! Status[{}] - Response[{}]", status, response); @@ -181,16 +192,18 @@ public synchronized BridgeLockActionResponse getBridgeLockAction(String nukiId, } } - public synchronized BridgeCallbackAddResponse getBridgeCallbackAdd(String callbackUrl) { - logger.debug("getBridgeCallbackAdd({})", callbackUrl); + public BridgeCallbackAddResponse getBridgeCallbackAdd(String callbackUrl) { + logger.debug("getBridgeCallbackAdd({}) in thread {}", callbackUrl, Thread.currentThread().getId()); try { String uri = prepareUri(NukiBindingConstants.URI_CBADD, URLEncoder.encode(callbackUrl, "UTF-8")); ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeCallbackAdd status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiCallbackAddDto bridgeApiCallbackAddDto = gson.fromJson(response, BridgeApiCallbackAddDto.class); + logger.debug("getBridgeCallbackAdd OK"); return new BridgeCallbackAddResponse(status, contentResponse.getReason(), bridgeApiCallbackAddDto); } else { logger.debug("Could not execute Callback Add! Status[{}] - Response[{}]", status, response); @@ -202,16 +215,18 @@ public synchronized BridgeCallbackAddResponse getBridgeCallbackAdd(String callba } } - public synchronized BridgeCallbackListResponse getBridgeCallbackList() { - logger.debug("getBridgeCallbackList()"); + public BridgeCallbackListResponse getBridgeCallbackList() { + logger.debug("getBridgeCallbackList() in thread {}", Thread.currentThread().getId()); String uri = prepareUri(NukiBindingConstants.URI_CBLIST); try { ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeCallbackList status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiCallbackListDto bridgeApiCallbackListDto = gson.fromJson(response, BridgeApiCallbackListDto.class); + logger.debug("getBridgeCallbackList OK"); return new BridgeCallbackListResponse(status, contentResponse.getReason(), bridgeApiCallbackListDto); } else { logger.debug("Could not execute Callback List! Status[{}] - Response[{}]", status, response); @@ -223,16 +238,18 @@ public synchronized BridgeCallbackListResponse getBridgeCallbackList() { } } - public synchronized BridgeCallbackRemoveResponse getBridgeCallbackRemove(int id) { - logger.debug("getBridgeCallbackRemove({})", id); + public BridgeCallbackRemoveResponse getBridgeCallbackRemove(int id) { + logger.debug("getBridgeCallbackRemove({}) in thread {}", id, Thread.currentThread().getId()); try { String uri = prepareUri(NukiBindingConstants.URI_CBREMOVE, Integer.toString(id)); ContentResponse contentResponse = executeRequest(uri); int status = contentResponse.getStatus(); String response = contentResponse.getContentAsString(); + logger.debug("getBridgeCallbackRemove status[{}] response[{}]", status, response); if (status == HttpStatus.OK_200) { BridgeApiCallbackRemoveDto bridgeApiCallbackRemoveDto = gson.fromJson(response, BridgeApiCallbackRemoveDto.class); + logger.debug("getBridgeCallbackRemove OK"); return new BridgeCallbackRemoveResponse(status, contentResponse.getReason(), bridgeApiCallbackRemoveDto); } else { diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackAddDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackAddDto.java index cd5ae2df4ef8b..d6e15683f19a1 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackAddDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackAddDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListCallbackDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListCallbackDto.java index 07bd0d9323baf..72c808841cca5 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListCallbackDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListCallbackDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListDto.java index e13ef8bdaaa12..8b9fbd4685e5f 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackListDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackRemoveDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackRemoveDto.java index 075f419c2bd0b..e7367b63a051f 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackRemoveDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiCallbackRemoveDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoDto.java index 9ee62a85dab01..592397622124b 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoIdDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoIdDto.java index 15b8026652c6a..219e18c58267a 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoIdDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoIdDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoScanResultDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoScanResultDto.java index 38817ae820a86..af493d17d8bfd 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoScanResultDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoScanResultDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoVersionDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoVersionDto.java index 24307f1087d67..43343ba1004f1 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoVersionDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiInfoVersionDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockActionDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockActionDto.java index 7e3d09a6bff59..93de49d2d6839 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockActionDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockActionDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateDto.java index 2296af7eb2f05..4e278f49d6d17 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateRequestDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateRequestDto.java index ffe6068705e79..faa3367e066c9 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateRequestDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/BridgeApiLockStateRequestDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/NukiHttpServerStatusResponseDto.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/NukiHttpServerStatusResponseDto.java index a4826c6a7159c..640dd892f5d93 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/NukiHttpServerStatusResponseDto.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/dto/NukiHttpServerStatusResponseDto.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiBridgeHandler.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiBridgeHandler.java index f1aaaaa7dbc9f..644261fe8e381 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiBridgeHandler.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.ThingStatus; @@ -50,6 +51,7 @@ public class NukiBridgeHandler extends BaseBridgeHandler { private String callbackUrl; private ScheduledFuture<?> checkBridgeOnlineJob; private String bridgeIp; + private boolean manageCallbacks; private boolean initializable; public NukiBridgeHandler(Bridge bridge, HttpClient httpClient, String callbackUrl) { @@ -57,13 +59,8 @@ public NukiBridgeHandler(Bridge bridge, HttpClient httpClient, String callbackUr logger.debug("Instantiating NukiBridgeHandler({}, {}, {})", bridge, httpClient, callbackUrl); this.httpClient = httpClient; this.callbackUrl = callbackUrl; - this.bridgeIp = (String) getConfig().get(NukiBindingConstants.CONFIG_IP); - if (bridgeIp == null || getConfig().get(NukiBindingConstants.CONFIG_API_TOKEN) == null) { - logger.debug("NukiBridgeHandler[{}] is not initializable, check required configuration!", - getThing().getUID()); - return; - } - this.initializable = true; + this.initializable = getConfig().get(NukiBindingConstants.CONFIG_IP) != null + && getConfig().get(NukiBindingConstants.CONFIG_API_TOKEN) != null; } public NukiHttpClient getNukiHttpClient() { @@ -79,10 +76,23 @@ public boolean isInitializable() { @Override public void initialize() { - logger.debug("initialize() for Bridge[{}].", bridgeIp); - scheduler.execute(() -> initializeHandler()); - checkBridgeOnlineJob = scheduler.scheduleWithFixedDelay(() -> checkBridgeOnline(), JOB_INTERVAL, JOB_INTERVAL, - TimeUnit.SECONDS); + logger.debug("initialize() for Bridge[{}].", getThing().getUID()); + Configuration config = getConfig(); + bridgeIp = (String) config.get(NukiBindingConstants.CONFIG_IP); + manageCallbacks = (Boolean) config.get(NukiBindingConstants.CONFIG_MANAGECB); + if (bridgeIp == null) { + logger.debug("NukiBridgeHandler[{}] is not initializable, IP setting is unset in the configuration!", + getThing().getUID()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "IP setting is unset"); + } else if (config.get(NukiBindingConstants.CONFIG_API_TOKEN) == null) { + logger.debug("NukiBridgeHandler[{}] is not initializable, apiToken setting is unset in the configuration!", + getThing().getUID()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "apiToken setting is unset"); + } else { + scheduler.execute(this::initializeHandler); + checkBridgeOnlineJob = scheduler.scheduleWithFixedDelay(this::checkBridgeOnline, JOB_INTERVAL, JOB_INTERVAL, + TimeUnit.SECONDS); + } } @Override @@ -92,9 +102,11 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void dispose() { - logger.debug("dispose() for Bridge[{}].", bridgeIp); + logger.debug("dispose() for Bridge[{}].", getThing().getUID()); nukiHttpClient = null; - checkBridgeOnlineJob.cancel(true); + if (checkBridgeOnlineJob != null && !checkBridgeOnlineJob.isCancelled()) { + checkBridgeOnlineJob.cancel(true); + } checkBridgeOnlineJob = null; } @@ -102,31 +114,35 @@ private synchronized void initializeHandler() { logger.debug("initializeHandler() for Bridge[{}].", bridgeIp); BridgeInfoResponse bridgeInfoResponse = getNukiHttpClient().getBridgeInfo(); if (bridgeInfoResponse.getStatus() == HttpStatus.OK_200) { - boolean manageCallbacks = (Boolean) getConfig().get(NukiBindingConstants.CONFIG_MANAGECB); if (manageCallbacks) { manageNukiBridgeCallbacks(); } + logger.debug("Bridge[{}] responded with status[{}]. Switching the bridge online.", bridgeIp, + bridgeInfoResponse.getStatus()); updateStatus(ThingStatus.ONLINE); } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, bridgeInfoResponse.getMessage()); + logger.debug("Bridge[{}] responded with status[{}]. Switching the bridge offline!", bridgeIp, + bridgeInfoResponse.getStatus()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, bridgeInfoResponse.getMessage()); } } private void checkBridgeOnline() { logger.debug("checkBridgeOnline():bridgeIp[{}] status[{}]", bridgeIp, getThing().getStatus()); if (getThing().getStatus().equals(ThingStatus.ONLINE)) { - logger.trace("Requesting BridgeInfo to ensure Bridge[{}] is online.", bridgeIp); + logger.debug("Requesting BridgeInfo to ensure Bridge[{}] is online.", bridgeIp); BridgeInfoResponse bridgeInfoResponse = getNukiHttpClient().getBridgeInfo(); int status = bridgeInfoResponse.getStatus(); if (status == HttpStatus.OK_200) { - logger.trace("Bridge[{}] responded with status[{}]. Bridge is online.", bridgeIp, status); + logger.debug("Bridge[{}] responded with status[{}]. Bridge is online.", bridgeIp, status); } else if (status == HttpStatus.SERVICE_UNAVAILABLE_503) { - logger.trace( + logger.debug( "Bridge[{}] responded with status[{}]. REST service seems to be busy but Bridge is online.", bridgeIp, status); } else { - logger.debug("Bridge[{}] responded with status[{}]. Bridge is offline!.", bridgeIp, status); - updateStatus(ThingStatus.OFFLINE); + logger.debug("Bridge[{}] responded with status[{}]. Switching the bridge offline!", bridgeIp, status); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + bridgeInfoResponse.getMessage()); } } else { initializeHandler(); @@ -138,20 +154,22 @@ private void manageNukiBridgeCallbacks() { BridgeCallbackListResponse bridgeCallbackListResponse = getNukiHttpClient().getBridgeCallbackList(); List<BridgeApiCallbackListCallbackDto> callbacks = bridgeCallbackListResponse.getCallbacks(); boolean callbackExists = false; - int callbackCount = callbacks.size(); - for (BridgeApiCallbackListCallbackDto callback : callbacks) { - if (callback.getUrl().equals(callbackUrl)) { - logger.debug("callbackUrl[{}] already existing on Bridge[{}].", callbackUrl, bridgeIp); - callbackExists = true; - continue; - } - if (callback.getUrl().contains(NukiBindingConstants.CALLBACK_ENDPOINT)) { - logger.debug("Partial callbackUrl[{}] found on Bridge[{}] - Removing it!", callbackUrl, bridgeIp); - BridgeCallbackRemoveResponse bridgeCallbackRemoveResponse = getNukiHttpClient() - .getBridgeCallbackRemove(callback.getId()); - if (bridgeCallbackRemoveResponse.getStatus() == HttpStatus.OK_200) { - logger.debug("Successfully removed callbackUrl[{}] on Bridge[{}]!", callbackUrl, bridgeIp); - callbackCount--; + int callbackCount = callbacks == null ? 0 : callbacks.size(); + if (callbacks != null) { + for (BridgeApiCallbackListCallbackDto callback : callbacks) { + if (callback.getUrl().equals(callbackUrl)) { + logger.debug("callbackUrl[{}] already existing on Bridge[{}].", callbackUrl, bridgeIp); + callbackExists = true; + continue; + } + if (callback.getUrl().contains(NukiBindingConstants.CALLBACK_ENDPOINT)) { + logger.debug("Partial callbackUrl[{}] found on Bridge[{}] - Removing it!", callbackUrl, bridgeIp); + BridgeCallbackRemoveResponse bridgeCallbackRemoveResponse = getNukiHttpClient() + .getBridgeCallbackRemove(callback.getId()); + if (bridgeCallbackRemoveResponse.getStatus() == HttpStatus.OK_200) { + logger.debug("Successfully removed callbackUrl[{}] on Bridge[{}]!", callbackUrl, bridgeIp); + callbackCount--; + } } } } diff --git a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiSmartLockHandler.java b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiSmartLockHandler.java index d69c8d511b4fd..bf00780751ff6 100644 --- a/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiSmartLockHandler.java +++ b/bundles/org.openhab.binding.nuki/src/main/java/org/openhab/binding/nuki/internal/handler/NukiSmartLockHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.Bridge; @@ -23,7 +24,9 @@ import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.State; @@ -50,100 +53,148 @@ public class NukiSmartLockHandler extends BaseThingHandler { private NukiHttpClient nukiHttpClient; private ScheduledFuture<?> reInitJob; private String nukiId; + private boolean unlatch; public NukiSmartLockHandler(Thing thing) { super(thing); logger.debug("Instantiating NukiSmartLockHandler({})", thing); - nukiId = (String) getConfig().get(NukiBindingConstants.CONFIG_NUKI_ID); } @Override public void initialize() { - logger.debug("initialize() for Smart Lock[{}].", nukiId); - scheduler.execute(() -> initializeHandler()); - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("handleCommand({}, {})", channelUID, command); - String nukiId = (String) getConfig().get(NukiBindingConstants.CONFIG_NUKI_ID); - if (command instanceof RefreshType) { - scheduler.execute(() -> handleCommandRefreshType(channelUID, command, nukiId)); - } else if (command instanceof OnOffType) { - scheduler.execute(() -> handleCommandOnOffType(channelUID, command, nukiId)); - } else if (command instanceof DecimalType) { - scheduler.execute(() -> handleCommandDecimalType(channelUID, command, nukiId)); + logger.debug("initialize() for Smart Lock[{}].", getThing().getUID()); + Configuration config = getConfig(); + nukiId = (String) config.get(NukiBindingConstants.CONFIG_NUKI_ID); + unlatch = (Boolean) config.get(NukiBindingConstants.CONFIG_UNLATCH); + if (nukiId == null) { + logger.debug("NukiSmartLockHandler[{}] is not initializable, nukiId setting is unset in the configuration!", + getThing().getUID()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "nukiId setting is unset"); } else { - logger.debug("handleCommand({}, {}) not implemented!", channelUID, command); + scheduler.execute(this::initializeHandler); } } @Override public void dispose() { - logger.debug("NukiSmartLockHandler:dispose()"); + logger.debug("dispose() for Smart Lock[{}].", getThing().getUID()); stopReInitJob(); } private void initializeHandler() { logger.debug("initializeHandler() for Smart Lock[{}]", nukiId); - if (nukiId == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR); - return; - } - if (getNukiHttpClient() == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED); - startReInitJob(); - return; + Bridge bridge = getBridge(); + if (bridge == null) { + initializeHandler(null, null); + } else { + initializeHandler(bridge.getHandler(), bridge.getStatus()); } - BridgeLockStateResponse bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); - if (handleResponse(bridgeLockStateResponse, null, null)) { - updateStatus(ThingStatus.ONLINE); - if (reInitJob != null) { - for (Channel channel : thing.getChannels()) { - handleCommand(channel.getUID(), RefreshType.REFRESH); + } + + private void initializeHandler(ThingHandler bridgeHandler, ThingStatus bridgeStatus) { + if (bridgeHandler != null && bridgeStatus != null) { + if (bridgeStatus == ThingStatus.ONLINE) { + nukiHttpClient = ((NukiBridgeHandler) bridgeHandler).getNukiHttpClient(); + BridgeLockStateResponse bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); + if (handleResponse(bridgeLockStateResponse, null, null)) { + updateStatus(ThingStatus.ONLINE); + for (Channel channel : thing.getChannels()) { + handleCommand(channel.getUID(), RefreshType.REFRESH); + } + stopReInitJob(); } + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + stopReInitJob(); } - stopReInitJob(); } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - bridgeLockStateResponse.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED); + stopReInitJob(); } } - private NukiHttpClient getNukiHttpClient() { - logger.debug("getNukiHttpClient()"); - Bridge bridge = this.getBridge(); - if (bridge == null) { - logger.debug("Setting Smart Lock[{}] offline because Bridge is null!", nukiId); - return null; + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + logger.debug("bridgeStatusChanged({}) for Smart Lock[{}].", bridgeStatusInfo, nukiId); + scheduler.execute(() -> { + Bridge bridge = getBridge(); + if (bridge == null) { + initializeHandler(null, bridgeStatusInfo.getStatus()); + } else { + initializeHandler(bridge.getHandler(), bridgeStatusInfo.getStatus()); + } + }); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("handleCommand({}, {})", channelUID, command); + + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.debug("Thing is not ONLINE; command[{}] for channelUID[{}] is ignored", command, channelUID); + return; + } + + if (command instanceof RefreshType) { + handleCommandRefreshType(channelUID, command); + return; } - NukiBridgeHandler nbh = (NukiBridgeHandler) bridge.getHandler(); - if (nbh == null) { - logger.debug("Setting Smart Lock[{}] offline because NukiBridgeHandler is null!", nukiId); - return null; + + boolean validCmd = true; + switch (channelUID.getId()) { + case NukiBindingConstants.CHANNEL_SMARTLOCK_LOCK: + if (command instanceof OnOffType) { + int lockAction; + if (unlatch) { + lockAction = (command == OnOffType.OFF ? NukiBindingConstants.LOCK_ACTIONS_UNLATCH + : NukiBindingConstants.LOCK_ACTIONS_LOCK); + } else { + lockAction = (command == OnOffType.OFF ? NukiBindingConstants.LOCK_ACTIONS_UNLOCK + : NukiBindingConstants.LOCK_ACTIONS_LOCK); + } + Channel channelLockState = thing.getChannel(NukiBindingConstants.CHANNEL_SMARTLOCK_STATE); + if (channelLockState != null) { + updateState(channelLockState.getUID(), + new DecimalType(LockActionConverter.getLockStateFor(lockAction))); + } + BridgeLockActionResponse bridgeLockActionResponse = nukiHttpClient.getBridgeLockAction(nukiId, + lockAction); + handleResponse(bridgeLockActionResponse, channelUID.getAsString(), command.toString()); + } else { + validCmd = false; + } + break; + case NukiBindingConstants.CHANNEL_SMARTLOCK_STATE: + if (command instanceof DecimalType) { + int lockAction; + lockAction = ((DecimalType) command).intValue(); + lockAction = LockActionConverter.getLockActionFor(lockAction); + updateState(channelUID, new DecimalType(LockActionConverter.getLockStateFor(lockAction))); + BridgeLockActionResponse bridgeLockActionResponse = nukiHttpClient.getBridgeLockAction(nukiId, + lockAction); + handleResponse(bridgeLockActionResponse, channelUID.getAsString(), command.toString()); + } else { + validCmd = false; + } + break; + default: + validCmd = false; + break; } - nukiHttpClient = nbh.getNukiHttpClient(); - if (nukiHttpClient == null) { - logger.debug("Setting Smart Lock[{}] offline because NukiBridgeHandler returned null for nukiHttpClient!", - nukiId); - return null; + if (!validCmd) { + logger.debug("Unexpected command[{}] for channelUID[{}]!", command, channelUID); } - return nukiHttpClient; } - private void handleCommandRefreshType(ChannelUID channelUID, Command command, String nukiId) { - logger.debug("handleCommandRefreshType({}, {}, {})", channelUID, command, nukiId); - if (nukiHttpClient == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED); - startReInitJob(); - return; - } - BridgeLockStateResponse bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); - if (handleResponse(bridgeLockStateResponse, channelUID.getAsString(), command.toString())) { - int lockState = bridgeLockStateResponse.getState(); - State state; - switch (channelUID.getId()) { - case NukiBindingConstants.CHANNEL_SMARTLOCK_LOCK: + private void handleCommandRefreshType(ChannelUID channelUID, Command command) { + logger.debug("handleCommandRefreshType({}, {})", channelUID, command); + BridgeLockStateResponse bridgeLockStateResponse; + switch (channelUID.getId()) { + case NukiBindingConstants.CHANNEL_SMARTLOCK_LOCK: + bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); + if (handleResponse(bridgeLockStateResponse, channelUID.getAsString(), command.toString())) { + int lockState = bridgeLockStateResponse.getState(); + State state; if (lockState == NukiBindingConstants.LOCK_STATES_LOCKED) { state = OnOffType.ON; } else if (lockState == NukiBindingConstants.LOCK_STATES_UNLOCKED) { @@ -154,59 +205,25 @@ private void handleCommandRefreshType(ChannelUID channelUID, Command command, St lockState); state = OnOffType.OFF; } - break; - case NukiBindingConstants.CHANNEL_SMARTLOCK_STATE: - state = new DecimalType(lockState); - break; - case NukiBindingConstants.CHANNEL_SMARTLOCK_LOW_BATTERY: - state = bridgeLockStateResponse.isBatteryCritical() ? OnOffType.ON : OnOffType.OFF; - break; - default: - logger.debug("Command[{}] for channelUID[{}] not implemented!", command, channelUID); - return; - } - updateState(channelUID, state); - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - bridgeLockStateResponse.getMessage()); - } - } - - private void handleCommandOnOffType(ChannelUID channelUID, Command command, String nukiId) { - logger.debug("handleCommandOnOffType({}, {}, {})", channelUID, command, nukiId); - if (!channelUID.getId().equals(NukiBindingConstants.CHANNEL_SMARTLOCK_LOCK)) { - logger.debug("Command[{}] for channelUID[{}] not implemented!", command, channelUID); - return; - } - int lockAction; - boolean unlatch = (Boolean) getConfig().get(NukiBindingConstants.CONFIG_UNLATCH); - if (unlatch) { - lockAction = (command == OnOffType.OFF ? NukiBindingConstants.LOCK_ACTIONS_UNLATCH - : NukiBindingConstants.LOCK_ACTIONS_LOCK); - } else { - lockAction = (command == OnOffType.OFF ? NukiBindingConstants.LOCK_ACTIONS_UNLOCK - : NukiBindingConstants.LOCK_ACTIONS_LOCK); - } - Channel channelLockState = thing.getChannel(NukiBindingConstants.CHANNEL_SMARTLOCK_STATE); - if (channelLockState != null) { - updateState(channelLockState.getUID(), new DecimalType(LockActionConverter.getLockStateFor(lockAction))); - } - BridgeLockActionResponse bridgeLockActionResponse = nukiHttpClient.getBridgeLockAction(nukiId, lockAction); - handleResponse(bridgeLockActionResponse, channelUID.getAsString(), command.toString()); - } - - private void handleCommandDecimalType(ChannelUID channelUID, Command command, String nukiId) { - logger.debug("handleCommandDecimalType({}, {}, {})", channelUID, command, nukiId); - if (!channelUID.getId().equals(NukiBindingConstants.CHANNEL_SMARTLOCK_STATE)) { - logger.debug("Command[{}] for channelUID[{}] not implemented!", command, channelUID); - return; + updateState(channelUID, state); + } + break; + case NukiBindingConstants.CHANNEL_SMARTLOCK_STATE: + bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); + if (handleResponse(bridgeLockStateResponse, channelUID.getAsString(), command.toString())) { + updateState(channelUID, new DecimalType(bridgeLockStateResponse.getState())); + } + break; + case NukiBindingConstants.CHANNEL_SMARTLOCK_LOW_BATTERY: + bridgeLockStateResponse = nukiHttpClient.getBridgeLockState(nukiId); + if (handleResponse(bridgeLockStateResponse, channelUID.getAsString(), command.toString())) { + updateState(channelUID, bridgeLockStateResponse.isBatteryCritical() ? OnOffType.ON : OnOffType.OFF); + } + break; + default: + logger.debug("Command[{}] for channelUID[{}] not implemented!", command, channelUID); + return; } - int lockAction; - lockAction = (command instanceof DecimalType) ? ((DecimalType) command).intValue() : 0; - lockAction = LockActionConverter.getLockActionFor(lockAction); - updateState(channelUID, new DecimalType(LockActionConverter.getLockStateFor(lockAction))); - BridgeLockActionResponse bridgeLockActionResponse = nukiHttpClient.getBridgeLockAction(nukiId, lockAction); - handleResponse(bridgeLockActionResponse, channelUID.getAsString(), command.toString()); } private boolean handleResponse(NukiBaseResponse nukiBaseResponse, String channelUID, String command) { @@ -222,7 +239,7 @@ private boolean handleResponse(NukiBaseResponse nukiBaseResponse, String channel nukiBaseResponse.getStatus(), nukiBaseResponse.getMessage(), nukiBaseResponse.isSuccess()); } logger.debug("Could not handle command[{}] for channelUID[{}] on nukiId[{}]!", command, channelUID, nukiId); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, nukiBaseResponse.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, nukiBaseResponse.getMessage()); Channel channelLock = thing.getChannel(NukiBindingConstants.CHANNEL_SMARTLOCK_LOCK); if (channelLock != null) { updateState(channelLock.getUID(), OnOffType.OFF); @@ -241,17 +258,17 @@ private void startReInitJob() { logger.trace("Already started reInitJob for Smart Lock[{}].", nukiId); return; } - reInitJob = scheduler.scheduleWithFixedDelay(() -> initializeHandler(), JOB_INTERVAL, JOB_INTERVAL, + reInitJob = scheduler.scheduleWithFixedDelay(this::initializeHandler, JOB_INTERVAL, JOB_INTERVAL, TimeUnit.SECONDS); } private void stopReInitJob() { logger.trace("Stopping reInitJob for Smart Lock[{}].", nukiId); - if (reInitJob != null) { + if (reInitJob != null && !reInitJob.isCancelled()) { logger.trace("Stopped reInitJob for Smart Lock[{}].", nukiId); reInitJob.cancel(true); - reInitJob = null; } + reInitJob = null; } public void handleApiServletUpdate(ChannelUID channelUID, State newState) { diff --git a/bundles/org.openhab.binding.oceanic/NOTICE b/bundles/org.openhab.binding.oceanic/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.oceanic/NOTICE +++ b/bundles/org.openhab.binding.oceanic/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.oceanic/README.md b/bundles/org.openhab.binding.oceanic/README.md index 330407d1aa8f7..eb958afc97bc2 100644 --- a/bundles/org.openhab.binding.oceanic/README.md +++ b/bundles/org.openhab.binding.oceanic/README.md @@ -10,7 +10,7 @@ The binding supports the Limex IQ and Limex Pro water softeners and require the ## Thing Configuration -The **serial** Thing configuration requires the name of the serial port that is used to connect the ESH host with the Oceanic unit, and the interval period in seconds to poll the Oceanic unit +The **serial** Thing configuration requires the name of the serial port that is used to connect openHAB with the Oceanic unit, and the interval period in seconds to poll the Oceanic unit The **network** Thing configuration requires the hostname or ip address of the proxy, the TCP port number to connect to, and the interval period in seconds to poll the Oceanic unit @@ -18,30 +18,30 @@ The **network** Thing configuration requires the hostname or ip address of the p All things support the following channels (non-exhaustive): -| Channel Type ID | Item Type | Description | | | -|--------------------------------------|-----------|-----------------------------------------------------------------|---|---| -| alarm | String | Current alarm description, if any | | | -| alert | String | Current alert description, if any, to notify a shortage of salt | | | -| totalflow | Number | Current flow in l/min | | | -| maxflow | Number | Maximum flow recorded, in l/min | | | -| reserve | Number | Water reserve in l before regeneration has to start | | | -| cycle | String | Indicates the stage of the regeneration cycle | | | -| endofcycle | String | Indicates the time to the end of the current cycle | | | -| endofgeneration | String | Indicates the time to the end of the current generation | | | -| inlethardness | Number | Water hardness at the inlet | | | -| outlethardness | Number | Water hardness at the outlet | | | -| salt | String | Volume of salt remaining, in kg | | | -| consumption(today)(currentweek)(...) | String | Water consumption, in l, for that period | | | -| regeneratenow | Switch | Start an immediate regeneration | | | -| regeneratelater | Switch | Start a delayed regeneration | | | -| lastgeneration | DateTime | Date and Time of the last regeneration cycle | | | -| pressure | Number | Water pressure, in bar | | | -| minpressure | Number | Minimum water pressure recorded, in bar | | | -| maxpressure | Number | Maximum water pressure recorded, in bar | | | -| normalregenerations | Number | Number of regenerations completed | | | -| serviceregenerations | Number | Number of service regenerations completed | | | -| incompleteregenerations | Number | Number of incomplete regenerations | | | -| allregenerations | Number | Number of all regenerations | | | +| Channel Type ID | Item Type | Description | +|--------------------------------------|-----------|-----------------------------------------------------------------| +| alarm | String | Current alarm description, if any | +| alert | String | Current alert description, if any, to notify a shortage of salt | +| totalflow | Number | Current flow in l/min | +| maxflow | Number | Maximum flow recorded, in l/min | +| reserve | Number | Water reserve in l before regeneration has to start | +| cycle | String | Indicates the stage of the regeneration cycle | +| endofcycle | String | Indicates the time to the end of the current cycle | +| endofgeneration | String | Indicates the time to the end of the current generation | +| inlethardness | Number | Water hardness at the inlet | +| outlethardness | Number | Water hardness at the outlet | +| salt | String | Volume of salt remaining, in kg | +| consumption(today)(currentweek)(...) | String | Water consumption, in l, for that period | +| regeneratenow | Switch | Start an immediate regeneration | +| regeneratelater | Switch | Start a delayed regeneration | +| lastgeneration | DateTime | Date and Time of the last regeneration cycle | +| pressure | Number | Water pressure, in bar | +| minpressure | Number | Minimum water pressure recorded, in bar | +| maxpressure | Number | Maximum water pressure recorded, in bar | +| normalregenerations | Number | Number of regenerations completed | +| serviceregenerations | Number | Number of service regenerations completed | +| incompleteregenerations | Number | Number of incomplete regenerations | +| allregenerations | Number | Number of all regenerations | ## Full Example diff --git a/bundles/org.openhab.binding.oceanic/pom.xml b/bundles/org.openhab.binding.oceanic/pom.xml index 03e070e732360..33f075f4d45b8 100644 --- a/bundles/org.openhab.binding.oceanic/pom.xml +++ b/bundles/org.openhab.binding.oceanic/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.oceanic</artifactId> diff --git a/bundles/org.openhab.binding.oceanic/src/main/feature/feature.xml b/bundles/org.openhab.binding.oceanic/src/main/feature/feature.xml index 890f8cce78e4c..a67bfb5216eb6 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.oceanic/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.oceanic-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-oceanic" description="Oceanic Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/NetworkOceanicBindingConfiguration.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/NetworkOceanicBindingConfiguration.java index 4040f9131eaf5..0e17bfe95b0fd 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/NetworkOceanicBindingConfiguration.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/NetworkOceanicBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicBindingConstants.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicBindingConstants.java index 97cbe863adb42..3289652380b1f 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicBindingConstants.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicHandlerFactory.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicHandlerFactory.java index 18cdab0a62b35..bc5c4b78ee66f 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicHandlerFactory.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/SerialOceanicBindingConfiguration.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/SerialOceanicBindingConfiguration.java index ce6da1bb4cb81..64a0b2bd04291 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/SerialOceanicBindingConfiguration.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/SerialOceanicBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/Throttler.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/Throttler.java index 79162981e9779..9023e677a2a3d 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/Throttler.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/Throttler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/NetworkOceanicThingHandler.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/NetworkOceanicThingHandler.java index 92691c97bbab4..2d1a3a3a15266 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/NetworkOceanicThingHandler.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/NetworkOceanicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/OceanicThingHandler.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/OceanicThingHandler.java index c5a33b40dee69..382fc3aee0ce5 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/OceanicThingHandler.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/OceanicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/SerialOceanicThingHandler.java b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/SerialOceanicThingHandler.java index c5973045f2219..550ffa6e4fa51 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/SerialOceanicThingHandler.java +++ b/bundles/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/handler/SerialOceanicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.oceanic/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.oceanic/src/main/resources/ESH-INF/thing/channel-types.xml index dfcb490d0aced..192077b1343b0 100644 --- a/bundles/org.openhab.binding.oceanic/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.oceanic/src/main/resources/ESH-INF/thing/channel-types.xml @@ -49,7 +49,7 @@ </channel-type> <channel-type id="hardness" advanced="true"> <item-type>Number</item-type> - <label>Water hardness</label> + <label>Water Hardness</label> <description>Water hardness expressed using the chosen hardness unit</description> <state readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.omnikinverter/NOTICE b/bundles/org.openhab.binding.omnikinverter/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.omnikinverter/NOTICE +++ b/bundles/org.openhab.binding.omnikinverter/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.omnikinverter/pom.xml b/bundles/org.openhab.binding.omnikinverter/pom.xml index 9fe26a86072de..c8549890dfb63 100644 --- a/bundles/org.openhab.binding.omnikinverter/pom.xml +++ b/bundles/org.openhab.binding.omnikinverter/pom.xml @@ -1,11 +1,10 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.omnikinverter</artifactId> diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/feature/feature.xml b/bundles/org.openhab.binding.omnikinverter/src/main/feature/feature.xml index f4da70585b390..0a7f08569c43b 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.omnikinverter/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.omnikinverter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-omnikinverter" description="Omnik Inverter Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverter.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverter.java index bbc3305161748..7281c69ebea72 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverter.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterBindingConstants.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterBindingConstants.java index c7060ee259db1..e84a73105a7d5 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterBindingConstants.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterConfiguration.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterConfiguration.java index 92ab695f15ad4..266958a685d51 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterConfiguration.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterHandlerFactory.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterHandlerFactory.java index e2b26ec305bb9..0f3a66613f9b7 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterHandlerFactory.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterMessage.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterMessage.java index 43763e18077f0..8d37e61aff5cb 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterMessage.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/OmnikInverterMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/handler/OmnikInverterHandler.java b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/handler/OmnikInverterHandler.java index a92987c29ce4e..bbb1e2e6977a9 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/handler/OmnikInverterHandler.java +++ b/bundles/org.openhab.binding.omnikinverter/src/main/java/org/openhab/binding/omnikinverter/internal/handler/OmnikInverterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/binding/binding.xml index 91916fe387d53..0ea7ca89e8ecd 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/binding/binding.xml @@ -4,9 +4,6 @@ xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>OmnikInverter Binding</name> - <description>This is the binding for the Omnik solar grid inverters. The integration is based on the - undocumented API, which is reverse engineered at https://github.com/Woutrrr/Omnik-Data-Logger. - As such, the known supported inverters are known to work with inverters with wifi bridge which start with the serial number '602' and '606'. - </description> + <description>This is the binding for the Omnik solar grid inverters. The integration is based on the undocumented API, which is reverse engineered at https://github.com/Woutrrr/Omnik-Data-Logger. As such, the known supported inverters are known to work with inverters with wifi bridge which start with the serial number '602' and '606'.</description> <author>Hans van den Bogert</author> </binding:binding> diff --git a/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/thing/thing-types.xml index 0cdd0b27ed4c7..03f325fcab8ad 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.omnikinverter/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="omnikinverter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" diff --git a/bundles/org.openhab.binding.omnikinverter/src/test/java/org/openhab/binding/omnikinverter/internal/test/OmnikInverterMessageTest.java b/bundles/org.openhab.binding.omnikinverter/src/test/java/org/openhab/binding/omnikinverter/internal/test/OmnikInverterMessageTest.java index ddfdffc70de72..4e0a58d06c5d9 100644 --- a/bundles/org.openhab.binding.omnikinverter/src/test/java/org/openhab/binding/omnikinverter/internal/test/OmnikInverterMessageTest.java +++ b/bundles/org.openhab.binding.omnikinverter/src/test/java/org/openhab/binding/omnikinverter/internal/test/OmnikInverterMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,9 @@ import org.junit.Test; import org.openhab.binding.omnikinverter.internal.OmnikInverterMessage; +/** + * @author Hans van den Bogert - Initial contribution + */ public class OmnikInverterMessageTest { private OmnikInverterMessage message; diff --git a/bundles/org.openhab.binding.onebusaway/NOTICE b/bundles/org.openhab.binding.onebusaway/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.onebusaway/NOTICE +++ b/bundles/org.openhab.binding.onebusaway/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.onebusaway/README.md b/bundles/org.openhab.binding.onebusaway/README.md index 5f8905363a2b5..05fc0704b279d 100644 --- a/bundles/org.openhab.binding.onebusaway/README.md +++ b/bundles/org.openhab.binding.onebusaway/README.md @@ -4,8 +4,8 @@ ## Preparation -You'll need to obtain an API key from the transit provider you want to load data from. -Different providers of the service have different policies, so you'll have to figure this part out for each [deployment](https://github.com/OneBusAway/onebusaway/wiki/OneBusAway-Deployments). +You will need to obtain an API key from the transit provider you want to load data from. +Different providers of the service have different policies, so you will have to figure this part out for each [deployment](https://github.com/OneBusAway/onebusaway/wiki/OneBusAway-Deployments). ## Supported Things @@ -45,7 +45,7 @@ The Route Thing supports the following state channels: |------------------|--------------|-----------|----------------------------------------------------------------------------------------------------------| | arrival | state | DateTime | The arrival time of a Route at a Stop. | | departure | state | DateTime | The departure time of a Route at a Stop. | -| update | state | DateTime | The last time this data was updated (per the data provider, not the last time OpenHAB updated the data). | +| update | state | DateTime | The last time this data was updated (per the data provider, not the last time openHAB updated the data). | | arrivalDeparture | trigger | DateTime | Triggered when a Route arrives or departs a Stop. | @@ -55,7 +55,7 @@ The `arrival`, `departure`, and `arrivalDeparture` channels can be configured wi ## Full Example -Here's an example of a configuration for a bus stop in Seattle, WA, USA that has three routes configured. +Here is an example of a configuration for a bus stop in Seattle, WA, USA that has three routes configured. `demo.things`: diff --git a/bundles/org.openhab.binding.onebusaway/pom.xml b/bundles/org.openhab.binding.onebusaway/pom.xml index 8ba482331ea5d..5925d84acf8db 100644 --- a/bundles/org.openhab.binding.onebusaway/pom.xml +++ b/bundles/org.openhab.binding.onebusaway/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.onebusaway</artifactId> diff --git a/bundles/org.openhab.binding.onebusaway/src/main/feature/feature.xml b/bundles/org.openhab.binding.onebusaway/src/main/feature/feature.xml index 90836a2be1e77..42e41222c7d22 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.onebusaway/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.onebusaway-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-onebusaway" description="OneBusAway Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayBindingConstants.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayBindingConstants.java index 02a50f954dd05..bd46e2038ed9c 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayBindingConstants.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayHandlerFactory.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayHandlerFactory.java index a04f9ad07083f..f85f6cc10b313 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayHandlerFactory.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/OneBusAwayHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ApiConfiguration.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ApiConfiguration.java index ab3b7fa4763a3..8022ce31ad028 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ApiConfiguration.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ApiConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ChannelConfig.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ChannelConfig.java index 901bec778c4fd..6d6663b6384bc 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ChannelConfig.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/ChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/RouteConfiguration.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/RouteConfiguration.java index 895bd9219fa14..af606551a2ed8 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/RouteConfiguration.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/RouteConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/StopConfiguration.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/StopConfiguration.java index a675f00c6d241..762a45d51cfb6 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/StopConfiguration.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/config/StopConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ApiHandler.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ApiHandler.java index acca106213551..63ba83acec92d 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ApiHandler.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ApiHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ObaStopArrivalResponse.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ObaStopArrivalResponse.java index e56152f663eda..dc7398935b844 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ObaStopArrivalResponse.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/ObaStopArrivalResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteDataListener.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteDataListener.java index d64848d6eb319..ffd5396aa95e3 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteDataListener.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteDataListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteHandler.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteHandler.java index 7ab8f58265a5a..e461652dea138 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteHandler.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/RouteHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/StopHandler.java b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/StopHandler.java index 27e5f302da3bb..3ecc135b94946 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/StopHandler.java +++ b/bundles/org.openhab.binding.onebusaway/src/main/java/org/openhab/binding/onebusaway/internal/handler/StopHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onebusaway/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.onebusaway/src/main/resources/ESH-INF/thing/channels.xml index ad742635b98c5..2771503a5ab3f 100644 --- a/bundles/org.openhab.binding.onebusaway/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.onebusaway/src/main/resources/ESH-INF/thing/channels.xml @@ -22,7 +22,7 @@ <channel-type id="routeEvent"> <kind>trigger</kind> - <label>Route event</label> + <label>Route Event</label> <description>Route event</description> <event> <options> diff --git a/bundles/org.openhab.binding.onewire/NOTICE b/bundles/org.openhab.binding.onewire/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.onewire/NOTICE +++ b/bundles/org.openhab.binding.onewire/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.onewire/README.md b/bundles/org.openhab.binding.onewire/README.md index ce3e4c80694a5..33f338e6d4574 100644 --- a/bundles/org.openhab.binding.onewire/README.md +++ b/bundles/org.openhab.binding.onewire/README.md @@ -6,7 +6,7 @@ It provides cheap sensors for temperature, humidity, digital I/O and more. ## Getting Started -The OneWire File System (OWFS, http://owfs.org) provides an abstraction layer between the OneWire bus and this binding. +The OneWire File System (OWFS, https://owfs.org) provides an abstraction layer between the OneWire bus and this binding. It is assumed that you already have a working OWFS installation. Besides your sensors, you need a busmaster device (e.g. DS9490R). @@ -206,6 +206,7 @@ Some sensors (e.g. DS18x20) report 85 °C as Power-On-Reset value. In some installations this leads to errorneous temperature readings. If the `ignorepor` parameter is set to `true` 85 °C values will be filtered. The default is `false` as correct reading of 85 °C will otherwise be filtered, too. +Please note that the parameter value must not be set in quotation marks (see example below). A channel of type `temperature-por-res` has one parameter: `resolution`. OneWire temperature sensors are capable of different resolutions: `9`, `10`, `11` and `12` bits. @@ -261,6 +262,7 @@ Bridge onewire:owserver:mybridge [ ] { Channels: Type temperature-por-res : temperature [ + ignorepor=true, resolution="11" ] } @@ -273,6 +275,7 @@ Bridge onewire:owserver:mybridge [ ] { Channels: Type temperature-por-res : temperature [ + ignorepor=false, resolution="9" ] } diff --git a/bundles/org.openhab.binding.onewire/pom.xml b/bundles/org.openhab.binding.onewire/pom.xml index f363e7584c631..fea792e0fb189 100644 --- a/bundles/org.openhab.binding.onewire/pom.xml +++ b/bundles/org.openhab.binding.onewire/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.onewire</artifactId> diff --git a/bundles/org.openhab.binding.onewire/src/main/feature/feature.xml b/bundles/org.openhab.binding.onewire/src/main/feature/feature.xml index 1a771223c5e56..f97b12645140b 100644 --- a/bundles/org.openhab.binding.onewire/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.onewire/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.onewire-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-onewire" description="OneWire Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DS2438Configuration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DS2438Configuration.java index eaa101d7d6909..941d171561505 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DS2438Configuration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DS2438Configuration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoConfig.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoConfig.java index b954fefb31821..dbda56de900d2 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoConfig.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoLogic.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoLogic.java index 888a98e191966..df46b9b9c1606 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoLogic.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoLogic.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoMode.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoMode.java index 86ce6e60d3cc0..307d9bf4d0982 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoMode.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/DigitalIoMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwBindingConstants.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwBindingConstants.java index 7a731df9a320d..c98408b4afcec 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwBindingConstants.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwDynamicStateDescriptionProvider.java index 9e7770ae1dba0..f853a3b877f9f 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwException.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwException.java index 64e530dde7658..f760179112bc7 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwException.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwHandlerFactory.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwHandlerFactory.java index f5ab87f2097ce..4be0b7d013334 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwHandlerFactory.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwPageBuffer.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwPageBuffer.java index 7a2b9eb817220..7bec7ae0e8899 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwPageBuffer.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/OwPageBuffer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/SensorId.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/SensorId.java index 836bce506272b..ec2e39a03cd99 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/SensorId.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/SensorId.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/Util.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/Util.java index ac23cf23ffb49..86a7e36d3f91e 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/Util.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/Util.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/AMSHandlerConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/AMSHandlerConfiguration.java index 8a60facbe2f7a..e91f421475401 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/AMSHandlerConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/AMSHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xAnalogConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xAnalogConfiguration.java index 21829d16ceef6..3a313aa9ea3ed 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xAnalogConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xAnalogConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xHandlerConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xHandlerConfiguration.java index f3e45e8b59e17..63e053cbd5a8b 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xHandlerConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPIOConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPIOConfiguration.java index ad6b792dca8a1..7aef0a5ac5b02 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPIOConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPIOConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPWMConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPWMConfiguration.java index 137fee9867b1a..83615f1eb1200 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPWMConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BAE091xPWMConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BaseHandlerConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BaseHandlerConfiguration.java index 3ec0432f8da9f..5340b59735320 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BaseHandlerConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/BaseHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/MstxHandlerConfiguration.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/MstxHandlerConfiguration.java index d3a13ebd647c7..251d9890982ed 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/MstxHandlerConfiguration.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/config/MstxHandlerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractDigitalOwDevice.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractDigitalOwDevice.java index 7e3d2a3bb40a7..90bbf458c849b 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractDigitalOwDevice.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractDigitalOwDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractOwDevice.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractOwDevice.java index 5afac7316ca22..f8f24c7a13373 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractOwDevice.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/AbstractOwDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/BAE0910.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/BAE0910.java index 1accba637bc24..d9d2221816bf7 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/BAE0910.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/BAE0910.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS18x20.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS18x20.java index 853a26f68a907..582e5ad0da2d4 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS18x20.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS18x20.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS1923.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS1923.java index 3d71b3709ae9f..c89020fd3be1b 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS1923.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS1923.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2401.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2401.java index 801ad52df576f..c0f7ea050f845 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2401.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2401.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2405.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2405.java index de7668a0b8f18..20e376e92ac47 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2405.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2405.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2406_DS2413.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2406_DS2413.java index 3a4aaec7867fd..ea818ddb3d0ab 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2406_DS2413.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2406_DS2413.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2408.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2408.java index 37c9345e4d013..50fb1db8a45da 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2408.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2408.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2423.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2423.java index f1bebc0b5ba82..cf38eb77dafbf 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2423.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2423.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2438.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2438.java index 5a385345fe549..bb2c3d60cc0b6 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2438.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/DS2438.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/EDS006x.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/EDS006x.java index c11fc744438b8..da41e606d03aa 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/EDS006x.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/EDS006x.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwChannelConfig.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwChannelConfig.java index e61f7d30e19e4..db77ae2aa75a5 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwChannelConfig.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwSensorType.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwSensorType.java index bac2c5aa3530b..6a0832ade5599 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwSensorType.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/device/OwSensorType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryItem.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryItem.java index 36ed6e301a9be..356e59819a7a0 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryItem.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryService.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryService.java index c2bb12cefe630..8293ba1d940fa 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryService.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/discovery/OwDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/AdvancedMultisensorThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/AdvancedMultisensorThingHandler.java index 78f464b476e66..d1c0598895d2b 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/AdvancedMultisensorThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/AdvancedMultisensorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BAE091xSensorThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BAE091xSensorThingHandler.java index 9aca52401d0cb..3e696c2a10dc4 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BAE091xSensorThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BAE091xSensorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicMultisensorThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicMultisensorThingHandler.java index a8e39e09ba4b1..c9da53d420244 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicMultisensorThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicMultisensorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicThingHandler.java index 700985c51ae1a..580e6c5516fdb 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/BasicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/EDSSensorThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/EDSSensorThingHandler.java index 121cf0f15d5d0..d868ba7ebd06c 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/EDSSensorThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/EDSSensorThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwBaseThingHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwBaseThingHandler.java index c98e4a6f5b23f..6a098d3f49227 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwBaseThingHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwserverBridgeHandler.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwserverBridgeHandler.java index 97b362eecf4bc..a1da78dc8a3ee 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwserverBridgeHandler.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/handler/OwserverBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwfsDirectChannelConfig.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwfsDirectChannelConfig.java index ecf5f84d0fc7f..7bade40d7b8ad 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwfsDirectChannelConfig.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwfsDirectChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnection.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnection.java index 102c6b303cb3f..a6ccecc547448 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnection.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnectionState.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnectionState.java index 8370232ab45da..6dcce21e81f06 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnectionState.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverConnectionState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverControlFlag.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverControlFlag.java index 807295b596803..0048e43c9703e 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverControlFlag.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverControlFlag.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverDeviceParameter.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverDeviceParameter.java index 4b8477542f3be..f74ffed7ba936 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverDeviceParameter.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverDeviceParameter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverMessageType.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverMessageType.java index d5313db0c2965..9cb0a82a40e65 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverMessageType.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverMessageType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacket.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacket.java index 18f5273b642ba..128b357bc2c30 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacket.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacketType.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacketType.java index 4def66bb0e385..991a68e6b9d3d 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacketType.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPacketType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPressureScale.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPressureScale.java index d2a79c9212bc1..8b6f1c50d7073 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPressureScale.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverPressureScale.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverTemperatureScale.java b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverTemperatureScale.java index 1108e4e9ecea5..93c528cc0b885 100644 --- a/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverTemperatureScale.java +++ b/bundles/org.openhab.binding.onewire/src/main/java/org/openhab/binding/onewire/internal/owserver/OwserverTemperatureScale.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/binding/binding.xml index a0a01dbf508ae..7f2f0bdf31b5a 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/binding/binding.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="onewire" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> +<binding:binding id="onewire" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>OneWire Binding</name> <description>This is the binding for OneWire.</description> <author>Jan N. Klug</author> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/config/config.xml index a5ae319c62a7a..5d962802c3ad7 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/config/config.xml @@ -31,32 +31,32 @@ <required>false</required> </parameter> </config-description> - <config-description uri="thing-type:onewire:mstxconfig"> - <parameter name="id" type="text"> - <label>Sensor ID</label> - <description>Sensor ID in format: xx.xxxxxxxxxxxx or a full path including hubs/branches</description> - <required>true</required> - </parameter> - <parameter name="refresh" type="integer" min="1"> - <label>Refresh Time</label> - <description>Time in seconds after which the thing is refreshed</description> - <default>300</default> - <unitLabel>s</unitLabel> - <required>false</required> - </parameter> - <parameter name="manualsensor" type="text"> - <label>Manual Sensor Type</label> - <description>Overrides detected sensor type</description> - <options> - <option value="DS2438">Generic</option> - <option value="MS_TH">MS-TH</option> - <option value="MS_TV">MS-TV</option> - <option value="MS_TL">MS-TL</option> - <option value="MS_TC">MS-TC</option> - </options> - <limitToOptions>true</limitToOptions> - <required>false</required> - <advanced>true</advanced> - </parameter> - </config-description> + <config-description uri="thing-type:onewire:mstxconfig"> + <parameter name="id" type="text"> + <label>Sensor ID</label> + <description>Sensor ID in format: xx.xxxxxxxxxxxx or a full path including hubs/branches</description> + <required>true</required> + </parameter> + <parameter name="refresh" type="integer" min="1"> + <label>Refresh Time</label> + <description>Time in seconds after which the thing is refreshed</description> + <default>300</default> + <unitLabel>s</unitLabel> + <required>false</required> + </parameter> + <parameter name="manualsensor" type="text"> + <label>Manual Sensor Type</label> + <description>Overrides detected sensor type</description> + <options> + <option value="DS2438">Generic</option> + <option value="MS_TH">MS-TH</option> + <option value="MS_TV">MS-TV</option> + <option value="MS_TL">MS-TL</option> + <option value="MS_TC">MS-TC</option> + </options> + <limitToOptions>true</limitToOptions> + <required>false</required> + <advanced>true</advanced> + </parameter> + </config-description> </config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/bae09x.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/bae09x.xml index 25e075bb27b62..3f226e91f0238 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/bae09x.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/bae09x.xml @@ -100,7 +100,7 @@ <limitToOptions>true</limitToOptions> </parameter> <parameter name="reversePolarity" type="boolean"> - <label>Reverse polarity</label> + <label>Reverse Polarity</label> <default>false</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/basic.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/basic.xml index 49b6ff6816a6e..64dc53527e972 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/basic.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/basic.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="owserver" /> </supported-bridge-type-refs> - <label>Basic 1 wire sensor</label> + <label>Basic 1 Wire Sensor</label> <config-description-ref uri="thing-type:onewire:basethingconfig" /> </thing-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/common.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/common.xml index 24a4e6a0a3a82..b33ed778769c6 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/common.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/common.xml @@ -1,5 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="onewire" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> +<thing:thing-descriptions bindingId="onewire" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Device Present Channel --> <channel-type id="present"> <item-type>Switch</item-type> @@ -41,7 +44,7 @@ <required>false</required> </parameter> <parameter name="resolution" type="text"> - <label>Sensor resolution</label> + <label>Sensor Resolution</label> <options> <option value="9">9 bit</option> <option value="10">10 bit</option> @@ -138,7 +141,7 @@ <limitToOptions>true</limitToOptions> </parameter> <parameter name="logic" type="text"> - <label>Channel logic</label> + <label>Channel Logic</label> <options> <option value="normal">normal</option> <option value="inverted">inverted</option> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/deprecated.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/deprecated.xml index 77a368e22f54c..7ace858fc4c5a 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/deprecated.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/deprecated.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="owserver" /> </supported-bridge-type-refs> - <label>Counter sensor</label> + <label>Counter Sensor</label> <description>A 1-wire Dual Counter (DS2423)</description> <config-description-ref uri="thing-type:onewire:fastthingconfig" /> </thing-type> @@ -23,7 +23,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="owserver" /> </supported-bridge-type-refs> - <label>Temperature sensor</label> + <label>Temperature Sensor</label> <description>A 1-wire temperature sensor (DS18x20)</description> <config-description-ref uri="thing-type:onewire:basethingconfig" /> </thing-type> @@ -47,27 +47,27 @@ <config-description-ref uri="thing-type:onewire:basethingconfig" /> </thing-type> <thing-type id="digitalio" listed="false"> - <supported-bridge-type-refs> - <bridge-type-ref id="owserver" /> - </supported-bridge-type-refs> - <label>Digital I/O</label> - <description>Digital I/O device (DS2405: single, DS2406/DS2413: dual, DS2408: octal)</description> - <config-description-ref uri="thing-type:onewire:fastthingconfig" /> - </thing-type> + <supported-bridge-type-refs> + <bridge-type-ref id="owserver" /> + </supported-bridge-type-refs> + <label>Digital I/O</label> + <description>Digital I/O device (DS2405: single, DS2406/DS2413: dual, DS2408: octal)</description> + <config-description-ref uri="thing-type:onewire:fastthingconfig" /> + </thing-type> <thing-type id="digitalio2" listed="false"> - <supported-bridge-type-refs> - <bridge-type-ref id="owserver" /> - </supported-bridge-type-refs> - <label>Dual Digital I/O</label> - <description>A dual digital I/O device (DS2406, DS2413)</description> - <config-description-ref uri="thing-type:onewire:fastthingconfig" /> - </thing-type> - <thing-type id="digitalio8" listed="false"> - <supported-bridge-type-refs> - <bridge-type-ref id="owserver" /> - </supported-bridge-type-refs> - <label>Octal Digital I/O</label> - <description>A octal digital I/O device (DS2408)</description> - <config-description-ref uri="thing-type:onewire:fastthingconfig" /> - </thing-type> + <supported-bridge-type-refs> + <bridge-type-ref id="owserver" /> + </supported-bridge-type-refs> + <label>Dual Digital I/O</label> + <description>A dual digital I/O device (DS2406, DS2413)</description> + <config-description-ref uri="thing-type:onewire:fastthingconfig" /> + </thing-type> + <thing-type id="digitalio8" listed="false"> + <supported-bridge-type-refs> + <bridge-type-ref id="owserver" /> + </supported-bridge-type-refs> + <label>Octal Digital I/O</label> + <description>A octal digital I/O device (DS2408)</description> + <config-description-ref uri="thing-type:onewire:fastthingconfig" /> + </thing-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/multisensor.xml b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/multisensor.xml index 00018ee7d90e3..7ca785683b996 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/multisensor.xml +++ b/bundles/org.openhab.binding.onewire/src/main/resources/ESH-INF/thing/multisensor.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="owserver" /> </supported-bridge-type-refs> - <label>Multisensor (T, TC, TH, TL, TV, generic)</label> + <label>Multisensor (T, TC, TH, TL, TV, Generic)</label> <description>A 1-wire multisensor (DS1923/DS2438-based)</description> <config-description-ref uri="thing-type:onewire:mstxconfig" /> </thing-type> @@ -19,7 +19,7 @@ <description>1-wire multisensor (DS2438-based)</description> <config-description> <parameter name="id" type="text"> - <label>TH(S) sensor ID</label> + <label>TH(S) Sensor ID</label> <description>Sensor ID of the DS2438 sensor in format: xx.xxxxxxxxxxxx or a full path including hubs/branches</description> <required>true</required> </parameter> @@ -50,19 +50,19 @@ <description>1-wire multisensor (DS2438-based)</description> <config-description> <parameter name="id" type="text"> - <label>TH(S) sensor ID</label> + <label>TH(S) Sensor ID</label> <description>Sensor ID of the DS2438 sensor in format: xx.xxxxxxxxxxxx or a full path including hubs/branches</description> <required>true</required> </parameter> <parameter name="refresh" type="integer" min="1"> - <label>Refresh Time for analog channels</label> + <label>Refresh Time for Analog Channels</label> <description>Time in seconds after which the thing is refreshed</description> <default>300</default> <unitLabel>s</unitLabel> <required>false</required> </parameter> <parameter name="refreshdigital" type="integer" min="1"> - <label>Refresh Time for digital channels</label> + <label>Refresh Time for Digital Channels</label> <description>Time in seconds after which the digital I/Os are refreshed</description> <default>10</default> <unitLabel>s</unitLabel> diff --git a/bundles/org.openhab.binding.onewire/src/main/resources/sensor.properties b/bundles/org.openhab.binding.onewire/src/main/resources/sensor.properties index bc60abd5e3059..a590c9c774dc1 100644 --- a/bundles/org.openhab.binding.onewire/src/main/resources/sensor.properties +++ b/bundles/org.openhab.binding.onewire/src/main/resources/sensor.properties @@ -86,4 +86,4 @@ EDS0068.thingtype = edsenv # BAE091x BAE0910.channels = BAE0910.label = Multisensor BAE0910 -BAE0910.thingtype = bae091x \ No newline at end of file +BAE0910.thingtype = bae091x diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/CompletenessTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/CompletenessTest.java index 5ac7d3caf0599..993b12491ef1f 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/CompletenessTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/CompletenessTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/OwserverDeviceParameterTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/OwserverDeviceParameterTest.java index e6960bb57f788..869b1f51f021b 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/OwserverDeviceParameterTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/OwserverDeviceParameterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/SensorIdTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/SensorIdTest.java index 47be8452e36bb..f70f66bdfb8fc 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/SensorIdTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/SensorIdTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/UtilTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/UtilTest.java index d7ecd26a254bc..eebbc98407876 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/UtilTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/UtilTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/BAE0910Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/BAE0910Test.java index 2f3b2ead290c0..8224cec419806 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/BAE0910Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/BAE0910Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS18x20Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS18x20Test.java index fb70df146e396..bb453d399f5f0 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS18x20Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS18x20Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS1923Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS1923Test.java index 2e811361ab71b..0fce6a7341b91 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS1923Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS1923Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2401Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2401Test.java index 13a1c65a419a9..983fa55d21c8e 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2401Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2401Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2405Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2405Test.java index 2f7092e8fa5d6..4daafb63c6343 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2405Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2405Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2406_DS2413Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2406_DS2413Test.java index 3cff5824149cc..3ce431574e4f3 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2406_DS2413Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2406_DS2413Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2408Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2408Test.java index 9ea3d36305aee..39cfea1224f5a 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2408Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2408Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2423Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2423Test.java index 9de4f533d2892..09f63eef4e82e 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2423Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2423Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2438Test.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2438Test.java index f8d4519ca9b7c..9dcd5b0c2a62d 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2438Test.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DS2438Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DeviceTestParent.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DeviceTestParent.java index a8d204c7cd4c2..f4164c5f8cf0f 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DeviceTestParent.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/DeviceTestParent.java @@ -1,6 +1,5 @@ -package org.openhab.binding.onewire.device; /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -11,6 +10,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ +package org.openhab.binding.onewire.device; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/EDS006xTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/EDS006xTest.java index 74fc2eb68fee5..2b2082809328c 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/EDS006xTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/device/EDS006xTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/BasicThingHandlerTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/BasicThingHandlerTest.java index c24f6f867fc08..ebb78dbc9d5e0 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/BasicThingHandlerTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/BasicThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/EDSSensorThingHandlerTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/EDSSensorThingHandlerTest.java index 2ac8b872c23ee..a69e2baef92ab 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/EDSSensorThingHandlerTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/EDSSensorThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/MultisensorThingHandlerTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/MultisensorThingHandlerTest.java index d0348515dfd8a..73b66e92cf2cd 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/MultisensorThingHandlerTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/MultisensorThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/OwserverBridgeHandlerTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/OwserverBridgeHandlerTest.java index 2e76fe813c6d5..33e9c0af9f492 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/OwserverBridgeHandlerTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/internal/OwserverBridgeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/owserver/OwserverConnectionTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/owserver/OwserverConnectionTest.java index d350541d28e46..6e855682bb057 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/owserver/OwserverConnectionTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/owserver/OwserverConnectionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/AbstractThingHandlerTest.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/AbstractThingHandlerTest.java index da4c8d7745da1..bb3262bc83858 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/AbstractThingHandlerTest.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/AbstractThingHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/OwserverTestServer.java b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/OwserverTestServer.java index 09e41868758ac..1226ebc912ec2 100644 --- a/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/OwserverTestServer.java +++ b/bundles/org.openhab.binding.onewire/src/test/java/org/openhab/binding/onewire/test/OwserverTestServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewiregpio/NOTICE b/bundles/org.openhab.binding.onewiregpio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.onewiregpio/NOTICE +++ b/bundles/org.openhab.binding.onewiregpio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.onewiregpio/README.md b/bundles/org.openhab.binding.onewiregpio/README.md index d4183c1266195..c76882f122905 100644 --- a/bundles/org.openhab.binding.onewiregpio/README.md +++ b/bundles/org.openhab.binding.onewiregpio/README.md @@ -1,17 +1,17 @@ # OneWire GPIO Binding -This binding reads temperature values from OneWire bus sensors connected to the GPIO bus on Raspberry PI. +This binding reads temperature values from OneWire bus sensors connected to the GPIO bus on Raspberry Pi. ## Supported Things Temperature sensors. -Tested successfully with DS18B20 sensor on Raspberry PI 3. +Tested successfully with DS18B20 sensor on Raspberry Pi 3. ## Binding Configuration -The binding requires OneWire sensor to be properly connected to Raspberry PI GPIO bus, +The binding requires OneWire sensor to be properly connected to Raspberry Pi GPIO bus, "w1_gpio" and "wire" kernel modules should be loaded. Configuration is proper when /sys/bus/w1/devices folder is present, and contains sensor's data. diff --git a/bundles/org.openhab.binding.onewiregpio/pom.xml b/bundles/org.openhab.binding.onewiregpio/pom.xml index 5c877275bd140..c487928320989 100644 --- a/bundles/org.openhab.binding.onewiregpio/pom.xml +++ b/bundles/org.openhab.binding.onewiregpio/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.onewiregpio</artifactId> diff --git a/bundles/org.openhab.binding.onewiregpio/src/main/feature/feature.xml b/bundles/org.openhab.binding.onewiregpio/src/main/feature/feature.xml index 7eb201bdf8d3d..72bbd6c917d32 100644 --- a/bundles/org.openhab.binding.onewiregpio/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.onewiregpio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.onewiregpio-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-onewiregpio" description="OneWireGPIO Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOBindingConstants.java b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOBindingConstants.java index 06907a253f0ad..e7d957ca791cf 100644 --- a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOBindingConstants.java +++ b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOHandlerFactory.java b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOHandlerFactory.java index fe6733aa6158c..9bb38512a1336 100644 --- a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOHandlerFactory.java +++ b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/OneWireGPIOHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/handler/OneWireGPIOHandler.java b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/handler/OneWireGPIOHandler.java index e86c447d2e113..56e48d66e1816 100644 --- a/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/handler/OneWireGPIOHandler.java +++ b/bundles/org.openhab.binding.onewiregpio/src/main/java/org/openhab/binding/onewiregpio/internal/handler/OneWireGPIOHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onewiregpio/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.onewiregpio/src/main/resources/ESH-INF/thing/thing-types.xml index 309daea5cba59..6a24036414475 100644 --- a/bundles/org.openhab.binding.onewiregpio/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.onewiregpio/src/main/resources/ESH-INF/thing/thing-types.xml @@ -12,12 +12,12 @@ </channels> <config-description> <parameter name="gpio_bus_file" type="text" required="true"> - <label>Device path</label> + <label>Device Path</label> <description>device id in format: /sys/bus/w1/devices/DEVICE_ID_TO_SET/w1_slave</description> </parameter> <parameter name="refresh_time" type="integer"> - <label>Refresh time interval</label> + <label>Refresh Time Interval</label> <description>Refresh time interval in seconds.</description> <default>600</default> </parameter> diff --git a/bundles/org.openhab.binding.onkyo/NOTICE b/bundles/org.openhab.binding.onkyo/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.onkyo/NOTICE +++ b/bundles/org.openhab.binding.onkyo/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.onkyo/README.md b/bundles/org.openhab.binding.onkyo/README.md index e9d409d85b4cb..b8c4fb97cb4d6 100644 --- a/bundles/org.openhab.binding.onkyo/README.md +++ b/bundles/org.openhab.binding.onkyo/README.md @@ -65,7 +65,7 @@ The binding has the following configuration options, which can be set for "bindi When an Onkyo receiver is used as an audio sink, the receiver connects to openHAB to get the audio stream. By default, the binding sends the URL for getting the audio stream based on the Primary Address (Network Settings configuration) and the openHAB HTTP port. -Sometimes it's necessary to use the Callback URL to override the default, such as when using a reverse proxy or with some docker implementations. +Sometimes it is necessary to use the Callback URL to override the default, such as when using a reverse proxy or with some Docker implementations. ## Thing Configuration diff --git a/bundles/org.openhab.binding.onkyo/pom.xml b/bundles/org.openhab.binding.onkyo/pom.xml index 3cc4aef300aba..dd569afc94f00 100644 --- a/bundles/org.openhab.binding.onkyo/pom.xml +++ b/bundles/org.openhab.binding.onkyo/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.onkyo</artifactId> diff --git a/bundles/org.openhab.binding.onkyo/src/main/feature/feature.xml b/bundles/org.openhab.binding.onkyo/src/main/feature/feature.xml index 82f37bfe36a87..3d6bda88646f1 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.onkyo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.onkyo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-onkyo" description="Onkyo Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoAlbumArt.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoAlbumArt.java index b4b1d355acd6a..c0c3f34f25180 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoAlbumArt.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoAlbumArt.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBindingConstants.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBindingConstants.java index e736ea2d83bb5..34a9620ded499 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBindingConstants.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoConnection.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoConnection.java index 784b1d33bfe24..6b30005160986 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoConnection.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoEventListener.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoEventListener.java index 4f503b68f36d5..61351ad1d328a 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoEventListener.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoHandlerFactory.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoHandlerFactory.java index 991906b4c2746..e9985184ac10a 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoHandlerFactory.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoStateDescriptionProvider.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoStateDescriptionProvider.java index 5ac4661d868c4..07330cc96de04 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/OnkyoStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/ServiceType.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/ServiceType.java index e62e7d31293e2..4806b1e532eba 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/ServiceType.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/ServiceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/automation/modules/OnkyoThingActionsService.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/automation/modules/OnkyoThingActionsService.java index 235a8d5d1fc7e..a1a78a9dbc3e1 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/automation/modules/OnkyoThingActionsService.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/automation/modules/OnkyoThingActionsService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/config/OnkyoDeviceConfiguration.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/config/OnkyoDeviceConfiguration.java index b8dde7993f17b..e9eb6e21ead43 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/config/OnkyoDeviceConfiguration.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/config/OnkyoDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/discovery/OnkyoUpnpDiscoveryParticipant.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/discovery/OnkyoUpnpDiscoveryParticipant.java index 08c998869fcb6..5b4106aed6515 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/discovery/OnkyoUpnpDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/discovery/OnkyoUpnpDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpCommand.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpCommand.java index c861e4f5a8914..f7c5705501a9a 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpCommand.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpException.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpException.java index 07db284e8299b..3ca9b6f3e7aed 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpException.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpMessage.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpMessage.java index e6c01f1d77416..2f4bcbd730a46 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpMessage.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpProtocol.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpProtocol.java index da2ccd32890c3..e09fba8acbffa 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpProtocol.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/eiscp/EiscpProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/OnkyoHandler.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/OnkyoHandler.java index fd79e7a8d8410..f908625b627bd 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/OnkyoHandler.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/OnkyoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/UpnpAudioSinkHandler.java b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/UpnpAudioSinkHandler.java index 8f5998b0e034d..044af0ffd2d2c 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/UpnpAudioSinkHandler.java +++ b/bundles/org.openhab.binding.onkyo/src/main/java/org/openhab/binding/onkyo/internal/handler/UpnpAudioSinkHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.audio.AudioFormat; import org.eclipse.smarthome.core.audio.AudioHTTPServer; import org.eclipse.smarthome.core.audio.AudioSink; @@ -169,8 +170,13 @@ public String getLabel(Locale locale) { } @Override - public void process(AudioStream audioStream) + public void process(@Nullable AudioStream audioStream) throws UnsupportedAudioFormatException, UnsupportedAudioStreamException { + if (audioStream == null) { + stop(); + return; + } + String url = null; if (audioStream instanceof URLAudioStream) { // it is an external URL, the speaker can access it itself and play it. @@ -191,6 +197,7 @@ public void process(AudioStream audioStream) return; } } + playMedia(url); } diff --git a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/config/config.xml index d5607dd7c66ee..45efc073ed5b6 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/config/config.xml @@ -11,7 +11,7 @@ <description>The IP or host name of the Onkyo Receiver</description> <context>network-address</context> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>Port</label> <description>Port of the Onkyo to control</description> <default>60128</default> diff --git a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channel-groups.xml b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channel-groups.xml index 86c7822b3ac5c..e9a5e55597852 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channel-groups.xml +++ b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channel-groups.xml @@ -56,43 +56,43 @@ <channel id="title" typeId="title" /> <channel id="control" typeId="netControl" /> <channel id="item0" typeId="menuItem"> - <label>Menu item 0</label> + <label>Menu Item 0</label> <description>Net/USB menu item at position 0</description> </channel> <channel id="item1" typeId="menuItem"> - <label>Menu item 1</label> + <label>Menu Item 1</label> <description>Net/USB menu item at position 1</description> </channel> <channel id="item2" typeId="menuItem"> - <label>Menu item 2</label> + <label>Menu Item 2</label> <description>Net/USB menu item at position 2</description> </channel> <channel id="item3" typeId="menuItem"> - <label>Menu item 3</label> + <label>Menu Item 3</label> <description>Net/USB menu item at position 3</description> </channel> <channel id="item4" typeId="menuItem"> - <label>Menu item 4</label> + <label>Menu Item 4</label> <description>Net/USB menu item at position 4</description> </channel> <channel id="item5" typeId="menuItem"> - <label>Menu item 5</label> + <label>Menu Item 5</label> <description>Net/USB menu item at position 5</description> </channel> <channel id="item6" typeId="menuItem"> - <label>Menu item 6</label> + <label>Menu Item 6</label> <description>Net/USB menu item at position 6</description> </channel> <channel id="item7" typeId="menuItem"> - <label>Menu item 7</label> + <label>Menu Item 7</label> <description>Net/USB menu item at position 7</description> </channel> <channel id="item8" typeId="menuItem"> - <label>Menu item 8</label> + <label>Menu Item 8</label> <description>Net/USB menu item at position 8</description> </channel> <channel id="item9" typeId="menuItem"> - <label>Menu item 9</label> + <label>Menu Item 9</label> <description>Net/USB menu item at position 9</description> </channel> <channel id="selection" typeId="menuSelection" /> diff --git a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channels.xml index 6c282ce97894a..49a3f8e457235 100644 --- a/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.onkyo/src/main/resources/ESH-INF/thing/channels.xml @@ -173,7 +173,7 @@ </channel-type> <channel-type id="menuItem" advanced="true"> <item-type>String</item-type> - <label>Menu item</label> + <label>Menu Item</label> <description>Net/USB menu item</description> <state readOnly="true" pattern="%s"></state> </channel-type> diff --git a/bundles/org.openhab.binding.opengarage/NOTICE b/bundles/org.openhab.binding.opengarage/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.opengarage/NOTICE +++ b/bundles/org.openhab.binding.opengarage/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.opengarage/README.md b/bundles/org.openhab.binding.opengarage/README.md index 3de8dad9f6868..84920579fb349 100644 --- a/bundles/org.openhab.binding.opengarage/README.md +++ b/bundles/org.openhab.binding.opengarage/README.md @@ -34,15 +34,15 @@ As a minimum, the IP address is needed: opengarage.things: ``` -opengarage:opengarage:garage [ host="192.168.0.5" ] +opengarage:opengarage:OpenGarage [ host="192.168.0.5" ] ``` opengarage.items: ``` -Switch OpenGarage_Status { channel="opengarage:opengarage:garage:status" } -Number:Distance OpenGarage_Distance { channel="opengarage:opengarage:garage:setpoint" } -String OpenGarage_Vehicle { channel="opengarage:opengarage:garage:vehicle" } +Switch OpenGarage_Status { channel="opengarage:opengarage:OpenGarage:status" } +Number:Length OpenGarage_Distance { channel="opengarage:opengarage:OpenGarage:setpoint" } +String OpenGarage_Vehicle { channel="opengarage:opengarage:OpenGarage:vehicle" } ``` opengarage.sitemap: @@ -52,7 +52,7 @@ Switch item=OpenGarage_Status icon="garagedoorclosed" mappings=[ON=Open] visibi Switch item=OpenGarage_Status icon="garagedooropen" mappings=[OFF=Close] visibility=[OpenGarage_Status == OPEN] Switch item=OpenGarage_Status icon="garage" Text item=OpenGarage_Distance label="OG distance" -String item=OpenGarage_Vehicle label=Vehicle Presence" +Text item=OpenGarage_Vehicle label="Vehicle Presence" ``` diff --git a/bundles/org.openhab.binding.opengarage/pom.xml b/bundles/org.openhab.binding.opengarage/pom.xml index caad52dfbc7f5..79fcc2ea5476b 100644 --- a/bundles/org.openhab.binding.opengarage/pom.xml +++ b/bundles/org.openhab.binding.opengarage/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.opengarage</artifactId> diff --git a/bundles/org.openhab.binding.opengarage/src/main/feature/feature.xml b/bundles/org.openhab.binding.opengarage/src/main/feature/feature.xml index c2eef55851020..d9c8efe80bae3 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.opengarage/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.opengarage-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-opengarage" description="OpenGarage Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageBindingConstants.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageBindingConstants.java index 32c51327c50bf..af9bd360a1fbd 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageBindingConstants.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageCommunicationException.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageCommunicationException.java index 63a36f2dcc7a7..da1283c22d4b4 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageCommunicationException.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageConfiguration.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageConfiguration.java index 058ee1726dfb0..fe4524d272f04 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageConfiguration.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandler.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandler.java index 8eeb0d232d8c6..5ebbe453687c9 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandler.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandlerFactory.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandlerFactory.java index 45528cb78f3ab..0967a59ce51c0 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandlerFactory.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageWebTargets.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageWebTargets.java index 0086d89370e4e..2c5dcf744c4a9 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageWebTargets.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/OpenGarageWebTargets.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/api/ControllerVariables.java b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/api/ControllerVariables.java index 7205c2233eb51..1f14dc4f839fd 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/api/ControllerVariables.java +++ b/bundles/org.openhab.binding.opengarage/src/main/java/org/openhab/binding/opengarage/internal/api/ControllerVariables.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opengarage/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.opengarage/src/main/resources/ESH-INF/thing/thing-types.xml index d67a2ba8ace3d..5708076ea9d54 100644 --- a/bundles/org.openhab.binding.opengarage/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.opengarage/src/main/resources/ESH-INF/thing/thing-types.xml @@ -19,18 +19,21 @@ <label>Hostname/IP Address</label> <description>The host name or IP address of the OpenGarage Web API interface.</description> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>Port</label> <description>Port of the OpenGarage Web API interface.</description> + <default>80</default> </parameter> <parameter name="password" type="text"> <label>Password</label> <description>The admin password used to access the Web API interface.</description> <context>password</context> + <default>opendoor</default> </parameter> <parameter name="refresh" type="integer"> <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds.</description> + <default>60</default> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.opensprinkler/NOTICE b/bundles/org.openhab.binding.opensprinkler/NOTICE index 391a0aecff77c..d12cc88ee35bf 100644 --- a/bundles/org.openhab.binding.opensprinkler/NOTICE +++ b/bundles/org.openhab.binding.opensprinkler/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.opensprinkler/README.md b/bundles/org.openhab.binding.opensprinkler/README.md index a4f044860a9bf..d21a3e8b45d9f 100644 --- a/bundles/org.openhab.binding.opensprinkler/README.md +++ b/bundles/org.openhab.binding.opensprinkler/README.md @@ -1,12 +1,11 @@ # OpenSprinkler Binding -This binding allows allows basic control of the OpenSprinkler and OpenSprinkler PI (Plus) devices. +This binding allows allows basic control of the OpenSprinkler devices. Stations can be controlled to be turned on or off and rain sensor state can be read. ## Supported Bridges * HTTP (`http`) - The http bridge allows to communicate with an OpenSprinkler device through the network -* Pi (`pi`) - With the pi bridge, openHAB can communicate with an OpenSprinkler device which is installed on the same Pi as the openHAB system. ## Supported Things @@ -32,33 +31,35 @@ Bridge opensprinkler:http:http [hostname="127.0.0.1", port=80, pasword="opendoor - port: Port the OpenSprinkler device is listening on. Usually 80. - password: Admin password of the API. Factory default is: opendoor - refresh: Number of seconds in between refreshing the Thing state with the API. -- stationIndex: The index of the station to communicate with, starting with 0 for the first station - basicUsername: (optional) Only needed when the OpenSprinkler device is behind a basic auth enforcing reverse proxy. - basicPassword: (optional) Only needed when the OpenSprinkler device is behind a basic auth enforcing reverse proxy. -OpenSprinkler using the Pi interface +### Station Thing Configuration -``` -Bridge opensprinkler:http:http [stations=8, refresh=60] { - Thing station 01 [stationIndex=1] -} -``` +The `station` thing can be used with both bridge and has the following configuration properties: -- stations: Number of stations to control. -- refresh: Number of seconds in between refreshing the Thing state with the API. +- stationIndex: The index of the station to communicate with, starting with 0 for the first station ## Channels -The following channel is supported by the station thing. - -| Channel Type ID | Item Type | | Description | -|--------------------|-------------|----|---------------------------------------------------------| -| stationState | Switch | RW | This channel indicates whether station 01 is on or off. | -| remainingWaterTime | Number:Time | R | The time the station remains to be open. | +The following channel is supported by the `station` thing. +| Channel Type ID | Item Type | | Description | +|--------------------|-------------|----|----------------------------------------------------------| +| stationState | Switch | RW | This channel indicates whether station 01 is on or off. | +| remainingWaterTime | Number:Time | R | The time the station remains to be open. | +| nextDuration | Number:Time | RW | A configuration item, which time, if linked, will be | +| | | | used as the time the station will be kept open when | +| | | | switched on. It is advised to add persistence for items | +| | | | linked to this channel, the binding does not persist | +| | | | values of it. | +| queued | Switch | RW | Indicates that the station is queued to be turned on. | +| | | | The channel cannot be turned on, only turning it off is | +| | | | supported (which removes the station from the queue). | +When using the `nextDuration` channel, it is advised to setup persistence (e.g. MapDB) in order to persist the value through restarts. -The following is supported by the device thing, but only when connected using the http interface. +The following is supported by the `device` thing, but only when connected using the http interface. | Channel Type ID | Item Type | | Description | |-----------------|-----------|----|-----------------------------------------------------------------------| @@ -88,6 +89,7 @@ Switch Station01 (stations) { channel="opensprinkler:station:http:01:stationStat Number:Time Station01RaminingTime { channel="opensprinkler:station:http:01:remainingWaterTime" } Switch Station02 (stations) { channel="opensprinkler:station:http:02:stationState" } Switch Station03 (stations) { channel="opensprinkler:station:http:03:stationState" } +Number:Time Station03NextDuration { channel="opensprinkler:station:http:03:nextDuration" } Switch Station04 (stations) { channel="opensprinkler:station:http:04:stationState" } Switch Station05 (stations) { channel="opensprinkler:station:http:05:stationState" } Switch Station06 (stations) { channel="opensprinkler:station:http:06:stationState" } @@ -102,6 +104,7 @@ sitemap demo label="Main Menu" { Frame { Switch item=Station01 + Selection item=Station03NextDuration mappings=[300="5 min", 600="10 min"] } } ``` diff --git a/bundles/org.openhab.binding.opensprinkler/pom.xml b/bundles/org.openhab.binding.opensprinkler/pom.xml index 897af66fbb8bf..634f0eb50e3b9 100644 --- a/bundles/org.openhab.binding.opensprinkler/pom.xml +++ b/bundles/org.openhab.binding.opensprinkler/pom.xml @@ -1,25 +1,14 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.opensprinkler</artifactId> <name>openHAB Add-ons :: Bundles :: OpenSprinkler Binding</name> - - <dependencies> - <dependency> - <groupId>com.pi4j</groupId> - <artifactId>pi4j-core</artifactId> - <version>1.2</version> - <scope>provided</scope> - </dependency> - </dependencies> - </project> diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/feature/feature.xml b/bundles/org.openhab.binding.opensprinkler/src/main/feature/feature.xml index e1fe7ee61babb..fd736489ed72a 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.opensprinkler/src/main/feature/feature.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.opensprinkler-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-opensprinkler" description="OpenSprinkler Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:com.pi4j/pi4j-core/1.2</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.opensprinkler/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerBindingConstants.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerBindingConstants.java index ec99a40363801..51296d6d9308a 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerBindingConstants.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,7 +36,6 @@ public class OpenSprinklerBindingConstants { public static final ThingTypeUID OPENSPRINKLER_HTTP_BRIDGE = new ThingTypeUID(BINDING_ID, HTTP_BRIDGE); public static final ThingTypeUID OPENSPRINKLER_STATION = new ThingTypeUID(BINDING_ID, STATION_THING); public static final ThingTypeUID OPENSPRINKLER_DEVICE = new ThingTypeUID(BINDING_ID, DEVICE_THING); - public static final ThingTypeUID OPENSPRINKLER_PI_BRIDGE = new ThingTypeUID(BINDING_ID, PI_BRIDGE); public static final int DEFAULT_WAIT_BEFORE_INITIAL_REFRESH = 30; public static final int DEFAULT_REFRESH_RATE = 60; @@ -49,5 +48,7 @@ public class OpenSprinklerBindingConstants { // List of all Channel ids public static final String SENSOR_RAIN = "rainsensor"; public static final String STATION_STATE = "stationState"; + public static final String STATION_QUEUED = "queued"; public static final String REMAINING_WATER_TIME = "remainingWaterTime"; + public static final String NEXT_DURATION = "nextDuration"; } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerHandlerFactory.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerHandlerFactory.java index 85e97b89b605a..1e984c2f54e9e 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerHandlerFactory.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,7 +27,6 @@ import org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiFactory; import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerDeviceHandler; import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerHttpBridgeHandler; -import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerPiBridgeHandler; import org.openhab.binding.opensprinkler.internal.handler.OpenSprinklerStationHandler; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; @@ -42,8 +41,8 @@ */ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.opensprinkler") public class OpenSprinklerHandlerFactory extends BaseThingHandlerFactory { - private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(Arrays - .asList(OPENSPRINKLER_HTTP_BRIDGE, OPENSPRINKLER_PI_BRIDGE, OPENSPRINKLER_STATION, OPENSPRINKLER_DEVICE)); + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>( + Arrays.asList(OPENSPRINKLER_HTTP_BRIDGE, OPENSPRINKLER_STATION, OPENSPRINKLER_DEVICE)); private OpenSprinklerApiFactory apiFactory; @Activate @@ -64,8 +63,6 @@ protected ThingHandler createHandler(Thing thing) { return new OpenSprinklerHttpBridgeHandler((Bridge) thing, this.apiFactory); } else if (thingTypeUID.equals(OPENSPRINKLER_STATION)) { return new OpenSprinklerStationHandler(thing); - } else if (thingTypeUID.equals(OPENSPRINKLER_PI_BRIDGE)) { - return new OpenSprinklerPiBridgeHandler((Bridge) thing, this.apiFactory); } else if (thingTypeUID.equals(OPENSPRINKLER_DEVICE)) { return new OpenSprinklerDeviceHandler(thing); } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApi.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApi.java index b3b5aada32083..1ecaa0bb85319 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApi.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,8 @@ */ package org.openhab.binding.opensprinkler.internal.api; +import java.math.BigDecimal; + import org.openhab.binding.opensprinkler.internal.api.exception.CommunicationApiException; import org.openhab.binding.opensprinkler.internal.api.exception.GeneralApiException; import org.openhab.binding.opensprinkler.internal.model.StationProgram; @@ -45,12 +47,14 @@ public interface OpenSprinklerApi { public abstract void leaveManualMode() throws CommunicationApiException; /** - * Starts a station on the OpenSprinkler device. + * Starts a station on the OpenSprinkler device for the specified duration. * * @param station Index of the station to open starting at 0. + * @param duration The duration in seconds for how long the station should be turned on. * @throws Exception */ - public abstract void openStation(int station) throws Exception; + public abstract void openStation(int station, BigDecimal duration) + throws CommunicationApiException, GeneralApiException; /** * Closes a station on the OpenSprinkler device. @@ -58,7 +62,7 @@ public interface OpenSprinklerApi { * @param station Index of the station to open starting at 0. * @throws Exception */ - public abstract void closeStation(int station) throws Exception; + public abstract void closeStation(int station) throws CommunicationApiException, GeneralApiException; /** * Returns the state of a station on the OpenSprinkler device. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiConstants.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiConstants.java index f80c1c506c4d2..e6a0d58b588b1 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiConstants.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,9 +14,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; -import com.pi4j.io.gpio.Pin; -import com.pi4j.io.gpio.RaspiPin; - /** * The {@link OpenSprinklerApiContents} class defines common constants, which are * used across OpenSprinkler API classes. @@ -38,8 +35,6 @@ public class OpenSprinklerApiConstants { public static final String CMD_STATION = "sid="; public static final String CMD_STATION_ENABLE = "en=1"; public static final String CMD_STATION_DISABLE = "en=0"; - public static final String CMD_STATION_ENABLE_TIME = "t=64800"; - public static final String CMD_STATION_ENABLE_TIME_UNLIMITED = "t=0"; public static final String CMD_STATUS_INFO = "jc"; public static final String CMD_OPTIONS_INFO = "jo"; @@ -52,10 +47,4 @@ public class OpenSprinklerApiConstants { public static final String JSON_OPTION_STATION_COUNT = "nstations"; public static final String JSON_OPTION_RESULT = "result"; - - /* These pin-outs are based on the common scheme used by Pi4J and wiringPi. */ - public static final Pin SR_CLK_PIN = RaspiPin.GPIO_07; // rev1:4, rev2:4 - public static final Pin SR_NOE_PIN = RaspiPin.GPIO_00; // rev1:17, rev2:17 - public static final Pin SR_DAT_PIN = RaspiPin.GPIO_02; // rev1:21, rev2:27 - public static final Pin SR_LAT_PIN = RaspiPin.GPIO_03; // rev1:22, rev2:22 } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiFactory.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiFactory.java index c7f1e9500019c..df2e4062ed6dc 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiFactory.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerApiFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -81,14 +81,4 @@ public OpenSprinklerApi getHttpApi(OpenSprinklerHttpInterfaceConfig config) return lowestSupportedApi; } } - - /** - * Factory method returns an OpenSprnkler PI GPIO class for control. - * - * @param numberOfStations The number of stations to control on the OpenSprinkler PI device. - * @return OpenSprinkler GPIO class for control of the device. - */ - public OpenSprinklerApi getGpioApi(int numberOfStations) { - return new OpenSprinklerGpioApi(numberOfStations); - } } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerGpioApi.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerGpioApi.java deleted file mode 100644 index a7f9a84ff84ab..0000000000000 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerGpioApi.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.opensprinkler.internal.api; - -import static org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiConstants.*; - -import org.openhab.binding.opensprinkler.internal.api.exception.CommunicationApiException; -import org.openhab.binding.opensprinkler.internal.api.exception.GeneralApiException; -import org.openhab.binding.opensprinkler.internal.model.StationProgram; - -import com.pi4j.io.gpio.GpioController; -import com.pi4j.io.gpio.GpioFactory; -import com.pi4j.io.gpio.GpioPinDigitalOutput; - -/** - * The {@link OpenSprinklerGpioApi} class is used for communicating with - * the OpenSprinkler PI when openHAB is installed on the same Raspberry PI - * that the OpenSprinkler PI device is using. - * - * @author Jonathan Giles, Chris Graham - Initial contribution - * @author Florian Schmidt - Refactor class visibility - */ -class OpenSprinklerGpioApi implements OpenSprinklerApi { - private int firmwareVersion = -1; - private int numberOfStations = DEFAULT_STATION_COUNT; - - private boolean[] stationState; - - private boolean isInManualMode = false; - - private final GpioPinDigitalOutput srClkOutputPin; - private final GpioPinDigitalOutput srNoeOutputPin; - private final GpioPinDigitalOutput srDatOutputPin; - private final GpioPinDigitalOutput srLatOutputPin; - - private final GpioController gpio; - - /** - * Constructor for the OpenSprinkler PI class to create a connection to the OpenSprinkler PI - * device for control and obtaining status info using the GPIO. - * - * @param stations The number of stations to control on the OpenSprinkler PI device. - */ - OpenSprinklerGpioApi(int stations) { - this.numberOfStations = stations; - this.stationState = new boolean[stations]; - - for (int i = 0; i < stations; i++) { - stationState[i] = false; - } - - gpio = GpioFactory.getInstance(); - - /* Initialize the OpenSprinkler Pi */ - srClkOutputPin = gpio.provisionDigitalOutputPin(SR_CLK_PIN); - srNoeOutputPin = gpio.provisionDigitalOutputPin(SR_NOE_PIN); - srNoeOutputPin.high(); /* Disable shift register output */ - srDatOutputPin = gpio.provisionDigitalOutputPin(SR_DAT_PIN); - srLatOutputPin = gpio.provisionDigitalOutputPin(SR_LAT_PIN); - srNoeOutputPin.low(); /* Disable shift register output */ - - pullStationState(); - } - - @Override - public boolean isManualModeEnabled() { - return isInManualMode; - } - - @Override - public void enterManualMode() { - isInManualMode = true; - } - - @Override - public void leaveManualMode() { - isInManualMode = false; - } - - @Override - public void openStation(int station) throws Exception { - if (station < 0 || station >= numberOfStations) { - throw new Exception("This OpenSprinkler PI device only has " + this.numberOfStations + " but station " - + station + " was requested to be opened."); - } - - stationState[station] = false; - - pushStationState(); - } - - @Override - public void closeStation(int station) throws Exception { - if (station < 0 || station >= numberOfStations) { - throw new Exception("This OpenSprinkler device only has " + this.numberOfStations + " but station " - + station + " was requested to be closed."); - } - - stationState[station] = false; - - pushStationState(); - } - - @Override - public boolean isStationOpen(int station) throws GeneralApiException, CommunicationApiException { - if (station < 0 || station >= numberOfStations) { - throw new GeneralApiException("This OpenSprinkler device only has " + this.numberOfStations - + " but station " + station + " was requested for a status update."); - } - - pullStationState(); - - return stationState[station]; - } - - @Override - public boolean isRainDetected() { - throw new UnsupportedOperationException("Rain sensor access not supported in GPIO mode."); - } - - @Override - public int getNumberOfStations() { - return this.numberOfStations; - } - - @Override - public int getFirmwareVersion() { - return this.firmwareVersion; - } - - /** - * Communicate with the GPIO of the OpenSprinkler PI device to - * retrieve and update local station state from the device.. - */ - private void pullStationState() { - /* Needs research */ - } - - /** - * Communicate with the GPIO of the OpenSprinkler PI device to - * push and update local station state to the device. - */ - private void pushStationState() { - srClkOutputPin.low(); - srLatOutputPin.low(); - - for (int i = 1; i <= numberOfStations; i++) { - srClkOutputPin.low(); - srDatOutputPin.setState(stationState[numberOfStations - i]); - srClkOutputPin.high(); - } - - srLatOutputPin.high(); - } - - @Override - public StationProgram retrieveProgram(int station) throws CommunicationApiException { - throw new UnsupportedOperationException(); - } -} diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java index 0b43a5a2c6ff5..047ba2aa19c64 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV100.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiConstants.*; +import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.List; @@ -34,6 +35,7 @@ import org.openhab.binding.opensprinkler.internal.util.Parse; import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; /** * The {@link OpenSprinklerHttpApiV100} class is used for communicating with @@ -126,14 +128,14 @@ public void leaveManualMode() throws CommunicationApiException { } @Override - public void openStation(int station) throws Exception { + public void openStation(int station, BigDecimal duration) throws CommunicationApiException, GeneralApiException { if (station < 0 || station >= numberOfStations) { throw new GeneralApiException("This OpenSprinkler device only has " + this.numberOfStations + " but station " + station + " was requested to be opened."); } try { - http.sendHttpGet(getBaseUrl() + "sn" + station + "=1", null); + http.sendHttpGet(getBaseUrl() + "sn" + station + "=1&t=" + duration, null); } catch (Exception exp) { throw new CommunicationApiException( "There was a problem in the HTTP communication with the OpenSprinkler API: " + exp.getMessage()); @@ -141,17 +143,13 @@ public void openStation(int station) throws Exception { } @Override - public void closeStation(int station) throws Exception { + public void closeStation(int station) throws CommunicationApiException, GeneralApiException { if (station < 0 || station >= numberOfStations) { throw new GeneralApiException("This OpenSprinkler device only has " + this.numberOfStations + " but station " + station + " was requested to be closed."); } - try { - http.sendHttpGet(getBaseUrl() + "sn" + station + "=0", null); - } catch (Exception exp) { - throw new CommunicationApiException( - "There was a problem in the HTTP communication with the OpenSprinkler API: " + exp.getMessage()); - } + + http.sendHttpGet(getBaseUrl() + "sn" + station + "=0", null); } @Override @@ -259,6 +257,7 @@ private JcResponse statusInfo() throws CommunicationApiException { private static class JcResponse { public List<List<Integer>> ps; + @SerializedName(value = "sn1", alternate = "rs") public int rs; } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV210.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV210.java index 6859dd29c4232..78c21ba983509 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV210.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV210.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,8 @@ import static org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiConstants.*; +import java.math.BigDecimal; + import org.eclipse.jetty.client.HttpClient; import org.openhab.binding.opensprinkler.internal.api.exception.CommunicationApiException; import org.openhab.binding.opensprinkler.internal.api.exception.DataFormatErrorApiException; @@ -83,7 +85,7 @@ public boolean isStationOpen(int station) throws GeneralApiException, Communicat } @Override - public void openStation(int station) throws Exception { + public void openStation(int station, BigDecimal duration) throws CommunicationApiException, GeneralApiException { String returnContent; if (station < 0 || station >= numberOfStations) { @@ -93,8 +95,8 @@ public void openStation(int station) throws Exception { try { returnContent = http.sendHttpGet(getBaseUrl() + CMD_STATION_CONTROL, getRequestRequiredOptions() + "&" - + CMD_STATION + station + "&" + CMD_STATION_ENABLE + "&" + CMD_STATION_ENABLE_TIME); - } catch (Exception exp) { + + CMD_STATION + station + "&" + CMD_STATION_ENABLE + "&t=" + duration); + } catch (CommunicationApiException exp) { throw new CommunicationApiException( "There was a problem in the HTTP communication with the OpenSprinkler API: " + exp.getMessage()); } @@ -103,7 +105,7 @@ public void openStation(int station) throws Exception { } @Override - public void closeStation(int station) throws Exception { + public void closeStation(int station) throws CommunicationApiException, GeneralApiException { String returnContent; if (station < 0 || station > numberOfStations) { @@ -148,7 +150,7 @@ public void leaveManualMode() { * an action result is returned from the API. * @throws Exception Returns a custom exception based on the result key. */ - protected void resultParser(String returnContent) throws Exception { + protected void resultParser(String returnContent) throws GeneralApiException { int returnCode; try { diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV213.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV213.java index 96b7902d13bee..7aee7fd990bb7 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV213.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/OpenSprinklerHttpApiV213.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/CommunicationApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/CommunicationApiException.java index 6bf01bfa02ca2..b407528f37b12 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/CommunicationApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/CommunicationApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,4 +32,8 @@ public class CommunicationApiException extends Exception { public CommunicationApiException(String message) { super(message); } + + public CommunicationApiException(String message, Throwable e) { + super(message, e); + } } diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataFormatErrorApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataFormatErrorApiException.java index aedb4e68966ab..ebab7365469b2 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataFormatErrorApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataFormatErrorApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class DataFormatErrorApiException extends Exception { +public class DataFormatErrorApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataMissingApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataMissingApiException.java index 3ef55c037a5e9..507188393c997 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataMissingApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/DataMissingApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class DataMissingApiException extends Exception { +public class DataMissingApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/GeneralApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/GeneralApiException.java index eb82ddb0d3186..64b94478d8dd9 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/GeneralApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/GeneralApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/MismatchApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/MismatchApiException.java index 0e72e1286d235..8e2c441a4d02d 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/MismatchApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/MismatchApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class MismatchApiException extends Exception { +public class MismatchApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/NotPermittedApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/NotPermittedApiException.java index 04e9261c05432..22bb0188a9ba3 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/NotPermittedApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/NotPermittedApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class NotPermittedApiException extends Exception { +public class NotPermittedApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/OutOfRangeApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/OutOfRangeApiException.java index 85eabb49139ad..27d5da9bbfda2 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/OutOfRangeApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/OutOfRangeApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class OutOfRangeApiException extends Exception { +public class OutOfRangeApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/PageNotFoundApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/PageNotFoundApiException.java index 62725120e5419..38c2a451ce9ea 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/PageNotFoundApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/PageNotFoundApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class PageNotFoundApiException extends Exception { +public class PageNotFoundApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnauthorizedApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnauthorizedApiException.java index f7912b70facd6..0ab1b864fc6ee 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnauthorizedApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnauthorizedApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class UnauthorizedApiException extends Exception { +public class UnauthorizedApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnknownApiException.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnknownApiException.java index 2fac3bf2e9e09..9932de25ce0ec 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnknownApiException.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/api/exception/UnknownApiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ * * @author Chris Graham - Initial contribution */ -public class UnknownApiException extends Exception { +public class UnknownApiException extends GeneralApiException { /** * Serial ID of this error class. */ diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerHttpInterfaceConfig.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerHttpInterfaceConfig.java index 8efbc90f187fc..de65e6febea10 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerHttpInterfaceConfig.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerHttpInterfaceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerPiConfig.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerPiConfig.java index 102ac0ba9ef13..61c0817be3d95 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerPiConfig.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerPiConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerStationConfig.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerStationConfig.java index 4e882f1ffe81b..89f3b23ee6958 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerStationConfig.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/config/OpenSprinklerStationConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryJob.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryJob.java index 6450c7c184cf2..244781e214f2f 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryJob.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryJob.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryService.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryService.java index 7f4a683ef430c..c9b58d6937cc2 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryService.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/discovery/OpenSprinklerDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseBridgeHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseBridgeHandler.java index e89c3b0500c9e..633e3ee995783 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseBridgeHandler.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseHandler.java index 0ca3bd5a1e49f..aee9156e639cf 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseHandler.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerDeviceHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerDeviceHandler.java index 1f69009f119f6..afaeab6077e5f 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerDeviceHandler.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerHttpBridgeHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerHttpBridgeHandler.java index c3b49212d16e6..7b86405cab317 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerHttpBridgeHandler.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerHttpBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerPiBridgeHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerPiBridgeHandler.java deleted file mode 100644 index c28ac56af8693..0000000000000 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerPiBridgeHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.opensprinkler.internal.handler; - -import static org.openhab.binding.opensprinkler.internal.OpenSprinklerBindingConstants.DEFAULT_REFRESH_RATE; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.ThingStatus; -import org.eclipse.smarthome.core.thing.ThingStatusDetail; -import org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApi; -import org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApiFactory; -import org.openhab.binding.opensprinkler.internal.config.OpenSprinklerPiConfig; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Florian Schmidt - Refactoring - */ -@NonNullByDefault -public class OpenSprinklerPiBridgeHandler extends OpenSprinklerBaseBridgeHandler { - private final Logger logger = LoggerFactory.getLogger(OpenSprinklerPiBridgeHandler.class); - - @Nullable - private OpenSprinklerPiConfig openSprinklerConfig; - private OpenSprinklerApiFactory apiFactory; - - public OpenSprinklerPiBridgeHandler(Bridge bridge, OpenSprinklerApiFactory apiFactory) { - super(bridge); - this.apiFactory = apiFactory; - } - - @Override - public void initialize() { - OpenSprinklerPiConfig openSprinklerConfig = getConfig().as(OpenSprinklerPiConfig.class); - this.openSprinklerConfig = openSprinklerConfig; - - logger.debug("Initializing OpenSprinkler with config (Refresh: {}).", openSprinklerConfig.refresh); - - OpenSprinklerApi openSprinklerDevice; - try { - openSprinklerDevice = apiFactory.getGpioApi(openSprinklerConfig.stations); - this.openSprinklerDevice = openSprinklerDevice; - } catch (Exception exp) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not create API connection to the OpenSprinkler device. Error received: " + exp); - - return; - } - - logger.debug("Successfully created API connection to the OpenSprinkler device."); - - try { - openSprinklerDevice.enterManualMode(); - } catch (Exception exp) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not open API connection to the OpenSprinkler device. Error received: " + exp); - } - - if (openSprinklerDevice.isManualModeEnabled()) { - updateStatus(ThingStatus.ONLINE); - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not initialize the connection to the OpenSprinkler."); - - return; - } - - super.initialize(); - } - - @Override - protected long getRefreshInterval() { - OpenSprinklerPiConfig openSprinklerConfig = this.openSprinklerConfig; - if (openSprinklerConfig == null) { - return DEFAULT_REFRESH_RATE; - } - return openSprinklerConfig.refresh; - } - -} diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerStationHandler.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerStationHandler.java index 7262bdf842ce5..5b0e62f9068ab 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerStationHandler.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/handler/OpenSprinklerStationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,22 +14,26 @@ import static org.openhab.binding.opensprinkler.internal.OpenSprinklerBindingConstants.*; +import java.math.BigDecimal; + import javax.measure.quantity.Time; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.thing.Channel; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.eclipse.smarthome.core.types.State; import org.openhab.binding.opensprinkler.internal.api.OpenSprinklerApi; import org.openhab.binding.opensprinkler.internal.api.exception.CommunicationApiException; +import org.openhab.binding.opensprinkler.internal.api.exception.GeneralApiException; import org.openhab.binding.opensprinkler.internal.config.OpenSprinklerStationConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,6 +49,8 @@ public class OpenSprinklerStationHandler extends OpenSprinklerBaseHandler { @Nullable private OpenSprinklerStationConfig config; + @Nullable + private BigDecimal nextDurationTime; public OpenSprinklerStationHandler(Thing thing) { super(thing); @@ -57,48 +63,70 @@ public void initialize() { @Override public void handleCommand(ChannelUID channelUID, Command command) { - try { - if (command == RefreshType.REFRESH) { - updateChannels(); - } else { - handleStationCommand(this.getStationIndex(), command); + OpenSprinklerApi api = getApi(); + if (api == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "OpenSprinkler bridge has no initialized API."); + return; + } + + if (command != RefreshType.REFRESH) { + switch (channelUID.getIdWithoutGroup()) { + case NEXT_DURATION: + handleNextDurationCommand(channelUID, command); + break; + case STATION_STATE: + handleStationStateCommand(api, command); + break; + case STATION_QUEUED: + handleQueuedCommand(api, command); + break; } - } catch (Exception exp) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not control the OpenSprinkler."); - logger.debug("Error controlling and OpenSprinkler station. Exception received: {}", exp.toString()); } + updateChannels(); } - /** - * Handles control of an OpenSprnkler station based on commanded - * received by a channel call. - * - * @param stationId Int of the station to control. Starts at 0. - * @param command Command being issues to the channel. - */ - protected void handleStationCommand(int stationId, Command command) { - OpenSprinklerApi api = getApi(); - if (api == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "OpenSprinkler bridge has no initialized API."); + private void handleNextDurationCommand(ChannelUID channelUID, Command command) { + if (!(command instanceof QuantityType<?>)) { + logger.info("Ignoring implausible non-QuantityType command for NEXT_DURATION"); + return; + } + QuantityType<?> quantity = (QuantityType<?>) command; + this.nextDurationTime = quantity.toBigDecimal(); + updateState(channelUID, quantity); + } + + private void handleStationStateCommand(OpenSprinklerApi api, Command command) { + if (!(command instanceof OnOffType)) { + logger.error("Received invalid command type for OpenSprinkler station ({}).", command); return; } try { if (command == OnOffType.ON) { - api.openStation(stationId); - } else if (command == OnOffType.OFF) { - api.closeStation(stationId); + api.openStation(this.getStationIndex(), nextStationDuration()); } else { - logger.error("Received invalid command type for OpenSprinkler station ({}).", command); + api.closeStation(this.getStationIndex()); } - updateChannels(); - } catch (Exception exp) { + } catch (CommunicationApiException | GeneralApiException exp) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not control the station channel " + (stationId + 1) + " for the OpenSprinkler."); - logger.debug( - "Could not control the station channel {} for the OpenSprinkler device. Exception received: {}", - (stationId + 1), exp.toString()); + "Could not control the station channel " + (this.getStationIndex() + 1) + + " for the OpenSprinkler. Error: " + exp.getMessage()); + } + } + + private void handleQueuedCommand(OpenSprinklerApi api, Command command) { + if (command == OnOffType.ON) { + return; } + handleStationStateCommand(api, command); + } + + private BigDecimal nextStationDuration() { + BigDecimal nextDurationItemValue = nextDurationValue(); + Channel nextDuration = getThing().getChannel(NEXT_DURATION); + if (nextDuration != null && isLinked(nextDuration.getUID()) && nextDurationItemValue != null) { + return nextDurationItemValue; + } + return new BigDecimal(64800); } /** @@ -108,7 +136,7 @@ protected void handleStationCommand(int stationId, Command command) { * @return State representation for the channel. */ @Nullable - protected State getStationState(int stationId) { + private OnOffType getStationState(int stationId) { boolean stationOn = false; OpenSprinklerApi api = getApi(); if (api == null) { @@ -119,12 +147,10 @@ protected State getStationState(int stationId) { try { stationOn = api.isStationOpen(stationId); - } catch (Exception exp) { + } catch (GeneralApiException | CommunicationApiException exp) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, - "Could not get the station channel " + stationId + " current state from the OpenSprinkler thing."); - logger.debug( - "Could not get current state of station channel {} for the OpenSprinkler device. Exception received: {}", - (stationId + 1), exp.toString()); + "Could not get the station channel " + stationId + + " current state from the OpenSprinkler thing. Error: " + exp.getMessage()); } if (stationOn) { @@ -140,8 +166,7 @@ protected State getStationState(int stationId) { * @param stationId Int of the station to control. Starts at 0. * @return State representation for the channel. */ - @Nullable - protected State getRemainingWaterTime(int stationId) { + private @Nullable QuantityType<Time> getRemainingWaterTime(int stationId) { long remainingWaterTime = 0; OpenSprinklerApi api = getApi(); if (api == null) { @@ -163,22 +188,42 @@ protected State getRemainingWaterTime(int stationId) { @Override protected void updateChannel(@NonNull ChannelUID channel) { + OnOffType currentDeviceState = getStationState(this.getStationIndex()); + QuantityType<Time> remainingWaterTime = getRemainingWaterTime(config.stationIndex); switch (channel.getIdWithoutGroup()) { case STATION_STATE: - State currentDeviceState = getStationState(this.getStationIndex()); if (currentDeviceState != null) { updateState(channel, currentDeviceState); } + break; case REMAINING_WATER_TIME: - State remainingWaterTime = getRemainingWaterTime(config.stationIndex); if (remainingWaterTime != null) { updateState(channel, remainingWaterTime); } + break; + case NEXT_DURATION: + BigDecimal duration = nextDurationValue(); + if (duration != null) { + updateState(channel, new DecimalType(duration)); + } + break; + case STATION_QUEUED: + if (remainingWaterTime != null && currentDeviceState != null && currentDeviceState == OnOffType.OFF + && remainingWaterTime.intValue() != 0) { + updateState(channel, OnOffType.ON); + } else { + updateState(channel, OnOffType.OFF); + } + break; default: logger.debug("Not updating unknown channel {}", channel); } } + private @Nullable BigDecimal nextDurationValue() { + return nextDurationTime; + } + private int getStationIndex() { OpenSprinklerStationConfig config = this.config; if (config == null) { diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/model/StationProgram.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/model/StationProgram.java index e74a6c167f66a..283700aff4f35 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/model/StationProgram.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/model/StationProgram.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Hash.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Hash.java index 70b176175c9f9..f8f2dd498dfa4 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Hash.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Hash.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Parse.java b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Parse.java index d3d5009478abb..5b4691d389e22 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Parse.java +++ b/bundles/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/util/Parse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.opensprinkler/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.opensprinkler/src/main/resources/ESH-INF/thing/thing-types.xml index 37932a20059e6..abaef0651d0e4 100644 --- a/bundles/org.openhab.binding.opensprinkler/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.opensprinkler/src/main/resources/ESH-INF/thing/thing-types.xml @@ -14,7 +14,7 @@ <description>The host name or IP address of the OpenSprinkler Web API interface. It may or may not start with the protocol, e.g. in order to use https:// instead of the default http://.</description> <default>localhost</default> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>Port</label> <description>Port of the OpenSprinkler Web API interface.</description> <default>80</default> @@ -42,35 +42,18 @@ </config-description> </bridge-type> - <bridge-type id="pi"> - <label>OpenSprinkler Pi Interface</label> - <description>A connection to a OpenSprinkler via GPIO.</description> - - <config-description> - <parameter name="stations" type="integer" min="1" max="48"> - <label>Stations</label> - <description>The number of stations to control.</description> - <default>8</default> - </parameter> - <parameter name="refresh" type="integer"> - <label>Refresh Interval</label> - <description>Specifies the refresh interval in seconds.</description> - <default>60</default> - </parameter> - </config-description> - </bridge-type> - <thing-type id="station"> <supported-bridge-type-refs> <bridge-type-ref id="http" /> - <bridge-type-ref id="pi" /> </supported-bridge-type-refs> <label>OpenSprinkler Station</label> <description>Controls a station connected to the OpenSprinkler device.</description> <channels> <channel id="stationState" typeId="stationState"></channel> + <channel id="queued" typeId="queued"></channel> <channel id="remainingWaterTime" typeId="remainingWaterTime"></channel> + <channel id="nextDuration" typeId="nextDuration"></channel> </channels> <config-description> @@ -107,11 +90,25 @@ <description>Controls a station on the OpenSprinkler device.</description> <category>Switch</category> </channel-type> - + + <channel-type id="queued"> + <item-type>Switch</item-type> + <label>Queued</label> + <description>Indicates if the station is queued to be turned on. Can be removed from the queue by turning off. ON is read-only.</description> + <category>Switch</category> + </channel-type> + <channel-type id="remainingWaterTime"> <item-type>Number:Time</item-type> <label>Remaining Water Time</label> <description>Read-only property of the remaining water time of the station.</description> <state readOnly="true" pattern="%.0f min"/> </channel-type> + + <channel-type id="nextDuration"> + <item-type>Number:Time</item-type> + <label>Next Open Duration</label> + <description>The duration the station will be opened the next time it is switched on.</description> + <state readOnly="true" pattern="%.0f s"/> + </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.openuv/NOTICE b/bundles/org.openhab.binding.openuv/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.openuv/NOTICE +++ b/bundles/org.openhab.binding.openuv/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.openuv/pom.xml b/bundles/org.openhab.binding.openuv/pom.xml index e3c63612425c3..e304f8e7a5724 100644 --- a/bundles/org.openhab.binding.openuv/pom.xml +++ b/bundles/org.openhab.binding.openuv/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.openuv</artifactId> diff --git a/bundles/org.openhab.binding.openuv/src/main/feature/feature.xml b/bundles/org.openhab.binding.openuv/src/main/feature/feature.xml index b0cbc7dbc7974..5edc141761f29 100644 --- a/bundles/org.openhab.binding.openuv/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.openuv/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.openuv-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-openuv" description="OpenUV Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVBindingConstants.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVBindingConstants.java index a4940925b394f..0d0afe237e46e 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVBindingConstants.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVHandlerFactory.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVHandlerFactory.java index 5a1012abbb633..acde3ecddacc1 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVHandlerFactory.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/OpenUVHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/ReportConfiguration.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/ReportConfiguration.java index ac7c67a72a630..00d933b3839e5 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/ReportConfiguration.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/ReportConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/SafeExposureConfiguration.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/SafeExposureConfiguration.java index 6962339810481..5a4514c058ca3 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/SafeExposureConfiguration.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/SafeExposureConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/discovery/OpenUVDiscoveryService.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/discovery/OpenUVDiscoveryService.java index 05d126b21d55b..415fa17fcf263 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/discovery/OpenUVDiscoveryService.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/discovery/OpenUVDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java index 3fca31660d9a1..b40d03810d2b5 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java index 021970c652f53..e2bb340f2585a 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/handler/OpenUVReportHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResponse.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResponse.java index 650de56cbf690..5b22d92cdeca8 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResponse.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResult.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResult.java index a5b18603b67ba..b9bdbc1b5faf6 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResult.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/OpenUVResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/SafeExposureTime.java b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/SafeExposureTime.java index c7fba00b9461c..1e1718de32740 100644 --- a/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/SafeExposureTime.java +++ b/bundles/org.openhab.binding.openuv/src/main/java/org/openhab/binding/openuv/internal/json/SafeExposureTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openuv/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.openuv/src/main/resources/ESH-INF/thing/thing-types.xml index 963826fed6a87..ab725aea82c45 100644 --- a/bundles/org.openhab.binding.openuv/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.openuv/src/main/resources/ESH-INF/thing/thing-types.xml @@ -47,7 +47,7 @@ <config-description> <parameter name="refresh" type="integer" min="3"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in minutes.</description> <default>10</default> </parameter> diff --git a/bundles/org.openhab.binding.openweathermap/NOTICE b/bundles/org.openhab.binding.openweathermap/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.openweathermap/NOTICE +++ b/bundles/org.openhab.binding.openweathermap/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.openweathermap/README.md b/bundles/org.openhab.binding.openweathermap/README.md index 4e7d1c8518a70..223bc79e8e370 100644 --- a/bundles/org.openhab.binding.openweathermap/README.md +++ b/bundles/org.openhab.binding.openweathermap/README.md @@ -46,7 +46,7 @@ Once the system location will be changed, the background discovery updates the c |-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | apikey | API key to access the OpenWeatherMap API. **Mandatory** | | refreshInterval | Specifies the refresh interval (in minutes). Optional, the default value is 60, the minimum value is 10. | -| language | Language to be used by the OpenWeatherMap API. Optional, valid values are: `ar`, `bg`, `ca`, `de`, `el`, `en`, `es`, `fa`, `fi`, `fr`, `gl`, `hr`, `hu`, `it`, `ja`, `kr`, `la`, `lt`, `mk`, `nl`, `pl`, `pt`, `ro`, `ru`, `sk`, `sl`, `sw`, `tr`, `ua`, `vi`, `zh_cn`, `zh_tw`. | +| language | Language to be used by the OpenWeatherMap API. Optional, valid values are: `ar`, `bg`, `ca`, `de`, `el`, `en`, `es`, `fa`, `fi`, `fr`, `gl`, `hr`, `hu`, `it`, `ja`, `kr`, `la`, `lt`, `mk`, `nl`, `pl`, `pt`, `ro`, `ru`, `se`, `sk`, `sl`, `tr`, `ua`, `vi`, `zh_cn`, `zh_tw`. | ### Current Weather And Forecast diff --git a/bundles/org.openhab.binding.openweathermap/pom.xml b/bundles/org.openhab.binding.openweathermap/pom.xml index 51e0e46beb18a..731a0e3cc6d9b 100644 --- a/bundles/org.openhab.binding.openweathermap/pom.xml +++ b/bundles/org.openhab.binding.openweathermap/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.openweathermap</artifactId> diff --git a/bundles/org.openhab.binding.openweathermap/src/main/feature/feature.xml b/bundles/org.openhab.binding.openweathermap/src/main/feature/feature.xml index 7fe2cacdaa853..072c55015f6f6 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.openweathermap-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-openweathermap" description="OpenWeatherMap Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java index 8c2ae81e02918..807a03375c457 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/OpenWeatherMapBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java index 033175b1bf93a..d3bb646ce4d3b 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,7 +33,7 @@ public class OpenWeatherMapAPIConfiguration { // supported languages (see https://openweathermap.org/current#multi) public static final Set<String> SUPPORTED_LANGUAGES = Collections.unmodifiableSet(Stream.of("ar", "bg", "ca", "cz", "de", "el", "en", "es", "fa", "fi", "fr", "gl", "hr", "hu", "it", "ja", "kr", "la", "lt", "mk", "nl", "pl", - "pt", "ro", "ru", "sk", "sl", "sw", "tr", "ua", "vi", "zh_cn", "zh_tw").collect(Collectors.toSet())); + "pt", "ro", "ru", "se", "sk", "sl", "tr", "ua", "vi", "zh_cn", "zh_tw").collect(Collectors.toSet())); private @Nullable String apikey; private int refreshInterval; diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapLocationConfiguration.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapLocationConfiguration.java index 5d88ae7e31dac..2f3864d0555c8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapLocationConfiguration.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapLocationConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapUVIndexConfiguration.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapUVIndexConfiguration.java index fb7dd14156ad2..12f301c3fc2f8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapUVIndexConfiguration.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapUVIndexConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapWeatherAndForecastConfiguration.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapWeatherAndForecastConfiguration.java index a6127c541f1d2..27af4dd6772d0 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapWeatherAndForecastConfiguration.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapWeatherAndForecastConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapCommunicationException.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapCommunicationException.java index 69464d51f6cc7..ca2daef757a58 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapCommunicationException.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConfigurationException.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConfigurationException.java index fca970f4d9a27..c5a64388eb4ed 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConfigurationException.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConnection.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConnection.java index 90778a962395b..130c1b5f92acc 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConnection.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/connection/OpenWeatherMapConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -48,6 +48,7 @@ import org.slf4j.LoggerFactory; import com.google.gson.Gson; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; @@ -328,9 +329,12 @@ private String uglifyApikey(String url) { } private String getErrorMessage(String response) { - JsonObject jsonResponse = parser.parse(response).getAsJsonObject(); - if (jsonResponse.has(PROPERTY_MESSAGE)) { - return jsonResponse.get(PROPERTY_MESSAGE).getAsString(); + JsonElement jsonResponse = parser.parse(response); + if (jsonResponse.isJsonObject()) { + JsonObject json = jsonResponse.getAsJsonObject(); + if (json.has(PROPERTY_MESSAGE)) { + return json.get(PROPERTY_MESSAGE).getAsString(); + } } return response; } diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/discovery/OpenWeatherMapDiscoveryService.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/discovery/OpenWeatherMapDiscoveryService.java index 695381228e081..af48422cb3f65 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/discovery/OpenWeatherMapDiscoveryService.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/discovery/OpenWeatherMapDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/factory/OpenWeatherMapHandlerFactory.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/factory/OpenWeatherMapHandlerFactory.java index 0e641957e147c..d244a9bc6b5ed 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/factory/OpenWeatherMapHandlerFactory.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/factory/OpenWeatherMapHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/AbstractOpenWeatherMapHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/AbstractOpenWeatherMapHandler.java index e39a22740b7cb..e3c641da9b5e7 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/AbstractOpenWeatherMapHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/AbstractOpenWeatherMapHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java index d67c4c42dedd5..bf3924ffb1b75 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapAPIHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java index b60853561f8eb..51b1677869b36 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapUVIndexHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -155,14 +155,15 @@ protected void updateChannel(ChannelUID channelUID) { private void updateUVIndexChannel(ChannelUID channelUID) { String channelId = channelUID.getIdWithoutGroup(); String channelGroupId = channelUID.getGroupId(); - if (uvindexData != null) { + OpenWeatherMapJsonUVIndexData localUVIndexData = uvindexData; + if (localUVIndexData != null) { State state = UnDefType.UNDEF; switch (channelId) { case CHANNEL_TIME_STAMP: - state = getDateTimeTypeState(uvindexData.getDate()); + state = getDateTimeTypeState(localUVIndexData.getDate()); break; case CHANNEL_UVINDEX: - state = getDecimalTypeState(uvindexData.getValue()); + state = getDecimalTypeState(localUVIndexData.getValue()); break; } logger.debug("Update channel '{}' of group '{}' with new state '{}'.", channelId, channelGroupId, state); diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapWeatherAndForecastHandler.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapWeatherAndForecastHandler.java index 3b1729f0bda75..281a4bc6000a6 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapWeatherAndForecastHandler.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/handler/OpenWeatherMapWeatherAndForecastHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonDailyForecastData.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonDailyForecastData.java index cff84d9dc5c7c..d89830dc020df 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonDailyForecastData.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonDailyForecastData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonHourlyForecastData.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonHourlyForecastData.java index e6001e09be3ff..a576a2896e04f 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonHourlyForecastData.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonHourlyForecastData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonUVIndexData.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonUVIndexData.java index ac3fb7ab695f3..d613ca9e22767 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonUVIndexData.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonUVIndexData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonWeatherData.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonWeatherData.java index d1bb82eafcd2e..e1224ba064002 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonWeatherData.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/OpenWeatherMapJsonWeatherData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/City.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/City.java index 866c55a3db809..0f88e4a6e1601 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/City.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/City.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Clouds.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Clouds.java index f06b98d237d93..5c8ee14e802f8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Clouds.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Clouds.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Coord.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Coord.java index fbe753a65d62f..deac928701fc8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Coord.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Coord.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Rain.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Rain.java index dcf78fc4f4402..fe20b320447a7 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Rain.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Rain.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Snow.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Snow.java index 50c50d6685884..86cb644a3f2c0 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Snow.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Snow.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Weather.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Weather.java index 4ebd9d7c234f3..6425cb5d71c7a 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Weather.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Weather.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Wind.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Wind.java index 9d89a7574b253..31694d06b69e8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Wind.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/base/Wind.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/List.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/List.java index d60fc5c7f160b..21d3ae340007a 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/List.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/List.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/Temp.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/Temp.java index a5fd4b818aa59..db5cc46eb29c8 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/Temp.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/daily/Temp.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/List.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/List.java index 0bbf0538f9416..912896cb24269 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/List.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/List.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Main.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Main.java index 3709d180bdc8a..f323658f2701b 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Main.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Main.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Sys.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Sys.java index c7a74b1d6ce00..f8428bb2b4199 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Sys.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/forecast/hourly/Sys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Main.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Main.java index 1d07bbd492f4a..a579164eaa65a 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Main.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Main.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Sys.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Sys.java index 6166d95680da0..616d11f90059f 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Sys.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/model/weather/Sys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/utils/ByteArrayFileCache.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/utils/ByteArrayFileCache.java index 325e375a679eb..e22ffdcf734a9 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/utils/ByteArrayFileCache.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/utils/ByteArrayFileCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/config/config.xml index 3f2b5dce3ad66..54f5f815345a2 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/config/config.xml @@ -47,9 +47,9 @@ <option value="ro">Romanian</option> <option value="ru">Russian</option> <option value="sk">Slovak</option> + <option value="se">Swedish</option> <option value="sl">Slovenian</option> <option value="es">Spanish</option> - <option value="sw">Swedish</option> <option value="tr">Turkish</option> <option value="ua">Ukrainian</option> <option value="vi">Vietnamese</option> diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_de.properties b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_de.properties index 68a0e6f3246dd..4d45d86662521 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_de.properties +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_de.properties @@ -40,9 +40,9 @@ bridge-type.config.openweathermap.weather-api.language.option.pl = Polnisch bridge-type.config.openweathermap.weather-api.language.option.pt = Portugiesisch bridge-type.config.openweathermap.weather-api.language.option.ro = Rumänisch bridge-type.config.openweathermap.weather-api.language.option.ru = Russisch +bridge-type.config.openweathermap.weather-api.language.option.se = Schwedisch bridge-type.config.openweathermap.weather-api.language.option.sk = Slowakisch bridge-type.config.openweathermap.weather-api.language.option.sl = Slowenisch -bridge-type.config.openweathermap.weather-api.language.option.sw = Schwedisch bridge-type.config.openweathermap.weather-api.language.option.tr = Türkisch bridge-type.config.openweathermap.weather-api.language.option.ua = Ukrainisch bridge-type.config.openweathermap.weather-api.language.option.vi = Vietnamesisch @@ -219,6 +219,9 @@ channel-type.openweathermap.cloudiness.description = Zeigt die aktuelle Bew channel-type.openweathermap.forecasted-cloudiness.label = Vorhergesagte Bewölkung channel-type.openweathermap.forecasted-cloudiness.description = Zeigt die vorhergesagte Bewölkung an. +channel-type.openweathermap.visibility.label = Sichtweite +channel-type.openweathermap.visibility.description = Zeigt die aktuelle Sichtweite an. + channel-type.openweathermap.rain.label = Regen channel-type.openweathermap.rain.description = Zeigt den kumulierten Regen der letzten Stunde an. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_fr.properties b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_fr.properties index 14eafbefc5b8f..936f5f46272ab 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_fr.properties +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/i18n/openweathermap_fr.properties @@ -40,9 +40,9 @@ bridge-type.config.openweathermap.weather-api.language.option.pl = Polonais bridge-type.config.openweathermap.weather-api.language.option.pt = Portugais bridge-type.config.openweathermap.weather-api.language.option.ro = Roumain bridge-type.config.openweathermap.weather-api.language.option.ru = Russe +bridge-type.config.openweathermap.weather-api.language.option.se = Suédois bridge-type.config.openweathermap.weather-api.language.option.sk = Slovaque bridge-type.config.openweathermap.weather-api.language.option.sl = Slovène -bridge-type.config.openweathermap.weather-api.language.option.sw = Suédois bridge-type.config.openweathermap.weather-api.language.option.tr = Turc bridge-type.config.openweathermap.weather-api.language.option.ua = Ukrainien bridge-type.config.openweathermap.weather-api.language.option.vi = Vietnamien @@ -219,6 +219,9 @@ channel-type.openweathermap.cloudiness.description = La n channel-type.openweathermap.forecasted-cloudiness.label = Nébulosité prévue channel-type.openweathermap.forecasted-cloudiness.description = La nébulosité prévue. +channel-type.openweathermap.visibility.label = Distance de visibilité +channel-type.openweathermap.visibility.description = La distance de visibilité. + channel-type.openweathermap.rain.label = Pluie channel-type.openweathermap.rain.description = La quantité de pluie dans la dernière heure. diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/bridge-types.xml b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/bridge-types.xml index 07ee259960758..dfbeec5a4b200 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/bridge-types.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/bridge-types.xml @@ -2,7 +2,7 @@ <thing:thing-descriptions bindingId="openweathermap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- OpenWeatherMap Binding --> <bridge-type id="weather-api"> diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/thing-types.xml index ac91f6dec2d5e..dfe1de0fbc0b0 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/thing-types.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="weather-api" /> </supported-bridge-type-refs> - <label>Weather And Forecast</label> + <label>Weather and Forecast</label> <description>Provides current weather and forecast data from the OpenWeatherMap API.</description> <channel-groups> diff --git a/bundles/org.openhab.binding.orvibo/.classpath b/bundles/org.openhab.binding.orvibo/.classpath index 7e208668b4cb4..615608997a6c5 100644 --- a/bundles/org.openhab.binding.orvibo/.classpath +++ b/bundles/org.openhab.binding.orvibo/.classpath @@ -28,6 +28,5 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/s20-sdk-0.0.6-nmu1.jar" sourcepath="lib/s20-sdk-0.0.6-nmu1-src.zip" /> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.orvibo/NOTICE b/bundles/org.openhab.binding.orvibo/NOTICE index 82b6480866cb7..798a02c2fc2dc 100644 --- a/bundles/org.openhab.binding.orvibo/NOTICE +++ b/bundles/org.openhab.binding.orvibo/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1-src.zip b/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1-src.zip deleted file mode 100644 index ae76da6ab11d0..0000000000000 Binary files a/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1-src.zip and /dev/null differ diff --git a/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1.jar b/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1.jar deleted file mode 100644 index e2039fefd5f14..0000000000000 Binary files a/bundles/org.openhab.binding.orvibo/lib/s20-sdk-0.0.6-nmu1.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.orvibo/pom.xml b/bundles/org.openhab.binding.orvibo/pom.xml index acd7773a96f7c..2f0f8370ede31 100644 --- a/bundles/org.openhab.binding.orvibo/pom.xml +++ b/bundles/org.openhab.binding.orvibo/pom.xml @@ -1,24 +1,33 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.orvibo</artifactId> <name>openHAB Add-ons :: Bundles :: Orvibo Binding</name> + <properties> + <dep.noembedding>commons-collections4</dep.noembedding> + </properties> + <dependencies> + <dependency> + <groupId>com.github.tavalin.orvibo-sdk</groupId> + <artifactId>s20-sdk</artifactId> + <version>0.0.6-nmu1</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.1</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.orvibo/src/main/feature/feature.xml b/bundles/org.openhab.binding.orvibo/src/main/feature/feature.xml index 86f98d33870d1..03b85e236e88a 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.orvibo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.orvibo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-orvibo" description="Orvibo Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboActivator.java b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboActivator.java index 190baee391367..6ab9c28ba0962 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboActivator.java +++ b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboActivator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboBindingConstants.java b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboBindingConstants.java index 60ead91bb320f..e4b2cbdbe0165 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboBindingConstants.java +++ b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboHandlerFactory.java b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboHandlerFactory.java index 6bec027d42c0a..855d1ce0c5133 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboHandlerFactory.java +++ b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/OrviboHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/discovery/SocketDiscoveryService.java b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/discovery/SocketDiscoveryService.java index b06696f525bad..469aa123a978a 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/discovery/SocketDiscoveryService.java +++ b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/discovery/SocketDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/handler/S20Handler.java b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/handler/S20Handler.java index f711e907e7d8b..958f3ce7230a0 100644 --- a/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/handler/S20Handler.java +++ b/bundles/org.openhab.binding.orvibo/src/main/java/org/openhab/binding/orvibo/internal/handler/S20Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/NOTICE b/bundles/org.openhab.binding.paradoxalarm/NOTICE index ea0557550708a..edfd204e5d248 100644 --- a/bundles/org.openhab.binding.paradoxalarm/NOTICE +++ b/bundles/org.openhab.binding.paradoxalarm/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.paradoxalarm/README.md b/bundles/org.openhab.binding.paradoxalarm/README.md index 6c23a17e13b0a..f3b509830ec52 100644 --- a/bundles/org.openhab.binding.paradoxalarm/README.md +++ b/bundles/org.openhab.binding.paradoxalarm/README.md @@ -1,9 +1,8 @@ # Paradox Alarm System binding This binding is intended to provide basic support for Paradox Alarm system. - -With the power of OpenHAB this binding can be used for complex decision rules combining motion/magnetic sensor or whole partitions states with different scenarios. - +Currently the binding does not support active communication, i.e. you cannot change states (arming, disarming). The intention is to use it only for monitoring of your security system. +With the power of openHAB this binding can be used for complex decision rules combining motion/magnetic sensor or whole partitions states with different scenarios. Examples: @@ -25,18 +24,21 @@ Currently binding supports the following panels: EVO192, EVO48(not tested), EVO9 ## Things configuration -### IP150 parameters +### IP150 bridge parameters -| Parameter | Description | -|---------------|----------------------------------------| -| refresh | Value is in seconds. Defines the refresh interval when the binding polls from paradox system.| -| ip150Password | The password to your IP150 (not your panel PIN).| -| pcPassword | The code 3012 setting. Default value is 0000.| -| ipAddress | IP address of your IP150.| -| port | The port used for data communication. Default value is 10000.| -| panelType | Not mandatory. Will be used if discovery does not identify the panel. Otherwise provide EVO48, EVO96, EVO192, etc...| +| Parameter | Description | +|-------------------|----------------------------------------| +| refresh | Value is in seconds. Defines the refresh interval when the binding polls from paradox system.| +| ip150Password | The password to your IP150 (not your panel PIN).| +| pcPassword | The code 3012 setting. Default value is 0000.| +| ipAddress | IP address of your IP150.| +| port | The port used for data communication. Default value is 10000.| +| panelType | Optional parameter. Will be used if discovery does not identify the panel. Otherwise provide EVO48, EVO96, EVO192, etc...| +| reconnectWaitTime | Value is in seconds. The time to wait before a reconnect occurs after socket timeout.| +| maxPartitions | Optional parameter which sets maximum partitions to use during refresh. If not set, maximum allowed amount from panelType will be used.| +| maxZones | Optional parameter which sets maximum zones to use during refresh. If not set, maximum allowed amount from panelType will be used.| -### IP150 channels +### IP150 bridge channels | Channel | Description | |---------------------|------------------------------------------------| @@ -54,10 +56,40 @@ Currently binding supports the following panels: EVO192, EVO48(not tested), EVO9 |--------|------------------------------------------------------------------------------------| | id | The numeric ID of the zone/partition | +### Partition channels: + +| Channel | Type | Description | +|--------------------------|---------|---------------------------------------------------------------------------------------------| +| partitionLabel | String | Label of partition inside Paradox configuration | +| state | String |State of partition (armed, disarmed, in alarm) | +| additionalState | String | This used to be a channel where all different states were consolidated as semi-colon separated string. With implementation of each state as channel additional states should be no longer used. (deprecated channel) | +| readyToArm | Switch | Partition is Ready to arm | +| inExitDelay | Switch | Partition is in Exit delay | +| inEntryDelay | Switch | Partition in Entry Delay | +| inTrouble | Switch | Partition has trouble | +| alarmInMemory | Switch | Partition has alarm in memory | +| zoneBypass | Switch | Partition is in Zone Bypass | +| zoneInTamperTrouble | Switch | Partition is in Tamper Trouble | +| zoneInLowBatteryTrouble | Switch | Partition has zone in Low Battery Trouble | +| zoneInFireLoopTrouble | Switch | Partition has zone in Fire Loop Trouble | +| zoneInSupervisionTrouble | Switch | Partition has zone in Supervision Trouble | +| stayInstantReady | Switch | Partition is in state Stay Instant Ready | +| forceReady | Switch | Partition is in state Force Ready | +| bypassReady | Switch | Partition is in state Bypass Ready | +| inhibitReady | Switch | Partition is in state Inhibit Ready | +| allZonesClosed | Contact | All zones in partition are currently closed | + +### Zone channels: + +| Channel | Type | Description | +|-----------------|---------|--------------------------------------------------------------------------------| +| zoneLabel | String | Label of zone inside Paradox configuration | +| openedState | Contact | Zone opened / closed | +| tamperedState | Switch | Zone is tampered / not tampered | ## Example things configuration ```java - Bridge paradoxalarm:ip150:ip150 [refresh=5, panelType=“EVO192â€, ip150Password=“asdfasdfâ€, pcPassword=“1234â€, ipAddress=XXX.XXX.XXX.XXXâ€, port=10000 ] { + Bridge paradoxalarm:ip150:ip150 [refresh=5, panelType="EVO192", ip150Password="asdfasdf", pcPassword="1234", ipAddress=XXX.XXX.XXX.XXX", port=10000 ] { Thing panel panel @@ -77,29 +109,29 @@ Currently binding supports the following panels: EVO192, EVO48(not tested), EVO9 ```java //Groups - Group Paradox “Paradox security group†- Group Partitions “Paradox partitions†(Paradox) - Group Floor1MUC “Magnetic sensors - Floor 1†(Paradox) - Group PIRSensors “Motion sensors†(Paradox) + Group Paradox "Paradox security group" + Group Partitions "Paradox partitions" (Paradox) + Group Floor1MUC "Magnetic sensors - Floor 1" (Paradox) + Group PIRSensors "Motion sensors" (Paradox) //COMMUNICATOR BRIDGE - String paradoxSendCommand “Send command to IP150†{channel=“paradoxalarm:ip150:ip150:communicationCommandâ€} + String paradoxSendCommand "Send command to IP150" {channel="paradoxalarm:ip150:ip150:communicationCommand"} //PANEL - String panelState “Paradox panel state: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:state†} - String panelType “Paradox panel type: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:panelType†} - String serialNumber “Paradox Serial number: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:serialNumber†} - String hardwareVersion “Paradox HW version: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:hardwareVersion†} - String applicationVersion “Paradox Application version: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:applicationVersion†} - String bootloaderVersion “Paradox Bootloader version: [%s]†(Paradox) { channel = “paradoxalarm:panel:ip150:panel:bootloaderVersion†} + String panelState "Paradox panel state: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:state" } + String panelType "Paradox panel type: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:panelType" } + String serialNumber "Paradox Serial number: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:serialNumber" } + String hardwareVersion "Paradox HW version: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:hardwareVersion" } + String applicationVersion "Paradox Application version: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:applicationVersion" } + String bootloaderVersion "Paradox Bootloader version: [%s]" (Paradox) { channel = "paradoxalarm:panel:ip150:panel:bootloaderVersion" } //PARTITIONS - String partition1State “Magnetic sensors - Floor 1: [%s]†(Partitions) { channel = “paradoxalarm:partition:ip150:partition1:state†} - String partition1AdditionalStates “Floor1 MUC additional states: [%s]†(Partitions) { channel = “paradoxalarm:partition:ip150:partition1:additionalStates†} + String partition1State "Magnetic sensors - Floor 1: [%s]" (Partitions) { channel = "paradoxalarm:partition:ip150:partition1:state" } + String partition1AdditionalStates "Floor1 MUC additional states: [%s]" (Partitions) { channel = "paradoxalarm:partition:ip150:partition1:additionalStates" } //ZONES - Contact CorridorFl1_PIR_state “Corridor Fl1 motion: [%s]†(PIRSensors) { channel = “paradoxalarm:zone:ip150:MotionSensor1:opened†} - Contact CorridorFl1_MUC_state “Corridor Fl1 window: [%s]†(Floor1MUC) { channel = “paradoxalarm:zone:ip150:MagneticSensorWindow1:opened†} + Contact CorridorFl1_PIR_state "Corridor Fl1 motion: [%s]" (PIRSensors) { channel = "paradoxalarm:zone:ip150:MotionSensor1:opened" } + Contact CorridorFl1_MUC_state "Corridor Fl1 window: [%s]" (Floor1MUC) { channel = "paradoxalarm:zone:ip150:MagneticSensorWindow1:opened" } ``` ## Example sitemap configuration @@ -134,4 +166,12 @@ Currently binding supports the following panels: EVO192, EVO48(not tested), EVO9 Group item=PIRSensors } } -``` \ No newline at end of file +``` +## Acknowledgements +This binding would not be possible without the reverse engineering of the byte level protocol and the development by other authors in python, C# and other languages. Many thanks to the following authors and their respective github repositories for their development that helped in creating this binding: + +João Paulo Barraca - https://github.com/ParadoxAlarmInterface/pai + +Jean Henning - repository not available + +Tertuish - https://github.com/Tertiush/ParadoxIP150v2 / https://github.com/Tertiush/ParadoxIP150 \ No newline at end of file diff --git a/bundles/org.openhab.binding.paradoxalarm/pom.xml b/bundles/org.openhab.binding.paradoxalarm/pom.xml index 6b4f90476a1f6..9f9f53956a2cb 100644 --- a/bundles/org.openhab.binding.paradoxalarm/pom.xml +++ b/bundles/org.openhab.binding.paradoxalarm/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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> <artifactId>org.openhab.addons.reactor.bundles</artifactId> <groupId>org.openhab.addons.bundles</groupId> - <version>2.5.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.paradoxalarm</artifactId> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/feature/feature.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/feature/feature.xml index 6c54c5f2866b0..c6820307c1236 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.paradoxalarm-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-paradoxalarm" description="Paradox Alarm System Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/AbstractCommunicator.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/AbstractCommunicator.java index 55a3dc8932d64..ca4c4bc08ef16 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/AbstractCommunicator.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/AbstractCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,7 @@ import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; +import java.net.SocketException; import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Arrays; @@ -47,8 +48,10 @@ public abstract class AbstractCommunicator implements IConnectionHandler { protected ScheduledExecutorService scheduler; protected Collection<IDataUpdateListener> listeners; + protected int retryCounter = 0; protected Socket socket; + private ISocketTimeOutListener stoListener; private final String ipAddress; private final int tcpPort; @@ -67,7 +70,7 @@ public AbstractCommunicator(String ipAddress, int tcpPort, ScheduledExecutorServ } protected void initializeSocket() throws IOException, UnknownHostException { - if (socket != null) { + if (socket != null && !socket.isClosed()) { close(); } socket = new Socket(ipAddress, tcpPort); @@ -115,26 +118,29 @@ protected void sendPacket() { SyncQueue syncQueue = SyncQueue.getInstance(); IRequest request = syncQueue.peekSendQueue(); try { - logger.debug("Sending packet with request={}", request); + logger.trace("Sending packet with request={}", request); byte[] packetBytes = request.getRequestPayload().getBytes(); ParadoxUtil.printPacket("Tx Packet:", packetBytes); tx.write(packetBytes); syncQueue.moveRequest(); + } catch (SocketException e) { + logger.debug("Socket time out occurred. Informing listener. Request={}. Exception=", request, e); + syncQueue.removeSendRequest(); + stoListener.onSocketTimeOutOccurred(e); } catch (IOException e) { + logger.debug("Error while sending packet with request={}. IOException=", request, e); syncQueue.removeSendRequest(); - logger.debug("Error while sending packet with request={}. IOException={}. Will discard this request.", - request, e.getMessage()); } } protected void receivePacket() { SyncQueue syncQueue = SyncQueue.getInstance(); try { - logger.debug("Found packet to receive in queue..."); + logger.trace("Found packet to receive in queue..."); byte[] result = new byte[256]; int readBytes = rx.read(result); if (readBytes > 0 && result[1] > 0 && result[1] + 16 < 256) { - logger.debug("Successfully read valid packet from Rx"); + logger.trace("Successfully read valid packet from Rx"); retryCounter = 0; IRequest request = syncQueue.poll(); byte[] bytesData = Arrays.copyOfRange(result, 0, result[1] + 16); @@ -142,13 +148,17 @@ protected void receivePacket() { handleReceivedPacket(response); } else if (SyncQueue.getInstance().peekReceiveQueue() .isTimeStampExpired(PACKET_EXPIRATION_TRESHOLD_MILLISECONDS)) { - logger.debug("Unable to receive proper package for {} time. Rescheduling...", retryCounter); + logger.trace("Unable to receive proper package for {} time. Rescheduling...", retryCounter); } else { IRequest requestInQueue = syncQueue.poll(); - logger.debug("Error receiving packet after reaching the set treshold of retries. Request: {}", - requestInQueue); + logger.debug("Error receiving packet after reaching the set timeout of {}ms. Request: {}", + PACKET_EXPIRATION_TRESHOLD_MILLISECONDS, requestInQueue); retryCounter = 0; } + } catch (SocketException e) { + IRequest request = syncQueue.poll(); + logger.debug("Socket time out occurred. Informing listener. Request={}", request, e); + stoListener.onSocketTimeOutOccurred(e); } catch (IOException e) { IRequest request = syncQueue.poll(); retryCounter = 0; @@ -263,4 +273,13 @@ protected ParadoxIPPacket createParadoxIpPacket(IPPacketPayload payload) { protected abstract void receiveEpromResponse(IResponse response) throws ParadoxException; protected abstract void receiveRamResponse(IResponse response) throws ParadoxException; + + public ISocketTimeOutListener getStoListener() { + return stoListener; + } + + @Override + public void setStoListener(ISocketTimeOutListener stoListener) { + this.stoListener = stoListener; + } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/CommunicationState.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/CommunicationState.java index 8c62276f0f27e..548da82a6c1dc 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/CommunicationState.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/CommunicationState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,7 +42,7 @@ protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... String password = communicator.getPassword(); logger.debug("Phase {}", this); ParadoxIPPacket packet = new ParadoxIPPacket(password, false) - .setCommand(HeaderCommand.CONNECT_TO_IP_MODULE); + .setCommand(HeaderCommand.CONNECT_TO_IP_MODULE); sendPacket(communicator, packet); } @@ -96,7 +96,7 @@ protected CommunicationState nextState() { protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... args) { logger.debug("Phase {}", this); ParadoxIPPacket packet = new ParadoxIPPacket(ParadoxIPPacket.EMPTY_PAYLOAD, false) - .setCommand(HeaderCommand.LOGIN_COMMAND1); + .setCommand(HeaderCommand.LOGIN_COMMAND1); sendPacket(communicator, packet); } @@ -112,7 +112,7 @@ protected CommunicationState nextState() { protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... args) { logger.debug("Phase {}", this); ParadoxIPPacket packet = new ParadoxIPPacket(ParadoxIPPacket.EMPTY_PAYLOAD, false) - .setCommand(HeaderCommand.LOGIN_COMMAND2); + .setCommand(HeaderCommand.LOGIN_COMMAND2); sendPacket(communicator, packet); } @@ -130,7 +130,7 @@ protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... byte[] message4 = new byte[37]; message4[0] = 0x72; ParadoxIPPacket packet = new ParadoxIPPacket(message4, true) - .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST); + .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST); sendPacket(communicator, packet); } @@ -160,7 +160,7 @@ protected CommunicationState nextState() { protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... args) { logger.debug("Phase {}", this); ParadoxIPPacket packet = new ParadoxIPPacket(IpMessagesConstants.UNKNOWN_IP150_REQUEST_MESSAGE01, false) - .setCommand(HeaderCommand.SERIAL_CONNECTION_INITIATED); + .setCommand(HeaderCommand.SERIAL_CONNECTION_INITIATED); sendPacket(communicator, packet); } @@ -179,7 +179,7 @@ protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... message6[0] = 0x5F; message6[1] = 0x20; ParadoxIPPacket packet = new ParadoxIPPacket(message6, true) - .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST); + .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST); sendPacket(communicator, packet); } @@ -206,14 +206,14 @@ protected void runPhase(IParadoxInitialLoginCommunicator communicator, Object... byte[] initializationMessage = (byte[]) args[0]; logger.debug("Phase {}", this); byte[] message7 = generateInitializationRequest(initializationMessage, - communicator.getPcPasswordBytes()); + communicator.getPcPasswordBytes()); ParadoxIPPacket packet = new ParadoxIPPacket(message7, true) - .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST).setUnknown0((byte) 0x14); + .setMessageType(HeaderMessageType.SERIAL_PASSTHRU_REQUEST).setUnknown0((byte) 0x14); sendPacket(communicator, packet); } else { logger.error("Error in step {}. Missing argument {}", this, args); throw new IllegalArgumentException( - "Initialization message not send in request for phase + " + this + ". Arguments= " + args); + "Initialization message not send in request for phase + " + this + ". Arguments= " + args); } } @@ -291,7 +291,7 @@ protected void receiveResponse(IParadoxInitialLoginCommunicator communicator, IR logger.debug("Reading ghost packet with length={}", packetLength); ParadoxUtil.printPacket("Reading ghost packet", value); } catch (IOException e) { - logger.debug("Error reading ghost packet. {}", e); + logger.debug("Error reading ghost packet.", e); } super.receiveResponse(communicator, response); diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EpromRequest.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EpromRequest.java index 7ed008a3fd86a..cc64de0c0dbb3 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EpromRequest.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EpromRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,4 +39,9 @@ public int getEntityId() { return entityId; } + @Override + public String toString() { + return "EpromRequest [getType()=" + getType() + ", entityType=" + entityType + ", entityId=" + entityId + "]"; + } + } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EvoCommunicator.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EvoCommunicator.java index 1506516529a29..e57745e2d41cc 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EvoCommunicator.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/EvoCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -29,6 +29,7 @@ import org.openhab.binding.paradoxalarm.internal.communication.messages.ParadoxIPPacket; import org.openhab.binding.paradoxalarm.internal.communication.messages.RamRequestPayload; import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxException; +import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxRuntimeException; import org.openhab.binding.paradoxalarm.internal.model.EntityType; import org.openhab.binding.paradoxalarm.internal.model.PanelType; import org.openhab.binding.paradoxalarm.internal.model.ZoneStateFlags; @@ -49,15 +50,20 @@ public class EvoCommunicator extends GenericCommunicator implements IParadoxComm private MemoryMap memoryMap; - // Map of EntityTypes (Key:EntityType (Zone, Partition), Value: Map<entity IDs, Label> private Map<EntityType, Map<Integer, String>> entityLabelsMap = new HashMap<>(); private PanelType panelType = PanelType.UNKNOWN; + private Integer maxPartitions; + private Integer maxZones; - public EvoCommunicator(String ipAddress, int tcpPort, String ip150Password, String pcPassword, - ScheduledExecutorService scheduler, PanelType panelType) throws UnknownHostException, IOException { + private EvoCommunicator(String ipAddress, int tcpPort, String ip150Password, String pcPassword, + ScheduledExecutorService scheduler, PanelType panelType, Integer maxPartitions, Integer maxZones) + throws UnknownHostException, IOException { super(ipAddress, tcpPort, ip150Password, pcPassword, scheduler); this.panelType = panelType; + this.maxPartitions = maxPartitions; + this.maxZones = maxZones; + logger.debug("PanelType={}, max partitions={}, max Zones={}", panelType, maxPartitions, maxZones); initializeMemoryMap(); } @@ -77,15 +83,16 @@ protected void receiveRamResponse(IResponse response) throws ParadoxException { int ramBlockNumber = request.getRamBlockNumber(); byte[] parsedResult = parsePacket(response); - if (parsedResult != null) { + if (parsedResult != null && parsedResult.length == RAM_BLOCK_SIZE) { memoryMap.updateElement(ramBlockNumber, parsedResult); logger.trace("Result for ramBlock={} is [{}]", ramBlockNumber, parsedResult); } else { logger.debug("Wrong parsed result. Probably wrong data received in response"); + return; } // Trigger listeners update when last memory page update is received - if (ramBlockNumber == panelType.getRamPagesNumber() && listeners != null && !listeners.isEmpty()) { + if (ramBlockNumber == panelType.getRamPagesNumber()) { updateListeners(); } } @@ -221,7 +228,7 @@ public void refreshMemoryMap() { private void readRAM(int blockNo) { try { - logger.debug("Creating RAM page {} read request", blockNo); + logger.trace("Creating RAM page {} read request", blockNo); IPPacketPayload payload = new RamRequestPayload(blockNo, RAM_BLOCK_SIZE); ParadoxIPPacket ipPacket = createParadoxIpPacket(payload); IRequest ramRequest = new RamRequest(blockNo, ipPacket); @@ -283,11 +290,109 @@ public void initializeData() { } private void initializeEpromData() { - for (int i = 0; i < panelType.getPartitions(); i++) { + for (int i = 0; i < maxPartitions; i++) { retrievePartitionLabel(i); } - for (int i = 0; i < panelType.getZones(); i++) { + for (int i = 0; i < maxZones; i++) { retrieveZoneLabel(i); } } + + public static class EvoCommunicatorBuilder implements ICommunicatorBuilder { + + private final Logger logger = LoggerFactory.getLogger(EvoCommunicatorBuilder.class); + + // Mandatory parameters + private PanelType panelType; + private String ipAddress; + private String ip150Password; + private ScheduledExecutorService scheduler; + + // Non mandatory or with predefined values + private Integer maxPartitions; + private Integer maxZones; + private int tcpPort = 10000; + private String pcPassword = "0000"; + + EvoCommunicatorBuilder(PanelType panelType) { + this.panelType = panelType; + } + + @Override + public IParadoxCommunicator build() { + if (panelType != PanelType.EVO48 && panelType != PanelType.EVO96 && panelType != PanelType.EVO192) { + throw new ParadoxRuntimeException("Unknown or unsupported panel type. Type=" + panelType); + } + + if (ipAddress == null || ipAddress.isEmpty()) { + throw new ParadoxRuntimeException("IP address cannot be empty !"); + } + + if (ip150Password == null || ip150Password.isEmpty()) { + throw new ParadoxRuntimeException("Password for IP150 cannot be empty !"); + } + + if (scheduler == null) { + throw new ParadoxRuntimeException("Scheduler is mandatory parameter !"); + } + + if (maxPartitions == null || maxPartitions < 1) { + this.maxPartitions = panelType.getPartitions(); + } + + if (maxZones == null || maxZones < 1) { + this.maxZones = panelType.getZones(); + } + + try { + return new EvoCommunicator(ipAddress, tcpPort, ip150Password, pcPassword, scheduler, panelType, + maxPartitions, maxZones); + } catch (IOException e) { + logger.warn("Unable to create communicator for Panel={}. Message={}", panelType, e.getMessage()); + throw new ParadoxRuntimeException(e); + } + } + + @Override + public ICommunicatorBuilder withMaxZones(Integer maxZones) { + this.maxZones = maxZones; + return this; + } + + @Override + public ICommunicatorBuilder withMaxPartitions(Integer maxPartitions) { + this.maxPartitions = maxPartitions; + return this; + } + + @Override + public ICommunicatorBuilder withIp150Password(String ip150Password) { + this.ip150Password = ip150Password; + return this; + } + + @Override + public ICommunicatorBuilder withPcPassword(String pcPassword) { + this.pcPassword = pcPassword; + return this; + } + + @Override + public ICommunicatorBuilder withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + @Override + public ICommunicatorBuilder withTcpPort(Integer tcpPort) { + this.tcpPort = tcpPort; + return this; + } + + @Override + public ICommunicatorBuilder withScheduler(ScheduledExecutorService scheduler) { + this.scheduler = scheduler; + return this; + } + } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/GenericCommunicator.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/GenericCommunicator.java index 51f552afed3c7..1e7e491a57b86 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/GenericCommunicator.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/GenericCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -67,14 +67,13 @@ public synchronized void startLoginSequence() { protected void handleReceivedPacket(IResponse response) { retryCounter = 0; IRequest request = response.getRequest(); - logger.debug("Handling response for request={}", request); + logger.trace("Handling response for request={}", request); RequestType type = request.getType(); // Send back the response to proper receive methods switch (type) { case LOGON_SEQUENCE: - CommunicationState logonSequenceSender = ((LogonRequest) request) - .getLogonSequenceSender(); + CommunicationState logonSequenceSender = ((LogonRequest) request).getLogonSequenceSender(); logonSequenceSender.receiveResponse(this, response); break; case RAM: @@ -90,8 +89,8 @@ protected void handleReceivedPacket(IResponse response) { receiveEpromResponse(response); } catch (ParadoxException e) { EpromRequest epromRequest = (EpromRequest) request; - logger.debug("Unable to retrieve EPROM message for entity Type={}, Id={}", epromRequest.getEntityType(), - epromRequest.getEntityId()); + logger.debug("Unable to retrieve EPROM message for entity Type={}, Id={}", + epromRequest.getEntityType(), epromRequest.getEntityId()); } break; } @@ -143,6 +142,8 @@ public void setListeners(Collection<IDataUpdateListener> listeners) { @Override public void updateListeners() { - listeners.forEach(IDataUpdateListener::update); + if (listeners != null && !listeners.isEmpty()) { + listeners.forEach(IDataUpdateListener::update); + } } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ICommunicatorBuilder.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ICommunicatorBuilder.java new file mode 100644 index 0000000000000..2d2600dc4ea40 --- /dev/null +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ICommunicatorBuilder.java @@ -0,0 +1,39 @@ +/** + * 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.paradoxalarm.internal.communication; + +import java.util.concurrent.ScheduledExecutorService; + +/** + * The {@link ICommunicatorBuilder} is representing the functionality of communicator builders. + * The idea is to ease initialization of communicators which can have lots of parameters. + * + * @author Konstantin Polihronov - Initial contribution + */ +public interface ICommunicatorBuilder { + ICommunicatorBuilder withMaxZones(Integer zones); + + ICommunicatorBuilder withMaxPartitions(Integer partitions); + + ICommunicatorBuilder withIp150Password(String ip150Password); + + ICommunicatorBuilder withPcPassword(String pcPassword); + + ICommunicatorBuilder withIpAddress(String ipAddress); + + ICommunicatorBuilder withTcpPort(Integer tcpPort); + + ICommunicatorBuilder withScheduler(ScheduledExecutorService scheduler); + + IParadoxCommunicator build(); +} diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IConnectionHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IConnectionHandler.java index f06bf425a6cab..67313604ae289 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IConnectionHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IConnectionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,4 +27,9 @@ public interface IConnectionHandler { void submitRequest(IRequest request); + /** + * @param stoListener This method sets a listener which is called in case of socket timeout occurrence. + */ + void setStoListener(ISocketTimeOutListener stoListener); + } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IDataUpdateListener.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IDataUpdateListener.java index 1263e2d84e3fe..d9c3a2f2c4d79 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IDataUpdateListener.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IDataUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IP150Command.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IP150Command.java index 097872f18bff5..487d362666a51 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IP150Command.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IP150Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxCommunicator.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxCommunicator.java index 307fd25375c05..88db7824d179d 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxCommunicator.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxInitialLoginCommunicator.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxInitialLoginCommunicator.java index ba5e436426d60..e1f917b553b01 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxInitialLoginCommunicator.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IParadoxInitialLoginCommunicator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IRequest.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IRequest.java index c53adb08f7d87..a3425796aaa60 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IRequest.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IResponse.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IResponse.java index 5455b30d9623c..7538aac1506f2 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IResponse.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/IResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ISocketTimeOutListener.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ISocketTimeOutListener.java new file mode 100644 index 0000000000000..96ee5b90a81d0 --- /dev/null +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ISocketTimeOutListener.java @@ -0,0 +1,25 @@ +/** + * 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.paradoxalarm.internal.communication; + +import java.io.IOException; + +/** + * The {@link ISocketTimeOutListener} Listener interface for informing listeners who may be interested and act in case + * of socket time out occurs. + * + * @author Konstantin Polihronov - Initial contribution + */ +public interface ISocketTimeOutListener { + void onSocketTimeOutOccurred(IOException exception); +} diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/LogonRequest.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/LogonRequest.java index d967675ce9042..93140a232700b 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/LogonRequest.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/LogonRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,4 +31,9 @@ public LogonRequest(CommunicationState logonSequenceSender, IPPacketPayload payl public CommunicationState getLogonSequenceSender() { return logonSequenceSender; } + + @Override + public String toString() { + return "LogonRequest [getType()=" + getType() + ", getLogonSequenceSender()=" + getLogonSequenceSender() + "]"; + } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/MemoryMap.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/MemoryMap.java index f2534d8559990..7d8f2958723ff 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/MemoryMap.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/MemoryMap.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxBuilderFactory.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxBuilderFactory.java new file mode 100644 index 0000000000000..b6b24e68923df --- /dev/null +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxBuilderFactory.java @@ -0,0 +1,41 @@ +/** + * 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.paradoxalarm.internal.communication; + +import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxRuntimeException; +import org.openhab.binding.paradoxalarm.internal.model.PanelType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ParadoxBuilderFactory} used to create the proper communicator builder objects for different panel + * types. + * + * @author Konstantin Polihronov - Initial contribution + */ +public class ParadoxBuilderFactory { + + private final Logger logger = LoggerFactory.getLogger(ParadoxBuilderFactory.class); + + public ICommunicatorBuilder createBuilder(PanelType panelType) { + switch (panelType) { + case EVO48: + case EVO96: + case EVO192: + logger.debug("Creating new builder for Paradox {} system", panelType); + return new EvoCommunicator.EvoCommunicatorBuilder(panelType); + default: + throw new ParadoxRuntimeException("Unsupported panel type: " + panelType); + } + } +} diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxCommunicatorFactory.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxCommunicatorFactory.java deleted file mode 100644 index 52c344d57dd87..0000000000000 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/ParadoxCommunicatorFactory.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.paradoxalarm.internal.communication; - -import java.io.IOException; -import java.net.UnknownHostException; -import java.util.concurrent.ScheduledExecutorService; - -import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxException; -import org.openhab.binding.paradoxalarm.internal.model.PanelType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ParadoxCommunicatorFactory} used to create the proper communication implementation objects based on panel - * type. - * - * @author Konstantin Polihronov - Initial contribution - */ -public class ParadoxCommunicatorFactory { - - private final Logger logger = LoggerFactory.getLogger(ParadoxCommunicatorFactory.class); - - private String ipAddress; - private int tcpPort; - private String ip150Password; - private String pcPassword; - private ScheduledExecutorService scheduler; - - public ParadoxCommunicatorFactory(String ipAddress, int tcpPort, String ip150Password, String pcPassword, - ScheduledExecutorService scheduler) { - this.ipAddress = ipAddress; - this.tcpPort = tcpPort; - this.ip150Password = ip150Password; - this.pcPassword = pcPassword; - this.scheduler = scheduler; - } - - public IParadoxCommunicator createCommunicator(String panelTypeStr) { - PanelType panelType = PanelType.from(panelTypeStr); - try { - return createCommunicator(panelType); - } catch (IOException | ParadoxException e) { - logger.warn("Unable to create communicator for Panel {}. Exception={}", panelTypeStr, e.getMessage()); - return null; - } - } - - public IParadoxCommunicator createCommunicator(PanelType panelType) - throws UnknownHostException, IOException, ParadoxException { - switch (panelType) { - case EVO48: - case EVO192: - case EVOHD: - logger.debug("Creating new communicator for Paradox {} system", panelType); - return new EvoCommunicator(ipAddress, tcpPort, ip150Password, pcPassword, scheduler, panelType); - default: - throw new ParadoxException("Unsupported panel type: " + panelType); - } - } -} diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RamRequest.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RamRequest.java index c56bf4b1719c0..e22a5e2761aef 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RamRequest.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RamRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,4 +31,11 @@ public RamRequest(int ramBlockNumber, IPPacketPayload payload) { public int getRamBlockNumber() { return ramBlockNumber; } + + @Override + public String toString() { + return "RamRequest [getType()=" + getType() + ", getRamBlockNumber()=" + getRamBlockNumber() + "]"; + } + + } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Request.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Request.java index e811ad09e0163..c51192427bb97 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Request.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Request.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RequestType.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RequestType.java index 35b12a82393e7..5b0fc6cbf5318 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RequestType.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/RequestType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Response.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Response.java index 18fecc75a133a..e1f275a80c5f5 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Response.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/SyncQueue.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/SyncQueue.java index a056fdf0b440d..7d87253f62955 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/SyncQueue.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/SyncQueue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -54,26 +54,26 @@ public static SyncQueue getInstance() { } public synchronized void add(IRequest request) { - logger.debug("Adding to queue request={}", request); + logger.trace("Adding to queue request={}", request); sendQueue.add(request); } public synchronized void moveRequest() { IRequest request = sendQueue.poll(); request.setTimeStamp(); - logger.debug("Moving from Tx to RX queue request={}", request); + logger.trace("Moving from Tx to RX queue request={}", request); receiveQueue.add(request); } public synchronized IRequest poll() { IRequest request = receiveQueue.poll(); - logger.debug("Removing from queue request={}", request); + logger.trace("Removing from queue request={}", request); return request; } public synchronized IRequest removeSendRequest() { IRequest request = sendQueue.poll(); - logger.debug("Removing from queue request={}", request); + logger.trace("Removing from queue request={}", request); return request; } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/EpromRequestPayload.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/EpromRequestPayload.java index ea0928207b204..a11fbe7183b65 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/EpromRequestPayload.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/EpromRequestPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderCommand.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderCommand.java index 59d06c6d32e51..7cf0e3745f677 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderCommand.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderMessageType.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderMessageType.java index df6afe4fa6545..9e970e7d8f010 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderMessageType.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/HeaderMessageType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IPPacketPayload.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IPPacketPayload.java index 71345b2f3be3b..8ea56ff552d5d 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IPPacketPayload.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IPPacketPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IpMessagesConstants.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IpMessagesConstants.java index 4a5569d91e32f..66c3f02e8e763 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IpMessagesConstants.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/IpMessagesConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/MemoryRequestPayload.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/MemoryRequestPayload.java index a8a6a710a5628..b2892cb5f0309 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/MemoryRequestPayload.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/MemoryRequestPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/ParadoxIPPacket.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/ParadoxIPPacket.java index 17b6cddf4d6b3..da3a511bdeee9 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/ParadoxIPPacket.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/ParadoxIPPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/RamRequestPayload.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/RamRequestPayload.java index 0b28730927d8c..6ffb14ce381da 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/RamRequestPayload.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/communication/messages/RamRequestPayload.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/discovery/ParadoxDiscoveryService.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/discovery/ParadoxDiscoveryService.java index 546df5bb6a2cf..235a6ce2fef1d 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/discovery/ParadoxDiscoveryService.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/discovery/ParadoxDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -58,7 +58,7 @@ protected void startScan() { discoverPartitions(panel.getPartitions()); discoverZones(panel.getZones()); } else { - logger.debug("Communicator null or not online. Trace={}", new ParadoxRuntimeException()); + logger.debug("Communicator null or not online. Trace:", new ParadoxRuntimeException()); } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxException.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxException.java index 05b3e06fa378c..ba8a21a571b11 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxException.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxRuntimeException.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxRuntimeException.java index e3519a65c6e64..d48e64e17bff8 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxRuntimeException.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/exceptions/ParadoxRuntimeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityBaseHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityBaseHandler.java index 60759ee200e30..bed4a9434b92b 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityBaseHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityConfiguration.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityConfiguration.java index 80e8e763ccae2..9762b325be0a2 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityConfiguration.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/EntityConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmBindingConstants.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmBindingConstants.java index e4b36d4ea85cd..13203997792f0 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmBindingConstants.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,14 +42,14 @@ public class ParadoxAlarmBindingConstants { // List of all Thing Type UIDs public static final ThingTypeUID COMMUNICATOR_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, - PARADOX_COMMUNICATOR_THING_TYPE_ID); + PARADOX_COMMUNICATOR_THING_TYPE_ID); public static final ThingTypeUID PANEL_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, PARADOX_PANEL_THING_TYPE_ID); public static final ThingTypeUID PARTITION_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, PARTITION_THING_TYPE_ID); public static final ThingTypeUID ZONE_THING_TYPE_UID = new ThingTypeUID(BINDING_ID, ZONE_THING_TYPE_ID); public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet( - Stream.of(COMMUNICATOR_THING_TYPE_UID, PANEL_THING_TYPE_UID, PARTITION_THING_TYPE_UID, ZONE_THING_TYPE_UID) - .collect(Collectors.toSet())); + Stream.of(COMMUNICATOR_THING_TYPE_UID, PANEL_THING_TYPE_UID, PARTITION_THING_TYPE_UID, ZONE_THING_TYPE_UID) + .collect(Collectors.toSet())); // List of all Channel UIDs public static final String IP150_COMMUNICATION_COMMAND_CHANNEL_UID = "communicationCommand"; @@ -61,9 +61,26 @@ public class ParadoxAlarmBindingConstants { public static final String PANEL_APPLICATION_VERSION_PROPERTY_NAME = "applicationVersion"; public static final String PANEL_BOOTLOADER_VERSION_PROPERTY_NAME = "bootloaderVersion"; - public static final String PARTITION_ADDITIONAL_STATES_CHANNEL_UID = "additionalStates"; - public static final String PARTITION_STATE_CHANNEL_UID = "state"; public static final String PARTITION_LABEL_CHANNEL_UID = "partitionLabel"; + public static final String PARTITION_STATE_CHANNEL_UID = "state"; + @Deprecated // After implementation of channels for every possible state, the summarized additional states is no + // longer needed. We'll keep it for backward compatibility + public static final String PARTITION_ADDITIONAL_STATES_CHANNEL_UID = "additionalStates"; + public static final String PARTITION_READY_TO_ARM_CHANNEL_UID = "readyToArm"; + public static final String PARTITION_IN_EXIT_DELAY_CHANNEL_UID = "inExitDelay"; + public static final String PARTITION_IN_ENTRY_DELAY_CHANNEL_UID = "inEntryDelay"; + public static final String PARTITION_IN_TROUBLE_CHANNEL_UID = "inTrouble"; + public static final String PARTITION_ALARM_IN_MEMORY_CHANNEL_UID = "alarmInMemory"; + public static final String PARTITION_ZONE_BYPASS_CHANNEL_UID = "zoneBypass"; + public static final String PARTITION_ZONE_IN_TAMPER_CHANNEL_UID = "zoneInTamperTrouble"; + public static final String PARTITION_ZONE_IN_LOW_BATTERY_CHANNEL_UID = "zoneInLowBatteryTrouble"; + public static final String PARTITION_ZONE_IN_FIRE_LOOP_CHANNEL_UID = "zoneInFireLoopTrouble"; + public static final String PARTITION_ZONE_IN_SUPERVISION_TROUBLE_CHANNEL_UID = "zoneInSupervisionTrouble"; + public static final String PARTITION_STAY_INSTANT_READY_CHANNEL_UID = "stayInstantReady"; + public static final String PARTITION_FORCE_READY_CHANNEL_UID = "forceReady"; + public static final String PARTITION_BYPASS_READY_CHANNEL_UID = "bypassReady"; + public static final String PARTITION_INHIBIT_READY_CHANNEL_UID = "inhibitReady"; + public static final String PARTITION_ALL_ZONES_CLOSED_CHANNEL_UID = "allZonesClosed"; public static final String ZONE_LABEL_CHANNEL_UID = "zoneLabel"; public static final String ZONE_OPENED_CHANNEL_UID = "opened"; diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmHandlerFactory.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmHandlerFactory.java index 34704f28700c3..bdb1082675d45 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmHandlerFactory.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxAlarmHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeConfiguration.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeConfiguration.java index 666c8f0ae4b15..58e5c4f6d95bd 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeConfiguration.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,6 +25,9 @@ public class ParadoxIP150BridgeConfiguration { private String ipAddress; private int port; private String panelType; + private int reconnectWaitTime; + private Integer maxZones; + private Integer maxPartitions; public int getRefresh() { return refresh; @@ -74,4 +77,28 @@ public void setPanelType(String panelType) { this.panelType = panelType; } + public int getReconnectWaitTime() { + return reconnectWaitTime; + } + + public void setReconnectWaitTime(int reconnectWaitTime) { + this.reconnectWaitTime = reconnectWaitTime; + } + + public Integer getMaxZones() { + return maxZones; + } + + public void setMaxZones(Integer maxZones) { + this.maxZones = maxZones; + } + + public Integer getMaxPartitions() { + return maxPartitions; + } + + public void setMaxPartitions(Integer maxPartitions) { + this.maxPartitions = maxPartitions; + } + } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeHandler.java index 73de9d660b0aa..31dfe266ed03d 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxIP150BridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,10 +35,13 @@ import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.paradoxalarm.internal.communication.CommunicationState; import org.openhab.binding.paradoxalarm.internal.communication.GenericCommunicator; +import org.openhab.binding.paradoxalarm.internal.communication.ICommunicatorBuilder; import org.openhab.binding.paradoxalarm.internal.communication.IDataUpdateListener; +import org.openhab.binding.paradoxalarm.internal.communication.IP150Command; import org.openhab.binding.paradoxalarm.internal.communication.IParadoxCommunicator; import org.openhab.binding.paradoxalarm.internal.communication.IParadoxInitialLoginCommunicator; -import org.openhab.binding.paradoxalarm.internal.communication.ParadoxCommunicatorFactory; +import org.openhab.binding.paradoxalarm.internal.communication.ISocketTimeOutListener; +import org.openhab.binding.paradoxalarm.internal.communication.ParadoxBuilderFactory; import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxRuntimeException; import org.openhab.binding.paradoxalarm.internal.model.PanelType; import org.openhab.binding.paradoxalarm.internal.model.ParadoxInformationConstants; @@ -54,7 +57,8 @@ */ @SuppressWarnings("null") @NonNullByDefault({}) -public class ParadoxIP150BridgeHandler extends BaseBridgeHandler implements IDataUpdateListener { +public class ParadoxIP150BridgeHandler extends BaseBridgeHandler + implements IDataUpdateListener, ISocketTimeOutListener { private static final String RESET_COMMAND = "RESET"; @@ -71,6 +75,8 @@ public class ParadoxIP150BridgeHandler extends BaseBridgeHandler implements IDat private long timeStamp = 0; + private ScheduledFuture<?> resetScheduleFuture; + public ParadoxIP150BridgeHandler(Bridge bridge) { super(bridge); } @@ -95,18 +101,20 @@ private synchronized void initializeCommunicator() { logger.debug("Phase1 - Identify communicator"); IParadoxInitialLoginCommunicator initialCommunicator = new GenericCommunicator(ipAddress, tcpPort, - ip150Password, pcPassword, scheduler); + ip150Password, pcPassword, scheduler); initialCommunicator.startLoginSequence(); timeStamp = System.currentTimeMillis(); scheduler.schedule(() -> doPostOnlineTask(initialCommunicator), 500, TimeUnit.MILLISECONDS); } catch (UnknownHostException e) { logger.warn("Error while starting socket communication. {}", e.getMessage()); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Unknown host. Probably misconfiguration or DNS issue."); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Unknown host. Probably misconfiguration or DNS issue."); throw new ParadoxRuntimeException(e); } catch (IOException e) { logger.warn("Error while starting socket communication. {}", e.getMessage()); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error while starting socket communication."); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "Error while starting socket communication."); throw new ParadoxRuntimeException(e); } } @@ -118,9 +126,10 @@ private synchronized void doPostOnlineTask(IParadoxInitialLoginCommunicator init logger.debug("Communicator not yet online. Rescheduling..."); } else { logger.warn( - "Initial communicator not coming up online for {} seconds. Probably there is something wrong with communication.", - ONLINE_WAIT_TRESHOLD_MILLIS); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error while starting socket communication."); + "Initial communicator not coming up online for {} seconds. Probably there is something wrong with communication.", + ONLINE_WAIT_TRESHOLD_MILLIS); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "Error while starting socket communication."); } return; } @@ -131,34 +140,30 @@ private synchronized void doPostOnlineTask(IParadoxInitialLoginCommunicator init logger.info("Found {} panel type.", panelType); CommunicationState.logout(initialCommunicator); - // Wait 3 seconds before we create the discovered communicator so we ensure that the socket is closed successfully from - // both ends + // Wait 3 seconds before we create the discovered communicator so we ensure that the socket is closed + // successfully from both ends scheduler.schedule(() -> createDiscoveredCommunicatorJob(panelType), 3, TimeUnit.SECONDS); } protected void createDiscoveredCommunicatorJob(PanelType panelType) { // If not detected properly, use the value from config - String panelTypeStr; - if (panelType != PanelType.UNKNOWN) { - panelTypeStr = panelType.name(); - } else { - panelTypeStr = config.getPanelType(); + if (panelType == PanelType.UNKNOWN) { + panelType = PanelType.from(config.getPanelType()); } logger.debug("Phase2 - Creating communicator for panel {}", panelType); - String ipAddress = config.getIpAddress(); - int tcpPort = config.getPort(); - String ip150Password = config.getIp150Password(); - String pcPassword = config.getPcPassword(); - ParadoxCommunicatorFactory factory = new ParadoxCommunicatorFactory(ipAddress, tcpPort, ip150Password, - pcPassword, scheduler); - communicator = factory.createCommunicator(panelTypeStr); + ICommunicatorBuilder builder = new ParadoxBuilderFactory().createBuilder(panelType); + communicator = builder.withIp150Password(config.getIp150Password()).withPcPassword(config.getPcPassword()) + .withIpAddress(config.getIpAddress()).withTcpPort(config.getPort()) + .withMaxPartitions(config.getMaxPartitions()).withMaxZones(config.getMaxZones()) + .withScheduler(scheduler).build(); ParadoxPanel panel = ParadoxPanel.getInstance(); panel.setCommunicator(communicator); Collection<IDataUpdateListener> listeners = Arrays.asList(panel, this); communicator.setListeners(listeners); + communicator.setStoListener(this); communicator.startLoginSequence(); @@ -173,8 +178,10 @@ private void doPostOnlineFinalCommunicatorJob() { logger.debug("Communicator not yet online. Rescheduling..."); return; } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error while starting socket communication."); - throw new ParadoxRuntimeException("Communicator didn't go online in defined treshold time. " + ONLINE_WAIT_TRESHOLD_MILLIS + "sec."); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "Error while starting socket communication."); + throw new ParadoxRuntimeException("Communicator didn't go online in defined treshold time. " + + ONLINE_WAIT_TRESHOLD_MILLIS + "sec."); } } @@ -191,9 +198,17 @@ public void dispose() { private void scheduleRefresh() { logger.debug("Scheduling cache update. Refresh interval: {}s. Starts after: {}s.", config.getRefresh(), - INITIAL_SCHEDULE_DELAY_SECONDS); + INITIAL_SCHEDULE_DELAY_SECONDS); refreshCacheUpdateSchedule = scheduler.scheduleWithFixedDelay(communicator::refreshMemoryMap, - INITIAL_SCHEDULE_DELAY_SECONDS, config.getRefresh(), TimeUnit.SECONDS); + INITIAL_SCHEDULE_DELAY_SECONDS, config.getRefresh(), TimeUnit.SECONDS); + } + + private void cancelSchedule(@Nullable ScheduledFuture<?> schedule) { + if (schedule != null && !schedule.isCancelled()) { + boolean cancelingResult = schedule.cancel(true); + String cancelingSuccessful = cancelingResult ? "successful" : "failed"; + logger.debug("Canceling schedule of {} is {}", schedule, cancelingSuccessful); + } } @Override @@ -203,7 +218,7 @@ public void update() { for (Thing thing : things) { ThingHandler handler = thing.getHandler(); Channel bridgeChannel = bridge - .getChannel(ParadoxAlarmBindingConstants.IP150_COMMUNICATION_COMMAND_CHANNEL_UID); + .getChannel(ParadoxAlarmBindingConstants.IP150_COMMUNICATION_COMMAND_CHANNEL_UID); if (handler != null && bridgeChannel != null) { handler.handleCommand(bridgeChannel.getUID(), RefreshType.REFRESH); } @@ -223,7 +238,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { String commandAsString = command.toFullString(); if (commandAsString.equals(RESET_COMMAND)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, - "Bringing bridge offline due to reinitialization of communicator."); + "Bringing bridge offline due to reinitialization of communicator."); resetCommunicator(); } else { communicator.executeCommand(commandAsString); @@ -242,14 +257,18 @@ public void handleCommand(ChannelUID channelUID, Command command) { } private void resetCommunicator() { + updateStatus(ThingStatus.OFFLINE); + synchronized (communicator) { if (communicator != null) { CommunicationState.logout(communicator); } + initializeCommunicator(); } - } + resetScheduleFuture = null; + } @Override protected void updateStatus(ThingStatus status, ThingStatusDetail statusDetail, @Nullable String description) { @@ -263,16 +282,21 @@ protected void updateStatus(ThingStatus status, ThingStatusDetail statusDetail, } } - private void cancelSchedule(@Nullable ScheduledFuture<?> schedule) { - if (schedule != null) { - boolean cancelingResult = schedule.cancel(true); - String cancelingSuccessful = cancelingResult ? "successful" : "failed"; - logger.debug("Canceling schedule of {} is {}", schedule, cancelingSuccessful); - } - } - public IParadoxCommunicator getCommunicator() { return communicator; } + @Override + public void onSocketTimeOutOccurred(IOException exception) { + logger.warn("TIMEOUT! {} received message for socket timeout. ", this, exception); + if (resetScheduleFuture == null) { + communicator.executeCommand(IP150Command.LOGOUT.name()); + + logger.warn("Reset task is null. Will schedule new task to reset communicator in {} seconds.", + config.getReconnectWaitTime()); + resetScheduleFuture = scheduler.schedule(this::resetCommunicator, config.getReconnectWaitTime(), + TimeUnit.SECONDS); + } + } + } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPanelHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPanelHandler.java index ee9dd05212375..84d37ce273d4e 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPanelHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPanelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPartitionHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPartitionHandler.java index 10c8946abc5bb..27e24daea6d42 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPartitionHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxPartitionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,8 @@ import java.util.List; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.OpenClosedType; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.Thing; import org.openhab.binding.paradoxalarm.internal.model.ParadoxPanel; @@ -46,7 +48,40 @@ protected void updateEntity() { updateState(PARTITION_LABEL_CHANNEL_UID, new StringType(partition.getLabel())); updateState(PARTITION_STATE_CHANNEL_UID, new StringType(partition.getState().getMainState())); updateState(PARTITION_ADDITIONAL_STATES_CHANNEL_UID, - new StringType(partition.getState().getAdditionalState())); + new StringType("Deprecated field. Use direct channels instead")); + updateState(PARTITION_READY_TO_ARM_CHANNEL_UID, booleanToSwitchState(partition.getState().isReadyToArm())); + updateState(PARTITION_IN_EXIT_DELAY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isInExitDelay())); + updateState(PARTITION_IN_ENTRY_DELAY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isInEntryDelay())); + updateState(PARTITION_IN_TROUBLE_CHANNEL_UID, booleanToSwitchState(partition.getState().isInTrouble())); + updateState(PARTITION_ALARM_IN_MEMORY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isHasAlarmInMemory())); + updateState(PARTITION_ZONE_BYPASS_CHANNEL_UID, booleanToSwitchState(partition.getState().isInZoneBypass())); + updateState(PARTITION_ZONE_IN_TAMPER_CHANNEL_UID, + booleanToSwitchState(partition.getState().isHasZoneInTamperTrouble())); + updateState(PARTITION_ZONE_IN_LOW_BATTERY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isHasZoneInLowBatteryTrouble())); + updateState(PARTITION_ZONE_IN_FIRE_LOOP_CHANNEL_UID, + booleanToSwitchState(partition.getState().isHasZoneInFireLoopTrouble())); + updateState(PARTITION_ZONE_IN_SUPERVISION_TROUBLE_CHANNEL_UID, + booleanToSwitchState(partition.getState().isHasZoneInSupervisionTrouble())); + updateState(PARTITION_STAY_INSTANT_READY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isStayInstantReady())); + updateState(PARTITION_FORCE_READY_CHANNEL_UID, booleanToSwitchState(partition.getState().isForceReady())); + updateState(PARTITION_BYPASS_READY_CHANNEL_UID, booleanToSwitchState(partition.getState().isBypassReady())); + updateState(PARTITION_INHIBIT_READY_CHANNEL_UID, + booleanToSwitchState(partition.getState().isInhibitReady())); + updateState(PARTITION_ALL_ZONES_CLOSED_CHANNEL_UID, + booleanToContactState(partition.getState().isAreAllZoneclosed())); } } + + private OpenClosedType booleanToContactState(boolean value) { + return value ? OpenClosedType.OPEN : OpenClosedType.CLOSED; + } + + private OnOffType booleanToSwitchState(boolean value) { + return value ? OnOffType.ON : OnOffType.OFF; + } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxZoneHandler.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxZoneHandler.java index b683f0aa80370..4bb17092b70ca 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxZoneHandler.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/handlers/ParadoxZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Entity.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Entity.java index dafc709dfc306..9768810a67785 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Entity.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Entity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/EntityType.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/EntityType.java index be7d1c007c1a8..8dfe4dfb355d8 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/EntityType.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/EntityType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PanelType.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PanelType.java index 0ee93f588c954..3aca55fc42d5b 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PanelType.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PanelType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformation.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformation.java index 7c67313870b41..f1c3c353466c3 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformation.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformationConstants.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformationConstants.java index 0b2d7ae29fa06..9965c734d7626 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformationConstants.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxInformationConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxPanel.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxPanel.java index ad696526c3a99..32db382dc4edc 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxPanel.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ParadoxPanel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,7 +33,7 @@ public class ParadoxPanel implements IDataUpdateListener { private final Logger logger = LoggerFactory.getLogger(ParadoxPanel.class); - private static ParadoxPanel paradoxPanel; + private static ParadoxPanel paradoxPanel = new ParadoxPanel(); private ParadoxInformation panelInformation; private List<Partition> partitions; @@ -56,18 +56,11 @@ public void createModelEntities() { updateEntitiesStates(); } else { throw new ParadoxRuntimeException( - "Unsupported panel type. Type: " + panelInformation.getPanelType().name()); + "Unsupported panel type. Type: " + panelInformation.getPanelType().name()); } } public static ParadoxPanel getInstance() { - if (paradoxPanel == null) { - synchronized (ParadoxPanel.class) { - if (paradoxPanel == null) { - paradoxPanel = new ParadoxPanel(); - } - } - } return paradoxPanel; } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Partition.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Partition.java index 62cb8cddc3323..6147c8b6bc9cf 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Partition.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Partition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -37,8 +37,7 @@ public PartitionState getState() { public Partition setState(PartitionState state) { this.state = state; - logger.debug("Partition {}:\t{},\tAdditional:{}", getLabel(), getState().getMainState(), - getState().getAdditionalState()); + logger.debug("Partition {}:\t{}", getLabel(), getState().getMainState()); return this; } } diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PartitionState.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PartitionState.java index fc2de0d042e3f..d10292ac718e8 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PartitionState.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/PartitionState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,80 +47,26 @@ public class PartitionState { private boolean areAllZoneclosed; public String getMainState() { - return isArmed | isArmedInAway | isArmedInNoEntry | isArmedInStay ? "Armed" : "Disarmed"; - } - - public String getAdditionalState() { - StringBuilder sb = new StringBuilder(); if (isInAlarm) { - append(sb, "In alarm"); - } else if (isInSilentAlarm) { - append(sb, "Silent alarm"); - } else if (isInAudibleAlarm) { - append(sb, "Audible alarm"); - } else if (isInFireAlarm) { - append(sb, "Fire alarm"); - } - - if (isReadyToArm) { - append(sb, "Ready to arm"); - } - if (isInTrouble) { - append(sb, "Trouble"); - } - if (hasAlarmInMemory) { - append(sb, "Alarm in memory"); - } - if (isInZoneBypass) { - append(sb, "Zone bypassed"); - } - - if (hasZoneInTamperTrouble) { - append(sb, "Tamper trouble"); - } - if (hasZoneInLowBatteryTrouble) { - append(sb, "Low battery trouble"); - } - if (hasZoneInFireLoopTrouble) { - append(sb, "Fire Loop trouble"); + return "InAlarm"; + } else { + return isArmed || isArmedInAway || isArmedInStay || isArmedInNoEntry ? "Armed" : "Disarmed"; } - if (hasZoneInSupervisionTrouble) { - append(sb, "Supervision trouble"); - } - - if (isStayInstantReady) { - append(sb, "Stay instant ready"); - } - if (isForceReady) { - append(sb, "Force ready"); - } - if (isBypassReady) { - append(sb, "Bypass ready"); - } - if (isInhibitReady) { - append(sb, "Inhibit ready"); - } - - if (areAllZoneclosed) { - append(sb, "All zones closed"); - } - - return sb.toString(); - } - - public void append(StringBuilder sb, String value) { - sb.append(value); - sb.append(";"); } @Override public String toString() { - return "PartitionState [isArmed=" + isArmed + ", isArmedInAway=" + isArmedInAway + ", isArmedInStay=" + isArmedInStay + ", isArmedInNoEntry=" + isArmedInNoEntry + ", isInAlarm=" + isInAlarm + - ", isInSilentAlarm=" + isInSilentAlarm + ", isInAudibleAlarm=" + isInAudibleAlarm + ", isInFireAlarm=" + isInFireAlarm + ", isReadyToArm=" + isReadyToArm + ", isInExitDelay=" + - isInExitDelay + ", isInEntryDelay=" + isInEntryDelay + ", isInTrouble=" + isInTrouble + ", hasAlarmInMemory=" + hasAlarmInMemory + ", isInZoneBypass=" + isInZoneBypass + - ", hasZoneInTamperTrouble=" + hasZoneInTamperTrouble + ", hasZoneInLowBatteryTrouble=" + hasZoneInLowBatteryTrouble + ", hasZoneInFireLoopTrouble=" + hasZoneInFireLoopTrouble + - ", hasZoneInSupervisionTrouble=" + hasZoneInSupervisionTrouble + ", isStayInstantReady=" + isStayInstantReady + ", isForceReady=" + isForceReady + ", isBypassReady=" + isBypassReady + - ", isInhibitReady=" + isInhibitReady + ", areAllZoneclosed=" + areAllZoneclosed + "]"; + return "PartitionState [isArmed=" + isArmed + ", isArmedInAway=" + isArmedInAway + ", isArmedInStay=" + + isArmedInStay + ", isArmedInNoEntry=" + isArmedInNoEntry + ", isInAlarm=" + isInAlarm + + ", isInSilentAlarm=" + isInSilentAlarm + ", isInAudibleAlarm=" + isInAudibleAlarm + ", isInFireAlarm=" + + isInFireAlarm + ", isReadyToArm=" + isReadyToArm + ", isInExitDelay=" + isInExitDelay + + ", isInEntryDelay=" + isInEntryDelay + ", isInTrouble=" + isInTrouble + ", hasAlarmInMemory=" + + hasAlarmInMemory + ", isInZoneBypass=" + isInZoneBypass + ", hasZoneInTamperTrouble=" + + hasZoneInTamperTrouble + ", hasZoneInLowBatteryTrouble=" + hasZoneInLowBatteryTrouble + + ", hasZoneInFireLoopTrouble=" + hasZoneInFireLoopTrouble + ", hasZoneInSupervisionTrouble=" + + hasZoneInSupervisionTrouble + ", isStayInstantReady=" + isStayInstantReady + ", isForceReady=" + + isForceReady + ", isBypassReady=" + isBypassReady + ", isInhibitReady=" + isInhibitReady + + ", areAllZoneclosed=" + areAllZoneclosed + "]"; } public boolean isArmed() { diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Version.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Version.java index 29aab14496b16..982d4931ca1b7 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Version.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Version.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Zone.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Zone.java index a76f303d133f1..f8517a9961261 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Zone.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/Zone.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneState.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneState.java index 18398c08ca4f3..e0847130df425 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneState.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneStateFlags.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneStateFlags.java index ddd895a193093..41bad2a9e9079 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneStateFlags.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/model/ZoneStateFlags.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/AbstractParser.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/AbstractParser.java index 3f643369fb6c8..117c7e0760c83 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/AbstractParser.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/AbstractParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/EvoParser.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/EvoParser.java index 4640cc5039d0c..406b4c2800ea9 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/EvoParser.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/EvoParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/IParadoxParser.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/IParadoxParser.java index 4928327d2af37..5459fb7e89973 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/IParadoxParser.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/parsers/IParadoxParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/util/ParadoxUtil.java b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/util/ParadoxUtil.java index 9bc6876e31b84..1b12e309abb15 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/util/ParadoxUtil.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/java/org/openhab/binding/paradoxalarm/internal/util/ParadoxUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/binding/binding.xml index 3cdb42a1bf071..eecdcc6d2f912 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="paradoxalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>ParadoxAlarm Binding</name> <description>This is the binding for ParadoxAlarm.</description> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/ip150connector.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/ip150connector.xml index 5fec4ef518c3d..f138639905b5a 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/ip150connector.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/ip150connector.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="paradoxalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="ip150"> <label>Paradox IP150 Module Connector</label> @@ -43,6 +43,21 @@ <description>Port to connect to IP150</description> <default>10000</default> </parameter> + <parameter name="reconnectWaitTime" type="integer" required="true" unit="s"> + <label>Reconnect Wait Time</label> + <description>The time to wait before a reconnect occurs after socket timeout. Value is in seconds</description> + <default>30</default> + </parameter> + <parameter name="maxZones" type="integer" required="false" unit="s"> + <label>Max Zones</label> + <description>Maximum number of configured zones to check (from zone 1 to maxZones)</description> + <default>0</default> + </parameter> + <parameter name="maxPartitions" type="integer" required="false" unit="s"> + <label>Max Partitions</label> + <description>Maximum number of configured partitions to check (from partition 1 to maxPartitions)</description> + <default>0</default> + </parameter> </config-description> </bridge-type> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/panel.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/panel.xml index 199aa18b146d2..f6122b607a3ed 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/panel.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/panel.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="paradoxalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="panel"> <supported-bridge-type-refs> @@ -12,16 +12,16 @@ <label>Paradox Panel</label> <description>Paradox panel various information</description> - <channels> + <channels> <channel id="state" typeId="panelState" /> </channels> - <properties> - <property name="serialNumber"/> - <property name="panelType"/> - <property name="hardwareVersion"/> - <property name="applicationVersion"/> - <property name="bootloaderVersion"/> - </properties> + <properties> + <property name="serialNumber" /> + <property name="panelType" /> + <property name="hardwareVersion" /> + <property name="applicationVersion" /> + <property name="bootloaderVersion" /> + </properties> </thing-type> <channel-type id="panelState"> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/partition.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/partition.xml index 4c8507e266258..57d3041f9ce5d 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/partition.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/partition.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="paradoxalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="partition"> <supported-bridge-type-refs> @@ -16,6 +16,21 @@ <channel id="label" typeId="partitionLabel" /> <channel id="state" typeId="state" /> <channel id="additionalStates" typeId="additionalState" /> + <channel id="readyToArm" typeId="readyToArm" /> + <channel id="inExitDelay" typeId="inExitDelay" /> + <channel id="inEntryDelay" typeId="inEntryDelay" /> + <channel id="inTrouble" typeId="inTrouble" /> + <channel id="alarmInMemory" typeId="alarmInMemory" /> + <channel id="zoneBypass" typeId="zoneBypass" /> + <channel id="zoneInTamperTrouble" typeId="zoneInTamperTrouble" /> + <channel id="zoneInLowBatteryTrouble" typeId="zoneInLowBatteryTrouble" /> + <channel id="zoneInFireLoopTrouble" typeId="zoneInFireLoopTrouble" /> + <channel id="zoneInSupervisionTrouble" typeId="zoneInSupervisionTrouble" /> + <channel id="stayInstantReady" typeId="stayInstantReady" /> + <channel id="forceReady" typeId="forceReady" /> + <channel id="bypassReady" typeId="bypassReady" /> + <channel id="inhibitReady" typeId="inhibitReady" /> + <channel id="allZonesClosed" typeId="allZonesClosed" /> </channels> <config-description> @@ -30,19 +45,108 @@ <item-type>String</item-type> <label>Partition Label</label> <description>Label of partition</description> - <state readOnly="true" pattern="%s" /> + <state readOnly="true" pattern="%s"/> </channel-type> <channel-type id="state"> <item-type>String</item-type> <label>Partition State</label> <description>State of partition</description> - <state readOnly="true" pattern="%s" /> + <state readOnly="true" pattern="%s"/> </channel-type> <channel-type id="additionalState"> <item-type>String</item-type> <label>Partition Additional States</label> - <description>Additional states provided by panel</description> - <state readOnly="true" pattern="%s" /> + <description>Additional states provided by panel (deprecated channel)</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="readyToArm"> + <item-type>switch</item-type> + <label>Partition Ready To Arm</label> + <description>Partition ready to arm</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="inExitDelay"> + <item-type>switch</item-type> + <label>Partition In Exit Delay</label> + <description>Partition in Exit Delay</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="inEntryDelay"> + <item-type>switch</item-type> + <label>Partition In Entry Delay</label> + <description>Partition in Entry Delay</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="inTrouble"> + <item-type>switch</item-type> + <label>Partition In Trouble</label> + <description>Partition in Trouble</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="alarmInMemory"> + <item-type>switch</item-type> + <label>Partition Has Alarm In Memory</label> + <description>Partition has Alarm in Memory</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="zoneBypass"> + <item-type>switch</item-type> + <label>Partition Has Zone Bypass</label> + <description>Partition has Zone Bypass</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="zoneInTamperTrouble"> + <item-type>switch</item-type> + <label>Partition Has Zone In Tamper Trouble</label> + <description>Partition has in Tamper Trouble</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="zoneInLowBatteryTrouble"> + <item-type>switch</item-type> + <label>Partition Has Zone In Low Battery Trouble</label> + <description>Partition has in Low Battery Trouble</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="zoneInFireLoopTrouble"> + <item-type>switch</item-type> + <label>Partition Has Zone In Fire Loop Trouble</label> + <description>Partition has in Fire Loop Trouble</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="zoneInSupervisionTrouble"> + <item-type>switch</item-type> + <label>Partition Has Zone In Supervision Trouble</label> + <description>Partition has in Supervision Trouble</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="stayInstantReady"> + <item-type>switch</item-type> + <label>Partition Is Stay Instant Ready</label> + <description>Partition is Stay Instant Ready</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="forceReady"> + <item-type>switch</item-type> + <label>Partition Is Force Ready</label> + <description>Partition is Force Ready</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="bypassReady"> + <item-type>switch</item-type> + <label>Partition Is Bypass Ready</label> + <description>Partition is Bypass Ready</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="inhibitReady"> + <item-type>switch</item-type> + <label>Partition Is Inhibit Ready</label> + <description>Partition is Inhibit Ready</description> + <state readOnly="true" pattern="%s"/> + </channel-type> + <channel-type id="allZonesClosed"> + <item-type>contact</item-type> + <label>Partition Has All Zones Closed</label> + <description>Partition has All Zones closed</description> + <state readOnly="true" pattern="%s"/> </channel-type> - </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/zone.xml b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/zone.xml index 297b41325c5f5..e7ea634cd22aa 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/zone.xml +++ b/bundles/org.openhab.binding.paradoxalarm/src/main/resources/ESH-INF/thing/zone.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="paradoxalarm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="zone"> <supported-bridge-type-refs> <bridge-type-ref id="ip150" /> </supported-bridge-type-refs> - <label>Paradox zone</label> + <label>Paradox Zone</label> <description>Paradox zone</description> <channels> diff --git a/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java b/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java index c09a9ec69c831..ee2a54e66e42c 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java +++ b/bundles/org.openhab.binding.paradoxalarm/src/test/java/main/Main.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,9 +21,11 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import org.openhab.binding.paradoxalarm.internal.communication.ICommunicatorBuilder; import org.openhab.binding.paradoxalarm.internal.communication.IParadoxCommunicator; -import org.openhab.binding.paradoxalarm.internal.communication.ParadoxCommunicatorFactory; +import org.openhab.binding.paradoxalarm.internal.communication.ParadoxBuilderFactory; import org.openhab.binding.paradoxalarm.internal.exceptions.ParadoxException; +import org.openhab.binding.paradoxalarm.internal.model.PanelType; import org.openhab.binding.paradoxalarm.internal.model.ParadoxPanel; import org.openhab.binding.paradoxalarm.internal.model.Partition; import org.openhab.binding.paradoxalarm.internal.model.Zone; @@ -50,8 +52,6 @@ public class Main { private static ScheduledExecutorService scheduler; - private static final String PANEL_TYPE = "EVO192"; - private static final String LOG_LEVEL = "DEBUG"; private static IParadoxCommunicator communicator; @@ -63,17 +63,21 @@ public static void main(String[] args) { try { scheduler = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); + + ParadoxBuilderFactory factory = new ParadoxBuilderFactory(); + ICommunicatorBuilder builder = factory.createBuilder(PanelType.EVO192); + communicator = builder.withIp150Password(ip150Password).withPcPassword(pcPassword).withIpAddress(ipAddress) + .withTcpPort(port).withMaxPartitions(4).withMaxZones(60).withScheduler(scheduler).build(); + ParadoxPanel panel = ParadoxPanel.getInstance(); - ParadoxCommunicatorFactory factory = new ParadoxCommunicatorFactory(ipAddress, port, ip150Password, - pcPassword, scheduler); - communicator = factory.createCommunicator(PANEL_TYPE); + panel.setCommunicator(communicator); + communicator.setListeners(Arrays.asList(panel)); panel.setCommunicator(communicator); // scheduler.schedule(communicator::initializeEpromData, 2, TimeUnit.SECONDS); // scheduler.schedule(communicator::refreshMemoryMap, 2, TimeUnit.SECONDS); - logger.debug("Phase1 - Identify communicator"); scheduler.scheduleWithFixedDelay(() -> { updateDataCache(communicator, false); @@ -113,10 +117,12 @@ private static List<Partition> initializePartitions(IParadoxCommunicator paradox } private static void readArguments(String[] args) { - if (args == null || args.length < 8 || !"--password".equals(args[0]) || args[1] == null || args[1].isEmpty() || args[2] == null || !"--pc_password".equals(args[2]) || args[3] == null || - args[3].isEmpty() || !"--ip_address".equals(args[4]) || args[5] == null || args[5].isEmpty() || !"--port".equals(args[6]) || args[7] == null || args[7].isEmpty()) { + if (args == null || args.length < 8 || !"--password".equals(args[0]) || args[1] == null || args[1].isEmpty() + || args[2] == null || !"--pc_password".equals(args[2]) || args[3] == null || args[3].isEmpty() + || !"--ip_address".equals(args[4]) || args[5] == null || args[5].isEmpty() || !"--port".equals(args[6]) + || args[7] == null || args[7].isEmpty()) { logger.error( - "Usage: application --password <YOUR_PASSWORD_FOR_IP150> --pc_password <your PC_password> --ip_address <address of IP150> --port <port of Paradox>\n (pc password default is 0000, can be obtained by checking section 3012), default port is 10000"); + "Usage: application --password <YOUR_PASSWORD_FOR_IP150> --pc_password <your PC_password> --ip_address <address of IP150> --port <port of Paradox>\n (pc password default is 0000, can be obtained by checking section 3012), default port is 10000"); System.exit(0); } else { logger.info("Arguments retrieved successfully from CLI."); diff --git a/bundles/org.openhab.binding.paradoxalarm/src/test/java/resources/simplelogger.properties b/bundles/org.openhab.binding.paradoxalarm/src/test/java/resources/simplelogger.properties index eafa2b0f4a6f7..beb56b2e15b78 100644 --- a/bundles/org.openhab.binding.paradoxalarm/src/test/java/resources/simplelogger.properties +++ b/bundles/org.openhab.binding.paradoxalarm/src/test/java/resources/simplelogger.properties @@ -1 +1 @@ -org.slf4j.simpleLogger.defaultLogLevel=debug \ No newline at end of file +org.slf4j.simpleLogger.defaultLogLevel=debug diff --git a/bundles/org.openhab.binding.pentair/NOTICE b/bundles/org.openhab.binding.pentair/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.pentair/NOTICE +++ b/bundles/org.openhab.binding.pentair/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.pentair/README.md b/bundles/org.openhab.binding.pentair/README.md index f481a17d828de..0ac03c18afd54 100644 --- a/bundles/org.openhab.binding.pentair/README.md +++ b/bundles/org.openhab.binding.pentair/README.md @@ -1,30 +1,44 @@ # Pentair Pool -This is an openHAB binding for a Pentair Pool System. It is based on combined efforts of many on the internet in reverse-engineering the proprietary Pentair protocol (see References section). The binding was developed and tested on a system with a Pentair EasyTouch controller, but should operate with other Pentair systems. +This is an openHAB binding for a Pentair Pool System. +It is based on combined efforts of many on the internet in reverse-engineering the proprietary Pentair protocol (see References section). +The binding was developed and tested on a system with a Pentair EasyTouch controller, but should operate with other Pentair systems. ## Hardware Setup > REQUISITE DISCLAIMER: CONNECTING 3RD PARTY DEVICES TO THE PENTAIR SYSTEM BUS COULD CAUSE SERIOUS DAMAGE TO THE SYSTEM SHOULD SOMETHING MALFUNCTION. IT IS NOT ENDORSED BY PENTAIR AND COULD VOID WARRENTY. IF YOU DECIDE TO USE THIS BINDING TO INTERFACE TO A PENTAIR CONTROLLER, THE AUTHOR(S) CAN NOT BE HELD RESPONSIBLE. -This binding requires an adapter to interface to the Pentair system bus. This bus/wire runs between the Pentair control system, indoor control panels, IntelliFlo pumps, etc. It is a standard RS-485 bus running at 9600,8N1 so any RS-485 adapter should work and you should be able to buy one for under $30. Pentair does not publish any information on the protocol so this binding was developed using the great reverse-engineering efforts of others made available on the internet. I have cited sevearl of those in the References section below. +This binding requires an adapter to interface to the Pentair system bus. +This bus/wire runs between the Pentair control system, indoor control panels, IntelliFlo pumps, etc. +It is a standard RS-485 bus running at 9600,8N1 so any RS-485 adapter should work and you should be able to buy one for under $30. +Pentair does not publish any information on the protocol so this binding was developed using the great reverse-engineering efforts of others made available on the internet. +I have cited sevearl of those in the References section below. ### Connecting adapter to your system -A usb or serial RS-485 interface or IP based interface can be used to interface to the Pentair system bus. The binding includes 2 different bridge Things depending on which type of interface you use, serial_bridge or ip_bridge. +A USB or serial RS-485 interface or IP based interface can be used to interface to the Pentair system bus. +The binding includes 2 different bridge Things depending on which type of interface you use, serial_bridge or ip_bridge. -If your openHAB system is physically located far from your Pentair equipment or indoor control panel, you can use a Raspberry Pi or other computer to redirect USB/serial port traffic over the internet using a program called ser2sock (see Reference section). An example setup would run the following command: "ser2sock -p 10000 -s /dev/ttyUSB1 -b 9600 -d". Note: This is the setup utlized for the majority of my testing of this binding. +If your openHAB system is physically located far from your Pentair equipment or indoor control panel, you can use a Raspberry Pi or other computer to redirect USB/serial port traffic over the internet using a program called ser2sock (see Reference section). +An example setup would run the following command: "ser2sock -p 10000 -s /dev/ttyUSB1 -b 9600 -d". +Note: This is the setup utlized for the majority of my testing of this binding. -Note: if you are on a linux system, the framework may not see a symbolically linked device (i.e. /dev/ttyRS485). To use a symbolically linked device, add the following line to /etc/default/openhab2, `EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyRS485"` +Note: If you are on a Linux system, the framework may not see a symbolically linked device (i.e. /dev/ttyRS485). +To use a symbolically linked device, add the following line to /etc/default/openhab2, `EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyRS485"` -Once you have the interface connected to your system, it is best to test basic connectivity. Note the protocol is a binary protocol (not ASCII text based) and in order to view the communication packets, one must use a program capable of a binary/HEX mode. If connected properly, you will see a periodic traffic with packets staring with FF00FFA5. This is the preamble for Pentairs communication packet. After you see this traffic, you can proceed to configuring the Pentair binding in openHAB. +Once you have the interface connected to your system, it is best to test basic connectivity. +Note the protocol is a binary protocol (not ASCII text based) and in order to view the communication packets, one must use a program capable of a binary/HEX mode. +If connected properly, you will see a periodic traffic with packets staring with FF00FFA5. +This is the preamble for Pentairs communication packet. +After you see this traffic, you can proceed to configuring the Pentair binding in openHAB. #### USB/Serial interface -For a USB/Serial interface, you can use most terminal emulators. For linux, you can use minicom with the following options: `minicom -H -D /dev/ttyUSB1 -b 9600` +For a USB/Serial interface, you can use most terminal emulators. For Linux, you can use minicom with the following options: `minicom -H -D /dev/ttyUSB1 -b 9600` #### IP interface -For an IP based interface (or utilizing ser2sock) on a linux system, you can use nc command with the following options: `nc localhost 10000 | xxd` +For an IP based interface (or utilizing ser2sock) on a Linux system, you can use nc command with the following options: `nc localhost 10000 | xxd` ### Pentair Controller panel configuration @@ -49,7 +63,8 @@ There are no overall binding configurations that need to be set up as all config ## Thing Configuration -Pentair things can be configured either through the online Paper UI configuration, or manually through a 'pentair.thing' configuration file. The following table shows the available configuration parameters for each thing. +Pentair things can be configured either through the online Paper UI configuration, or manually through a 'pentair.thing' configuration file. +The following table shows the available configuration parameters for each thing. | Thing | Configuration Parameters | | ------------- | ------------------------------------------------------------ | @@ -61,13 +76,16 @@ Pentair things can be configured either through the online Paper UI configuratio | | pollPeriod - Period of time in minutes between the poll command being sent to the IT-100 bridge - Not Required - default=1. | | | id - ID to use when communciating on Pentair control bus - default = 34. | -Currently automatic discovery is not supported and the binding requires configuration via the PaperUI or a file in the conf/things folder. Here is an example of a thing configuration file called 'pentair.thing': +Currently automatic discovery is not supported and the binding requires configuration via the Paper UI or a file in the conf/things folder. +Here is an example of a thing configuration file called 'pentair.thing': - Bridge pentair:ip_bridge:1 [ address="192.168.1.202", port=10001 ] { - easytouch main [ id=16 ] - intelliflo pump1 [ id=96 ] - intellichlor ic40 - } +``` +Bridge pentair:ip_bridge:1 [ address="192.168.1.202", port=10001 ] { + easytouch main [ id=16 ] + intelliflo pump1 [ id=96 ] + intellichlor ic40 +} +``` ## Channels @@ -176,8 +194,8 @@ Frame label="Pool" { ## References -Setting up RS485 and basic protocol - http://www.sdyoung.com/home/decoding-the-pentair-easytouch-rs-485-protocol/ -ser2sock Github - https://github.com/nutechsoftware/ser2sock +Setting up RS485 and basic protocol - https://www.sdyoung.com/home/decoding-the-pentair-easytouch-rs-485-protocol/ +ser2sock GitHub - https://github.com/nutechsoftware/ser2sock ## Future Enhancements diff --git a/bundles/org.openhab.binding.pentair/pom.xml b/bundles/org.openhab.binding.pentair/pom.xml index cd0f9831f6359..20771a813416d 100644 --- a/bundles/org.openhab.binding.pentair/pom.xml +++ b/bundles/org.openhab.binding.pentair/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.pentair</artifactId> diff --git a/bundles/org.openhab.binding.pentair/src/main/feature/feature.xml b/bundles/org.openhab.binding.pentair/src/main/feature/feature.xml index e6d208661a966..94a9ff71af590 100644 --- a/bundles/org.openhab.binding.pentair/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.pentair/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.pentair-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-pentair" description="Pentair Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairBindingConstants.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairBindingConstants.java index 9c07075be66e0..a1a5da62ebdcb 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairBindingConstants.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairHandlerFactory.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairHandlerFactory.java index 545237a7db3bf..da1e22200a7a0 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairHandlerFactory.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacket.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacket.java index 6ce03341d987e..59b37e7f4ef5f 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacket.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketHeatSetPoint.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketHeatSetPoint.java index 4c3dd1f4e93b5..ec677046e2f58 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketHeatSetPoint.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketHeatSetPoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketIntellichlor.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketIntellichlor.java index 509d39c63cd50..35b33f89d71b5 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketIntellichlor.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketIntellichlor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketPumpStatus.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketPumpStatus.java index 69851b87f0b45..e8816c673bcc4 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketPumpStatus.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketPumpStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketStatus.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketStatus.java index 006c5c48127e3..2ba1240f620c9 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketStatus.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/PentairPacketStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairIPBridgeConfig.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairIPBridgeConfig.java index 28509aafaa7ce..c2fce9790c075 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairIPBridgeConfig.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairIPBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairSerialBridgeConfig.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairSerialBridgeConfig.java index 5cc406ff5b114..e4731a10fb886 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairSerialBridgeConfig.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/config/PentairSerialBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java index fa7ac623c7c4a..dddd0722e558e 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -446,7 +446,7 @@ public void writePacket(PentairPacket p) { writer.write(buf, 0, 5 + p.getLength() + 8); writer.flush(); } catch (IOException e) { - logger.trace("I/O error while writing stream: {}", e); + logger.trace("I/O error while writing stream", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseThingHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseThingHandler.java index d817d810c1bc8..39456eee47c40 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseThingHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairEasyTouchHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairEasyTouchHandler.java index 2cc59aaeb2177..239db976071a4 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairEasyTouchHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairEasyTouchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIPBridgeHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIPBridgeHandler.java index 90272917a9d20..afa5b3126a6ca 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIPBridgeHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIPBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliChlorHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliChlorHandler.java index 67c86159fc254..f1b4222870f41 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliChlorHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliChlorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliFloHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliFloHandler.java index dc6b87f609037..d5f92212eea20 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliFloHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairIntelliFloHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairSerialBridgeHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairSerialBridgeHandler.java index 7479d3caf59e9..f4ac00a9e74b2 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairSerialBridgeHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairSerialBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -122,7 +122,7 @@ protected synchronized void disconnect() { try { reader.close(); } catch (IOException e) { - logger.trace("IOException when closing serial reader: {}", e); + logger.trace("IOException when closing serial reader", e); } reader = null; } @@ -131,7 +131,7 @@ protected synchronized void disconnect() { try { writer.close(); } catch (IOException e) { - logger.trace("IOException when closing serial writer: {}", e); + logger.trace("IOException when closing serial writer", e); } writer = null; } diff --git a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/easytouch.xml b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/easytouch.xml index fe25521478dbe..5a801f483cfed 100644 --- a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/easytouch.xml +++ b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/easytouch.xml @@ -59,25 +59,25 @@ <channel-type id="pooltemp"> <item-type>Number</item-type> - <label>Pool water temperature</label> + <label>Pool Water Temperature</label> <description>Pool water temperature. Only valid when pool pump is running and in pool mode.</description> </channel-type> <channel-type id="spatemp"> <item-type>Number</item-type> - <label>Spa water temperature</label> + <label>Spa Water Temperature</label> <description>Spa water temperature. Only valide when in spa mode.</description> </channel-type> <channel-type id="airtemp"> <item-type>Number</item-type> - <label>Air temperature</label> + <label>Air Temperature</label> <description>Air temperature.</description> </channel-type> <channel-type id="solartemp" advanced="true"> <item-type>Number</item-type> - <label>Solar temperature</label> + <label>Solar Temperature</label> <description>Solar temperature.</description> </channel-type> @@ -109,20 +109,20 @@ <channel-type id="heatactive"> <item-type>Number</item-type> - <label>Heat active</label> + <label>Heat Active</label> <description>Heat active state</description> <state readOnly="true"/> </channel-type> <channel-type id="poolsetpoint"> <item-type>Number</item-type> - <label>Pool temperature set point</label> + <label>Pool Temperature Set Point</label> <description>Pool temperature set point</description> </channel-type> <channel-type id="spasetpoint"> <item-type>Number</item-type> - <label>Spa temperature set point</label> + <label>Spa Temperature Set Point</label> <description>Spa temperature set point</description> </channel-type> diff --git a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/intelliflo.xml b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/intelliflo.xml index 2c04fa775ee32..bb774482bb40e 100644 --- a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/intelliflo.xml +++ b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/intelliflo.xml @@ -33,14 +33,14 @@ <channel-type id="pumpmode"> <item-type>Number</item-type> - <label>Pump mode</label> + <label>Pump Mode</label> <description>Pump mode</description> <state readOnly="true"/> </channel-type> <channel-type id="runswitch"> <item-type>Switch</item-type> - <label>Pump running</label> + <label>Pump Running</label> <description>Indicator on whether the pump is running or not.</description> <state readOnly="true"/> </channel-type> diff --git a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/ip_bridge.xml b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/ip_bridge.xml index fe5197d3f2497..5881cc471a311 100644 --- a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/ip_bridge.xml +++ b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/ip_bridge.xml @@ -2,7 +2,7 @@ <thing:thing-descriptions bindingId="pentair" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="ip_bridge"> <label>IP Bridge</label> diff --git a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/serial_bridge.xml b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/serial_bridge.xml index f196f0cca78bd..da17b66d803fd 100644 --- a/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/serial_bridge.xml +++ b/bundles/org.openhab.binding.pentair/src/main/resources/ESH-INF/thing/serial_bridge.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="pentair" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="pentair_serial_bridge"> <label>Serial Bridge</label> <description>This bridge is used when using a USB->RS485 interface.</description> <config-description> <parameter name="serialPort" type="text" required="true"> - <label>Serial port</label> + <label>Serial Port</label> <description>The serial port name. Valid values are e.g. COM1 for Windows and /dev/ttyS0 or /dev/ttyUSB0 for Linux.</description> </parameter> diff --git a/bundles/org.openhab.binding.phc/NOTICE b/bundles/org.openhab.binding.phc/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.phc/NOTICE +++ b/bundles/org.openhab.binding.phc/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.phc/pom.xml b/bundles/org.openhab.binding.phc/pom.xml index 9fb446b590dae..2288d33b6ceab 100644 --- a/bundles/org.openhab.binding.phc/pom.xml +++ b/bundles/org.openhab.binding.phc/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.phc</artifactId> diff --git a/bundles/org.openhab.binding.phc/src/main/feature/feature.xml b/bundles/org.openhab.binding.phc/src/main/feature/feature.xml index 1d752a9c96a15..eb6656f4501f0 100644 --- a/bundles/org.openhab.binding.phc/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.phc/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.phc-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-phc" description="PHC Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCBindingConstants.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCBindingConstants.java index f026b4359f5db..cfcc249c45f31 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCBindingConstants.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHandlerFactory.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHandlerFactory.java index ee11e0ac6cbc5..7f34ec6ec2487 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHandlerFactory.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHelper.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHelper.java index 149f4a01e8d51..2deaa2a608fa4 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHelper.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/PHCHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCBridgeHandler.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCBridgeHandler.java index 01d80197a957e..af1ca10631bf6 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCBridgeHandler.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java index ca5db9fca983b..fa52a8044b7e3 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/PHCHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/QueueObject.java b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/QueueObject.java index f4d0c3ef1034a..0ac16a75edc16 100644 --- a/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/QueueObject.java +++ b/bundles/org.openhab.binding.phc/src/main/java/org/openhab/binding/phc/internal/handler/QueueObject.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/channel-types.xml index 87a1a628ce3d4..2145e27b8a4e7 100644 --- a/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/channel-types.xml @@ -54,7 +54,7 @@ </channel-group-type> <channel-group-type id="jrmTimeChannels" advanced="true"> - <label>JRM time Channels</label> + <label>JRM Time Channels</label> <description>Time for shutter channels in seconds with an accuracy of 1/10 seconds.</description> <channels> <channel id="00" typeId="jrmTime-channel" /> diff --git a/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/thing-types.xml index 7ac7f9fcb121b..ae5e9787d7085 100644 --- a/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.phc/src/main/resources/ESH-INF/thing/thing-types.xml @@ -86,28 +86,28 @@ </parameter> <parameter name="upDownTime1" type="integer"> <advanced>true</advanced> - <label>Time shutter 1</label> + <label>Time Shutter 1</label> <description>The Time which the first shutter needs to move up/down.</description> <required>false</required> <default>30</default> </parameter> <parameter name="upDownTime2" type="integer"> <advanced>true</advanced> - <label>Time shutter 2</label> + <label>Time Shutter 2</label> <description>The Time which the second shutter needs to move up/down.</description> <required>false</required> <default>30</default> </parameter> <parameter name="upDownTime3" type="integer"> <advanced>true</advanced> - <label>Time shutter 3</label> + <label>Time Shutter 3</label> <description>The Time which the third shutter needs to move up/down.</description> <required>false</required> <default>30</default> </parameter> <parameter name="upDownTime4" type="integer"> <advanced>true</advanced> - <label>Time shutter 4</label> + <label>Time Shutter 4</label> <description>The Time which the fourth shutter needs to move up/down.</description> <required>false</required> <default>30</default> diff --git a/bundles/org.openhab.binding.pioneeravr/NOTICE b/bundles/org.openhab.binding.pioneeravr/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.pioneeravr/NOTICE +++ b/bundles/org.openhab.binding.pioneeravr/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.pioneeravr/pom.xml b/bundles/org.openhab.binding.pioneeravr/pom.xml index c4f6c87fd572c..a05469d210332 100644 --- a/bundles/org.openhab.binding.pioneeravr/pom.xml +++ b/bundles/org.openhab.binding.pioneeravr/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.pioneeravr</artifactId> diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/feature/feature.xml b/bundles/org.openhab.binding.pioneeravr/src/main/feature/feature.xml index 89c7b70615b39..4ac9cd5f60c0a 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.pioneeravr/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.pioneeravr-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-pioneeravr" description="PioneerAVR Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/PioneerAvrBindingConstants.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/PioneerAvrBindingConstants.java index 2c0c9ea56e490..e8cf9d5654cef 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/PioneerAvrBindingConstants.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/PioneerAvrBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/discovery/PioneerAvrDiscoveryParticipant.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/discovery/PioneerAvrDiscoveryParticipant.java index 6f0c403826ef9..d519478db2f1c 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/discovery/PioneerAvrDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/discovery/PioneerAvrDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AbstractAvrHandler.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AbstractAvrHandler.java index 82d91b144a997..ff7ccf6aa5680 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AbstractAvrHandler.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AbstractAvrHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -227,11 +227,11 @@ public void statusUpdateReceived(AvrStatusUpdateEvent event) { break; default: - logger.debug("Unkown response type from AVR @{}. Response discarded: {}", event.getData(), + logger.debug("Unknown response type from AVR @{}. Response discarded: {}", event.getData(), event.getConnection()); } } catch (AvrConnectionException e) { - logger.debug("Unkown response type from AVR @{}. Response discarded: {}", event.getData(), + logger.debug("Unknown response type from AVR @{}. Response discarded: {}", event.getData(), event.getConnection()); } } diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AvrHandlerFactory.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AvrHandlerFactory.java index 07a38d69b1074..d4bb94c3aee91 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AvrHandlerFactory.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/AvrHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/IpAvrHandler.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/IpAvrHandler.java index 33f77522a8e21..af15e931305d6 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/IpAvrHandler.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/IpAvrHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/SerialAvrHandler.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/SerialAvrHandler.java index 2338edd0bbf40..f10c8a0d177a3 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/SerialAvrHandler.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/handler/SerialAvrHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/DisplayInformation.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/DisplayInformation.java index 9a5465b336287..93b85dfb5b86c 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/DisplayInformation.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/DisplayInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ParameterizedCommand.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ParameterizedCommand.java index 71055c4a98d3a..79307c0d97875 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ParameterizedCommand.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ParameterizedCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/RequestResponseFactory.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/RequestResponseFactory.java index 898631fbbdab0..1ce7cf2dfe11d 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/RequestResponseFactory.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/RequestResponseFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/Response.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/Response.java index 89d6269f1bd01..ebbf648c78cc4 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/Response.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/SimpleCommand.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/SimpleCommand.java index 524711c509212..3f65fd1d13cea 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/SimpleCommand.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/SimpleCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/StreamAvrConnection.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/StreamAvrConnection.java index 5e605399d6ca8..b57396e32a60e 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/StreamAvrConnection.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/StreamAvrConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrCommand.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrCommand.java index fb19db11a2e4e..8a744642dd2dc 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrCommand.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnection.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnection.java index 0af0b4a62a3eb..52e428c3b3eae 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnection.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnectionException.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnectionException.java index 0d3b52fc31a27..8a1191315f917 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnectionException.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrConnectionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrResponse.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrResponse.java index 7382cb7fc1cea..509b146fd82e4 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrResponse.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/AvrResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/CommandTypeNotSupportedException.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/CommandTypeNotSupportedException.java index 8ca1717899496..07e6e7e7bb6b5 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/CommandTypeNotSupportedException.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/avr/CommandTypeNotSupportedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionEvent.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionEvent.java index 73c01e563287a..f0aabb02c4728 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionEvent.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionListener.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionListener.java index 8e2c3cb4c080e..25a5dce337f52 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionListener.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrDisconnectionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrStatusUpdateEvent.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrStatusUpdateEvent.java index 9ca26b599bf0c..2e196d2fc9b3d 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrStatusUpdateEvent.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrStatusUpdateEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrUpdateListener.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrUpdateListener.java index bdf72f453cb0c..1a153991b414a 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrUpdateListener.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/event/AvrUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ip/IpAvrConnection.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ip/IpAvrConnection.java index ab0adcddbe6ee..4c63b60f89694 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ip/IpAvrConnection.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/ip/IpAvrConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java index 2e57a7b753329..adc9589e5a8f6 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/serial/SerialAvrConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/MuteStateValues.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/MuteStateValues.java index 8f05b22bc8e09..4ddabc4466413 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/MuteStateValues.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/MuteStateValues.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/PowerStateValues.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/PowerStateValues.java index 3bab1a1ee69b0..160f9399e2383 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/PowerStateValues.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/states/PowerStateValues.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/DisplayInformationConverter.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/DisplayInformationConverter.java index 1f7138d0fed98..c9d1e0b93a4b4 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/DisplayInformationConverter.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/DisplayInformationConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/VolumeConverter.java b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/VolumeConverter.java index 54de03b908a6a..1921ea6104e87 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/VolumeConverter.java +++ b/bundles/org.openhab.binding.pioneeravr/src/main/java/org/openhab/binding/pioneeravr/internal/protocol/utils/VolumeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pioneeravr/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.pioneeravr/src/main/resources/ESH-INF/thing/thing-types.xml index 54b7ebe2419b6..952a158338df6 100644 --- a/bundles/org.openhab.binding.pioneeravr/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.pioneeravr/src/main/resources/ESH-INF/thing/thing-types.xml @@ -176,7 +176,7 @@ <config-description> <parameter name="serialPort" type="text" required="true"> - <label>Serial Port name</label> + <label>Serial Port Name</label> <context>serial-port</context> <description>The Serial port name to use to connect to the AVR.</description> </parameter> @@ -191,7 +191,7 @@ </channel-group-type> <channel-group-type id="zoneControls"> - <label>Controls</label> + <label>Zone Controls</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -204,7 +204,7 @@ </channel-group-type> <channel-group-type id="controls2014"> - <label>zoneControls2014</label> + <label>Controls 2014</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -217,7 +217,7 @@ </channel-group-type> <channel-group-type id="zoneControls2014"> - <label>zoneControls2014</label> + <label>Zone Controls 2014</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -230,7 +230,7 @@ </channel-group-type> <channel-group-type id="hdZoneControls2014"> - <label>zoneControls2014</label> + <label>HD Zone Controls 2014</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -243,7 +243,7 @@ </channel-group-type> <channel-group-type id="controls2015"> - <label>zoneControls2015</label> + <label>Controls 2015</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -256,7 +256,7 @@ </channel-group-type> <channel-group-type id="zoneControls2015"> - <label>zoneControls2015</label> + <label>Zone Controls 2015</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -269,7 +269,7 @@ </channel-group-type> <channel-group-type id="hdZoneControls2015"> - <label>zoneControls2015</label> + <label>HD Zone Controls 2015</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -282,7 +282,7 @@ </channel-group-type> <channel-group-type id="controls2016"> - <label>controls2016</label> + <label>Controls 2016</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -295,7 +295,7 @@ </channel-group-type> <channel-group-type id="zoneControls2016"> - <label>zoneControls2016</label> + <label>Zone Controls 2016</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -308,7 +308,7 @@ </channel-group-type> <channel-group-type id="hdZoneControls2016"> - <label>hdZoneControls2016</label> + <label>HD Zone Controls 2016</label> <channels> <channel id="power" typeId="powerChannel" /> <channel id="volumeDimmer" typeId="volumeChannelDimmer" /> @@ -350,7 +350,7 @@ <channel-type id="setInputSourceChannel"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -381,7 +381,7 @@ <channel-type id="setInputSourceChannel2014"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -417,7 +417,7 @@ <channel-type id="setInputSourceChannel2015"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -451,7 +451,7 @@ <channel-type id="setInputSourceChannel2016"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -485,7 +485,7 @@ <channel-type id="setInputSourceZoneChannel2014"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -510,7 +510,7 @@ <channel-type id="setInputSourceZoneChannel2015"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -535,7 +535,7 @@ <channel-type id="setInputSourceZoneChannel2016"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -561,7 +561,7 @@ <channel-type id="setInputSourceHDZoneChannel2014"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -584,7 +584,7 @@ <channel-type id="setInputSourceHDZoneChannel2015"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> @@ -612,7 +612,7 @@ <channel-type id="setInputSourceHDZoneChannel2016"> <item-type>String</item-type> - <label>Input source</label> + <label>Input Source</label> <description>Select the input source of the AVR</description> <state> <options> diff --git a/bundles/org.openhab.binding.pixometer/.classpath b/bundles/org.openhab.binding.pixometer/.classpath new file mode 100644 index 0000000000000..a5d95095ccaaf --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/.classpath @@ -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> diff --git a/bundles/org.openhab.binding.pixometer/.project b/bundles/org.openhab.binding.pixometer/.project new file mode 100644 index 0000000000000..7c04a32837dd1 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.pixometer</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> diff --git a/bundles/org.openhab.binding.pixometer/NOTICE b/bundles/org.openhab.binding.pixometer/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.pixometer/README.md b/bundles/org.openhab.binding.pixometer/README.md new file mode 100644 index 0000000000000..88d0815c89165 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/README.md @@ -0,0 +1,65 @@ +# Pixometer Binding + +This binding connects to the pixometer API, which can manage your meter readings through a native smartphone app. + +## Supported Things + +This binding supports the following thing types according to the capabilities of pixometer: + +| Name | Type | Description | +|-------------|--------|-----------------------------------------------------------------------------| +| Account | Bridge | Representation of a pixometer account, which connects to the pixometer API. | +| Energymeter | Thing | Provides access to the readings of configured energy meters. | +| Gasmeter | Thing | Provides access to the readings of configured gas meters. | +| Watermeter | Thing | Provides access to the readings of configured water meters. | + +The different meter types are pretty similar in basic, but are implemented in parallel to provide Units of Measurement support. + +## Thing Configuration + +### Account (bridge) + +| Parameter | Description | Required | Default Value | Comment | +|--------------|--------------------------------------------------------------------|----------|------------------|---------------------------------------------------------------| +| user | | Yes | - | | +| password | | Yes | - | | +| refresh | Sets the refresh time. Minimum is 60 Minutes. | Yes | 240 | | + +### Meter Things + +| Parameter | Description | Required | +|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| resource_id | The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit" | Yes | + +## Channels + +All meter things have the following channels: + +| Channel ID | Channel Description | Supported item type | Advanced | +|--------------------|--------------------------------------------------------|---------------------|----------| +| last_reading_value | The last value that has been read for this meter. | Number | false | +| last_reading_date | The time at which the last reading value was recorded. | DateTime | false | +| last_refresh_date | The last time that the current thing has been updated. | DateTime | false | + +## Full Example + +pixometer.things: + +```java +Bridge pixometer:account:AccountName "MyAccountName" [ user="xxxxxxxx@xxxx.xx", password="xxxxxxxxxxxx", refresh= 60 ] { + Thing energymeter MeterName1 "MyMeterName1" [ resource_id = "xxxxxxxx" ] + Thing gasmeter MeterName2 "MyMeterName2" [ resource_id = "xxxxxxxx" ] + Thing watermeter MeterName3 "MyMeterName3" [ resource_id = "xxxxxxxx" ] +} +``` + +pixometer.items: + +```java +Number:Volume Meter_Gas_ReadingValue "[.3%f %unit%]" [] {channel="pixometer:gasmeter:accountname:metername1:last_reading_value"} +DateTime Meter_Gas_LastReadingDate "[%1$td.%1$tm.%1$tY %1$tH:%1$tM]" [] {channel="pixometer:gasmeter:accountname:metername1:last_reading_date"} +Number:Energy Meter_Electricity_ReadingValue "[.3%f %unit%]" [] {channel="pixometer:energymeter:accountname:metername2:last_reading_value"} +DateTime Meter_Electricity_LastReadingDate "[%1$td.%1$tm.%1$tY %1$tH:%1$tM]" [] {channel="pixometer:energymeter:accountname:metername2:last_reading_date"} +Number:Volume Meter_Water_ReadingValue "[.3%f %unit%]" [] {channel="pixometer:watermeter:accountname:metername3:last_reading_value"} +DateTime Meter_Water_LastReadingDate "[%1$td.%1$tm.%1$tY %1$tH:%1$tM]" [] {channel="pixometer:watermeter:accountname:metername3:last_reading_date"} +``` diff --git a/bundles/org.openhab.binding.pixometer/pom.xml b/bundles/org.openhab.binding.pixometer/pom.xml new file mode 100644 index 0000000000000..e6eb3a56c942c --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/pom.xml @@ -0,0 +1,15 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.pixometer</artifactId> + + <name>openHAB Add-ons :: Bundles :: pixometer Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.pixometer/src/main/feature/feature.xml b/bundles/org.openhab.binding.pixometer/src/main/feature/feature.xml new file mode 100644 index 0000000000000..45775aff7f55b --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/feature/feature.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.pixometer-${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-pixometer" description="pixometer Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.pixometer/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/AccountHandler.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/AccountHandler.java new file mode 100644 index 0000000000000..9b93a7ea038ee --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/AccountHandler.java @@ -0,0 +1,171 @@ +/** + * 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.pixometer.handler; + +import static org.openhab.binding.pixometer.internal.PixometerBindingConstants.*; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.pixometer.internal.config.PixometerAccountConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +/** + * The {@link AccountHandler} is responsible for handling the api connection and authorization (including token + * refresh) + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +public class AccountHandler extends BaseBridgeHandler { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + private static final int TOKEN_MIN_DIFF_MS = (int) TimeUnit.DAYS.toMillis(2); + private final JsonParser jsonParser = new JsonParser(); + + private @NonNullByDefault({}) String authToken; + private int refreshInterval; + private long tokenExpiryDate; + + public AccountHandler(Bridge bridge) { + super(bridge); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + // Nothing to handle here currently + } + + @Override + public void initialize() { + logger.debug("Initialize Pixometer Accountservice"); + + PixometerAccountConfiguration config = getConfigAs(PixometerAccountConfiguration.class); + setRefreshInterval(config.refresh); + String user = config.user; + String password = config.password; + String scope = "read"; // Prepared for config value + + // Check expiry date every Day and obtain new access token if difference is less then or equal to 2 days + scheduler.scheduleWithFixedDelay(() -> { + logger.debug("Checking if new access token is needed..."); + try { + long difference = getTokenExpiryDate() - System.nanoTime(); + if (difference <= TOKEN_MIN_DIFF_MS) { + obtainAuthTokenAndExpiryDate(user, password, scope); + } + } catch (RuntimeException r) { + logger.debug("Could not check token expiry date for Thing {}: {}", getThing().getUID(), r.getMessage(), + r); + } + }, 1, TimeUnit.DAYS.toMinutes(1), TimeUnit.MINUTES); + + logger.debug("Refresh job scheduled to run every days. for '{}'", getThing().getUID()); + } + + @Override + public void updateStatus(ThingStatus status) { + super.updateStatus(status); + } + + /** + * Request auth token with read or write access. + * (Write access is prepared for a possible later usage for updating meters.) + * + * @param user The username to use + * @param password The corresponding password + * @param scope The granted scope on the api for the binding + */ + private void obtainAuthTokenAndExpiryDate(String user, String password, String scope) { + try { + String url = API_BASE_URL + "v1/access-token/"; + Properties urlHeader = (Properties) new Properties().put("CONTENT-TYPE", "application/json"); + + JsonObject httpBody = new JsonObject(); + httpBody.addProperty("username", user); + httpBody.addProperty("password", password); + httpBody.addProperty("scope", scope); + + InputStream content = new ByteArrayInputStream(httpBody.toString().getBytes(StandardCharsets.UTF_8)); + String urlResponse = HttpUtil.executeUrl("POST", url, urlHeader, content, "application/json", 2000); + JsonObject responseJson = (JsonObject) jsonParser.parse(urlResponse); + + if (responseJson.has(AUTH_TOKEN)) { + // Store the expire date for automatic token refresh + int expiresIn = Integer.parseInt(responseJson.get("expires_in").toString()); + setTokenExpiryDate(TimeUnit.SECONDS.toNanos(expiresIn)); + + setAuthToken(responseJson.get(AUTH_TOKEN).toString().replaceAll("\"", "")); + + updateStatus(ThingStatus.ONLINE); + return; + } + + String errorMsg = String.format("Invalid Api Response ( %s )", responseJson); + + throw new IOException(errorMsg); + } catch (IOException e) { + String errorMsg = String.format( + "Could not obtain auth token. Please check your configured account credentials. %s %s", + this.getThing().getUID(), e.getMessage()); + + logger.debug(errorMsg, e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, errorMsg); + } + } + + /** + * Getters and Setters + */ + + public String getAuthToken() { + return authToken; + } + + private void setAuthToken(String authToken) { + this.authToken = authToken; + } + + public int getRefreshInterval() { + return refreshInterval; + } + + private void setRefreshInterval(int refreshInterval) { + this.refreshInterval = refreshInterval; + } + + public long getTokenExpiryDate() { + return tokenExpiryDate; + } + + private void setTokenExpiryDate(long expiresIn) { + this.tokenExpiryDate = System.nanoTime() + expiresIn; + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/MeterHandler.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/MeterHandler.java new file mode 100644 index 0000000000000..fad4988ddfb1a --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/handler/MeterHandler.java @@ -0,0 +1,308 @@ +/** + * 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.pixometer.handler; + +import static org.openhab.binding.pixometer.internal.PixometerBindingConstants.*; + +import java.io.IOException; +import java.time.Duration; +import java.util.Properties; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import javax.measure.quantity.Energy; +import javax.measure.quantity.Volume; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.cache.ExpiringCache; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.pixometer.internal.config.PixometerMeterConfiguration; +import org.openhab.binding.pixometer.internal.config.ReadingInstance; +import org.openhab.binding.pixometer.internal.data.MeterState; +import org.openhab.binding.pixometer.internal.serializer.CustomReadingInstanceDeserializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +/** + * The {@link MeterHandler} is responsible for handling data and measurements of a meter thing + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +public class MeterHandler extends BaseThingHandler { + + private final Logger logger = LoggerFactory.getLogger(MeterHandler.class); + + private static final String API_VERSION = "v1"; + private static final String API_METER_ENDPOINT = "meters"; + private static final String API_READINGS_ENDPOINT = "readings"; + + private final GsonBuilder gsonBuilder = new GsonBuilder().registerTypeAdapter(ReadingInstance.class, + new CustomReadingInstanceDeserializer()); + private final Gson gson = gsonBuilder.create(); + private final JsonParser jsonParser = new JsonParser(); + + private @NonNullByDefault({}) String resourceID; + private @NonNullByDefault({}) String meterID; + private @NonNullByDefault({}) ExpiringCache<@Nullable MeterState> cache; + + private @Nullable ScheduledFuture<?> pollingJob; + + public MeterHandler(Thing thing) { + super(thing); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + try { + if (command instanceof RefreshType) { + updateMeter(channelUID, cache.getValue()); + } else { + logger.debug("The pixometer binding is read-only and can not handle command {}", command); + } + } catch (IOException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + + @Override + public void initialize() { + logger.debug("Initializing Pixometer handler '{}'", getThing().getUID()); + updateStatus(ThingStatus.UNKNOWN); + + PixometerMeterConfiguration config = getConfigAs(PixometerMeterConfiguration.class); + setRessourceID(config.resourceId); + + cache = new ExpiringCache<@Nullable MeterState>(Duration.ofMinutes(60), this::refreshCache); + + Bridge b = this.getBridge(); + if (b == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Could not find bridge (pixometer config). Did you choose one?"); + return; + } + + obtainMeterId(); + + // Start polling job with the interval, that has been set up in the bridge + int pollingPeriod = Integer.parseInt(b.getConfiguration().get(CONFIG_BRIDGE_REFRESH).toString()); + pollingJob = scheduler.scheduleWithFixedDelay(() -> { + logger.debug("Try to refresh meter data"); + try { + updateMeter(cache.getValue()); + } catch (RuntimeException r) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + } + }, 2, pollingPeriod, TimeUnit.MINUTES); + logger.debug("Refresh job scheduled to run every {} minutes for '{}'", pollingPeriod, getThing().getUID()); + } + + /** + * @return returns the auth token or null for error handling if the bridge was not found. + */ + private @Nullable String getTokenFromBridge() { + Bridge b = this.getBridge(); + if (b == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Could not find bridge (pixometer config). Did you choose one?"); + return null; + } + + return new StringBuilder("Bearer ").append(((AccountHandler) b.getHandler()).getAuthToken()).toString(); + } + + @Override + public void dispose() { + if (pollingJob != null) { + pollingJob.cancel(true); + } + super.dispose(); + } + + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + logger.debug("Bridge Status updated to {} for device: {}", bridgeStatusInfo.getStatus(), getThing().getUID()); + if (bridgeStatusInfo.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, bridgeStatusInfo.getDescription()); + } + } + + /** + * Requests the corresponding meter data and stores the meterId internally for later usage + * + * @param token The current active auth token + */ + private void obtainMeterId() { + try { + String token = getTokenFromBridge(); + + if (token == null) { + throw new IOException( + "Auth token has not been delivered.\n API request can't get executed without authentication."); + } + + String url = getApiString(API_METER_ENDPOINT); + + Properties urlHeader = new Properties(); + urlHeader.put("CONTENT-TYPE", "application/json"); + urlHeader.put("Authorization", token); + + String urlResponse = HttpUtil.executeUrl("GET", url, urlHeader, null, null, 2000); + JsonObject responseJson = (JsonObject) jsonParser.parse(urlResponse); + + if (responseJson.has("meter_id")) { + setMeterID(responseJson.get("meter_id").toString()); + updateStatus(ThingStatus.ONLINE); + return; + } + + String errorMsg = String.format("Invalid Api Response ( %s )", responseJson); + + throw new IOException(errorMsg); + } catch (IOException e) { + String errorMsg = String.format("Could not initialize Thing ( %s ). %s", this.getThing().getUID(), + e.getMessage()); + + logger.debug(errorMsg, e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, errorMsg); + } + } + + /** + * Checks if a channel is linked and redirects to the updateMeter method if link is existing + * + * @param channelUID the channel requested for refresh + * @param meterState a meterState instance with current values + */ + private void updateMeter(ChannelUID channelUID, @Nullable MeterState meterState) throws IOException { + if (!isLinked(channelUID)) { + throw new IOException("Channel is not linked."); + } + updateMeter(meterState); + } + + /** + * updates all corresponding channels + * + * @param token The current active access token + */ + private void updateMeter(@Nullable MeterState meterState) { + try { + if (meterState == null) { + throw new IOException("Meter state has not been delivered to update method. Can't update channels."); + } + + ThingTypeUID thingtype = getThing().getThingTypeUID(); + + if (THING_TYPE_ENERGYMETER.equals(thingtype)) { + QuantityType<Energy> state = new QuantityType<>(meterState.getReadingValue(), + SmartHomeUnits.KILOWATT_HOUR); + updateState(CHANNEL_LAST_READING_VALUE, state); + } + + if (thingtype.equals(THING_TYPE_GASMETER) || thingtype.equals(THING_TYPE_WATERMETER)) { + QuantityType<Volume> state = new QuantityType<>(meterState.getReadingValue(), SIUnits.CUBIC_METRE); + updateState(CHANNEL_LAST_READING_VALUE, state); + } + + updateState(CHANNEL_LAST_READING_DATE, meterState.getLastReadingDate()); + updateState(CHANNEL_LAST_REFRESH_DATE, meterState.getLastRefreshTime()); + } catch (IOException e) { + logger.debug("Exception while updating Meter {}: {}", getThing().getUID(), e.getMessage(), e); + } + } + + private @Nullable MeterState refreshCache() { + try { + String url = getApiString(API_READINGS_ENDPOINT); + + Properties urlHeader = new Properties(); + urlHeader.put("CONTENT-TYPE", "application/json"); + urlHeader.put("Authorization", getTokenFromBridge()); + + String urlResponse = HttpUtil.executeUrl("GET", url, urlHeader, null, null, 2000); + + ReadingInstance latestReading = gson.fromJson(new JsonParser().parse(urlResponse), ReadingInstance.class); + + return new MeterState(latestReading); + } catch (IOException e) { + logger.debug("Exception while refreshing cache for Meter {}: {}", getThing().getUID(), e.getMessage(), e); + return null; + } + } + + /** + * Generates a url string based on the given api endpoint + * + * @param endpoint The choosen api endpoint + * @return The generated url string + */ + private String getApiString(String endpoint) { + StringBuilder sb = new StringBuilder(API_BASE_URL); + sb.append(API_VERSION).append("/"); + + switch (endpoint) { + case API_METER_ENDPOINT: + sb.append(API_METER_ENDPOINT).append("/"); + sb.append(this.getRessourceID()).append("/?"); + break; + case API_READINGS_ENDPOINT: + sb.append(API_READINGS_ENDPOINT).append("/"); + sb.append("?meter_ressource_id=").append(this.getRessourceID()); + sb.append("&o=-reading_date").append("&"); + break; + } + + sb.append("format=json"); + return sb.toString(); + } + + /** + * Getters and Setters + */ + + public String getRessourceID() { + return resourceID; + } + + private void setRessourceID(String ressourceID) { + this.resourceID = ressourceID; + } + + public String getMeterID() { + return meterID; + } + + private void setMeterID(String meterID) { + this.meterID = meterID; + } +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerBindingConstants.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerBindingConstants.java new file mode 100644 index 0000000000000..028bd5cfcc3c4 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerBindingConstants.java @@ -0,0 +1,61 @@ +/** + * 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.pixometer.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 {@link PixometerBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +public class PixometerBindingConstants { + + private static final String BINDING_ID = "pixometer"; + + // Api base url + public static final String API_BASE_URL = "https://pixometer.io/api/"; + + // List of all Thing Type UIDs + public static final ThingTypeUID BRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "account"); + public static final ThingTypeUID THING_TYPE_ENERGYMETER = new ThingTypeUID(BINDING_ID, "energymeter"); + public static final ThingTypeUID THING_TYPE_GASMETER = new ThingTypeUID(BINDING_ID, "gasmeter"); + public static final ThingTypeUID THING_TYPE_WATERMETER = new ThingTypeUID(BINDING_ID, "watermeter"); + + public static final Set<ThingTypeUID> BRIDGE_THING_TYPES_UIDS = Collections.singleton(BRIDGE_THING_TYPE); + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream + .of(THING_TYPE_ENERGYMETER, THING_TYPE_GASMETER, THING_TYPE_WATERMETER).collect(Collectors.toSet()); + + // List of all Channel ids + public static final String CHANNEL_LAST_READING_VALUE = "last_reading_value"; + public static final String CHANNEL_LAST_READING_DATE = "last_reading_date"; + public static final String CHANNEL_LAST_REFRESH_DATE = "last_refresh_date"; + + // List of all config ids + public static final String CONFIG_BRIDGE_PASSWORD = "password"; + public static final String CONFIG_BRIDGE_REFRESH = "refresh"; + public static final String CONFIG_BRIDGE_USER = "user"; + + public static final String CONFIG_THING_RESSOURCE_ID = "resource_id"; + + // References for needed API identifiers + public static final String AUTH_TOKEN = "access_token"; +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerHandlerFactory.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerHandlerFactory.java new file mode 100644 index 0000000000000..1a2664bdf374e --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/PixometerHandlerFactory.java @@ -0,0 +1,72 @@ +/** + * 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.pixometer.internal; + +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.openhab.binding.pixometer.handler.AccountHandler; +import org.openhab.binding.pixometer.handler.MeterHandler; +import org.osgi.service.component.annotations.Component; + +/** + * The {@link PixometerHandlerFactory} is responsible for creating things and thing + * handlers. + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.pixometer", service = ThingHandlerFactory.class) +public class PixometerHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream + .of(PixometerBindingConstants.BRIDGE_THING_TYPES_UIDS, PixometerBindingConstants.SUPPORTED_THING_TYPES_UIDS) + .flatMap(Set::stream).collect(Collectors.toSet()); + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (thingTypeUID.equals(PixometerBindingConstants.THING_TYPE_ENERGYMETER)) { + return new MeterHandler(thing); + } + + if (thingTypeUID.equals(PixometerBindingConstants.THING_TYPE_GASMETER)) { + return new MeterHandler(thing); + } + + if (thingTypeUID.equals(PixometerBindingConstants.THING_TYPE_WATERMETER)) { + return new MeterHandler(thing); + } + + if (thingTypeUID.equals(PixometerBindingConstants.BRIDGE_THING_TYPE)) { + return new AccountHandler((Bridge) thing); + } + + return null; + } +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/Annotation.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/Annotation.java new file mode 100644 index 0000000000000..dc36553ece5d2 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/Annotation.java @@ -0,0 +1,73 @@ +/** + * 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.pixometer.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link Annotation} class is the representing java model for the json result for a annotation from the pixometer + * api + * + * @author Jerome Luckenbach - Initial Contribution + * + */ +@NonNullByDefault +public class Annotation { + + private @NonNullByDefault({}) Integer id; + private @NonNullByDefault({}) Object rectangle; + private @NonNullByDefault({}) String meaning; + private @NonNullByDefault({}) String text; + private @NonNullByDefault({}) Integer image; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Object getRectangle() { + return rectangle; + } + + public void setRectangle(Object rectangle) { + this.rectangle = rectangle; + } + + public String getMeaning() { + return meaning; + } + + public void setMeaning(String meaning) { + this.meaning = meaning; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Integer getImage() { + return image; + } + + public void setImage(Integer image) { + this.image = image; + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ImageMeta.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ImageMeta.java new file mode 100644 index 0000000000000..1128bb1579875 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ImageMeta.java @@ -0,0 +1,147 @@ +/** + * 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.pixometer.internal.config; + +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link ImageMeta} class is the representing java model for the json result for Image Meta Data from the pixometer + * api + * + * @author Jerome Luckenbach - Initial Contribution + * + */ +@NonNullByDefault +public class ImageMeta { + + private @NonNullByDefault({}) Integer id; + private @NonNullByDefault({}) List<Annotation> annotations = null; + private @NonNullByDefault({}) String image; + private @NonNullByDefault({}) String imageDownload; + private @NonNullByDefault({}) String cameraModel; + private @NonNullByDefault({}) Boolean flash; + private @NonNullByDefault({}) Integer frameNumber; + private @NonNullByDefault({}) Double secondsSinceDetection; + private @NonNullByDefault({}) Double secondsSinceStart; + private @NonNullByDefault({}) Double lat; + private @NonNullByDefault({}) Double lng; + private @NonNullByDefault({}) String osVersion; + private @NonNullByDefault({}) String pixolusVersion; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public List<Annotation> getAnnotations() { + return annotations; + } + + public void setAnnotations(List<Annotation> annotations) { + this.annotations = annotations; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getImageDownload() { + return imageDownload; + } + + public void setImageDownload(String imageDownload) { + this.imageDownload = imageDownload; + } + + public String getCameraModel() { + return cameraModel; + } + + public void setCameraModel(String cameraModel) { + this.cameraModel = cameraModel; + } + + public Boolean getFlash() { + return flash; + } + + public void setFlash(Boolean flash) { + this.flash = flash; + } + + public Integer getFrameNumber() { + return frameNumber; + } + + public void setFrameNumber(Integer frameNumber) { + this.frameNumber = frameNumber; + } + + public Double getSecondsSinceDetection() { + return secondsSinceDetection; + } + + public void setSecondsSinceDetection(Double secondsSinceDetection) { + this.secondsSinceDetection = secondsSinceDetection; + } + + public Double getSecondsSinceStart() { + return secondsSinceStart; + } + + public void setSecondsSinceStart(Double secondsSinceStart) { + this.secondsSinceStart = secondsSinceStart; + } + + public Double getLat() { + return lat; + } + + public void setLat(Double lat) { + this.lat = lat; + } + + public Double getLng() { + return lng; + } + + public void setLng(Double lng) { + this.lng = lng; + } + + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } + + public String getPixolusVersion() { + return pixolusVersion; + } + + public void setPixolusVersion(String pixolusVersion) { + this.pixolusVersion = pixolusVersion; + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/MeterInstance.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/MeterInstance.java new file mode 100644 index 0000000000000..22d3234eab4e4 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/MeterInstance.java @@ -0,0 +1,207 @@ +/** + * 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.pixometer.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link MeterInstance} class is the representing java model for the json result for a meter from the pixometer + * api + * + * @author Jerome Luckenbach - Initial Contribution + * + */ +@NonNullByDefault +public class MeterInstance { + + private @NonNullByDefault({}) String url; + private @NonNullByDefault({}) String owner; + private @NonNullByDefault({}) String changedHash; + private @NonNullByDefault({}) String created; + private @NonNullByDefault({}) String modified; + private @NonNullByDefault({}) String appearance; + private @NonNullByDefault({}) Integer fractionDigits; + private @NonNullByDefault({}) Boolean isDoubleTariff; + private @NonNullByDefault({}) String locationInBuilding; + private @NonNullByDefault({}) String meterId; + private @NonNullByDefault({}) String physicalMedium; + private @NonNullByDefault({}) String physicalUnit; + private @NonNullByDefault({}) Integer integerDigits; + private @NonNullByDefault({}) String registerOrder; + private @NonNullByDefault({}) Object city; + private @NonNullByDefault({}) Object zipCode; + private @NonNullByDefault({}) Object address; + private @NonNullByDefault({}) Object description; + private @NonNullByDefault({}) Object label; + private @NonNullByDefault({}) Integer resourceId; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getChangedHash() { + return changedHash; + } + + public void setChangedHash(String changedHash) { + this.changedHash = changedHash; + } + + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + public String getModified() { + return modified; + } + + public void setModified(String modified) { + this.modified = modified; + } + + public String getAppearance() { + return appearance; + } + + public void setAppearance(String appearance) { + this.appearance = appearance; + } + + public Integer getFractionDigits() { + return fractionDigits; + } + + public void setFractionDigits(Integer fractionDigits) { + this.fractionDigits = fractionDigits; + } + + public Boolean getIsDoubleTariff() { + return isDoubleTariff; + } + + public void setIsDoubleTariff(Boolean isDoubleTariff) { + this.isDoubleTariff = isDoubleTariff; + } + + public String getLocationInBuilding() { + return locationInBuilding; + } + + public void setLocationInBuilding(String locationInBuilding) { + this.locationInBuilding = locationInBuilding; + } + + public String getMeterId() { + return meterId; + } + + public void setMeterId(String meterId) { + this.meterId = meterId; + } + + public String getPhysicalMedium() { + return physicalMedium; + } + + public void setPhysicalMedium(String physicalMedium) { + this.physicalMedium = physicalMedium; + } + + public String getPhysicalUnit() { + return physicalUnit; + } + + public void setPhysicalUnit(String physicalUnit) { + this.physicalUnit = physicalUnit; + } + + public Integer getIntegerDigits() { + return integerDigits; + } + + public void setIntegerDigits(Integer integerDigits) { + this.integerDigits = integerDigits; + } + + public String getRegisterOrder() { + return registerOrder; + } + + public void setRegisterOrder(String registerOrder) { + this.registerOrder = registerOrder; + } + + public Object getCity() { + return city; + } + + public void setCity(Object city) { + this.city = city; + } + + public Object getZipCode() { + return zipCode; + } + + public void setZipCode(Object zipCode) { + this.zipCode = zipCode; + } + + public Object getAddress() { + return address; + } + + public void setAddress(Object address) { + this.address = address; + } + + public Object getDescription() { + return description; + } + + public void setDescription(Object description) { + this.description = description; + } + + public Object getLabel() { + return label; + } + + public void setLabel(Object label) { + this.label = label; + } + + public Integer getResourceId() { + return resourceId; + } + + public void setResourceId(Integer resourceId) { + this.resourceId = resourceId; + } +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerAccountConfiguration.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerAccountConfiguration.java new file mode 100644 index 0000000000000..cb2d05699d4d6 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerAccountConfiguration.java @@ -0,0 +1,40 @@ +/** + * 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.pixometer.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Data class representing the user configurable settings of the api + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +public class PixometerAccountConfiguration { + + /** + * The configured user name + */ + public @NonNullByDefault({}) String user; + + /** + * The configured password + */ + public @NonNullByDefault({}) String password; + + /** + * Configured refresh rate + */ + public int refresh; + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerMeterConfiguration.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerMeterConfiguration.java new file mode 100644 index 0000000000000..285702af9a9c2 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/PixometerMeterConfiguration.java @@ -0,0 +1,30 @@ +/** + * 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.pixometer.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * Data class representing the user configurable settings of a meter thing + * + * @author Jerome Luckenbach - Initial contribution + */ +@NonNullByDefault +public class PixometerMeterConfiguration { + + /** + * The resourceId of the current meter + */ + public @NonNullByDefault({}) String resourceId; + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ReadingInstance.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ReadingInstance.java new file mode 100644 index 0000000000000..3137f009e7f81 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/config/ReadingInstance.java @@ -0,0 +1,93 @@ +/** + * 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.pixometer.internal.config; + +import java.time.ZonedDateTime; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link ReadingInstance} class is the representing java model for the json result for a reading from the pixometer + * api + * + * @author Jerome Luckenbach - Initial Contribution + * + */ +@NonNullByDefault +public class ReadingInstance { + + private @NonNullByDefault({}) String url; + private @NonNullByDefault({}) String appliedMethod; + private @NonNullByDefault({}) ZonedDateTime readingDate; + private double value; + private double valueSecondTariff; + private int providedFractionDigits; + private int providedFractionDigitsSecondTariff; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getAppliedMethod() { + return appliedMethod; + } + + public void setAppliedMethod(String appliedMethod) { + this.appliedMethod = appliedMethod; + } + + public ZonedDateTime getReadingDate() { + return readingDate; + } + + public void setReadingDate(ZonedDateTime readingDate) { + this.readingDate = readingDate; + } + + public double getValue() { + return value; + } + + public void setValue(double value) { + this.value = value; + } + + public double getValueSecondTariff() { + return valueSecondTariff; + } + + public void setValueSecondTariff(double valueSecondTariff) { + this.valueSecondTariff = valueSecondTariff; + } + + public int getProvidedFractionDigits() { + return providedFractionDigits; + } + + public void setProvidedFractionDigits(int provided_fraction_digits) { + this.providedFractionDigits = provided_fraction_digits; + } + + public int getProvidedFractionDigitsSecondTariff() { + return providedFractionDigitsSecondTariff; + } + + public void setProvidedFractionDigitsSecondTariff(int provided_fraction_digits_second_tariff) { + this.providedFractionDigitsSecondTariff = provided_fraction_digits_second_tariff; + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/data/MeterState.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/data/MeterState.java new file mode 100644 index 0000000000000..c772cb561635d --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/data/MeterState.java @@ -0,0 +1,65 @@ +/** + * 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.pixometer.internal.data; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.openhab.binding.pixometer.internal.config.ReadingInstance; + +/** + * Abstract data class to store shared/common meter state values + * + * @author Jerome Luckenbach - Initial contribution + * + */ +@NonNullByDefault +public class MeterState { + + private final DateTimeType lastReadingDate; + private final DateTimeType lastRefreshTime; + private final double readingValue; + + /** + * Initialize times from the given timestamps + * + * @param lastReadingDate time of last reading as ZonedDateTime + * @param lastRefreshTime time of last refresh as ZonedDateTime + */ + public MeterState(ReadingInstance reading) { + this.readingValue = reading.getValue(); + this.lastReadingDate = new DateTimeType(reading.getReadingDate()); + this.lastRefreshTime = new DateTimeType(); + } + + /** + * @return returns the current reading value + */ + public double getReadingValue() { + return readingValue; + } + + /** + * @return returns the last time that the meter has been read into pixometer + */ + public DateTimeType getLastReadingDate() { + return lastReadingDate; + } + + /** + * @return returns the last time, the item has been refreshed + */ + public DateTimeType getLastRefreshTime() { + return lastRefreshTime; + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/serializer/CustomReadingInstanceDeserializer.java b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/serializer/CustomReadingInstanceDeserializer.java new file mode 100644 index 0000000000000..927ce674eb99a --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/java/org/openhab/binding/pixometer/internal/serializer/CustomReadingInstanceDeserializer.java @@ -0,0 +1,110 @@ +/** + * 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.pixometer.internal.serializer; + +import java.lang.reflect.Type; +import java.time.Instant; +import java.time.ZonedDateTime; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.openhab.binding.pixometer.internal.config.ReadingInstance; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; + +/** + * Custom Deserializer for meter reading api responses + * + * @author Jerome Luckenbach - Initial contribution + * + */ +@NonNullByDefault +public class CustomReadingInstanceDeserializer implements JsonDeserializer<ReadingInstance> { + + private static final String COUNT = "count"; + private static final String RESULTS = "results"; + private static final String URL = "url"; + private static final String APPLIED_METHOD = "applied_method"; + private static final String READING_DATE = "reading_date"; + private static final String VALUE = "value"; + private static final String VALUE_SECOND_TARIFF = "value_second_tariff"; + private static final String PROVIDED_FRACTION_DIGITS = "provided_fraction_digits"; + private static final String PROVIDED_FRACTION_DIGITS_SECOND_TARIFF = "provided_fraction_digits_second_tariff"; + + @Override + @NonNullByDefault({}) + public ReadingInstance deserialize(final JsonElement json, final Type typeOfT, + final JsonDeserializationContext context) throws JsonParseException { + final JsonObject jsonObject = json.getAsJsonObject(); + + if (!jsonObject.has(COUNT)) { + throw new JsonParseException("Invalid Json Response"); + } + + ReadingInstance result = new ReadingInstance(); + int resultCount = Integer.parseInt(jsonObject.get(COUNT).toString()); + + // No readings provided yet + if (resultCount < 1) { + result.setReadingDate(ZonedDateTime.from(Instant.EPOCH)); + result.setValue(0); + } + + // Fist result is the last reading instance + JsonObject latestReading = jsonObject.getAsJsonArray(RESULTS).get(0).getAsJsonObject(); + + result.setUrl(getStringFromJson(latestReading, URL)); + result.setAppliedMethod(getStringFromJson(latestReading, APPLIED_METHOD)); + result.setReadingDate(ZonedDateTime.parse(getStringFromJson(latestReading, READING_DATE))); + result.setValue(Double.parseDouble(getStringFromJson(latestReading, VALUE))); + + // Not all meters provide useful data for second tariff and fraction digits , so zero should be used in case of + // a null value. + String secondTariffValue = getStringFromJson(latestReading, VALUE_SECOND_TARIFF); + result.setValueSecondTariff( + checkStringForNullValues(secondTariffValue) ? 0 : Double.parseDouble(secondTariffValue)); + + String providedFractionDigits = getStringFromJson(latestReading, PROVIDED_FRACTION_DIGITS); + result.setProvidedFractionDigits( + checkStringForNullValues(providedFractionDigits) ? 0 : Integer.parseInt(providedFractionDigits)); + + String secondprovidedFractionDigits = getStringFromJson(latestReading, PROVIDED_FRACTION_DIGITS_SECOND_TARIFF); + result.setProvidedFractionDigitsSecondTariff(checkStringForNullValues(secondprovidedFractionDigits) ? 0 + : Integer.parseInt(secondprovidedFractionDigits)); + + return result; + } + + /** + * Returns the node value and removes possible added quotation marks, which would lead to parse errors. + * + * @param data The Json source to get the string from + * @param key The key for the wanted Json Node + * @return The wanted string without unnecessary quotation marks + */ + private String getStringFromJson(JsonObject data, String key) { + return data.get(key).toString().replaceAll("\"", ""); + } + + /** + * @param s the striong to check + * @return returns true if null values have been found, false otherwise + */ + private boolean checkStringForNullValues(String s) { + return (s == null || s.isEmpty() || s.equals("null")); + } + +} diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..a8e4c0d11a3c2 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="pixometer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Pixometer Binding</name> + <description>This binding integrates meter data through pixometer.</description> + <author>Jerome Luckenbach</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_de_DE.properties b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_de_DE.properties new file mode 100644 index 0000000000000..1492ef07fa7ab --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_de_DE.properties @@ -0,0 +1,44 @@ +# binding +binding.pixometer.name = Pixometer Binding +binding.pixometer.description = Mit dem Pixometer Binding ist es möglich über die Pixometer.io API Daten und Messwerte von den dort erfassten Zählern abzurufen. + +# thing types +thing-type.pixometer.account.label = Pixometer Account +thing-type.pixometer.account.description = Stellt die Verbindung zur API für die eingerichteten Zähler bereit. + +thing-type.config.pixometer.account.user.label = Benutzername +thing-type.config.pixometer.account.user.description = Der Pixometer Benutzername + +thing-type.config.pixometer.account.password.label = Password +thing-type.config.pixometer.account.password.description = Das Pixometer Passwort + +thing-type.config.pixometer.account.refresh.label = Aktualisierungsintervall +thing-type.config.pixometer.account.refresh.description = Das Intervall in dem ein Zähler aktualisiert wird (in Minuten, Minimum 60) + +thing-type.pixometer.energymeter.label = Stromzähler +thing-type.pixometer.energymeter.description = Stellt die Informationen und Messwerte zu einem Stromzähler bereit. + +thing-type.config.pixometer.energymeter.resource_id.label = Zähler Ressourcen ID +thing-type.config.pixometer.energymeter.resource_id.description = Unter dieser ID wird der Zähler im Pixometer Account geführt. Sie ist in der Pixometer Homepage in der Adressleiste des Browsers beim Bearbeiten des Zählers ersichtlich. + +thing-type.pixometer.gasmeter.label = Gaszähler +thing-type.pixometer.gasmeter.description = Stellt die Informationen und Messwerte zu einem Gaszähler bereit. + +thing-type.config.pixometer.gasmeter.resource_id.label = Zähler Ressourcen ID +thing-type.config.pixometer.gasmeter.resource_id.description = Unter dieser ID wird der Zähler im Pixometer Account geführt. Sie ist in der Pixometer Homepage in der Adressleiste des Browsers beim Bearbeiten des Zählers ersichtlich. + +thing-type.pixometer.watermeter.label = Wasserzähler +thing-type.pixometer.watermeter.description = Stellt die Informationen und Messwerte zu einem Wasserzähler bereit. + +thing-type.config.pixometer.watermeter.resource_id.label = Zähler Ressourcen ID +thing-type.config.pixometer.watermeter.resource_id.description = Unter dieser ID wird der Zähler im Pixometer Account geführt. Sie ist in der Pixometer Homepage in der Adressleiste des Browsers beim Bearbeiten des Zählers ersichtlich. + +# channel types +channel-type.pixometer.last_reading_value.label = Zählerstand +channel-type.pixometer.last_reading_value.description = Der zuletzt von der API abgefragte Zählerstand für diesen Zähler. + +channel-type.pixometer.last_reading_date.label = Ablesezeitpunkt +channel-type.pixometer.last_reading_date.description = Der Zeitpunkt der zuletzt abgefragten Ablesung für diesem Zähler. + +channel-type.pixometer.last_refresh_date.label = Aktualisierungszeitpunkt +channel-type.pixometer.last_refresh_date.description = Der Zeitpunkt an dem dieser Zähler zuletzt vom Binding in der API abgefragt wurde. diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_en_US.properties b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_en_US.properties new file mode 100644 index 0000000000000..829c1e1cf310e --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/i18n/pixometer_en_US.properties @@ -0,0 +1,44 @@ +# binding +binding.pixometer.name = Pixometer Binding +binding.pixometer.description = This binding can connect to the Pixometer.io API and accesses meters and measurement data from the connected account. + +# thing types +thing-type.pixometer.account.label = Pixometer Account +thing-type.pixometer.account.description = + +thing-type.config.pixometer.account.user.label = Username +thing-type.config.pixometer.account.user.description = The Pixometer username + +thing-type.config.pixometer.account.password.label = Password +thing-type.config.pixometer.account.password.description = The Pixometer password + +thing-type.config.pixometer.account.refresh.label = Refresh Interval +thing-type.config.pixometer.account.refresh.description = The interval on which the API is refreshed. (at least 60 minutes) + +thing-type.pixometer.energymeter.label = Energymeter +thing-type.pixometer.energymeter.description = An energymeter thing. + +thing-type.config.pixometer.energymeter.resource_id.label = Meter Ressource ID +thing-type.config.pixometer.energymeter.resource_id.description = The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit" + +thing-type.pixometer.gasmeter.label = Gasmeter +thing-type.pixometer.gasmeter.description = A gas meter. + +thing-type.config.pixometer.gasmeter.resource_id.label = Meter Tressource ID +thing-type.config.pixometer.gasmeter.resource_id.description = The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit" + +thing-type.pixometer.watermeter.label = Watermeter +thing-type.pixometer.watermeter.description = A water meter. + +thing-type.config.pixometer.watermeter.resource_id.label = Meter Ressource ID +thing-type.config.pixometer.watermeter.resource_id.description = The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit" + +# channel types +channel-type.pixometer.last_reading_value.label = Reading Value +channel-type.pixometer.last_reading_value.description = Value of the last reading that has been made with pixometer. + +channel-type.pixometer.last_reading_date.label = Reading Date +channel-type.pixometer.last_reading_date.description = Date of the last reading that has been made with pixometer. + +channel-type.pixometer.last_refresh_date.label = Refresh Date +channel-type.pixometer.last_refresh_date.description = Date of the last time the Api has been refreshed. diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/account.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/account.xml new file mode 100644 index 0000000000000..e363e78c13ed7 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/account.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="pixometer" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <!-- API Bridge Type --> + <bridge-type id="account"> + <label>Pixometer Account</label> + <description>This Bridge handles your Pixometer account.</description> + <config-description> + <parameter name="user" type="text" required="true"> + <label>Username</label> + <description>Your Pixometer Username.</description> + <default></default> + </parameter> + <parameter name="password" type="text" required="true"> + <context>password</context> + <label>Password</label> + <description>Your Pixometer Password.</description> + <default></default> + </parameter> + <parameter name="refresh" type="integer" required="true" min="60"> + <label>Refresh Time</label> + <description>Sets the refresh time. Minimum is 60 Minutes.</description> + <default>240</default> + </parameter> + </config-description> + </bridge-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..2f98ccc5a544b --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="pixometer" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + <channel-type id="last_reading_date"> + <item-type>DateTime</item-type> + <label>Last Reading</label> + <description>The last time that the current meter has been read.</description> + <state readOnly="true" /> + </channel-type> + <channel-type id="last_refresh_date"> + <item-type>DateTime</item-type> + <label>Last Refresh</label> + <description>The last time that the thing has been refreshed.</description> + <state readOnly="true" /> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/energymeter.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/energymeter.xml new file mode 100644 index 0000000000000..cc858a83471b5 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/energymeter.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="pixometer" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="energymeter"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + <label>Energymeter</label> + <description>A specific energy meter.</description> + <channels> + <channel id="last_reading_value" typeId="last_reading_value_energy" /> + <channel id="last_reading_date" typeId="last_reading_date" /> + <channel id="last_refresh_date" typeId="last_refresh_date" /> + </channels> + <config-description> + <parameter name="resourceId" type="text" required="true"> + <label>Ressource ID</label> + <description>The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit"</description> + </parameter> + </config-description> + </thing-type> + <channel-type id="last_reading_value_energy"> + <item-type>Number:Energy</item-type> + <label>Last Reading</label> + <description>The last value that has been read for this meter.</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/gasmeter.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/gasmeter.xml new file mode 100644 index 0000000000000..9c8347ee73c26 --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/gasmeter.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="pixometer" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="gasmeter"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + <label>Gasmeter</label> + <description>A specific gas meter.</description> + <channels> + <channel id="last_reading_value" typeId="last_reading_value_gas" /> + <channel id="last_reading_date" typeId="last_reading_date" /> + <channel id="last_refresh_date" typeId="last_refresh_date" /> + </channels> + <config-description> + <parameter name="resourceId" type="text" required="true"> + <label>Ressource ID</label> + <description>The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit"</description> + </parameter> + </config-description> + </thing-type> + <channel-type id="last_reading_value_gas"> + <item-type>Number:Volume</item-type> + <label>Last Reading</label> + <description>The last value that has been read for this meter.</description> + <state pattern="%.3f %unit%" readOnly="true" /> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/watermeter.xml b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/watermeter.xml new file mode 100644 index 0000000000000..b26c4d728b43c --- /dev/null +++ b/bundles/org.openhab.binding.pixometer/src/main/resources/ESH-INF/thing/watermeter.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="pixometer" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="watermeter"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + <label>Watermeter</label> + <description>A specific water meter.</description> + <channels> + <channel id="last_reading_value" typeId="last_reading_value_water" /> + <channel id="last_reading_date" typeId="last_reading_date" /> + <channel id="last_refresh_date" typeId="last_refresh_date" /> + </channels> + <config-description> + <parameter name="resourceId" type="text" required="true"> + <label>Ressource ID</label> + <description>The ID which represents the current meter. You can find it in the pixometer browser app while editing a specific meter. It should look like this: "https://pixometer.io/portal/#/meters/XXXXX/edit"</description> + </parameter> + </config-description> + </thing-type> + <channel-type id="last_reading_value_water"> + <item-type>Number:Volume</item-type> + <label>Last Reading</label> + <description>The last value that has been read for this meter.</description> + <state pattern="%.3f %unit%" readOnly="true" /> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.pjlinkdevice/.project b/bundles/org.openhab.binding.pjlinkdevice/.project index 9e933854136f0..52743bbd874fd 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/.project +++ b/bundles/org.openhab.binding.pjlinkdevice/.project @@ -20,4 +20,4 @@ <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures> -</projectDescription> \ No newline at end of file +</projectDescription> diff --git a/bundles/org.openhab.binding.pjlinkdevice/NOTICE b/bundles/org.openhab.binding.pjlinkdevice/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/NOTICE +++ b/bundles/org.openhab.binding.pjlinkdevice/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.pjlinkdevice/README.md b/bundles/org.openhab.binding.pjlinkdevice/README.md index ff9bb26b5c23b..ba63f5cb2cd77 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/README.md +++ b/bundles/org.openhab.binding.pjlinkdevice/README.md @@ -12,7 +12,7 @@ This binding supports devices which implement the PJLink protocol (Class 1). Limitations at this point: - only IPv4 connections are supported -- only PJLink Class 1 commands are supported. Class 2 devices should work fine nevertheless, it's just the Class 2 features that will not work. +- only PJLink Class 1 commands are supported. Class 2 devices should work fine nevertheless, it is just the Class 2 features that will not work. The binding is tested with the PJLink device test tool (PJLinkTEST4CNT) and an Acer VL7680. diff --git a/bundles/org.openhab.binding.pjlinkdevice/pom.xml b/bundles/org.openhab.binding.pjlinkdevice/pom.xml index e2225cd7ff737..7399486a7ddee 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/pom.xml +++ b/bundles/org.openhab.binding.pjlinkdevice/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.pjlinkdevice</artifactId> diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/feature/feature.xml b/bundles/org.openhab.binding.pjlinkdevice/src/main/feature/feature.xml index fdba07a7b3114..e84b2c389a6e9 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.pjlinkdevice-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-pjlinkdevice" description="PJLinkDevice Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/ConfigurationException.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/ConfigurationException.java index 85ec691658f95..9136d8b389f46 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/ConfigurationException.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/ConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/InputChannelStateDescriptionProvider.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/InputChannelStateDescriptionProvider.java index f3975ba3346da..7bd71ba0142e4 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/InputChannelStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/InputChannelStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceBindingConstants.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceBindingConstants.java index 7df2074ade0ac..3bec70d6021ce 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceBindingConstants.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceConfiguration.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceConfiguration.java index 4bad51e5b4552..585c4d0063744 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceConfiguration.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandler.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandler.java index 70cee8f007683..cc62c2df17168 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandler.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandlerFactory.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandlerFactory.java index 3635397f4b3e7..9c68d8e352f20 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandlerFactory.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/PJLinkDeviceHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/PJLinkDevice.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/PJLinkDevice.java index 230d6112f999b..549f49807d821 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/PJLinkDevice.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/PJLinkDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,6 +27,8 @@ import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.binding.pjlinkdevice.internal.device.command.AuthenticationException; import org.openhab.binding.pjlinkdevice.internal.device.command.ResponseException; import org.openhab.binding.pjlinkdevice.internal.device.command.authentication.AuthenticationCommand; @@ -50,9 +52,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; - /** * Represents a PJLink device and takes care of managing the TCP connection, executing commands, and authentication. * @@ -62,287 +61,290 @@ */ @NonNullByDefault public class PJLinkDevice { - private static final int TIMEOUT = 30000; - protected int tcpPort; - protected InetAddress ipAddress; - protected @Nullable String adminPassword; - protected boolean authenticationRequired; - protected @Nullable BufferedReader reader; - protected @Nullable Socket socket; - protected int timeout = TIMEOUT; - private final Logger logger = LoggerFactory.getLogger(PJLinkDevice.class); - private String prefixForNextCommand = ""; - private @Nullable Instant socketCreatedOn; - - public PJLinkDevice(int tcpPort, InetAddress ipAddress, @Nullable String adminPassword, int timeout) { - this.tcpPort = tcpPort; - this.ipAddress = ipAddress; - this.adminPassword = adminPassword; - this.timeout = timeout; - } - - public PJLinkDevice(int tcpPort, InetAddress ipAddress, @Nullable String adminPassword) { - this(tcpPort, ipAddress, adminPassword, TIMEOUT); - } - - @Override - public String toString() { - return "PJLink " + this.ipAddress + ":" + this.tcpPort; - } - - protected Socket connect() throws IOException, ResponseException, AuthenticationException { - return connect(false); - } - - protected BufferedReader getReader() throws IOException, ResponseException, AuthenticationException { - BufferedReader reader = this.reader; - if (reader == null) { - this.reader = reader = new BufferedReader(new InputStreamReader(connect().getInputStream())); + private static final int TIMEOUT = 30000; + protected int tcpPort; + protected InetAddress ipAddress; + protected @Nullable String adminPassword; + protected boolean authenticationRequired; + protected @Nullable BufferedReader reader; + protected @Nullable Socket socket; + protected int timeout = TIMEOUT; + private final Logger logger = LoggerFactory.getLogger(PJLinkDevice.class); + private String prefixForNextCommand = ""; + private @Nullable Instant socketCreatedOn; + + public PJLinkDevice(int tcpPort, InetAddress ipAddress, @Nullable String adminPassword, int timeout) { + this.tcpPort = tcpPort; + this.ipAddress = ipAddress; + this.adminPassword = adminPassword; + this.timeout = timeout; } - return reader; - } - - protected void closeSocket(@Nullable Socket socket) { - if (socket != null) { - try { - socket.close(); - } catch (IOException e) { - // okay then, at least we tried - logger.trace("closing of socket failed, cause {}", e); - } + + public PJLinkDevice(int tcpPort, InetAddress ipAddress, @Nullable String adminPassword) { + this(tcpPort, ipAddress, adminPassword, TIMEOUT); } - this.socket = null; - this.reader = null; - } - - protected Socket connect(boolean forceReconnect) throws IOException, ResponseException, AuthenticationException { - Instant now = Instant.now(); - Socket socket = this.socket; - boolean connectionTooOld = false; - if (this.socketCreatedOn != null) { - long millisecondsSinceLastConnect = Duration.between(this.socketCreatedOn, now).toMillis(); - // according to the PJLink specification, the device closes the connection after 30s idle (without notice), - // so to be on the safe side we do not reuse sockets older than 20s - connectionTooOld = millisecondsSinceLastConnect > 20 * 1000; + + @Override + public String toString() { + return "PJLink " + this.ipAddress + ":" + this.tcpPort; } - if (forceReconnect || connectionTooOld) { - if (socket != null) { - closeSocket(socket); - } + protected Socket connect() throws IOException, ResponseException, AuthenticationException { + return connect(false); } - this.socketCreatedOn = now; - if (socket != null && socket.isConnected() && !socket.isClosed()) { - return socket; + protected BufferedReader getReader() throws IOException, ResponseException, AuthenticationException { + BufferedReader reader = this.reader; + if (reader == null) { + this.reader = reader = new BufferedReader(new InputStreamReader(connect().getInputStream())); + } + return reader; } - SocketAddress socketAddress = new InetSocketAddress(ipAddress, tcpPort); - - try { - this.socket = socket = new Socket(); - socket.connect(socketAddress, timeout); - socket.setSoTimeout(timeout); - BufferedReader reader = getReader(); - String header = reader.readLine(); - if (header == null) { - throw new ResponseException("No PJLink header received from the device"); - } - header = header.toUpperCase(); - switch (header.substring(0, "PJLINK x".length())) { - case "PJLINK 0": - logger.debug("Authentication not needed"); - this.authenticationRequired = false; - break; - case "PJLINK 1": - logger.debug("Authentication needed"); - this.authenticationRequired = true; - if (this.adminPassword == null) { - closeSocket(socket); - throw new AuthenticationException("No password provided, but device requires authentication"); - } else { + protected void closeSocket(@Nullable Socket socket) { + if (socket != null) { try { - authenticate(header.substring("PJLINK 1 ".length())); - } catch (AuthenticationException e) { - // propagate AuthenticationException - throw e; - } catch (ResponseException e) { - // maybe only the test command is broken on the device - // as long as we don't get an AuthenticationException, we'll just ignore it for now + socket.close(); + } catch (IOException e) { + // okay then, at least we tried + logger.trace("closing of socket failed", e); } - } - break; - default: - logger.debug("Cannot handle introduction response {}", header); - throw new ResponseException("Invalid header: " + header); - } - return socket; - } catch (ConnectException | SocketTimeoutException | NoRouteToHostException e) { - // these exceptions indicate that there's no device at this address, just throw without logging - throw e; - } catch (IOException | ResponseException e) { - // these exceptions seem to be more interesting in the log during a scan - // This should not happen and might be a user configuration issue, we log a warning message therefore. - logger.debug("Could not create a socket connection", e); - throw e; + } + this.socket = null; + this.reader = null; } - } - - private void authenticate(String challenge) throws ResponseException, IOException, AuthenticationException { - new AuthenticationCommand<>(this, challenge, new PowerQueryCommand(this)).execute(); - } - - public PowerQueryResponse getPowerStatus() throws ResponseException, IOException, AuthenticationException { - return new PowerQueryCommand(this).execute(); - } - - public void addPrefixToNextCommand(String cmd) throws IOException, AuthenticationException { - this.prefixForNextCommand = cmd; - } - - public synchronized String execute(String command) throws IOException, AuthenticationException, ResponseException { - String fullCommand = this.prefixForNextCommand + command; - this.prefixForNextCommand = ""; - for (int numberOfTries = 0; true; numberOfTries++) { - try { - Socket socket = connect(); - socket.getOutputStream().write((fullCommand).getBytes()); - socket.getOutputStream().flush(); - - // success, no further tries needed - break; - } catch (java.net.SocketException e) { - closeSocket(socket); - if (numberOfTries >= 2) { - // do not retry endlessly - throw e; + + protected Socket connect(boolean forceReconnect) throws IOException, ResponseException, AuthenticationException { + Instant now = Instant.now(); + Socket socket = this.socket; + boolean connectionTooOld = false; + if (this.socketCreatedOn != null) { + long millisecondsSinceLastConnect = Duration.between(this.socketCreatedOn, now).toMillis(); + // according to the PJLink specification, the device closes the connection after 30s idle (without notice), + // so to be on the safe side we do not reuse sockets older than 20s + connectionTooOld = millisecondsSinceLastConnect > 20 * 1000; } - } + + if (forceReconnect || connectionTooOld) { + if (socket != null) { + closeSocket(socket); + } + } + + this.socketCreatedOn = now; + if (socket != null && socket.isConnected() && !socket.isClosed()) { + return socket; + } + + SocketAddress socketAddress = new InetSocketAddress(ipAddress, tcpPort); + + try { + this.socket = socket = new Socket(); + socket.connect(socketAddress, timeout); + socket.setSoTimeout(timeout); + BufferedReader reader = getReader(); + String header = reader.readLine(); + if (header == null) { + throw new ResponseException("No PJLink header received from the device"); + } + header = header.toUpperCase(); + switch (header.substring(0, "PJLINK x".length())) { + case "PJLINK 0": + logger.debug("Authentication not needed"); + this.authenticationRequired = false; + break; + case "PJLINK 1": + logger.debug("Authentication needed"); + this.authenticationRequired = true; + if (this.adminPassword == null) { + closeSocket(socket); + throw new AuthenticationException("No password provided, but device requires authentication"); + } else { + try { + authenticate(header.substring("PJLINK 1 ".length())); + } catch (AuthenticationException e) { + // propagate AuthenticationException + throw e; + } catch (ResponseException e) { + // maybe only the test command is broken on the device + // as long as we don't get an AuthenticationException, we'll just ignore it for now + } + } + break; + default: + logger.debug("Cannot handle introduction response {}", header); + throw new ResponseException("Invalid header: " + header); + } + return socket; + } catch (ConnectException | SocketTimeoutException | NoRouteToHostException e) { + // these exceptions indicate that there's no device at this address, just throw without logging + throw e; + } catch (IOException | ResponseException e) { + // these exceptions seem to be more interesting in the log during a scan + // This should not happen and might be a user configuration issue, we log a warning message therefore. + logger.debug("Could not create a socket connection", e); + throw e; + } + } + + private void authenticate(String challenge) throws ResponseException, IOException, AuthenticationException { + new AuthenticationCommand<>(this, challenge, new PowerQueryCommand(this)).execute(); + } + + public PowerQueryResponse getPowerStatus() throws ResponseException, IOException, AuthenticationException { + return new PowerQueryCommand(this).execute(); } - String response = null; - while ((response = getReader().readLine()) != null && response.isEmpty()) { - logger.debug("Got empty string response for request '{}' from {}, waiting for another line", response, - fullCommand.replaceAll("\r", "\\\\r")); + public void addPrefixToNextCommand(String cmd) throws IOException, AuthenticationException { + this.prefixForNextCommand = cmd; } - logger.debug("Got response '{}' for request '{}' from {}", response, fullCommand.replaceAll("\r", "\\\\r"), - ipAddress.toString()); - if (response == null) { - throw new ResponseException("Response to request '" + fullCommand.replaceAll("\r", "\\\\r") + "' was null"); + + public synchronized String execute(String command) throws IOException, AuthenticationException, ResponseException { + String fullCommand = this.prefixForNextCommand + command; + this.prefixForNextCommand = ""; + for (int numberOfTries = 0; true; numberOfTries++) { + try { + Socket socket = connect(); + socket.getOutputStream().write((fullCommand).getBytes()); + socket.getOutputStream().flush(); + + // success, no further tries needed + break; + } catch (java.net.SocketException e) { + closeSocket(socket); + if (numberOfTries >= 2) { + // do not retry endlessly + throw e; + } + } + } + + String response = null; + while ((response = getReader().readLine()) != null && response.isEmpty()) { + logger.debug("Got empty string response for request '{}' from {}, waiting for another line", response, + fullCommand.replaceAll("\r", "\\\\r")); + } + logger.debug("Got response '{}' for request '{}' from {}", response, fullCommand.replaceAll("\r", "\\\\r"), + ipAddress.toString()); + if (response == null) { + throw new ResponseException("Response to request '" + fullCommand.replaceAll("\r", "\\\\r") + "' was null"); + } + return response; } - return response; - } - - public void checkAvailability() throws IOException, AuthenticationException, ResponseException { - connect(); - } - - public String getName() throws IOException, ResponseException, AuthenticationException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.NAME).execute().getResult(); - } - - public String getManufacturer() throws IOException, ResponseException, AuthenticationException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.MANUFACTURER).execute() - .getResult(); - } - - public String getModel() throws IOException, ResponseException, AuthenticationException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.MODEL).execute().getResult(); - } - - public String getFullDescription() throws AuthenticationException, ResponseException { - StringBuilder sb = new StringBuilder(); - try { - sb.append(getManufacturer()); - sb.append(" "); - } catch (ResponseException | IOException e) { - // okay, we'll try the other identification commands + + public void checkAvailability() throws IOException, AuthenticationException, ResponseException { + connect(); } - try { - sb.append(getModel()); - } catch (ResponseException | IOException e1) { - // okay, we'll try the other identification commands + public String getName() throws IOException, ResponseException, AuthenticationException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.NAME).execute().getResult(); } - try { - String name = getName(); - if (!name.isEmpty()) { - sb.append(": "); - sb.append(name); - } - } catch (ResponseException | IOException e2) { - // okay, we'll try the other identification commands + public String getManufacturer() throws IOException, ResponseException, AuthenticationException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.MANUFACTURER).execute() + .getResult(); } - if (sb.length() == 0) { - throw new ResponseException("None of the identification commands worked"); + public String getModel() throws IOException, ResponseException, AuthenticationException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.MODEL).execute() + .getResult(); } - return sb.toString(); - } + public String getFullDescription() throws AuthenticationException, ResponseException { + StringBuilder sb = new StringBuilder(); + try { + sb.append(getManufacturer()); + sb.append(" "); + } catch (ResponseException | IOException e) { + // okay, we'll try the other identification commands + } - public String getPJLinkClass() throws IOException, AuthenticationException, ResponseException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.CLASS).execute().getResult(); - } + try { + sb.append(getModel()); + } catch (ResponseException | IOException e1) { + // okay, we'll try the other identification commands + } - public void powerOn() throws ResponseException, IOException, AuthenticationException { - new PowerInstructionCommand(this, PowerInstructionCommand.PowerInstructionState.ON).execute(); - } + try { + String name = getName(); + if (!name.isEmpty()) { + sb.append(": "); + sb.append(name); + } + } catch (ResponseException | IOException e2) { + // okay, we'll try the other identification commands + } - public void powerOff() throws IOException, ResponseException, AuthenticationException { - new PowerInstructionCommand(this, PowerInstructionCommand.PowerInstructionState.OFF).execute(); - } + if (sb.length() == 0) { + throw new ResponseException("None of the identification commands worked"); + } - public @Nullable String getAdminPassword() { - return this.adminPassword; - } + return sb.toString(); + } - public Boolean getAuthenticationRequired() { - return this.authenticationRequired; - } + public String getPJLinkClass() throws IOException, AuthenticationException, ResponseException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.CLASS).execute() + .getResult(); + } - public InputQueryResponse getInputStatus() throws ResponseException, IOException, AuthenticationException { - return new InputQueryCommand(this).execute(); - } + public void powerOn() throws ResponseException, IOException, AuthenticationException { + new PowerInstructionCommand(this, PowerInstructionCommand.PowerInstructionState.ON).execute(); + } - public void setInput(Input input) throws ResponseException, IOException, AuthenticationException { - new InputInstructionCommand(this, input).execute(); - } + public void powerOff() throws IOException, ResponseException, AuthenticationException { + new PowerInstructionCommand(this, PowerInstructionCommand.PowerInstructionState.OFF).execute(); + } - public MuteQueryResponseValue getMuteStatus() throws ResponseException, IOException, AuthenticationException { - return new MuteQueryCommand(this).execute().getResult(); - } + public @Nullable String getAdminPassword() { + return this.adminPassword; + } - public void setMute(MuteInstructionChannel channel, boolean muteOn) - throws ResponseException, IOException, AuthenticationException { - new MuteInstructionCommand(this, muteOn ? MuteInstructionState.ON : MuteInstructionState.OFF, channel).execute(); - } + public Boolean getAuthenticationRequired() { + return this.authenticationRequired; + } - public Map<ErrorStatusDevicePart, ErrorStatusQueryResponseState> getErrorStatus() - throws ResponseException, IOException, AuthenticationException { - return new ErrorStatusQueryCommand(this).execute().getResult(); - } + public InputQueryResponse getInputStatus() throws ResponseException, IOException, AuthenticationException { + return new InputQueryCommand(this).execute(); + } + + public void setInput(Input input) throws ResponseException, IOException, AuthenticationException { + new InputInstructionCommand(this, input).execute(); + } + + public MuteQueryResponseValue getMuteStatus() throws ResponseException, IOException, AuthenticationException { + return new MuteQueryCommand(this).execute().getResult(); + } + + public void setMute(MuteInstructionChannel channel, boolean muteOn) + throws ResponseException, IOException, AuthenticationException { + new MuteInstructionCommand(this, muteOn ? MuteInstructionState.ON : MuteInstructionState.OFF, channel) + .execute(); + } - public String getLampHours() throws ResponseException, IOException, AuthenticationException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.LAMP_HOURS).execute() - .getResult(); - } + public Map<ErrorStatusDevicePart, ErrorStatusQueryResponseState> getErrorStatus() + throws ResponseException, IOException, AuthenticationException { + return new ErrorStatusQueryCommand(this).execute().getResult(); + } - public String getOtherInformation() throws ResponseException, IOException, AuthenticationException { - return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.OTHER_INFORMATION).execute() - .getResult(); - } + public String getLampHours() throws ResponseException, IOException, AuthenticationException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.LAMP_HOURS).execute() + .getResult(); + } - public Set<Input> getAvailableInputs() throws ResponseException, IOException, AuthenticationException { - return new InputListQueryCommand(this).execute().getResult(); + public String getOtherInformation() throws ResponseException, IOException, AuthenticationException { + return new IdentificationCommand(this, IdentificationCommand.IdentificationProperty.OTHER_INFORMATION).execute() + .getResult(); + } - } + public Set<Input> getAvailableInputs() throws ResponseException, IOException, AuthenticationException { + return new InputListQueryCommand(this).execute().getResult(); - public void dispose() { - final Socket socket = this.socket; - if (socket != null) { - closeSocket(socket); } - } + + public void dispose() { + final Socket socket = this.socket; + if (socket != null) { + closeSocket(socket); + } + } } diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AbstractCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AbstractCommand.java index 827d3a9b0bd53..9526adf2f3912 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AbstractCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AbstractCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AcknowledgeResponseValue.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AcknowledgeResponseValue.java index ba0838ed350ea..321e0bd692343 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AcknowledgeResponseValue.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AcknowledgeResponseValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AuthenticationException.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AuthenticationException.java index 8475c0817b6d8..56d3e260a0468 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AuthenticationException.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/AuthenticationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Command.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Command.java index 1dfae0229c198..18e764f356220 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Command.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ErrorCode.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ErrorCode.java index 94572eca705a4..dfc7d7a262be0 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ErrorCode.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ErrorCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/PrefixedResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/PrefixedResponse.java index 472c93361dc35..1dd99e7b814d0 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/PrefixedResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/PrefixedResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Request.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Request.java index 8ad1031c9b504..2eb928caabb40 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Request.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Request.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Response.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Response.java index b5bf07f7c9464..93620b6684c8c 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Response.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/Response.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ResponseException.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ResponseException.java index da9ac784ff0bd..fa8028133618c 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ResponseException.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/ResponseException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationCommand.java index 5a9e185c5f2a3..7158761439cc4 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationRequest.java index 5de8cccda73ca..b9cb4c08ed180 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/authentication/AuthenticationRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryCommand.java index 5ce9c62a22208..4aeff43bfa22a 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryRequest.java index 68503413c9cf3..17d111fd6b9ac 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryResponse.java index 0df097dbeb2c2..a26b463d5b88e 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/errorstatus/ErrorStatusQueryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationCommand.java index 3215a1627dbb4..de36630f64ba8 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationRequest.java index de8f018b2c54d..33ecdb23ce192 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationResponse.java index 650f235382e07..b9053583bce55 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/identification/IdentificationResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/Input.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/Input.java index 81640b30ea7e4..a0785655e7d10 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/Input.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/Input.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionCommand.java index 86da5daf96eb9..b22ed79d999ff 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionRequest.java index 9c0f12bcbaa40..1ab2cab6ee045 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionResponse.java index 60030d6f40579..39cb8f596d5bc 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputInstructionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryCommand.java index 6c948c146b7ec..7a06124571f2c 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryRequest.java index bc9eb6ac6aee4..8a7960ba35527 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryResponse.java index d524cf5038c1a..25927d843ef30 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputListQueryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryCommand.java index d30be9b5e2332..56e1d3a0bfa78 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryRequest.java index 51c803be25d00..4d56f5dbfc1ee 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryResponse.java index 2c4172513337b..006fadc43309c 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/input/InputQueryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionCommand.java index 8498a6551ef5b..4e94be8f94aed 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionRequest.java index f661e2ada452e..b14a22e5389b7 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionResponse.java index 55bc365240270..7612f9f611939 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteInstructionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryCommand.java index 9a241ae835cfe..b09de20d121d4 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryRequest.java index 5f2b17904e221..18e39778d02b8 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryResponse.java index e4e0f39504ec0..3afc351c11e29 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/mute/MuteQueryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionCommand.java index 6ee513fb3220a..09726476464de 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionRequest.java index d3684d913f6fd..a4f48c85f19cc 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionResponse.java index e3ed2ccade297..131488060e112 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerInstructionResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryCommand.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryCommand.java index b469714471dda..7eefbabc0f74a 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryCommand.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryRequest.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryRequest.java index 6d1f0d2956562..cd4c26aa15de9 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryRequest.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryResponse.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryResponse.java index 865e3d3355382..da46ab7dc0dbe 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryResponse.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/device/command/power/PowerQueryResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/AbstractDiscoveryParticipant.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/AbstractDiscoveryParticipant.java index 93558286a6e41..6928825eedf8c 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/AbstractDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/AbstractDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/DiscoveryParticipantClass1.java b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/DiscoveryParticipantClass1.java index be76cd5a04dac..13715a7a2f168 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/DiscoveryParticipantClass1.java +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/java/org/openhab/binding/pjlinkdevice/internal/discovery/DiscoveryParticipantClass1.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/binding/binding.xml index 950133daf55e5..a6eaec0bd94c5 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="pjLinkDevice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>PJLinkDevice Binding</name> <description>This binding can control PJLink compatible devices. diff --git a/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/thing/thing-types.xml index 80ba8fd806c6c..14be5a9c541eb 100644 --- a/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.pjlinkdevice/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="pjLinkDevice" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <!-- Sample Thing Type --> <thing-type id="pjLinkDevice"> <label>PJLink Device</label> <description>A PJLink compatible device, e.g. a digital projector</description> @@ -19,7 +18,7 @@ <config-description> <parameter name="ipAddress" type="text" required="true" min="1"> <context>network-address</context> - <label>IP address</label> + <label>IP Address</label> <description>The address of the PJLink device to control.</description> </parameter> <parameter name="adminPassword" type="text"> @@ -27,33 +26,33 @@ <label>Password</label> <description>The password of the PJLink device.</description> </parameter> - <parameter name="tcpPort" type="integer" min="0" max="65535"> + <parameter name="tcpPort" type="integer" min="1" max="65535"> <default>4352</default> <label>TCP Port</label> <description>The TCP port of the PJLink device to control.</description> </parameter> <parameter name="refreshInterval" type="integer" min="0"> <default>5</default> - <label>Refresh interval (s)</label> + <label>Refresh Interval (s)</label> <description>How often to poll the device state (in seconds). A value of zero will disable polling.</description> </parameter> <parameter name="refreshPower" type="boolean"> <default>false</default> - <label>Poll for power state</label> + <label>Poll for Power State</label> <description>Enable polling for the power state. Only considered if the refreshInterval interval is greater than zero.</description> </parameter> <parameter name="refreshMute" type="boolean"> <default>false</default> - <label>Poll for mute state</label> + <label>Poll for Mute State</label> <description>Enable polling for the mute state. Only considered if the refreshInterval interval is greater than zero.</description> </parameter> <parameter name="refreshInputChannel" type="boolean"> <default>false</default> - <label>Poll for selected input channel</label> + <label>Poll for Selected Input Channel</label> <description>Enable polling for the selected input channel. Only considered if the refreshInterval interval is greater than zero.</description> </parameter> <parameter name="autoReconnectInterval" type="integer" min="0"> - <label>Auto reconnect interval</label> + <label>Auto Reconnect Interval</label> <description>Seconds between connection retries when connection to the PJLink device has been lost, 0 means never retry, minimum 30s</description> <default>60</default> </parameter> @@ -85,4 +84,4 @@ <description>Select the video mute status</description> </channel-type> -</thing:thing-descriptions> \ No newline at end of file +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.plclogo/NOTICE b/bundles/org.openhab.binding.plclogo/NOTICE index 8a852a86f2b77..0942da7b14538 100644 --- a/bundles/org.openhab.binding.plclogo/NOTICE +++ b/bundles/org.openhab.binding.plclogo/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.plclogo/pom.xml b/bundles/org.openhab.binding.plclogo/pom.xml index 0a366d57e2bbc..928a50cd52216 100644 --- a/bundles/org.openhab.binding.plclogo/pom.xml +++ b/bundles/org.openhab.binding.plclogo/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.plclogo</artifactId> diff --git a/bundles/org.openhab.binding.plclogo/src/main/feature/feature.xml b/bundles/org.openhab.binding.plclogo/src/main/feature/feature.xml index b53f8514c658a..a357f22f4f84a 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.plclogo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.plclogo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-plclogo" description="PLCLogo Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoBindingConstants.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoBindingConstants.java index 7e7fafe4be269..00bd25097929a 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoBindingConstants.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoClient.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoClient.java index 288e44c44a64f..93bcb01b3efa1 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoClient.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoHandlerFactory.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoHandlerFactory.java index 2ddfd147cec22..cd0cceb7bb106 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoHandlerFactory.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/PLCLogoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCAnalogConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCAnalogConfiguration.java index 8fcc27fcc720c..99f92fa612633 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCAnalogConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCAnalogConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCCommonConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCCommonConfiguration.java index 181f4b40a0d87..e2c920011a385 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCCommonConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCCommonConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDateTimeConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDateTimeConfiguration.java index 24ceffd67fa9b..cce4bfd6cb516 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDateTimeConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDateTimeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDigitalConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDigitalConfiguration.java index 303eacaf88abd..6262e1b4db9d3 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDigitalConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCDigitalConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCLogoBridgeConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCLogoBridgeConfiguration.java index c17351869f9af..7a9008f36acfd 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCLogoBridgeConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCLogoBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCMemoryConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCMemoryConfiguration.java index e1bbb196a8160..bdbac8692c159 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCMemoryConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCMemoryConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCPulseConfiguration.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCPulseConfiguration.java index 05513910e3d99..f291ea68a7278 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCPulseConfiguration.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/config/PLCPulseConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/discovery/PLCDiscoveryService.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/discovery/PLCDiscoveryService.java index 036239be2fcbf..3d90bbe588bcd 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/discovery/PLCDiscoveryService.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/discovery/PLCDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCAnalogHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCAnalogHandler.java index d41755d2ed29d..9480cbea377de 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCAnalogHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCAnalogHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCBridgeHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCBridgeHandler.java index a9c9c6ca4a657..1506f199d6a41 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCBridgeHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCCommonHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCCommonHandler.java index 182f19d831625..c6c13c81ec3f8 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCCommonHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCCommonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java index 859d73a43e430..9bafaa28fd46d 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDateTimeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -190,7 +190,7 @@ protected int getNumberOfChannels() { @Override protected void doInitialization() { Thing thing = getThing(); - logger.debug("Initialize LOGO! {} date/time handler."); + logger.debug("Initialize LOGO! date/time handler."); config.set(getConfigAs(PLCDateTimeConfiguration.class)); diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDigitalHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDigitalHandler.java index 6c6174670a6c1..055b604565b3c 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDigitalHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCDigitalHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCMemoryHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCMemoryHandler.java index 40df7b5b4fd4a..6856d54cae05e 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCMemoryHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCMemoryHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -264,7 +264,7 @@ protected int getNumberOfChannels() { @Override protected void doInitialization() { Thing thing = getThing(); - logger.debug("Initialize LOGO! {} memory handler."); + logger.debug("Initialize LOGO! memory handler."); config.set(getConfigAs(PLCMemoryConfiguration.class)); diff --git a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCPulseHandler.java b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCPulseHandler.java index 808a1ce7c09f0..eb85d0477f0b3 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCPulseHandler.java +++ b/bundles/org.openhab.binding.plclogo/src/main/java/org/openhab/binding/plclogo/internal/handler/PLCPulseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plclogo/src/main/resources/ESH-INF/config/datetime.xml b/bundles/org.openhab.binding.plclogo/src/main/resources/ESH-INF/config/datetime.xml index 86768254c25fe..5dc6c329caaa8 100644 --- a/bundles/org.openhab.binding.plclogo/src/main/resources/ESH-INF/config/datetime.xml +++ b/bundles/org.openhab.binding.plclogo/src/main/resources/ESH-INF/config/datetime.xml @@ -10,7 +10,7 @@ <required>true</required> </parameter> <parameter name="type" type="text"> - <label>Send Value as</label> + <label>Send Value As</label> <description>Interpret received channel value as date or time</description> <options> <option value="date">date</option> diff --git a/bundles/org.openhab.binding.plugwise/NOTICE b/bundles/org.openhab.binding.plugwise/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.plugwise/NOTICE +++ b/bundles/org.openhab.binding.plugwise/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.plugwise/pom.xml b/bundles/org.openhab.binding.plugwise/pom.xml index 32447a5d184e8..4247af4fb28ba 100644 --- a/bundles/org.openhab.binding.plugwise/pom.xml +++ b/bundles/org.openhab.binding.plugwise/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.plugwise</artifactId> diff --git a/bundles/org.openhab.binding.plugwise/src/main/feature/feature.xml b/bundles/org.openhab.binding.plugwise/src/main/feature/feature.xml index fdf17ae89a6e8..ad13a11c7e243 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.plugwise/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.plugwise-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-plugwise" description="Plugwise Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseBindingConstants.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseBindingConstants.java index 64b9c7a8f98d9..c1d52f5fcb000 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseBindingConstants.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationContext.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationContext.java index 89effd2219070..6cc7296e7166b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationContext.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationHandler.java index 41c2ad03d8c84..fc4fbd1ebeb52 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseCommunicationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseDeviceTask.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseDeviceTask.java index ea3ed741b4e31..09fe40148133a 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseDeviceTask.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseDeviceTask.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListener.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListener.java index 99efef32dbe7d..bd3c13662b27e 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListener.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListenerList.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListenerList.java index d503927a3833b..5aa5f4252c80d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListenerList.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseFilteredMessageListenerList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseHandlerFactory.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseHandlerFactory.java index 4c725cdfe95e7..4a1e07c7729c2 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseHandlerFactory.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,6 +35,7 @@ import org.openhab.binding.plugwise.internal.handler.PlugwiseStickHandler; import org.openhab.binding.plugwise.internal.handler.PlugwiseSwitchHandler; import org.osgi.framework.ServiceRegistration; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; @@ -49,7 +50,12 @@ public class PlugwiseHandlerFactory extends BaseThingHandlerFactory { private final Map<ThingUID, @Nullable ServiceRegistration<?>> discoveryServiceRegistrations = new HashMap<>(); - private @NonNullByDefault({}) SerialPortManager serialPortManager; + private final SerialPortManager serialPortManager; + + @Activate + public PlugwiseHandlerFactory(final @Reference SerialPortManager serialPortManager) { + this.serialPortManager = serialPortManager; + } @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { @@ -97,12 +103,4 @@ protected void removeHandler(ThingHandler thingHandler) { } } - @Reference - protected void setSerialPortManager(SerialPortManager serialPortManager) { - this.serialPortManager = serialPortManager; - } - - protected void unsetSerialPortManager(SerialPortManager serialPortManager) { - this.serialPortManager = null; - } } diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseInitializationException.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseInitializationException.java index 0273a0e0379c1..2b82fc84022ab 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseInitializationException.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseInitializationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessagePriority.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessagePriority.java index 99f39356a0cf4..18a24cd416cdc 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessagePriority.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessagePriority.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageProcessor.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageProcessor.java index 2e8e7f1b6a828..0e44da92d2261 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageProcessor.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageSender.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageSender.java index c99fa7cdc3fc2..4e0c7c1753059 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageSender.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseMessageSender.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseQueuedMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseQueuedMessage.java index 96562f8d2198e..11d1905aa3e1b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseQueuedMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseQueuedMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseStickDiscoveryService.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseStickDiscoveryService.java index 4cfd337490706..27b71d70fc1c2 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseStickDiscoveryService.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseStickDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -68,14 +68,17 @@ public class PlugwiseStickDiscoveryService extends AbstractDiscoveryService impl private final PlugwiseCommunicationHandler communicationHandler = new PlugwiseCommunicationHandler(); private @Nullable ScheduledFuture<?> discoveryJob; - private @NonNullByDefault({}) SerialPortManager serialPortManager; + private final SerialPortManager serialPortManager; private boolean discovering; private final ReentrantLock discoveryLock = new ReentrantLock(); private Condition continueDiscovery = discoveryLock.newCondition(); - public PlugwiseStickDiscoveryService() throws IllegalArgumentException { + @Activate + public PlugwiseStickDiscoveryService(final @Reference SerialPortManager serialPortManager) + throws IllegalArgumentException { super(DISCOVERED_THING_TYPES_UIDS, 1, true); + this.serialPortManager = serialPortManager; } @Override @@ -215,15 +218,6 @@ private void sendMessage(Message message) { } } - @Reference - protected void setSerialPortManager(SerialPortManager serialPortManager) { - this.serialPortManager = serialPortManager; - } - - protected void unsetSerialPortManager(SerialPortManager serialPortManager) { - this.serialPortManager = null; - } - @Override protected void startBackgroundDiscovery() { logger.debug("Starting Plugwise Stick background discovery"); diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseThingDiscoveryService.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseThingDiscoveryService.java index de12d026942ba..b416321e3e181 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseThingDiscoveryService.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseThingDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseUtils.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseUtils.java index 4f680db9327ef..11c0b2d5e0eb2 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseUtils.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/PlugwiseUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseRelayConfig.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseRelayConfig.java index f1f89ed27aec8..be6c4f72d9747 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseRelayConfig.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseRelayConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseScanConfig.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseScanConfig.java index 2084b6d690690..c7211ae1ee89b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseScanConfig.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseScanConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSenseConfig.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSenseConfig.java index 61a3e2803ba95..865477f976014 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSenseConfig.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSenseConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseStickConfig.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseStickConfig.java index d5d5381ee1439..44dec2ccf737a 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseStickConfig.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseStickConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSwitchConfig.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSwitchConfig.java index a887c04132bdc..bfeca2500e2dd 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSwitchConfig.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/config/PlugwiseSwitchConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractPlugwiseThingHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractPlugwiseThingHandler.java index a95004a7bfa26..b0f31784c02f8 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractPlugwiseThingHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractPlugwiseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractSleepingEndDeviceHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractSleepingEndDeviceHandler.java index 76645da4d72c1..f304b6cb9a284 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractSleepingEndDeviceHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/AbstractSleepingEndDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseRelayDeviceHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseRelayDeviceHandler.java index fb2be6d0ead0f..0b5fa26a414ec 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseRelayDeviceHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseRelayDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseScanHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseScanHandler.java index 0245b8f8c0be1..f25bc4476076d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseScanHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseScanHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSenseHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSenseHandler.java index 39f1178ea6c11..e4a1e5ab7fab6 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSenseHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSenseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseStickHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseStickHandler.java index 57f58321bb442..f1403a5358ee6 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseStickHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseStickHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSwitchHandler.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSwitchHandler.java index a9993be7677c3..2a7cf0555bc59 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSwitchHandler.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/handler/PlugwiseSwitchHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseMessageListener.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseMessageListener.java index d2840de930379..ebb8e31601366 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseMessageListener.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseStickStatusListener.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseStickStatusListener.java index 673fd29eae21e..480be889a43b1 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseStickStatusListener.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/listener/PlugwiseStickStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AcknowledgementMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AcknowledgementMessage.java index af71cb824f82f..01abd9ff763e9 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AcknowledgementMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AcknowledgementMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AnnounceAwakeRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AnnounceAwakeRequestMessage.java index 4bfdd8f69ca9c..c1378fa4e504f 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AnnounceAwakeRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/AnnounceAwakeRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/BroadcastGroupSwitchResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/BroadcastGroupSwitchResponseMessage.java index dd168ee33a267..f559c62fac49b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/BroadcastGroupSwitchResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/BroadcastGroupSwitchResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetRequestMessage.java index 3c29ff28dac1c..251fbc3db5fee 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetResponseMessage.java index f29d7242aa5d8..bce0b6e84ee57 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockGetResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockSetRequestMessage.java index 8da0edf72b069..61ea43cd71ab8 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ClockSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationRequestMessage.java index fe521637541b9..b54b55da461fb 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationResponseMessage.java index d606e6d9a78f4..df5b877f2e95c 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/InformationResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/LightCalibrationRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/LightCalibrationRequestMessage.java index 8365e9f5fab27..15f6f12ac75e0 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/LightCalibrationRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/LightCalibrationRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/Message.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/Message.java index 712a677379ebf..bf80705236de2 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/Message.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/MessageFactory.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/MessageFactory.java index 746fc00f2ff96..8fd72ac32ee9f 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/MessageFactory.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/MessageFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ModuleJoinedNetworkRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ModuleJoinedNetworkRequestMessage.java index ad71b2b83b82a..318f3ee27c1fc 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ModuleJoinedNetworkRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ModuleJoinedNetworkRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkResetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkResetRequestMessage.java index 954974087d11c..060a17846edc1 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkResetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkResetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusRequestMessage.java index 18c0ad396c27c..ba8742d0436b7 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusResponseMessage.java index d6c2fa21edba0..bdcfedc07f5bf 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NetworkStatusResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableMessage.java index a21e421dea85c..c6cd70f9aaac5 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableResponseMessage.java index d680d8f1961c0..c3a5000dbec44 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/NodeAvailableResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingRequestMessage.java index 835537afc2577..9f19109320135 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingResponseMessage.java index e341011951e98..f178f31fbc170 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PingResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PlugwisePayloadMismatchException.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PlugwisePayloadMismatchException.java index 8e082c2ed6958..d10724d11e401 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PlugwisePayloadMismatchException.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PlugwisePayloadMismatchException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferRequestMessage.java index 82e0de2b9fabc..9bbb5abb65b67 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferResponseMessage.java index 9dcb7d097505e..4dea098e83002 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerBufferResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationRequestMessage.java index 7b6a115f7151f..008a77e1a6095 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationResponseMessage.java index 1e98ffe2a4320..6c0103c8a73bc 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerCalibrationResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerChangeRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerChangeRequestMessage.java index 8c1bb753fd38c..3a2c121980721 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerChangeRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerChangeRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationRequestMessage.java index d04b98cbbc9eb..e6d2d5a67a63a 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationResponseMessage.java index 932d6e759be9b..c275e67c7ab7e 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerInformationResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerLogIntervalSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerLogIntervalSetRequestMessage.java index f7bf1ba2050fb..57064ee96d9a0 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerLogIntervalSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/PowerLogIntervalSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetRequestMessage.java index 6ac0fca7e1354..43dcd9ef0a030 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetResponseMessage.java index b7f90c72e5d30..df31242a5c7e8 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockGetResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockSetRequestMessage.java index 0762793cd2936..ccc485545fd9a 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RealTimeClockSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallRequestMessage.java index 2b9094e576d90..5adf9fd8381db 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallResponseMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallResponseMessage.java index 6b2090ec228c5..6c1fac3a67893 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallResponseMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/RoleCallResponseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ScanParametersSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ScanParametersSetRequestMessage.java index a39cd86102f07..6f05e7ac7c65b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ScanParametersSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/ScanParametersSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseBoundariesSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseBoundariesSetRequestMessage.java index aa57452491510..949bc9296c169 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseBoundariesSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseBoundariesSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportIntervalSetRequest.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportIntervalSetRequest.java index bf8e36cfadf1a..8ff8829973f04 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportIntervalSetRequest.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportIntervalSetRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportRequestMessage.java index 3c6e6fb94146e..3e01899518c8e 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SenseReportRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SleepSetRequestMessage.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SleepSetRequestMessage.java index ce10067f4407a..44dfed8dad78d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SleepSetRequestMessage.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/SleepSetRequestMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryAction.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryAction.java index 6947b9a75722a..7e7ae9bb22efa 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryAction.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryType.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryType.java index c1e8aff938396..e54579a471e3d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryType.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/BoundaryType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/DeviceType.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/DeviceType.java index 0bdd037e4f956..a8accd0a8c67d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/DeviceType.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Energy.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Energy.java index 2f73c7e0c3e0e..513d02ac0023e 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Energy.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Energy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Humidity.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Humidity.java index 50f9d75e7910c..9ae6e6ad2b32d 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Humidity.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Humidity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MACAddress.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MACAddress.java index 342513b1d2d7f..fd00f7fad418b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MACAddress.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MACAddress.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MessageType.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MessageType.java index df0bcc371bada..bd8576d33721b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MessageType.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/MessageType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/PowerCalibration.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/PowerCalibration.java index 4810750b11fbd..3ee6bb43b2734 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/PowerCalibration.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/PowerCalibration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Sensitivity.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Sensitivity.java index 29741ee7cedbd..24f32e4971dc7 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Sensitivity.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Sensitivity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Temperature.java b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Temperature.java index 215ae9d72c9e1..1530fa0ebc42e 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Temperature.java +++ b/bundles/org.openhab.binding.plugwise/src/main/java/org/openhab/binding/plugwise/internal/protocol/field/Temperature.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/config/config.xml index 21703f41655c4..5b38ceceba48b 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/config/config.xml @@ -5,13 +5,13 @@ <config-description uri="bridge-type:plugwise:stick"> <parameter name="serialPort" type="text" required="true"> - <label>Serial port</label> + <label>Serial Port</label> <context>serial-port</context> <description>The serial port of the Stick, e.g. "/dev/ttyUSB0" for Linux or "COM1" for Windows</description> <default>/dev/ttyUSB0</default> </parameter> <parameter name="messageWaitTime" type="integer" min="0" max="500" step="50"> - <label>Message wait time</label> + <label>Message Wait Time</label> <description>The time to wait between messages sent on the ZigBee network (in ms)</description> <default>150</default> <unitLabel>ms</unitLabel> @@ -20,7 +20,7 @@ <config-description uri="channel-type:plugwise:fasterupdates"> <parameter name="updateInterval" type="integer" min="1" required="true" unit="s"> - <label>Update interval</label> + <label>Update Interval</label> <description>Specifies at what rate the state is updated (in seconds)</description> <default>15</default> <unitLabel>s</unitLabel> @@ -29,7 +29,7 @@ <config-description uri="channel-type:plugwise:slowerupdates"> <parameter name="updateInterval" type="integer" min="1" required="true" unit="s"> - <label>Update interval</label> + <label>Update Interval</label> <description>Specifies at what rate the state is updated (in seconds)</description> <default>60</default> <unitLabel>s</unitLabel> @@ -38,11 +38,11 @@ <config-description uri="thing-type:plugwise:relay"> <parameter name="macAddress" type="text" pattern="(000)(d|D)6(f|F)(0000)([0-9A-Fa-f]{6})|(000)(d|D)6(f|F)(000)([0-9A-Fa-f]{7})" required="true"> - <label>MAC address</label> + <label>MAC Address</label> <description>The full device MAC address e.g. "000D6F0000A1B2C3"</description> </parameter> <parameter name="powerStateChanging" type="text" required="false"> - <label>Power state changing</label> + <label>Power State Changing</label> <description>Controls if the power state can be changed with commands or is always on/off</description> <default>commandSwitching</default> <options> @@ -52,25 +52,25 @@ </options> </parameter> <parameter name="suppliesPower" type="boolean" required="false"> - <label>Supplies power</label> + <label>Supplies Power</label> <description>Enables power production measurements</description> <default>false</default> </parameter> <parameter name="measurementInterval" type="integer" min="5" max="60" step="5" required="false" unit="min"> - <label>Measurement interval</label> + <label>Measurement Interval</label> <description>The energy measurement interval (in minutes)</description> <default>60</default> <unitLabel>m</unitLabel> <advanced>true</advanced> </parameter> <parameter name="temporarilyNotInNetwork" type="boolean" required="false"> - <label>Temporarily not in network</label> + <label>Temporarily Not in Network</label> <description>Stops searching for an unplugged device on the ZigBee network traffic</description> <default>false</default> <advanced>true</advanced> </parameter> <parameter name="updateConfiguration" type="boolean" required="true" readOnly="true"> - <label>Update configuration</label> + <label>Update Configuration</label> <description>Stores if the device configuration is up to date (automatically enabled/disabled)</description> <default>true</default> <advanced>true</advanced> @@ -79,7 +79,7 @@ <config-description uri="thing-type:plugwise:scan"> <parameter name="macAddress" type="text" pattern="(000)(d|D)6(f|F)(0000)([0-9A-Fa-f]{6})|(000)(d|D)6(f|F)(000)([0-9A-Fa-f]{7})" required="true"> - <label>MAC address</label> + <label>MAC Address</label> <description>The full device MAC address e.g. "000D6F0000A1B2C3"</description> </parameter> <parameter name="sensitivity" type="text" required="false"> @@ -93,25 +93,25 @@ </options> </parameter> <parameter name="switchOffDelay" type="integer" min="1" max="240" required="false" unit="min"> - <label>Switch off delay</label> + <label>Switch Off Delay</label> <description>The delay the Scan waits before sending an off command when motion is no longer detected (in minutes)</description> <default>5</default> <unitLabel>m</unitLabel> </parameter> <parameter name="daylightOverride" type="boolean" required="false"> - <label>Daylight override</label> + <label>Daylight Override</label> <description>Disables movement detection when there is daylight</description> <default>false</default> </parameter> <parameter name="wakeupInterval" type="integer" min="5" max="1440" step="60" required="false" unit="min"> - <label>Wake-up interval</label> + <label>Wake-up Interval</label> <description>The interval in which the Scan wakes up at least once (in minutes)</description> <default>1440</default> <unitLabel>m</unitLabel> <advanced>true</advanced> </parameter> <parameter name="wakeupDuration" type="integer" min="10" max="120" step="10" required="false" unit="s"> - <label>Wake-up duration</label> + <label>Wake-up Duration</label> <description>The number of seconds the Scan stays awake after it woke up</description> <default>10</default> <unitLabel>s</unitLabel> @@ -124,7 +124,7 @@ <advanced>true</advanced> </parameter> <parameter name="updateConfiguration" type="boolean" required="true" readOnly="true"> - <label>Update configuration</label> + <label>Update Configuration</label> <description>Stores if the Scan configuration is up to date (automatically enabled/disabled)</description> <default>true</default> <advanced>true</advanced> @@ -133,17 +133,17 @@ <config-description uri="thing-type:plugwise:sense"> <parameter name="macAddress" type="text" pattern="(000)(d|D)6(f|F)(0000)([0-9A-Fa-f]{6})|(000)(d|D)6(f|F)(000)([0-9A-Fa-f]{7})" required="true"> - <label>MAC address</label> + <label>MAC Address</label> <description>The full device MAC address e.g. "000D6F0000A1B2C3"</description> </parameter> <parameter name="measurementInterval" type="integer" min="5" max="60" step="5" required="false" unit="min"> - <label>Measurement interval</label> + <label>Measurement Interval</label> <description>The interval in which the Sense measures the temperature and humidity (in minutes)</description> <default>15</default> <unitLabel>m</unitLabel> </parameter> <parameter name="boundaryType" type="text" required="false"> - <label>Boundary type</label> + <label>Boundary Type</label> <description>The boundary type that is used for switching</description> <default>none</default> <options> @@ -153,7 +153,7 @@ </options> </parameter> <parameter name="boundaryAction" type="text" required="false"> - <label>Boundary action</label> + <label>Boundary Action</label> <description>The boundary switch action when the value is below/above the boundary minimum/maximum</description> <default>offBelowOnAbove</default> <options> @@ -162,41 +162,41 @@ </options> </parameter> <parameter name="temperatureBoundaryMin" type="integer" min="0" max="60" step="5" required="false" unit="Cel"> - <label>Temperature minimum</label> + <label>Temperature Minimum</label> <description>The minimum boundary for the temperature boundary action</description> <default>15</default> </parameter> <parameter name="temperatureBoundaryMax" type="integer" min="0" max="60" step="5" required="false" unit="Cel"> - <label>Temperature maximum</label> + <label>Temperature Maximum</label> <description>The maximum boundary for the temperature boundary action</description> <default>25</default> </parameter> <parameter name="humidityBoundaryMin" type="integer" min="5" max="95" step="5" required="false" unit="%"> - <label>Humidity minimum</label> + <label>Humidity Minimum</label> <description>The minimum boundary for the humidity boundary action</description> <default>45</default> </parameter> <parameter name="humidityBoundaryMax" type="integer" min="5" max="95" step="5" required="false" unit="%"> - <label>Humidity maximum</label> + <label>Humidity Maximum</label> <description>The maximum boundary for the humidity boundary action</description> <default>65</default> </parameter> <parameter name="wakeupInterval" type="integer" min="5" max="1440" step="60" required="false" unit="min"> - <label>Wake-up interval</label> + <label>Wake-up Interval</label> <description>The interval in which the Sense wakes up at least once (in minutes)</description> <default>1440</default> <unitLabel>m</unitLabel> <advanced>true</advanced> </parameter> <parameter name="wakeupDuration" type="integer" min="10" max="120" step="10" required="false" unit="s"> - <label>Wake-up duration</label> + <label>Wake-up Duration</label> <description>The number of seconds the Sense stays awake after it woke up</description> <default>10</default> <unitLabel>s</unitLabel> <advanced>true</advanced> </parameter> <parameter name="updateConfiguration" type="boolean" required="true" readOnly="true"> - <label>Update configuration</label> + <label>Update Configuration</label> <description>Stores if the Sense configuration is up to date (automatically enabled/disabled)</description> <default>true</default> <advanced>true</advanced> @@ -205,25 +205,25 @@ <config-description uri="thing-type:plugwise:switch"> <parameter name="macAddress" type="text" pattern="(000)(d|D)6(f|F)(0000)([0-9A-Fa-f]{6})|(000)(d|D)6(f|F)(000)([0-9A-Fa-f]{7})" required="true"> - <label>MAC address</label> + <label>MAC Address</label> <description>The full device MAC address e.g. "000D6F0000A1B2C3"</description> </parameter> <parameter name="wakeupInterval" type="integer" min="5" max="1440" step="60" required="false" unit="min"> - <label>Wake-up interval</label> + <label>Wake-up Interval</label> <description>The interval in which the Switch wakes up at least once (in minutes)</description> <default>1440</default> <unitLabel>m</unitLabel> <advanced>true</advanced> </parameter> <parameter name="wakeupDuration" type="integer" min="10" max="120" step="10" required="false" unit="s"> - <label>Wake-up duration</label> + <label>Wake-up Duration</label> <description>The number of seconds the Switch stays awake after it woke up</description> <default>10</default> <unitLabel>s</unitLabel> <advanced>true</advanced> </parameter> <parameter name="updateConfiguration" type="boolean" required="true" readOnly="true"> - <label>Update configuration</label> + <label>Update Configuration</label> <description>Stores if the Switch configuration is up to date (automatically enabled/disabled)</description> <default>true</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/thing/channel.xml b/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/thing/channel.xml index 6a6982d0ed7d8..26d051c6e8711 100644 --- a/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/thing/channel.xml +++ b/bundles/org.openhab.binding.plugwise/src/main/resources/ESH-INF/thing/channel.xml @@ -30,21 +30,21 @@ <channel-type id="energystamp" advanced="true"> <item-type>DateTime</item-type> - <label>Energy timestamp</label> + <label>Energy Timestamp</label> <description>Timestamp of the start of the last energy measurement interval</description> <state readOnly="true" /> </channel-type> <channel-type id="lastseen" advanced="true"> <item-type>DateTime</item-type> - <label>Last seen</label> + <label>Last Seen</label> <description>Timestamp of the last received message</description> <state readOnly="true" /> </channel-type> <channel-type id="leftbuttonstate"> <item-type>Switch</item-type> - <label>Left button state</label> + <label>Left Button State</label> <description>Current state of the left button</description> <state readOnly="true" /> </channel-type> @@ -60,7 +60,7 @@ <channel-type id="realtimeclock" advanced="true"> <item-type>DateTime</item-type> - <label>Real-time clock</label> + <label>Real-time Clock</label> <description>Time as indicated by the real-time internal clock of the Circle+</description> <state readOnly="true"></state> <config-description-ref uri="channel-type:plugwise:slowerupdates" /> @@ -68,7 +68,7 @@ <channel-type id="rightbuttonstate"> <item-type>Switch</item-type> - <label>Right button state</label> + <label>Right Button State</label> <description>Current state of the right button</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.powermax/NOTICE b/bundles/org.openhab.binding.powermax/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.powermax/NOTICE +++ b/bundles/org.openhab.binding.powermax/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.powermax/README.md b/bundles/org.openhab.binding.powermax/README.md index 71c2b5f37b760..272bd7e89dc49 100644 --- a/bundles/org.openhab.binding.powermax/README.md +++ b/bundles/org.openhab.binding.powermax/README.md @@ -1,18 +1,24 @@ # Powermax Binding -Visonic produces the Powermax alarm panel series (PowerMax, PowerMax+, PowerMaxExpress, PowerMaxPro and PowerMaxComplete) and the Powermaster alarm series (PowerMaster 10 and PowerMaster 30). This binding allows you to control the alarm panel (arm/disarm) and allows you to use the Visonic sensors (movement, door contact, ...) within openHAB. +Visonic produces the Powermax alarm panel series (PowerMax, PowerMax+, PowerMaxExpress, PowerMaxPro and PowerMaxComplete) and the Powermaster alarm series (PowerMaster 10 and PowerMaster 30). +This binding allows you to control the alarm panel (arm/disarm) and allows you to use the Visonic sensors (movement, door contact, ...) within openHAB. -The PowerMax provides support for a serial interface. This serial interface is not installed by default but can be ordered from any PowerMax vendor (called the Visonic RS-232 Adaptor Kit). +The PowerMax provides support for a serial interface. +This serial interface is not installed by default but can be ordered from any PowerMax vendor (called the Visonic RS-232 Adaptor Kit). In case your alarm panel is directly connected to a serial port of your openHAB server (or to an USB port through a serial to USB converter), you must setup a serial connection thing type in openHAB. -But you even don't need to have your alarm panel directly connected to your openHAB server. You can connect it for example to a Raspberry PI and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). In this case, you must setup an IP connection thing type in openHAB. Here is an example of ser2net.conf you can use to share your serial port /dev/ttyUSB0 on IP port 4444: +But you even don't need to have your alarm panel directly connected to your openHAB server. +You can connect it for example to a Raspberry Pi and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). +In this case, you must setup an IP connection thing type in openHAB. + +Here is an example of ser2net.conf you can use to share your serial port /dev/ttyUSB0 on IP port 4444: ``` 4444:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT ``` -Visonic does not provide a specification of the RS232 protocol and, thus, the binding uses the available protocol specification given at the [​domoticaforum](http://www.domoticaforum.eu/viewtopic.php?f=68&t=6581). +Visonic does not provide a specification of the RS232 protocol and, thus, the binding uses the available protocol specification given at the [​domoticaforum](https://www.domoticaforum.eu/viewtopic.php?f=68&t=6581). The binding implemntation of this protocol is largely inspired by the [Vera plugin](http://code.mios.com/trac/mios_visonic-powermax). @@ -29,11 +35,14 @@ This binding supports the following thing types: ## Discovery -The alarm system is not discovered automatically. First you have to create manually a bridge thing, either of type ip or serial depending on how your openHAB server is connected to the alarm system. Then the binding will automatically discover all zones and X10 devices that are setup in your alarm system. +The alarm system is not discovered automatically. +First you have to create manually a bridge thing, either of type ip or serial depending on how your openHAB server is connected to the alarm system. +Then the binding will automatically discover all zones and X10 devices that are setup in your alarm system. ## Binding configuration -There are no overall binding configuration settings that need to be set. All settings are through thing configuration parameters. +There are no overall binding configuration settings that need to be set. +All settings are through thing configuration parameters. ## Thing Configuration @@ -70,8 +79,10 @@ The serial bridge thing requires the following configuration parameters: Some notes: -* On Linux, you may get an error stating the serial port cannot be opened when the Powermax binding tries to load. You can get around this by adding the `openhab` user to the `dialout` group like this: `usermod -a -G dialout openhab`. -* Also on Linux you may have issues with the USB if using two serial USB devices e.g. Powermax and RFXcom. See the wiki page for more on symlinking the USB ports [](https://github.com/openhab/openhab1-addons/wiki/symlinks). +- On Linux, you may get an error stating the serial port cannot be opened when the Powermax binding tries to load. +You can get around this by adding the `openhab` user to the `dialout` group like this: `usermod -a -G dialout openhab`. +- Also on Linux you may have issues with the USB if using two serial USB devices e.g. Powermax and RFXcom. +See the [general documentation about serial port configuration](/docs/administration/serial.html) for more on symlinking the USB ports. ### X10 device @@ -117,7 +128,8 @@ The following channels are available: ## Console Commands -The binding provides few specific commands you can use in the console. Enter the command `smarthome:powermax` to get the usage of each available command. +The binding provides few specific commands you can use in the console. +Enter the command `smarthome:powermax` to get the usage of each available command. ``` openhab> smarthome:powermax @@ -125,17 +137,24 @@ Usage: smarthome:powermax <bridgeUID> info_setup - information on setup Usage: smarthome:powermax <bridgeUID> download_setup - download setup ``` -The command `info_setup` displays in the console informations about your current panel setup. The command `download_setup` will trigger a new download of the panel setup. +The command `info_setup` displays in the console informations about your current panel setup. +The command `download_setup` will trigger a new download of the panel setup. Here is an example of command you can run: `smarthome:powermax powermax:serial:home info_setup`. ## Notes & Limitations -* For Powerlink mode to work, the enrollment procedure has to be followed. If you don't enroll the Powerlink on the PowerMax the binding will operate in Standard mode, and if enrolled in Powerlink mode. On the newer software versions of the PowerMax the Powerlink enrollment is automatic, and the binding should only operate in 'Powerlink' mode (if enrollment is successful). -* In Powerlink mode, the binding is downloading the panel setup at startup. When openHAB is starting, unfortunately this download is often failing on a RPI for an unclear reason (maybe too many things running at the same time). A retry mechanism is implemented in the binding to retry until 3 times with a delay of 1 minute between each try. My experience is that the download finally succeeds. In case it fails after all the retries, you still have the option to later trigger the download either by using the channel `download_setup` or the appropriate console command. -* Visonic does not provide a specification of the RS232 protocol and, thus, use this binding at your own risk. -* The binding is not able to arm/disarm a particular partition. -* The compatibility of the binding with the Powermaster alarm panel series is probably only partial. +- For Powerlink mode to work, the enrollment procedure has to be followed. +If you don't enroll the Powerlink on the PowerMax the binding will operate in Standard mode, and if enrolled in Powerlink mode. +On the newer software versions of the PowerMax the Powerlink enrollment is automatic, and the binding should only operate in 'Powerlink' mode (if enrollment is successful). +- In Powerlink mode, the binding is downloading the panel setup at startup. +When openHAB is starting, unfortunately this download is often failing on a Raspberry Pi for an unclear reason (maybe too many things running at the same time). +A retry mechanism is implemented in the binding to retry until 3 times with a delay of 1 minute between each try. +My experience is that the download finally succeeds. +In case it fails after all the retries, you still have the option to later trigger the download either by using the channel `download_setup` or the appropriate console command. +- Visonic does not provide a specification of the RS232 protocol and, thus, use this binding at your own risk. +- The binding is not able to arm/disarm a particular partition. +- The compatibility of the binding with the Powermaster alarm panel series is probably only partial. ## Full Example diff --git a/bundles/org.openhab.binding.powermax/pom.xml b/bundles/org.openhab.binding.powermax/pom.xml index ac11a21377a88..557fde13a3df9 100644 --- a/bundles/org.openhab.binding.powermax/pom.xml +++ b/bundles/org.openhab.binding.powermax/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.powermax</artifactId> diff --git a/bundles/org.openhab.binding.powermax/src/main/feature/feature.xml b/bundles/org.openhab.binding.powermax/src/main/feature/feature.xml index 61fb3fe70020a..c333a75793963 100644 --- a/bundles/org.openhab.binding.powermax/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.powermax/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.powermax-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-powermax" description="Powermax Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxBindingConstants.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxBindingConstants.java index 6e618c4a5eed0..695a204e83bde 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxBindingConstants.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxHandlerFactory.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxHandlerFactory.java index 8defacb3eb411..a8d5bb73d82e0 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxHandlerFactory.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/PowermaxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxIpConfiguration.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxIpConfiguration.java index b2a12932623d6..7fdc35eb1ea6d 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxIpConfiguration.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxIpConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxSerialConfiguration.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxSerialConfiguration.java index 945589edeab96..9d16cd95974a0 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxSerialConfiguration.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxSerialConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxX10Configuration.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxX10Configuration.java index 66eeb8189ccc4..ad6a59f76fbde 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxX10Configuration.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxX10Configuration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxZoneConfiguration.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxZoneConfiguration.java index be783d0ad22bc..ab3dac062a58d 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxZoneConfiguration.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/config/PowermaxZoneConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnector.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnector.java index a96651c945455..70c440ccc17e0 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnector.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnectorInterface.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnectorInterface.java index 78c7cb076a3a6..019d5baa7261f 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnectorInterface.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxConnectorInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxReaderThread.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxReaderThread.java index 86bba159a11de..752c80465fa85 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxReaderThread.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxReaderThread.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxSerialConnector.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxSerialConnector.java index 40798e64cbfb1..ef804d13b4233 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxSerialConnector.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxTcpConnector.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxTcpConnector.java index 55a800d4fd958..b64d368745a0e 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxTcpConnector.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/connector/PowermaxTcpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/console/PowermaxCommandExtension.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/console/PowermaxCommandExtension.java index 0f43d677b54c2..4bdaa267eabcb 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/console/PowermaxCommandExtension.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/console/PowermaxCommandExtension.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/discovery/PowermaxDiscoveryService.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/discovery/PowermaxDiscoveryService.java index fff59d693943e..2d3158c19cce5 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/discovery/PowermaxDiscoveryService.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/discovery/PowermaxDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxBridgeHandler.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxBridgeHandler.java index 65a5b4768604a..6ef66dac2dc89 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxBridgeHandler.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxThingHandler.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxThingHandler.java index 5a99a13dfcb39..74a989600f860 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxThingHandler.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/handler/PowermaxThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAckMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAckMessage.java index 0c53444476ffa..237006d7e8200 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAckMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAckMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAlarmType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAlarmType.java index 024f5c6721217..4033a53d92216 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAlarmType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxAlarmType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxBaseMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxBaseMessage.java index f2a997c3e7bee..7629660c22d6f 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxBaseMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxBaseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxCommManager.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxCommManager.java index fc2a2c21450a5..c2e738b5369c3 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxCommManager.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxCommManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDeniedMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDeniedMessage.java index f0acca67a08b5..4d6757f99bfb2 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDeniedMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDeniedMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDownloadRetryMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDownloadRetryMessage.java index 6bc3047f488e5..7f1788a6d0722 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDownloadRetryMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxDownloadRetryMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxEventLogMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxEventLogMessage.java index b092934d15795..e5f6888c61392 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxEventLogMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxEventLogMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxInfoMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxInfoMessage.java index e3ea7d7e028f3..b09a0bc35be3f 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxInfoMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxInfoMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEvent.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEvent.java index b04e1a55758da..34641be9a91e3 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEvent.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEventListener.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEventListener.java index e0d487ebd2aac..d637023585581 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEventListener.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxMessageEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPanelMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPanelMessage.java index 737385b1bdce1..da5f687f1fb4a 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPanelMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPanelMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerMasterMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerMasterMessage.java index 1e9fc729c7988..a9dec3861500b 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerMasterMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerMasterMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerlinkMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerlinkMessage.java index 899504817f678..1412bd76284f6 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerlinkMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxPowerlinkMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxReceiveType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxReceiveType.java index 11535f6d6f876..d148364cfb6bf 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxReceiveType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxReceiveType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSendType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSendType.java index a6f59b5a5ffa6..8b9ca4f7fff49 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSendType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSendType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSettingsMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSettingsMessage.java index 121a2d4810625..bf359fc696bfb 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSettingsMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxSettingsMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxStatusMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxStatusMessage.java index 7e2cc87a9202b..fbddf9bdaccba 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxStatusMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTimeoutMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTimeoutMessage.java index 610fe9841a7cb..ceaef361c11e3 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTimeoutMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTimeoutMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTroubleType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTroubleType.java index 2d8d32c32563b..3e5c73ba5971f 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTroubleType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxTroubleType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesNameMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesNameMessage.java index 24925d049b6a6..d647ab07b76d2 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesNameMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesNameMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesTypeMessage.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesTypeMessage.java index dbda2ec95a7eb..792f6106388b1 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesTypeMessage.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/message/PowermaxZonesTypeMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermasterSensorType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermasterSensorType.java index 17452bf894a4e..e9089c8c4b642 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermasterSensorType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermasterSensorType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxArmMode.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxArmMode.java index bf8f96d203297..b97ae47587813 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxArmMode.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxArmMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettings.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettings.java index 73e6e6bbd8a47..53e57c3aa4344 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettings.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettingsListener.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettingsListener.java index 71044a5dbfcea..b2d930b3b452c 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettingsListener.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelSettingsListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelType.java index 9ef6cf8566827..dfd7e788c46d8 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxPanelType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxSensorType.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxSensorType.java index 4d3492323efd4..5795b10bffe6e 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxSensorType.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxSensorType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxState.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxState.java index e2d0be5186414..247e3a43b5137 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxState.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEvent.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEvent.java index 17649438c5d55..2fbe2dd558bfb 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEvent.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEventListener.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEventListener.java index 71a674d4e10cc..5d8bae497402c 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEventListener.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxStateEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxX10Settings.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxX10Settings.java index 03558c2ef5731..ba9d7b8bfa5b5 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxX10Settings.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxX10Settings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneName.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneName.java index 596a5db9852d0..7b40b5e935dc3 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneName.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneName.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneSettings.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneSettings.java index 1d7d20fa9d8c9..5edf3744a9769 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneSettings.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneSettings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneState.java b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneState.java index d5fd4ee8562b9..19305bad93ecc 100644 --- a/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneState.java +++ b/bundles/org.openhab.binding.powermax/src/main/java/org/openhab/binding/powermax/internal/state/PowermaxZoneState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.powermax/src/main/resources/ESH-INF/thing/ip.xml b/bundles/org.openhab.binding.powermax/src/main/resources/ESH-INF/thing/ip.xml index 7b4f6af2fccf8..8fd6f89487794 100644 --- a/bundles/org.openhab.binding.powermax/src/main/resources/ESH-INF/thing/ip.xml +++ b/bundles/org.openhab.binding.powermax/src/main/resources/ESH-INF/thing/ip.xml @@ -43,7 +43,7 @@ <label>IP Address</label> <description>The IP address to use for connecting to the Ethernet interface of the alarm system.</description> </parameter> - <parameter name="tcpPort" type="integer" min="0" required="true"> + <parameter name="tcpPort" type="integer" min="1" max="65535" required="true"> <label>TCP Port</label> <description>The TCP port to use for connecting to the Ethernet interface of the alarm system.</description> </parameter> diff --git a/bundles/org.openhab.binding.pulseaudio/NOTICE b/bundles/org.openhab.binding.pulseaudio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.pulseaudio/NOTICE +++ b/bundles/org.openhab.binding.pulseaudio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.pulseaudio/pom.xml b/bundles/org.openhab.binding.pulseaudio/pom.xml index 454ad8a4ea100..1a2ef1924571f 100644 --- a/bundles/org.openhab.binding.pulseaudio/pom.xml +++ b/bundles/org.openhab.binding.pulseaudio/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.pulseaudio</artifactId> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/feature/feature.xml b/bundles/org.openhab.binding.pulseaudio/src/main/feature/feature.xml index 0465a9876185c..daabcebe54b76 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.pulseaudio-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-pulseaudio" description="Pulseaudio Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioBindingConstants.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioBindingConstants.java index 29ea413bd8609..9064e190e6784 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioBindingConstants.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioClient.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioClient.java index d002b025466b4..655606fe86cb5 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioClient.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioHandlerFactory.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioHandlerFactory.java index c5d1cf808fd49..8cba3147830a9 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioHandlerFactory.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/cli/Parser.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/cli/Parser.java index 74704569d69ed..c19401cde57e1 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/cli/Parser.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/cli/Parser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDeviceDiscoveryService.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDeviceDiscoveryService.java index 67ebe1742d9ca..6ffe35634360e 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDiscoveryParticipant.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDiscoveryParticipant.java index b8e3f03988e3b..c4d8c984d8eab 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/discovery/PulseaudioDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/DeviceStatusListener.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/DeviceStatusListener.java index 58177f9dcffd4..0b7cc600579b0 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/DeviceStatusListener.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/DeviceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioBridgeHandler.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioBridgeHandler.java index c23e3f0295097..0da9f565b6c1a 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioBridgeHandler.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java index 52b2151d42813..c3c4a26ae801f 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractAudioDeviceConfig.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractAudioDeviceConfig.java index b547fd6ff88f6..2e655f158620a 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractAudioDeviceConfig.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractAudioDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractDeviceConfig.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractDeviceConfig.java index 006cdc8cf74a1..78621b07530b3 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractDeviceConfig.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/AbstractDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Module.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Module.java index e3a4d21e624f1..17ffc1d134e71 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Module.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Module.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Sink.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Sink.java index 2599eed8f483c..6615dd334854e 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Sink.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Sink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SinkInput.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SinkInput.java index 8f1fa0d74165b..adcd317d1a8e7 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SinkInput.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SinkInput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Source.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Source.java index d7c3eaaee8216..a43a17b46b952 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Source.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/Source.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SourceOutput.java b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SourceOutput.java index 13e47bf6f6297..8e268f246b180 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SourceOutput.java +++ b/bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/items/SourceOutput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/config/config.xml index fd64d567677c0..208337468aa56 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/config/config.xml @@ -6,22 +6,22 @@ <config-description uri="binding:pulseaudio"> <parameter name="sink" type="boolean"> - <label>Import sinks</label> + <label>Import Sinks</label> <description>Activate the import of sink elements.</description> <default>true</default> </parameter> <parameter name="sinkInput" type="boolean"> - <label>Import sink inputs</label> + <label>Import Sink Inputs</label> <description>Activate the import of sink-input elements.</description> <default>false</default> </parameter> <parameter name="source" type="boolean"> - <label>Import sources</label> + <label>Import Sources</label> <description>Activate the import of source elements.</description> <default>false</default> </parameter> <parameter name="sourceOutput" type="boolean"> - <label>Import source outputs</label> + <label>Import Source Outputs</label> <description>Activate the import of source-output elements.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/bridge.xml index b811fba4decf6..17a3b4e79a393 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="pulseaudio" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridge"> - <label>Pulseaudio server</label> + <label>Pulseaudio Server</label> <description>This bridge represents a pulseaudio server.</description> <config-description> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/channels.xml index 3d18e147e6922..75b7ff2457476 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/channels.xml @@ -37,7 +37,7 @@ </channel-type> <channel-type id="routeToSink" advanced="true"> <item-type>String</item-type> - <label>Route to sink</label> + <label>Route to Sink</label> <description>Shows the sink a sink-input is currently routed to</description> </channel-type> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink-input.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink-input.xml index 5d96b5136697e..7dad0525930d3 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink-input.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink-input.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>A Pulseaudio sink-input</label> + <label>A Pulseaudio Sink-input</label> <description>represents a pulseaudio sink-input</description> <channels> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink.xml index f092fab5f3b62..9722b329d6679 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/sink.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>A Pulseaudio sink</label> + <label>A Pulseaudio Sink</label> <description>represents a pulseaudio sink</description> <channels> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source-output.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source-output.xml index dc11851157585..ea571285dd10d 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source-output.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source-output.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>A Pulseaudio source output</label> + <label>A Pulseaudio Source Output</label> <description>represents a pulseaudio source-output</description> <channels> diff --git a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source.xml b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source.xml index 436223b83a01d..d82e523dcffa5 100644 --- a/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source.xml +++ b/bundles/org.openhab.binding.pulseaudio/src/main/resources/ESH-INF/thing/source.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridge" /> </supported-bridge-type-refs> - <label>A Pulseaudio source</label> + <label>A Pulseaudio Source</label> <description>represents a pulseaudio source</description> <channels> diff --git a/bundles/org.openhab.binding.pushbullet/NOTICE b/bundles/org.openhab.binding.pushbullet/NOTICE index 4c20ef446c1e4..460d017368baf 100644 --- a/bundles/org.openhab.binding.pushbullet/NOTICE +++ b/bundles/org.openhab.binding.pushbullet/NOTICE @@ -10,4 +10,12 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content + +javax.mail: +* License: Common Development and Distribution License (CDDL) v1.1 and GNU General Public License (GPL) v2 with Classpath Exception +* Project: https://javaee.github.io/javamail/ +* Source: https://github.com/javaee/javamail + diff --git a/bundles/org.openhab.binding.pushbullet/pom.xml b/bundles/org.openhab.binding.pushbullet/pom.xml index f7d2623e8c3f2..61d1c12ef8d77 100644 --- a/bundles/org.openhab.binding.pushbullet/pom.xml +++ b/bundles/org.openhab.binding.pushbullet/pom.xml @@ -1,24 +1,27 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.pushbullet</artifactId> <name>openHAB Add-ons :: Bundles :: Pushbullet Binding</name> + <properties> + <bnd.importpackage>sun.security.util;resolution:=optional</bnd.importpackage> + </properties> + <dependencies> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.7</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.pushbullet/src/main/feature/feature.xml b/bundles/org.openhab.binding.pushbullet/src/main/feature/feature.xml index f0dfc37f14ad8..8c52d27d78d9c 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.pushbullet/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.pushbullet-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-pushbullet" description="Pushbullet Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletBindingConstants.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletBindingConstants.java index d60d350de3423..43e60304519c7 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletBindingConstants.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletConfiguration.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletConfiguration.java index 784e4553b99fa..ef1a3ec6c2d70 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletConfiguration.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletHandlerFactory.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletHandlerFactory.java index 4b73f6c093613..189c0ecca0146 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletHandlerFactory.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/PushbulletHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/action/PushbulletActions.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/action/PushbulletActions.java index c8716bae1cdf1..0574952fe36a9 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/action/PushbulletActions.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/action/PushbulletActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/handler/PushbulletHandler.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/handler/PushbulletHandler.java index 45120307b7e64..8ee0422ecd570 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/handler/PushbulletHandler.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/handler/PushbulletHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/Push.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/Push.java index e32ca0c711359..604a1fe13d235 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/Push.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/Push.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushError.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushError.java index 85f963d62daa7..0f725ce6f1720 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushError.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushResponse.java b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushResponse.java index 7183d3b66f26f..2e9c06c01459b 100644 --- a/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushResponse.java +++ b/bundles/org.openhab.binding.pushbullet/src/main/java/org/openhab/binding/pushbullet/internal/model/PushResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/NOTICE b/bundles/org.openhab.binding.regoheatpump/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.regoheatpump/NOTICE +++ b/bundles/org.openhab.binding.regoheatpump/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.regoheatpump/README.md b/bundles/org.openhab.binding.regoheatpump/README.md index 9ef9beba6a7e4..5bea601deeb03 100644 --- a/bundles/org.openhab.binding.regoheatpump/README.md +++ b/bundles/org.openhab.binding.regoheatpump/README.md @@ -29,7 +29,7 @@ Two connection types are supported: #### TCP/IP connection A transparent bridge between the serial interface of the heat pump and network (i.e. wifi) is used. -This way no additional wires are required between heat pump and computer, running openhab. +This way no additional wires are required between heat pump and computer, running openHAB. There are many existing project providing such functionality, i.e. [ser2net](http://ser2net.sourceforge.net/). @@ -141,7 +141,7 @@ Access: R = read only; RW = read write ## The Husdata interface -The [Husdata](http://www.husdata.se/) interface bridges the often complex communication methods with a heat pump controller and provides access through a simple standard interface over RS-232. +The [Husdata](https://www.husdata.se/) interface bridges the often complex communication methods with a heat pump controller and provides access through a simple standard interface over RS-232. Supported heat pump models diff --git a/bundles/org.openhab.binding.regoheatpump/pom.xml b/bundles/org.openhab.binding.regoheatpump/pom.xml index ea1bb8a60d7c6..1ea98852e44dd 100644 --- a/bundles/org.openhab.binding.regoheatpump/pom.xml +++ b/bundles/org.openhab.binding.regoheatpump/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.regoheatpump</artifactId> diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/feature/feature.xml b/bundles/org.openhab.binding.regoheatpump/src/main/feature/feature.xml index a0dcf61f4c590..c25503d35a3db 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.regoheatpump/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.regoheatpump-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-regoheatpump" description="RegoHeatPump Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpBindingConstants.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpBindingConstants.java index 78a0aa1c4dc08..66d563b2f5e1d 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpBindingConstants.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpHandlerFactory.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpHandlerFactory.java index 59ed64b3e2727..99333f8bd310a 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpHandlerFactory.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/RegoHeatPumpHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/HusdataHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/HusdataHandler.java index 1dbea57f24877..f80587b7534c2 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/HusdataHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/HusdataHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpHusdataHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpHusdataHandler.java index 74c580c843f15..6b01cbd57ff9b 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpHusdataHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpHusdataHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpRego6xxHeatPumpHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpRego6xxHeatPumpHandler.java index a5ffe9ca4f4ed..b269fd99bc64b 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpRego6xxHeatPumpHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/IpRego6xxHeatPumpHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/Rego6xxHeatPumpHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/Rego6xxHeatPumpHandler.java index a8fac21992fc0..cbad0cf2a8c69 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/Rego6xxHeatPumpHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/Rego6xxHeatPumpHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -154,7 +154,7 @@ private static double commandToValue(Command command) { } private void processChannelWriteRequest(RegoRegisterMapper.Channel channel, Command command) { - short value = (short) (commandToValue(command) / channel.scaleFactor() + 0.5); + short value = (short) Math.round(commandToValue(command) / channel.scaleFactor()); byte[] commandPayload = CommandFactory.createWriteToSystemRegisterCommand(channel.address(), value); executeCommand(null, commandPayload, ResponseParserFactory.WRITE, result -> { // Ignore result since it is a write command. @@ -235,7 +235,7 @@ private void readAndUpdateSystemRegister(String channelIID) { byte[] command = CommandFactory.createReadFromSystemRegisterCommand(channel.address()); executeCommandAndUpdateState(channelIID, command, ResponseParserFactory.SHORT, value -> { Unit<?> unit = channel.unit(); - double result = value * channel.scaleFactor(); + double result = Math.round(channel.convertValue(value) * channel.scaleFactor() * 10.0) / 10.0; return unit != null ? new QuantityType<>(result, unit) : new DecimalType(result); }); } else { diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialHusdataHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialHusdataHandler.java index 1deebabc1febe..25c30cc3d3993 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialHusdataHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialHusdataHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialRego6xxHeatPumpHandler.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialRego6xxHeatPumpHandler.java index d1b992a36091d..59d6b39518284 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialRego6xxHeatPumpHandler.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/handler/SerialRego6xxHeatPumpHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/IpRegoConnection.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/IpRegoConnection.java index 949892533ac21..12a8c8b8fb942 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/IpRegoConnection.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/IpRegoConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/RegoConnection.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/RegoConnection.java index c826cf43c729e..c65922ac7a95b 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/RegoConnection.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/RegoConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/SerialRegoConnection.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/SerialRegoConnection.java index 31b0606b9de6a..a7d90f5829160 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/SerialRegoConnection.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/protocol/SerialRegoConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractLongResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractLongResponseParser.java index 0f7ab4c206a26..2142913f1fbf7 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractLongResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractLongResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractResponseParser.java index 885b1474d260f..89a365e7cf4f0 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/AbstractResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Checksum.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Checksum.java index f84761cae5888..f719d8736e714 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Checksum.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Checksum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/CommandFactory.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/CommandFactory.java index faf1e40f29942..3bb3ff86343d1 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/CommandFactory.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/CommandFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -55,4 +55,4 @@ private static byte[] createCommand(byte source, short address, short data) { return new byte[] { DEVICE_ADDRESS, source, addressBytes[0], addressBytes[1], addressBytes[2], dataBytes[0], dataBytes[1], dataBytes[2], Checksum.calculate(addressBytes, dataBytes) }; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLine.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLine.java index 25117c1d7b690..7b18b14381d0a 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLine.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLine.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLineResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLineResponseParser.java index 271ba4bc1409e..07d10ce13474d 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLineResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ErrorLineResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Rego6xxProtocolException.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Rego6xxProtocolException.java index e1693f4348a23..e738fd6e886fc 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Rego6xxProtocolException.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/Rego6xxProtocolException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/RegoRegisterMapper.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/RegoRegisterMapper.java index 9f2d557f64c6e..e4487170ccc85 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/RegoRegisterMapper.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/RegoRegisterMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,6 +36,8 @@ public static interface Channel { public double scaleFactor(); public Unit<?> unit(); + + public int convertValue(short value); } private static class ChannelFactory { @@ -64,6 +66,11 @@ public double scaleFactor() { public Unit<?> unit() { return unit; } + + @Override + public int convertValue(short value) { + return value; + } } private ChannelFactory() { @@ -74,7 +81,12 @@ static Channel temperature(short address) { } static Channel hours(short address) { - return new ChannelImpl(address, 1, SmartHomeUnits.HOUR); + return new ChannelImpl(address, 1, SmartHomeUnits.HOUR) { + @Override + public int convertValue(short value) { + return Short.toUnsignedInt(value); + } + }; } static Channel percent(short address) { diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParser.java index 35c00bb049f24..c0485fcda3c15 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParserFactory.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParserFactory.java index ff1e91e1f0a75..045acf6fcadc8 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParserFactory.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ResponseParserFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ShortResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ShortResponseParser.java index b67071a232017..376a10ea7958e 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ShortResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ShortResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/StringResponseParser.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/StringResponseParser.java index a610c10add2f5..4338722e50823 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/StringResponseParser.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/StringResponseParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ValueConverter.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ValueConverter.java index c158b4e42e771..79e45181085d1 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ValueConverter.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/ValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/WriteResponse.java b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/WriteResponse.java index 7d4f2bfc4e57e..8ff1d4d4ed989 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/WriteResponse.java +++ b/bundles/org.openhab.binding.regoheatpump/src/main/java/org/openhab/binding/regoheatpump/internal/rego6xx/WriteResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -28,4 +28,4 @@ public int responseLength() { protected Void convert(byte[] responseBytes) { return null; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.regoheatpump/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.regoheatpump/src/main/resources/ESH-INF/thing/thing-types.xml index f13ff67d24a07..26207a846cbfc 100644 --- a/bundles/org.openhab.binding.regoheatpump/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.regoheatpump/src/main/resources/ESH-INF/thing/thing-types.xml @@ -32,7 +32,7 @@ </parameter> <parameter name="refreshInterval" type="integer" max="65535" min="10" required="false"> <default>60</default> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval in seconds.</description> </parameter> </config-description> @@ -61,7 +61,7 @@ </parameter> <parameter name="refreshInterval" type="integer" max="65535" min="10" required="false"> <default>60</default> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval in seconds.</description> </parameter> </config-description> @@ -69,7 +69,7 @@ <!-- Manage Husdata interface over IP --> <thing-type id="ipHusdata"> - <label>Husdata interface</label> + <label>Husdata Interface</label> <description>Access heat pump over Husdata interface connected via TCP/IP</description> <channel-groups> @@ -95,7 +95,7 @@ <!-- Manage Husdata interface over serial --> <thing-type id="serialHusdata"> - <label>Husdata interface</label> + <label>Husdata Interface</label> <description>Access heat pump over Husdata interface connected via serial port</description> <channel-groups> @@ -229,7 +229,7 @@ <channel-type id="radiatorReturnTemp"> <item-type>Number:Temperature</item-type> - <label>Radiator return</label> + <label>Radiator Return</label> <description>Temperature of the water that returns to the heat pump from the radiators</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -245,7 +245,7 @@ <channel-type id="hotWaterTemp" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Hot water</label> + <label>Hot Water</label> <description>Temperature in the hot water cylinder</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -253,7 +253,7 @@ <channel-type id="radiatorForwardTemp" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Radiator forward</label> + <label>Radiator Forward</label> <description>Temperature on the flow water in the circuit</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -277,7 +277,7 @@ <channel-type id="heatFluidOutTemp"> <item-type>Number:Temperature</item-type> - <label>Heat fluid out</label> + <label>Heat Fluid Out</label> <description>Temperature of the radiator water as it leaves the heat pump</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -285,7 +285,7 @@ <channel-type id="heatFluidInTemp"> <item-type>Number:Temperature</item-type> - <label>Heat fluid in</label> + <label>Heat Fluid In</label> <description>Temperature of the water that is led into the heat pump</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -293,7 +293,7 @@ <channel-type id="coldFluidInTemp"> <item-type>Number:Temperature</item-type> - <label>Cold fluid in</label> + <label>Cold Fluid In</label> <description>Temperature of the heat transfer fluid that is led into the heat pump from the bore hole or the ground</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -301,7 +301,7 @@ <channel-type id="coldFluidOutTemp"> <item-type>Number:Temperature</item-type> - <label>Cold fluid out</label> + <label>Cold Fluid Out</label> <description>Temperature of the heat transfer fluid that is led out of the heat pump to the bore hole or the ground</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -309,7 +309,7 @@ <channel-type id="externalHotWaterTemp" advanced="true"> <item-type>Number:Temperature</item-type> - <label>External hot water</label> + <label>External Hot Water</label> <description>Temperature in the external hot water cylinder</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -317,7 +317,7 @@ <channel-type id="lastErrorType"> <item-type>String</item-type> - <label>Last error type</label> + <label>Last Error Type</label> <description>Information about the alarm type that occured last</description> <category>Error</category> <state readOnly="true" pattern="%s"> @@ -351,7 +351,7 @@ <channel-type id="lastErrorTimestamp"> <item-type>DateTime</item-type> - <label>Last error date</label> + <label>Last Error Date</label> <description>Information about when last alarm occurred</description> <category>Time</category> <state readOnly="true" pattern="%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS"/> @@ -359,7 +359,7 @@ <channel-type id="powerLamp" advanced="true"> <item-type>Switch</item-type> - <label>Power lamp</label> + <label>Power Lamp</label> <description>Lamp on when the heat pump is on</description> <category>Switch</category> <state readOnly="true"/> @@ -367,7 +367,7 @@ <channel-type id="heatPumpLamp"> <item-type>Switch</item-type> - <label>Heat pump lamp</label> + <label>Heat Pump Lamp</label> <description>Lamp on when the heat pump (compressor) is operational</description> <category>Switch</category> <state readOnly="true"/> @@ -375,7 +375,7 @@ <channel-type id="additionalHeatLamp"> <item-type>Switch</item-type> - <label>Additional heat lamp</label> + <label>Additional Heat Lamp</label> <description>Lamp on when the heat pump is using additional heat from an electric cassette</description> <category>Switch</category> <state readOnly="true"/> @@ -383,7 +383,7 @@ <channel-type id="hotWaterLamp"> <item-type>Switch</item-type> - <label>Hot water lamp</label> + <label>Hot Water Lamp</label> <description>Lamp on when the heat pump is heating water in the heater</description> <category>Switch</category> <state readOnly="true"/> @@ -391,7 +391,7 @@ <channel-type id="alarmLamp"> <item-type>Switch</item-type> - <label>Alarm lamp</label> + <label>Alarm Lamp</label> <description>Lamp indicates that a fault has occurred in the heat pump</description> <category>Siren</category> <state readOnly="true"/> @@ -399,7 +399,7 @@ <channel-type id="coldFluidPumpState" advanced="true"> <item-type>Switch</item-type> - <label>Cold fluid pump</label> + <label>Cold Fluid Pump</label> <category>Switch</category> <state readOnly="true"/> </channel-type> @@ -413,35 +413,35 @@ <channel-type id="radiatorPumpState" advanced="true"> <item-type>Switch</item-type> - <label>Radiator pump</label> + <label>Radiator Pump</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="heatFluidPumpState" advanced="true"> <item-type>Switch</item-type> - <label>Heat fluid pump</label> + <label>Heat Fluid Pump</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="additionalHeat3kWState" advanced="true"> <item-type>Switch</item-type> - <label>Additional heat 3kW</label> + <label>Additional Heat 3kW</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="additionalHeat6kWState" advanced="true"> <item-type>Switch</item-type> - <label>Additional heat 6kW</label> + <label>Additional Heat 6kW</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="switchValveState" advanced="true"> <item-type>Switch</item-type> - <label>Switch valve</label> + <label>Switch Valve</label> <description>The valve switches between heating the heating water and hot water</description> <category>Heating</category> <state readOnly="true"/> @@ -456,7 +456,7 @@ <channel-type id="radiatorReturnTarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Radiator return target</label> + <label>Radiator Return Target</label> <description>Calculated desired radiator return temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -464,7 +464,7 @@ <channel-type id="radiatorReturnOn" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Minimal radiator return</label> + <label>Minimal Radiator Return</label> <description>Calculated minimal (start) radiator return temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -472,7 +472,7 @@ <channel-type id="radiatorReturnOff" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Maximal radiator return</label> + <label>Maximal Radiator Return</label> <description>Calculated maximal (stop) radiator return temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -480,7 +480,7 @@ <channel-type id="hotWaterTarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Hot water target</label> + <label>Hot Water Target</label> <description>Desired radiator return temperature</description> <category>Temperature</category> <state min="35" max="54" step="0.1" pattern="%.1f %unit%"/> @@ -488,7 +488,7 @@ <channel-type id="hotWaterTargetHysteresis" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Hot water hysteresis</label> + <label>Hot Water Hysteresis</label> <description> The function measures below and above the value set in hotWaterTarget</description> <category>Temperature</category> <state min="2" max="15" step="0.1" pattern="%.1f %unit%"/> @@ -496,7 +496,7 @@ <channel-type id="hotWaterOn" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Minimal hot water</label> + <label>Minimal Hot Water</label> <description>Minimal (start) hot water temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -504,7 +504,7 @@ <channel-type id="hotWaterOff" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Maximal hot water</label> + <label>Maximal Hot Water</label> <description>Maximal (stop) hot water temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -512,7 +512,7 @@ <channel-type id="radiatorForwardTarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Radiator forward target</label> + <label>Radiator Forward Target</label> <description>Calculated desired radiator forward temperature</description> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> @@ -520,21 +520,21 @@ <channel-type id="addHeatPowerPercent" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Additional heat power</label> + <label>Additional Heat Power</label> <category>Energy</category> <state readOnly="true" pattern="%.1f %unit%"/> </channel-type> <channel-type id="addHeatPowerEnergy" advanced="true"> <item-type>Number:Energy</item-type> - <label>Additional heat power</label> + <label>Additional Heat Power</label> <category>Energy</category> <state readOnly="true" pattern="%.1f %unit%"/> </channel-type> <channel-type id="heatCurve" advanced="true"> <item-type>Number</item-type> - <label>Heat curve</label> + <label>Heat Curve</label> <description>Heat curve influences the heat pump’s production of heat</description> <category>Line</category> <state min="0" max="10" step="0.1" pattern="%.1f"/> @@ -542,7 +542,7 @@ <channel-type id="heatCurveFineAdj" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Heat curve fine tune</label> + <label>Heat Curve Fine Tune</label> <description>Fine-tuning means that you offset the heat curve in parallel</description> <category>Temperature</category> <state min="-10" max="10" step="0.1" pattern="%.1f %unit%"/> @@ -550,7 +550,7 @@ <channel-type id="indoorTempSetting" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Indoor target</label> + <label>Indoor Target</label> <description>Desired temperature in the room where the sensor is fitted</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -558,7 +558,7 @@ <channel-type id="curveInflByInTemp" advanced="true"> <item-type>Number</item-type> - <label>Room sensor influence</label> + <label>Room Sensor Influence</label> <description>Set how much the room sensor should influence the heat curve</description> <category>Line</category> <state step="0.1" pattern="%.1f"/> @@ -566,7 +566,7 @@ <channel-type id="adjCurveAt20" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at 20 °C</label> + <label>Adjust Heat Curve At 20 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -574,7 +574,7 @@ <channel-type id="adjCurveAt15" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at 15 °C</label> + <label>Adjust Heat Curve At 15 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -582,7 +582,7 @@ <channel-type id="adjCurveAt10" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at 10 °C</label> + <label>Adjust Heat Curve At 10 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -590,7 +590,7 @@ <channel-type id="adjCurveAt5" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at 5 °C</label> + <label>Adjust Heat Curve At 5 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -598,7 +598,7 @@ <channel-type id="adjCurveAt0" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at 0 °C</label> + <label>Adjust Heat Curve At 0 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -606,7 +606,7 @@ <channel-type id="adjCurveAtMinus5" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -5 °C</label> + <label>Adjust Heat Curve At -5 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -614,7 +614,7 @@ <channel-type id="adjCurveAtMinus10" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -10 °C</label> + <label>Adjust Heat Curve At -10 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -622,7 +622,7 @@ <channel-type id="adjCurveAtMinus15" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -15 °C</label> + <label>Adjust Heat Curve At -15 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -630,7 +630,7 @@ <channel-type id="adjCurveAtMinus20" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -20 °C</label> + <label>Adjust Heat Curve At -20 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -638,7 +638,7 @@ <channel-type id="adjCurveAtMinus25" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -25 °C</label> + <label>Adjust Heat Curve At -25 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -646,7 +646,7 @@ <channel-type id="adjCurveAtMinus30" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -30 °C</label> + <label>Adjust Heat Curve At -30 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -654,7 +654,7 @@ <channel-type id="adjCurveAtMinus35" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Adjust heat curve at -35 °C</label> + <label>Adjust Heat Curve At -35 °C</label> <description>Heat curve can be adjusted up or down every fifth outdoor degree. The purpose of breaking the curve is to be able to influence the heat pump's heat production at extra sensitive outdoor temperatures</description> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> @@ -662,14 +662,14 @@ <channel-type id="heatCurveCouplingDiff" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Heat curve coupling diff</label> + <label>Heat Curve Coupling Diff</label> <category>Temperature</category> <state step="0.1" pattern="%.1f %unit%"/> </channel-type> <channel-type id="airIntakeTemp" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Air intake</label> + <label>Air Intake</label> <category>Temperature</category> <state readOnly="true" pattern="%.1f %unit%"/> </channel-type> @@ -683,21 +683,21 @@ <channel-type id="compressorSpeed" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Compressor speed</label> + <label>Compressor Speed</label> <category>Pump</category> <state readOnly="true" pattern="%.1f %unit%"/> </channel-type> <channel-type id="heatCurve2" advanced="true"> <item-type>Number</item-type> - <label>Heat curve 2</label> + <label>Heat Curve 2</label> <category>Line</category> <state min="0" max="10" step="0.1" pattern="%.1f"/> </channel-type> <channel-type id="heatCurve2FineAdj" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Heat curve 2 fine tune</label> + <label>Heat Curve 2 Fine Tune</label> <description>Fine-tuning means that you offset the heat curve 2 in parallel</description> <category>Temperature</category> <state min="-10" max="10" step="0.1" pattern="%.1f %unit%"/> @@ -705,7 +705,7 @@ <channel-type id="switchValve2State" advanced="true"> <item-type>Switch</item-type> - <label>Switch valve 2</label> + <label>Switch Valve 2</label> <category>Heating</category> <state readOnly="true"/> </channel-type> @@ -719,49 +719,49 @@ <channel-type id="highPressostatState" advanced="true"> <item-type>Switch</item-type> - <label>High pressostat</label> + <label>High Pressostat</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="lowPressostatState" advanced="true"> <item-type>Switch</item-type> - <label>Low pressostat</label> + <label>Low Pressostat</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="heatingCableState" advanced="true"> <item-type>Switch</item-type> - <label>Heating cable</label> + <label>Heating Cable</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="crankCaseHeaterState" advanced="true"> <item-type>Switch</item-type> - <label>Crank case heater</label> + <label>Crank Case Heater</label> <category>Switch</category> <state readOnly="true"/> </channel-type> <channel-type id="elMeter1" advanced="true"> <item-type>Number</item-type> - <label>Collected pulses meter 1</label> + <label>Collected Pulses Meter 1</label> <category>Switch</category> <state readOnly="true" pattern="%d"/> </channel-type> <channel-type id="elMeter2" advanced="true"> <item-type>Number</item-type> - <label>Collected pulses meter 2</label> + <label>Collected Pulses Meter 2</label> <category>Switch</category> <state readOnly="true" pattern="%d"/> </channel-type> <channel-type id="heatPumpInOperationDHW" advanced="true"> <item-type>Number:Time</item-type> - <label>Heat pump in oper. - DHW</label> + <label>Heat Pump in Oper. - DHW</label> <description>Heat pump in operation while heating DHW - number of hours</description> <category>Time</category> <state readOnly="true" pattern="%d %unit%"/> @@ -769,7 +769,7 @@ <channel-type id="heatPumpInOperationRAD" advanced="true"> <item-type>Number:Time</item-type> - <label>Heat pump in oper. - radiators</label> + <label>Heat Pump in Oper. - Radiators</label> <description>Heat pump in operation while heating radiators - number of hours</description> <category>Time</category> <state readOnly="true" pattern="%d %unit%"/> @@ -777,7 +777,7 @@ <channel-type id="addHeatInOperationDHW" advanced="true"> <item-type>Number:Time</item-type> - <label>Add. heat in oper. - DHW</label> + <label>Add. Heat in Oper. - DHW</label> <description>Additional heat in operation heating DHW - number of hours</description> <category>Time</category> <state readOnly="true" pattern="%d %unit%"/> @@ -785,7 +785,7 @@ <channel-type id="addHeatInOperationRAD" advanced="true"> <item-type>Number:Time</item-type> - <label>Add. heat in oper. - radiators</label> + <label>Add. Heat in Oper. - Radiators</label> <description>Additional heat in operation heating radiators - number of hours</description> <category>Time</category> <state readOnly="true" pattern="%d %unit%"/> @@ -793,7 +793,7 @@ <channel-type id="summerDisconnection" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Summer disconnection</label> + <label>Summer Disconnection</label> <description>The function means the heat pump only produces hot water when the outdoor temperature rises above the set value</description> <category>Temperature</category> <state min="10" max="30" step="0.1" pattern="%.1f %unit%"/> diff --git a/bundles/org.openhab.binding.rfxcom/NOTICE b/bundles/org.openhab.binding.rfxcom/NOTICE index c26850b4e0a13..8ccd1eef2c9fd 100644 --- a/bundles/org.openhab.binding.rfxcom/NOTICE +++ b/bundles/org.openhab.binding.rfxcom/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.rfxcom/README.md b/bundles/org.openhab.binding.rfxcom/README.md index 2740847707629..09853cf31fa18 100644 --- a/bundles/org.openhab.binding.rfxcom/README.md +++ b/bundles/org.openhab.binding.rfxcom/README.md @@ -65,7 +65,7 @@ and then you will be able to use /dev/rfxtrx0 as the serial device regardless of If you have any problems with JD2XX or you don't want to disable FTDI driver on OS X or Linux, you can also configure RFXCOM transceivers/receivers manually. -To do that via the PaperUI, manually add the generic RFXCOM device named `RFXCOM USB Transceiver`, with the description "This is universal RFXCOM transceiver bridge for manual configuration purposes". +To do that via the Paper UI, manually add the generic RFXCOM device named `RFXCOM USB Transceiver`, with the description "This is universal RFXCOM transceiver bridge for manual configuration purposes". You will need to specify at least the serial port which has been assigned to the RFXCOM (see notes above). To configure the serial port within openHAB see the [general documentation about serial port configuration](/docs/administration/serial.html). @@ -86,7 +86,7 @@ To start a TCP server for an RFXCOM device, you can use socat: socat tcp-listen:10001,fork,reuseaddr file:/dev/ttyUSB0,raw ``` -A TCP bridge, for use with socat on a remote host, can only be configured manually either through the PaperUI by adding an "RFXCOM USB Transceiver over TCP/IP" device or in a thing file like this: +A TCP bridge, for use with socat on a remote host, can only be configured manually either through the Paper UI by adding an "RFXCOM USB Transceiver over TCP/IP" device or in a thing file like this: ``` Bridge rfxcom:tcpbridge:sunflower [ host="sunflower", port=10001 ] { @@ -160,6 +160,7 @@ This binding currently supports following channel types: | datetime | DateTime | DateTime channel. | | dimminglevel | Dimmer | Dimming level channel. | | fanspeedstring | String | Set the speed of the device, values could be device specific | +| fanspeedcontrol | Rollershutter | Set the speed of the device, values could be device specific | | fanlight | Switch | Enable light of Fan | | forecast | String | Weather forecast from device: NO\_INFO\_AVAILABLE/SUNNY/PARTLY\_CLOUDY/CLOUDY/RAIN | | tempcontrol | Rollershutter | Global control for temperature also setting ON, OFF, UP, DOWN | @@ -182,6 +183,7 @@ This binding currently supports following channel types: | totalamphour | Number | Used "energy" in ampere-hours. | | uv | Number | Current UV level. | | venetianBlind | Dimmer | Open/close and adjust angle of venetian blind | +| voltage | Number | Voltage | | winddirection | Number | Wind direction in degrees. | | windspeed | Number | Wind speed in meters per second. | @@ -198,7 +200,7 @@ The binding uses the following system channels: ### Thing files -Sensors/actuators are easy to configure through the PaperUI. +Sensors/actuators are easy to configure through the Paper UI. However, if you used a thing file for your RFXCOM you can also configure them manually there as well, for example: ``` @@ -209,7 +211,7 @@ Bridge rfxcom:bridge:usb0 [ serialPort="/dev/<device>" ] { ### Item files -Items may be created through PaperUI or add using item files in which you add a channel parameter specifying the bridge's name, the thing ID and channel that the item should be linked to, for example: +Items may be created through Paper UI or add using item files in which you add a channel parameter specifying the bridge's name, the thing ID and channel that the item should be linked to, for example: ``` Switch Switch {channel="rfxcom:lighting2:usb0:100001_1:command"} @@ -234,6 +236,7 @@ This binding currently supports the following things / message types: * [lighting5 - RFXCOM Lighting5 Actuator](#lighting5---rfxcom-lighting5-actuator) * [lighting6 - RFXCOM Lighting6 Actuator](#lighting6---rfxcom-lighting6-actuator) * [rain - RFXCOM Rain Sensor](#rain---rfxcom-rain-sensor) +* [rfxsensor - RFXCOM rfxsensor](#rfxsensor) * [rfy - RFXCOM Rfy Actuator](#rfy---rfxcom-rfy-actuator) * [security1 - RFXCOM Security1 Sensor](#security1---rfxcom-security1-sensor) * [temperaturehumiditybarometric - RFXCOM Temperature-Humidity-Barometric Sensor](#temperaturehumiditybarometric---rfxcom-temperature-humidity-barometric-sensor) @@ -465,6 +468,71 @@ Switch item=FanLightSwitch label="Light" mappings=[ON="On"] Switch item=FanSpeedSwitch label="Speed" mappings=[LOW=Low, MED=Medium, HI=High] ``` +#### Falmec fan + +A Falmec Fan device + +##### Channels + +| Name | Channel Type | Item Type | Remarks | +|--------------|-------------------------------------|-----------|------------------------------| +| command | [command](#channels) | Switch | | +| fanSpeed | [fanspeed](#channels) | Number | Options: 1,2,3,4,5,6 | +| fanLight | [fanlight](#channels) | Switch | | +| signalLevel | [system.signal-strength](#channels) | Number | | + + +##### Configuration Options + +* deviceId - Device Id + * Device id, example 47360 +* subType - Sub Type + * Specifies device sub type. + * FALMEC - Falmec + +#### Lucci Air DC fan + +A Lucci Air DC fan device + +##### Channels + +| Name | Channel Type | Item Type | Remarks | +|--------------|-------------------------------------|---------------|---------------------------------------------------------------| +| commandString| [commandString](#channels) | String | Options: POWER, UP, DOWN, LIGHT, REVERSE, NATURAL_FLOW, PAIR | +| fanSpeed | [fanspeedcontrol](#channels) | RollerShutter | Options: UP / DOWN | +| fanLight | [fanlight](#channels) | Switch | | +| signalLevel | [system.signal-strength](#channels) | Number | | + +##### Configuration Options + +* deviceId - Device Id + * Device id, example 47360 +* subType - Sub Type + * Specifies device sub type. + * LUCCI_AIR_DC - Lucci Air DC + +#### Lucci Air DC II fan + +A Lucci Air DC II fan device + +##### Channels + +| Name | Channel Type | Item Type | Remarks | +|--------------|-------------------------------------|-----------|--------------------------------------| +| command | [command](#channels) | Switch | | +| commandString| [commandString](#channels) | String | Options: POWER_OFF, LIGHT, REVERSE | +| fanSpeed | [fanspeed](#channels) | Number | Options: 1,2,3,4,5,6 | +| fanLight | [fanlight](#channels) | Switch | | +| signalLevel | [system.signal-strength](#channels) | Number | | + +##### Configuration Options + +* deviceId - Device Id + * Device id, example 47360 +* subType - Sub Type + * Specifies device sub type. + * LUCCI_AIR_DC_II - Lucci Air DC II + ### energy - RFXCOM Energy Sensor An Energy device @@ -662,10 +730,10 @@ A Lighting4 device The support for lighting 4 in RFXCOM is less complete because a lot of different devices use the same chips and can not easily be distinguished. So some extra configuration can be used for fine tuning the behavior of your Lighting4 devices. -For configuration via the PaperUI three extra fields are available, being the the pulse length and a commmand id for on and off commands. +For configuration via the Paper UI three extra fields are available, being the the pulse length and a commmand id for on and off commands. If your item is auto-discovered normally the on or off command should be recognized properly. -For a usb attached RFXCOM on Windows the configuration could look like this (note that the `onCommandId`, `offCommandId` and `pulse` are all optional): +For a USB attached RFXCOM on Windows the configuration could look like this (note that the `onCommandId`, `offCommandId` and `pulse` are all optional): ``` Bridge rfxcom:bridge:238adf67 [ serialPort="COM4" ] { @@ -697,10 +765,10 @@ end | Brand | What | Action | Command ID | Supported | Source | |-------|---------------|-------------|------------|-----------|--------| -| Kerui | Motion Sensor | Motion | 10 | as ON | [#3103](https://github.com/openhab/openhab2-addons/issues/3103) | -| Kerui | Door Contact | door open | 14 | as OFF | [#3103](https://github.com/openhab/openhab2-addons/issues/3103) | -| Kerui | Door Contact | door closed | 7 | as ON | [#3103](https://github.com/openhab/openhab2-addons/issues/3103) | -| Kerui | Door Contact | tamper | 7 | as ON | [#3103](https://github.com/openhab/openhab2-addons/issues/3103) | +| Kerui | Motion Sensor | Motion | 10 | as ON | [#3103](https://github.com/openhab/openhab-addons/issues/3103) | +| Kerui | Door Contact | door open | 14 | as OFF | [#3103](https://github.com/openhab/openhab-addons/issues/3103) | +| Kerui | Door Contact | door closed | 7 | as ON | [#3103](https://github.com/openhab/openhab-addons/issues/3103) | +| Kerui | Door Contact | tamper | 7 | as ON | [#3103](https://github.com/openhab/openhab-addons/issues/3103) | ### lighting5 - RFXCOM Lighting5 Actuator @@ -821,6 +889,25 @@ A Rain device * RAIN5 - WS2300 * RAIN6 - La Crosse TX5 +### rfxsensor - RFXCOM RFXSensor + +A RFXSensor sensor + +#### Channels + +| Name | Channel Type | Item Type | Remarks | +|------------------|-------------------------------------|------------|---------| +| pressure | [pressure](#channels) | Number | | +| humidity | [humidity](#channels) | Number | | +| referenceVoltage | [voltage](#channels) | Number | | +| voltage | [voltage](#channels) | Number | | +| temperature | [temperature](#channels) | Number | | +| signalLevel | [system.signal-strength](#channels) | Number | | + +#### Configuration Options + +* deviceId - Device Id + * Unit Id. Example 100 ### rfy - RFXCOM Rfy Actuator diff --git a/bundles/org.openhab.binding.rfxcom/pom.xml b/bundles/org.openhab.binding.rfxcom/pom.xml index e919f5c4eb7d4..9b703f8ced86f 100644 --- a/bundles/org.openhab.binding.rfxcom/pom.xml +++ b/bundles/org.openhab.binding.rfxcom/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.rfxcom</artifactId> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/feature/feature.xml b/bundles/org.openhab.binding.rfxcom/src/main/feature/feature.xml index a58c213a917f0..7a6a73b7a25db 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.rfxcom-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-rfxcom" description="RFXCOM Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/DeviceMessageListener.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/DeviceMessageListener.java index abf7577124c3b..ad9417d66e83f 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/DeviceMessageListener.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/DeviceMessageListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,10 +27,8 @@ public interface DeviceMessageListener { /** * This method is called whenever the message is received from the bridge. * - * @param bridge - * The RFXCom bridge where message is received. - * @param message - * The message which received. + * @param bridge The RFXCom bridge where message is received. + * @param message The message which received. */ void onDeviceMessageReceived(ThingUID bridge, RFXComDeviceMessage message) throws RFXComException; } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComBindingConstants.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComBindingConstants.java index 9b5631743b864..197bea440d2f5 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComBindingConstants.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -107,6 +107,7 @@ public class RFXComBindingConstants { public static final String CHANNEL_CONTACT_2 = "contact2"; public static final String CHANNEL_CONTACT_3 = "contact3"; public static final String CHANNEL_VOLTAGE = "voltage"; + public static final String CHANNEL_REFERENCE_VOLTAGE = "referenceVoltage"; public static final String CHANNEL_SET_POINT = "setpoint"; public static final String CHANNEL_DATE_TIME = "dateTime"; public static final String CHANNEL_CHIME_SOUND = "chimeSound"; @@ -129,7 +130,7 @@ public class RFXComBindingConstants { private static final ThingTypeUID THING_TYPE_FAN_LUCCI_DC = new ThingTypeUID(BINDING_ID, "fan_lucci_dc"); private static final ThingTypeUID THING_TYPE_FAN_FT1211R = new ThingTypeUID(BINDING_ID, "fan_ft1211r"); private static final ThingTypeUID THING_TYPE_FAN_FALMEC = new ThingTypeUID(BINDING_ID, "fan_falmec"); - private static final ThingTypeUID THING_TYPE_FAN_LUCCI_DC_II = new ThingTypeUID(BINDING_ID, "fan_lucci_dc2"); + private static final ThingTypeUID THING_TYPE_FAN_LUCCI_DC_II = new ThingTypeUID(BINDING_ID, "fan_lucci_dc_ii"); private static final ThingTypeUID THING_TYPE_FS20 = new ThingTypeUID(BINDING_ID, "fs20"); private static final ThingTypeUID THING_TYPE_GAS_USAGE = new ThingTypeUID(BINDING_ID, "gasusage"); private static final ThingTypeUID THING_TYPE_HOME_CONFORT = new ThingTypeUID(BINDING_ID, "homeconfort"); @@ -205,7 +206,7 @@ public class RFXComBindingConstants { put(PacketType.FAN_LUCCI_DC, RFXComBindingConstants.THING_TYPE_FAN_LUCCI_DC); put(PacketType.FAN_FT1211R, RFXComBindingConstants.THING_TYPE_FAN_FT1211R); put(PacketType.FAN_FALMEC, RFXComBindingConstants.THING_TYPE_FAN_FALMEC); - put(PacketType.FAN_LUCCI_DCII, RFXComBindingConstants.THING_TYPE_FAN_LUCCI_DC_II); + put(PacketType.FAN_LUCCI_DC_II, RFXComBindingConstants.THING_TYPE_FAN_LUCCI_DC_II); put(PacketType.FS20, RFXComBindingConstants.THING_TYPE_FS20); put(PacketType.GAS, RFXComBindingConstants.THING_TYPE_GAS_USAGE); put(PacketType.HOME_CONFORT, RFXComBindingConstants.THING_TYPE_HOME_CONFORT); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComHandlerFactory.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComHandlerFactory.java index a96af66e8ad80..ac41e913a0ada 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComHandlerFactory.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/RFXComHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -74,7 +74,6 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { @Override protected @Nullable ThingHandler createHandler(Thing thing) { - ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (RFXComBindingConstants.SUPPORTED_BRIDGE_THING_TYPES_UIDS.contains(thingTypeUID)) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComBridgeConfiguration.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComBridgeConfiguration.java index d6f85779c6268..6d36873c83b06 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComBridgeConfiguration.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,8 @@ */ package org.openhab.binding.rfxcom.internal.config; -import org.openhab.binding.rfxcom.internal.connector.RFXComBaseConnector; - /** - * Configuration class for {@link RFXComBaseConnector} device. + * Configuration class for RFXComBaseConnector device. * * @author Pauli Anttila - Initial contribution */ diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfiguration.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfiguration.java index ee819f458c6cb..1e5ec25ac57c0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfiguration.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,7 @@ package org.openhab.binding.rfxcom.internal.config; /** - * Configuration class for {@link RfxcomBinding} device. + * Configuration class for RfxcomBinding device. * * @author Pauli Anttila - Initial contribution */ diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComBaseConnector.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComBaseConnector.java index 8da22b6ccd966..6940f231b924f 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComBaseConnector.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComBaseConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,7 +23,7 @@ /** * RFXCOM connector for serial port communication. * - * @author James Hewitt-Thomas + * @author James Hewitt-Thomas - Initial contribution */ public abstract class RFXComBaseConnector implements RFXComConnectorInterface { private final Logger logger = LoggerFactory.getLogger(RFXComBaseConnector.class); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComConnectorInterface.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComConnectorInterface.java index 1550aff9bbad1..b41dcdb5e0b76 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComConnectorInterface.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComConnectorInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,40 +26,35 @@ public interface RFXComConnectorInterface { /** * Procedure for connecting to RFXCOM controller. * - * @param device - * Controller connection parameters (e.g. serial port name or IP - * address). + * @param device Controller connection parameters (e.g. serial port name or IP address). */ - public void connect(RFXComBridgeConfiguration device) throws Exception; + void connect(RFXComBridgeConfiguration device) throws Exception; /** * Procedure for disconnecting to RFXCOM controller. * */ - public void disconnect(); + void disconnect(); /** * Procedure for send raw data to RFXCOM controller. * - * @param data - * raw bytes. + * @param data raw bytes. */ - public void sendMessage(byte[] data) throws IOException; + void sendMessage(byte[] data) throws IOException; /** * Procedure for register event listener. * - * @param listener - * Event listener instance to handle events. + * @param listener Event listener instance to handle events. */ - public void addEventListener(RFXComEventListener listener); + void addEventListener(RFXComEventListener listener); /** * Procedure for remove event listener. * - * @param listener - * Event listener instance to remove. + * @param listener Event listener instance to remove. */ - public void removeEventListener(RFXComEventListener listener); + void removeEventListener(RFXComEventListener listener); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComEventListener.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComEventListener.java index abf1f9b305298..b65539e77d614 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComEventListener.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,16 +22,14 @@ public interface RFXComEventListener { /** * Procedure for receive raw data from RFXCOM controller. * - * @param data - * Received raw data. + * @param data Received raw data. */ void packetReceived(byte[] data); /** * Procedure for receiving information fatal error. * - * @param error - * Error occurred. + * @param error Error occurred. */ void errorOccurred(String error); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComJD2XXConnector.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComJD2XXConnector.java index cb81352959400..b10915b662b28 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComJD2XXConnector.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComJD2XXConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComSerialConnector.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComSerialConnector.java index 4169931c95702..5dcc7745713d9 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComSerialConnector.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComStreamReader.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComStreamReader.java index 28c3568e4eab2..f8308a2481d85 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComStreamReader.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComStreamReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,21 +22,23 @@ /** * RFXCOM stream reader to parse RFXCOM output into messages. * - * @author Martin van Wingerden - Slight refactoring for read loop for TCP connector - * @author Mike Jagdis - Interruptible read loop + * @author Pauli Anttila - Initial contribution * @author James Hewitt-Thomas - New class - * @author Pauli Anttila - Original read loop + * @author Mike Jagdis - Interruptible read loop + * @author Martin van Wingerden - Slight refactoring for read loop for TCP connector */ public class RFXComStreamReader extends Thread { private final Logger logger = LoggerFactory.getLogger(RFXComStreamReader.class); private static final int MAX_READ_TIMEOUTS = 4; + private static final int MAX_RFXCOM_MESSAGE_LEN = 256; private RFXComBaseConnector connector; private class ExceptionHandler implements Thread.UncaughtExceptionHandler { @Override public void uncaughtException(Thread thread, Throwable throwable) { - logger.error("Connector died: ", throwable); + logger.debug("Connector died: ", throwable); + connector.sendErrorToListeners("Connector died: " + throwable.getMessage()); } } @@ -48,7 +50,7 @@ public RFXComStreamReader(RFXComBaseConnector connector) { @Override public void run() { logger.debug("Data listener started"); - byte[] buf = new byte[Byte.MAX_VALUE]; + byte[] buf = new byte[MAX_RFXCOM_MESSAGE_LEN]; // The stream has (or SHOULD have) a read timeout set. Taking a // read timeout (read returns 0) between packets gives us a chance @@ -62,6 +64,7 @@ public void run() { int packetLength = buf[0]; if (bytesRead > 0 && packetLength > 0) { + logger.trace("Message length is {} bytes", packetLength); processMessage(buf, packetLength); connector.sendMsgToListeners(Arrays.copyOfRange(buf, 0, packetLength + 1)); } @@ -78,13 +81,12 @@ private void processMessage(byte[] buf, int packetLength) throws IOException, RF // Now read the rest of the packet int bufferIndex = 1; int readTimeoutCount = 1; - int bytesRead; while (bufferIndex <= packetLength) { int bytesRemaining = packetLength - bufferIndex + 1; - - bytesRead = connector.read(buf, bufferIndex, bytesRemaining); - + logger.trace("Waiting remaining {} bytes from the message", bytesRemaining); + int bytesRead = connector.read(buf, bufferIndex, bytesRemaining); if (bytesRead > 0) { + logger.trace("Received {} bytes from the message", bytesRead); bufferIndex += bytesRead; readTimeoutCount = 1; } else if (readTimeoutCount++ == MAX_READ_TIMEOUTS) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComTcpConnector.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComTcpConnector.java index 24208387cc1e6..2c8a71eedef59 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComTcpConnector.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/connector/RFXComTcpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComBridgeDiscovery.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComBridgeDiscovery.java index 5676ed933c1a8..4e55940f94417 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComBridgeDiscovery.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -82,7 +82,6 @@ protected void stopBackgroundDiscovery() { } private synchronized void discoverRfxcom() { - try { JD2XX jd2xx = new JD2XX(); logger.debug("Discovering RFXCOM transceiver devices by JD2XX version {}", jd2xx.getLibraryVersion()); @@ -131,7 +130,7 @@ private synchronized void discoverRfxcom() { private void addBridge(ThingTypeUID bridgeType, String bridgeId) { logger.debug("Discovered RFXCOM transceiver, bridgeType='{}', bridgeId='{}'", bridgeType, bridgeId); - Map<String, Object> properties = new HashMap<>(2); + Map<String, Object> properties = new HashMap<>(); properties.put(RFXComBridgeConfiguration.BRIDGE_ID, bridgeId); ThingUID uid = new ThingUID(bridgeType, bridgeId); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComDeviceDiscoveryService.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComDeviceDiscoveryService.java index 6cfa60725d7bd..a3315306e1354 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/discovery/RFXComDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -82,8 +82,7 @@ public void onDeviceMessageReceived(ThingUID bridge, RFXComDeviceMessage message if (!bridgeHandler.getConfiguration().disableDiscovery) { logger.trace("Adding new RFXCOM {} with id '{}' to smarthome inbox", thingUID, id); - DiscoveryResultBuilder discoveryResultBuilder = DiscoveryResultBuilder.create(thingUID) - .withBridge(bridge); + DiscoveryResultBuilder discoveryResultBuilder = DiscoveryResultBuilder.create(thingUID).withBridge(bridge); message.addDevicePropertiesTo(discoveryResultBuilder); thingDiscovered(discoveryResultBuilder.build()); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComException.java index b8f2c83a79f18..7427644094ab0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageNotImplementedException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageNotImplementedException.java index 0d6ee35861ec4..0c7a99f40db75 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageNotImplementedException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageNotImplementedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageTooLongException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageTooLongException.java index 36ca5e4b082c0..d669c80ab89eb 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageTooLongException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComMessageTooLongException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComTimeoutException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComTimeoutException.java index 3c88d7f109d1a..259b88015ee9b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComTimeoutException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComTimeoutException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedChannelException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedChannelException.java index 9b1198fa42f18..b3775aef37428 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedChannelException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedChannelException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,7 @@ /** * Exception to indicate that a request was received for an unsupported channel * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ public class RFXComUnsupportedChannelException extends RFXComException { public RFXComUnsupportedChannelException(String message) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedValueException.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedValueException.java index c5e9c10f0d7ab..1f2432e92a0f7 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedValueException.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/exceptions/RFXComUnsupportedValueException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/DeviceState.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/DeviceState.java new file mode 100644 index 0000000000000..1c2b3a8a434ce --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/DeviceState.java @@ -0,0 +1,24 @@ +/** + * 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.rfxcom.internal.handler; + +import org.eclipse.smarthome.core.types.Type; + +/** + * Add support for a device state to be stored and retrieved later one + * + * @author Martin van Wingerden - Initial contribution + */ +public interface DeviceState { + Type getLastState(String channelId); +} diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComBridgeHandler.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComBridgeHandler.java index 1fd141ac20ff9..9b5911463c981 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComBridgeHandler.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -218,7 +218,7 @@ private synchronized void connect() { } } - public void sendMessage(RFXComMessage msg) throws RFXComException { + public void sendMessage(RFXComMessage msg) { try { RFXComBaseMessage baseMsg = (RFXComBaseMessage) msg; transmitQueue.enqueue(baseMsg); @@ -240,7 +240,7 @@ public void packetReceived(byte[] packet) { RFXComInterfaceMessage msg = (RFXComInterfaceMessage) message; if (msg.subType == SubType.RESPONSE) { if (msg.command == Commands.GET_STATUS) { - logger.info("RFXCOM transceiver/receiver type: {}, hw version: {}.{}, fw version: {}", + logger.debug("RFXCOM transceiver/receiver type: {}, hw version: {}.{}, fw version: {}", msg.transceiverType, msg.hardwareVersion1, msg.hardwareVersion2, msg.firmwareVersion); thing.setProperty(Thing.PROPERTY_HARDWARE_VERSION, @@ -330,8 +330,7 @@ public boolean registerDeviceStatusListener(DeviceMessageListener deviceStatusLi if (deviceStatusListener == null) { throw new IllegalArgumentException("It's not allowed to pass a null deviceStatusListener."); } - return deviceStatusListeners.contains(deviceStatusListener) ? false - : deviceStatusListeners.add(deviceStatusListener); + return !deviceStatusListeners.contains(deviceStatusListener) && deviceStatusListeners.add(deviceStatusListener); } public boolean unregisterDeviceStatusListener(DeviceMessageListener deviceStatusListener) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComHandler.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComHandler.java index bcb83f2d1a67f..78a8dada4170b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComHandler.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/handler/RFXComHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,9 @@ import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import org.eclipse.jdt.annotation.NonNull; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; @@ -29,6 +32,7 @@ import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.Type; import org.openhab.binding.rfxcom.internal.DeviceMessageListener; import org.openhab.binding.rfxcom.internal.config.RFXComDeviceConfiguration; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -46,11 +50,13 @@ * * @author Pauli Anttila - Initial contribution */ -public class RFXComHandler extends BaseThingHandler implements DeviceMessageListener { +public class RFXComHandler extends BaseThingHandler implements DeviceMessageListener, DeviceState { private static final int LOW_BATTERY_LEVEL = 1; private final Logger logger = LoggerFactory.getLogger(RFXComHandler.class); + private final Map<String, Type> stateMap = new ConcurrentHashMap<>(); + private RFXComBridgeHandler bridgeHandler; private RFXComDeviceConfiguration config; @@ -90,6 +96,8 @@ public void initialize() { logger.debug("Initializing thing {}", getThing().getUID()); initializeBridge((getBridge() == null) ? null : getBridge().getHandler(), (getBridge() == null) ? null : getBridge().getStatus()); + + stateMap.clear(); } @Override @@ -149,15 +157,16 @@ public void onDeviceMessageReceived(ThingUID bridge, RFXComDeviceMessage message case CHANNEL_COMMAND: case CHANNEL_CHIME_SOUND: case CHANNEL_MOOD: - postNullableCommand(uid, message.convertToCommand(channelId)); + postNullableCommand(uid, message.convertToCommand(channelId, this)); break; case CHANNEL_LOW_BATTERY: - updateNullableState(uid, isLowBattery(message.convertToState(CHANNEL_BATTERY_LEVEL))); + updateNullableState(uid, + isLowBattery(message.convertToState(CHANNEL_BATTERY_LEVEL, this))); break; default: - updateNullableState(uid, message.convertToState(channelId)); + updateNullableState(uid, message.convertToState(channelId, this)); break; } } catch (RFXComException e) { @@ -176,6 +185,7 @@ private void updateNullableState(ChannelUID uid, State state) { return; } + stateMap.put(uid.getId(), state); updateState(uid, state); } @@ -184,9 +194,15 @@ private void postNullableCommand(ChannelUID uid, Command command) { return; } + stateMap.put(uid.getId(), command); postCommand(uid, command); } + @Override + public Type getLastState(String channelId) { + return stateMap.get(channelId); + } + /** * Check if battery level is below low battery threshold level. * diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumUtil.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumUtil.java index 18a06f5858d93..51eeea7a613f6 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumUtil.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,13 +12,15 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; /** * An Utility class to handle {@link ByteEnumWrapper} instances * - * @author Martin van Wingerden - Simplify some code in the RFXCOM binding + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class ByteEnumUtil { private ByteEnumUtil() { // deliberately empty @@ -51,7 +53,8 @@ public static <T extends ByteEnumWrapper> T convertSubType(Class<T> typeClass, S } } - public static <T extends ByteEnumWrapperWithSupportedSubTypes> T fromByte(Class<T> typeClass, int input, Object subType) throws RFXComUnsupportedValueException { + public static <T extends ByteEnumWrapperWithSupportedSubTypes<?>> T fromByte(Class<T> typeClass, int input, + Object subType) throws RFXComUnsupportedValueException { for (T enumValue : typeClass.getEnumConstants()) { if (enumValue.toByte() == input && enumValue.supportedBySubTypes().contains(subType)) { return enumValue; diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapper.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapper.java index 63b26ad5735f9..17e26711ec836 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapper.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,7 @@ /** * An interface for all enums wrapping / mapping bytes * - * @author Martin van Wingerden - Simplify some code in the RFXCOM binding + * @author Martin van Wingerden - Initial contribution */ interface ByteEnumWrapper { byte toByte(); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapperWithSupportedSubTypes.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapperWithSupportedSubTypes.java index a8b067fcf8d7b..970b2c61d1a9b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapperWithSupportedSubTypes.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/ByteEnumWrapperWithSupportedSubTypes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,7 +17,7 @@ /** * An interface for all enums wrapping / mapping bytes * - * @author Martin van Wingerden - Simplify some code in the RFXCOM binding + * @author Martin van Wingerden - Initial contribution */ interface ByteEnumWrapperWithSupportedSubTypes<T extends ByteEnumWrapper> extends ByteEnumWrapper { List<T> supportedBySubTypes(); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessage.java index 5d01da87e51d1..d6c7f4d297f00 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for BBQ temperature message. @@ -123,13 +124,13 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (CHANNEL_FOOD_TEMPERATURE.equals(channelId)) { return new DecimalType(foodTemperature); } else if (CHANNEL_BBQ_TEMPERATURE.equals(channelId)) { return new DecimalType(bbqTemperature); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBaseMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBaseMessage.java index 63fea8071ab0d..d9706a76f84d4 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBaseMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBaseMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -38,11 +38,12 @@ public enum PacketType implements ByteEnumWrapper { LIGHTING5(20), LIGHTING6(21), CHIME(22), - FAN(23, RFXComFanMessage.SubType.LUCCI_AIR_FAN, RFXComFanMessage.SubType.WESTINGHOUSE_7226640, RFXComFanMessage.SubType.CASAFAN), + FAN(23, RFXComFanMessage.SubType.LUCCI_AIR_FAN, RFXComFanMessage.SubType.WESTINGHOUSE_7226640, + RFXComFanMessage.SubType.CASAFAN), FAN_SF01(23, RFXComFanMessage.SubType.SF01), FAN_ITHO(23, RFXComFanMessage.SubType.CVE_RFT), FAN_LUCCI_DC(23, RFXComFanMessage.SubType.LUCCI_AIR_DC), - FAN_LUCCI_DCII(23, RFXComFanMessage.SubType.LUCCI_AIR_DCII), + FAN_LUCCI_DC_II(23, RFXComFanMessage.SubType.LUCCI_AIR_DC_II), FAN_SEAV(23, RFXComFanMessage.SubType.SEAV_TXS4), FAN_FT1211R(23, RFXComFanMessage.SubType.FT1211R), FAN_FALMEC(23, RFXComFanMessage.SubType.FALMEC), @@ -87,7 +88,7 @@ public enum PacketType implements ByteEnumWrapper { private final int packetType; private final ByteEnumWrapper[] subTypes; - PacketType(int packetType, ByteEnumWrapper ... subTypes) { + PacketType(int packetType, ByteEnumWrapper... subTypes) { this.packetType = packetType; this.subTypes = subTypes; } @@ -107,7 +108,6 @@ public byte toByte() { public byte id2; public RFXComBaseMessage() { - } public RFXComBaseMessage(PacketType packetType) { @@ -116,7 +116,6 @@ public RFXComBaseMessage(PacketType packetType) { @Override public void encodeMessage(byte[] data) throws RFXComException { - rawMessage = data; packetId = data[1]; @@ -131,22 +130,22 @@ public void encodeMessage(byte[] data) throws RFXComException { } private PacketType fromByte(byte packetId, byte subType) throws RFXComUnsupportedValueException { - for (PacketType enumValue : PacketType.values()) { - if (enumValue.toByte() == packetId) { - // if there are no subtypes? - if (enumValue.subTypes.length == 0) { + for (PacketType enumValue : PacketType.values()) { + if (enumValue.toByte() == packetId) { + // if there are no subtypes? + if (enumValue.subTypes.length == 0) { + return enumValue; + } + // otherwise check for the matching subType + for (ByteEnumWrapper e : enumValue.subTypes) { + if (e.toByte() == subType) { return enumValue; } - // otherwise check for the matching subType - for (ByteEnumWrapper e: enumValue.subTypes){ - if (e.toByte() == subType) { - return enumValue; - } - } } } + } - throw new RFXComUnsupportedValueException(PacketType.class, packetId); + throw new RFXComUnsupportedValueException(PacketType.class, packetId); } public PacketType getPacketType() { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBatteryDeviceMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBatteryDeviceMessage.java index 89674325244b6..9ee5532e23d49 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBatteryDeviceMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBatteryDeviceMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,11 +17,12 @@ import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.types.State; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * A base class for all battery device messages * - * @author Martin van Wingerden - Simplify some code in the RFXCOM binding + * @author Martin van Wingerden - Initial contribution */ abstract class RFXComBatteryDeviceMessage<T> extends RFXComDeviceMessageImpl<T> { int batteryLevel; @@ -35,13 +36,13 @@ abstract class RFXComBatteryDeviceMessage<T> extends RFXComDeviceMessageImpl<T> } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_BATTERY_LEVEL: return convertBatteryLevelToSystemWideLevel(batteryLevel); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1Message.java index af698534122c0..38734cbca15c8 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,12 +23,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for blinds1 message. * * @author Peter Janson / PÃ¥l Edman - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migration to OH2 */ public class RFXComBlinds1Message extends RFXComBatteryDeviceMessage<RFXComBlinds1Message.SubType> { @@ -165,11 +166,11 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (CHANNEL_COMMAND.equals(channelId)) { return (command == Commands.CLOSE ? OpenClosedType.CLOSED : OpenClosedType.OPEN); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessage.java index 1ca35f4d31ba4..98ce12eb87058 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,11 +21,12 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for chime messages. * - * @author Mike Jagdis + * @author Mike Jagdis - Initial contribution */ public class RFXComChimeMessage extends RFXComDeviceMessageImpl<RFXComChimeMessage.SubType> { @@ -132,11 +133,11 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (CHANNEL_CHIME_SOUND.equals(channelId)) { return new DecimalType(chimeSound); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -146,7 +147,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String sensorId) throws RFXComException { + public void setDeviceId(String sensorId) { this.sensorId = Integer.parseInt(sensorId); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessage.java index 56dd407f64302..68a4717318ad5 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,11 +21,12 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for Current and Energy message. * - * @author Damien Servant + * @author Damien Servant - Initial contribution */ public class RFXComCurrentEnergyMessage extends RFXComBatteryDeviceMessage<RFXComCurrentEnergyMessage.SubType> { private static final float TOTAL_USAGE_CONVERSION_FACTOR = 223.666F; @@ -135,7 +136,7 @@ public byte[] decodeMessage() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_CHANNEL1_AMPS: return new DecimalType(channel1Amps); @@ -150,7 +151,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(totalUsage); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessage.java index c4c10e65106eb..51d4193e9b768 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for current message. @@ -124,7 +125,7 @@ public byte[] decodeMessage() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_CHANNEL1_AMPS: return new DecimalType(channel1Amps); @@ -136,7 +137,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(channel3Amps); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1Message.java index 57bbc6308b35d..6fcdbb3f05338 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,12 +23,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for curtain1 message. See Harrison. * * @author Evert van Es - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated to OH2 */ public class RFXComCurtain1Message extends RFXComBatteryDeviceMessage<RFXComCurtain1Message.SubType> { @@ -130,11 +131,11 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (channelId.equals(CHANNEL_COMMAND)) { return (command == Commands.CLOSE ? OpenClosedType.CLOSED : OpenClosedType.OPEN); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessage.java index 5c406d1182777..36e1b9bb2efd6 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,11 +21,12 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for Date and Time message. * - * @author Damien Servant + * @author Damien Servant - Initial contribution */ public class RFXComDateTimeMessage extends RFXComBatteryDeviceMessage<RFXComDateTimeMessage.SubType> { @@ -121,16 +122,16 @@ public byte[] decodeMessage() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (channelId.equals(CHANNEL_DATE_TIME)) { return new DateTimeType(dateTime); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessage.java index 93b84a4ca050e..3a2c4e97691af 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,30 +19,33 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * An interface for message about devices, so interface message do not (have to) implement this * - * @author Martin van Wingerden - Simplify some code in the RFXCOM binding + * @author Martin van Wingerden - Initial contribution */ public interface RFXComDeviceMessage<T> extends RFXComMessage { /** * Procedure for converting RFXCOM value to openHAB command. * - * @param channelId id of the channel + * @param channelId id of the channel + * @param deviceState * @return openHAB command. * @throws RFXComUnsupportedChannelException if the channel is not supported */ - Command convertToCommand(String channelId) throws RFXComUnsupportedChannelException; + Command convertToCommand(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException; /** * Procedure for converting RFXCOM value to openHAB state. * - * @param channelId id of the channel + * @param channelId id of the channel + * @param deviceState * @return openHAB state. * @throws RFXComUnsupportedChannelException if the channel is not supported */ - State convertToState(String channelId) throws RFXComUnsupportedChannelException; + State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException; /** * Procedure to get device id. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessageImpl.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessageImpl.java index 0695b8f971f75..5a96cd39f189d 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessageImpl.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComDeviceMessageImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,11 +21,12 @@ import org.openhab.binding.rfxcom.internal.config.RFXComDeviceConfiguration; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * A base class for all device messages, so this is not about things as interface messages * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ abstract class RFXComDeviceMessageImpl<T> extends RFXComBaseMessage implements RFXComDeviceMessage<T> { byte signalLevel; @@ -45,12 +46,13 @@ public void setConfig(RFXComDeviceConfiguration config) throws RFXComException { } @Override - public Command convertToCommand(String channelId) throws RFXComUnsupportedChannelException { - return (Command) convertToState(channelId); + public Command convertToCommand(String channelId, DeviceState deviceState) + throws RFXComUnsupportedChannelException { + return (Command) convertToState(channelId, deviceState); } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_SIGNAL_LEVEL: return convertSignalLevelToSystemWideLevel(signalLevel); diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java index 640f4097a1828..00277fd03f4c6 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for energy message. @@ -144,7 +145,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_INSTANT_POWER: return new DecimalType(instantPower); @@ -159,7 +160,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(totalAmpHour); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessage.java index 3e4a61fc6cba6..37ca1bb061427 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,23 +12,26 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.ByteEnumUtil.fromByte; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.Commands.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.*; + +import java.util.Arrays; +import java.util.List; + import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.Type; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; - -import java.util.Arrays; -import java.util.List; - -import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; -import static org.openhab.binding.rfxcom.internal.messages.ByteEnumUtil.fromByte; -import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.*; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for fan message. @@ -47,7 +50,7 @@ public enum SubType implements ByteEnumWrapper { CASAFAN(6), FT1211R(7), FALMEC(8), - LUCCI_AIR_DCII(9); + LUCCI_AIR_DC_II(9); private final int subType; @@ -90,7 +93,25 @@ public enum Commands implements ByteEnumWrapperWithSupportedSubTypes<SubType> { FT1211R_FORWARD_REVERSE(8, FT1211R), FT1211R_TIMER_1H(9, FT1211R), FT1211R_TIMER_4H(10, FT1211R), - FT1211R_TIMER_8H(11, FT1211R); + FT1211R_TIMER_8H(11, FT1211R), + + LUCCI_AIR_DC_POWER(1, LUCCI_AIR_DC), + LUCCI_AIR_DC_UP(2, LUCCI_AIR_DC), + LUCCI_AIR_DC_DOWN(3, LUCCI_AIR_DC), + LUCCI_AIR_DC_LIGHT(4, LUCCI_AIR_DC), + LUCCI_AIR_DC_REVERSE(5, LUCCI_AIR_DC), + LUCCI_AIR_DC_NATURAL_FLOW(6, LUCCI_AIR_DC), + LUCCI_AIR_DC_PAIR(7, LUCCI_AIR_DC), + + LUCCI_AIR_DC_II_POWER_OFF(1, 0, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_1(2, 1, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_2(3, 2, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_3(4, 3, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_4(5, 4, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_5(6, 5, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_SPEED_6(7, 6, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_LIGHT(8, LUCCI_AIR_DC_II), + LUCCI_AIR_DC_II_REVERSE(9, LUCCI_AIR_DC_II); private final int command; private final Integer speed; @@ -133,16 +154,17 @@ public List<SubType> supportedBySubTypes() { private static final List<SubType> GENERIC_SUB_TYPES = Arrays.asList(WESTINGHOUSE_7226640, CASAFAN, LUCCI_AIR_FAN); - private static final List<Commands> LIGHT_ON_COMMANDS = Arrays.asList(Commands.LIGHT, Commands.FALMEC_LIGHT_ON); - private static final List<Commands> ON_COMMANDS = Arrays.asList(Commands.HI, Commands.MED, Commands.LOW, - Commands.FALMEC_SPEED_1, Commands.FALMEC_SPEED_2, Commands.FALMEC_SPEED_3, Commands.FALMEC_SPEED_4); - private static final List<Commands> OFF_COMMANDS = Arrays.asList(Commands.OFF, Commands.FALMEC_POWER_OFF); + private static final List<Commands> LIGHT_ON_COMMANDS = Arrays.asList(LIGHT, LUCCI_AIR_DC_LIGHT, + LUCCI_AIR_DC_II_LIGHT, FALMEC_LIGHT_ON); + private static final List<Commands> ON_COMMANDS = Arrays.asList(Commands.HI, MED, LOW, FALMEC_SPEED_1, + FALMEC_SPEED_2, FALMEC_SPEED_3, FALMEC_SPEED_4, LUCCI_AIR_DC_II_SPEED_1, LUCCI_AIR_DC_II_SPEED_2, + LUCCI_AIR_DC_II_SPEED_3, LUCCI_AIR_DC_II_SPEED_4, LUCCI_AIR_DC_II_SPEED_5, LUCCI_AIR_DC_II_SPEED_6); + private static final List<Commands> OFF_COMMANDS = Arrays.asList(OFF, FALMEC_POWER_OFF, LUCCI_AIR_DC_II_POWER_OFF); private SubType subType; private int sensorId; private Commands command; - public RFXComFanMessage() { super(PacketType.FAN); } @@ -170,8 +192,8 @@ public PacketType getPacketType() { return PacketType.FAN_FT1211R; case FALMEC: return PacketType.FAN_FALMEC; - case LUCCI_AIR_DCII: - return PacketType.FAN_LUCCI_DCII; + case LUCCI_AIR_DC_II: + return PacketType.FAN_LUCCI_DC_II; } return super.getPacketType(); } @@ -218,7 +240,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { sensorId = Integer.parseInt(deviceId); } @@ -228,7 +250,7 @@ public SubType convertSubType(String subType) throws RFXComUnsupportedValueExcep } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_FAN_LIGHT: return handleLightChannel(); @@ -239,9 +261,19 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc case CHANNEL_COMMAND: return handleCommandChannel(); + case CHANNEL_COMMAND_STRING: + return handleCommandStringChannel(); + default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); + } + } + + private State handleCommandStringChannel() { + if (command == null) { + return UnDefType.UNDEF; } + return StringType.valueOf(command.toString().replace(subType.name() + "_", "")); } private State handleLightChannel() { @@ -273,8 +305,21 @@ private State handleFanSpeedChannel() { case FT1211R_SPEED_3: case FT1211R_SPEED_4: case FT1211R_SPEED_5: + case LUCCI_AIR_DC_II_POWER_OFF: + case LUCCI_AIR_DC_II_SPEED_1: + case LUCCI_AIR_DC_II_SPEED_2: + case LUCCI_AIR_DC_II_SPEED_3: + case LUCCI_AIR_DC_II_SPEED_4: + case LUCCI_AIR_DC_II_SPEED_5: + case LUCCI_AIR_DC_II_SPEED_6: return new DecimalType(command.getSpeed()); + case LUCCI_AIR_DC_DOWN: + return UpDownType.DOWN; + + case LUCCI_AIR_DC_UP: + return UpDownType.UP; + default: return null; } @@ -305,17 +350,47 @@ public void convertFromState(String channelId, Type type) throws RFXComUnsupport command = handleFanLightCommand(channelId, type); break; + case CHANNEL_COMMAND_STRING: + command = handleCommandString(channelId, type); + break; + default: throw new RFXComUnsupportedChannelException("Channel " + channelId + " is not relevant here"); } } + private Commands handleCommandString(String channelId, Type type) throws RFXComUnsupportedChannelException { + if (type instanceof StringType) { + String stringCommand = type.toString(); + switch (stringCommand) { + case "POWER": + case "POWER_OFF": + case "UP": + case "DOWN": + case "LIGHT": + case "REVERSE": + case "NATURAL_FLOW": + case "PAIR": + case "SPEED_1": + case "SPEED_2": + case "SPEED_3": + case "SPEED_4": + case "SPEED_5": + case "SPEED_6": + return Commands.valueOf(subType.name() + "_" + stringCommand); + } + } + throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + type); + } + private Commands handleCommand(String channelId, Type type) throws RFXComUnsupportedChannelException { if (type instanceof OnOffType) { if (GENERIC_SUB_TYPES.contains(subType)) { return (type == OnOffType.ON ? Commands.MED : Commands.OFF); } else if (subType == FALMEC) { return (type == OnOffType.ON ? Commands.FALMEC_SPEED_2 : Commands.FALMEC_POWER_OFF); + } else if (subType == LUCCI_AIR_DC_II) { + return (type == OnOffType.ON ? LUCCI_AIR_DC_II_SPEED_3 : LUCCI_AIR_DC_II_POWER_OFF); } } throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + type); @@ -336,6 +411,12 @@ private Commands handleFanSpeedCommand(String channelId, Type type) throws RFXCo if (speedCommand != null) { return speedCommand; } + } else if (type instanceof UpDownType && subType == LUCCI_AIR_DC) { + if (UpDownType.UP == type) { + return Commands.LUCCI_AIR_DC_UP; + } else { + return Commands.LUCCI_AIR_DC_DOWN; + } } throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + type); } @@ -346,14 +427,18 @@ private Commands handleFanLightCommand(String channelId, Type type) throws RFXCo case LUCCI_AIR_FAN: case CASAFAN: case WESTINGHOUSE_7226640: - return Commands.LIGHT; + case LUCCI_AIR_DC: + return LIGHT; case FALMEC: - return Commands.FALMEC_LIGHT_ON; + return FALMEC_LIGHT_ON; + + case LUCCI_AIR_DC_II: + return LUCCI_AIR_DC_II_LIGHT; } } else if (type == OnOffType.OFF && subType == FALMEC) { return Commands.FALMEC_LIGHT_OFF; } throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + type); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortMessage.java index ece2ebfd3dac8..c7f68f7a1b6d7 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for HomeConfort message. @@ -124,11 +125,11 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { if (channelId.equals(CHANNEL_COMMAND)) { return (command == Commands.OFF || command == Commands.GROUP_OFF ? OnOffType.OFF : OnOffType.ON); } else { - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessage.java index 9ac44182fcb3d..7b4b96cfb7c2d 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for humidity message. @@ -128,7 +129,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_HUMIDITY: return new DecimalType(humidity); @@ -137,7 +138,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new StringType(humidityStatus.toString()); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -147,12 +148,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java index 6c15a82bf87fd..66d5993074a66 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,13 +14,12 @@ import org.eclipse.smarthome.core.types.Type; import org.openhab.binding.rfxcom.internal.config.RFXComBridgeConfiguration; -import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; /** * RFXCOM data class for control message. * - * @author Mike Jagdis * @author Pauli Anttila - Initial contribution + * @author Mike Jagdis */ public class RFXComInterfaceControlMessage extends RFXComBaseMessage { private byte[] data = new byte[14]; @@ -35,49 +34,48 @@ public RFXComInterfaceControlMessage(RFXComInterfaceMessage.TransceiverType tran data[5] = transceiverType.toByte(); data[6] = (byte) (configuration.transmitPower + 18); - data[7] = (byte)( - (configuration.enableUndecoded ? 0x80 : 0x00) - | (configuration.enableImagintronixOpus ? 0x40 : 0x00) - | (configuration.enableByronSX ? 0x20 : 0x00) - | (configuration.enableRSL ? 0x10 : 0x00) - | (configuration.enableLighting4 ? 0x08 : 0x00) - | (configuration.enableFineOffsetViking ? 0x04 : 0x00) - | (configuration.enableRubicson ? 0x02 : 0x00) - | (configuration.enableAEBlyss ? 0x01 : 0x00) - ); + //@formatter:off + data[7] = (byte) ( + (configuration.enableUndecoded ? 0x80 : 0x00) + | (configuration.enableImagintronixOpus ? 0x40 : 0x00) + | (configuration.enableByronSX ? 0x20 : 0x00) + | (configuration.enableRSL ? 0x10 : 0x00) + | (configuration.enableLighting4 ? 0x08 : 0x00) + | (configuration.enableFineOffsetViking ? 0x04 : 0x00) + | (configuration.enableRubicson ? 0x02 : 0x00) + | (configuration.enableAEBlyss ? 0x01 : 0x00)); + + data[8] = (byte) ( + (configuration.enableBlindsT1T2T3T4 ? 0x80 : 0x00) + | (configuration.enableBlindsT0 ? 0x40 : 0x00) + | (configuration.enableProGuard ? 0x20 : 0x00) + | (configuration.enableFS20 ? 0x10 : 0x00) + | (configuration.enableLaCrosse ? 0x08 : 0x00) + | (configuration.enableHidekiUPM ? 0x04 : 0x00) + | (configuration.enableADLightwaveRF ? 0x02 : 0x00) + | (configuration.enableMertik ? 0x01 : 0x00)); - data[8] = (byte)( - (configuration.enableBlindsT1T2T3T4 ? 0x80 : 0x00) - | (configuration.enableBlindsT0 ? 0x40 : 0x00) - | (configuration.enableProGuard ? 0x20 : 0x00) - | (configuration.enableFS20 ? 0x10 : 0x00) - | (configuration.enableLaCrosse ? 0x08 : 0x00) - | (configuration.enableHidekiUPM ? 0x04 : 0x00) - | (configuration.enableADLightwaveRF ? 0x02 : 0x00) - | (configuration.enableMertik ? 0x01 : 0x00) - ); + data[9] = (byte) ( + (configuration.enableVisonic ? 0x80 : 0x00) + | (configuration.enableATI ? 0x40 : 0x00) + | (configuration.enableOregonScientific ? 0x20 : 0x00) + | (configuration.enableMeiantech ? 0x10 : 0x00) + | (configuration.enableHomeEasyEU ? 0x08 : 0x00) + | (configuration.enableAC ? 0x04 : 0x00) + | (configuration.enableARC ? 0x02 : 0x00) + | (configuration.enableX10 ? 0x01 : 0x00)); - data[9] = (byte)( - (configuration.enableVisonic ? 0x80 : 0x00) - | (configuration.enableATI ? 0x40 : 0x00) - | (configuration.enableOregonScientific ? 0x20 : 0x00) - | (configuration.enableMeiantech ? 0x10 : 0x00) - | (configuration.enableHomeEasyEU ? 0x08 : 0x00) - | (configuration.enableAC ? 0x04 : 0x00) - | (configuration.enableARC ? 0x02 : 0x00) - | (configuration.enableX10 ? 0x01 : 0x00) - ); + data[10] = (byte) ( + (configuration.enableHomeConfort ? 0x02 : 0x00) + | (configuration.enableKEELOQ ? 0x01 : 0x00)); - data[10] = (byte)( - (configuration.enableHomeConfort ? 0x02 : 0x00) - | (configuration.enableKEELOQ ? 0x01 : 0x00) - ); data[11] = 0; data[12] = 0; data[13] = 0; + //@formatter:on } - public RFXComInterfaceControlMessage(byte[] data) throws RFXComException { + public RFXComInterfaceControlMessage(byte[] data) { // We should never receive control messages throw new UnsupportedOperationException(); } @@ -88,7 +86,7 @@ public byte[] decodeMessage() { } @Override - public void encodeMessage(byte[] data) throws RFXComException { + public void encodeMessage(byte[] data) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessage.java index 37d290d3b8a64..dc6291edc516d 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,7 +14,7 @@ import static org.openhab.binding.rfxcom.internal.messages.ByteEnumUtil.fromByte; -import java.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import org.eclipse.smarthome.core.types.Type; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -174,7 +174,6 @@ public String toString() { str += ", Command = " + command; if (subType == SubType.RESPONSE) { - str += ", Transceiver type = " + transceiverType; str += ", Hardware version = " + hardwareVersion1 + "." + hardwareVersion2; str += ", Firmware type = " + (firmwareType != null ? firmwareType : "unknown"); @@ -218,7 +217,6 @@ public String toString() { @Override public void encodeMessage(byte[] data) throws RFXComException { - super.encodeMessage(data); subType = fromByte(SubType.class, super.subType); @@ -280,7 +278,6 @@ public void encodeMessage(byte[] data) throws RFXComException { } text = ""; - } else if (subType == SubType.START_RECEIVER) { command = fromByte(Commands.class, data[4]); @@ -293,11 +290,7 @@ public void encodeMessage(byte[] data) throws RFXComException { byteArray[i - dataOffset] += data[i]; } - try { - text = new String(byteArray, "ASCII"); - } catch (UnsupportedEncodingException e) { - // ignore - } + text = new String(byteArray, StandardCharsets.US_ASCII); } else { // We don't handle the other subTypes but to avoid null pointer // exceptions we set command to something. It doesn't really @@ -307,7 +300,7 @@ public void encodeMessage(byte[] data) throws RFXComException { } @Override - public byte[] decodeMessage() throws RFXComException { + public byte[] decodeMessage() { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java index b0d284d47aaa9..1b7bc24ee22a6 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,6 +25,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for lighting1 message. See X10, ARC, etc.. @@ -125,11 +126,11 @@ public void encodeMessage(byte[] data) throws RFXComException { // the message unless the last X<n> ON they saw was for them. So we // redirect an incoming broadcast DIM/BRIGHT to the correct item // based on the last X<n> we saw or sent. - unitCode = lastUnit[(int)houseCode - (int)'A']; + unitCode = lastUnit[(int) houseCode - (int) 'A']; } else { unitCode = data[5]; if (command == Commands.ON) { - lastUnit[(int)houseCode - (int)'A'] = unitCode; + lastUnit[(int) houseCode - (int) 'A'] = unitCode; } } @@ -148,18 +149,7 @@ public byte[] decodeMessage() { data[2] = subType.toByte(); data[3] = seqNbr; data[4] = (byte) houseCode; - // When an SS13 sends a DIM/BRIGHT it broadcasts to the all-units code (X0) - // and it is up to the dimmers to ignore the message if the last X<n> they - // saw wasn't for them. Sending to an actual X<n> may or may not work. - // It is untested against _any_ dimmer never mind all so we stick to doing - // the same as an SS13. At least for now. Using an explicit X<n> would be - // better (if it works) because X10 RF and PLM are lossy and different - // modules may have seen different traffic. - if ((command == Commands.DIM) || (command == Commands.BRIGHT)) { - data[5] = 0; - } else { - data[5] = unitCode; - } + data[5] = unitCode; data[6] = command.toByte(); data[7] = (byte) ((signalLevel & 0x0F) << 4); @@ -172,7 +162,8 @@ public String getDeviceId() { } @Override - public Command convertToCommand(String channelId) throws RFXComUnsupportedChannelException { + public Command convertToCommand(String channelId, DeviceState deviceState) + throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: switch (command) { @@ -194,15 +185,16 @@ public Command convertToCommand(String channelId) throws RFXComUnsupportedChanne return OnOffType.ON; default: - throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + command); + throw new RFXComUnsupportedChannelException( + "Channel " + channelId + " does not accept " + command); } default: - return super.convertToCommand(channelId); + return super.convertToCommand(channelId, deviceState); } } - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: switch (command) { @@ -218,7 +210,8 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return OnOffType.ON; default: - throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + command); + throw new RFXComUnsupportedChannelException( + "Channel " + channelId + " does not accept " + command); } case CHANNEL_COMMAND_STRING: @@ -238,7 +231,8 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return OpenClosedType.OPEN; default: - throw new RFXComUnsupportedChannelException("Channel " + channelId + " does not accept " + command); + throw new RFXComUnsupportedChannelException( + "Channel " + channelId + " does not accept " + command); } default: diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2Message.java index 0ddfcb9b8c0e4..8b4210f81f804 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -28,6 +28,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for lighting2 message. @@ -35,7 +36,6 @@ * @author Pauli Anttila - Initial contribution */ public class RFXComLighting2Message extends RFXComDeviceMessageImpl<RFXComLighting2Message.SubType> { - public enum SubType implements ByteEnumWrapper { AC(0), HOME_EASY_EU(1), @@ -123,7 +123,6 @@ public void encodeMessage(byte[] data) throws RFXComException { @Override public byte[] decodeMessage() { - byte[] data = new byte[12]; data[0] = 0x0B; @@ -151,8 +150,7 @@ public String getDeviceId() { /** * Convert a 0-15 scale value to a percent type. * - * @param pt - * percent type to convert + * @param pt percent type to convert * @return converted value 0-15 */ public static int getDimLevelFromPercentType(PercentType pt) { @@ -163,8 +161,7 @@ public static int getDimLevelFromPercentType(PercentType pt) { /** * Convert a 0-15 scale value to a percent type. * - * @param value - * percent type to convert + * @param value percent type to convert * @return converted value 0-15 */ public static PercentType getPercentTypeFromDimLevel(int value) { @@ -175,8 +172,7 @@ public static PercentType getPercentTypeFromDimLevel(int value) { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_DIMMING_LEVEL: return RFXComLighting2Message.getPercentTypeFromDimLevel(dimmingLevel); @@ -214,7 +210,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc } default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -225,7 +221,6 @@ public void setSubType(SubType subType) { @Override public void setDeviceId(String deviceId) throws RFXComException { - String[] ids = deviceId.split("\\" + ID_DELIMITER); if (ids.length != 2) { throw new RFXComException("Invalid device id '" + deviceId + "'"); @@ -243,7 +238,6 @@ public void setDeviceId(String deviceId) throws RFXComException { @Override public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { - switch (channelId) { case CHANNEL_COMMAND: if (type instanceof OnOffType) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java index 60c8e8bb4e9d4..2a719052cdc37 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,6 +26,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +54,7 @@ * (ReceiveCommand ON/OFF Command ) * * @author Alessandro Ballini (ITA) - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated to OH2 * @author Martin van Wingerden - Extended support for more complex PT2262 devices */ public class RFXComLighting4Message extends RFXComDeviceMessageImpl<RFXComLighting4Message.SubType> { @@ -175,7 +176,6 @@ public void encodeMessage(byte[] data) throws RFXComException { @Override public byte[] decodeMessage() { - byte[] data = new byte[10]; data[0] = 0x09; @@ -204,8 +204,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: case CHANNEL_MOTION: @@ -218,7 +217,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(commandId); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -228,7 +227,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { sensorId = Integer.parseInt(deviceId); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java index a778081e912cd..9351c6b87b2bb 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -32,6 +32,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for lighting5 message. @@ -175,7 +176,6 @@ public void encodeMessage(byte[] data) throws RFXComException { @Override public byte[] decodeMessage() { - byte[] data = new byte[11]; data[0] = 0x0A; @@ -202,8 +202,7 @@ public String getDeviceId() { /** * Convert a 0-31 scale value to a percent type. * - * @param pt - * percent type to convert + * @param pt percent type to convert * @return converted value 0-31 */ public static int getDimLevelFromPercentType(PercentType pt) { @@ -214,8 +213,7 @@ public static int getDimLevelFromPercentType(PercentType pt) { /** * Convert a 0-31 scale value to a percent type. * - * @param value - * percent type to convert + * @param value percent type to convert * @return converted value 0-31 */ public static PercentType getPercentTypeFromDimLevel(int value) { @@ -226,8 +224,7 @@ public static PercentType getPercentTypeFromDimLevel(int value) { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_MOOD: switch (command) { @@ -285,7 +282,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc } default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -307,7 +304,6 @@ public void setDeviceId(String deviceId) throws RFXComException { @Override public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { - switch (channelId) { case CHANNEL_COMMAND: if (type instanceof OnOffType) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6Message.java index d6de9d285cde4..55d00b3de7c4d 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,12 +22,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for lighting6 message. See Blyss. * * @author Damien Servant - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated for OH2 */ public class RFXComLighting6Message extends RFXComDeviceMessageImpl<RFXComLighting6Message.SubType> { @@ -133,8 +134,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: switch (command) { @@ -165,7 +165,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc } default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -188,7 +188,6 @@ public void setDeviceId(String deviceId) throws RFXComException { @Override public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { - switch (channelId) { case CHANNEL_COMMAND: if (type instanceof OnOffType) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessage.java index 727875d7b030f..68b33320c49f1 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,8 +27,7 @@ public interface RFXComMessage { /** * Procedure for encode raw data. * - * @param data - * Raw data. + * @param data Raw data. */ void encodeMessage(byte[] data) throws RFXComException; @@ -41,7 +40,6 @@ public interface RFXComMessage { /** * Procedure for converting openHAB state to RFXCOM object. - * */ void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException; diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessageFactory.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessageFactory.java index 5222ad384c5f1..4f7233a6d1af9 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessageFactory.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComMessageFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,10 +47,10 @@ public class RFXComMessageFactory { // put(PacketType.FAN_SF01, RFXComFanMessage.class); // put(PacketType.FAN_ITHO, RFXComFanMessage.class); // put(PacketType.FAN_SEAV, RFXComFanMessage.class); - // put(PacketType.FAN_LUCCI_DC, RFXComFanMessage.class); + put(PacketType.FAN_LUCCI_DC, RFXComFanMessage.class); // put(PacketType.FAN_FT1211R, RFXComFanMessage.class); put(PacketType.FAN_FALMEC, RFXComFanMessage.class); - // put(PacketType.FAN_LUCCI_DCII, RFXComFanMessage.class); + put(PacketType.FAN_LUCCI_DC_II, RFXComFanMessage.class); put(PacketType.CURTAIN1, RFXComCurtain1Message.class); put(PacketType.BLINDS1, RFXComBlinds1Message.class); put(PacketType.RFY, RFXComRfyMessage.class); @@ -81,7 +81,7 @@ public class RFXComMessageFactory { // put(PacketType.WEIGHT, RFXComWeightMessage.class); // put(PacketType.GAS, RFXComGasMessage.class); // put(PacketType.WATER, RFXComWaterMessage.class); - // put(PacketType.RFXSENSOR, RFXComRFXSensorMessage.class); + put(PacketType.RFXSENSOR, RFXComRFXSensorMessage.class); // put(PacketType.RFXMETER, RFXComRFXMeterMessage.class); // put(PacketType.FS20, RFXComFS20Message.class); // put(PacketType.IO_LINES, RFXComIOLinesMessage.class); @@ -117,7 +117,6 @@ public class RFXComMessageFactory { 0x00, 0x00, 0x00, 0x00, 0x00 }; public static RFXComMessage createMessage(PacketType packetType) throws RFXComException { - try { Class<? extends RFXComMessage> cl = MESSAGE_CLASSES.get(packetType); if (cl == null) { @@ -130,7 +129,7 @@ public static RFXComMessage createMessage(PacketType packetType) throws RFXComEx } public static RFXComMessage createMessage(byte[] packet) throws RFXComException { - PacketType packetType = ByteEnumUtil.fromByte(PacketType.class, (int) packet[1]); + PacketType packetType = ByteEnumUtil.fromByte(PacketType.class, packet[1]); try { Class<? extends RFXComMessage> cl = MESSAGE_CLASSES.get(packetType); @@ -151,7 +150,6 @@ public static RFXComMessage createMessage(byte[] packet) throws RFXComException } public static PacketType convertPacketType(String packetType) throws IllegalArgumentException { - for (PacketType p : PacketType.values()) { if (p.toString().replace("_", "").equals(packetType.replace("_", ""))) { return p; diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessage.java new file mode 100644 index 0000000000000..2959426b09517 --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessage.java @@ -0,0 +1,295 @@ +/** + * 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.rfxcom.internal.messages; + +import static java.math.BigDecimal.*; +import static java.math.RoundingMode.HALF_DOWN; +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.ByteEnumUtil.fromByte; + +import java.math.BigDecimal; + +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.Type; +import org.eclipse.smarthome.core.types.UnDefType; +import org.eclipse.smarthome.core.util.HexUtils; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Add support for the rfx-sensor + * + * @author Martin van Wingerden - Initial contribution + */ +public class RFXComRFXSensorMessage extends RFXComDeviceMessageImpl<RFXComRFXSensorMessage.SubType> { + private final Logger logger = LoggerFactory.getLogger(RFXComRFXSensorMessage.class); + + private static final BigDecimal PRESSURE_ADDITION = new BigDecimal("0.095"); + private static final BigDecimal PRESSURE_DIVIDER = new BigDecimal("0.0009"); + + private static final BigDecimal HUMIDITY_VOLTAGE_SUBTRACTION = new BigDecimal("0.16"); + private static final BigDecimal HUMIDITY_VOLTAGE_DIVIDER = new BigDecimal("0.0062"); + private static final BigDecimal HUMIDITY_TEMPERATURE_CORRECTION = new BigDecimal("1.0546"); + private static final BigDecimal HUMIDITY_TEMPERATURE_MULTIPLIER = new BigDecimal("0.00216"); + + private static final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100); + + public enum SubType implements ByteEnumWrapper { + TEMPERATURE(0), + A_D(1), + VOLTAGE(2), + MESSAGE(3); + + private final int subType; + + SubType(int subType) { + this.subType = subType; + } + + @Override + public byte toByte() { + return (byte) subType; + } + } + + public SubType subType; + + public int sensorId; + private Double temperature; + private BigDecimal miliVoltageTimesTen; + public byte signalLevel; + + public RFXComRFXSensorMessage() { + super(PacketType.RFXSENSOR); + } + + public RFXComRFXSensorMessage(byte[] data) throws RFXComException { + encodeMessage(data); + } + + @Override + public String toString() { + String str = super.toString(); + + str += ", Sub type = " + subType; + str += ", Device Id = " + getDeviceId(); + str += ", Temperature = " + temperature; + str += ", Voltage = " + getVoltage(); + str += ", Signal level = " + signalLevel; + + return str; + } + + @Override + public void encodeMessage(byte[] data) throws RFXComException { + super.encodeMessage(data); + + subType = fromByte(SubType.class, super.subType); + + sensorId = (data[4] & 0xFF); + + byte msg1 = data[5]; + byte msg2 = data[6]; + + switch (subType) { + case TEMPERATURE: + encodeTemperatureMessage(msg1, msg2); + break; + case A_D: + case VOLTAGE: + encodeVoltageMessage(msg1, msg2); + break; + case MESSAGE: + encodeStatusMessage(msg2); + break; + } + + signalLevel = (byte) ((data[7] & 0xF0) >> 4); + } + + private void encodeTemperatureMessage(byte msg1, byte msg2) { + temperature = (short) ((msg1 & 0x7F) << 8 | (msg2 & 0xFF)) * 0.01; + if ((msg1 & 0x80) != 0) { + temperature = -temperature; + } + } + + private void encodeVoltageMessage(byte msg1, byte msg2) { + miliVoltageTimesTen = BigDecimal.valueOf((short) ((msg1 & 0xFF) << 8 | (msg2 & 0xFF))); + } + + private void encodeStatusMessage(byte msg2) { + // noop + } + + @Override + public byte[] decodeMessage() { + byte[] data = new byte[8]; + + data[0] = 0x07; + data[1] = PacketType.RFXSENSOR.toByte(); + data[2] = subType.toByte(); + data[3] = seqNbr; + data[4] = (byte) (sensorId & 0x00FF); + + if (subType == SubType.TEMPERATURE) { + decodeTemperatureMessage(data); + } else if (subType == SubType.A_D) { + decodeVoltageMessage(data); + } else if (subType == SubType.VOLTAGE) { + decodeVoltageMessage(data); + } else if (subType == SubType.MESSAGE) { + decodeStatusMessage(data); + } + + data[7] = (byte) ((signalLevel & 0x0F) << 4); + + return data; + } + + @Override + public void convertFromState(String channelId, Type type) { + throw new UnsupportedOperationException(); + } + + private void decodeTemperatureMessage(byte[] data) { + short temp = (short) Math.abs(temperature * 100); + data[5] = (byte) ((temp >> 8) & 0xFF); + data[6] = (byte) (temp & 0xFF); + if (temperature < 0) { + data[5] |= 0x80; + } + } + + private void decodeVoltageMessage(byte[] data) { + short miliVoltageTimesTenShort = this.miliVoltageTimesTen.shortValueExact(); + data[5] = (byte) ((miliVoltageTimesTenShort >> 8) & 0xFF); + data[6] = (byte) (miliVoltageTimesTenShort & 0xFF); + + } + + private void decodeStatusMessage(byte[] data) { + logger.info("A status message was received {}", HexUtils.bytesToHex(data)); + } + + @Override + public String getDeviceId() { + return String.valueOf(sensorId); + } + + @Override + public SubType convertSubType(String subType) throws RFXComUnsupportedValueException { + return ByteEnumUtil.convertSubType(SubType.class, subType); + } + + @Override + public void setSubType(SubType subType) { + throw new UnsupportedOperationException(); + } + + @Override + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { + switch (channelId) { + case CHANNEL_TEMPERATURE: + return subType == SubType.TEMPERATURE ? getTemperature() : null; + + case CHANNEL_VOLTAGE: + return subType == SubType.A_D ? handleVoltage() : null; + + case CHANNEL_REFERENCE_VOLTAGE: + return subType == SubType.VOLTAGE ? handleVoltage() : null; + + case CHANNEL_HUMIDITY: + return subType == SubType.A_D ? handleHumidity(deviceState) : null; + + case CHANNEL_PRESSURE: + return subType == SubType.A_D ? handlePressure(deviceState) : null; + + default: + return super.convertToState(channelId, deviceState); + } + } + + private State getTemperature() { + if (temperature != null) { + return new DecimalType(temperature); + } else { + return UnDefType.UNDEF; + } + } + + private State handleVoltage() { + if (miliVoltageTimesTen != null) { + return new DecimalType(getVoltage()); + } else { + return UnDefType.UNDEF; + } + } + + private State handleHumidity(DeviceState deviceState) { + DecimalType temperatureState = (DecimalType) deviceState.getLastState(CHANNEL_TEMPERATURE); + Type referenceVoltageState = deviceState.getLastState(CHANNEL_REFERENCE_VOLTAGE); + BigDecimal adVoltage = getVoltage(); + + if (temperatureState == null || referenceVoltageState == null || adVoltage == null) { + return null; + } + + if (!(referenceVoltageState instanceof DecimalType)) { + return UnDefType.UNDEF; + } + + BigDecimal temperature = temperatureState.toBigDecimal(); + BigDecimal supplyVoltage = ((DecimalType) referenceVoltageState).toBigDecimal(); + + // RH = (((A/D voltage / supply voltage) - 0.16) / 0.0062) / (1.0546 - 0.00216 * temperature) + BigDecimal belowTheDivider = adVoltage.divide(supplyVoltage, 4, ROUND_HALF_DOWN) + .subtract(HUMIDITY_VOLTAGE_SUBTRACTION).divide(HUMIDITY_VOLTAGE_DIVIDER, 4, ROUND_HALF_DOWN); + BigDecimal underTheDivider = HUMIDITY_TEMPERATURE_CORRECTION + .subtract(HUMIDITY_TEMPERATURE_MULTIPLIER.multiply(temperature)); + + return new DecimalType(belowTheDivider.divide(underTheDivider, 4, ROUND_HALF_DOWN)); + } + + private State handlePressure(DeviceState deviceState) { + DecimalType referenceVoltageState = (DecimalType) deviceState.getLastState(CHANNEL_REFERENCE_VOLTAGE); + BigDecimal adVoltage = getVoltage(); + + if (referenceVoltageState == null || adVoltage == null) { + return null; + } + + BigDecimal supplyVoltage = referenceVoltageState.toBigDecimal(); + + // hPa = ((A/D voltage / supply voltage) + 0.095) / 0.0009 + return new DecimalType((adVoltage.divide(supplyVoltage, 4, HALF_DOWN).add(PRESSURE_ADDITION)) + .divide(PRESSURE_DIVIDER, 4, ROUND_HALF_DOWN)); + } + + private BigDecimal getVoltage() { + if (miliVoltageTimesTen == null) { + return null; + } + return miliVoltageTimesTen.divide(ONE_HUNDRED, 100, ROUND_CEILING); + } + + @Override + public void setDeviceId(String deviceId) throws RFXComException { + throw new RFXComException("Not supported"); + } +} diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessage.java index 0ab9d002bb378..18d0e4af0f93b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,12 +21,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for temperature and humidity message. * * @author Marc SAUVEUR - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated for OH2 */ public class RFXComRainMessage extends RFXComBatteryDeviceMessage<RFXComRainMessage.SubType> { @@ -132,8 +133,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_RAIN_RATE: return new DecimalType(rainRate); @@ -142,7 +142,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(rainTotal); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -152,12 +152,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessage.java index 3be590aefcbac..11aafafbffa34 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,6 +25,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for RFY (Somfy RTS) message. @@ -133,14 +134,13 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: return (command == Commands.DOWN ? OpenClosedType.CLOSED : OpenClosedType.OPEN); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -162,7 +162,6 @@ public void setDeviceId(String deviceId) throws RFXComException { @Override public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { - switch (channelId) { case CHANNEL_SHUTTER: if (type instanceof OpenClosedType) { @@ -180,9 +179,8 @@ public void convertFromState(String channelId, Type type) throws RFXComUnsupport break; case CHANNEL_PROGRAM: - if (type instanceof OnOffType && type == OnOffType.ON) { + if (type == OnOffType.ON) { this.command = Commands.PROGRAM; - } else { throw new RFXComUnsupportedChannelException("Can't convert " + type + " to Command"); } @@ -192,7 +190,6 @@ public void convertFromState(String channelId, Type type) throws RFXComUnsupport if (type instanceof OnOffType) { this.command = (type == OnOffType.ON ? Commands.ENABLE_SUN_WIND_DETECTOR : Commands.DISABLE_SUN_DETECTOR); - } else { throw new RFXComUnsupportedChannelException("Can't convert " + type + " to Command"); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java index 822896989a4a8..93428f583f2b9 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,6 +23,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for Security1 message. @@ -196,7 +197,6 @@ public String toString() { @Override public void encodeMessage(byte[] data) throws RFXComException { - super.encodeMessage(data); subType = fromByte(SubType.class, super.subType); @@ -212,7 +212,6 @@ public void encodeMessage(byte[] data) throws RFXComException { @Override public byte[] decodeMessage() { - byte[] data = new byte[9]; data[0] = 0x08; @@ -234,8 +233,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_MOTION: switch (status) { @@ -265,7 +263,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new StringType(status.toString()); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -275,13 +273,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { sensorId = Integer.parseInt(deviceId); } @Override public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { - switch (channelId) { case CHANNEL_COMMAND: if ((type instanceof OnOffType) && (subType == SubType.X10_SECURITY_REMOTE)) { diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2Message.java index de600a50c95d8..dfb6c1205ae53 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,6 +23,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for Security2 message. @@ -54,10 +55,10 @@ public byte toByte() { public int sensorId; public int buttonStatus; - private final int BUTTON_0_BIT = 0x02; - private final int BUTTON_1_BIT = 0x04; - private final int BUTTON_2_BIT = 0x08; - private final int BUTTON_3_BIT = 0x01; + private static final int BUTTON_0_BIT = 0x02; + private static final int BUTTON_1_BIT = 0x04; + private static final int BUTTON_2_BIT = 0x08; + private static final int BUTTON_3_BIT = 0x01; public RFXComSecurity2Message() { super(PacketType.SECURITY2); @@ -114,7 +115,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_CONTACT: return ((buttonStatus & BUTTON_0_BIT) == 0) ? OpenClosedType.CLOSED : OpenClosedType.OPEN; @@ -129,7 +130,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return ((buttonStatus & BUTTON_3_BIT) == 0) ? OpenClosedType.CLOSED : OpenClosedType.OPEN; default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -139,7 +140,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { sensorId = Integer.parseInt(deviceId); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessage.java index d8a351e6c2a02..3d813ef19964c 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,11 +22,12 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for temperature, humidity and barometric message. * - * @author Damien Servant + * @author Damien Servant - Initial contribution * @author Martin van Wingerden - ported to openHAB 2.0 */ public class RFXComTemperatureHumidityBarometricMessage @@ -177,7 +178,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_TEMPERATURE: return new DecimalType(temperature); @@ -195,12 +196,12 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new StringType(forecastStatus.toString()); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } @@ -215,7 +216,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessage.java index f3314e9f3023a..2cd06945f9335 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for temperature and humidity message. @@ -157,7 +158,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_TEMPERATURE: return new DecimalType(temperature); @@ -169,7 +170,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new StringType(humidityStatus.toString()); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -179,12 +180,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessage.java index 46b42df56de8c..ea19dad0e5432 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for temperature and humidity message. @@ -125,13 +126,13 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_TEMPERATURE: return new DecimalType(temperature); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -141,12 +142,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessage.java index 1f50d49d9fdda..087bdc4934cde 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,11 +21,12 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for Temperature and Rain message. * - * @author Damien Servant + * @author Damien Servant - Initial contribution * @author Martin van Wingerden - ported to openHAB 2.0 */ public class RFXComTemperatureRainMessage extends RFXComBatteryDeviceMessage<RFXComTemperatureRainMessage.SubType> { @@ -119,7 +120,7 @@ public byte[] decodeMessage() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_TEMPERATURE: return new DecimalType(temperature); @@ -128,12 +129,12 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(rainTotal); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } @@ -148,7 +149,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1Message.java index 9e6f1312f6356..a3a6f8c772fad 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,13 +23,14 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for thermostat1 message. * Digimax 210 Thermostat RF sensor operational * * @author Les Ashworth - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated for OH2 */ public class RFXComThermostat1Message extends RFXComDeviceMessageImpl<RFXComThermostat1Message.SubType> { @@ -154,8 +155,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { - + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_TEMPERATURE: return new DecimalType(temperature); @@ -174,7 +174,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc } default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -184,12 +184,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3Message.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3Message.java index 63323cf1abcc3..e58af6f20343b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3Message.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3Message.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,6 +30,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for thermostat3message. @@ -129,7 +130,7 @@ public void encodeMessage(byte[] data) throws RFXComException { subType = fromByte(SubType.class, super.subType); unitId = (data[4] & 0xFF) << 16 | (data[5] & 0xFF) << 8 | (data[6] & 0xFF); - command = fromByte(Commands.class, (int) data[7], subType); + command = fromByte(Commands.class, data[7], subType); signalLevel = (byte) ((data[8] & 0xF0) >> 4); } @@ -151,7 +152,7 @@ public byte[] decodeMessage() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_COMMAND: switch (command) { @@ -201,7 +202,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return command == null ? UnDefType.UNDEF : StringType.valueOf(command.toString()); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -256,7 +257,7 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { this.unitId = Integer.parseInt(deviceId); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessage.java index 99381f9c948fa..8749c5228fc36 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java index 5cd4df33c5df1..947bf9d30cf4e 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for UV and temperature message. @@ -63,13 +64,15 @@ public RFXComUVMessage(byte[] data) throws RFXComException { @Override public String toString() { + //@formatter:off return super.toString() - + ", Sub type = " + subType - + ", Device Id = " + getDeviceId() - + ", UV = " + uv - + ", Temperature = " + temperature - + ", Signal level = " + signalLevel - + ", Battery level = " + batteryLevel; + + ", Sub type = " + subType + + ", Device Id = " + getDeviceId() + + ", UV = " + uv + + ", Temperature = " + temperature + + ", Signal level = " + signalLevel + + ", Battery level = " + batteryLevel; + //@formatter:on } @Override @@ -122,7 +125,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_UV: return new DecimalType(uv); @@ -131,7 +134,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return (subType == SubType.UV3 ? new DecimalType(temperature) : UnDefType.UNDEF); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } @@ -141,12 +144,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessage.java index 1d69d6d6ff023..1b52a849faaa7 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,12 +25,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageTooLongException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for undecoded messages. * - * @author Ivan Martinez - * @author James Hewitt-Thomas + * @author Ivan Martinez - Initial contribution + * @author James Hewitt-Thomas - Migrated for OH2 */ public class RFXComUndecodedRFMessage extends RFXComDeviceMessageImpl<RFXComUndecodedRFMessage.SubType> { @@ -135,7 +136,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_RAW_MESSAGE: return new StringType(HexUtils.bytesToHex(rawMessage)); @@ -154,12 +155,12 @@ public void setSubType(SubType subType) { } @Override - public void setDeviceId(String deviceId) throws RFXComException { + public void setDeviceId(String deviceId) { throw new UnsupportedOperationException(); } @Override - public void convertFromState(String channelId, Type type) throws RFXComUnsupportedChannelException { + public void convertFromState(String channelId, Type type) { throw new UnsupportedOperationException(); } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessage.java b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessage.java index afac6e6c5092b..19a9799408a74 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessage.java +++ b/bundles/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,12 +21,13 @@ import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedChannelException; import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * RFXCOM data class for temperature and humidity message. * * @author Marc SAUVEUR - Initial contribution - * @author Pauli Anttila + * @author Pauli Anttila - Migrated for OH2 * @author Mike Jagdis - Support all available data from sensors */ public class RFXComWindMessage extends RFXComBatteryDeviceMessage<RFXComWindMessage.SubType> { @@ -70,21 +71,22 @@ public RFXComWindMessage(byte[] data) throws RFXComException { @Override public String toString() { + //@formatter:off return super.toString() - + ", Sub type = " + subType - + ", Device Id = " + getDeviceId() - + ", Wind direction = " + windDirection - + ", Wind gust = " + windSpeed - + ", Average wind speed = " + avgWindSpeed - + ", Temperature = " + temperature - + ", Chill temperature = " + chillTemperature - + ", Signal level = " + signalLevel - + ", Battery level = " + batteryLevel; + + ", Sub type = " + subType + + ", Device Id = " + getDeviceId() + + ", Wind direction = " + windDirection + + ", Wind gust = " + windSpeed + + ", Average wind speed = " + avgWindSpeed + + ", Temperature = " + temperature + + ", Chill temperature = " + chillTemperature + + ", Signal level = " + signalLevel + + ", Battery level = " + batteryLevel; + //@formatter:on } @Override public void encodeMessage(byte[] data) throws RFXComException { - super.encodeMessage(data); subType = fromByte(SubType.class, super.subType); @@ -166,7 +168,7 @@ public String getDeviceId() { } @Override - public State convertToState(String channelId) throws RFXComUnsupportedChannelException { + public State convertToState(String channelId, DeviceState deviceState) throws RFXComUnsupportedChannelException { switch (channelId) { case CHANNEL_WIND_DIRECTION: return new DecimalType(windDirection); @@ -184,7 +186,7 @@ public State convertToState(String channelId) throws RFXComUnsupportedChannelExc return new DecimalType(chillTemperature); default: - return super.convertToState(channelId); + return super.convertToState(channelId, deviceState); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXrec433.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXrec433.xml index a900fc62a891e..5249d35805b81 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXrec433.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXrec433.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="RFXrec433"> <label>RFXrec433 USB 433.92MHz Receiver</label> @@ -8,148 +8,148 @@ <config-description> <parameter name="bridgeId" type="text" required="true"> - <label>Serial number</label> + <label>Serial Number</label> <description>Serial number of the RFXCOM (FTDI) device</description> </parameter> <parameter name="disableDiscovery" type="boolean" required="true"> - <label>Disable discovery of unknown devices</label> + <label>Disable Discovery of Unknown Devices</label> <description>These RF protocols are prone to noise. If you find a lot of unknown devices showing up in your inbox enabling this will stop devices being added to your inbox.</description> <default>false</default> </parameter> <parameter name="ignoreConfig" type="boolean"> - <label>Skip transceiver configuration</label> + <label>Skip Transceiver Configuration</label> <description>Fully skip and ignore RFXCOM transceiver configuration. Binding assume that RFXCOM transceiver is preconfigured e.g. via RFXcom Manager. When this is enabled, both set mode command and individual message configurations are ignored.</description> <default>true</default> </parameter> <parameter name="setMode" type="text"> - <label>RFXCOM transceiver mode</label> + <label>RFXCOM Transceiver Mode</label> <description>RFXCOM transceiver set mode command. Command should be in hexadecimal string format and 28 characters (14 bytes) long. If set mode command is given, individual message configurations are ignored.</description> </parameter> <parameter name="transmitPower" type="integer" min="-18" max="10"> - <label>Transmit power</label> + <label>Transmit Power</label> <description>Transmit power in dBm, between -18dBm and +10dBm.</description> <default>-18</default> </parameter> <parameter name="enableUndecoded" type="boolean"> - <label>Undecoded messages</label> + <label>Undecoded Messages</label> <description>Enable display of unencoded messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableImagintronixOpus" type="boolean"> - <label>Imagintronix/Opus messages</label> + <label>Imagintronix/Opus Messages</label> <description>Enable Imagintronix/Opus messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableByronSX" type="boolean"> - <label>Byron SX messages</label> + <label>Byron SX Messages</label> <description>Enable Byron SX messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRSL" type="boolean"> - <label>RSL messages</label> + <label>RSL Messages</label> <description>Enable RSL messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLighting4" type="boolean"> - <label>Lighting4 messages</label> + <label>Lighting4 Messages</label> <description>Enable Lighting4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFineOffsetViking" type="boolean"> - <label>FineOffset/Viking messages</label> + <label>FineOffset/Viking Messages</label> <description>Enable FineOffset/Viking messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRubicson" type="boolean"> - <label>Rubicson messages</label> + <label>Rubicson Messages</label> <description>Enable Rubicson messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAEBlyss" type="boolean"> - <label>AE Blyss messages</label> + <label>AE Blyss Messages</label> <description>Enable AE Blyss messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT1T2T3T4" type="boolean"> - <label>BlindsT1/T2/T3/T4 messages</label> + <label>BlindsT1/T2/T3/T4 Messages</label> <description>Enable BlindsT1/T2/T3/T4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT0" type="boolean"> - <label>BlindsT0 messages</label> + <label>BlindsT0 Messages</label> <description>Enable BlindsT0 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFS20" type="boolean"> - <label>FS20/Legrand CAD messages</label> + <label>FS20/Legrand CAD Messages</label> <description>Enable FS20/Legrand CAD messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLaCrosse" type="boolean"> - <label>La Crosse messages</label> + <label>La Crosse Messages</label> <description>Enable La Crosse messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHidekiUPM" type="boolean"> - <label>Hideki/UPM messages</label> + <label>Hideki/UPM Messages</label> <description>Enable Hideki/UPM messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableADLightwaveRF" type="boolean"> - <label>AD LightwaveRF messages</label> + <label>AD LightwaveRF Messages</label> <description>Enable AD LightwaveRF messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMertik" type="boolean"> - <label>Mertik messages</label> + <label>Mertik Messages</label> <description>Enable Mertik messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableATI" type="boolean"> - <label>ATI messages</label> + <label>ATI Messages</label> <description>Enable ATI messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableOregonScientific" type="boolean"> - <label>Oregon Scientific messages</label> + <label>Oregon Scientific Messages</label> <description>Enable Oregon Scientific messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMeiantech" type="boolean"> - <label>Meiantech messages</label> + <label>Meiantech Messages</label> <description>Enable Meiantech messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeEasyEU" type="boolean"> - <label>HomeEasy EU messages</label> + <label>HomeEasy EU Messages</label> <description>Enable HomeEasy EU messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAC" type="boolean"> - <label>AC messages</label> + <label>AC Messages</label> <description>Enable AC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableARC" type="boolean"> - <label>ARC messages</label> + <label>ARC Messages</label> <description>Enable ARC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableX10" type="boolean"> - <label>X10 messages</label> + <label>X10 Messages</label> <description>Enable X10 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeConfort" type="boolean"> - <label>HomeConfort messages</label> + <label>HomeConfort Messages</label> <description>Enable HomeConfort messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableKEELOQ" type="boolean"> - <label>KEELOQ messages</label> + <label>KEELOQ Messages</label> <description>Enable KEELOQ messages to RFXCOM transceiver.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx315.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx315.xml index 89efab26f0fa7..78f4abfab8552 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx315.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx315.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="RFXtrx315"> <label>RFXtrx315 USB 315MHz Transceiver</label> @@ -8,28 +8,28 @@ <config-description> <parameter name="bridgeId" type="text" required="true"> - <label>Serial number</label> + <label>Serial Number</label> <description>Serial number of the RFXCOM (FTDI) device</description> </parameter> <parameter name="disableDiscovery" type="boolean" required="true"> - <label>Disable discovery of unknown devices</label> + <label>Disable Discovery of Unknown Devices</label> <description>These RF protocols are prone to noise. If you find a lot of unknown devices showing up in your inbox enabling this will stop devices being added to your inbox.</description> <default>false</default> </parameter> <parameter name="ignoreConfig" type="boolean"> - <label>Skip transceiver configuration</label> + <label>Skip Transceiver Configuration</label> <description>Fully skip and ignore RFXCOM transceiver configuration. Binding assume that RFXCOM transceiver is preconfigured e.g. via RFXcom Manager. When this is enabled, both set mode command and individual message configurations are ignored.</description> <default>true</default> </parameter> <parameter name="setMode" type="text"> - <label>RFXCOM transceiver mode</label> + <label>RFXCOM Transceiver Mode</label> <description>RFXCOM transceiver set mode command. Command should be in hexadecimal string format and 28 characters (14 bytes) long. If set mode command is given, individual message configurations are ignored.</description> </parameter> <parameter name="transceiverType" type="text"> - <label>RFXCOM transceiver type</label> + <label>RFXCOM Transceiver Type</label> <description>RFXCOM transceiver type.</description> <default>315MHz</default> <options> @@ -38,22 +38,22 @@ </options> </parameter> <parameter name="transmitPower" type="integer" min="-18" max="10"> - <label>Transmit power</label> + <label>Transmit Power</label> <description>Transmit power in dBm, between -18dBm and +10dBm.</description> <default>-18</default> </parameter> <parameter name="enableUndecoded" type="boolean"> - <label>Undecoded messages</label> + <label>Undecoded Messages</label> <description>Enable display of unencoded messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableVisonic" type="boolean"> - <label>Visonic messages</label> + <label>Visonic Messages</label> <description>Enable Visonic messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableX10" type="boolean"> - <label>X10 messages</label> + <label>X10 Messages</label> <description>Enable X10 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx433.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx433.xml index 92c530b7445cb..1f67c01a1f6d2 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx433.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/RFXtrx433.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="RFXtrx433"> <label>RFXtrx433E USB 433.92MHz Transceiver</label> @@ -8,148 +8,148 @@ <config-description> <parameter name="bridgeId" type="text" required="true"> - <label>Serial number</label> + <label>Serial Number</label> <description>Serial number of the RFXCOM (FTDI) device</description> </parameter> <parameter name="disableDiscovery" type="boolean" required="true"> - <label>Disable discovery of unknown devices</label> + <label>Disable Discovery of Unknown Devices</label> <description>These RF protocols are prone to noise. If you find a lot of unknown devices showing up in your inbox enabling this will stop devices being added to your inbox.</description> <default>false</default> </parameter> <parameter name="ignoreConfig" type="boolean"> - <label>Skip transceiver configuration</label> + <label>Skip Transceiver Configuration</label> <description>Fully skip and ignore RFXCOM transceiver configuration. Binding assume that RFXCOM transceiver is preconfigured e.g. via RFXcom Manager. When this is enabled, both set mode command and individual message configurations are ignored.</description> <default>true</default> </parameter> <parameter name="setMode" type="text"> - <label>RFXCOM transceiver mode</label> + <label>RFXCOM Transceiver Mode</label> <description>RFXCOM transceiver set mode command. Command should be in hexadecimal string format and 28 characters (14 bytes) long. If set mode command is given, individual message configurations are ignored.</description> </parameter> <parameter name="transmitPower" type="integer" min="-18" max="10"> - <label>Transmit power</label> + <label>Transmit Power</label> <description>Transmit power in dBm, between -18dBm and +10dBm.</description> <default>-18</default> </parameter> <parameter name="enableUndecoded" type="boolean"> - <label>Undecoded messages</label> + <label>Undecoded Messages</label> <description>Enable display of unencoded messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableImagintronixOpus" type="boolean"> - <label>Imagintronix/Opus messages</label> + <label>Imagintronix/Opus Messages</label> <description>Enable Imagintronix/Opus messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableByronSX" type="boolean"> - <label>Byron SX messages</label> + <label>Byron SX Messages</label> <description>Enable Byron SX messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRSL" type="boolean"> - <label>RSL messages</label> + <label>RSL Messages</label> <description>Enable RSL messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLighting4" type="boolean"> - <label>Lighting4 messages</label> + <label>Lighting4 Messages</label> <description>Enable Lighting4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFineOffsetViking" type="boolean"> - <label>FineOffset/Viking messages</label> + <label>FineOffset/Viking Messages</label> <description>Enable FineOffset/Viking messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRubicson" type="boolean"> - <label>Rubicson messages</label> + <label>Rubicson Messages</label> <description>Enable Rubicson messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAEBlyss" type="boolean"> - <label>AE Blyss messages</label> + <label>AE Blyss Messages</label> <description>Enable AE Blyss messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT1T2T3T4" type="boolean"> - <label>BlindsT1/T2/T3/T4 messages</label> + <label>BlindsT1/T2/T3/T4 Messages</label> <description>Enable BlindsT1/T2/T3/T4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT0" type="boolean"> - <label>BlindsT0 messages</label> + <label>BlindsT0 Messages</label> <description>Enable BlindsT0 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFS20" type="boolean"> - <label>FS20/Legrand CAD messages</label> + <label>FS20/Legrand CAD Messages</label> <description>Enable FS20/Legrand CAD messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLaCrosse" type="boolean"> - <label>La Crosse messages</label> + <label>La Crosse Messages</label> <description>Enable La Crosse messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHidekiUPM" type="boolean"> - <label>Hideki/UPM messages</label> + <label>Hideki/UPM Messages</label> <description>Enable Hideki/UPM messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableADLightwaveRF" type="boolean"> - <label>AD LightwaveRF messages</label> + <label>AD LightwaveRF Messages</label> <description>Enable AD LightwaveRF messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMertik" type="boolean"> - <label>Mertik messages</label> + <label>Mertik Messages</label> <description>Enable Mertik messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableATI" type="boolean"> - <label>ATI messages</label> + <label>ATI Messages</label> <description>Enable ATI messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableOregonScientific" type="boolean"> - <label>Oregon Scientific messages</label> + <label>Oregon Scientific Messages</label> <description>Enable Oregon Scientific messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMeiantech" type="boolean"> - <label>Meiantech messages</label> + <label>Meiantech Messages</label> <description>Enable Meiantech messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeEasyEU" type="boolean"> - <label>HomeEasy EU messages</label> + <label>HomeEasy EU Messages</label> <description>Enable HomeEasy EU messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAC" type="boolean"> - <label>AC messages</label> + <label>AC Messages</label> <description>Enable AC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableARC" type="boolean"> - <label>ARC messages</label> + <label>ARC Messages</label> <description>Enable ARC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableX10" type="boolean"> - <label>X10 messages</label> + <label>X10 Messages</label> <description>Enable X10 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeConfort" type="boolean"> - <label>HomeConfort messages</label> + <label>HomeConfort Messages</label> <description>Enable HomeConfort messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableKEELOQ" type="boolean"> - <label>KEELOQ messages</label> + <label>KEELOQ Messages</label> <description>Enable KEELOQ messages to RFXCOM transceiver.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/bridge.xml index daa7c9c087316..9f369338a50b1 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridge"> <label>RFXCOM USB Transceiver</label> @@ -13,13 +13,13 @@ <description>Serial port where RFXCOM transceiver is connected.</description> </parameter> <parameter name="disableDiscovery" type="boolean" required="true"> - <label>Disable discovery of unknown devices</label> + <label>Disable Discovery of Unknown Devices</label> <description>These RF protocols are prone to noise. If you find a lot of unknown devices showing up in your inbox enabling this will stop devices being added to your inbox.</description> <default>false</default> </parameter> <parameter name="ignoreConfig" type="boolean" required="true"> - <label>Skip transceiver configuration</label> + <label>Skip Transceiver Configuration</label> <description>Fully skip and ignore RFXCOM transceiver configuration. Binding assume that RFXCOM transceiver is preconfigured e.g. via RFXcom Manager. When this is enabled, both set mode command and individual message configurations are ignored. @@ -27,13 +27,13 @@ <default>true</default> </parameter> <parameter name="setMode" type="text"> - <label>RFXCOM transceiver mode</label> + <label>RFXCOM Transceiver Mode</label> <description>RFXCOM transceiver set mode command. Command should be in hexadecimal string format and 28 characters (14 bytes) long. If set mode command is given, individual message configurations are ignored. </description> </parameter> <parameter name="transceiverType" type="text"> - <label>RFXCOM transceiver type</label> + <label>RFXCOM Transceiver Type</label> <description>RFXCOM transceiver type.</description> <default>433.92MHz</default> <options> @@ -44,137 +44,137 @@ </options> </parameter> <parameter name="transmitPower" type="integer" min="-18" max="10"> - <label>Transmit power</label> + <label>Transmit Power</label> <description>Transmit power in dBm, between -18dBm and +10dBm.</description> <default>-18</default> </parameter> <parameter name="enableUndecoded" type="boolean"> - <label>Undecoded messages</label> + <label>Undecoded Messages</label> <description>Enable display of unencoded messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableImagintronixOpus" type="boolean"> - <label>Imagintronix/Opus messages</label> + <label>Imagintronix/Opus Messages</label> <description>Enable Imagintronix/Opus messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableByronSX" type="boolean"> - <label>Byron SX messages</label> + <label>Byron SX Messages</label> <description>Enable Byron SX messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRSL" type="boolean"> - <label>RSL messages</label> + <label>RSL Messages</label> <description>Enable RSL messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLighting4" type="boolean"> - <label>Lighting4 messages</label> + <label>Lighting4 Messages</label> <description>Enable Lighting4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFineOffsetViking" type="boolean"> - <label>FineOffset/Viking messages</label> + <label>FineOffset/Viking Messages</label> <description>Enable FineOffset/Viking messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRubicson" type="boolean"> - <label>Rubicson messages</label> + <label>Rubicson Messages</label> <description>Enable Rubicson messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAEBlyss" type="boolean"> - <label>AE Blyss messages</label> + <label>AE Blyss Messages</label> <description>Enable AE Blyss messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT1T2T3T4" type="boolean"> - <label>BlindsT1/T2/T3/T4 messages</label> + <label>BlindsT1/T2/T3/T4 Messages</label> <description>Enable BlindsT1/T2/T3/T4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT0" type="boolean"> - <label>BlindsT0 messages</label> + <label>BlindsT0 Messages</label> <description>Enable BlindsT0 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableProGuard" type="boolean"> - <label>ProGuard messages</label> + <label>ProGuard Messages</label> <description>Enable ProGuard messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFS20" type="boolean"> - <label>FS20/Legrand CAD messages</label> + <label>FS20/Legrand CAD Messages</label> <description>Enable FS20/Legrand CAD messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLaCrosse" type="boolean"> - <label>La Crosse messages</label> + <label>La Crosse Messages</label> <description>Enable La Crosse messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHidekiUPM" type="boolean"> - <label>Hideki/UPM messages</label> + <label>Hideki/UPM Messages</label> <description>Enable Hideki/UPM messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableADLightwaveRF" type="boolean"> - <label>AD LightwaveRF messages</label> + <label>AD LightwaveRF Messages</label> <description>Enable AD LightwaveRF messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMertik" type="boolean"> - <label>Mertik messages</label> + <label>Mertik Messages</label> <description>Enable Mertik messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableVisonic" type="boolean"> - <label>Visonic messages</label> + <label>Visonic Messages</label> <description>Enable Visonic messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableATI" type="boolean"> - <label>ATI messages</label> + <label>ATI Messages</label> <description>Enable ATI messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableOregonScientific" type="boolean"> - <label>Oregon Scientific messages</label> + <label>Oregon Scientific Messages</label> <description>Enable Oregon Scientific messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMeiantech" type="boolean"> - <label>Meiantech messages</label> + <label>Meiantech Messages</label> <description>Enable Meiantech messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeEasyEU" type="boolean"> - <label>HomeEasy EU messages</label> + <label>HomeEasy EU Messages</label> <description>Enable HomeEasy EU messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAC" type="boolean"> - <label>AC messages</label> + <label>AC Messages</label> <description>Enable AC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableARC" type="boolean"> - <label>ARC messages</label> + <label>ARC Messages</label> <description>Enable ARC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableX10" type="boolean"> - <label>X10 messages</label> + <label>X10 Messages</label> <description>Enable X10 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeConfort" type="boolean"> - <label>HomeConfort messages</label> + <label>HomeConfort Messages</label> <description>Enable HomeConfort messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableKEELOQ" type="boolean"> - <label>KEELOQ messages</label> + <label>KEELOQ Messages</label> <description>Enable KEELOQ messages to RFXCOM transceiver.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/channels.xml index 837efa75fa756..bf5957045a5b0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/channels.xml @@ -62,6 +62,12 @@ <state min="1" max="6" step="1" readOnly="false"></state> </channel-type> + <channel-type id="fanspeedcontrol"> + <item-type>Rollershutter</item-type> + <label>Global Speed Control</label> + <description>Requested speed setting, UP, DOWN</description> + </channel-type> + <channel-type id="fanspeedstring"> <item-type>String</item-type> <label>Fan Speed</label> @@ -142,6 +148,13 @@ <description>Open/close and adjust angle of venetian blind</description> </channel-type> + <channel-type id="voltage"> + <item-type>Number</item-type> + <label>Voltage</label> + <description>Measured voltage</description> + <state pattern="%d V" readOnly="true"></state> + </channel-type> + <channel-type id="instantpower"> <item-type>Number</item-type> <label>Instant Power</label> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/datetime.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/datetime.xml index 6b3cd3dc108cb..3b38cb97eae7d 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/datetime.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/datetime.xml @@ -11,7 +11,7 @@ <bridge-type-ref id="RFXrec433" /> </supported-bridge-type-refs> - <label>RFXCOM Date/time sensor</label> + <label>RFXCOM Date/time Sensor</label> <description>A DateTime device.</description> <channels> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc.xml new file mode 100644 index 0000000000000..b3344e5b7bc57 --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="fan_lucci_dc"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + <bridge-type-ref id="tcpbridge" /> + <bridge-type-ref id="RFXtrx433" /> + <bridge-type-ref id="RFXrec433" /> + </supported-bridge-type-refs> + + <label>RFXCOM Fan Device - Lucci Air DC</label> + <description>A Lucci Air DC fan device.</description> + + <channels> + <channel id="commandString" typeId="commandString" /> + <channel id="fanSpeed" typeId="fanspeedcontrol"/> + <channel id="fanLight" typeId="command" /> + <channel id="signalLevel" typeId="system.signal-strength" /> + </channels> + + <config-description> + <parameter name="deviceId" type="text" required="true"> + <label>Device Id</label> + <description>Unit Id. Example 1000</description> + </parameter> + <parameter name="subType" type="text"> + <label>Sub Type</label> + <description>Specifies device sub type.</description> + <options> + <option value="LUCCI_AIR_DC">Lucci Air DC</option> + </options> + <default>LUCCI_AIR_DC</default> + </parameter> + </config-description> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc_ii.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc_ii.xml new file mode 100644 index 0000000000000..4e27321c9b04e --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/fan_lucci_dc_ii.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="fan_lucci_dc_ii"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + <bridge-type-ref id="tcpbridge" /> + <bridge-type-ref id="RFXtrx433" /> + <bridge-type-ref id="RFXrec433" /> + </supported-bridge-type-refs> + + <label>RFXCOM Fan Device - Lucci Air DC II</label> + <description>A Lucci Air DC II fan device.</description> + + <channels> + <channel id="command" typeId="command" /> + <channel id="commandString" typeId="commandString" /> + <channel id="fanSpeed" typeId="fanspeed"/> + <channel id="fanLight" typeId="command" /> + <channel id="signalLevel" typeId="system.signal-strength" /> + </channels> + + <config-description> + <parameter name="deviceId" type="text" required="true"> + <label>Device Id</label> + <description>Unit Id. Example 1000</description> + </parameter> + <parameter name="subType" type="text"> + <label>Sub Type</label> + <description>Specifies device sub type.</description> + <options> + <option value="LUCCI_AIR_DC_II">Lucci Air DC II</option> + </options> + <default>LUCCI_AIR_DC_II</default> + </parameter> + </config-description> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/lighting4.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/lighting4.xml index dd564ac9956bc..dfed0de4c4724 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/lighting4.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/lighting4.xml @@ -33,12 +33,12 @@ </options> </parameter> <parameter name="pulse" type="integer" min="100" max="800"> - <label>Pulse length</label> + <label>Pulse Length</label> <description>Pulse length of the device</description> <default>350</default> </parameter> <parameter name="onCommandId" type="integer" required="true"> - <label>On command</label> + <label>On Command</label> <description>Specifies command to be send when ON must be transmitted</description> <options> <option value="0">OFF (value 0)</option> @@ -61,7 +61,7 @@ <default>1</default> </parameter> <parameter name="offCommandId" type="integer" required="true"> - <label>Off command</label> + <label>Off Command</label> <description>Specifies command to be send when OFF must be transmitted</description> <options> <option value="0">OFF (value 0)</option> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfxsensor.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfxsensor.xml new file mode 100644 index 0000000000000..2934fba02c7f3 --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfxsensor.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="rfxsensor"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + <bridge-type-ref id="tcpbridge" /> + <bridge-type-ref id="RFXtrx433" /> + <bridge-type-ref id="RFXrec433" /> + </supported-bridge-type-refs> + + <label>RFXCOM RFXSensor</label> + <description>A RFXSensor device.</description> + + <channels> + <channel id="temperature" typeId="temperature" /> + <channel id="referenceVoltage" typeId="voltage" /> + <channel id="voltage" typeId="voltage" /> + <channel id="humidity" typeId="humidity" /> + <channel id="pressure" typeId="pressure" /> + </channels> + + <config-description> + <parameter name="deviceId" type="text" required="true"> + <label>Device Id</label> + <description>Sensor Id. Example 8</description> + </parameter> + </config-description> + </thing-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfy.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfy.xml index 0e3a4bbbabd19..18676a02131a2 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfy.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/rfy.xml @@ -23,7 +23,7 @@ <channel id="shutter" typeId="shutter" /> <channel id="venetianBlind" typeId="venetianBlind" /> <channel id="sunWindDetector" typeId="command"> - <label>Sun+wind detector</label> + <label>Sun+Wind Detector</label> <description>Enable the sun+wind detector.</description> </channel> <channel id="signalLevel" typeId="system.signal-strength" /> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/tcpbridge.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/tcpbridge.xml index bb34181441b96..a6747b04467dd 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/tcpbridge.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/tcpbridge.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rfxcom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="tcpbridge"> <label>RFXCOM USB Transceiver over TCP/IP</label> @@ -18,24 +18,24 @@ <default>10001</default> </parameter> <parameter name="disableDiscovery" type="boolean" required="true"> - <label>Disable discovery of unknown devices</label> + <label>Disable Discovery of Unknown Devices</label> <description>These RF protocols are prone to noise. If you find a lot of unknown devices showing up in your inbox enabling this will stop devices being added to your inbox.</description> <default>false</default> </parameter> <parameter name="ignoreConfig" type="boolean" required="true"> - <label>Skip transceiver configuration</label> + <label>Skip Transceiver Configuration</label> <description>Fully skip and ignore RFXCOM transceiver configuration. Binding assume that RFXCOM transceiver is preconfigured e.g. via RFXcom Manager. When this is enabled, both set mode command and individual message configurations are ignored.</description> <default>true</default> </parameter> <parameter name="setMode" type="text"> - <label>RFXCOM transceiver mode</label> + <label>RFXCOM Transceiver Mode</label> <description>RFXCOM transceiver set mode command. Command should be in hexadecimal string format and 28 characters (14 bytes) long. If set mode command is given, individual message configurations are ignored.</description> </parameter> <parameter name="transceiverType" type="text"> - <label>RFXCOM transceiver type</label> + <label>RFXCOM Transceiver Type</label> <description>RFXCOM transceiver type.</description> <default>433.92MHz</default> <options> @@ -46,137 +46,137 @@ </options> </parameter> <parameter name="transmitPower" type="integer" min="-18" max="10"> - <label>Transmit power</label> + <label>Transmit Power</label> <description>Transmit power in dBm, between -18dBm and +10dBm.</description> <default>-18</default> </parameter> <parameter name="enableUndecoded" type="boolean"> - <label>Undecoded messages</label> + <label>Undecoded Messages</label> <description>Enable display of unencoded messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableImagintronixOpus" type="boolean"> - <label>Imagintronix/Opus messages</label> + <label>Imagintronix/Opus Messages</label> <description>Enable Imagintronix/Opus messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableByronSX" type="boolean"> - <label>Byron SX messages</label> + <label>Byron SX Messages</label> <description>Enable Byron SX messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRSL" type="boolean"> - <label>RSL messages</label> + <label>RSL Messages</label> <description>Enable RSL messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLighting4" type="boolean"> - <label>Lighting4 messages</label> + <label>Lighting4 Messages</label> <description>Enable Lighting4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFineOffsetViking" type="boolean"> - <label>FineOffset/Viking messages</label> + <label>FineOffset/Viking Messages</label> <description>Enable FineOffset/Viking messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableRubicson" type="boolean"> - <label>Rubicson messages</label> + <label>Rubicson Messages</label> <description>Enable Rubicson messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAEBlyss" type="boolean"> - <label>AE Blyss messages</label> + <label>AE Blyss Messages</label> <description>Enable AE Blyss messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT1T2T3T4" type="boolean"> - <label>BlindsT1/T2/T3/T4 messages</label> + <label>BlindsT1/T2/T3/T4 Messages</label> <description>Enable BlindsT1/T2/T3/T4 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableBlindsT0" type="boolean"> - <label>BlindsT0 messages</label> + <label>BlindsT0 Messages</label> <description>Enable BlindsT0 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableProGuard" type="boolean"> - <label>ProGuard messages</label> + <label>ProGuard Messages</label> <description>Enable ProGuard messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableFS20" type="boolean"> - <label>FS20/Legrand CAD messages</label> + <label>FS20/Legrand CAD Messages</label> <description>Enable FS20/Legrand CAD messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableLaCrosse" type="boolean"> - <label>La Crosse messages</label> + <label>La Crosse Messages</label> <description>Enable La Crosse messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHidekiUPM" type="boolean"> - <label>Hideki/UPM messages</label> + <label>Hideki/UPM Messages</label> <description>Enable Hideki/UPM messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableADLightwaveRF" type="boolean"> - <label>AD LightwaveRF messages</label> + <label>AD LightwaveRF Messages</label> <description>Enable AD LightwaveRF messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMertik" type="boolean"> - <label>Mertik messages</label> + <label>Mertik Messages</label> <description>Enable Mertik messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableVisonic" type="boolean"> - <label>Visonic messages</label> + <label>Visonic Messages</label> <description>Enable Visonic messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableATI" type="boolean"> - <label>ATI messages</label> + <label>ATI Messages</label> <description>Enable ATI messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableOregonScientific" type="boolean"> - <label>Oregon Scientific messages</label> + <label>Oregon Scientific Messages</label> <description>Enable Oregon Scientific messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableMeiantech" type="boolean"> - <label>Meiantech messages</label> + <label>Meiantech Messages</label> <description>Enable Meiantech messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeEasyEU" type="boolean"> - <label>HomeEasy EU messages</label> + <label>HomeEasy EU Messages</label> <description>Enable HomeEasy EU messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableAC" type="boolean"> - <label>AC messages</label> + <label>AC Messages</label> <description>Enable AC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableARC" type="boolean"> - <label>ARC messages</label> + <label>ARC Messages</label> <description>Enable ARC messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableX10" type="boolean"> - <label>X10 messages</label> + <label>X10 Messages</label> <description>Enable X10 messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableHomeConfort" type="boolean"> - <label>HomeConfort messages</label> + <label>HomeConfort Messages</label> <description>Enable HomeConfort messages to RFXCOM transceiver.</description> <default>false</default> </parameter> <parameter name="enableKEELOQ" type="boolean"> - <label>KEELOQ messages</label> + <label>KEELOQ Messages</label> <description>Enable KEELOQ messages to RFXCOM transceiver.</description> <default>false</default> </parameter> diff --git a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/thermostat3.xml b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/thermostat3.xml index 0f7a1b1204054..7874169f7ffc0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/thermostat3.xml +++ b/bundles/org.openhab.binding.rfxcom/src/main/resources/ESH-INF/thing/thermostat3.xml @@ -42,4 +42,4 @@ </config-description> </thing-type> -</thing:thing-descriptions> \ No newline at end of file +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfigurationBuilder.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfigurationBuilder.java index b97d0a721c7ab..67d95b28927fd 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfigurationBuilder.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/config/RFXComDeviceConfigurationBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,7 @@ /** * Test helper for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ public class RFXComDeviceConfigurationBuilder { private final RFXComDeviceConfiguration config; diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/MockDeviceState.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/MockDeviceState.java new file mode 100644 index 0000000000000..d8532bc2a75e5 --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/MockDeviceState.java @@ -0,0 +1,37 @@ +/** + * 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.rfxcom.internal.messages; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.eclipse.smarthome.core.types.Type; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; + +/** + * Mock implementation for the DeviceState + * + * @author Martin van Wingerden - Initial contribution + */ +public class MockDeviceState implements DeviceState { + private final Map<String, Type> stateMap = new ConcurrentHashMap<>(); + + @Override + public Type getLastState(String channelId) { + return stateMap.get(channelId); + } + + public void set(String channelId, Type state) { + stateMap.put(channelId, state); + } +} diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessageTest.java index 045397c3cde45..2ceb048778dbd 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBBQTemperatureMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComBBQTemperatureMessage.SubType.BBQ1; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Mike Jagdis + * @author Mike Jagdis - Initial contribution */ +@NonNullByDefault public class RFXComBBQTemperatureMessageTest { @Test public void testSomeMessages() throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBarometricMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBarometricMessageTest.java index c1e82b3a9f47c..38e02f47b2286 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBarometricMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBarometricMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,13 +20,12 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComBarometricMessageTest { - @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { RFXComMessageFactory.createMessage(PacketType.BAROMETRIC); } - } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1MessageTest.java index 20aedb22859fd..f58f2bdf2ac93 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComBlinds1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -23,8 +24,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComBlinds1MessageTest { private void testMessage(String hexMsg, SubType subType, int seqNbr, String deviceId, int signalLevel, RFXComBlinds1Message.Commands command) throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCamera1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCamera1MessageTest.java index e206fc8e1d7a7..b0f2364790c84 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCamera1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCamera1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComCamera1MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessageTest.java index 4b4d93d88651d..ea04013fd19c4 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComChimeMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,9 +23,10 @@ /** * Test for RFXCom-binding * - * @author Mike Jagdis - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution + * @author Mike Jagdis - Added actual functional tests */ +@NonNullByDefault public class RFXComChimeMessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessageTest.java index f05b968c03a09..f27978b840b33 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentEnergyMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,8 +22,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComCurrentEnergyMessageTest { private void testMessage(String hexMsg, RFXComCurrentEnergyMessage.SubType subType, int seqNbr, String deviceId, int count, double channel1, double channel2, double channel3, double totalUsage, int signalLevel, @@ -51,6 +53,5 @@ public void testSomeMessages() throws RFXComException { 2.2d, 0d, 0d, 32547.4d, 8, 9); testMessage("135B014FB80002001D0000000000000000000079", RFXComCurrentEnergyMessage.SubType.ELEC4, 79, "47104", 2, 2.9d, 0d, 0d, 0d, 7, 9); - } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessageTest.java index 18f46a09d3f7b..b69d4a7d8ae34 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurrentMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -24,6 +25,7 @@ * * @author Martin van Wingerden - Initial Contribution */ +@NonNullByDefault public class RFXComCurrentMessageTest { @Test @@ -45,6 +47,5 @@ public void testSomeMessages() throws RFXComException { byte[] decoded = msg.decodeMessage(); assertEquals("Message converted back", message, HexUtils.bytesToHex(decoded)); - } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1MessageTest.java index 646821e72511e..a4191a2813d8b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComCurtain1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,14 +14,16 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.CURTAIN1; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComCurtain1MessageTest { @Test public void checkForSupportTest() throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessageTest.java index 41f7e4ea2aeaf..d07a85f9e60ad 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComDateTimeMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.DateTimeType; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; @@ -23,8 +24,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComDateTimeMessageTest { @Test public void testSomeMessages() throws RFXComException { @@ -38,7 +40,7 @@ public void testSomeMessages() throws RFXComException { assertEquals("Signal Level", 2, RFXComTestHelper.getActualIntValue(msg, CHANNEL_SIGNAL_LEVEL)); assertEquals("Converted value", DateTimeType.valueOf("2003-04-29T13:21:10"), - msg.convertToState(CHANNEL_DATE_TIME)); + msg.convertToState(CHANNEL_DATE_TIME, new MockDeviceState())); byte[] decoded = msg.decodeMessage(); diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEdisioTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEdisioTest.java index ca97b4355fa82..2e6f4cefe2a66 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEdisioTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEdisioTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,14 +14,16 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.EDISIO; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComEdisioTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessageTest.java index d842deb113215..e924ba72e3e15 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComEnergyMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComEnergyMessage.SubType.ELEC2; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComEnergyMessageTest { @Test public void testSomeMessages() throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFS20MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFS20MessageTest.java index fe3bafdac08f1..a4cfb738ecb54 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFS20MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFS20MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComFS20MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanFalmecMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanFalmecMessageTest.java new file mode 100644 index 0000000000000..0b71fc3e9b38c --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanFalmecMessageTest.java @@ -0,0 +1,95 @@ +/** + * 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.rfxcom.internal.messages; + +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN_FALMEC; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.FALMEC; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessageTest.testCommand; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.types.UnDefType; +import org.junit.Test; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; + +/** + * Test for RFXCom-binding + * + * @author Martin van Wingerden - Initial contribution + */ +@NonNullByDefault +public class RFXComFanFalmecMessageTest { + + @Test + public void testFalmecCommandOn() throws RFXComException { + testCommand(FALMEC, CHANNEL_COMMAND, OnOffType.ON, OnOffType.ON, UnDefType.UNDEF, new DecimalType(2), + StringType.valueOf("SPEED_2"), FAN_FALMEC); + } + + @Test + public void testFalmecCommandOff() throws RFXComException { + testCommand(FALMEC, CHANNEL_COMMAND, OnOffType.OFF, OnOffType.OFF, UnDefType.UNDEF, new DecimalType(0), + StringType.valueOf("POWER_OFF"), FAN_FALMEC); + } + + @Test + public void testFanSpeed0() throws RFXComException { + testFalmecFanSpeed(0, OnOffType.OFF); + } + + @Test + public void testFanSpeed1() throws RFXComException { + testFalmecFanSpeed(1, OnOffType.ON); + } + + @Test + public void testFanSpeed2() throws RFXComException { + testFalmecFanSpeed(2, OnOffType.ON); + } + + @Test + public void testFanSpeed3() throws RFXComException { + testFalmecFanSpeed(3, OnOffType.ON); + } + + @Test + public void testFanSpeed4() throws RFXComException { + testFalmecFanSpeed(4, OnOffType.ON); + } + + @Test + public void testFalmecFanLightOn() throws RFXComException { + testCommand(FALMEC, CHANNEL_FAN_LIGHT, OnOffType.ON, null, OnOffType.ON, null, StringType.valueOf("LIGHT_ON"), + FAN_FALMEC); + } + + @Test + public void testFalmecFanLightOff() throws RFXComException { + testCommand(FALMEC, CHANNEL_FAN_LIGHT, OnOffType.OFF, null, OnOffType.OFF, null, + StringType.valueOf("LIGHT_OFF"), FAN_FALMEC); + } + + private void testFalmecFanSpeed(int value, OnOffType expectedCommand) throws RFXComException { + StringType expectedCommandString; + if (value == 0) { + expectedCommandString = StringType.valueOf("POWER_OFF"); + } else { + expectedCommandString = StringType.valueOf("SPEED_" + value); + } + testCommand(FALMEC, CHANNEL_FAN_SPEED, new DecimalType(value), expectedCommand, UnDefType.UNDEF, + new DecimalType(value), expectedCommandString, FAN_FALMEC); + } +} diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDc2MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDc2MessageTest.java new file mode 100644 index 0000000000000..ed935ec63cf9a --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDc2MessageTest.java @@ -0,0 +1,118 @@ +/** + * 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.rfxcom.internal.messages; + +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN_LUCCI_DC_II; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.LUCCI_AIR_DC_II; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.junit.Test; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; + +/** + * Test for RFXCom-binding + * + * @author Martin van Wingerden - Initial contribution + */ +@NonNullByDefault +public class RFXComFanLucciAirDc2MessageTest { + + @Test + public void testCommandOn() throws RFXComException { + testCommand(CHANNEL_COMMAND, OnOffType.ON, OnOffType.ON, UnDefType.UNDEF, new DecimalType(3), + StringType.valueOf("SPEED_3")); + } + + @Test + public void testCommandOff() throws RFXComException { + testCommand(CHANNEL_COMMAND, OnOffType.OFF, OnOffType.OFF, UnDefType.UNDEF, new DecimalType(0), + StringType.valueOf("POWER_OFF")); + } + + @Test + public void testFanLightOn() throws RFXComException { + testCommand(CHANNEL_FAN_LIGHT, OnOffType.ON, null, OnOffType.ON, null, StringType.valueOf("LIGHT")); + } + + @Test + public void testFanSpeed0() throws RFXComException { + testFanSpeed(0, OnOffType.OFF); + } + + @Test + public void testFanSpeed1() throws RFXComException { + testFanSpeed(1, OnOffType.ON); + } + + @Test + public void testFanSpeed2() throws RFXComException { + testFanSpeed(2, OnOffType.ON); + } + + @Test + public void testFanSpeed3() throws RFXComException { + testFanSpeed(3, OnOffType.ON); + } + + @Test + public void testFanSpeed4() throws RFXComException { + testFanSpeed(4, OnOffType.ON); + } + + @Test + public void testCommandString() throws RFXComException { + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("POWER_OFF"), OnOffType.OFF, UnDefType.UNDEF, + new DecimalType(0), StringType.valueOf("POWER_OFF")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("LIGHT"), null, OnOffType.ON, null, + StringType.valueOf("LIGHT")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("REVERSE"), null, UnDefType.UNDEF, null, + StringType.valueOf("REVERSE")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_1"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(1), StringType.valueOf("SPEED_1")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_2"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(2), StringType.valueOf("SPEED_2")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_3"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(3), StringType.valueOf("SPEED_3")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_4"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(4), StringType.valueOf("SPEED_4")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_5"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(5), StringType.valueOf("SPEED_5")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("SPEED_6"), OnOffType.ON, UnDefType.UNDEF, + new DecimalType(6), StringType.valueOf("SPEED_6")); + } + + private void testFanSpeed(int value, OnOffType expectedCommand) throws RFXComException { + StringType expectedCommandString; + if (value == 0) { + expectedCommandString = StringType.valueOf("POWER_OFF"); + } else { + expectedCommandString = StringType.valueOf("SPEED_" + value); + } + testCommand(CHANNEL_FAN_SPEED, new DecimalType(value), expectedCommand, UnDefType.UNDEF, new DecimalType(value), + expectedCommandString); + } + + private void testCommand(String channel, State inputValue, @Nullable OnOffType expectedCommand, + State expectedLightCommand, @Nullable State expectedFanSpeed, State expectedCommandString) + throws RFXComException { + RFXComFanMessageTest.testCommand(LUCCI_AIR_DC_II, channel, inputValue, expectedCommand, expectedLightCommand, + expectedFanSpeed, expectedCommandString, FAN_LUCCI_DC_II); + } +} diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDcMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDcMessageTest.java new file mode 100644 index 0000000000000..ecc2474a1c335 --- /dev/null +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanLucciAirDcMessageTest.java @@ -0,0 +1,75 @@ +/** + * 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.rfxcom.internal.messages; + +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN_LUCCI_DC; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.LUCCI_AIR_DC; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.types.UpDownType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.junit.Test; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; + +/** + * Test for RFXCom-binding + * + * @author Martin van Wingerden - Initial contribution + */ +@NonNullByDefault +public class RFXComFanLucciAirDcMessageTest { + + @Test + public void testFanLightOn() throws RFXComException { + testCommand(CHANNEL_FAN_LIGHT, OnOffType.ON, OnOffType.ON, null, StringType.valueOf("LIGHT")); + } + + @Test + public void testUp() throws RFXComException { + testCommand(CHANNEL_FAN_SPEED, UpDownType.UP, UnDefType.UNDEF, UpDownType.UP, StringType.valueOf("UP")); + } + + @Test + public void testDown() throws RFXComException { + testCommand(CHANNEL_FAN_SPEED, UpDownType.DOWN, UnDefType.UNDEF, UpDownType.DOWN, StringType.valueOf("DOWN")); + } + + @Test + public void testCommandString() throws RFXComException { + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("POWER"), UnDefType.UNDEF, null, + StringType.valueOf("POWER")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("UP"), UnDefType.UNDEF, UpDownType.UP, + StringType.valueOf("UP")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("DOWN"), UnDefType.UNDEF, UpDownType.DOWN, + StringType.valueOf("DOWN")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("LIGHT"), OnOffType.ON, null, + StringType.valueOf("LIGHT")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("REVERSE"), UnDefType.UNDEF, null, + StringType.valueOf("REVERSE")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("NATURAL_FLOW"), UnDefType.UNDEF, null, + StringType.valueOf("NATURAL_FLOW")); + testCommand(CHANNEL_COMMAND_STRING, StringType.valueOf("PAIR"), UnDefType.UNDEF, null, + StringType.valueOf("PAIR")); + } + + private void testCommand(String channel, State inputValue, State expectedLightCommand, + @Nullable State expectedFanSpeed, State expectedCommandString) throws RFXComException { + RFXComFanMessageTest.testCommand(LUCCI_AIR_DC, channel, inputValue, null, expectedLightCommand, + expectedFanSpeed, expectedCommandString, FAN_LUCCI_DC); + } +} diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessageTest.java index 43dce293326e7..ed190addc0fc0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComFanMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,7 +12,13 @@ */ package org.openhab.binding.rfxcom.internal.messages; -import org.eclipse.smarthome.core.library.types.DecimalType; +import static org.junit.Assert.assertEquals; +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN; +import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.CASAFAN; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.types.State; @@ -21,19 +27,15 @@ import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; -import static org.junit.Assert.assertEquals; -import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; -import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN; -import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.FAN_FALMEC; -import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.CASAFAN; -import static org.openhab.binding.rfxcom.internal.messages.RFXComFanMessage.SubType.FALMEC; - /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComFanMessageTest { + private static final MockDeviceState DEVICE_STATE = new MockDeviceState(); + @Test public void checkForSupportTest() throws RFXComException { RFXComMessageFactory.createMessage(FAN); @@ -49,17 +51,17 @@ public void basicBoundaryCheck() throws RFXComException { RFXComTestHelper.basicBoundaryCheck(FAN, message); } - private void testMessage(String hexMsg, int seqNbr, String deviceId, - int signalLevel, State expectedCommand, State expectedLightCommand, State expectedFanSpeed, RFXComBaseMessage.PacketType packetType) throws RFXComException { - final RFXComFanMessage msg = (RFXComFanMessage) RFXComMessageFactory - .createMessage(HexUtils.hexToBytes(hexMsg)); + private void testMessage(String hexMsg, int seqNbr, String deviceId, int signalLevel, + @Nullable State expectedCommand, State expectedLightCommand, @Nullable State expectedFanSpeed, + RFXComBaseMessage.PacketType packetType) throws RFXComException { + final RFXComFanMessage msg = (RFXComFanMessage) RFXComMessageFactory.createMessage(HexUtils.hexToBytes(hexMsg)); assertEquals("Seq Number", seqNbr, (short) (msg.seqNbr & 0xFF)); assertEquals("Sensor Id", deviceId, msg.getDeviceId()); assertEquals("Signal Level", signalLevel, msg.signalLevel); - assertEquals(expectedCommand, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(expectedLightCommand, msg.convertToState(CHANNEL_FAN_LIGHT)); - assertEquals(expectedFanSpeed, msg.convertToState(CHANNEL_FAN_SPEED)); + assertEquals(expectedCommand, msg.convertToState(CHANNEL_COMMAND, DEVICE_STATE)); + assertEquals(expectedLightCommand, msg.convertToState(CHANNEL_FAN_LIGHT, DEVICE_STATE)); + assertEquals(expectedFanSpeed, msg.convertToState(CHANNEL_FAN_SPEED, DEVICE_STATE)); assertEquals(packetType, msg.getPacketType()); @@ -75,12 +77,14 @@ public void testSomeMessages() throws RFXComException { @Test public void testCommandOn() throws RFXComException { - testCommand(CASAFAN, CHANNEL_COMMAND, OnOffType.ON, OnOffType.ON, UnDefType.UNDEF, StringType.valueOf("MED"), FAN); + testCommand(CASAFAN, CHANNEL_COMMAND, OnOffType.ON, OnOffType.ON, UnDefType.UNDEF, StringType.valueOf("MED"), + StringType.valueOf("MED"), FAN); } @Test public void testCommandOff() throws RFXComException { - testCommand(CASAFAN, CHANNEL_COMMAND, OnOffType.OFF, OnOffType.OFF, UnDefType.UNDEF, StringType.valueOf("OFF"), FAN); + testCommand(CASAFAN, CHANNEL_COMMAND, OnOffType.OFF, OnOffType.OFF, UnDefType.UNDEF, StringType.valueOf("OFF"), + StringType.valueOf("OFF"), FAN); } @Test @@ -105,80 +109,39 @@ public void testFanSpeedStringLow() throws RFXComException { @Test public void testFanLightOn() throws RFXComException { - testCommand(CASAFAN, CHANNEL_FAN_LIGHT, OnOffType.ON, null, OnOffType.ON, null, FAN); - } - - @Test - public void testFalmecCommandOn() throws RFXComException { - testCommand(FALMEC, CHANNEL_COMMAND, OnOffType.ON, OnOffType.ON, UnDefType.UNDEF, new DecimalType(2), FAN_FALMEC); - } - - @Test - public void testFalmecCommandOff() throws RFXComException { - testCommand(FALMEC, CHANNEL_COMMAND, OnOffType.OFF, OnOffType.OFF, UnDefType.UNDEF, new DecimalType(0), FAN_FALMEC); - } - - @Test - public void testFanSpeed0() throws RFXComException { - testFalmecFanSpeed(0, OnOffType.OFF); - } - - @Test - public void testFanSpeed1() throws RFXComException { - testFalmecFanSpeed(1, OnOffType.ON); - } - - @Test - public void testFanSpeed2() throws RFXComException { - testFalmecFanSpeed(2, OnOffType.ON); - } - - @Test - public void testFanSpeed3() throws RFXComException { - testFalmecFanSpeed(3, OnOffType.ON); - } - - @Test - public void testFanSpeed4() throws RFXComException { - testFalmecFanSpeed(4, OnOffType.ON); - } - - @Test - public void testFalmecFanLightOn() throws RFXComException { - testCommand(FALMEC, CHANNEL_FAN_LIGHT, OnOffType.ON, null, OnOffType.ON, null, FAN_FALMEC); - } - - @Test - public void testFalmecFanLightOff() throws RFXComException { - testCommand(FALMEC, CHANNEL_FAN_LIGHT, OnOffType.OFF, null, OnOffType.OFF, null, FAN_FALMEC); - } - - private void testFanSpeedString(String value, OnOffType expectedCommand, State expectedFanSpeed) throws RFXComException { - testCommand(CASAFAN, CHANNEL_FAN_SPEED, StringType.valueOf(value), expectedCommand, UnDefType.UNDEF, expectedFanSpeed, FAN); + testCommand(CASAFAN, CHANNEL_FAN_LIGHT, OnOffType.ON, null, OnOffType.ON, null, StringType.valueOf("LIGHT"), + FAN); } - private void testFalmecFanSpeed(int value, OnOffType expectedCommand) throws RFXComException { - testCommand(FALMEC, CHANNEL_FAN_SPEED, new DecimalType(value), expectedCommand, UnDefType.UNDEF, new DecimalType(value), FAN_FALMEC); + private void testFanSpeedString(String value, OnOffType expectedCommand, State expectedFanSpeed) + throws RFXComException { + testCommand(CASAFAN, CHANNEL_FAN_SPEED, StringType.valueOf(value), expectedCommand, UnDefType.UNDEF, + expectedFanSpeed, expectedFanSpeed, FAN); } - private void testCommand(RFXComFanMessage.SubType subType, String channel, State inputValue, OnOffType expectedCommand, State expectedLightCommand, State expectedFanSpeed, RFXComBaseMessage.PacketType packetType) throws RFXComException { + static void testCommand(RFXComFanMessage.SubType subType, String channel, State inputValue, + @Nullable OnOffType expectedCommand, State expectedLightCommand, @Nullable State expectedFanSpeed, + State expectedCommandString, RFXComBaseMessage.PacketType packetType) throws RFXComException { RFXComFanMessage msg = new RFXComFanMessage(); msg.setSubType(subType); msg.convertFromState(channel, inputValue); - assertValues(msg, expectedCommand, expectedLightCommand, expectedFanSpeed, packetType); + assertValues(msg, expectedCommand, expectedLightCommand, expectedFanSpeed, packetType, expectedCommandString); RFXComFanMessage result = new RFXComFanMessage(); result.encodeMessage(msg.decodeMessage()); - assertValues(msg, expectedCommand, expectedLightCommand, expectedFanSpeed, packetType); + assertValues(msg, expectedCommand, expectedLightCommand, expectedFanSpeed, packetType, expectedCommandString); } - private void assertValues(RFXComFanMessage msg, OnOffType expectedCommand, State expectedLightCommand, State expectedFanSpeed, RFXComBaseMessage.PacketType packetType) throws RFXComException { - assertEquals(expectedCommand, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(expectedLightCommand, msg.convertToState(CHANNEL_FAN_LIGHT)); - assertEquals(expectedFanSpeed, msg.convertToState(CHANNEL_FAN_SPEED)); + private static void assertValues(RFXComFanMessage msg, @Nullable OnOffType expectedCommand, + State expectedLightCommand, @Nullable State expectedFanSpeed, RFXComBaseMessage.PacketType packetType, + State expectedCommandString) throws RFXComException { + assertEquals(expectedCommand, msg.convertToState(CHANNEL_COMMAND, DEVICE_STATE)); + assertEquals(expectedLightCommand, msg.convertToState(CHANNEL_FAN_LIGHT, DEVICE_STATE)); + assertEquals(expectedFanSpeed, msg.convertToState(CHANNEL_FAN_SPEED, DEVICE_STATE)); + assertEquals(expectedCommandString, msg.convertToState(CHANNEL_COMMAND_STRING, DEVICE_STATE)); assertEquals(packetType, msg.getPacketType()); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComGasMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComGasMessageTest.java index 05bfc4281a413..d88328d9e7cad 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComGasMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComGasMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComGasMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortTest.java index fe0cc721f8bc6..9026230c264e9 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHomeConfortTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.HOME_CONFORT; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -24,12 +25,12 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden - Initial contribution of empty test + * @author Martin van Wingerden - Initial contribution * @author Mike Jagdis - added message handling and real test */ +@NonNullByDefault public class RFXComHomeConfortTest { private void testMessage(SubType subType, Commands command, String deviceId, String data) throws RFXComException { - RFXComHomeConfortMessage message = (RFXComHomeConfortMessage) RFXComMessageFactory.createMessage(HOME_CONFORT); message.setSubType(subType); message.command = command; diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessageTest.java index ed49e73195b75..be19b02abe232 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComHumidityMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,8 +22,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComHumidityMessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComIOLinesMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComIOLinesMessageTest.java index b8f8e985b2100..08e69b6882999 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComIOLinesMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComIOLinesMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComIOLinesMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessageTest.java index 8be29f545d45a..620dec0ed6ec0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceControlMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage.TransceiverType._433_92MHZ_TRANSCEIVER; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Before; import org.junit.Test; @@ -24,8 +25,9 @@ /** * Test for RFXCom-binding * - * @author Mike Jagdis + * @author Mike Jagdis - Initial contribution */ +@NonNullByDefault public class RFXComInterfaceControlMessageTest { private RFXComBridgeConfiguration configuration = new RFXComBridgeConfiguration(); @@ -61,8 +63,7 @@ public void resetConfig() { } private void testMessage(RFXComInterfaceMessage.TransceiverType transceiverType, - RFXComBridgeConfiguration configuration, String data) throws RFXComException { - + RFXComBridgeConfiguration configuration, String data) { assertArrayEquals(HexUtils.hexToBytes(data), new RFXComInterfaceControlMessage(transceiverType, configuration).decodeMessage()); } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessageTest.java index 5c6340fa4d046..6d66bb2f355f0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInterfaceMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage.SubType.START_RECEIVER; import static org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage.TransceiverType._433_92MHZ_TRANSCEIVER; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -27,11 +28,12 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComInterfaceMessageTest { - private RFXComInterfaceMessage testMessage(String hexMsg, SubType subType, int seqNbr, Commands command, - boolean skipDecode) throws RFXComException { + private RFXComInterfaceMessage testMessage(String hexMsg, SubType subType, int seqNbr, Commands command) + throws RFXComException { RFXComInterfaceMessage msg = (RFXComInterfaceMessage) RFXComMessageFactory .createMessage(HexUtils.hexToBytes(hexMsg)); assertEquals("SubType", subType, msg.subType); @@ -44,20 +46,19 @@ private RFXComInterfaceMessage testMessage(String hexMsg, SubType subType, int s @Test public void testWelcomeCopyRightMessage() throws RFXComException { RFXComInterfaceMessage msg = testMessage("1401070307436F7079726967687420524658434F4D", START_RECEIVER, 3, - Commands.START_RECEIVER, true); + Commands.START_RECEIVER); assertEquals("text", "Copyright RFXCOM", msg.text); } @Test public void testRespondOnUnknownMessage() throws RFXComException { - testMessage("0D01FF190053E2000C2701020000", UNKNOWN_COMMAND, 25, UNSUPPORTED_COMMAND, true); + testMessage("0D01FF190053E2000C2701020000", UNKNOWN_COMMAND, 25, UNSUPPORTED_COMMAND); } @Test public void testStatusMessage() throws RFXComException { - RFXComInterfaceMessage msg = testMessage("1401000102530C0800270001031C04524658434F4D", RESPONSE, 1, GET_STATUS, - false); + RFXComInterfaceMessage msg = testMessage("1401000102530C0800270001031C04524658434F4D", RESPONSE, 1, GET_STATUS); assertEquals("Command", _433_92MHZ_TRANSCEIVER, msg.transceiverType); diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInvalidMessageTypeTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInvalidMessageTypeTest.java index 8f4c1ee5df922..9789b4246dcc3 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInvalidMessageTypeTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComInvalidMessageTypeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -20,13 +21,14 @@ /** * Test for RFXCom-binding * - * @author James Hewitt-Thomas + * @author James Hewitt-Thomas - Initial contribution */ +@NonNullByDefault public class RFXComInvalidMessageTypeTest { @Test(expected = RFXComUnsupportedValueException.class) public void testMessage() throws RFXComException { byte[] message = HexUtils.hexToBytes("07CC01271356ECC0"); - final RFXComMessage msg = RFXComMessageFactory.createMessage(message); + RFXComMessageFactory.createMessage(message); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1MessageTest.java index d4a5778af3b45..7e6e24f4b0fd6 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.OpenClosedType; import org.eclipse.smarthome.core.library.types.StringType; @@ -27,12 +28,14 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting1MessageTest { + private final MockDeviceState deviceState = new MockDeviceState(); private void testMessage(String hexMsg, RFXComLighting1Message.SubType subType, int seqNbr, String deviceId, - byte signalLevel, Commands command, String commandString) throws RFXComException { + byte signalLevel, Commands command, String commandString) throws RFXComException { final RFXComLighting1Message msg = (RFXComLighting1Message) RFXComMessageFactory .createMessage(HexUtils.hexToBytes(hexMsg)); assertEquals("SubType", subType, msg.subType); @@ -40,7 +43,8 @@ private void testMessage(String hexMsg, RFXComLighting1Message.SubType subType, assertEquals("Sensor Id", deviceId, msg.getDeviceId()); assertEquals("Signal Level", signalLevel, msg.signalLevel); assertEquals("Command", command, msg.command); - assertEquals("Command String", commandString, msg.convertToState(CHANNEL_COMMAND_STRING).toString()); + assertEquals("Command String", commandString, + msg.convertToState(CHANNEL_COMMAND_STRING, deviceState).toString()); byte[] decoded = msg.decodeMessage(); @@ -49,7 +53,8 @@ private void testMessage(String hexMsg, RFXComLighting1Message.SubType subType, @Test public void testSomeMessages() throws RFXComException { - testMessage("0710015242080780", RFXComLighting1Message.SubType.ARC, 82, "B.8", (byte) 8, Commands.CHIME, "CHIME"); + testMessage("0710015242080780", RFXComLighting1Message.SubType.ARC, 82, "B.8", (byte) 8, Commands.CHIME, + "CHIME"); testMessage("0710010047010070", RFXComLighting1Message.SubType.ARC, 0, "G.1", (byte) 7, Commands.OFF, "OFF"); testMessage("071001014D090160", RFXComLighting1Message.SubType.ARC, 1, "M.9", (byte) 6, Commands.ON, "ON"); @@ -67,9 +72,9 @@ public void testCommandStringOff() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("OFF")); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OpenClosedType.CLOSED, msg.convertToState(CHANNEL_CONTACT)); - assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OpenClosedType.CLOSED, msg.convertToState(CHANNEL_CONTACT, deviceState)); + assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -78,9 +83,9 @@ public void testCommandStringChime() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("chime")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OpenClosedType.OPEN, msg.convertToState(CHANNEL_CONTACT)); - assertEquals(StringType.valueOf("CHIME"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OpenClosedType.OPEN, msg.convertToState(CHANNEL_CONTACT, deviceState)); + assertEquals(StringType.valueOf("CHIME"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -89,9 +94,9 @@ public void testCommandStringBright() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("bright")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OpenClosedType.OPEN, msg.convertToState(CHANNEL_CONTACT)); - assertEquals(StringType.valueOf("BRIGHT"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OpenClosedType.OPEN, msg.convertToState(CHANNEL_CONTACT, deviceState)); + assertEquals(StringType.valueOf("BRIGHT"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -100,9 +105,9 @@ public void testCommandStringDim() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("dim")); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OpenClosedType.CLOSED, msg.convertToState(CHANNEL_CONTACT)); - assertEquals(StringType.valueOf("DIM"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OpenClosedType.CLOSED, msg.convertToState(CHANNEL_CONTACT, deviceState)); + assertEquals(StringType.valueOf("DIM"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2MessageTest.java index 60835efaf5c10..4f5b2fe7bf508 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting2MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,8 +22,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting2MessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting3MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting3MessageTest.java index 74b25f21b506f..af7d262f8d41e 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting3MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting3MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting3MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4MessageTest.java index e230dcac38051..7634aed4eab89 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting4MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,8 @@ import java.util.Arrays; import java.util.List; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; @@ -31,8 +33,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting4MessageTest { @Test public void basicBoundaryCheck() throws RFXComException { @@ -47,17 +50,17 @@ public void basicBoundaryCheck() throws RFXComException { RFXComLighting4Message msg = (RFXComLighting4Message) RFXComMessageFactory.createMessage(binaryMessage); assertEquals("Sensor Id", "90000", msg.getDeviceId()); - } - private void testMessage(String hexMsg, RFXComLighting4Message.SubType subType, String deviceId, Integer pulse, - RFXComLighting4Message.Commands command, Integer seqNbr, int signalLevel, int offCommand, int onCommand) - throws RFXComException { + private void testMessage(String hexMsg, RFXComLighting4Message.SubType subType, String deviceId, + @Nullable Integer pulse, RFXComLighting4Message.Commands command, @Nullable Integer seqNbr, int signalLevel, + int offCommand, int onCommand) throws RFXComException { testMessage(hexMsg, subType, deviceId, pulse, command.toByte(), seqNbr, signalLevel, offCommand, onCommand); } - private void testMessage(String hexMsg, RFXComLighting4Message.SubType subType, String deviceId, Integer pulse, - byte commandByte, Integer seqNbr, int signalLevel, int offCommand, int onCommand) throws RFXComException { + private void testMessage(String hexMsg, RFXComLighting4Message.SubType subType, String deviceId, + @Nullable Integer pulse, byte commandByte, @Nullable Integer seqNbr, int signalLevel, int offCommand, + int onCommand) throws RFXComException { RFXComLighting4Message msg = (RFXComLighting4Message) RFXComMessageFactory .createMessage(HexUtils.hexToBytes(hexMsg)); assertEquals("Sensor Id", deviceId, msg.getDeviceId()); @@ -87,12 +90,12 @@ public void testSomeMessages() throws RFXComException { } @Test - public void test_some_alarm_remote() throws RFXComException { + public void testSomeAlarmRemote() throws RFXComException { testMessage("0913004A0D8998016E60", PT2262, "55449", 366, ON_8, 74, 2, 4, 8); } @Test - public void test_cheap_pir_sensor() throws RFXComException { + public void testCheapPirSensor() throws RFXComException { testMessage("091300EF505FC6019670", PT2262, "329212", 406, ON_6, 239, 2, 4, 6); } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5MessageTest.java index 4050547b4673a..666c3fe88433a 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting5MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComLighting5Message.Commands.*; import static org.openhab.binding.rfxcom.internal.messages.RFXComLighting5Message.SubType.IT; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.util.HexUtils; @@ -28,9 +29,11 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting5MessageTest { + private final MockDeviceState deviceState = new MockDeviceState(); @Test public void convertFromStateItMessage() throws RFXComException { @@ -64,7 +67,7 @@ public void testStringCommandOpenRelay() throws RFXComUnsupportedChannelExceptio RFXComLighting5Message msg = new RFXComLighting5Message(); msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("OPEN_RELAY")); - assertEquals(StringType.valueOf("OPEN_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(StringType.valueOf("OPEN_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); assertEquals(OPEN_RELAY, msg.command); } @@ -73,7 +76,7 @@ public void testStringCommandCloseRelay() throws RFXComUnsupportedChannelExcepti RFXComLighting5Message msg = new RFXComLighting5Message(); msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("CLOSE_RELAY")); - assertEquals(StringType.valueOf("CLOSE_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(StringType.valueOf("CLOSE_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); assertEquals(CLOSE_RELAY, msg.command); } @@ -82,7 +85,7 @@ public void testStringCommandStopRelay() throws RFXComUnsupportedChannelExceptio RFXComLighting5Message msg = new RFXComLighting5Message(); msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("STOP_RELAY")); - assertEquals(StringType.valueOf("STOP_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(StringType.valueOf("STOP_RELAY"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); assertEquals(STOP_RELAY, msg.command); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6MessageTest.java index 7c71233c8d9af..40e9e30dc78a8 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComLighting6MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,8 +22,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComLighting6MessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComPowerMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComPowerMessageTest.java index 51c6adf138666..803dba8e4d6cf 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComPowerMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComPowerMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,14 +12,16 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComPowerMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXMeterMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXMeterMessageTest.java index b06d9ac539106..7fe843b7d2fa4 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXMeterMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXMeterMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRFXMeterMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessageTest.java index c85b765283f70..ac41d3b9f7e77 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRFXSensorMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,19 +12,91 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import static org.junit.Assert.assertEquals; +import static org.openhab.binding.rfxcom.internal.RFXComBindingConstants.*; +import static org.openhab.binding.rfxcom.internal.messages.RFXComRFXSensorMessage.SubType.*; + +import javax.xml.bind.DatatypeConverter; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.types.State; import org.junit.Test; -import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; -import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; +import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; +import org.openhab.binding.rfxcom.internal.handler.DeviceState; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRFXSensorMessageTest { + private final MockDeviceState mockedDeviceState = new MockDeviceState(); + + private void testMessage(String hexMsg, RFXComRFXSensorMessage.SubType subType, int seqNbr, String deviceId, + @Nullable Double temperature, @Nullable Double voltage, @Nullable Double referenceVoltage, + @Nullable Double expectedPressure, @Nullable Double expectedHumidity, int signalLevel, + DeviceState deviceState) throws RFXComException { + final RFXComRFXSensorMessage msg = (RFXComRFXSensorMessage) RFXComMessageFactory + .createMessage(DatatypeConverter.parseHexBinary(hexMsg)); + assertEquals("SubType", subType, msg.subType); + assertEquals("Seq Number", seqNbr, (short) (msg.seqNbr & 0xFF)); + assertEquals("Sensor Id", deviceId, msg.getDeviceId()); + assertEquals("Signal Level", signalLevel, msg.signalLevel); + assertEquals("Temperature", temperature, getMessageTemperature(msg, deviceState)); + assertEquals("Voltage", voltage, getChannelAsDouble(CHANNEL_VOLTAGE, msg, deviceState)); + assertEquals("Reference Voltage", referenceVoltage, + getChannelAsDouble(CHANNEL_REFERENCE_VOLTAGE, msg, deviceState)); + assertEquals("Humidity", expectedHumidity, getChannelAsDouble(CHANNEL_HUMIDITY, msg, deviceState)); + assertEquals("Pressure", expectedPressure, getChannelAsDouble(CHANNEL_PRESSURE, msg, deviceState)); + + byte[] decoded = msg.decodeMessage(); + + assertEquals("Message converted back", hexMsg, DatatypeConverter.printHexBinary(decoded)); + } + + @Test + public void testSomeMessages() throws RFXComException { + testMessage("0770000008080270", TEMPERATURE, 0, "8", 20.5d, null, null, null, null, 7, mockedDeviceState); + testMessage("0770000208809650", TEMPERATURE, 2, "8", -1.5d, null, null, null, null, 5, mockedDeviceState); + testMessage("077002010801F270", VOLTAGE, 1, "8", null, null, 4.98, null, null, 7, mockedDeviceState); + testMessage("077001020800F470", A_D, 2, "8", null, 2.44, null, null, null, 7, mockedDeviceState); + } + + @Test + public void testPressure() throws RFXComException { + MockDeviceState deviceState = new MockDeviceState(); + deviceState.set(CHANNEL_REFERENCE_VOLTAGE, new DecimalType(4.98)); + + testMessage("077001020800F470", A_D, 2, "8", null, 2.44, null, 650.0, null, 7, deviceState); + } + + @Test + public void testHumidity() throws RFXComException { + MockDeviceState deviceState = new MockDeviceState(); + deviceState.set(CHANNEL_TEMPERATURE, new DecimalType(20.5)); + deviceState.set(CHANNEL_REFERENCE_VOLTAGE, new DecimalType(4.98)); + + testMessage("077001020800F470", A_D, 2, "8", null, 2.44, null, 650.0, 52.6821, 7, deviceState); + } + + private @Nullable Double getMessageTemperature(RFXComRFXSensorMessage msg, DeviceState deviceState) + throws RFXComException { + return getChannelAsDouble(CHANNEL_TEMPERATURE, msg, deviceState); + } + + private @Nullable Double getChannelAsDouble(String channelId, RFXComRFXSensorMessage msg, DeviceState deviceState) + throws RFXComException { + return getStateAsDouble(msg.convertToState(channelId, deviceState)); + } - @Test(expected = RFXComMessageNotImplementedException.class) - public void checkNotImplemented() throws Exception { - RFXComMessageFactory.createMessage(PacketType.RFXSENSOR); + private @Nullable Double getStateAsDouble(State state) { + if (state instanceof DecimalType) { + return ((DecimalType) state).doubleValue(); + } else { + return null; + } } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRadiator1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRadiator1MessageTest.java index 1c40e886dc8d1..97508cf3ea8b9 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRadiator1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRadiator1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,14 +14,16 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.RADIATOR1; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRadiator1MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessageTest.java index e555142493f3e..10bc3a64dc0e0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRainMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComRainMessage.SubType.RAIN2; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRainMessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRemoteControlMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRemoteControlMessageTest.java index 51c0b35a54a64..42773123e8033 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRemoteControlMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRemoteControlMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRemoteControlMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessageTest.java index 04cf080e36c8f..161f07a8c3631 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComRfyMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.RFY; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -24,8 +25,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComRfyMessageTest { @Test @@ -39,7 +41,6 @@ public void basicBoundaryCheck() throws RFXComException { } private void testMessage(SubType subType, Commands command, String deviceId, String data) throws RFXComException { - RFXComRfyMessage message = (RFXComRfyMessage) RFXComMessageFactory.createMessage(RFY); message.setSubType(subType); message.command = command; diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1MessageTest.java index 05a6a4c65e36a..54a6a5fe8ecee 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,8 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComSecurity1Message.SubType.*; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,16 +24,18 @@ import org.openhab.binding.rfxcom.internal.messages.RFXComSecurity1Message.Contact; import org.openhab.binding.rfxcom.internal.messages.RFXComSecurity1Message.Motion; import org.openhab.binding.rfxcom.internal.messages.RFXComSecurity1Message.Status; +import org.openhab.binding.rfxcom.internal.messages.RFXComSecurity1Message.SubType; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComSecurity1MessageTest { - private void testSomeMessages(String hexMessage, RFXComSecurity1Message.SubType subType, int sequenceNumber, - String deviceId, int batteryLevel, Contact contact, Motion motion, Status status, int signalLevel) - throws RFXComException { + private void testSomeMessages(String hexMessage, @Nullable SubType subType, int sequenceNumber, + @Nullable String deviceId, int batteryLevel, @Nullable Contact contact, @Nullable Motion motion, + @Nullable Status status, int signalLevel) throws RFXComException { byte[] message = HexUtils.hexToBytes(hexMessage); RFXComSecurity1Message msg = (RFXComSecurity1Message) RFXComMessageFactory.createMessage(message); assertEquals("SubType", subType, msg.subType); diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2MessageTest.java index 13c372b97b210..02c2462c08b0f 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComSecurity2MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,9 +23,10 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden - Initial contribution of empty test + * @author Martin van Wingerden - Initial contribution * @author Mike Jagdis - added message handling and real test */ +@NonNullByDefault public class RFXComSecurity2MessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessageTest.java index 564cb68ab93c2..5e888c7e5408e 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityBarometricMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,20 +17,21 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureHumidityBarometricMessage.HumidityStatus.DRY; import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureHumidityBarometricMessage.SubType.THB2; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; -import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComTemperatureHumidityBarometricMessageTest { @Test - public void testSomeMessages() throws RFXComException, RFXComMessageNotImplementedException { + public void testSomeMessages() throws RFXComException { String hexMessage = "0D54020EE90000C9270203E70439"; byte[] message = HexUtils.hexToBytes(hexMessage); RFXComTemperatureHumidityBarometricMessage msg = (RFXComTemperatureHumidityBarometricMessage) RFXComMessageFactory diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessageTest.java index 1973817d4e5f5..c86ff87201bfe 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureHumidityMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,7 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureHumidityMessage.HumidityStatus.*; import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureHumidityMessage.SubType.*; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -24,9 +25,10 @@ /** * Test for RFXCom-binding * - * @author Ivan F. Martinez - * @author Martin van Wingerden + * @author Ivan F. Martinez - Initial contribution + * @author Martin van Wingerden - Extended tests */ +@NonNullByDefault public class RFXComTemperatureHumidityMessageTest { private void testMessage(String hexMsg, RFXComTemperatureHumidityMessage.SubType subType, int seqNbr, int sensorId, diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessageTest.java index bb308ff257ff8..673b5479d1ae4 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureMessage.SubType.*; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComTemperatureMessageTest { private void testMessage(String hexMsg, RFXComTemperatureMessage.SubType subType, int seqNbr, String deviceId, double temperature, int signalLevel, int bateryLevel) throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessageTest.java index ed2f96fd356d8..2260eeab7e992 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTemperatureRainMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComTemperatureRainMessage.SubType.WS1200; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComTemperatureRainMessageTest { @Test public void testSomeMessages() throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTestHelper.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTestHelper.java index cdd3c13113d7c..632cb97574c73 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTestHelper.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTestHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,8 @@ import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.thing.ThingUID; @@ -25,9 +27,10 @@ /** * Helper class for testing the RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ -public class RFXComTestHelper { +@NonNullByDefault +class RFXComTestHelper { static void basicBoundaryCheck(PacketType packetType, RFXComMessage message) throws RFXComException { // This is a place where its easy to make mistakes in coding, and can result in errors, normally // array bounds errors @@ -36,7 +39,7 @@ static void basicBoundaryCheck(PacketType packetType, RFXComMessage message) thr assertEquals("Wrong packet type", packetType.toByte(), binaryMessage[1]); } - static void checkDiscoveryResult(RFXComDeviceMessage msg, String deviceId, Integer pulse, String subType, + static void checkDiscoveryResult(RFXComDeviceMessage msg, String deviceId, @Nullable Integer pulse, String subType, int offCommand, int onCommand) throws RFXComException { String thingUID = "homeduino:rfxcom:fssfsd:thing"; DiscoveryResultBuilder builder = DiscoveryResultBuilder.create(new ThingUID(thingUID)); @@ -55,6 +58,6 @@ static void checkDiscoveryResult(RFXComDeviceMessage msg, String deviceId, Integ } static int getActualIntValue(RFXComDeviceMessage msg, String channelId) throws RFXComException { - return ((DecimalType) msg.convertToState(channelId)).intValue(); + return ((DecimalType) msg.convertToState(channelId, new MockDeviceState())).intValue(); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1MessageTest.java index 04f822d4dd8b7..c2157db153a90 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat1MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,8 +22,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComThermostat1MessageTest { @Test diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat2MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat2MessageTest.java index 48c3505260358..204bc73d8f4f2 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat2MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat2MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComThermostat2MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3MessageTest.java index ec809a39c6a86..d528749ca7524 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat3MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,8 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.THERMOSTAT3; import static org.openhab.binding.rfxcom.internal.messages.RFXComThermostat3Message.SubType.*; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.StopMoveType; import org.eclipse.smarthome.core.library.types.StringType; @@ -33,7 +35,10 @@ * * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComThermostat3MessageTest { + private final MockDeviceState deviceState = new MockDeviceState(); + @Test public void checkForSupportTest() throws RFXComException { RFXComMessageFactory.createMessage(THERMOSTAT3); @@ -60,7 +65,8 @@ public void testSomeMessages() throws RFXComException { private void testMessage(String hexMessage, RFXComThermostat3Message.SubType subtype, int sequenceNumber, String sensorId, RFXComThermostat3Message.Commands command, byte signalLevel, State commandChannel, - State secondCommandChannel, State controlChannel, State commandStringChannel) throws RFXComException { + @Nullable State secondCommandChannel, State controlChannel, State commandStringChannel) + throws RFXComException { byte[] message = HexUtils.hexToBytes(hexMessage); RFXComThermostat3Message msg = (RFXComThermostat3Message) RFXComMessageFactory.createMessage(message); assertEquals("SubType", subtype, msg.subType); @@ -69,10 +75,10 @@ private void testMessage(String hexMessage, RFXComThermostat3Message.SubType sub assertEquals(CHANNEL_COMMAND, command, msg.command); assertEquals("Signal Level", signalLevel, msg.signalLevel); - assertEquals(commandChannel, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(secondCommandChannel, msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertEquals(controlChannel, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(commandStringChannel, msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(commandChannel, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(secondCommandChannel, msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertEquals(controlChannel, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(commandStringChannel, msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); byte[] decoded = msg.decodeMessage(); @@ -86,10 +92,10 @@ public void testCommandChannelOn() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND, OnOffType.ON); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("ON"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("ON"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -98,10 +104,10 @@ public void testCommandChannelOff() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND, OnOffType.OFF); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_CONTROL)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -110,10 +116,10 @@ public void testSecondCommandChannelOn() throws RFXComUnsupportedChannelExceptio msg.convertFromState(CHANNEL_COMMAND_SECOND, OnOffType.ON); - assertNull(msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("SECOND_ON"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertNull(msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("SECOND_ON"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -122,10 +128,10 @@ public void testSecondCommandChannelOff() throws RFXComUnsupportedChannelExcepti msg.convertFromState(CHANNEL_COMMAND_SECOND, OnOffType.OFF); - assertNull(msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("SECOND_OFF"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertNull(msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("SECOND_OFF"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); } @Test @@ -134,11 +140,11 @@ public void testControlUp() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_CONTROL, UpDownType.UP); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("UP"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("UP"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -147,11 +153,11 @@ public void testControlDown() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_CONTROL, UpDownType.DOWN); - assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -160,11 +166,11 @@ public void testControlStop() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_CONTROL, StopMoveType.STOP); - assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(StringType.valueOf("STOP"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(StringType.valueOf("STOP"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -173,10 +179,10 @@ public void testCommandStringOff() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("OFF")); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("OFF"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -185,10 +191,10 @@ public void testCommandStringOn() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("On")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("ON"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("ON"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -197,11 +203,11 @@ public void testCommandStringUp() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("UP")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("UP"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("UP"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -210,10 +216,10 @@ public void testCommandStringDown() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("down")); - assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -222,10 +228,10 @@ public void testCommandStringRunUp() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("RUN_UP")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("RUN_UP"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.UP, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("RUN_UP"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -234,10 +240,10 @@ public void testCommandStringRunDown() throws RFXComUnsupportedChannelException msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("RUN_DOWN")); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL)); - assertEquals(StringType.valueOf("RUN_DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(UpDownType.DOWN, msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertEquals(StringType.valueOf("RUN_DOWN"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -246,11 +252,11 @@ public void testCommandStringStop() throws RFXComUnsupportedChannelException { msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("STOP")); - assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND)); - assertEquals(StringType.valueOf("STOP"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(UnDefType.UNDEF, msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertEquals(StringType.valueOf("STOP"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); - assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); + assertNull(msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); } @Test @@ -259,11 +265,11 @@ public void testCommandStringSecondOn() throws RFXComUnsupportedChannelException msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("SECOND_ON")); - assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertEquals(StringType.valueOf("SECOND_ON"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.ON, msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertEquals(StringType.valueOf("SECOND_ON"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_COMMAND)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); + assertNull(msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); } @Test @@ -272,10 +278,10 @@ public void testCommandStringSecondOff() throws RFXComUnsupportedChannelExceptio msg.convertFromState(CHANNEL_COMMAND_STRING, StringType.valueOf("SECOND_OFF")); - assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND_SECOND)); - assertEquals(StringType.valueOf("SECOND_OFF"), msg.convertToState(CHANNEL_COMMAND_STRING)); + assertEquals(OnOffType.OFF, msg.convertToState(CHANNEL_COMMAND_SECOND, deviceState)); + assertEquals(StringType.valueOf("SECOND_OFF"), msg.convertToState(CHANNEL_COMMAND_STRING, deviceState)); - assertNull(msg.convertToState(CHANNEL_COMMAND)); - assertNull(msg.convertToState(CHANNEL_CONTROL)); + assertNull(msg.convertToState(CHANNEL_COMMAND, deviceState)); + assertNull(msg.convertToState(CHANNEL_CONTROL, deviceState)); } } diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat4MessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat4MessageTest.java index fef5950facc7a..5a64e03d43038 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat4MessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComThermostat4MessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,14 +14,16 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType.THERMOSTAT4; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComThermostat4MessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessageTest.java index 1da036b8252b3..acfa85b364350 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComTransmitterMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,7 @@ import static org.openhab.binding.rfxcom.internal.messages.RFXComTransmitterMessage.Response.ACK; import static org.openhab.binding.rfxcom.internal.messages.RFXComTransmitterMessage.SubType.RESPONSE; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -25,8 +26,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComTransmitterMessageTest { private void testMessage(String hexMsg, Response response, SubType subType, int seqNbr) throws RFXComException { final RFXComTransmitterMessage msg = (RFXComTransmitterMessage) RFXComMessageFactory diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessageTest.java index 7d784ca1499d2..d8cb71efc7dbe 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUVMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -21,9 +22,10 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden - * @author Mike Jagdis + * @author Martin van Wingerden - Initial contribution + * @author Mike Jagdis - Added actual functional tests */ +@NonNullByDefault public class RFXComUVMessageTest { @Test public void testMessage1() throws RFXComException { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessageTest.java index 7ef7efcdcd2ac..2fcaed921a77b 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComUndecodedRFMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.junit.Assert.assertEquals; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -23,9 +24,10 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden - * @author James Hewitt-Thomas + * @author Martin van Wingerden - Initial contribution + * @author James Hewitt-Thomas - Added first actual tests */ +@NonNullByDefault public class RFXComUndecodedRFMessageTest { private void testMessage(String hexMsg, RFXComUndecodedRFMessage.SubType subType, int seqNbr, String rawPayload) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWaterMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWaterMessageTest.java index 5eccf08f35ab7..10606749cce92 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWaterMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWaterMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComWaterMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWeightMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWeightMessageTest.java index 63f7e7cdab280..9933f3b320ca0 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWeightMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWeightMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.rfxcom.internal.messages; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComMessageNotImplementedException; import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage.PacketType; @@ -19,8 +20,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComWeightMessageTest { @Test(expected = RFXComMessageNotImplementedException.class) public void checkNotImplemented() throws Exception { diff --git a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessageTest.java b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessageTest.java index 700e9a9e444c5..88e0565c699eb 100644 --- a/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessageTest.java +++ b/bundles/org.openhab.binding.rfxcom/src/test/java/org/openhab/binding/rfxcom/internal/messages/RFXComWindMessageTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,6 +15,7 @@ import static org.junit.Assert.assertEquals; import static org.openhab.binding.rfxcom.internal.messages.RFXComWindMessage.SubType.WIND1; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.util.HexUtils; import org.junit.Test; import org.openhab.binding.rfxcom.internal.exceptions.RFXComException; @@ -22,8 +23,9 @@ /** * Test for RFXCom-binding * - * @author Martin van Wingerden + * @author Martin van Wingerden - Initial contribution */ +@NonNullByDefault public class RFXComWindMessageTest { @Test public void testSomeMessages() throws RFXComException { diff --git a/bundles/org.openhab.binding.rme/NOTICE b/bundles/org.openhab.binding.rme/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.rme/NOTICE +++ b/bundles/org.openhab.binding.rme/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.rme/pom.xml b/bundles/org.openhab.binding.rme/pom.xml index adf65aae87a92..b578ed3f856ce 100644 --- a/bundles/org.openhab.binding.rme/pom.xml +++ b/bundles/org.openhab.binding.rme/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.rme</artifactId> diff --git a/bundles/org.openhab.binding.rme/src/main/feature/feature.xml b/bundles/org.openhab.binding.rme/src/main/feature/feature.xml index fe93fa25bcf85..c63a7ae985243 100644 --- a/bundles/org.openhab.binding.rme/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.rme/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.rme-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-rme" description="RME Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEBindingConstants.java b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEBindingConstants.java index 3aa75b1e72b6f..c2b23b72cf428 100644 --- a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEBindingConstants.java +++ b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEHandlerFactory.java b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEHandlerFactory.java index 842646058e525..f2d020d50423f 100644 --- a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEHandlerFactory.java +++ b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/RMEHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/RMEThingHandler.java b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/RMEThingHandler.java index 2bd992955685f..49b28e76dfbaa 100644 --- a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/RMEThingHandler.java +++ b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/RMEThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java index 0cef7b98930ee..d2a79f192ae53 100644 --- a/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java +++ b/bundles/org.openhab.binding.rme/src/main/java/org/openhab/binding/rme/internal/handler/SerialThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/NOTICE b/bundles/org.openhab.binding.robonect/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.robonect/NOTICE +++ b/bundles/org.openhab.binding.robonect/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.robonect/README.md b/bundles/org.openhab.binding.robonect/README.md index 7b6298fdf4ddb..9bcfd4c004f7b 100644 --- a/bundles/org.openhab.binding.robonect/README.md +++ b/bundles/org.openhab.binding.robonect/README.md @@ -2,7 +2,7 @@ Robonect is a piece of hardware which has to be put into your Husqvarna, Gardena and other branded automower and makes it accessible in your internal network. -More details about the Robonect module can be found at [robonect.de](http://www.robonect.de) +More details about the Robonect module can be found at [robonect.de](https://forum.robonect.de/) This binding integrates mowers having the robonect module installed as a thing into the home automation solution, allowing to control the mower and react on mower status changes in rules. diff --git a/bundles/org.openhab.binding.robonect/pom.xml b/bundles/org.openhab.binding.robonect/pom.xml index 488168a7494af..0e4074dd329c0 100644 --- a/bundles/org.openhab.binding.robonect/pom.xml +++ b/bundles/org.openhab.binding.robonect/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.robonect</artifactId> diff --git a/bundles/org.openhab.binding.robonect/src/main/feature/feature.xml b/bundles/org.openhab.binding.robonect/src/main/feature/feature.xml index 172582612cbfa..ccc77ebac3e70 100644 --- a/bundles/org.openhab.binding.robonect/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.robonect/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.robonect-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-robonect" description="Robonect Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java index 6c0faf36a464b..61b68ff47fadc 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectClient.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectClient.java index e5d0fd60f218e..1bef800975c74 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectClient.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectCommunicationException.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectCommunicationException.java index 9097c72065c84..a6579c55bae96 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectCommunicationException.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectEndpoint.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectEndpoint.java index 8afeef45e14a4..cdbef928859d6 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectEndpoint.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectHandlerFactory.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectHandlerFactory.java index 107ac518692ba..a7826b46ef912 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectHandlerFactory.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/RobonectHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/JobChannelConfig.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/JobChannelConfig.java index d4cb3d7804968..75543dd60212a 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/JobChannelConfig.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/JobChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/RobonectConfig.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/RobonectConfig.java index 12aef32573bb0..53b3cec6a2372 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/RobonectConfig.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/config/RobonectConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java index 9eaaa667ead85..558ae1c52a694 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/handler/RobonectHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorEntry.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorEntry.java index 37d3f002c0203..ec9a4da22b57a 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorEntry.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorList.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorList.java index 5480aa87d4dea..2cbd2d2b170f4 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorList.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ErrorList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Health.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Health.java index d7a9dd7b4e764..3f5ea7fbe62ad 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Health.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Health.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ModelParser.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ModelParser.java index bc326364838f2..59cc8fa3ec0ab 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ModelParser.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/ModelParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java index 1967df36ba28c..bedf018fd227d 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerMode.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerMode.java index ae71d49d8b45c..28abf8930948e 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerMode.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerModeDeserializer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerModeDeserializer.java index fbd8da744ed98..56212d25ed696 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerModeDeserializer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerModeDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatus.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatus.java index 7d33510b7c535..31933364d4573 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatus.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatusDeserializer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatusDeserializer.java index 3381c5f42a5bd..38668d5827f3b 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatusDeserializer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/MowerStatusDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Name.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Name.java index a6ab47c12d1b8..5061bd4bc2a8e 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Name.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Name.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/NextTimer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/NextTimer.java index 47ed29b11fd6e..1cf3393da288b 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/NextTimer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/NextTimer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/RobonectAnswer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/RobonectAnswer.java index 2eda07f22cfc6..b5a44fccf98a6 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/RobonectAnswer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/RobonectAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Status.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Status.java index 9128dc434af42..b491db6c1ee14 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Status.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Status.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Timer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Timer.java index 45959a6b15964..d69c80f27af98 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Timer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Timer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/TimerModeDeserializer.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/TimerModeDeserializer.java index e81ca3d296041..c641f79be3b7a 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/TimerModeDeserializer.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/TimerModeDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/VersionInfo.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/VersionInfo.java index 152870df08e36..aef9dd09a2498 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/VersionInfo.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/VersionInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Wlan.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Wlan.java index 812a562e9eb40..a32e0aa10b09b 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Wlan.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/Wlan.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/Command.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/Command.java index fac1fe7b9c8f7..ae3a8fd49e78b 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/Command.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/Command.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ErrorCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ErrorCommand.java index cd3f61153c4ed..b60ab0fd0056f 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ErrorCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ErrorCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ModeCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ModeCommand.java index 8be270ea8b968..f34c28e1fcf99 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ModeCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/ModeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/NameCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/NameCommand.java index d9b02e5b03948..1dc0619e7fd03 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/NameCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/NameCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StartCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StartCommand.java index 035599b8b5876..bf8dbbc167abc 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StartCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StartCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StatusCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StatusCommand.java index 8d23ba5eb4b32..2d5270dd83325 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StatusCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StatusCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StopCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StopCommand.java index 41bd0a3daacce..dfa838cb94ceb 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StopCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/StopCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/VersionCommand.java b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/VersionCommand.java index 2fd371c2ca2c7..61d9e7d13f5cd 100644 --- a/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/VersionCommand.java +++ b/bundles/org.openhab.binding.robonect/src/main/java/org/openhab/binding/robonect/internal/model/cmd/VersionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.robonect/src/main/resources/ESH-INF/thing/thing-types.xml index 2b13da6203e4f..1317448ac775b 100644 --- a/bundles/org.openhab.binding.robonect/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.robonect/src/main/resources/ESH-INF/thing/thing-types.xml @@ -69,13 +69,13 @@ <description>The password if authentication has been enabled on the mower</description> </parameter> <parameter name="pollInterval" type="integer" required="false" unit="s"> - <label>Polling interval</label> + <label>Polling Interval</label> <default>30</default> <description>The interval for the binding to poll the mowers status information. </description> </parameter> <parameter name="offlineTimeout" type="integer" required="false" unit="m"> - <label>Offline timeout</label> + <label>Offline Timeout</label> <default>30</default> <description>The maximum time the mower may be offline before the offline trigger is triggered. </description> @@ -85,45 +85,45 @@ <channel-type id="serialType"> <item-type>String</item-type> - <label>Robonect serial number</label> + <label>Robonect Serial Number</label> <state readOnly="true"/> </channel-type> <channel-type id="versionType"> <item-type>String</item-type> - <label>Robonect version</label> + <label>Robonect Version</label> <state readOnly="true"/> </channel-type> <channel-type id="compiledType"> <item-type>String</item-type> - <label>Robonect version</label> + <label>Robonect Version</label> <state readOnly="true"/> </channel-type> <channel-type id="commentType"> <item-type>String</item-type> - <label>Robonect firmware comment</label> + <label>Robonect Firmware Comment</label> <state readOnly="true"/> </channel-type> <channel-type id="nameType"> <item-type>String</item-type> - <label>Mower name</label> + <label>Mower Name</label> <description>The name of the mower</description> <state readOnly="false"/> </channel-type> <channel-type id="durationType"> <item-type>Number:Time</item-type> - <label>Status duration</label> + <label>Status Duration</label> <description>The number of seconds the mower is in the current status.</description> <state readOnly="true" pattern="%d %unit%"/> </channel-type> <channel-type id="hoursType"> <item-type>Number:Time</item-type> - <label>Total mowing hours</label> + <label>Total Mowing Hours</label> <description>The number of total mowing hours</description> <state readOnly="true" pattern="%d %unit%"/> </channel-type> @@ -144,7 +144,7 @@ <channel-type id="modeType"> <item-type>String</item-type> - <label>Mower mode</label> + <label>Mower Mode</label> <description>The mower mode</description> <state readOnly="false"> <options> @@ -216,28 +216,28 @@ <channel-type id="nextTimerType"> <item-type>DateTime</item-type> - <label>Next timer date</label> + <label>Next Timer Date</label> <description>The next date the timer starts</description> <state readOnly="true"/> </channel-type> <channel-type id="errorCodeType"> <item-type>Number</item-type> - <label>Error code</label> + <label>Error Code</label> <description>Error code defined by the mower manufacturer</description> <state readOnly="true"/> </channel-type> <channel-type id="errorMessageType"> <item-type>String</item-type> - <label>Error message</label> + <label>Error Message</label> <description>The error message</description> <state readOnly="true"/> </channel-type> <channel-type id="errorDateType"> <item-type>DateTime</item-type> - <label>Error date</label> + <label>Error Date</label> <description>The date and time the error occurred</description> <state readOnly="true"/> </channel-type> diff --git a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/RobonectClientTest.java b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/RobonectClientTest.java index b2e84e132ae90..2d07f6839925d 100644 --- a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/RobonectClientTest.java +++ b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/RobonectClientTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/handler/RobonectHandlerTest.java b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/handler/RobonectHandlerTest.java index b68eb3a3be3ed..070851d68e6db 100644 --- a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/handler/RobonectHandlerTest.java +++ b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/handler/RobonectHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java index 0a8c45b825b38..e23f6ccb2108d 100644 --- a/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java +++ b/bundles/org.openhab.binding.robonect/src/test/java/org/openhab/binding/robonect/internal/model/ModelParserTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/NOTICE b/bundles/org.openhab.binding.rotel/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.rotel/NOTICE +++ b/bundles/org.openhab.binding.rotel/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.rotel/README.md b/bundles/org.openhab.binding.rotel/README.md index 6f119a7164ccb..e8282b1ccfb29 100644 --- a/bundles/org.openhab.binding.rotel/README.md +++ b/bundles/org.openhab.binding.rotel/README.md @@ -17,7 +17,7 @@ The binding supports all kinds of Rotel protocols: For users without serial connector on server side, of course you can add a serial to USB adapter. You don't need to have your Rotel device directly connected to your openHAB server. -You can connect it for example to a Raspberry PI and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). +You can connect it for example to a Raspberry Pi and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). Recent devices provide a network interface (RJ45 connector). So you can use the device IP to connect to the device, keeping 9590 as default port. @@ -132,7 +132,7 @@ Some have additional parameters listed in the next table: Some notes: * On Linux, you may get an error stating the serial port cannot be opened when the Rotel binding tries to load. You can get around this by adding the `openhab` user to the `dialout` group like this: `usermod -a -G dialout openhab`. -* Also on Linux you may have issues with the USB if using two serial USB devices e.g. Rotel and RFXcom. See the wiki page for more on symlinking the USB ports [](https://github.com/openhab/openhab1-addons/wiki/symlinks). +* Also on Linux you may have issues with the USB if using two serial USB devices e.g. Rotel and RFXcom. See the [general documentation about serial port configuration](/docs/administration/serial.html) for more on symlinking the USB ports. * Here is an example of ser2net.conf you can use to share your serial port /dev/ttyUSB0 on IP port 4444 using [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) (take care, the baud rate is Rotel device specific): ``` diff --git a/bundles/org.openhab.binding.rotel/pom.xml b/bundles/org.openhab.binding.rotel/pom.xml index 59b13b4c76e38..3445274b6937e 100644 --- a/bundles/org.openhab.binding.rotel/pom.xml +++ b/bundles/org.openhab.binding.rotel/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.rotel</artifactId> diff --git a/bundles/org.openhab.binding.rotel/src/main/feature/feature.xml b/bundles/org.openhab.binding.rotel/src/main/feature/feature.xml index e6a2a1ae3101e..a7e71d801a557 100644 --- a/bundles/org.openhab.binding.rotel/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.rotel/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.freebox-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-rotel" description="Rotel Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java index 7d337094c15fd..eedcc41344719 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelException.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelException.java index b2b91c89c7a85..cae35dd15a569 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelException.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java index 51bf336235545..161c22dd74329 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java index f418250dcfc91..9f85cabed9cd2 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelPlayStatus.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelPlayStatus.java index 380eaea4a9c87..0546e234bf7c1 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelPlayStatus.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelPlayStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelStateDescriptionOptionProvider.java index c18a78af9d482..764748623bd9e 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelStateDescriptionOptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelCommand.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelCommand.java index 331c3e8761251..361610f165473 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelCommand.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelConnector.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelConnector.java index 8b46f416b0c86..719684b015d49 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelConnector.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelDsp.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelDsp.java index 7768da4c14863..ffb4c7ce97913 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelDsp.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelDsp.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelFlagsMapping.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelFlagsMapping.java index 24b38fdf6fbd0..40040e6a53758 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelFlagsMapping.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelFlagsMapping.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelIpConnector.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelIpConnector.java index 46fb11accbdb3..237d7f68baab7 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelIpConnector.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelIpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEvent.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEvent.java index 8a0bf0038cabd..a965bc5aef8af 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEvent.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEventListener.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEventListener.java index 61add2b4b1a5b..57093319771dc 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEventListener.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelMessageEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelProtocol.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelProtocol.java index 5c5333e3e9adb..4b5ccd3d7a8cf 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelProtocol.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java index 6456c14f4c32a..d010eebcc0860 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSerialConnector.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSerialConnector.java index aad9cf7a68244..f033ce087a641 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSerialConnector.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSimuConnector.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSimuConnector.java index 8bb04580c85f9..d627859303607 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSimuConnector.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSimuConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSource.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSource.java index 8894d58e20621..21bca793b0b1f 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSource.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelSource.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/configuration/RotelThingConfiguration.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/configuration/RotelThingConfiguration.java index 8c281916b42f6..91e5b20bae17e 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/configuration/RotelThingConfiguration.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/configuration/RotelThingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java index a5f86bd902510..8a8fa61fd32d4 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -1352,6 +1352,10 @@ public void onNewMessageEvent(EventObject event) { if (RotelConnector.MSG_VALUE_OFF.equalsIgnoreCase(value)) { frequency = 0.0; } else { + // Suppress a potential ending "k" or "K" + if (value.toUpperCase().endsWith("K")) { + value = value.substring(0, value.length() - 1); + } frequency = Double.parseDouble(value); } updateChannelState(CHANNEL_FREQUENCY); diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/binding/binding.xml index 7f57fac30c731..86356b4d68f98 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Rotel Binding</name> <description>The Rotel binding controls a Rotel audio device like a surround processor, a surround receiver, a stereo preamplifier, an integrated amplifier, a CD player or a tuner.</description> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a11.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a11.xml index 5bee460b34522..6c6bdfadf7871 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a11.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a11.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel A11 Connection Thing Type --> <thing-type id="a11"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a12.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a12.xml index cd949f614c5e4..f6df022f7daa6 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a12.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a12.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel A12 Connection Thing Type --> <thing-type id="a12"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a14.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a14.xml index 7fbdf1ced13b7..e622d699520ae 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a14.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/a14.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel A14 Connection Thing Type --> <thing-type id="a14"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd11.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd11.xml index 8eab03f31542f..4955adb3e56e9 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd11.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd11.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel CD11 Connection Thing Type --> <thing-type id="cd11"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd14.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd14.xml index 62802c9b024d9..3ff5492c38ed3 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd14.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/cd14.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel CD14 Connection Thing Type --> <thing-type id="cd14"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/channels.xml index 3a45b6b415c99..8f34460f7b55f 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/channels.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-group-type id="mainZoneType1"> <label>Main Zone</label> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra11.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra11.xml index 81a1d6e7ca3d0..57998d86cbc96 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra11.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra11.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RA-11 Connection Thing Type --> <thing-type id="ra11"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra12.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra12.xml index c0f04e447b299..ef768c6a5fb91 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra12.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra12.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RA-12 Connection Thing Type --> <thing-type id="ra12"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1570.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1570.xml index e4425767fb4aa..f0b3d5705f281 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1570.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1570.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RA-1570 Connection Thing Type --> <thing-type id="ra1570"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1572.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1572.xml index 98b656d5118b7..5f04b95bc1941 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1572.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1572.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RA-1572 Connection Thing Type --> <thing-type id="ra1572"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1592.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1592.xml index ee2d4ee988913..94b2753838a86 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1592.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/ra1592.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RA-1592 Connection Thing Type --> <thing-type id="ra1592"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rap1580.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rap1580.xml index 716eb8859bd18..987fe423c832c 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rap1580.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rap1580.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RAP-1580 Connection Thing Type --> <thing-type id="rap1580"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1570.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1570.xml index 55e5ffde9a5c3..1a5d23acf1c27 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1570.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1570.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RC-1570 Connection Thing Type --> <thing-type id="rc1570"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1572.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1572.xml index 8810ac07e4736..ae21c90783c5e 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1572.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1572.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RC-1572 Connection Thing Type --> <thing-type id="rc1572"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1590.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1590.xml index a6a7dbc6ce87e..2d3160c26a803 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1590.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rc1590.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RC-1590 Connection Thing Type --> <thing-type id="rc1590"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1570.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1570.xml index b832e903d6529..c89548d0574aa 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1570.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1570.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RCD-1570 Connection Thing Type --> <thing-type id="rcd1570"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1572.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1572.xml index e2d5c6b120817..42d230cbc704c 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1572.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcd1572.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RCD-1572 Connection Thing Type --> <thing-type id="rcd1572"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcx1500.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcx1500.xml index e2a44b79b1b67..92a759a3171bb 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcx1500.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rcx1500.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RCX-1500 Connection Thing Type --> <thing-type id="rcx1500"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdd1580.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdd1580.xml index 0085dd6223dc2..2b36ed42533a3 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdd1580.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdd1580.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RDD-1580 Connection Thing Type --> <thing-type id="rdd1580"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdg1520.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdg1520.xml index 57500a59dc0c5..dc3e556a5dceb 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdg1520.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rdg1520.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RDG-1520 Connection Thing Type --> <thing-type id="rdg1520"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1066.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1066.xml index 9e7440089dad5..cbc8817ec9d01 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1066.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1066.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1066 Connection Thing Type --> <thing-type id="rsp1066"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1068.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1068.xml index 4f991f63c519b..9a2145a4babf1 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1068.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1068.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1068 Connection Thing Type --> <thing-type id="rsp1068"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1069.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1069.xml index e4db6a4aa8586..f36e15272a27f 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1069.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1069.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1069 Connection Thing Type --> <thing-type id="rsp1069"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1098.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1098.xml index 4ba79f6936438..02579824f9768 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1098.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1098.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1098 Connection Thing Type --> <thing-type id="rsp1098"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1570.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1570.xml index 4a4e220995cbb..7f1d0cd3389ca 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1570.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1570.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1570 Connection Thing Type --> <thing-type id="rsp1570"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1572.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1572.xml index 4ffa2ea8c4d5d..c92bf9f2f0735 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1572.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1572.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1572 Connection Thing Type --> <thing-type id="rsp1572"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1576.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1576.xml index 49709f45019ba..3831d5116a239 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1576.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1576.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1576 Connection Thing Type --> <thing-type id="rsp1576"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1582.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1582.xml index c1850e1b9a564..2d4495c64c626 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1582.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsp1582.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSP-1582 Connection Thing Type --> <thing-type id="rsp1582"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1055.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1055.xml index f59d91e786409..f88bbdcd7304a 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1055.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1055.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1055 Connection Thing Type --> <thing-type id="rsx1055"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1056.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1056.xml index 69bc2f7d61254..3342e731680d2 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1056.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1056.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1056 Connection Thing Type --> <thing-type id="rsx1056"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1057.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1057.xml index 5d75fd31b6a45..628d46f576632 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1057.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1057.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1057 Connection Thing Type --> <thing-type id="rsx1057"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1058.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1058.xml index 7b1530c357658..bd6160aaf6fd3 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1058.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1058.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1058 Connection Thing Type --> <thing-type id="rsx1058"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1065.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1065.xml index 27ac7251c2268..639fe6dee8afb 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1065.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1065.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1065 Connection Thing Type --> <thing-type id="rsx1065"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1067.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1067.xml index fe6916830b606..4f3f70540f366 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1067.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1067.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1067 Connection Thing Type --> <thing-type id="rsx1067"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1550.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1550.xml index d39af7673f911..f4ed54f72da4c 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1550.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1550.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1550 Connection Thing Type --> <thing-type id="rsx1550"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1560.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1560.xml index f3763e753cabc..8a709659da55a 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1560.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1560.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1560 Connection Thing Type --> <thing-type id="rsx1560"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1562.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1562.xml index 54da0ef96e1e1..0f7ee74290163 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1562.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rsx1562.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1562 Connection Thing Type --> <thing-type id="rsx1562"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt09.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt09.xml index a2f7472c5f421..fea122796965c 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt09.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt09.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RT-09 Connection Thing Type --> <thing-type id="rt09"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt11.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt11.xml index 688c7a1a4fc48..09f697484fdd6 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt11.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt11.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RT-11 Connection Thing Type --> <thing-type id="rt11"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt1570.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt1570.xml index 0a130d1a8ca7f..f34e52c40735f 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt1570.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/rt1570.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RT-1570 Connection Thing Type --> <thing-type id="rt1570"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t11.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t11.xml index a3942d173e819..232d9f929f8ce 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t11.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t11.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel T11 Connection Thing Type --> <thing-type id="t11"> diff --git a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t14.xml b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t14.xml index 65bb134ad0d82..262586ad2acbe 100644 --- a/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t14.xml +++ b/bundles/org.openhab.binding.rotel/src/main/resources/ESH-INF/thing/t14.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel T14 Connection Thing Type --> <thing-type id="t14"> diff --git a/bundles/org.openhab.binding.rotelra1x/NOTICE b/bundles/org.openhab.binding.rotelra1x/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.rotelra1x/NOTICE +++ b/bundles/org.openhab.binding.rotelra1x/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.rotelra1x/pom.xml b/bundles/org.openhab.binding.rotelra1x/pom.xml index 78d3d36677dad..989110575440e 100644 --- a/bundles/org.openhab.binding.rotelra1x/pom.xml +++ b/bundles/org.openhab.binding.rotelra1x/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.rotelra1x</artifactId> diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/feature/feature.xml b/bundles/org.openhab.binding.rotelra1x/src/main/feature/feature.xml index f0760532e2666..dcbc260ab1557 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.rotelra1x/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.rotelra1x-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-rotelra1x" description="RotelRa1x Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/ConfigurationError.java b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/ConfigurationError.java index 1a673b493d409..a1f641cee1d90 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/ConfigurationError.java +++ b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/ConfigurationError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xBindingConstants.java b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xBindingConstants.java index 4350fc79781b2..081a5e584611f 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xBindingConstants.java +++ b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xHandlerFactory.java b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xHandlerFactory.java index d2e45bc62d3ba..24c72744fb163 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xHandlerFactory.java +++ b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/RotelRa1xHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/handler/RotelRa1xHandler.java b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/handler/RotelRa1xHandler.java index b6d8674998e75..12882298baaec 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/handler/RotelRa1xHandler.java +++ b/bundles/org.openhab.binding.rotelra1x/src/main/java/org/openhab/binding/rotelra1x/internal/handler/RotelRa1xHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.rotelra1x/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.rotelra1x/src/main/resources/ESH-INF/thing/thing-types.xml index b1ae74377896f..d509652e95cd6 100644 --- a/bundles/org.openhab.binding.rotelra1x/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.rotelra1x/src/main/resources/ESH-INF/thing/thing-types.xml @@ -19,7 +19,7 @@ <config-description> <parameter name="port" type="text"> - <label>Serial port</label> + <label>Serial Port</label> <description>Select serial port (COM1, /dev/ttyS0, ...)</description> <required>true</required> </parameter> @@ -27,7 +27,7 @@ complicated the code, and it could be nice to set 100 % at less than the receiver's max. --> <parameter name="maximum-volume" type="integer" min="1"> - <label>Maximum volume</label> + <label>Maximum Volume</label> <description>Volume level representing 100 %.</description> <default>100</default> <required>true</required> @@ -86,7 +86,7 @@ <channel-type id="brightness" advanced="true"> <item-type>Dimmer</item-type> - <label>Display brightness</label> + <label>Display Brightness</label> <description>Display backlight brightness.</description> </channel-type> diff --git a/bundles/org.openhab.binding.russound/NOTICE b/bundles/org.openhab.binding.russound/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.russound/NOTICE +++ b/bundles/org.openhab.binding.russound/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.russound/README.md b/bundles/org.openhab.binding.russound/README.md index 882d79f23fb8a..34d877d3e178c 100644 --- a/bundles/org.openhab.binding.russound/README.md +++ b/bundles/org.openhab.binding.russound/README.md @@ -22,7 +22,7 @@ Although it seems to work a majority of the times, there have been instances whe ## Device Discovery -The Russound binding does support devices discovery via the paperUI. +The Russound binding does support devices discovery via the Paper UI. When you start device discovery, the system will scan all network interfaces and **all IP Addresses in the subnet on each interface** looking for a Russound system device. If found, the device will be added to the inbox. Adding the device will then start a scan of the device to discover all the controllers, sources, and zones attached defined on the device. @@ -30,7 +30,7 @@ As these are found, they will be added to the inbox. ## HABPANEL or other UI -All media management functions are supported to allow building of a dynamic UI for the various streaming sources. +All media management functions are supported to allow building of a dynamic UI for the various streaming sources. All media management channels begin with "mm". An example HABPanel implementation can be found in the HABPanel forum. @@ -144,7 +144,7 @@ The controller channel will contain up to 6 controllers and the sources will con | source | RW | Number | The (physical) number for the current source | | bass | RW | Number | The bass setting (-10 to 10) | | treble | RW | Number | The treble setting (-10 to 10) | -| balance | RW | Number | The balance setting (-10 [full left] to 10 [full right]) | +| balance | RW | Number | The balance setting (-10 [full left] to 10 [full right]) | | loudness | RW | Switch | Set's the loudness on/off | | turnonvolume | RW | Dimmer | The initial volume when turned on (0 to 100) | | donotdisturb | RW | String | The do not disturb setting (on/off/slave) | @@ -176,17 +176,20 @@ The controller channel will contain up to 6 controllers and the sources will con 1. As of the time of this document, rating ON (like) produced an error in the firmware from the related command. This has been reported to Russound. 2. keypress/keyrelease/keyhold/keycode/event are advanced commands that will pass the related event string to Russound (i.e. `EVENT C[x].Z[y]!KeyPress [stringtype]`). Please see the "RIO Protocol for 3rd Party Integrators.pdf" (found at the Russound Portal) for proper string forms. -3. If you send a OnOffType to the volume will have the same affect as turning the zone on/off (ie sending OnOffType to "status") +3. If you send an OnOffType to the volume will have the same affect as turning the zone on/off (ie sending OnOffType to "status") 4. The volume PercentType will be scaled to Russound's volume of 0-50 (ie 50% = volume of 25, 100% = volume of 50) 5. Initialize a media management session by sending ON to the channel. The related source thing will then start sending out media management information in the MM channels. To close the session - simply send OFF to the channel. Sending OFF to the channel when a session has not been initialized does nothing. Likewise if the related source is a tuner, this command does nothing. ##### System Favorites -The JSON will look like `[{"id":xxx,"valid":true,"name":"yyyy"},...]` and will have a representation for each VALID favorite on the system (ie where "valid" is true). You will have up to 32 system favorites in the JSON array (the ID field will be between 1 and 32). System favorites will be the same on ALL zones (because they are system level). This channel appears on the zone because when you send a system favorite representation to zone channel, it sets the system favorite to what is playing in the zone. +The JSON will look like `[{"id":xxx,"valid":true,"name":"yyyy"},...]` and will have a representation for each VALID favorite on the system (ie where "valid" is true). +You will have up to 32 system favorites in the JSON array (the ID field will be between 1 and 32). +System favorites will be the same on ALL zones (because they are system level). +This channel appears on the zone because when you send a system favorite representation to zone channel, it sets the system favorite to what is playing in the zone. There are three different ways to use this channel: -1. Save a system favorite. Send a representation with "valid" set to true. Example: to set system favorite 3 to what is playing in the zone: `[{"id":3,"valid":true,"name":"80s Rock"}]`. If system favorite 3 was invalid, this would save what is currently playing and make it valid. If system favorite 3 was already valid, this would overlay the favorite with what is currently playing and change it's name. +1. Save a system favorite. Send a representation with "valid" set to true. Example: to set system favorite 3 to what is playing in the zone: `[{"id":3,"valid":true,"name":"80s Rock"}]`. If system favorite 3 was invalid, this would save what is currently playing and make it valid. If system favorite 3 was already valid, this would overlay the favorite with what is currently playing and change its name. 2. Update the name of a system favorite. Send a representation of an existing ID with "valid" set to true and the new name. Example: we could update system favorite 3 (after the above statement) by sending: `[{"id":3,"valid":true,"name":"80s Rock Even More"}]`. Note this will ONLY change the name (this will NOT save what is currently playing to the system favorite). 3. Delete a system favorite. Send a representation with "valid" as false. Example: deleting system favorite 3 (after the above statements) by sending: `[{"id":3","valid":false"}]` @@ -198,7 +201,7 @@ The JSON will look like `[{"id":xxx,"valid":true,"name":"yyyy"},...]` and will h There are two different ways to use this channel: -1. Save a zone favorite. Send a representation with "valid" set to true. Example: to set zone favorite 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"80s Rock"}]`. +1. Save a zone favorite. Send a representation with "valid" set to true. Example: to set zone favorite 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"80s Rock"}]`. 2. Delete a zone favorite. Send a representation with "valid" as false. Example: deleting zone favorite 2 (after the above statement) by sending: `[{"id":2","valid":false"}] ` There is no ability to change JUST the name. Sending a new name will save the new name AND set the favorite to what is currently playing. @@ -207,23 +210,29 @@ The channel will be refreshed with the new representation after processing. If ##### Zone Presets -The JSON will look like `[{"id":xxx,"valid":true,"name":"yyyy", "bank": xxx, "bankPreset":yyyy},...]` and will have a representation for each VALID preset in the zone (ie where "valid" is true). Please note that this channel is only valid if the related source is a tuner. If not a tuner, an empty json array will be returned. You will have up to 36 presets to choose from (ID from 1 to 36). The "bank" and "bankPreset" are readonly (will be ignored if sent) and are informational only (i.e. specify the bank and the preset within the bank for convenience). +The JSON will look like `[{"id":xxx,"valid":true,"name":"yyyy", "bank": xxx, "bankPreset":yyyy},...]` and will have a representation for each VALID preset in the zone (ie where "valid" is true). +Please note that this channel is only valid if the related source is a tuner. +If not a tuner, an empty json array will be returned. +You will have up to 36 presets to choose from (ID from 1 to 36). +The "bank" and "bankPreset" are readonly (will be ignored if sent) and are informational only (i.e. specify the bank and the preset within the bank for convenience). There are two different ways to use this channel: -1. Save a preset. Send a representation to an ID that is invalid with "valid" set to true. Example: to set a zone pret 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"103.7 FM"}]`. -2. Save a preset with default name. Send a representation to an ID that is invalid with "valid" set to true. Example: to set a zone pret 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"103.7 FM"}]`. +1. Save a preset. Send a representation to an ID that is invalid with "valid" set to true. Example: to set a zone pret 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"103.7 FM"}]`. +2. Save a preset with default name. Send a representation to an ID that is invalid with "valid" set to true. Example: to set a zone pret 2 to what is playing in the zone: `[{"id":2,"valid":true,"name":"103.7 FM"}]`. 3. Delete a zone favorite. Send a representation with "valid" as false. Example: deleting zone favorite 2 (after the above statement) by sending: `[{"id":2","valid":false"}]` -There is no ability to change JUST the name. Sending a new name will save the new name AND set the favorite to what is currently playing. +There is no ability to change JUST the name. +Sending a new name will save the new name AND set the favorite to what is currently playing. -The channel will be refreshed with the new representation after processing. If the refreshed representation doesn't include the changes, the russound system rejected them for some reason (generally length of the name). +The channel will be refreshed with the new representation after processing. +If the refreshed representation doesn't include the changes, the russound system rejected them for some reason (generally length of the name). ### Source channel support cross reference -| Channel Type ID | Sirius | XM | SMS3 | DMS 3.1 Media | DMS 3.1 AM/FM | iBridge | Internal AM/FM | Arcam T32 | Others | +| Channel Type ID | Sirius | XM | SMS3 | DMS 3.1 Media | DMS 3.1 AM/FM | iBridge | Internal AM/FM | Arcam T32 | Others | |--------------------|--------|----|------|---------------|---------------|---------|----------------|-----------|--------| -| name | X | X | X | X | X | X | X | X | X | +| name | X | X | X | X | X | X | X | X | X | | type | X | X | X | X | X | X | X | X | X | | ipaddress | | | X | X | X | | | | | | composername | X | | | | | | | | | @@ -372,7 +381,7 @@ Frame label="Russound" { Text item= Rio_Src_RadioText2 Text item= Rio_Src_RadioText3 Text item= Rio_Src_RadioText4 - } + } } } } diff --git a/bundles/org.openhab.binding.russound/pom.xml b/bundles/org.openhab.binding.russound/pom.xml index e70fbf2698bb5..5dfba89e0aeeb 100644 --- a/bundles/org.openhab.binding.russound/pom.xml +++ b/bundles/org.openhab.binding.russound/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.russound</artifactId> diff --git a/bundles/org.openhab.binding.russound/src/main/feature/feature.xml b/bundles/org.openhab.binding.russound/src/main/feature/feature.xml index 176444529f586..dc23cf8510191 100644 --- a/bundles/org.openhab.binding.russound/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.russound/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.russound-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-russound" description="Russound Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundBindingConstants.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundBindingConstants.java index ee6aee6096644..0e56d7d0578de 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundBindingConstants.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundHandlerFactory.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundHandlerFactory.java index 2310b17eaa107..fa68ecb06fa7e 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundHandlerFactory.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/RussoundHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDeviceDiscoveryService.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDeviceDiscoveryService.java index 295a0da8f0fcf..7c81b45e95930 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDiscovery.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDiscovery.java index 8fbc856386265..8adaf0e5ee446 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDiscovery.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/discovery/RioSystemDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java index 8c9eacfff2bb1..983f507ad4aec 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSession.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSession.java index 4e485cd28baf6..c01a9fd69be87 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSession.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSession.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSessionListener.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSessionListener.java index 7dc2e922ca802..8ce8ac80c090a 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSessionListener.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketSessionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/WaitingSessionListener.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/WaitingSessionListener.java index 40cfaf2029612..ee0f398b24fb8 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/WaitingSessionListener.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/WaitingSessionListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractBridgeHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractBridgeHandler.java index 6d25530f83d6b..2d7bcb630ee61 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractBridgeHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioHandlerCallback.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioHandlerCallback.java index 053bcf1640ec8..1d033e3ae08d2 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioHandlerCallback.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioProtocol.java index 204dc9fb7b950..502e4d88fcc55 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractRioProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractThingHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractThingHandler.java index 6778b65dbb0f6..ccbb37c0694d0 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractThingHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/AbstractThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioCallbackHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioCallbackHandler.java index bfbc0ac438ac9..77a3c4ec9b254 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioCallbackHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioCallbackHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioConstants.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioConstants.java index 67308f33dcf15..3cbc4f72f1bd5 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioConstants.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallback.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallback.java index e81baa5232da0..2ed74e6cfa7c4 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallback.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallbackListener.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallbackListener.java index f351fbf7abcbf..ea9567b8f7c97 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallbackListener.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioHandlerCallbackListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioNamedHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioNamedHandler.java index a07d6b2b32346..07d66ce888c22 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioNamedHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioNamedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioPresetsProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioPresetsProtocol.java index 1fdd26e1ab598..ff7a613afa0e8 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioPresetsProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioPresetsProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioSystemFavoritesProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioSystemFavoritesProtocol.java index 2d63bd0290d1a..9118e0558d166 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioSystemFavoritesProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/RioSystemFavoritesProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/StatefulHandlerCallback.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/StatefulHandlerCallback.java index 1b7e68b7e1557..4b77eb27f8868 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/StatefulHandlerCallback.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/StatefulHandlerCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerConfig.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerConfig.java index e7eba9621946e..40b5628ae3021 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerConfig.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerHandler.java index 7f3095523aa91..22a78f8c3b244 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerProtocol.java index 4ce82402933fc..22415d4221b1e 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/controller/RioControllerProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/AtomicStringTypeAdapter.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/AtomicStringTypeAdapter.java index 24a94a1c1f3c7..b06b6b000d0a6 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/AtomicStringTypeAdapter.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/AtomicStringTypeAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/GsonUtilities.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/GsonUtilities.java index 57129cd4c9e0a..45ff6d9473c1f 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/GsonUtilities.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/GsonUtilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBank.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBank.java index 51156b1a5b022..be2c1ff109990 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBank.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBank.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBankSerializer.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBankSerializer.java index 67e14158657e8..34dede83086e2 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBankSerializer.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioBankSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavorite.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavorite.java index 73790318096ea..3b7b160bee2e5 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavorite.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavorite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavoriteSerializer.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavoriteSerializer.java index 895d8cc5319a2..efa2c4e55787e 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavoriteSerializer.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioFavoriteSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPreset.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPreset.java index 7d69ca62bc8b0..da31ab7e7dd73 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPreset.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPreset.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPresetSerializer.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPresetSerializer.java index 1cb573093f950..165c7f3d40e71 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPresetSerializer.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/models/RioPresetSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceConfig.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceConfig.java index d2aad1f865de9..653787f6c5c7b 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceConfig.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceHandler.java index fc0ec76d20588..842e7a0f46bec 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceProtocol.java index 5c48ddec390aa..c0fbcf26921aa 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/source/RioSourceProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -731,7 +731,7 @@ public void dispose() { try { httpClient.stop(); } catch (Exception e) { - logger.debug("Error stopping the httpclient: {}", e); + logger.debug("Error stopping the httpclient", e); } } super.dispose(); diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemConfig.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemConfig.java index d54612584ded2..d1e180e5d0567 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemConfig.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemHandler.java index a4c58aec7c3b8..7a3b82fb92b0c 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemProtocol.java index 03556f00c9f4f..89f63aeb8a35d 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/system/RioSystemProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneConfig.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneConfig.java index b40b542505261..f766cc9574da4 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneConfig.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneHandler.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneHandler.java index 9b06706b42fcd..2e93f238fb2c7 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneHandler.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneProtocol.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneProtocol.java index fcfebd209b49a..7664986d2f1af 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneProtocol.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/rio/zone/RioZoneProtocol.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/NOTICE b/bundles/org.openhab.binding.samsungtv/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.samsungtv/NOTICE +++ b/bundles/org.openhab.binding.samsungtv/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.samsungtv/README.md b/bundles/org.openhab.binding.samsungtv/README.md index ae41d8cdd9102..a1fff5a8fe91e 100644 --- a/bundles/org.openhab.binding.samsungtv/README.md +++ b/bundles/org.openhab.binding.samsungtv/README.md @@ -1,10 +1,11 @@ # Samsung TV Binding -This binding integrates the [Samsung TV's](http://www.samsung.com). +This binding integrates the [Samsung TV's](https://www.samsung.com). ## Supported Things -Samsung TV C (2010), D (2011), E (2012) and F (2013) models should be supported. Also support added for TVs using websocket remote interface (2016+ models) +Samsung TV C (2010), D (2011), E (2012) and F (2013) models should be supported. +Also support added for TVs using websocket remote interface (2016+ models) Because Samsung does not publish any documentation about the TV's UPnP interface, there could be differences between different TV models, which could lead to mismatch problems. Tested TV models: @@ -12,6 +13,7 @@ Tested TV models: | Model | State | Notes | |-------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | UE48J5670SU | PARTIAL | Supported channels: `volume`, `sourceName` | +| UE40J6300AU | PARTIAL | Supported channels: `volume`, `mute`, `sourceName`, `power` | | UE46E5505 | OK | Initial contribution is done by this model | | UE46D5700 | PARTIAL | Supports at my home only commands via the fake remote, no discovery | | UE40F6500 | OK | All channels except `colorTemperature`, `programTitle` and `channelName` are working | @@ -31,15 +33,18 @@ The binding does not require any special configuration. ## Thing Configuration -The Samsung TV Thing requires the host name and port address as a configuration value in order for the binding to know how to access it. Samsung TV publish several UPnP devices and hostname is used to recognize those UPnP devices. +The Samsung TV Thing requires the host name and port address as a configuration value in order for the binding to know how to access it. +Samsung TV publish several UPnP devices and hostname is used to recognize those UPnP devices. Port address is used for remote control emulation protocol. Additionally, a refresh interval can be configured in milliseconds to specify how often TV resources are polled. E.g. ``` -Thing samsungtv:tv:livingroom [ hostName="192.168.1.10", port=55000, refreshInterval=1000 ] +Thing samsungtv:tv:livingroom [ hostName="192.168.1.10", port=55000, macAddress="78:bd:bc:9f:12:34", refreshInterval=1000 ] ``` +Different ports are used in different models. It may be 55000, 8001 or 8002. +Try to scan for new Things in Paper UI to find TV easily. ## Channels @@ -68,7 +73,14 @@ TVs support the following channels: E.g. ``` -Dimmer TV_Volume { channel="samsungtv:tv:livingroom:volume" } -Switch TV_Mute { channel="samsungtv:tv:livingroom:mute" } -String TV_KeyCode { channel="samsungtv:tv:livingroom:keyCode" } +Group gLivingRoomTV "Living room TV" <screen> +Dimmer TV_Volume "Volume" <soundvolume> (gLivingRoomTV) { channel="samsungtv:tv:livingroom:volume" } +Switch TV_Mute "Mute" <soundvolume_mute> (gLivingRoomTV) { channel="samsungtv:tv:livingroom:mute" } +String TV_SourceName "Source Name" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:sourceName" } +String TV_SourceApp "Source App" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:sourceApp" } +String TV_ProgramTitle "Program Title" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:programTitle" } +String TV_ChannelName "Channel Name" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:channelName" } +String TV_KeyCode "Key Code" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:keyCode" } +Switch TV_Power "Power" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:power" } +Switch TV_ArtMode "Art Mode" (gLivingRoomTV) { channel="samsungtv:tv:livingroom:artMode" } ``` diff --git a/bundles/org.openhab.binding.samsungtv/pom.xml b/bundles/org.openhab.binding.samsungtv/pom.xml index 6907c91faa333..a85d1e4a3632d 100644 --- a/bundles/org.openhab.binding.samsungtv/pom.xml +++ b/bundles/org.openhab.binding.samsungtv/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.samsungtv</artifactId> diff --git a/bundles/org.openhab.binding.samsungtv/src/main/feature/feature.xml b/bundles/org.openhab.binding.samsungtv/src/main/feature/feature.xml index dc8d4b6ad71a1..be1d6fcf97d37 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.samsungtv/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.samsungtv-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-samsungtv" description="Samsung TV Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvBindingConstants.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvBindingConstants.java index 0769ce0922842..43b308565cb23 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvBindingConstants.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvHandlerFactory.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvHandlerFactory.java index 1a8e78c112cb4..cc236f266fb68 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvHandlerFactory.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvTlsTrustManagerProvider.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvTlsTrustManagerProvider.java index 22b4c7a0e3387..358def500e281 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvTlsTrustManagerProvider.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/SamsungTvTlsTrustManagerProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/WakeOnLanUtility.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/WakeOnLanUtility.java index 672b0efe40c7b..48e9425709242 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/WakeOnLanUtility.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/WakeOnLanUtility.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/config/SamsungTvConfiguration.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/config/SamsungTvConfiguration.java index 2af706b5c7cd4..db3b3fa61c169 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/config/SamsungTvConfiguration.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/config/SamsungTvConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java index 7ff267e45ee9c..4bc16cb1fe1b4 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/discovery/SamsungTvDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java index 52c5c8f7e5f39..ffe2cf848ab53 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/handler/SamsungTvHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/KeyCode.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/KeyCode.java old mode 100755 new mode 100644 index c6d83e9d08b7c..7ceb500f85641 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/KeyCode.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/KeyCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteController.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteController.java index b238aae5e5527..645125708de8b 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteController.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerException.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerException.java old mode 100755 new mode 100644 index c6f4d1d1d37d0..61a6b6400ec17 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerException.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerLegacy.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerLegacy.java index f0bcd59592fa1..0aa7766595f5f 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerLegacy.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerLegacy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebSocket.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebSocket.java index ff8987041bf5e..3646f62afa78b 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebSocket.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebsocketCallback.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebsocketCallback.java index 37f58b1d8c413..fb52135984db0 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebsocketCallback.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/RemoteControllerWebsocketCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketArt.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketArt.java index 1bbf694cfe540..6b4a4a02c6120 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketArt.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketArt.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketBase.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketBase.java index 44ce3102bf031..6a9f436f82419 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketBase.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketRemote.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketRemote.java index 5b979c572e879..297f70e1c6e39 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketRemote.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketRemote.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketV2.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketV2.java index bd33e67d2ed0c..354716c3982fd 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketV2.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/protocol/WebSocketV2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/DataConverters.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/DataConverters.java index aeac6ffc698bd..fb2fed72068fe 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/DataConverters.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/DataConverters.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java index 3f7311ce750af..cab335e0b4b98 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MainTVServerService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MediaRendererService.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MediaRendererService.java index 1fa0f5c3c4a1b..b600a7025407e 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MediaRendererService.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/MediaRendererService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/RemoteControllerService.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/RemoteControllerService.java index f65082b7ca5c7..c06717afa25fc 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/RemoteControllerService.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/RemoteControllerService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/SamsungTvUtils.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/SamsungTvUtils.java index e7f92c43f40ba..b44cd5125396f 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/SamsungTvUtils.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/SamsungTvUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/ServiceFactory.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/ServiceFactory.java index bf309ce6598a0..64e727ae7c036 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/ServiceFactory.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/ServiceFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/EventListener.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/EventListener.java index 363adecc4d74b..7548845e47e18 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/EventListener.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/EventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/SamsungTvService.java b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/SamsungTvService.java index 76ea669821901..f84d997aa9dd6 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/SamsungTvService.java +++ b/bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/SamsungTvService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/config/config.xml index 2d4d5afe78390..ae3387065b182 100644 --- a/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.samsungtv/src/main/resources/ESH-INF/config/config.xml @@ -6,11 +6,11 @@ <config-description uri="thing-type:samsungtv:tv"> <parameter name="hostName" type="text" required="true"> - <label>Host name</label> + <label>Host Name</label> <description>Network address of the Samsung TV.</description> <context>network-address</context> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>TCP Port</label> <description>TCP port of the Samsung TV.</description> <default>55000</default> @@ -26,7 +26,7 @@ <default>1000</default> </parameter> <parameter name="protocol" type="text" required="true"> - <label>Remote control protocol</label> + <label>Remote Control Protocol</label> <description>The type of remote control protocol. This depends on the age of the TV.</description> <options> <option value="None">None</option> diff --git a/bundles/org.openhab.binding.satel/NOTICE b/bundles/org.openhab.binding.satel/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.satel/NOTICE +++ b/bundles/org.openhab.binding.satel/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.satel/README.md b/bundles/org.openhab.binding.satel/README.md index 1800b2cf0d27c..2a452f79905a8 100644 --- a/bundles/org.openhab.binding.satel/README.md +++ b/bundles/org.openhab.binding.satel/README.md @@ -1,9 +1,14 @@ # Satel Integra Alarm System Binding -The Satel Integra Alarm System allows openHAB to connect to your alarm system via TCP/IP network with ETHM-1/ETHM-1 Plus module installed, or via RS-232 serial port with INT-RS/INT-RS Plus module installed. For ETHM-1 the binding uses integration protocol, so it must be enabled and properly configured. -Also it is always a good idea to update module/mainboard firmware to the latest version. For ETHM-1 and INT-RS modules it is a must. For "Plus" modules however it is not required. +The Satel Integra Alarm System allows openHAB to connect to your alarm system via TCP/IP network with ETHM-1/ETHM-1 Plus module installed, or via RS-232 serial port with INT-RS/INT-RS Plus module installed. +For ETHM-1 the binding uses integration protocol, so it must be enabled and properly configured. +Also it is always a good idea to update module/mainboard firmware to the latest version. +For ETHM-1 and INT-RS modules it is a must. +For "Plus" modules however it is not required. -In order to use encryption with ETHM-1/ETHM-1 Plus, Java Runtime Environment must support 192 bit AES keys. Oracle Java by default supports only 128 bit keys, therefore ["Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"](http://www.oracle.com/technetwork/java/javase/downloads/index.html) must be installed. OpenJDK supports unlimited AES keys by default (but OpenJDK is sometimes discouraged for openHAB). +In order to use encryption with ETHM-1/ETHM-1 Plus, Java Runtime Environment must support 192 bit AES keys. +Oracle Java by default supports only 128 bit keys, therefore ["Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"](https://www.oracle.com/technetwork/java/javase/downloads/index.html) must be installed. +OpenJDK supports unlimited AES keys by default (but OpenJDK is sometimes discouraged for openHAB). More details and all documentation about Integra system you can find on their site: [satel.pl](https://www.satel.pl/pl/cat/2#cat15) @@ -230,7 +235,7 @@ Thing atd-100 KitchenTemp [ id=10, refresh=30 ] | Name | Type | Description | |-----------------|----------|------------------------------------------------------------------------------------------------------------------------------------| | date_time | DateTime | Date and time on the alarm system | -| troubles | Switch | Active when the system has troubles (trouble led is blinking on a panel) | +| troubles | Switch | Active when the system has troubles (trouble LED is blinking on a panel) | | troubles_memory | Switch | Memorized state of system troubles | | service_mode | Switch | Active when the system is in service mode | | acu100_present | Switch | Active when there is an ACU-100 module installed in the system | @@ -397,10 +402,10 @@ then // prevent initiating reading when index item is restored during OH startup EVENT_LOG_IDX.postUpdate(NULL) } else { - eventLogMsgBody += "\n" + (EVENT_LOG_TIME.state as DateTimeType).format("%1$tF %1$tR") + ": " + EVENT_LOG_DESCR.state - if (EVENT_LOG_DET.state != NULL && EVENT_LOG_DET.state != "") { - eventLogMsgBody += " - " + EVENT_LOG_DET.state - } + eventLogMsgBody += "\n" + (EVENT_LOG_TIME.state as DateTimeType).format("%1$tF %1$tR") + ": " + EVENT_LOG_DESCR.state + if (EVENT_LOG_DET.state != NULL && EVENT_LOG_DET.state != "") { + eventLogMsgBody += " - " + EVENT_LOG_DET.state + } eventLogCounter += 1 EVENT_LOG_IDX.sendCommand(EVENT_LOG_PREV.state) } @@ -411,13 +416,14 @@ end ### binary items -In OH2.x all channels have strict types, which means you cannot use other type then designated for a channel. +In openHAB all channels have strict types, which means you cannot use other type then designated for a channel. In Satel binding all binary items are now of 'Switch' type. Using other item types, like 'Contact' is not possible in this version of the binding. -For this reason, when migrating 1.x item files, besides changing binding configuration for each item, you must replace all 'Contact' items to 'Switch' type. +For this reason, when migrating 1.x item files, besides changing binding configuration for each item, you must replace all 'Contact' items to 'Switch' type. ### 'module' channels -In version 2.x of the binding all 'module' channels have been removed. You can easily replace them with the following configuration: +In version 2.x of the binding all 'module' channels have been removed. +You can easily replace them with the following configuration: #### satel.items @@ -458,11 +464,16 @@ end ### User for openHAB integration -To control Integra partitions and outputs, you need to provide security code of a user in behalf of all those operations will be executed. It is highly recommended to use a separate user for openHAB integration with only required access rights set in Integra configuration, like access to certain partitions, etc. This allows you to distinguish actions made by openHAB and a user using Integra panel, also it will block unwanted operations in case someone breaks into your local network. +To control Integra partitions and outputs, you need to provide security code of a user in behalf of all those operations will be executed. +It is highly recommended to use a separate user for openHAB integration with only required access rights set in Integra configuration, like access to certain partitions, etc. +This allows you to distinguish actions made by openHAB and a user using Integra panel, also it will block unwanted operations in case someone breaks into your local network. ### Disarming and clearing alarms -Although this binding allows you to configure disarming a partition and clearing alarms for a partition, this should be used only in cases when security is not the priority. Don't forget both these operations can be executed in openHAB without specifying a user code, which is required to disarm or clear alarms using Integra panel. Consider adding a keypad in your sitemap to temporarily change user code to execute sensitive operations. You can find such keypad in the [Full Example](#full-example) section. +Although this binding allows you to configure disarming a partition and clearing alarms for a partition, this should be used only in cases when security is not the priority. +Don't forget both these operations can be executed in openHAB without specifying a user code, which is required to disarm or clear alarms using Integra panel. +Consider adding a keypad in your sitemap to temporarily change user code to execute sensitive operations. +You can find such keypad in the [Full Example](#full-example) section. ## Media diff --git a/bundles/org.openhab.binding.satel/pom.xml b/bundles/org.openhab.binding.satel/pom.xml index f58504aad967e..4b42466e5b812 100644 --- a/bundles/org.openhab.binding.satel/pom.xml +++ b/bundles/org.openhab.binding.satel/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.satel</artifactId> diff --git a/bundles/org.openhab.binding.satel/src/main/feature/feature.xml b/bundles/org.openhab.binding.satel/src/main/feature/feature.xml index cbf4e9fb2868f..b731d17b82644 100644 --- a/bundles/org.openhab.binding.satel/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.satel/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.satel-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-satel" description="Satel Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelBindingConstants.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelBindingConstants.java index f28da78309e23..b2d53d498e0aa 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelBindingConstants.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelHandlerFactory.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelHandlerFactory.java index 5ea95b585a678..69b067cec40ae 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelHandlerFactory.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/SatelHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ClearTroublesCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ClearTroublesCommand.java index e90c21de8c174..7656421338bdb 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ClearTroublesCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ClearTroublesCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlCommand.java index 20bbf4ad45a14..16e20a02c992a 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlObjectCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlObjectCommand.java index 13aca290432d0..6c8dcaad97516 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlObjectCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ControlObjectCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStateCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStateCommand.java index 6554b57d198eb..e564751757804 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStateCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStateCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStatusCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStatusCommand.java index dd74d378388c0..196109bd5c0fd 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStatusCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraStatusCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraVersionCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraVersionCommand.java index 52ce53327042e..8a08e8aac28a0 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraVersionCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/IntegraVersionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -40,11 +40,7 @@ public IntegraVersionCommand() { * @return Integra firmware version and release date */ public String getVersion() { - // build version string - String verStr = new String(response.getPayload(), 1, 1) + "." + new String(response.getPayload(), 2, 2) + " " - + new String(response.getPayload(), 4, 4) + "-" + new String(response.getPayload(), 8, 2) + "-" - + new String(response.getPayload(), 10, 2); - return verStr; + return getVersion(1); } /** diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ModuleVersionCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ModuleVersionCommand.java new file mode 100644 index 0000000000000..36bfc7da58c5e --- /dev/null +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ModuleVersionCommand.java @@ -0,0 +1,78 @@ +/** + * 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.satel.internal.command; + +import org.openhab.binding.satel.internal.event.EventDispatcher; +import org.openhab.binding.satel.internal.event.ModuleVersionEvent; +import org.openhab.binding.satel.internal.protocol.SatelMessage; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Command class for command that returns communication module version. + * + * @author Krzysztof Goworek - Initial contribution + */ +public class ModuleVersionCommand extends SatelCommandBase { + + private final Logger logger = LoggerFactory.getLogger(ModuleVersionCommand.class); + + public static final byte COMMAND_CODE = 0x7c; + + /** + * Creates new command class instance. + */ + public ModuleVersionCommand() { + super(COMMAND_CODE, false); + } + + /** + * @return communication module firmware version and release date + */ + public String getVersion() { + return getVersion(0); + } + + /** + * @return <code>true</code> if the module supports extended (32-bit) payload for zones/outputs + */ + public boolean hasExtPayloadSupport() { + return (response.getPayload()[11] & 0x01) != 0; + } + + @Override + public boolean handleResponse(EventDispatcher eventDispatcher, SatelMessage response) { + if (super.handleResponse(eventDispatcher, response)) { + // dispatch version event + eventDispatcher.dispatchEvent(new ModuleVersionEvent(getVersion(), hasExtPayloadSupport())); + return true; + } else { + return false; + } + } + + @Override + protected boolean isResponseValid(SatelMessage response) { + // validate response + if (response.getCommand() != COMMAND_CODE) { + logger.debug("Invalid response code: {}", response.getCommand()); + return false; + } + if (response.getPayload().length != 12) { + logger.debug("Invalid payload length: {}", response.getPayload().length); + return false; + } + return true; + } + +} diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/NewStatesCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/NewStatesCommand.java index c6935983cf5ea..5cd4fca29fbb2 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/NewStatesCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/NewStatesCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadDeviceInfoCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadDeviceInfoCommand.java index c0c07b26b4e99..c312a1fc2e815 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadDeviceInfoCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadDeviceInfoCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventCommand.java index 3dee7e55b74cc..dcb43c7789308 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventDescCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventDescCommand.java index 3596cc44aa046..7c560539a1209 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventDescCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadEventDescCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadZoneTemperature.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadZoneTemperature.java index 68bb57aa1315c..c44ea26f4dbc0 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadZoneTemperature.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/ReadZoneTemperature.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommand.java index 2e1e6ca200220..fedb0c1363d17 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommandBase.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommandBase.java index e4312f4ec86db..ff82a719c3043 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommandBase.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SatelCommandBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -40,11 +40,8 @@ public abstract class SatelCommandBase extends SatelMessage implements SatelComm /** * Creates new command basing on command code and extended command flag. * - * @param commandCode - * command code - * @param extended - * if <code>true</code> command will be sent as extended (256 - * zones or outputs) + * @param commandCode command code + * @param extended if <code>true</code> command will be sent as extended (256 zones or outputs) */ public SatelCommandBase(byte commandCode, boolean extended) { this(commandCode, extended ? EXTENDED_CMD_PAYLOAD : EMPTY_PAYLOAD); @@ -53,10 +50,8 @@ public SatelCommandBase(byte commandCode, boolean extended) { /** * Creates new instance with specified command code and payload. * - * @param command - * command code - * @param payload - * command payload + * @param command command code + * @param payload command payload */ public SatelCommandBase(byte commandCode, byte[] payload) { super(commandCode, payload); @@ -191,4 +186,20 @@ protected boolean hasCommandSucceeded(SatelMessage response) { return false; } + /** + * Decodes firmware version and release date from command payload + * + * @param offset starting offset in payload + * @return decoded firmware version and release date as string + */ + public String getVersion(int offset) { + // build version string + String verStr = new String(response.getPayload(), offset, 1) + "." + + new String(response.getPayload(), offset + 1, 2) + " " + + new String(response.getPayload(), offset + 3, 4) + "-" + + new String(response.getPayload(), offset + 7, 2) + "-" + + new String(response.getPayload(), offset + 9, 2); + return verStr; + } + } diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SetClockCommand.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SetClockCommand.java index 5dcc6d279f953..c2ae1d73935c7 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SetClockCommand.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/command/SetClockCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Atd100Config.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Atd100Config.java index e29821a059917..9830a5a9ac62d 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Atd100Config.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Atd100Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Ethm1Config.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Ethm1Config.java index 8e6f4734619ee..bb18353b8875b 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Ethm1Config.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/Ethm1Config.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/IntRSConfig.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/IntRSConfig.java index 76d50a5845e4c..4f0f7e08a52a6 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/IntRSConfig.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/IntRSConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelBridgeConfig.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelBridgeConfig.java index b595064360520..690772f69ee37 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelBridgeConfig.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelThingConfig.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelThingConfig.java index 75cc51d0131fc..18d99a056ffba 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelThingConfig.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/config/SatelThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/discovery/SatelDeviceDiscoveryService.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/discovery/SatelDeviceDiscoveryService.java index 5baaec135af80..ee7aeca737a27 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/discovery/SatelDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/discovery/SatelDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ConnectionStatusEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ConnectionStatusEvent.java index 5f9a7ed0ed300..54e17912be3cc 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ConnectionStatusEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ConnectionStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/EventDispatcher.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/EventDispatcher.java index faf5d9117f606..8272c39e12e90 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/EventDispatcher.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/EventDispatcher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStateEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStateEvent.java index 6ea95710a5a64..a3b5b8719e835 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStateEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStateEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStatusEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStatusEvent.java index 428814b284767..7989a939efa7a 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStatusEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraStatusEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraVersionEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraVersionEvent.java index 1f7b136023109..8b2e0607f1100 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraVersionEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/IntegraVersionEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ModuleVersionEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ModuleVersionEvent.java new file mode 100644 index 0000000000000..dbf81f3fa8209 --- /dev/null +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ModuleVersionEvent.java @@ -0,0 +1,55 @@ +/** + * 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.satel.internal.event; + +/** + * Event class describing version of communication module. + * + * @author Krzysztof Goworek - Initial contribution + */ +public class ModuleVersionEvent implements SatelEvent { + + private String version; + private boolean extPayloadSupport; + + /** + * Constructs new event class. + * + * @param version string describing version number and firmware revision + * @param extPayloadSupport the module supports extended (32-bit) payload for zones/outputs + */ + public ModuleVersionEvent(String version, boolean extPayloadSupport) { + this.version = version; + this.extPayloadSupport = extPayloadSupport; + } + + /** + * @return firmware version and date + */ + public String getVersion() { + return version; + } + + /** + * @return <code>true</code> if the module supports extended (32-bit) payload for zones/outputs + */ + public boolean hasExtPayloadSupport() { + return this.extPayloadSupport; + } + + @Override + public String toString() { + return String.format("ModuleVersionEvent: version = %s, extPayloadSupport = %b", this.version, + this.extPayloadSupport); + } +} diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/NewStatesEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/NewStatesEvent.java index 021e4b80072fd..7df949b5245bf 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/NewStatesEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/NewStatesEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEvent.java index 617f1df3971f0..b7952b1f28fd4 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEventListener.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEventListener.java index 695993ca6676c..eb528da04c806 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEventListener.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/SatelEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ZoneTemperatureEvent.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ZoneTemperatureEvent.java index e776527e8c722..968c79c28c96e 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ZoneTemperatureEvent.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/event/ZoneTemperatureEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Atd100Handler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Atd100Handler.java index fc40eb9f10e1f..2cdbc201cffc7 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Atd100Handler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Atd100Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Ethm1BridgeHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Ethm1BridgeHandler.java index db85e459a6866..5c27a75c615b4 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Ethm1BridgeHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/Ethm1BridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/IntRSBridgeHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/IntRSBridgeHandler.java index c25b766527017..c3191d3766cb7 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/IntRSBridgeHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/IntRSBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelBridgeHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelBridgeHandler.java index 63ae4ff8088e6..2d1cfeccc2a0c 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelBridgeHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -61,7 +61,7 @@ public void incomingEvent(SatelEvent event) { // update bridge status and get new states from the system if (statusEvent.isConnected()) { updateStatus(ThingStatus.ONLINE); - satelModule.sendCommand(new NewStatesCommand(satelModule.getIntegraType().hasExtPayload())); + satelModule.sendCommand(new NewStatesCommand(satelModule.hasExtPayloadSupport())); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, statusEvent.getReason()); @@ -94,7 +94,7 @@ protected void initialize(final SatelModule satelModule) { // get list of states that have changed logger.trace("Sending 'get new states' command"); - satelModule.sendCommand(new NewStatesCommand(satelModule.getIntegraType().hasExtPayload())); + satelModule.sendCommand(new NewStatesCommand(satelModule.hasExtPayloadSupport())); }; pollingJob = scheduler.scheduleWithFixedDelay(pollingCommand, 0, config.getRefresh(), TimeUnit.MILLISECONDS); diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelEventLogHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelEventLogHandler.java index 8ae574bb9d882..8697e4b5bfcbd 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelEventLogHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelEventLogHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelOutputHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelOutputHandler.java index 66bed9e4d8051..8112c7e30aec6 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelOutputHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelOutputHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelPartitionHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelPartitionHandler.java index 14d3c5bb5544e..cf123364b6692 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelPartitionHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelPartitionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelShutterHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelShutterHandler.java index cb04c2b78fca4..3706682eab58f 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelShutterHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelShutterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelStateThingHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelStateThingHandler.java index 63f1ec0a33b90..6f872e525bfda 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelStateThingHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelStateThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelSystemHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelSystemHandler.java index 47ec84f037527..b20cfc18c7680 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelSystemHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelSystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelThingHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelThingHandler.java index 5e3495a2041b2..9c2679bbd60b0 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelThingHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelZoneHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelZoneHandler.java index 014c061a6ebfa..3e9c5eb9efe0a 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelZoneHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/SatelZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/WirelessChannelsHandler.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/WirelessChannelsHandler.java index 47df29682ad7b..8e65fde6f938f 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/WirelessChannelsHandler.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/handler/WirelessChannelsHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/EncryptionHelper.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/EncryptionHelper.java index 79efe49396615..0652e65322683 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/EncryptionHelper.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/EncryptionHelper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/Ethm1Module.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/Ethm1Module.java index 2fd098a2ef7b7..2187ed8fa0a29 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/Ethm1Module.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/Ethm1Module.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/IntRSModule.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/IntRSModule.java index b63a96fa3ad89..34c6ebcb25908 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/IntRSModule.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/IntRSModule.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelMessage.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelMessage.java index 10f3746f90585..d993d89ffb0ed 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelMessage.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java index d02e043cc8483..01c66cdf432b5 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,11 +22,13 @@ import java.util.concurrent.LinkedBlockingQueue; import org.openhab.binding.satel.internal.command.IntegraVersionCommand; +import org.openhab.binding.satel.internal.command.ModuleVersionCommand; import org.openhab.binding.satel.internal.command.SatelCommand; import org.openhab.binding.satel.internal.command.SatelCommand.State; import org.openhab.binding.satel.internal.event.ConnectionStatusEvent; import org.openhab.binding.satel.internal.event.EventDispatcher; import org.openhab.binding.satel.internal.event.IntegraVersionEvent; +import org.openhab.binding.satel.internal.event.ModuleVersionEvent; import org.openhab.binding.satel.internal.event.SatelEvent; import org.openhab.binding.satel.internal.event.SatelEventListener; import org.openhab.binding.satel.internal.types.IntegraType; @@ -52,11 +54,12 @@ public abstract class SatelModule extends EventDispatcher implements SatelEventL private final BlockingQueue<SatelCommand> sendQueue = new LinkedBlockingQueue<SatelCommand>(); - private IntegraType integraType; - private int timeout; - private String integraVersion; + private final int timeout; + private volatile IntegraType integraType; + private volatile String integraVersion; + private volatile boolean extPayloadSupport; private CommunicationChannel channel; - private Object channelLock; + private final Object channelLock = new Object(); private CommunicationWatchdog communicationWatchdog; /* @@ -107,9 +110,9 @@ public ConnectionFailureException(String message, Throwable cause) { * operations */ public SatelModule(int timeout) { - this.integraType = IntegraType.UNKNOWN; this.timeout = timeout; - this.channelLock = new Object(); + this.integraType = IntegraType.UNKNOWN; + this.extPayloadSupport = false; addEventListener(this); } @@ -155,6 +158,15 @@ public boolean isInitialized() { return this.integraType != IntegraType.UNKNOWN; } + /** + * Returns extended payload flag. + * + * @return <code>true</code> if the module supports extended (32-bit) payload for zones/outputs + */ + public boolean hasExtPayloadSupport() { + return this.extPayloadSupport; + } + protected abstract CommunicationChannel connect() throws ConnectionFailureException; /** @@ -227,18 +239,23 @@ public boolean sendCommand(SatelCommand cmd, boolean force) { @Override public void incomingEvent(SatelEvent event) { - if (event instanceof IntegraVersionEvent) { + if (event instanceof ModuleVersionEvent) { + ModuleVersionEvent versionEvent = (ModuleVersionEvent) event; + this.extPayloadSupport = versionEvent.hasExtPayloadSupport(); + logger.info("Module version: {}.", versionEvent.getVersion()); + } else if (event instanceof IntegraVersionEvent) { IntegraVersionEvent versionEvent = (IntegraVersionEvent) event; this.integraType = IntegraType.valueOf(versionEvent.getType() & 0xFF); this.integraVersion = versionEvent.getVersion(); - logger.info("Connection to {} initialized. Version: {}.", this.integraType.getName(), this.integraVersion); + logger.info("Connection to {} initialized. INTEGRA version: {}.", this.integraType.getName(), + this.integraVersion); } } private SatelMessage readMessage() throws InterruptedException { try { - InputStream is = this.channel.getInputStream(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); + final InputStream is = this.channel.getInputStream(); + final ByteArrayOutputStream baos = new ByteArrayOutputStream(); boolean inMessage = false; int syncBytes = 0; @@ -312,7 +329,7 @@ private SatelMessage readMessage() throws InterruptedException { private boolean writeMessage(SatelMessage message) { try { - OutputStream os = this.channel.getOutputStream(); + final OutputStream os = this.channel.getOutputStream(); os.write(FRAME_START); for (byte b : message.getBytes()) { @@ -492,6 +509,7 @@ public void run() { this.thread.start(); // if module is not initialized yet, send version command if (!SatelModule.this.isInitialized()) { + SatelModule.this.sendCommand(new ModuleVersionCommand()); SatelModule.this.sendCommand(new IntegraVersionCommand()); } } diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ControlType.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ControlType.java index 2596dbaa4d03b..cb6e0d0064a52 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ControlType.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ControlType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorControl.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorControl.java index bf287d3c3a326..4146a593b412c 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorControl.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorState.java index 2debd05a6ca04..82b81cb86174a 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/DoorState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/IntegraType.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/IntegraType.java index 66e8d99dab87f..f1a38f3e4b727 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/IntegraType.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/IntegraType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ObjectType.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ObjectType.java index a46205edfb5c5..50a704918784d 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ObjectType.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ObjectType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputControl.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputControl.java index 71b348d7aa78e..501dc80cd8f79 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputControl.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputState.java index d2e1a2342d7d7..79594748027c6 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/OutputState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionControl.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionControl.java index ae8d18d72c8cc..ec3ab4919bd08 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionControl.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionState.java index 1aecc98bca79b..5042966e2cc51 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/PartitionState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/StateType.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/StateType.java index ff55b04323db0..cb4ac83bb3c81 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/StateType.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/StateType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleMemoryState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleMemoryState.java index 616640f474b51..d6ab396a22515 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleMemoryState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleMemoryState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleState.java index c9a0d6bb1c7f6..ee6615c4853e1 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/TroubleState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneControl.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneControl.java index 53c732a56672b..1cd43525f18cc 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneControl.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneState.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneState.java index 48065b10b80a7..bb057dc268a65 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneState.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/types/ZoneState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/common.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/common.xml index 713847f73c2fe..d8c63baadf09c 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/common.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/common.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="satel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="device_nocomm"> <item-type>Switch</item-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/ethm-1.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/ethm-1.xml index 67e9c374f5568..2e735dd1d32b7 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/ethm-1.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/ethm-1.xml @@ -13,8 +13,8 @@ <description>Host name or IP address of ETHM-1 module.</description> <context>network-address</context> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> - <label>Port number</label> + <parameter name="port" type="integer" min="1" max="65535"> + <label>Port Number</label> <description>TCP port for the integration protocol.</description> <default>7094</default> </parameter> @@ -25,18 +25,18 @@ <unitLabel>Milliseconds</unitLabel> </parameter> <parameter name="refresh" type="integer" unit="ms"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Polling interval in milliseconds.</description> <default>5000</default> <unitLabel>Milliseconds</unitLabel> </parameter> <parameter name="userCode" type="text" pattern="[0-9]{4,8}"> - <label>User code</label> + <label>User Code</label> <description>Security code of the user in behalf of all operations will be executed. If empty, only read operations are allowed.</description> <context>password</context> </parameter> <parameter name="encryptionKey" type="text"> - <label>Encryption key</label> + <label>Encryption Key</label> <description>Encryption key used to encrypt data sent and received, if empty communication is not encrypted.</description> <context>password</context> </parameter> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/event-log.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/event-log.xml index fb8d024cab12e..2a2c14d676e7c 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/event-log.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/event-log.xml @@ -11,7 +11,7 @@ <bridge-type-ref id="int-rs" /> </supported-bridge-type-refs> - <label>Event log</label> + <label>Event Log</label> <description><![CDATA[A virtual thing that allows reading records from the alarm system event log.<br> Event log must read sequentially starting from the most recent record.]]></description> @@ -27,20 +27,20 @@ <channel-type id="index"> <item-type>Number</item-type> - <label>Current index</label> + <label>Current Index</label> <description>Index of the current record in the event log. Send '-1' to get most recent record.</description> </channel-type> <channel-type id="prev_index"> <item-type>Number</item-type> - <label>Previous index</label> + <label>Previous Index</label> <description>Index of the previous record in the event log. Use this value to iterate over the log.</description> <state readOnly="true" /> </channel-type> <channel-type id="timestamp"> <item-type>DateTime</item-type> - <label>Date and time</label> + <label>Date and Time</label> <description>Date and time when the event happened.</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/int-rs.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/int-rs.xml index a7a5010f62c92..dbfd5254ba522 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/int-rs.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/int-rs.xml @@ -9,7 +9,7 @@ <config-description> <parameter name="port" type="text" required="true"> - <label>Serial port</label> + <label>Serial Port</label> <description>Serial port connected to the module.</description> <context>serial-port</context> </parameter> @@ -20,13 +20,13 @@ <unitLabel>Milliseconds</unitLabel> </parameter> <parameter name="refresh" type="integer" unit="ms"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Current state polling interval, in milliseconds.</description> <default>5000</default> <unitLabel>Milliseconds</unitLabel> </parameter> <parameter name="userCode" type="text" pattern="[0-9]{4,8}"> - <label>User code</label> + <label>User Code</label> <description>Security code of the user in behalf of all operations will be executed.</description> <context>password</context> </parameter> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/output.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/output.xml index e42f42e505200..f35989db6972b 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/output.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/output.xml @@ -24,19 +24,19 @@ <config-description> <parameter name="id" type="integer" min="1" max="256" required="true"> - <label>Output number</label> + <label>Output Number</label> <description>Number that identifies the output in the alarm system</description> </parameter> <parameter name="invertState" type="boolean" required="false"> - <label>Invert state</label> + <label>Invert State</label> <description>Changes active (ON) state to 0</description> </parameter> <parameter name="commandOnly" type="boolean" required="false"> - <label>Command only</label> + <label>Command Only</label> <description>Accepts commands only, does not update state of the thing</description> </parameter> <parameter name="wireless" type="boolean" required="false"> - <label>Wireless output</label> + <label>Wireless Output</label> <description>This output controls a wireless device like ASP-100 R, ASW-100 E, etc.</description> </parameter> </config-description> @@ -45,7 +45,7 @@ <channel-type id="output_state"> <item-type>Switch</item-type> - <label>Output state</label> + <label>Output State</label> <description>Represents state of the output</description> </channel-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/partition.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/partition.xml index d6fe886a3e939..02f793aae6b6f 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/partition.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/partition.xml @@ -39,11 +39,11 @@ access to some portion of the premises to selected users.]]> <config-description> <parameter name="id" type="integer" min="1" max="32" required="true"> - <label>Partition number</label> + <label>Partition Number</label> <description></description> </parameter> <parameter name="forceArming" type="boolean" required="false"> - <label>Force arming</label> + <label>Force Arming</label> <description>Forces arming the partition regardless of ongoing troubles and violations.</description> </parameter> </config-description> @@ -58,66 +58,66 @@ access to some portion of the premises to selected users.]]> <channel-type id="really_armed"> <item-type>Switch</item-type> - <label>Really armed</label> + <label>Really Armed</label> <description>Active when the partion is armed in any mode</description> </channel-type> <channel-type id="armed_mode_1" advanced="true"> <item-type>Switch</item-type> - <label>Armed in mode 1</label> + <label>Armed in Mode 1</label> <description>Active when the partion is armed in mode 1</description> </channel-type> <channel-type id="armed_mode_2" advanced="true"> <item-type>Switch</item-type> - <label>Armed in mode 2</label> + <label>Armed in Mode 2</label> <description>Active when the partion is armed in mode 2</description> </channel-type> <channel-type id="armed_mode_3" advanced="true"> <item-type>Switch</item-type> - <label>Armed in mode 3</label> + <label>Armed in Mode 3</label> <description>Active when the partion is armed in mode 3</description> </channel-type> <channel-type id="first_code_entered" advanced="true"> <item-type>Switch</item-type> - <label>First code entered</label> + <label>First Code Entered</label> <description>Active when first code of required two codes has been entered</description> <state readOnly="true" /> </channel-type> <channel-type id="entry_time" advanced="true"> <item-type>Switch</item-type> - <label>Entry time</label> + <label>Entry Time</label> <description>Active in entry time</description> <state readOnly="true" /> </channel-type> <channel-type id="exit_time_gt_10" advanced="true"> <item-type>Switch</item-type> - <label>Exit time > 10s</label> + <label>Exit Time > 10s</label> <description>Active when arming is in progress and time to exit is greater than ten seconds</description> <state readOnly="true" /> </channel-type> <channel-type id="exit_time_lt_10" advanced="true"> <item-type>Switch</item-type> - <label>Exit time < 10s</label> + <label>Exit Time < 10s</label> <description>Active when arming is in progress and time to exit is less than ten seconds</description> <state readOnly="true" /> </channel-type> <channel-type id="temporary_blocked" advanced="true"> <item-type>Switch</item-type> - <label>Temporary blocked</label> + <label>Temporary Blocked</label> <description>Active when the partition is blocked after arming</description> <state readOnly="true" /> </channel-type> <channel-type id="blocked_for_guard" advanced="true"> <item-type>Switch</item-type> - <label>Blocked for guard</label> + <label>Blocked for Guard</label> <description>Active when the partition is blocked for guard round</description> <state readOnly="true" /> </channel-type> @@ -130,37 +130,37 @@ access to some portion of the premises to selected users.]]> <channel-type id="alarm_memory"> <item-type>Switch</item-type> - <label>Alarm memory</label> + <label>Alarm Memory</label> <description>Active when there had been an alarm in the patition</description> </channel-type> <channel-type id="fire_alarm"> <item-type>Switch</item-type> - <label>Fire alarm</label> + <label>Fire Alarm</label> <description>Active when there is ongoing fire alarm in the patition</description> </channel-type> <channel-type id="fire_alarm_memory"> <item-type>Switch</item-type> - <label>Fire alarm memory</label> + <label>Fire Alarm Memory</label> <description>Active when there had been a fire alarm in the patition</description> </channel-type> <channel-type id="verified_alarms" advanced="true"> <item-type>Switch</item-type> - <label>Verified alarms</label> + <label>Verified Alarms</label> <description>Active when two zones triggered an alarm during verification time</description> </channel-type> <channel-type id="warning_alarms" advanced="true"> <item-type>Switch</item-type> - <label>Warning alarms</label> + <label>Warning Alarms</label> <description>Active when there are warning alarms in the partition</description> </channel-type> <channel-type id="violated_zones" advanced="true"> <item-type>Switch</item-type> - <label>Violated zones</label> + <label>Violated Zones</label> <description>Active when there are violated zones in the partition</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/shutter.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/shutter.xml index 8943d36e9cf9d..72dc638476661 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/shutter.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/shutter.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="int-rs" /> </supported-bridge-type-refs> - <label>Roller shutter</label> + <label>Roller Shutter</label> <description>A roller shutter connected to two subsequent outputs.</description> <channels> @@ -19,15 +19,15 @@ <config-description> <parameter name="upId" type="integer" min="1" max="256" required="true"> - <label>Up output</label> + <label>Up Output</label> <description>Output number for "up" direction.</description> </parameter> <parameter name="downId" type="integer" min="1" max="256" required="true"> - <label>Down output</label> + <label>Down Output</label> <description>Output number for "down" direction.</description> </parameter> <parameter name="commandOnly" type="boolean" required="false"> - <label>Command only</label> + <label>Command Only</label> <description>Accepts commands only, does not update state of the thing</description> </parameter> </config-description> @@ -36,7 +36,7 @@ <channel-type id="shutter_state"> <item-type>Rollershutter</item-type> - <label>Shutter state</label> + <label>Shutter State</label> <description>Represents state of the roller shutter</description> </channel-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/system.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/system.xml index 1539602880428..1d98842c56647 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/system.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/system.xml @@ -10,7 +10,7 @@ <bridge-type-ref id="int-rs" /> </supported-bridge-type-refs> - <label>Alarm system</label> + <label>Alarm System</label> <description>A virtual thing describing general status of the alarm system.</description> <channels> @@ -28,7 +28,7 @@ <channel-type id="date_time"> <item-type>DateTime</item-type> - <label>Date and time</label> + <label>Date and Time</label> <description>Current date and time in the alarm system</description> </channel-type> @@ -40,41 +40,41 @@ <channel-type id="troubles_memory" advanced="true"> <item-type>Switch</item-type> - <label>Troubles memory</label> + <label>Troubles Memory</label> <description>Memorized state of system troubles</description> </channel-type> <channel-type id="service_mode"> <item-type>Switch</item-type> - <label>Service mode</label> + <label>Service Mode</label> <description>Active when the system is in service mode</description> <state readOnly="true" /> </channel-type> <channel-type id="acu100_present" advanced="true"> <item-type>Switch</item-type> - <label>ACU-100 present</label> + <label>ACU-100 Present</label> <description>Active when there is an ACU-100 module installed in the system</description> <state readOnly="true" /> </channel-type> <channel-type id="intrx_present" advanced="true"> <item-type>Switch</item-type> - <label>INT-RX present</label> + <label>INT-RX Present</label> <description>Active when there is an INT-RX module installed in the system</description> <state readOnly="true" /> </channel-type> <channel-type id="grade23_set" advanced="true"> <item-type>Switch</item-type> - <label>Grade2/Grade3 set</label> + <label>Grade2/Grade3 Set</label> <description>Active when Grade2/Grade3 option is set in the system</description> <state readOnly="true" /> </channel-type> <channel-type id="user_code"> <item-type>String</item-type> - <label>User code</label> + <label>User Code</label> <description>Accepts string commands that override configured user code. Send empty string to revert user code to the one in the binding configuration.</description> </channel-type> diff --git a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/zone.xml b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/zone.xml index 956aae41ad642..6075c870ba2ff 100644 --- a/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/zone.xml +++ b/bundles/org.openhab.binding.satel/src/main/resources/ESH-INF/thing/zone.xml @@ -34,15 +34,15 @@ <config-description> <parameter name="id" type="integer" min="1" max="256" required="true"> - <label>Zone number</label> + <label>Zone Number</label> <description>Number that identifies the zone in the alarm system</description> </parameter> <parameter name="invertState" type="boolean" required="false"> - <label>Invert state</label> + <label>Invert State</label> <description>Changes active (ON) state to 0</description> </parameter> <parameter name="wireless" type="boolean" required="false"> - <label>Wireless zone</label> + <label>Wireless Zone</label> <description>This zone is monitored by a wireless detector like APD-100, AFD-100, etc</description> </parameter> </config-description> @@ -72,21 +72,21 @@ <channel-type id="tamper_alarm"> <item-type>Switch</item-type> - <label>Tamper alarm</label> + <label>Tamper Alarm</label> <description>Active when detector in the zone is tampered and zone is armed</description> <state readOnly="true" /> </channel-type> <channel-type id="alarm_memory"> <item-type>Switch</item-type> - <label>Alarm memory</label> + <label>Alarm Memory</label> <description>Memorized alarm state for the zone</description> <state readOnly="true" /> </channel-type> <channel-type id="tamper_alarm_memory"> <item-type>Switch</item-type> - <label>Tamper alarm memory</label> + <label>Tamper Alarm Memory</label> <description>Memorized tamper alarm state for the zone</description> <state readOnly="true" /> </channel-type> @@ -99,14 +99,14 @@ <channel-type id="no_violation_trouble" advanced="true"> <item-type>Switch</item-type> - <label>No violation trouble</label> + <label>No Violation Trouble</label> <description>Active when no violation has been detected in the zone for configured time</description> <state readOnly="true" /> </channel-type> <channel-type id="long_violation_trouble" advanced="true"> <item-type>Switch</item-type> - <label>Long violation trouble</label> + <label>Long Violation Trouble</label> <description>Active when violation in the zone lasts longer than configured time</description> <state readOnly="true" /> </channel-type> @@ -126,7 +126,7 @@ <channel-type id="masked_memory" advanced="true"> <item-type>Switch</item-type> - <label>Masked memory</label> + <label>Masked Memory</label> <description>Memorized masked state for the zone</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.seneye/.classpath b/bundles/org.openhab.binding.seneye/.classpath old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.seneye/.project b/bundles/org.openhab.binding.seneye/.project old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.seneye/NOTICE b/bundles/org.openhab.binding.seneye/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.seneye/NOTICE +++ b/bundles/org.openhab.binding.seneye/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.seneye/pom.xml b/bundles/org.openhab.binding.seneye/pom.xml old mode 100755 new mode 100644 index b47b1005707f6..69c1072e2f542 --- a/bundles/org.openhab.binding.seneye/pom.xml +++ b/bundles/org.openhab.binding.seneye/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.seneye</artifactId> diff --git a/bundles/org.openhab.binding.seneye/src/main/feature/feature.xml b/bundles/org.openhab.binding.seneye/src/main/feature/feature.xml index a60428422ea99..04d91def1dee1 100644 --- a/bundles/org.openhab.binding.seneye/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.seneye/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.seneye-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-seneye" description="Seneye Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/CommunicationException.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/CommunicationException.java index d06a4a8c6bea9..c0f2d6cfa00e0 100644 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/CommunicationException.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/CommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/InvalidConfigurationException.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/InvalidConfigurationException.java old mode 100755 new mode 100644 index 8dc28f1626590..05e55bab675ac --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/InvalidConfigurationException.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/InvalidConfigurationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/ReadingsUpdate.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/ReadingsUpdate.java old mode 100755 new mode 100644 index 6de4cdc1d8bd8..7f57e9cd3a9b7 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/ReadingsUpdate.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/ReadingsUpdate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/Seneye.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/Seneye.java old mode 100755 new mode 100644 index d1c042f68a66c..45f292373ea6d --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/Seneye.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/Seneye.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeBindingConstants.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeBindingConstants.java old mode 100755 new mode 100644 index cd18184365b4e..15eaa3728498a --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeBindingConstants.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeConfigurationParameters.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeConfigurationParameters.java index f488f6a4f32d5..4e22e841cf7b4 100644 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeConfigurationParameters.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeConfigurationParameters.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReading.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReading.java old mode 100755 new mode 100644 index 7bfd70fac090e..c24c606bb4d81 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReading.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingAdvice.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingAdvice.java old mode 100755 new mode 100644 index f4549bdbf50ca..8e0b200e12132 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingAdvice.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingAdvice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingKelvin.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingKelvin.java old mode 100755 new mode 100644 index 79926968e4761..c363d09e16241 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingKelvin.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingKelvin.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingLux.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingLux.java old mode 100755 new mode 100644 index 62c9d41ad6d1e..a67293fab33fd --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingLux.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingLux.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh3.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh3.java old mode 100755 new mode 100644 index e33d7971c7f3d..2dfd928410c89 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh3.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh3.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh4.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh4.java old mode 100755 new mode 100644 index 19e55c0854f1f..da3b213a99a9d --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh4.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingNh4.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingO2.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingO2.java old mode 100755 new mode 100644 index 8c63f30e5ef9b..66c0dc306bf2e --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingO2.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingO2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPar.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPar.java old mode 100755 new mode 100644 index 2d822f9012b67..70dba5c022bf9 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPar.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPar.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPh.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPh.java old mode 100755 new mode 100644 index 01ea8de092be6..eb0e684a125c4 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPh.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingPh.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingTemperature.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingTemperature.java old mode 100755 new mode 100644 index b8cbac057fafb..4d13f22319045 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingTemperature.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeDeviceReadingTemperature.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeHandlerFactory.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeHandlerFactory.java old mode 100755 new mode 100644 index 8f2611aa0022c..75f0a4c2e4f94 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeHandlerFactory.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeService.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeService.java old mode 100755 new mode 100644 index 2513b9af24bd2..7fea63e04be48 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeService.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeStatus.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeStatus.java old mode 100755 new mode 100644 index 968a902f2c5ec..94c5c83c11e64 --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeStatus.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/SeneyeStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/handler/SeneyeHandler.java b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/handler/SeneyeHandler.java old mode 100755 new mode 100644 index 4422c7dc27160..a965475f2815b --- a/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/handler/SeneyeHandler.java +++ b/bundles/org.openhab.binding.seneye/src/main/java/org/openhab/binding/seneye/internal/handler/SeneyeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/binding/binding.xml old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/thing/thing-types.xml old mode 100755 new mode 100644 index 275eb026fe957..b28f61ffd0efa --- a/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.seneye/src/main/resources/ESH-INF/thing/thing-types.xml @@ -95,19 +95,19 @@ </channel-type> <channel-type id="kelvin"> <item-type>Number</item-type> - <label>kelvin</label> + <label>Kelvin</label> <description>The Kelvin Light Level</description> <state readOnly="true" /> </channel-type> <channel-type id="lastreading"> <item-type>DateTime</item-type> - <label>Last reading</label> + <label>Last Reading</label> <description>The last time your seneye is checked</description> <state readOnly="true" /> </channel-type> <channel-type id="slideexpires"> <item-type>DateTime</item-type> - <label>Slide expiration</label> + <label>Slide Expiration</label> <description>The time your slide expires</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.sensebox/NOTICE b/bundles/org.openhab.binding.sensebox/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.sensebox/NOTICE +++ b/bundles/org.openhab.binding.sensebox/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.sensebox/pom.xml b/bundles/org.openhab.binding.sensebox/pom.xml index 732a05460c5cc..43d89fe0b2fdc 100644 --- a/bundles/org.openhab.binding.sensebox/pom.xml +++ b/bundles/org.openhab.binding.sensebox/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sensebox</artifactId> diff --git a/bundles/org.openhab.binding.sensebox/src/main/feature/feature.xml b/bundles/org.openhab.binding.sensebox/src/main/feature/feature.xml index 8e977535b8a23..b4d2066e7bd90 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sensebox/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.sensebox-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sensebox" description="Sensebox Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxAPIConnection.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxAPIConnection.java index f40498c3b7889..fd39ae7358fe6 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxAPIConnection.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxAPIConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxBindingConstants.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxBindingConstants.java index 38e2b456af35e..b96a8e3e362bd 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxBindingConstants.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxHandlerFactory.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxHandlerFactory.java index 5e4df4fb5e3de..6063116c82f4e 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxHandlerFactory.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/SenseBoxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/config/SenseBoxConfiguration.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/config/SenseBoxConfiguration.java index 6bfdb08a8d739..58fb6ae51a3af 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/config/SenseBoxConfiguration.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/config/SenseBoxConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/handler/SenseBoxHandler.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/handler/SenseBoxHandler.java index d49ed03a03f3f..22d1b2967edb9 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/handler/SenseBoxHandler.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/handler/SenseBoxHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxData.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxData.java index 6b55de551647e..8d1473a4d73c3 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxData.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxDescriptor.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxDescriptor.java index 43979fe717280..dc03b9b67fbdb 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxDescriptor.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxDescriptor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxGeometry.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxGeometry.java index 9c5cfa91d0e91..9a41a4c53140a 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxGeometry.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxGeometry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLoc.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLoc.java index 4522df6d91485..6937d5412c1e1 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLoc.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLoc.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLocation.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLocation.java index 59714e98f3436..899c3d25d1acc 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLocation.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxLocation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxMeasurement.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxMeasurement.java index 210df4620b01c..bff0cf19e341e 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxMeasurement.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxMeasurement.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxSensor.java b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxSensor.java index 07f796e24ecd3..8230b96da0d1f 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxSensor.java +++ b/bundles/org.openhab.binding.sensebox/src/main/java/org/openhab/binding/sensebox/internal/model/SenseBoxSensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sensebox/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.sensebox/src/main/resources/ESH-INF/thing/channels.xml index 077bd3aa1641d..f8c06ea006a75 100644 --- a/bundles/org.openhab.binding.sensebox/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.sensebox/src/main/resources/ESH-INF/thing/channels.xml @@ -63,7 +63,7 @@ <channel-type id="uvIntensityLastReported" advanced="true"> <item-type>DateTime</item-type> - <label>UV intensity Measurement Time</label> + <label>UV Intensity Measurement Time</label> <description>Timestamp when data was measured</description> <state readOnly="true"/> </channel-type> diff --git a/bundles/org.openhab.binding.serialbutton/NOTICE b/bundles/org.openhab.binding.serialbutton/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.serialbutton/NOTICE +++ b/bundles/org.openhab.binding.serialbutton/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.serialbutton/pom.xml b/bundles/org.openhab.binding.serialbutton/pom.xml index de52d2f7ef4c3..9bd9b2a49684c 100644 --- a/bundles/org.openhab.binding.serialbutton/pom.xml +++ b/bundles/org.openhab.binding.serialbutton/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.serialbutton</artifactId> diff --git a/bundles/org.openhab.binding.serialbutton/src/main/feature/feature.xml b/bundles/org.openhab.binding.serialbutton/src/main/feature/feature.xml index 9a09db74da545..18fe161599e3a 100644 --- a/bundles/org.openhab.binding.serialbutton/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.serialbutton/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.serialbutton-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-serialbutton" description="Serial Button Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonBindingConstants.java b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonBindingConstants.java index 503ab6edab578..cc6bc12f3204e 100644 --- a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonBindingConstants.java +++ b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonHandlerFactory.java b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonHandlerFactory.java index 98f56f65fcfdc..96f17d92e761b 100644 --- a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonHandlerFactory.java +++ b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/SerialButtonHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java index 4673c269664fa..25999161ec9e7 100644 --- a/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java +++ b/bundles/org.openhab.binding.serialbutton/src/main/java/org/openhab/binding/serialbutton/internal/handler/SerialButtonHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.shelly/.classpath b/bundles/org.openhab.binding.shelly/.classpath new file mode 100644 index 0000000000000..615608997a6c5 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/.classpath @@ -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="test" value="true"/> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" 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> diff --git a/bundles/org.openhab.io.azureiothub/.project b/bundles/org.openhab.binding.shelly/.project similarity index 92% rename from bundles/org.openhab.io.azureiothub/.project rename to bundles/org.openhab.binding.shelly/.project index ef9ae19c5978d..9b6a8135f7711 100644 --- a/bundles/org.openhab.io.azureiothub/.project +++ b/bundles/org.openhab.binding.shelly/.project @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>org.openhab.io.azureiothub</name> + <name>org.openhab.binding.shelly</name> <comment></comment> <projects> </projects> diff --git a/bundles/org.openhab.binding.shelly/NOTICE b/bundles/org.openhab.binding.shelly/NOTICE new file mode 100644 index 0000000000000..38d625e349232 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/NOTICE @@ -0,0 +1,13 @@ +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 diff --git a/bundles/org.openhab.binding.shelly/README.md b/bundles/org.openhab.binding.shelly/README.md new file mode 100644 index 0000000000000..d97e9b24c8ca7 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/README.md @@ -0,0 +1,509 @@ +# Shelly Binding + +This Binding integrated Shelly devices. + +## Supported Devices + +|Thing |Type | +|--------------------|--------------------------------------------------------| +| shelly1 | Shelly Single Relay Switch | +| shelly1pm | Shelly Single Relay Switch with integrated Power Meter | +| shellyem | Shelly EM with integrated Power Meter | +| shelly2-relay | Shelly Double Relay Switch in relay mode | +| shelly2-roller | Shelly2 in Roller Mode | +| shelly25-relay | Shelly 2.5 in Relay Switch | +| shelly25-roller | Shelly 2.5 in Roller Mode | +| shelly4pro | Shelly 4x Relay Switch | +| shellydimmer | Shelly Dimmer | +| shellyplugs | Shelly Plug-S | +| shellyplug | Shelly Plug | +| shellyrgbw2 | Shelly RGB Controller | +| shellybulb | Shelly Bulb in Color or White Mode | +| shellyht | Shelly Sensor (temp+humidity) | +| shellyflood | Shelly Flood Sensor | +| shellysmoke | Shelly Smoke Sensor | +| shellysense | Shelly Motion and IR Controller | +| shellydevice | A password protected Shelly device or an unknown type | + +## Firmware + +To utilize all features the binding requires firmware version 1.5.2 or newer. +This should be available for all devices. +Older versions work in general, but have impacts to functionality (e.g. no events for battery powered devices). + +The binding displays a WARNING in the log if the firmware is older. +It also informs you when an update is available. +Use the device' web ui or the Shelly App to perform the update. + +## Discovery + +The binding uses mDNS to discover the Shelly devices. +They periodically announce their presence, which is used by the binding to find them on the local network. + +Make sure to wake-up battery powered devices (press the button inside the device), so that they show up on the network. +Sometimes you need to run the manual discovery multiple times until you see all your devices. + +Important: The IP address should not be changed after the device is added to openHAB. +This can be achieved by + +- assigning a static IP address or +- using DHCP and setup the router to always assign the same IP address to the device + +### Password Protected Devices + +The Shelly devices can be configured to require authentication through a user id and password. +In this case you need to set these values in the Thing configuration after approving the Inbox entry. + +## Binding Configuration + +The binding has the following configuration options: + +| Parameter |Description |Mandatory|Default | +|----------------|------------------------------------------------------------------|---------|------------------------------------------------| +| defaultUserId |Default user id for HTTP authentication when not set in the Thing | no |admin | +| defaultPassword|Default password for HTTP authentication when not set in the Thing| no |admin | + +## Thing Configuration + +|Parameter |Description |Mandatory|Default | +|------------------|--------------------------------------------------------------|---------|--------------------------------------------------| +|deviceIp |IP address of the Shelly device | yes |none | +|userId |The user id used for HTTP authentication | no |none | +|password |Password for HTTP authentication* | no |none | +|lowBattery |Threshold for battery level. Set alert when level is below. | no |20 (=20%), only for battery powered devices | +|updateInterval |Interval for the background status check in seconds. | no |1h for battery powered devices, 60s for all others| +|eventsButton |true: register event "trigger when a button is pushed" | no |false | +|eventsPush |true: register event "trigger on short and long push" | no |false | +|eventsSwitch |true: register event "trigger of switching the relay output" | no |true | +|eventsSensorReport|true: register event "posted updated sensor data" | no |true for sensor devices | +|eventsCoIoT |true: Listen for CoIoT/COAP events | no |true for battery devices, false for others | + + +## Channels + +### General Notes + +- channels `input` and `input1`/`input2` get only updated with firmware 1.5.6+. +- channel button: Short push and long push events require firmware version 1.5.6+. +- Use the channel `rollerpos` only if you need the inverted roller position, otherwise use the `control` channel with item type `Number` +- The different devices have different types of power meters, i.e. different sets of channels. + +Every device has a channel group `device` with the following channels: + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|device |uptime |Number |yes |Number of seconds since the device was powered up | +| |wifiSignal |Number |yes |WiFi signal strength (4=excellent, 3=good, 2=not string, 1=unreliable, 0=none) | +| |alarm |Trigger |yes |Most recent alarm for health check | + + +### Alarm Events + +The binding provides health monitoring functions for the device. +When an alarm condition is detected the channel alarm gets triggered and provides one of the following alarm types: + +|Event Type|Description| +|------------|-----------------------------------------------------------------------------------------------------------------| +|WEAK_SIGNAL |An alarm is triggered when RSSI is < -80, which indicates an unstable connection. | +|RESTARTED |The device has been restarted. This could be an indicator for a firmware problem. | +|OVER_TEMP |The device is over heating, check installation and housing. | +|OVER_LOAD |An over load condition has been detected, e.g. from the roller motor. | +|OVER_POWER |Maximum allowed power was exceeded. The relay was turned off. | +|LOAD_ERROR |Device reported a load problem. | +|LOW_BATTERY |Device reported a load problem. | + +A new alarm will be triggered on a new condition or every 5 minutes if the condition persists. + +``` +rule "Shelly Alarm" +when + Channel "shelly:shelly1:XXXXXX:device#alarm" triggered +then + logInfo("Shelly", "n alarm condition was detected:" + receivedEvent.toString()) +end +``` + +### Shelly 1 (thing-type: shelly1) + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay |output |Switch |r/w |Controls the relay's output channel (on/off) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | + +### Shelly 1PM (thing-type: shelly1pm) + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay |output |Switch |r/w |Controls the relay's output channel (on/off) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |button |Trigger |yes |Event trigger with payload SHORT_PRESSED or LONG_PRESSED (FW 1.5.6+) | +|meter |currentWatts |Number |yes |Current power consumption in Watts | +| |lastPower1 |Number |yes |Energy consumption in Watts for a round minute, 1 minute ago | +| |lastPower2 |Number |yes |Energy consumption in Watts for a round minute, 2 minutes ago | +| |lastPower3 |Number |yes |Energy consumption in Watts for a round minute, 3 minutes ago | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |timestamp |String |yes |Timestamp of the last measurement | + +### Shelly EM (thing-type: shellyem) + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay |output |Switch |r/w |Controls the relay's output channel (on/off) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |button |Trigger |yes |Event trigger with payload SHORT_PRESSED or LONG_PRESSED (FW 1.5.6+) | +|meter1 |currentWatts |Number |yes |Current power consumption in Watts | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |returnedKWH |Number |yes |Total returned energy, kw/h | +| |reactiveWatts|Number |yes |Instantaneous reactive power, Watts | +| |voltage |Number |yes |RMS voltage, Volts | +| |timestamp |String |yes |Timestamp of the last measurement | +|meter2 |currentWatts |Number |yes |Current power consumption in Watts | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |returnedKWH |Number |yes |Total returned energy, kw/h | +| |reactiveWatts|Number |yes |Instantaneous reactive power, Watts | +| |voltage |Number |yes |RMS voltage, Volts | +| |timestamp |String |yes |Timestamp of the last measurement | + +### Shelly 2 - relay mode thing-type: shelly2-relay) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay1 |output |Switch |r/w |Relay #1: Controls the relay's output channel (on/off) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |autoOn |Number |r/w |Relay #1: Sets a timer to turn the device ON after every OFF command; in seconds| +| |autoOff |Number |r/w |Relay #1: Sets a timer to turn the device OFF after every ON command; in seconds| +| |timerActive |Switch |yes |Relay #1: ON: An auto-on/off timer is active | +| |button |Trigger |yes |Event trigger with payload SHORT_PRESSED or LONG_PRESSED (FW 1.5.6+) | +|relay2 |output |Switch |r/w |Relay #2: Controls the relay's output channel (on/off) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |autoOn |Number |r/w |Relay #2: Sets a timer to turn the device ON after every OFF command; in seconds| +| |autoOff |Number |r/w |Relay #2: Sets a timer to turn the device OFF after every ON command; in seconds| +| |timerActive |Switch |yes |Relay #2: ON: An auto-on/off timer is active | +| |button |Trigger |yes |Event trigger with payload SHORT_PRESSED or LONG_PRESSED (FW 1.5.6+) | +|meter |currentWatts |Number |yes |Current power consumption in Watts | +| |lastPower1 |Number |yes |Energy consumption in Watts for a round minute, 1 minute ago | +| |lastPower2 |Number |yes |Energy consumption in Watts for a round minute, 2 minutes ago | +| |lastPower3 |Number |yes |Energy consumption in Watts for a round minute, 3 minutes ago | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |timestamp |String |yes |Timestamp of the last measurement | + +### Shelly 2 - roller mode thing-type: shelly2-roller) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|--------------------------------------------------------------------------------------| +|roller |control |Rollershutter|r/w |can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close) | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |rollerpos |Number |r/w |Roller position: 100%=open...0%=closed; gets updated when the roller stops, see Notes | +| |lastDirection|String |yes |Last direction: open or close | +| |stopReason |String |yes |Last stop reasons: normal, safety_switch or obstacle | +| |event |Trigger |yes |Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP | +|meter |currentWatts |Number |yes |Current power consumption in Watts | +| |lastPower1 |Number |yes |Energy consumption in Watts for a round minute, 1 minute ago | +| |lastPower2 |Number |yes |Energy consumption in Watts for a round minute, 2 minutes ago | +| |lastPower3 |Number |yes |Energy consumption in Watts for a round minute, 3 minutes ago | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |timestamp |String |yes |Timestamp of the last measurement | + +### Shelly 2.5 - relay mode (thing-type:shelly25-relay) + +The Shelly 2.5 includes 2 meters, one for each channel. + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay1 | | | |See group relay1 for Shelly 2 | +|relay2 | | | |See group relay1 for Shelly 2 | +|meter1 | | | |See group meter1 for Shelly 2 | +|meter2 | | | |See group meter1 for Shelly 2 | + +### Shelly 2.5 - roller mode (thing-type: shelly25-roller) + +The Shelly 2.5 includes 2 meters, one for each channel. +However, it doesn't make sense to differ power consumption for the roller moving up vs. moving down. +For this the binding aggregates the power consumption of both relays and includes the values in "meter1". + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|-------------------------------------------------------------------------------------------| +|roller |control |Rollershutter |r/w |can be open (0%), stop, or close (100%); could also handle ON (open) and OFF (close)| +| |rollerpos |Dimmer |r/w |Roller position: 100%=open...0%=closed; gets updated when the roller stopped | +| |input |Switch |yes |ON: Input/Button is powered, see General Notes on Channels | +| |lastDirection|String |yes |Last direction: open or close | +| |stopReason |String |yes |Last stop reasons: normal, safety_switch or obstacle | +| |calibrating |Switch |yes |ON: Roller is in calibration mode, OFF: normal mode (no calibration) | +| |positioning |Switch |yes |ON: Roller is positioning/moving | +| |event |Trigger |yes |Roller event/trigger with payload ROLLER_OPEN / ROLLER_CLOSE / ROLLER_STOP | +|meter | | | |See group meter1 for Shelly 2 | + +### Shelly4 Pro (thing-type: shelly4pro) + +The Shelly 4Pro provides 4 relays and 4 power meters. + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay1 | | | |See group relay1 for Shelly 2 | +|relay2 | | | |See group relay1 for Shelly 2 | +|relay3 | | | |See group relay1 for Shelly 2 | +|relay4 | | | |See group relay1 for Shelly 2 | +|meter1 | | | |See group meter1 for Shelly 2 | +|meter2 | | | |See group meter1 for Shelly 2 | +|meter3 | | | |See group meter1 for Shelly 2 | +|meter4 | | | |See group meter1 for Shelly 2 | + +### Shelly Plug-S (thing-type: shellyplugs) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay | | | |See group relay1 for Shelly 2 | +|meter | | | |See group meter1 for Shelly 2 | +|led |statusLed |Switch |r/w |ON: Status LED is disabled, OFF: LED enabled | +| |powerLed |Switch |r/w |ON: Power LED is disabled, OFF: LED enabled | + +### Shelly Dimmer (thing-type: shellydimmer) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|---------------------------------------------------------------------------------| +|relay |brightness |Dimmer |r/w |Currently selected brightness. | +| |input1 |Switch |yes |State of Input 1 (S1) | +| |input2 |Switch |yes |State of Input 2 (S2) | +| |autoOn |Number |r/w |Sets a timer to turn the device ON after every OFF command; in seconds | +| |autoOff |Number |r/w |Sets a timer to turn the device OFF after every ON command; in seconds | +| |button |Trigger |yes |Event trigger with payload SHORT_PRESSED or LONG_PRESSED (FW 1.5.6+) | +|status |loaderror |Switch |yes |Last error, "no" if none | +| |overload |Switch |yes |Overload condition detected, switch dimmer off or reduce load! | +| |overtemperature |Switch|yes |Internal device temperature over maximum. Switch off, check physical installation| +|meter |currentWatts |Number |yes |Current power consumption in Watts | +| |lastPower1 |Number |yes |Energy consumption in Watts for a round minute, 1 minute ago | +| |lastPower2 |Number |yes |Energy consumption in Watts for a round minute, 2 minutes ago | +| |lastPower3 |Number |yes |Energy consumption in Watts for a round minute, 3 minutes ago | +| |totalKWH |Number |yes |Total energy consumption in Watts since the device powered up (reset on restart) | +| |timestamp |String |yes |Timestamp of the last measurement | + +### Shelly Bulb (thing-type: shellybulb) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|control |power |Switch |r/w |Switch light ON/OFF | +| |mode |Switch |r/w |Color mode: color or white | +| |autoOn |Number |r/w |Sets a timer to turn the device ON after every OFF; in sec | +| |autoOff |Number |r/w |Sets a timer to turn the device OFF after every ON: in sec | +| |timerActive |Switch |yes |ON: An auto-on/off timer is active | +|color | | | |Color settings: only valid in COLOR mode | +| |hsb |HSB |r/w |Represents the color picker (HSBType), control r/g/b, bight not white | +| |full |String |r/w |Set Red / Green / Blue / Yellow / White mode and switch mode | +| | | |r/w |Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w" | +| |red |Dimmer |r/w |Red brightness: 0..100% or 0..255 (control only the red channel) | +| |green |Dimmer |r/w |Green brightness: 0..100% or 0..255 (control only the red channel) | +| |blue |Dimmer |r/w |Blue brightness: 0..100% or 0..255 (control only the red channel) | +| |white |Dimmer |r/w |White brightness: 0..100% or 0..255 (control only the red channel) | +| |gain |Dimmer |r/w |Gain setting: 0..100% or 0..100 | +| |effect |Number |r/w |Puts the light into effect mode: 0..6) | +| | | | | 0=No effect, 1=Meteor Shows, 2=Gradual Change, 3=Breath | +| | | | | 4=Flash, 5=On/Off Gradual, 6=Red/Green Change | +|white | | | |Color settings: only valid in WHITE mode | +| |temperature |Number |r/w |color temperature (K): 0..100% or 3000..6500 | +| |brightness |Dimmer | |Brightness: 0..100% or 0..100 | + +### Shelly RGBW2 in Color Mode (thing-type: shellyrgbw2-color) + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|control |power |Switch |r/w |Switch light ON/OFF | +| |autoOn |Number |r/w |Sets a timer to turn the device ON after every OFF command; in seconds| +| |autoOff |Number |r/w |Sets a timer to turn the device OFF after every ON command; in seconds| +| |timerActive |Switch |yes |ON: An auto-on/off timer is active | +|light |color |Color |r/w |Color picker (HSBType) | +| |fullColor |String |r/w |Set Red / Green / Blue / Yellow / White mode and switch mode | +| | | |r/w |Valid settings: "red", "green", "blue", "yellow", "white" or "r,g,b,w" | +| |red |Dimmer |r/w |Red brightness: 0..100% or 0..255 (control only the red channel) | +| |green |Dimmer |r/w |Green brightness: 0..100% or 0..255 (control only the red channel) | +| |blue |Dimmer |r/w |Blue brightness: 0..100% or 0..255 (control only the red channel) | +| |white |Dimmer |r/w |White brightness: 0..100% or 0..255 (control only the red channel) | +| |gain |Dimmer |r/w |Gain setting: 0..100% or 0..100 | +| |effect |Number |r/w |Select a special effect | +| | | | | 0=No effect, 1=Meteor Shows, 2=Gradual Change, 3=Flash | +|meter |currentWatts |Number |yes |Current power consumption in Watts | + +### Shelly RGBW2 in White Mode (thing-type: shellyrgbw2-white) + +|Group |Channel |Type |read-only|Desciption | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|control |autoOn |Number |r/w |Sets a timer to turn the device ON after every OFF command; in seconds| +| |autoOff |Number |r/w |Sets a timer to turn the device OFF after every ON command; in seconds| +| |timerActive |Switch |yes |ON: An auto-on/off timer is active | +|channel1 |power |Switch |r/w |Channel 1: Turn channel on/off | +| |brightness |Dimmer |r/w |Channel 1: Brightness: 0..100 | +|channel2 |power |Switch |r/w |Channel 2: Turn channel on/off | +| |brightness |Dimmer |r/w |Channel 2: Brightness: 0..100 | +|channel3 |power |Switch |r/w |Channel 3: Turn channel on/off | +| |brightness |Dimmer |r/w |Channel 3: Brightness: 0..100 | +|channel4 |power |Switch |r/w |Channel 4: Turn channel on/off | +| |brightness |Dimmer |r/w |Channel 4: Brightness: 0..100 | +|meter1 |currentWatts |Number |yes |Channel 1: Current power consumption in Watts | +|meter2 |currentWatts |Number |yes |Channel 2: Current power consumption in Watts | +|meter3 |currentWatts |Number |yes |Channel 3: Current power consumption in Watts | +|meter4 |currentWatts |Number |yes |Channel 4: Current power consumption in Watts | + +Please note that the settings of channel group color are only valid in color mode and vice versa for white mode. +The current firmware doesn't support the timestamp report for the meters. +In this case "n/a" is returned. +Maybe an upcoming firmware release adds this attribute, then the correct value is returned; + +### Shelly HT (thing-type: shellyht) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|sensors |temperature |Number |yes |Temperature, unit is reported by tempUnit | +| |humidity |Number |yes |Relative humidity in % | +| |last_update |String |yes |Timestamp of the last update (values read by the binding) | +|battery |batteryLevel |Number |yes |Battery Level in % | +| |voltage |Number |yes |Voltage of the battery | +| |lowBattery |Switch |yes |Low battery alert (< 20%) | + +### Shelly Flood (thing type: shellyflood) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|sensors |temperature |Number |yes |Temperature, unit is reported by tempUnit | +| |flood |Switch |yes |ON: Flooding condition detected, OFF: no flooding | +| |last_update |String |yes |Timestamp of the last update (values read by the binding) | +|battery |batteryLevel |Number |yes |Battery Level in % | +| |voltage |Number |yes |Voltage of the battery | +| |lowBattery |Switch |yes |Low battery alert (< 20%) | + +### Shelly Sense (thing-type: shellysense) + +|Group |Channel |Type |read-only|Description | +|----------|-------------|---------|---------|-----------------------------------------------------------------------| +|control |key |String |r/w |Send a IR key to the sense. There a 3 different types supported | +| | | | |Stored key: send the key code defined by the App , e.g. 123_1_up | +| | | | |Pronto hex: send a Pronto Code in ex format, e.g. 0000 006C 0022 ... | +| | | | |Pronto base64: in base64 format, will be send 1:1 to the Sense | +| |motionTime |Number |r/w |Define the number of seconds when the Sense should report motion | +| |motionLED |Switch |r/w |Control the motion LED: ON when motion is detected or OFF | +| |charger |Switch |yes |ON: charger connected, OFF: charger not connected. | +|sensors |temperature |Number |yes |Temperature in °C | +| |humidity |Number |yes |Relative humidity in % | +| |lux |Number |yes |Brightness in Lux | +| |motion |Switch |yes |ON: Motion detected, OFF: No motion (check also motionTimer) | +| |last_update |String |yes |Timestamp of the last update (values read by the binding) | +|battery |batteryLevel |Number |yes |Battery Level in % | +| |batteryAlert |Switch |yes |Low battery alert | + +## Full Example + +### shelly.things + +``` +/* Shelly 2.5 Roller */ +Thing shelly:shelly25-roller:XXXXX1 "Shelly 25 Roller XXXXX1" @ "Home Theater" [deviceIp="x.x.x.x", userId="", password=""] +Thing shelly:shelly25-roller:XXXXX2 "Shelly 25 Roller XXXXX2" @ "Living Room" [deviceIp="x.x.x.x", userId="admin", password="secret"] + + +/* Shelly 2.5 Relays */ +Thing shelly:shelly25-relay:XXXXX3 "Shelly 25 Relay XXXXX3" @ "Hall Way" [deviceIp="x.x.x.x", userId="", password=""] +Thing shelly:shelly25-relay:XXXXX4 "Shelly 25 Relay XXXXX4" @ "Dining Room" [deviceIp="x.x.x.x", userId="", password=""] +Thing shelly:shelly25-relay:XXXXX5 "Shelly 25 Relay XXXXX5" @ "Bed Room" [deviceIp="x.x.x.x", userId="", password=""] + +/* Other * +Thing shelly:shellyht:e01691 "ShellyChimenea" @ "lowerground" [ deviceIp="10.0.55.101", userId="", password="", lowBattery=15 , eventsCoIoT=true ] +Thing shelly:shellyht:e01681 "ShellyDormitorio" @ "upperground" [ deviceIp="10.0.55.102", userId="", password="", lowBattery=15 , eventsCoIoT=true ] +Thing shelly:shellyflood:XXXXXX "ShellyFlood" @ "cellar" [ deviceIp="10.0.0.103", userId="", password="", lowBattery=15, eventsSwitch=true, eventsButton=true, eventsCoIoT=true ] + +``` + +### shelly.items + +``` +/* Relays */ +Switch Shelly_XXXXX3_Relay "Garage Light" {channel="shelly:shelly1:XXXXX3:relay#output"} +Switch Shelly_XXXXX3_OverPower "Garage Light Over Power" {channel="shelly:shelly1:XXXXX3:relay#overpower"} +Switch Shelly_XXXXX3_OverTemp "Garage Light Over Temperature" {channel="shelly:shelly1:XXXXX3:relay#overtemperature"} +Number Shelly_XXXXX3_AutoOnTimer "Garage Light Auto On Timer" {channel="shelly:shelly1:XXXXX3:relay#autoOn"} +Number Shelly_XXXXX3_AutoOffTimer "Garage Light Auto Off Timer" {channel="shelly:shelly1:BA2F18:relay#autoOff"} +Switch Shelly_XXXXX3_Relay "Garage Light" {channel="shelly:shelly1:XXXXX3:relay#output"} +Switch Shelly_XXXXX3_Input "Garage Switch (Input)" {channel="shelly:shelly1:XXXXX3:relay#input"} + +/* Sensors */ +Number ShellyHT_Dormitorio_Temp "Dormitorio Temperature" <temperature> {channel="shelly:shellyht:e01681:sensors#temperature"} +Number ShellyHT_Dormitorio_Humid "Dormitorio Humidity" <humidity> {channel="shelly:shellyht:e01681:sensors#humidity"} +Number ShellyHT_Dormitorio_Batt "Dormitorio Battery" <battery> {channel="shelly:shellyht:e01681:battery#batteryLevel"} +Number ShellyHT_Chimenea_Temp "Chimenea Temperature" <temperature> {channel="shelly:shellyht:e01691:sensors#temperature"} +Number ShellyHT_Chimenea_Humid "Chimenea Humidity" <humidity> {channel="shelly:shellyht:e01691:sensors#humidity"} +Number ShellyHT_Chimenea_Batt "Chimenea Battery" <battery> {channel="shelly:shellyht:e01691:battery#batteryLevel"} +Number ShellyF_Sotano_Temp "Sotano Temperature" <temperature> {channel="shelly:shellyflood:764fe0:sensors#temperature"} +Number ShellyF_Sotano_Batt "Sotano Battery" <battery> {channel="shelly:shellyflood:764fe0:battery#batteryLevel"} +Switch ShellyF_Sotano_Flood "Sotano Flood Alarm" <alarm> {channel="shelly:shellyflood:764fe0:sensors#flood"} + +/* Dimmer */ +Switch DimmerSwitch "Light on/off" {channel="shelly:shellydimmer:XXX:relay#brightness"} +Dimmer DimmerBrightness "Garage Light Brightness" {channel="shelly:shellydimmer:XXX:relay#brightness"} +Dimmer DimmerIncDec "Garage Light +/-" {channel="shelly:shellydimmer:XXX:relay#brightness"} + +Number Shelly_Power "Bath Room Light Power" {channel="shelly:shelly1:XXXXXX:meter#currentWatts"} /* Power Meter */ + +``` + +### shelly.rules + +reading colors from color picker: + +``` +import org.openhab.core.library.types.* + +rule "Get input change from garage light" +when + Item Shelly_XXXXX3_Input changed to ON +then + logInfo("Garage", "Light input is ON") + BackDoorLight.sendCommand(ON) +end + +rule "Momentary Switch events" +when + Channel "shelly:shellydevice:XXXXXX:relay1#button" triggered SHORT_PRESSED +then + logInfo("Relay", "A short push was detected") +end + + +rule "Shelly alarms" +when + Channel "shelly:shellydevice:XXXXXX:device#alarm" triggered or + Channel "shelly:shelly25-roller:XXXXXX:device#alarm" triggered +then + if (receivedEvent !== null) { // A (channel) event triggered the rule + eventSource = receivedEvent.getChannel().asString + eventType = receivedEvent.getEvent() + ... + } +end + +rule "Color changed" +when + Item ShellyColor changed +then + var HSBType hsbValue = ShellyColor.state as HSBType + var int redValue = hsbValue.red.intValue + var int greenValue = hsbValue.green.intValue + var int blueValue = hsbValue.blue.intValue +end + +``` + +### shelly.sitemap + +``` +sitemap demo label="Home" +{ + Frame label="Dimmer" { + Switch item=DimmerSwitch + Slider item=DimmerBrightness + SetPoint item=DimmerIncDec + + Number item=ShellyHT_Dormitorio_Temp + Number item=ShellyHT_Chimenea_Humid + Number item=ShellyF_Sotano_Batt + Number item=Shelly_Power + } +} + +``` diff --git a/bundles/org.openhab.binding.shelly/doc/DEVNOTES - API JSON Samples.md b/bundles/org.openhab.binding.shelly/doc/DEVNOTES - API JSON Samples.md new file mode 100644 index 0000000000000..eec7d0298ca96 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/doc/DEVNOTES - API JSON Samples.md @@ -0,0 +1,1722 @@ +# Shelly Binding (org.openhab.binding.shelly) + +This openHAB 2 Binding implements control for the Shelly series of devices. +This includes sending commands to the devices as well as reading the device status and sensor data. + +Author: Markus Michels (markus7017) +Check https://community.openhab.org/t/shelly-binding/ for more information, questions and contributing ideas. Any comments are welcome! + +Also check section **Additional Information** at the end of the document. +This includes some general comments, information how to debug and request new features. + +--- + +### Alpha/Beta versions + +The binding is work in progress. You have to expect bugs etc. and each version might be incompatible to the existing thing definition, which means no backware compatibility. + +Channel definitions are subject to change with any alpha or beta release. Please make sure to **delete all Shelly things before updating*** the binding and clean out the JSON DB: + +- **remove all shelly entries from paperui** +- stop oh2 service +- openhab-cli clear-cache +- copy jar into addons (set correct permission) +- start oh2 service +- **re-discover things** +- the channel/item linkage should be restored automatically + +If you hit a problem make sure to post a TRACE log (or send PM) so I could look into the details. + +### Instalation + +As described above the binding will be installed by copying the jar into the addons folder of your OH installation. +Once a stable state is reached the binding may become part of the openHAB 2.5 distribution, but this will take some time. +The binding was developed an tested on OH version 2.4 and 2.5. +Please post an info if you also verified compatibility to version 2.3. +However, this release is not officially supported. + +# Additional Notes + +## General + +* You should use firmware version 1.5.2 or never. +It might be that the binding is working with older versions, but this was never tested. +List of Firmware Versions for the different devices could be found here: https://api.shelly.cloud/files/firmware + + +* If you gave multiple network interfaces you should check openHAB's default setting. + +Open PaperUI and go to Configuration:System-:Network Settings and verify the selected interface. +If the Shelly devices are not on the same network you could try to add them manually. +However, devices in different networks have not been tested yet (please post a comment in the community thread if you are successful). + +## Reporting a problem/bug + +If you encounter a problem you could put the device into DEBUG or TRACE mode + +- open OH console (execute "openhab-cli console") +- set the debug level ("log:set DEBUG org.openhab.binding.shelly") +- issue command or wait until problem occurs +- post an extract of openhab.log to the community thread (or send the author a PM - make sure the log extract has enough information, some more lines are fine) + +## Feature Request + +Any comment or feature request is welcome. Post the idea to the community thread, all of us will benefit. + +## Other devices + +The thing definition of the following devices is primarily. +If you have one of those devices send a PM to marks7017 and we could work on the implementation/testing. + +- thing-type: shellysmoke +- thing-type: shellysense +- thing-type: shellyplug + +## Supporting new devices + +You could help to integrate and support new devices. In general the following information is a good start + +- open a browser and issue the following urls +- http://<device ip>/settings +- http://<device ip>/status + +once basic discovery is implemented the Coap Discription could be discovered + +- enable CoIoT events within the thing configuration +- open the thing properties ([Show Properties]) +- and copy&paste the coapDescr property + +post this information in the community thread or send a PM to the author. +Depending on the device type and complexity of the integration you should be prepared to run test cycles with snapshort binds of the binding incl. back and forth communication with the author. + +# REST API JSON Sample Data + +## Shelly1 + +### Shelly1: /status/relay/0 + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.1","rssi":-70}, + "cloud":{"enabled":false, "connected":false}, + "mqtt":{"connected":true}, + "time":"15:36","serial":1,"has_update":false,"mac":"XXXXXXXXXXXX", + "relays" :[ + {"ison":false,"has_timer":false} + ], + "meters":[ + {"power":0.00,"is_valid":"true"} + ], + "update":{"status":"idle","has_update":false,"new_version":"20190711-084053/v1.5.0-hotfix4@3b4f7414","old_version":"20190711-084053/v1.5.0-hotfix4@3b4f7414"}, + "ram_total":51104,"ram_free":40356,"fs_size":233681,"fs_free":175951,"uptime":3455 +} +``` + +### COAP Device Description Shelly1 + +``` +{ + "blk":[ + {"I":0,"D":"Relay0"} + ], + "sen":[ + {"I":112,"T":"Switch","R":"0/1","L":0} + ], + "act":[ + {"I":211,"D":"Switch","L":0,"P":[ + {"I":2011,"D":"ToState","R":"0/1"} + ] + } + ] +} +``` + + +## Shelly 1PM + +### Shelly 1PM - /settings + +``` +{ + "device": { + "type": "SHSW-PM", + "mac": "XXXXXXXX", + "hostname": "shelly1pm-XXXXXX", + "num_outputs": 1, + "num_meters": 1 + }, + "wifi_ap": { + "enabled": false, + "ssid": "shelly1pm-XXXXXX", + "key": "" + }, + "wifi_sta": { + "enabled": true, + "ssid": "iot-wlan", + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "wifi_sta1": { + "enabled": false, + "ssid": null, + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "mqtt": { + "enable": false, + "server": "10.0.0.2:1883", + "user": "", + "id": "shelly1pm-XXXXXX", + "reconnect_timeout_max": 60.0, + "reconnect_timeout_min": 2.0, + "clean_session": true, + "keep_alive": 60, + "max_qos": 0, + "retain": false, + "update_period": 30 + }, + "sntp": { + "server": "time.google.com" + }, + "login": { + "enabled": false, + "unprotected": false, + "username": "admin", + "password": "admin" + }, + "pin_code": "RPSR$p", + "name": "", + "fw": "20191127-095910/v1.5.6@0d769d69", + "build_info": { + "build_id": "20191127-095910/v1.5.6@0d769d69", + "build_timestamp": "2019-11-27T09:59:10Z", + "build_version": "1.0" + }, + "cloud": { + "enabled": true, + "connected": true + }, + "timezone": "Europe/Berlin", + "lat": 50.252491, + "lng": 5.779092, + "tzautodetect": false, + "time": "12:41", + "hwinfo": { + "hw_revision": "prod-190329", + "batch_id": 1 + }, + "max_power": 3500, + "mode": "relay", + "relays": [ + { + "name": null, + "ison": false, + "has_timer": false, + "default_state": "off", + "btn_type": "edge", + "btn_reverse": 0, + "auto_on": 0.0, + "auto_off": 0.0, + "btn_on_url": null, + "btn_off_url": null, + "out_on_url": "http://10.0.0.20:8080/shelly/event/shelly1pm-e5bed0/relay/0?type=out_on", + "out_off_url": "http://10.0.0.2:8080/shelly/event/shelly1pm-e5bed0/relay/0?type=out_off", + "longpush_url": null, + "shortpush_url": null, + "schedule": false, + "schedule_rules": [], + "max_power": 3500 + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117676, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 2262 + } + ] +} +``` + +### Shelly 1PM /status + +``` +{ + "wifi_sta": { + "connected": true, + "ssid": "iot-wlan", + "ip": "10.0.0.2", + "rssi": -49 + }, + "cloud": { + "enabled": true, + "connected": true + }, + "mqtt": { + "connected": false + }, + "time": "12:41", + "serial": 23, + "has_update": false, + "mac": "XXXXXXXXXXXX", + "relays": [ + { + "ison": false, + "has_timer": false, + "overpower": false + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117691, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 2262 + } + ], + "inputs": [ + { + "input": 0 + } + ], + "ext_temperature": {}, + "temperature": 45.51, + "overtemperature": false, + "tmp": { + "tC": 45.51, + "tF": 113.93, + "is_valid": "true" + }, + "update": { + "status": "idle", + "has_update": false, + "new_version": "20191127-095910/v1.5.6@0d769d69", + "old_version": "20191127-095910/v1.5.6@0d769d69" + }, + "ram_total": 50704, + "ram_free": 35428, + "fs_size": 233681, + "fs_free": 172437, + "uptime": 237010 +} +``` + +## Shelly2 + +### /settings + +``` +{ + "device" : { + "type":"SHSW-21","mac":"XXXXXXXXXXXX","hostname":"shellyswitch-XXXXXX", + "num_outputs":2,"num_meters":1,"num_rollers":1 + }, + "wifi_ap":{"enabled":false,"ssid":"shellyswitch-XXXXXX","key":"}, + "wifi_sta":{"enabled":true,"ssid":"iot-wlan","ipv4_method":"static","ip":"10.0.0.10","gw":"10.0.0.1","mask":"255.0.0.0","dns":"10.0.0.1"}, + "wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":true,"server":"10.0.0.7:1883","user":"admin","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000, + "clean_session":true,"keep_alive":60,"will_topic":"shellies/shellyswitch-XXXXXX/online","will_message":"false", max_qos":0,"retain":true,"update_period":30}, + "sntp": {"server":"time.google.com"}, + "login":{"enabled":true,"unprotected":false,"username":"xxx","password":"xxx"},"pin_code":"", + "coiot_execute_enable":true,"name":"", + "fw":"20190531-075812/v1.5.0-hotfix2@022ec015","build_info":{"build_id":"20190531-075812/v1.5.0-hotfix2@022ec015","build_timestamp":"2019-05-31T07:58:12Z","build_version":"1.0"}, + "cloud":{"enabled":false,"connected":false}, + "timezone":"Europe/Berlin","lat":45.864700,"lng":7.625460,"tzautodetect":true,"time":"23:02", + "hwinfo":{"hw_revision":"prod-2018-10c", "batch_id":5}, + "mode":"relay","max_power":1840, + "relays":[ + { + "name":null,"ison":false,"has_timer":false,"overpower":falsem "default_state":"last","btn_type":"edge", "btn_reverse":0, + "auto_on":0.00,"auto_off":0.00,"btn_on_url":null,"btn_off_url":null,"out_on_url":null,"out_off_url":null,"schedule":false, + "schedule_rules":[] + }, + { + "name":null,"ison":false,"has_timer":false,"overpower":false,"default_state":"off","btn_type":"edge","btn_reverse":0, + "auto_on":0.00,"auto_off":0.00, + "btn_on_url":null,"btn_off_url":null,"out_on_url":null,"out_off_url":null, + "schedule":false,"schedule_rules":[]} + ], + "rollers":[ + { + "maxtime":20.00,"maxtime_open":20.00,"maxtime_close":20.00,"default_state":"stop","swap":false,"swap_inputs":false,"input_mode":"openclose", + "button_type":"toggle","btn_reverse":0, + "state":"stop", + "power":0.00, + "is_valid":true,"safety_switch":false, + "schedule":false,"schedule_rules":[], + "obstacle_mode":"disabled","obstacle_action":"stop","obstacle_power":200,"obstacle_delay":1,"safety_mode":"while_opening","safety_action":"stop", + "safety_allowed_on_trigger":"none","off_power":2, + "positioning":true + } + ], + "meters":[ + {"power":0.00,"is_valid":true,"timestamp":1562713329,"counters":[0.000, 0.000, 0.000],"total":19111} + ] + } +``` + +### Shelly 2 /settings/relay/0 + +``` +{ + "name":null, "ison":false,"has_timer":false, + "overpower":false,"default_state":"last", + "btn_type":"edge","btn_reverse":0, + "auto_on":0.00,"auto_off":0.00, + "btn_on_url":null, + "btn_off_url":null, + "out_on_url":null, + "out_off_url":null, + "schedule":false, + "schedule_rules":[] +} +``` + +### Shelly 2: /status/relay/0 + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.1","rssi":-70}, + "cloud":{"enabled":false, "connected":false}, + "mqtt":{"connected":true}, + "time":"15:36","serial":1,"has_update":false,"mac":"XXXXXXXXXXXX","serial":1, + "has_update":true,"mac":"XXXXXXXXXXXX", + "relays":[ + {"ison":false,"has_timer":false,"overpower":false,"is_valid":true}, + {"ison":false,"has_timer":false,"overpower":false,"is_valid":true} + ], + "rollers":[ + {"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"stop_reason":"normal","last_direction":"open","current_pos":101,"calibrating":false,"positioning":true} + ], + "meters":[ + {"power":0.00,"is_valid":true,"timestamp":1563292829,"counters":[0.000, 0.000, 0.000],"total":35473} + ], + "update":{"status":"pending","has_update":true,"new_version":"20190711-084105/v1.5.0-hotfix4@3b4f7414","old_version":"20190531-075812/v1.5.0-hotfix2@022ec015"}, + "ram_total":50264,"ram_free":37548, + "fs_size":233681, + "fs_free":155620, + "uptime":1352018 +} +``` + + +### Shelly2: /status/device + +``` +{ + "enabled":true, "ssid":"iot-wlan", "ipv4_method":"static","ip":"10.0.0.10","gw":"10.0.0.1","mask":"255.0.0.0","dns":"10.0.0.1" + +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.1","rssi":-69}, + "cloud":{"enabled":false,"connected":false}, + "mqtt":{"connected":true}, + "time":"00:17","serial":1,"has_update":false,"mac":"XXXXXXXXXXXX", + "relays":[ + { + "ison":false, + "has_timer":false, + "overpower":false, + "is_valid":true + }, + { + "ison":false, + "has_timer":false, + "overpower":false, + "is_valid":true + } + ], + "rollers":[ + { + "state":"stop", + "power":0.00, + "is_valid":true, + "safety_switch":false, + "stop_reason":"normal", + "last_direction":"stop", + "current_pos":101, + "calibrating":false, + "positioning":true + } + ], + "meters":[ + { + "power":0.00, + "is_valid":true, + "timestamp":1562717876, + "counters":[0.000, 0.000, 0.000], + "total":19111 + } + ], + "update":{ + "status":"idle", + "has_update":false, + "new_version":"20190531-075812/v1.5.0-hotfix2@022ec015", + "old_version":"20190531-075812/v1.5.0-hotfix2@022ec015" + }, + "ram_total":50264,"ram_free":37884,"fs_size":233681,"fs_free":156373,"uptime":777069 +} +``` + +## Shelly 2.5 + +### Shelly 2.5-Relay: /settings + +``` +{ + "device": { + "type": "SHSW-25", + "mac": "XXXXXXXXXXXX", + "hostname": "shellyswitch25-XXXXXX", + "num_outputs": 2, + "num_meters": 2, + "num_rollers": 1 + }, + "wifi_ap": { + "enabled": false, + "ssid": "shellyswitch25-XXXXXX", + "key": "" + }, + "wifi_sta": { + "enabled": true, + "ssid": "iot-wlan", + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "wifi_sta1": { + "enabled": false, + "ssid": null, + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "mqtt": { + "enable": false, + "server": "10.0.0.2:1883", + "user": "", + "id": "shellyswitch25-XXXXXX", + "reconnect_timeout_max": 60.0, + "reconnect_timeout_min": 2.0, + "clean_session": true, + "keep_alive": 60, + "max_qos": 0, + "retain": false, + "update_period": 30 + }, + "sntp": { + "server": "time.google.com" + }, + "login": { + "enabled": false, + "unprotected": false, + "username": "admin", + "password": "admin" + }, + "pin_code": "Y}e!BK", + "name": "", + "fw": "20191127-095444/v1.5.6@0d769d69", + "build_info": { + "build_id": "20191127-095444/v1.5.6@0d769d69", + "build_timestamp": "2019-11-27T09:54:44Z", + "build_version": "1.0" + }, + "cloud": { + "enabled": true, + "connected": true + }, + "timezone": "Europe/Berlin", + "lat": 50.252491, + "lng": 5.779092, + "tzautodetect": false, + "time": "12:42", + "hwinfo": { + "hw_revision": "prod-2019-03", + "batch_id": 1 + }, + "mode": "relay", + "max_power": 1840, + "relays": [ + { + "name": null, + "ison": false, + "has_timer": false, + "overpower": false, + "default_state": "off", + "btn_type": "edge", + "btn_reverse": 0, + "auto_on": 0.0, + "auto_off": 0.0, + "max_power": 0, + "btn_on_url": null, + "btn_off_url": null, + "out_on_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-0043e0/relay/0?type=out_on", + "out_off_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-0043e0/relay/0?type=out_off", + "longpush_url": null, + "shortpush_url": null, + "schedule": false, + "schedule_rules": [] + }, + { + "name": null, + "ison": false, + "has_timer": false, + "overpower": false, + "default_state": "off", + "btn_type": "edge", + "btn_reverse": 0, + "auto_on": 0.0, + "auto_off": 0.0, + "max_power": 0, + "btn_on_url": null, + "btn_off_url": null, + "out_on_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-0043e0/relay/1?type=out_on", + "out_off_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-0043e0/relay/1?type=out_off", + "longpush_url": null, + "shortpush_url": null, + "schedule": false, + "schedule_rules": [] + } + ], + "rollers": [ + { + "maxtime": 20.0, + "maxtime_open": 20.0, + "maxtime_close": 20.0, + "default_state": "stop", + "swap": false, + "swap_inputs": false, + "input_mode": "openclose", + "button_type": "toggle", + "btn_reverse": 0, + "state": "stop", + "power": 0.0, + "is_valid": true, + "safety_switch": false, + "roller_open_url": null, + "roller_close_url": null, + "roller_stop_url": null, + "schedule": false, + "schedule_rules": [], + "obstacle_mode": "disabled", + "obstacle_action": "stop", + "obstacle_power": 200, + "obstacle_delay": 1, + "safety_mode": "while_opening", + "safety_action": "stop", + "safety_allowed_on_trigger": "none", + "off_power": 2, + "positioning": true + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117725, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 47 + }, + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117725, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 10215 + } + ] +} +``` + +### Shelly 2.5 Relay Mode: /status + +``` +{ + "wifi_sta": { + "connected": true, + "ssid": "iot_wlan", + "ip": "10.0.0.2", + "rssi": -48 + }, + "cloud": { + "enabled": true, + "connected": true + }, + "mqtt": { + "connected": false + }, + "time": "12:42", + "serial": 83, + "has_update": false, + "mac": "XXXXXXXXXXXX", + "relays": [ + { + "ison": false, + "has_timer": false, + "overpower": false, + "overtemperature": false, + "is_valid": true + }, + { + "ison": false, + "has_timer": false, + "overpower": false, + "overtemperature": false, + "is_valid": true + } + ], + "rollers": [ + { + "state": "stop", + "power": 0.0, + "is_valid": true, + "safety_switch": false, + "overtemperature": false, + "stop_reason": "normal", + "last_direction": "stop", + "current_pos": 101, + "calibrating": false, + "positioning": true + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117739, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 47 + }, + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117739, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 10215 + } + ], + "inputs": [ + { + "input": 0 + }, + { + "input": 0 + } + ], + "temperature": 61.76, + "overtemperature": false, + "tmp": { + "tC": 61.76, + "tF": 143.16, + "is_valid": "true" + }, + "update": { + "status": "idle", + "has_update": false, + "new_version": "20191127-095444/v1.5.6@0d769d69", + "old_version": "20191127-095444/v1.5.6@0d769d69" + }, + "ram_total": 49568, + "ram_free": 34720, + "fs_size": 233681, + "fs_free": 156624, + "voltage": 237.72, + "uptime": 237037 +} +``` + +### Shelly 2.5 Generic Coap Status + +``` +{ + "G":[ + [0,112,0], + [0,122,0], + [0,111,0.000000] + ] +} +``` + +### Shelly 2.5 Coap Description + + +``` +{"blk":[ + {"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"}, + {"I":2,"D":"Device"}],"sen":[ + {"I":112,"T":"S","D":"State","R":"0/1","L":0}, + {"I":122,"T":"S","D":"State","R":"0/1","L":1}, + {"I":111,"T":"W","D":"Power","R":"0/2300","L":0}, + {"I":121,"T":"W","D":"Power","R":"0/2300","L":1}, + {"I":113,"T":"S","D":"Position","R":"0/100","L":2} + ], + "act":[ + {"I":211,"D":"Switch","L":0,"P":[{"I":2011,"D":"ToState","R":"0/1"}]}, + {"I":221,"D":"Switch","L":1,"P":[{"I":2021,"D":"ToState","R":"0/1"}]} + ] +} +``` + + +``` +{ + "blk":[ + {"I":0,"D":"Relay0"}, + {"I":1,"D":"Relay1"}, + {"I":2,"D":"Device"} + ], + "sen":[ + {"I":112,"T":"S","D":"State","R":"0/1","L":0}, + {"I":122,"T":"S","D":"State","R":"0/1","L":1}, + {"I":111,"T":"W","D":"Power","R":"0/3680","L":2}, + {"I":113,"T":"S","D":"Position","R":"0/100","L":2} + ], + "act":[ + {"I":211,"D":"Switch","L":0,"P":[ + {"I":2011,"D":"ToState","R":"0/1"} + ] + }, + {"I":221,"D":"Switch","L":1,"P":[ + {"I":2021,"D":"ToState","R":"0/1"} + ] + }] +} +``` + +### SHelly 2.5 Roller Mode: /settings + +``` +{ + "device": { + "type": "SHSW-25", + "mac": "XXXXXXXXXXXX", + "hostname": "shellyswitch25-XXXXXX", + "num_outputs": 2, + "num_meters": 2, + "num_rollers": 1 + }, + "wifi_ap": { + "enabled": false, + "ssid": "shellyswitch25-XXXXXX", + "key": "" + }, + "wifi_sta": { + "enabled": true, + "ssid": "iot-wlan", + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "wifi_sta1": { + "enabled": false, + "ssid": null, + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "mqtt": { + "enable": false, + "server": "10.0.0.2:1883", + "user": "", + "id": "shellyswitch25-XXXXXX", + "reconnect_timeout_max": 60.0, + "reconnect_timeout_min": 2.0, + "clean_session": true, + "keep_alive": 60, + "max_qos": 0, + "retain": false, + "update_period": 30 + }, + "sntp": { + "server": "time.google.com" + }, + "login": { + "enabled": false, + "unprotected": false, + "username": "admin", + "password": "admin" + }, + "pin_code": "!pw5e5", + "name": "", + "fw": "20191127-095444/v1.5.6@0d769d69", + "build_info": { + "build_id": "20191127-095444/v1.5.6@0d769d69", + "build_timestamp": "2019-11-27T09:54:44Z", + "build_version": "1.0" + }, + "cloud": { + "enabled": true, + "connected": true + }, + "timezone": "Europe/Berlin", + "lat": 50.252491, + "lng": 5.779092, + "tzautodetect": false, + "time": "12:42", + "hwinfo": { + "hw_revision": "prod-2019-03", + "batch_id": 1 + }, + "mode": "roller", + "max_power": 1840, + "relays": [ + { + "name": null, + "ison": false, + "has_timer": false, + "overpower": false, + "default_state": "off", + "btn_type": "toggle", + "btn_reverse": 0, + "auto_on": 0.0, + "auto_off": 0.0, + "max_power": 0, + "btn_on_url": null, + "btn_off_url": null, + "out_on_url": null, + "out_off_url": null, + "longpush_url": null, + "shortpush_url": null, + "schedule": false, + "schedule_rules": [] + }, + { + "name": null, + "ison": false, + "has_timer": false, + "overpower": false, + "default_state": "off", + "btn_type": "toggle", + "btn_reverse": 0, + "auto_on": 0.0, + "auto_off": 0.0, + "max_power": 0, + "btn_on_url": null, + "btn_off_url": null, + "out_on_url": null, + "out_off_url": null, + "longpush_url": null, + "shortpush_url": null, + "schedule": false, + "schedule_rules": [] + } + ], + "rollers": [ + { + "maxtime": 20.0, + "maxtime_open": 23.0, + "maxtime_close": 22.0, + "default_state": "stop", + "swap": false, + "swap_inputs": false, + "input_mode": "openclose", + "button_type": "momentary", + "btn_reverse": 0, + "state": "stop", + "power": 0.0, + "is_valid": true, + "safety_switch": false, + "roller_open_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-XXXXXX/roller/0?type=roller_open", + "roller_close_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-XXXXXX/roller/0?type=roller_close", + "roller_stop_url": "http://10.0.0.2:8080/shelly/event/shellyswitch25-XXXXXX/roller/0?type=roller_stop", + "schedule": false, + "schedule_rules": [ + "0700-0123456-10%", + "0000bss-0123456-open" + ], + "obstacle_mode": "disabled", + "obstacle_action": "stop", + "obstacle_power": 200, + "obstacle_delay": 1, + "safety_mode": "while_opening", + "safety_action": "stop", + "safety_allowed_on_trigger": "none", + "off_power": 2, + "positioning": true + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117752, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 44 + }, + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117752, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 44 + } + ] +} +``` + +### Shelly 2.5 Roller Mode: /status + +``` +{ + "wifi_sta": { + "connected": true, + "ssid": "iot_wlan", + "ip": "10.0.0.1", + "rssi": -54 + }, + "cloud": { + "enabled": true, + "connected": true + }, + "mqtt": { + "connected": false + }, + "time": "12:42", + "serial": 16, + "has_update": false, + "mac": "XXXXXXXXXXXX", + "relays": [ + { + "ison": false, + "has_timer": false, + "overpower": false, + "overtemperature": false, + "is_valid": true + }, + { + "ison": false, + "has_timer": false, + "overpower": false, + "overtemperature": false, + "is_valid": true + } + ], + "rollers": [ + { + "state": "stop", + "power": 0.0, + "is_valid": true, + "safety_switch": false, + "overtemperature": false, + "stop_reason": "normal", + "last_direction": "open", + "current_pos": 100, + "calibrating": false, + "positioning": true + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117766, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 44 + }, + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117766, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 44 + } + ], + "inputs": [ + { + "input": 0 + }, + { + "input": 0 + } + ], + "temperature": 63.62, + "overtemperature": false, + "tmp": { + "tC": 63.62, + "tF": 146.52, + "is_valid": "true" + }, + "update": { + "status": "idle", + "has_update": false, + "new_version": "20191127-095444/v1.5.6@0d769d69", + "old_version": "20191127-095444/v1.5.6@0d769d69" + }, + "ram_total": 49568, + "ram_free": 34712, + "fs_size": 233681, + "fs_free": 156122, + "voltage": 231.83, + "uptime": 237263 +} +``` + + + +## Shelly Plug-S + +###Shelly Plug-S: /settings + +``` +{ + "device": { + "type": "SHPLG-S", + "mac": "XXXXXXXXXXXX", + "hostname": "shellyplug-s-XXXX", + "num_outputs": 1, + "num_meters": 1 + }, + "wifi_ap": { + "enabled": false, + "ssid": "shellyplug-s-XXXX", + "key": "" + }, + "wifi_sta": { + "enabled": true, + "ssid": "iot-wlan", + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "wifi_sta1": { + "enabled": false, + "ssid": null, + "ipv4_method": "dhcp", + "ip": null, + "gw": null, + "mask": null, + "dns": null + }, + "mqtt": { + "enable": false, + "server": "10.0.0.2:1883", + "user": "", + "id": "shellyplug-s-XXXXXX", + "reconnect_timeout_max": 60.0, + "reconnect_timeout_min": 2.0, + "clean_session": true, + "keep_alive": 60, + "max_qos": 0, + "retain": false, + "update_period": 30 + }, + "sntp": { + "server": "time.google.com" + }, + "login": { + "enabled": false, + "unprotected": false, + "username": "admin", + "password": "admin" + }, + "pin_code": "adIL-{", + "name": "", + "fw": "20191127-095857/v1.5.6@0d769d69", + "build_info": { + "build_id": "20191127-095857/v1.5.6@0d769d69", + "build_timestamp": "2019-11-27T09:58:57Z", + "build_version": "1.0" + }, + "cloud": { + "enabled": true, + "connected": true + }, + "timezone": "Europe/Berlin", + "lat": 50.252491, + "lng": 5.779092, + "tzautodetect": false, + "time": "12:43", + "hwinfo": { + "hw_revision": "prod-190516", + "batch_id": 1 + }, + "max_power": 2500, + "led_status_disable": true, + "led_power_disable": false, + "relays": [ + { + "ison": false, + "has_timer": false, + "overpower": false, + "default_state": "off", + "auto_on": 0.0, + "auto_off": 0.0, + "btn_on_url": null, + "out_on_url": "http://10.0.0.1:8080/shelly/event/shellyplug-s-041b29/relay/0?type=out_on", + "out_off_url": "http://10.0.0.1:8080/shelly/event/shellyplug-s-041b29/relay/0?type=out_off", + "schedule": true, + "schedule_rules": [ + "0700-0123456-off" + ], + "max_power": 2500 + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117787, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 0 + } + ] +}``` + +### Shelly Plug-S: /status + +{ + "wifi_sta": { + "connected": true, + "ssid": "iot_wlan", + "ip": "10.0.0.2", + "rssi": -52 + }, + "cloud": { + "enabled": true, + "connected": true + }, + "mqtt": { + "connected": false + }, + "time": "12:43", + "serial": 1, + "has_update": false, + "mac": "XXXXXXXXXXXX", + "relays": [ + { + "ison": false, + "has_timer": false, + "overpower": false + } + ], + "meters": [ + { + "power": 0.0, + "is_valid": true, + "timestamp": 1575117798, + "counters": [ + 0.0, + 0.0, + 0.0 + ], + "total": 0 + } + ], + "temperature": 30.71, + "overtemperature": false, + "tmp": { + "tC": 30.71, + "tF": 87.28, + "is_valid": "true" + }, + "update": { + "status": "idle", + "has_update": false, + "new_version": "20191127-095857/v1.5.6@0d769d69", + "old_version": "20191127-095857/v1.5.6@0d769d69" + }, + "ram_total": 50784, + "ram_free": 37312, + "fs_size": 233681, + "fs_free": 173441, + "uptime": 237171 +} +``` + +### ### Shelly Plug-S Coap Description + +``` +{ + “blkâ€:[ + {“Iâ€:0,“Dâ€:“Relay0â€} + ], + “senâ€:[ + {“Iâ€:111,“Tâ€:“Wâ€,“Râ€:“0/2500â€,“Lâ€:0}, + {“Iâ€:112,“Tâ€:“Switchâ€,“Râ€:“0/1â€,“Lâ€:0}, + {“Iâ€:113,“Tâ€:“tCâ€,“Râ€:"-40/300",“Lâ€:0}, + {“Iâ€:114,“Tâ€:“tFâ€,“Râ€:"-40/300",“Lâ€:0}, + {“Iâ€:115,“Tâ€:“Overtempâ€,“Râ€:“0/1â€,“Lâ€:0} + ], + “actâ€:[{“Iâ€:211,“Dâ€:“Switchâ€,“Lâ€:0,“Pâ€:[{“Iâ€:2011,“Dâ€:“ToStateâ€,“Râ€:“0/1â€}]}] + } + + ``` + +## Shelly EM + +### Shelly EM /settings + +``` +{ + "device":{ + "type":"SHEM","mac":"XXXXXXXXXXXX","hostname":"shellyem-XXXXXX", + "num_outputs":1, "num_meters": 0, "num_emeters":2 + }, + "wifi_ap":{"enabled":false,"ssid":"shellyem-XXXXXX","key":""},"wifi_sta":{"enabled":true,"ssid":"iot_wlan","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":false,"server":"10.0.0.1:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"shellies/shellyem-XXXXXX/online","will_message":"false","max_qos":0,"retain":false,"update_period":30}, + "sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"BZ1Xg+", + "coiot_execute_enable":false,"name":"","fw":"20190821-095337/v1.5.2@4148d2b7","build_info":{"build_id":"20190821-095337/v1.5.2@4148d2b7","build_timestamp":"2019-08-21T09:53:37Z","build_version":"1.0"}, + "cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":45.775398,"lng":9.181760,"tzautodetect":true,"time":"22:50","hwinfo":{"hw_revision":"prod-2019-06", "batch_id":0},"max_power":0, + "relays":[{"name":null,"ison":true,"has_timer":false,"overpower":false,"default_state":"last","auto_on":0.00,"auto_off":0.00,"max_power":0, + "out_on_url":"http://10.0.10.254:8080/shelly/event/shellyem-b9f355/relay/0?type=out_on", + "out_off_url":"http://10.0.10.254:8080/shelly/event/shellyem-b9f355/relay/0?type=out_off","schedule":false, + "schedule_rules":[]}], + "emeters":[{"ctraf_type":120},{"ctraf_type":120}] +} +``` + +### Shelly EM /status + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"172.16.12.26","rssi":-54},"cloud":{"enabled":true,"connected":true}, + "mqtt":{"connected":false},"time":"22:56","serial":13416, + "has_update":false,"mac":"XXXXXXXXXXXX", + "relays":[{"ison":true,"has_timer":false,"overpower":false,"is_valid":true}], + "emeters":[ + {"power":98.55,"reactive":-159.32,"voltage":239.38,"is_valid":true,"total":9188.8,"total_returned":16477.0}, + {"power":0.00,"reactive":0.00,"voltage":239.38,"is_valid":true,"total":0.0,"total_returned":0.0} + ], + "update":{"status":"idle","has_update":false,"new_version":"20190821-095337/v1.5.2@4148d2b7","old_version":"20190821-095337/v1.5.2@4148d2b7"}, + "ram_total":49960,"ram_free":33784,"fs_size":233681,"fs_free":169425,"uptime":174189 +} +``` + +### Shelly Dimmer /settings + +``` +{ + "device":{ + "type":"SHDM-1","mac":"XXXXXXXXXXXX","hostname":"shellydimmer-XXXXXX", + "num_outputs":1,"num_meters":1}, + "wifi_ap":{"enabled":false,"ssid":"shellydimmer-XXXXXX","key":""}, + "wifi_sta":{"enabled":true,"ssid":"iot-wlan","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":false,"server":"10.0.0.1:1883","user":"","id":"shellydimmer-4200A0","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"shellies/shellydimmer-4200A0/online","will_message":"false","max_qos":0,"retain":false,"update_period":30}, + "sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"XXXXXX","password":"XXXXXX"},"pin_code":"lFTBFP","coiot_execute_enable":false,"name":"", + "fw":"20191018-133016/master@a8aed1ac","build_info":{"build_id":"20191018-133016/master@a8aed1ac","build_timestamp":"2019-10-18T13:30:16Z","build_version":"1.0"}, + "cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":45.252491,"lng":7.779092,"tzautodetect":false,"time":"06:57", + "hwinfo":{"hw_revision":"dev-prototype","batch_id":0},"mode":"white","pulse_mode":2, + "calibrated":false,"transition":2000,"fade_rate":1, + "lights":[ + { + "name":"","ison":false,"default_state":"off","auto_on":0.00,"auto_off":0.00, + "btn1_on_url":"","btn1_off_url":"","btn2_on_url":"","btn2_off_url":"","out_on_url":"","out_off_url":"", + "schedule":false,"schedule_rules":[], + "btn_type":"edge","swap_inputs":0 + } + ], + "night_mode":{"enabled":0, "start_time":"21:00", "end_time":"00:00", "brightness":10} +} +``` + + +### Shelly Dimmer /status + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.195","rssi":-75}, + "cloud":{"enabled":true,"connected":true}, + "mqtt":{"connected":false}, + "time":"13:35","serial":9496,"has_update":false,"mac":"XXXXXXXXXXXX", + "lights":[ + {"ison":true,"mode":"white","brightness":100} + ], + "meters":[{"power":22.83, "is_valid":true, "timestamp":1568986518,"counters":[8.305, 3.153, 8.892],"total":782}], + "inputs":[ + {"input":0}, + {"input":0} + ], + "tmp":{"tC":56.73,"tF":134.11, "is_valid":"true"}, + "overtemperature":false, + "loaderror":false, + "overload":false + "update":{"status":"unknown","has_update":false,"new_version":"","old_version":"20190913-140549/master@d040e20e"}, + "ram_total":49888,"ram_free":38540,"fs_size":233681,"fs_free":149596,"uptime":561474 +} +``` + + +## Shelly Bulb + +Firmware Version 1.5.2 + +### Shelly Bulb /settings + +``` +{ + "device":{"type":"SHBLB-1","mac":"XXXXXXXXXXXX","hostname":"shellybulb-XXXXXX","num_outputs":1}, + "wifi_ap":{"enabled":false,"ssid":"shellybulb-XXXXXX","key":""}, + "wifi_sta":{"enabled":true,"ssid":iot-wlan","ipv4_method":"static","ip":"10.0.0.10,"gw":"10.0.0.1","mask":"255.0.0.0","dns":"10.0.0.1"}, + "wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":false,"server":"10.0.0.10:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive";60,"will_topic":"shellies/shellybulb-XXXXXX/online","will_message":"false","max_qos":0,"retain":false,"update_period":30}, + "sntp": {"server":"time.google.com"}, + "login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"}, + "pin_code":"aXJ9eE","coiot_execute_enable":true,"name":"", + "fw":"20190821-094813/v1.5.2@4148d2b7","build_info":{"build_id":"20190821-094813/v1.5.2@4148d2b7","build_timestamp":"2019-08-21T09:48:13Z","build_version":"1.0"}, + "cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":51.394344,"lng":8.571319,"tzautodetect":false,"time":"10:40", + "hwinfo": {"hw_revision":"prod-1.3","batch_id":1}, + "mode":"color", + "lights":[ + {"ison":true,"red":255,"green":182,"blue":27,"white":0,"gain":100,"temp":3648,"brightness":86,"effect":0,"default_state":"on","auto_on":0.00,"auto_off":0.00,"power":0.00,"schedule":false,"schedule_rules":[]} + ] +} +``` + + +### Shelly Bulb /status + + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlank","ip":"10.0.0.10","rssi":-74}, + "cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"10:41","serial":133,"has_update":false,"mac":"XXXXXXXXXXXX", + "lights":[ + {"ison":true,"mode":"color","red":255,"green":182,"blue":27,"white":0,"gain":100,"temp":3648,"brightness":86,"effect":0} + ], + "meters":[{"power":0.00,"is_valid":"true"}], + "update":{"status":"idle","has_update":false,"new_version":"20190821-094813/v1.5.2@4148d2b7","old_version":"20190821-094813/v1.5.2@4148d2b7"}, + "ram_total":51032,"ram_free":37420,"fs_size":233681,"fs_free":171182,"uptime":3125051 +} +``` + +### Shelly Bulb Coap Description - Color Mode + +``` +{ + "blk":[{"I":1,"D":"RGBW"}], + "sen":[ + {"I":111,"T":"Red","R":"0/255","L":0}, + {"I":121,"T":"Green","R":"0/255","L":0}, + {"I":131,"T":"Blue","R":"0/255","L":0}, + {"I":141,"T":"White","R":"0/255","L":0}, + {"I":151,"T":"Gain","R":"0/100","L":0}, + {"I":161,"T":"Temp","R":"3000/6500","L":0}, + {"I":171,"T":"Brightness","R":"0/100","L":0}, + {"I":181,"T":"VSwitch","R":"0/1","L":0} + ], + "act":[ + {"I":211,"D":"RGBW","L":0,"P":[{"I":2011,"T":"Red","R":"0/255"}, + {"I":2021,"T":"Green","R":"0/255"},{"I":2031,"T":"Blue","R":"0/255"}, + {"I":2041,"T":"White","R":"0/255"},{"I":2051,"T":"Gain","R":"0/100"}, + {"I":2061,"T":"Temp","R":"3000/6500"}, + {"I":2071,"T":"Brightness","R":"0/100"}, + {"I":2081,"T":"VSwitch","R":"0/1"}]} + ] +} +``` + +### Shelly Bulb Coap Description - White Mode + +``` +{ + "blk":[{"I":1,"D":"RGBW"}], + "sen":[ + {"I":111,"T":"Red","R":"0/255","L":0}, + {"I":121,"T":"Green","R":"0/255","L":0}, + {"I":131,"T":"Blue","R":"0/255","L":0}, + {"I":141,"T":"White","R":"0/255","L":0}, + {"I":151,"T":"Gain","R":"0/100","L":0}, + {"I":161,"T":"Temp","R":"3000/6500","L":0}, + {"I":171,"T":"Brightness","R":"0/100","L":0}, + {"I":181,"T":"VSwitch","R":"0/1","L":0} + ], + "act":[...] + } + ``` + + +## Shelly RGBW2 + +### Shelly RGW2 /settiings in color mode + +``` +{ + "device":{ + "type":"SHRGBW2", + "mac":"XXXXXXXXXXXX", + "hostname":"shellyrgbw2-XXXXXX", + "num_outputs":4 + }, + "wifi_ap":{"enabled":false, "ssid":"shellyrgbw2-XXXXXX", "key":""}, + "wifi_sta":{"enabled":true,"ssid":"iot-wlan","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":false,"server":"10.0.0.3:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"","will_message":"","max_qos":0,"retain":false,"update_period":30}, + "sntp": {"server":"time.google.com"}," + login":{"enabled":false,"unprotected":false,"xxx":"xxx","password":"xxx"}, + "pin_code":"PIpf!A", + "coiot_execute_enable":false,"name":"", + "fw":"20190711-084448/v1.5.0-hotfix4@3b4f7414", + "build_info":{"build_id":"20190711-084448/v1.5.0-hotfix4@3b4f7414","build_timestamp":"2019-07-11T08:44:48Z","build_version":"1.0"}, + "cloud":{"enabled":true,"connected":true}, + "timezone":"Europe/Berlin","lat":45.252491,"lng":7.779092,"tzautodetect":false,"time":"07:13", + "hwinfo": {"hw_revision":"prod-190410b","batch_id":1}, + "mode":"color"," + dcpower":1, + lights":[ + { + "ison":false, + "red":255,"green":0,"blue":0,"white":255, + "gain":29, + "effect":0, + "default_state":"off", + "auto_on":0.00,"auto_off":0.00, + "schedule":false, + "btn_type":"detached", + "btn_reverse":0,"schedule_rules":[] + } + ] +} +``` + +### RGW2 /status color mode + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.100","rssi":-69}, + "cloud":{"enabled":true,"connected":true}, + "mqtt":{"connected":false},"time":"07:12", + "serial":112, + "has_update":false,"mac":"XXXXXXXXXXXX", + "mode":"color", + "input":0, + "lights":[ + {"ison":false,"mode":"color", "red":255,"green":0,"blue":0,"white":255, "gain":29,"effect":0, "power":0.00,"overpower":false} + ], + "meters":[ + {"power":0.00,"is_valid":true} + ], + "update":{"status":"idle","has_update":false,"new_version":"20190711-084448/v1.5.0-hotfix4@3b4f7414","old_version":"20190711-084448/v1.5.0-hotfix4@3b4f7414"}, + "ram_total":50448,"ram_free":35824,"fs_size":233681,"fs_free":162648,"uptime":30380 +} +``` + +### RGBW2 /settings in white mode + +``` +{ + "device":{"type":"SHRGBW2","mac":"XXXXXXXXXXXX","hostname":"shellyrgbw2-XXXXXX","num_outputs":4}, + "wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-XXXXXX","key":""}, + "wifi_sta":{"enabled":true,"ssid":"iot_wlan","ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null}, + "mqtt": {"enable":false,"server":"10.0.0.1:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"","will_message":"","max_qos":0,"retain":false,"update_period":30}, + "sntp": {"server":"time.google.com"}," + login":{"enabled":false,"unprotected":false,"username":"xxx","password":"xxx"}, + "pin_code":"PIpf!A", + "coiot_execute_enable":false, + "name":"", + "fw":"20190711-084448/v1.5.0-hotfix4@3b4f7414", + "build_info":{"build_id":"20190711-084448/v1.5.0-hotfix4@3b4f7414","build_timestamp":"2019-07-11T08:44:48Z","build_version":"1.0"}, + "cloud":{"enabled":true,"connected":true}, + "timezone":"Europe/Berlin","lat":45.252491,"lng":7.779092,"tzautodetect":false,"time":"20:33", + "hwinfo": {"hw_revision":"prod-190410b","batch_id":1}, + "mode":"white", + "dcpower":1, + "lights":[ + {"ison":true,"brightness":50,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"detached","btn_reverse":0,"schedule_rules":[]}, + {"ison":false,"brightness":50,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"schedule_rules":[]}, + {"ison":false,"brightness":50,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"schedule_rules":[]}, + {"ison":false,"brightness":50,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"schedule_rules":[]} + ] +} +``` + +### RGBW2 set/statustings in white mode + +``` +{ + "wifi_sta":{"connected":true,"ssid":"iot_wlan","ip":"10.0.0.100","rssi":-36}, + "cloud":{"enabled":true,"connected":true}, + "mqtt":{"connected":false},"time":"20:33","serial":42, + "has_update":false,"mac":"XXXXXXXXXXXX","mode":"white","input":0, + "lights":[ + {"ison":true,"mode":"white","brightness":50,"power":1.20,"overpower":false}, + {"ison":false,"mode":"white","brightness":50,"power":0.00,"overpower":false}, + {"ison":false,"mode":"white","brightness":50,"power":0.00,"overpower":false}, + {"ison":false,"mode":"white","brightness":50,"power":0.00,"overpower":false} + ], + "meters":[ + {"power":1.20,"is_valid":true}, + {"power":0.00,"is_valid":true}, + {"power":0.00,"is_valid":true}, + {"power":0.00,"is_valid":true} + ], + "update":{"status":"idle","has_update":false,"new_version":"20190711-084448/v1.5.0-hotfix4@3b4f7414","old_version":"20190711-084448/v1.5.0-hotfix4@3b4f7414"}, + "ram_total":50448,"ram_free":35360,"fs_size":233681,"fs_free":162648, + "uptime":7201 +} +``` + +## Shelly Sense + +### Shelly Sense: /settings + +``` +{"device":{"type":"SHSEN-1","mac":"XXXXXXXXXXXX","hostname":"shellysense-XXXXXX"},"wifi_ap":{"enabled":false,"ssid":"shellysense-XXXXXX","key":""},"wifi_sta":{"enabled":true,"ssid":"iot-wlan","ipv4_method":"static","ip":"10.0.0.2","gw":"10.0.0.1","mask":"255.255.255.0","dns":"10.0.0.1"},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"10.0.0.10:1883","user":"","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"will_topic":"shellies/shellysense-XXXXXXX/online","will_message":"false","max_qos":0,"retain":false,"update_period":30},"sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"bS^Mtq","coiot_execute_enable":true,"name":"","fw":"20190821-095017/v1.5.2@4148d2b7","build_info":{"build_id":"20190821-095017/v1.5.2@4148d2b7","build_timestamp":"2019-08-21T09:50:17Z","build_version":"1.0"},"cloud":{"enabled":true,"connected":true},"timezone":"Europe/Berlin","lat":51.394344,"lng":8.571319,"tzautodetect":false,"time":"19:32","light_sensor":"NOA1305","schedule":false,"schedule_rules":[],"sensors":{"motion_duration":20,"motion_led":false,"temperature_unit":"C"}} +``` + +### Shelly Sense /status + +``` +{"wifi_sta":{"connected":true,"ssid":"iot-wlan","ip":"10.0.0.2","rssi":-69},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"19:32","serial":4768,"has_update":false,"mac":"XXXXXXXXXXXX","motion":false,"charger":true,"tmp":{"value":24.249284,"is_valid":true,"units":"C"},"hum":{"value":44.250477,"is_valid":true},"lux":{"value":12.987013,"is_valid":true},"bat":{"value":40},"update":{"status":"idle","has_update":false,"new_version":"20190821-095017/v1.5.2@4148d2b7","old_version":"20190821-095017/v1.5.2@4148d2b7"},"ram_total":51112,"ram_free":26848,"fs_size":83081,"fs_free":26857,"uptime":1823498} +``` + +### Shelly Sense /ir/list + +``` +[ + ["1_231_pwr","tv(231) - Power"],["1_231_chdwn","tv(231) - Channel Down"],["1_231_chup","tv(231) - Channel Up"],["1_231_voldwn","tv(231) - Volume Down"], + ["1_231_volup","tv(231) - Volume Up"],["1_231_mute","tv(231) - Mute"],["1_231_menu","tv(231) - Menu"],["1_231_inp","tv(231) - Input"],["1_231_info","tv(231) - Info"], + ["1_231_left","tv(231) - Left"],["1_231_up","tv(231) - Up"],["1_231_right","tv(231) - Right"],["1_231_ok","tv(231) - OK"],["1_231_down","tv(231) - Down"], + ["1_231_back","tv(231) - Back"],["6_546_pwr","receiver(546) - Power"],["6_546_voldwn","receiver(546) - Volume Down"],["6_546_volup","receiver(546) - Volume Up"], + ["6_546_mute","receiver(546) - Mute"],["6_546_menu","receiver(546) - Menu"],["6_546_info","receiver(546) - Info"],["6_546_left","receiver(546) - Left"], + ["6_546_up","receiver(546) - Up"],["6_546_right","receiver(546) - Right"],["6_546_ok","receiver(546) - OK"],["6_546_down","receiver(546) - Down"],["6_546_back","receiver(546) - Back"] +] +``` + +### Shelly Sense Coap Description + +``` +{ + "blk":[{"I":1, "D":"sensors"}], + "sen":[ + {"I":11, "D":"motion", "T":"S", "R":"0/1", "L":1}, + {"I":22, "D":"charger", "T":"S", "R":"0/1", "L":1}, + {"I":33, "D":"temperature", "T":"T", "R":"-40/125", "L":1}, + {"I":44, "D":"humidity", "T":"H", "R":"0/100", "L":1}, + {"I":66, "D":"lux", "T":"L", "R":"0/1", "L":1}, + {"I":77, "D":"battery", "T":"H", "R":"0/100", "L":1} + ] +} +``` + +## Shelly Flood + +### Shelly Flood /settings + +``` +{ + “deviceâ€:{“typeâ€:“SHWT-1â€,“macâ€:“XXXXXXXXâ€,“hostnameâ€:“shellyflood-XXXXXXâ€,“sleep_modeâ€:true}, + “wifi_apâ€:{“enabledâ€:false,“ssidâ€:“shellyflood-XXXXXXâ€,“keyâ€:""}, + “wifi_staâ€:{“enabledâ€:true,“ssidâ€:“iot-wlanâ€,“ipv4_methodâ€:“dhcpâ€,“ipâ€:null,“gwâ€:null,“maskâ€:null,“dnsâ€:null}, + “wifi_sta1â€:{“enabledâ€:false,“ssidâ€:null,“ipv4_methodâ€:“dhcpâ€,“ipâ€:null,“gwâ€:null,“maskâ€:null,“dnsâ€:null}, + “mqttâ€: {“enableâ€:true,“serverâ€:“XXXXXXâ€,“userâ€:“XXXXXXâ€,“reconnect_timeout_maxâ€:60.000000,“reconnect_timeout_minâ€:2.000000,“clean_sessionâ€:true,“keep_aliveâ€:60,“will_topicâ€:“shellies/shellyflood-XXXXXX/onlineâ€,“will_messageâ€:“falseâ€,“max_qosâ€:0,“retainâ€:false,“update_periodâ€:30}, + “sntpâ€: {“serverâ€:“time.google.comâ€},loginâ€:{“enabledâ€:true,“unprotectedâ€:false,“usernameâ€:“XXXXXXXâ€,“passwordâ€:“XXXXXXâ€},“pin_codeâ€:"",“coiot_execute_enableâ€:false, + “nameâ€:"",“fwâ€:“20190821-095233/v1.5.2@4148d2b7â€,“build_infoâ€:{“build_idâ€:“20190821-095233/v1.5.2@4148d2b7â€,“build_timestampâ€:“2019-08-21T09:52:33Zâ€,“build_versionâ€:“1.0â€}, + “cloudâ€:{“enabledâ€:false,“connectedâ€:false},“timezoneâ€:“Europe/Berlinâ€,“latâ€:50.110901,“lngâ€:8.682130,“tzautodetectâ€:true,“timeâ€:“11:09â€, + “sensorsâ€:{ + “temperature_thresholdâ€:1.0, + “temperature_unitâ€:“C†+ }, + “sleep_modeâ€:{“periodâ€:24,“unitâ€:“hâ€}, + “report_urlâ€:null, + “rain_sensorâ€:false +} +``` + +### Shelly Flood /status + +``` +{ + “wifi_staâ€:{“connectedâ€:true,“ssidâ€:“XXXXXâ€,“ipâ€:"XXXXXXXX“,“rssiâ€:-88}, + “cloudâ€:{“enabledâ€:false,“connectedâ€:false},“mqttâ€:{“connectedâ€:true}, + “timeâ€:“11:07â€,“serialâ€:1,“has_updateâ€:false,“macâ€:“XXXXXXXXXXXXâ€, + “is_validâ€:true, + “floodâ€:false, + “tmpâ€:{“valueâ€:21.62,“unitsâ€:“Câ€,“tCâ€:21.62,“tFâ€:70.93, “is_validâ€:true}, + “batâ€:{“valueâ€:95,“voltageâ€:2.92},“act_reasonsâ€:[“buttonâ€], + “rain_sensorâ€:false, + “updateâ€:{“statusâ€:“idleâ€,“has_updateâ€:false,“new_versionâ€:“20190821-095233/v1.5.2@4148d2b7â€,“old_versionâ€:“20190821-095233/v1.5.2@4148d2b7â€}, + “ram_totalâ€:50592,“ram_freeâ€:39632,“fs_sizeâ€:233681,“fs_freeâ€:154365,“uptimeâ€:22 +} +``` + + + +# COAP API JSON + + + + +### Decoded Device Description + +``` + id=0: Relay0 + id=1: Relay1 + id=2: Device + Adding 5 sensor definitions + id 112: State, Type=S, Range=0/1, Links=0 + id 122: State, Type=S, Range=0/1, Links=1 + id 111: Power, Type=W, Range=0/2300, Links=0 + id 121: Power, Type=W, Range=0/2300, Links=1 + id 113: Position, Type=S, Range=0/100, Links=2 + Device has 2 actors + id=211: Switch, Links=0 + P[2011]: ToState, Range=0/1 + id=221: Switch, Links=1 + P[2021]: ToState, Range=0/1 +``` + + \ No newline at end of file diff --git a/bundles/org.openhab.binding.shelly/pom.xml b/bundles/org.openhab.binding.shelly/pom.xml new file mode 100644 index 0000000000000..2d268caaf63a5 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/pom.xml @@ -0,0 +1,15 @@ +<?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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.shelly</artifactId> + + <name>openHAB Add-ons :: Bundles :: Shelly Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.shelly/src/main/feature/feature.xml b/bundles/org.openhab.binding.shelly/src/main/feature/feature.xml new file mode 100644 index 0000000000000..c35eba15dc06a --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/feature/feature.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.shelly-${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-shelly" description="Shelly Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <feature>openhab-transport-coap</feature> + <feature>openhab-transport-mdns</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.shelly/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/.gitignore b/bundles/org.openhab.binding.shelly/src/main/java/org/.gitignore new file mode 100644 index 0000000000000..9bb88d3761802 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/.gitignore @@ -0,0 +1 @@ +/.DS_Store diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyBindingConstants.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyBindingConstants.java new file mode 100755 index 0000000000000..c961844d51b38 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyBindingConstants.java @@ -0,0 +1,313 @@ +/** + * 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.shelly.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 {@link ShellyBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyBindingConstants { + + public static final String VENDOR = "Shelly"; + public static final String BINDING_ID = "shelly"; + public static final String SYSTEM_ID = "system"; + + // Type names + public static final String THING_TYPE_SHELLY1_STR = "shelly1"; + public static final String THING_TYPE_SHELLY1PN_STR = "shelly1pm"; + public static final String THING_TYPE_SHELLYEM_STR = "shellyem"; + public static final String THING_TYPE_SHELLY2_PREFIX = "shellyswitch"; + public static final String THING_TYPE_SHELLY2_RELAY_STR = "shelly2-relay"; + public static final String THING_TYPE_SHELLY2_ROLLER_STR = "shelly2-roller"; + public static final String THING_TYPE_SHELLY25_PREFIX = "shellyswitch25"; + public static final String THING_TYPE_SHELLY25_RELAY_STR = "shelly25-relay"; + public static final String THING_TYPE_SHELLY25_ROLLER_STR = "shelly25-roller"; + public static final String THING_TYPE_SHELLY4PRO_STR = "shelly4pro"; + public static final String THING_TYPE_SHELLYPLUG_STR = "shellyplug"; + public static final String THING_TYPE_SHELLYPLUGS_STR = "shellyplugs"; + public static final String THING_TYPE_SHELLYDIMMER_STR = "shellydimmer"; + public static final String THING_TYPE_SHELLYBULB_STR = "shellybulb"; + public static final String THING_TYPE_SHELLYRGBW2_PREFIX = "shellyrgbw2"; + public static final String THING_TYPE_SHELLYRGBW2_COLOR_STR = "shellyrgbw2-color"; + public static final String THING_TYPE_SHELLYRGBW2_WHITE_STR = "shellyrgbw2-white"; + public static final String THING_TYPE_SHELLYHT_STR = "shellyht"; + public static final String THING_TYPE_SHELLYSMOKE_STR = "shellysmoke"; + public static final String THING_TYPE_SHELLYFLOOD_STR = "shellyflood"; + public static final String THING_TYPE_SHELLYEYE_STR = "shellyseye"; + public static final String THING_TYPE_SHELLYSENSE_STR = "shellysense"; + public static final String THING_TYPE_SHELLYPROTECTED_STR = "shellydevice"; + public static final String THING_TYPE_UNKNOWN_STR = "unknown"; + + // Device Types + public static final String SHELLYDT_DIMMER = "SHDM-1"; + + // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_SHELLY1 = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY1_STR); + public static final ThingTypeUID THING_TYPE_SHELLY1PM = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY1PN_STR); + public static final ThingTypeUID THING_TYPE_SHELLYEM = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYEM_STR); + public static final ThingTypeUID THING_TYPE_SHELLY2_RELAY = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLY2_RELAY_STR); + public static final ThingTypeUID THING_TYPE_SHELLY2_ROLLER = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLY2_ROLLER_STR); + public static final ThingTypeUID THING_TYPE_SHELLY25_RELAY = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLY25_RELAY_STR); + public static final ThingTypeUID THING_TYPE_SHELLY25_ROLLER = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLY25_ROLLER_STR); + public static final ThingTypeUID THING_TYPE_SHELLY4PRO = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLY4PRO_STR); + public static final ThingTypeUID THING_TYPE_SHELLYPLUG = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUG_STR); + public static final ThingTypeUID THING_TYPE_SHELLYPLUGS = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPLUGS_STR); + public static final ThingTypeUID THING_TYPE_SHELLYDIMMER = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLYDIMMER_STR); + public static final ThingTypeUID THING_TYPE_SHELLYBULB = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYBULB_STR); + public static final ThingTypeUID THING_TYPE_SHELLYHT = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYHT_STR); + public static final ThingTypeUID THING_TYPE_SHELLYSENSE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYSENSE_STR); + public static final ThingTypeUID THING_TYPE_SHELLYSMOKE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYSMOKE_STR); + public static final ThingTypeUID THING_TYPE_SHELLYFLOOD = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYFLOOD_STR); + public static final ThingTypeUID THING_TYPE_SHELLYEYE = new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYEYE_STR); + public static final ThingTypeUID THING_TYPE_SHELLYRGBW2_COLOR = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLYRGBW2_COLOR_STR); + public static final ThingTypeUID THING_TYPE_SHELLYRGBW2_WHITE = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLYRGBW2_WHITE_STR); + public static final ThingTypeUID THING_TYPE_SHELLYUNKNOWN = new ThingTypeUID(BINDING_ID, + THING_TYPE_SHELLYPROTECTED_STR); + + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet( + Stream.of(THING_TYPE_SHELLY1, THING_TYPE_SHELLY1PM, THING_TYPE_SHELLYEM, THING_TYPE_SHELLY2_RELAY, + THING_TYPE_SHELLY2_ROLLER, THING_TYPE_SHELLY25_RELAY, THING_TYPE_SHELLY25_ROLLER, + THING_TYPE_SHELLY4PRO, THING_TYPE_SHELLYPLUG, THING_TYPE_SHELLYPLUGS, THING_TYPE_SHELLYDIMMER, + THING_TYPE_SHELLYBULB, THING_TYPE_SHELLYRGBW2_COLOR, THING_TYPE_SHELLYRGBW2_WHITE, + THING_TYPE_SHELLYHT, THING_TYPE_SHELLYSENSE, THING_TYPE_SHELLYEYE, THING_TYPE_SHELLYSMOKE, + THING_TYPE_SHELLYFLOOD, THING_TYPE_SHELLYUNKNOWN).collect(Collectors.toSet())); + + // check for updates every x sec + public static final int UPDATE_STATUS_INTERVAL_SECONDS = 3; + // update every x triggers or when a key was pressed + public static final int UPDATE_SKIP_COUNT = 20; + // update every x triggers or when a key was pressed + public static final int UPDATE_MIN_DELAY = 15; + // check for updates every x sec + public static final int UPDATE_SETTINGS_INTERVAL_SECONDS = 60; + + // Thing Configuration Properties + public static final String CONFIG_DEVICEIP = "deviceIp"; + public static final String CONFIG_HTTP_USERID = "userId"; + public static final String CONFIG_HTTP_PASSWORD = "password"; + public static final String CONFIG_UPDATE_INTERVAL = "updateInterval"; + + public static final String PROPERTY_SERVICE_NAME = "serviceName"; + public static final String PROPERTY_DEV_TYPE = "deviceType"; + public static final String PROPERTY_DEV_MODE = "deviceMode"; + public static final String PROPERTY_HWBATCH = "hardwareBatch"; + public static final String PROPERTY_HWREV = "devHwRev"; + public static final String PROPERTY_NUM_RELAYS = "numberRelays"; + public static final String PROPERTY_NUM_ROLLERS = "numberRollers"; + public static final String PROPERTY_NUM_METER = "numberMeters"; + public static final String PROPERTY_LAST_ACTIVE = "lastActive"; + public static final String PROPERTY_WIFI_NETW = "wifiNetwork"; + public static final String PROPERTY_WIFI_IP = "networkIP"; + public static final String PROPERTY_UPDATE_STATUS = "updateStatus"; + public static final String PROPERTY_UPDATE_AVAILABLE = "updateAvailable"; + public static final String PROPERTY_UPDATE_CURR_VERS = "updateCurrentVersion"; + public static final String PROPERTY_UPDATE_NEW_VERS = "updateNewVersion"; + public static final String PROPERTY_COAP_DESCR = "coapDeviceDescr"; + + // Relay + public static final String CHANNEL_GROUP_RELAY_CONTROL = "relay"; + public static final String CHANNEL_OUTPUT = "output"; + public static final String CHANNEL_INPUT = "input"; + public static final String CHANNEL_INPUT1 = "input1"; + public static final String CHANNEL_INPUT2 = "input2"; + public static final String CHANNEL_BRIGHTNESS = "brightness"; + + public static final String CHANNEL_TIMER_AUTOON = "autoOn"; + public static final String CHANNEL_TIMER_AUTOOFF = "autoOff"; + public static final String CHANNEL_TIMER_ACTIVE = "timerActive"; + + // Roller + public static final String CHANNEL_GROUP_ROL_CONTROL = "roller"; + public static final String CHANNEL_ROL_CONTROL_CONTROL = "control"; + public static final String CHANNEL_ROL_CONTROL_POS = "rollerpos"; + public static final String CHANNEL_ROL_CONTROL_TIMER = "timer"; + public static final String CHANNEL_ROL_CONTROL_STOPR = "stopReason"; + public static final String CHANNEL_ROL_CONTROL_DIR = "lastDirection"; + + // Dimmer + public static final String CHANNEL_GROUP_DIMMER_CONTROL = CHANNEL_GROUP_RELAY_CONTROL; + + public static final String CHANNEL_GROUP_DIMMER_STATUS = "status"; + public static final String CHANNEL_DIMMER_LOAD_ERROR = "loaderror"; + + // Power meter + public static final String CHANNEL_GROUP_METER = "meter"; + public static final String CHANNEL_METER_CURRENTWATTS = "currentWatts"; + public static final String CHANNEL_METER_LASTMIN1 = "lastPower1"; + public static final String CHANNEL_METER_LASTMIN2 = "lastPower2"; + public static final String CHANNEL_METER_LASTMIN3 = "lastPower3"; + public static final String CHANNEL_METER_TOTALKWH = "totalKWH"; + public static final String CHANNEL_EMETER_TOTALRET = "returnedKWH"; + public static final String CHANNEL_EMETER_REACTWATTS = "reactiveWatts"; + public static final String CHANNEL_EMETER_VOLTAGE = "voltage"; + + public static final String CHANNEL_GROUP_LED_CONTROL = "led"; + public static final String CHANNEL_LED_STATUS_DISABLE = "statusLed"; + public static final String CHANNEL_LED_POWER_DISABLE = "powerLed"; + + public static final String CHANNEL_GROUP_SENSOR = "sensors"; + public static final String CHANNEL_SENSOR_TEMP = "temperature"; + public static final String CHANNEL_SENSOR_HUM = "humidity"; + public static final String CHANNEL_SENSOR_LUX = "lux"; + public static final String CHANNEL_SENSOR_FLOOD = "flood"; + public static final String CHANNEL_SENSOR_MOTION = "motion"; + public static final String CHANNEL_SENSOR_CHARGER = "charger"; + + public static final String CHANNEL_GROUP_SENSE_CONTROL = "control"; + public static final String CHANNEL_SENSE_KEY = "key"; + + public static final String CHANNEL_GROUP_BATTERY = "battery"; + public static final String CHANNEL_SENSOR_BAT_LEVEL = "batteryLevel"; + public static final String CHANNEL_SENSOR_BAT_LOW = "lowBattery"; + public static final String CHANNEL_SENSOR_BAT_VOLT = "voltage"; + + public static final String CHANNEL_GROUP_LIGHT_CONTROL = "control"; + public static final String CHANNEL_LIGHT_COLOR_MODE = "mode"; + public static final String CHANNEL_LIGHT_POWER = "power"; + public static final String CHANNEL_LIGHT_DEFSTATE = "defaultState"; + public static final String CHANNEL_GROUP_LIGHT_CHANNEL = "channel"; + + // Bulb/RGBW2 in color mode + public static final String CHANNEL_GROUP_COLOR_CONTROL = "color"; + public static final String CHANNEL_COLOR_PICKER = "hsb"; + public static final String CHANNEL_COLOR_FULL = "full"; + public static final String CHANNEL_COLOR_RED = "red"; + public static final String CHANNEL_COLOR_GREEN = "green"; + public static final String CHANNEL_COLOR_BLUE = "blue"; + public static final String CHANNEL_COLOR_WHITE = "white"; + public static final String CHANNEL_COLOR_GAIN = "gain"; + public static final String CHANNEL_COLOR_EFFECT = "effect"; + + // Bulb/RGBW2 in White Mode + public static final String CHANNEL_GROUP_WHITE_CONTROL = "white"; + public static final String CHANNEL_COLOR_TEMP = "temperature"; + + // Device Status + public static final String CHANNEL_GROUP_DEV_STATUS = "device"; + public static final String CHANNEL_DEVST_UPTIME = "uptime"; + public static final String CHANNEL_DEVST_RSSI = "wifiSignal"; + public static final String CHANNEL_DEVST_ALARM = "alarm"; + + // General + public static final String CHANNEL_LAST_UPDATE = "lastUpdate"; + public static final String CHANNEL_EVENT_TRIGGER = "event"; + public static final String CHANNEL_BUTTON_TRIGGER = "button"; + + public static final String SERVICE_TYPE = "_http._tcp.local."; + public static final String SHELLY_API_MIN_FWVERSION = "v1.5.2"; + public static final int SHELLY_API_TIMEOUT_MS = 6000; + + // Alarm types/messages + public static final String ALARM_TYPE_NONE = "NONE"; + public static final String ALARM_TYPE_WEAKSIGNAL = "WEAK_SIGNAL"; + public static final String ALARM_TYPE_RESTARTED = "RESTARTED"; + public static final String ALARM_TYPE_OVERTEMP = "OVERTEMP"; + public static final String ALARM_TYPE_OVERPOWER = "OVERPOWER"; + public static final String ALARM_TYPE_OVERLOAD = "OVERLOAD"; + public static final String ALARM_TYPE_LOADERR = "LOAD_ERROR"; + public static final String ALARM_TYPE_LOW_BATTERY = "LOW_BATTERY"; + + // Coap + public static final int COIOT_PORT = 5683; + public static final String COAP_MULTICAST_ADDRESS = "224.0.1.187"; + + public static final String COLOIT_URI_BASE = "/cit/"; + public static final String COLOIT_URI_DEVDESC = COLOIT_URI_BASE + "d"; + public static final String COLOIT_URI_DEVSTATUS = COLOIT_URI_BASE + "s"; + + public static final int COIOT_OPTION_GLOBAL_DEVID = 3332; + public static final int COIOT_OPTION_STATUS_VALIDITY = 3412; + public static final int COIOT_OPTION_STATUS_SERIAL = 3420; + + public static final byte[] EMPTY_BYTE = new byte[0]; + + public static final String SHELLY_NULL_URL = "null"; + public static final String SHELLY_URL_DEVINFO = "/shelly"; + public static final String SHELLY_URL_STATUS = "/status"; + public static final String SHELLY_URL_SETTINGS = "/settings"; + public static final String SHELLY_URL_SETTINGS_AP = "/settings/ap"; + public static final String SHELLY_URL_SETTINGS_STA = "/settings/sta"; + public static final String SHELLY_URL_SETTINGS_LOGIN = "/settings/sta"; + public static final String SHELLY_URL_SETTINGS_CLOUD = "/settings/cloud"; + public static final String SHELLY_URL_LIST_IR = "/ir/list"; + public static final String SHELLY_URL_SEND_IR = "/ir/emit"; + + public static final String SHELLY_URL_SETTINGS_RELAY = "/settings/relay"; + public static final String SHELLY_URL_STATUS_RELEAY = "/status/relay"; + public static final String SHELLY_URL_CONTROL_RELEAY = "/relay"; + + public static final String SHELLY_URL_SETTINGS_EMETER = "/settings/emeter"; + public static final String SHELLY_URL_STATUS_EMETER = "/emeter"; + public static final String SHELLY_URL_DATA_EMETER = "/emeter/{0}/em_data.csv"; + + public static final String SHELLY_URL_CONTROL_ROLLER = "/roller"; + public static final String SHELLY_URL_SETTINGS_ROLLER = "/settings/roller"; + + public static final String SHELLY_URL_SETTINGS_LIGHT = "/settings/light"; + public static final String SHELLY_URL_STATUS_LIGHT = "/light"; + public static final String SHELLY_URL_CONTROL_LIGHT = "/light"; + + public static final String SHELLY_URL_SETTINGS_DIMMER = "/settings/light"; + + public static final String SHELLY_CALLBACK_URI = "/shelly/event"; + public static final String EVENT_TYPE_RELAY = "relay"; + public static final String EVENT_TYPE_ROLLER = "roller"; + public static final String EVENT_TYPE_SENSORDATA = "sensordata"; + public static final String EVENT_TYPE_LIGHT = "light"; + + public static final String SHELLY_IR_CODET_STORED = "stored"; + public static final String SHELLY_IR_CODET_PRONTO = "pronto"; + public static final String SHELLY_IR_CODET_PRONTO_HEX = "pronto_hex"; + + public static final String HTTP_DELETE = "DELETE"; + public static final String HTTP_HEADER_AUTH = "Authorization"; + public static final String HTTP_AUTH_TYPE_BASIC = "Basic"; + public static final String CONTENT_TYPE_XML = "text/xml; charset=UTF-8"; + + public static final String APIERR_HTTP_401_UNAUTHORIZED = "401 Unauthorized"; + public static final String APIERR_TIMEOUT = "Timeout"; + public static final String APIERR_NOT_CALIBRATED = "Not calibrated!"; + + // Minimum signal strength for basic connectivity. Packet delivery may be unreliable. + public static final int HEALTH_CHECK_INTERVAL_SEC = 300; + public static final int SIGNAL_ALARM_MIN_RSSI = -80; + + public static final int DIM_STEPSIZE = 5; + + // Formatting: Number of scaling digits + public static final int DIGITS_NONE = 0; + public static final int DIGITS_WATT = 3; + public static final int DIGITS_KWH = 4; + public static final int DIGITS_VOLT = 2; + public static final int DIGITS_TEMP = 2; + public static final int DIGITS_LUX = 2; + public static final int DIGITS_PERCENT = 2; +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyHandlerFactory.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyHandlerFactory.java new file mode 100755 index 0000000000000..fbd599949cee3 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyHandlerFactory.java @@ -0,0 +1,166 @@ +/** + * 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.shelly.internal; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; + +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; + +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.net.HttpServiceUtil; +import org.eclipse.smarthome.core.net.NetworkAddressService; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.openhab.binding.shelly.internal.coap.ShellyCoapServer; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.openhab.binding.shelly.internal.handler.ShellyBaseHandler; +import org.openhab.binding.shelly.internal.handler.ShellyDeviceListener; +import org.openhab.binding.shelly.internal.handler.ShellyLightHandler; +import org.openhab.binding.shelly.internal.handler.ShellyProtectedHandler; +import org.openhab.binding.shelly.internal.handler.ShellyRelayHandler; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.reactivex.annotations.NonNull; + +/** + * The {@link ShellyHandlerFactory} is responsible for creating things and thing handlers. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +@Component(service = { ThingHandlerFactory.class, ShellyHandlerFactory.class }, configurationPid = "binding.shelly") +public class ShellyHandlerFactory extends BaseThingHandlerFactory { + private final Logger logger = LoggerFactory.getLogger(ShellyHandlerFactory.class); + private final ShellyCoapServer coapServer; + private final Set<ShellyDeviceListener> deviceListeners = new CopyOnWriteArraySet<>(); + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = ShellyBindingConstants.SUPPORTED_THING_TYPES_UIDS; + private ShellyBindingConfiguration bindingConfig = new ShellyBindingConfiguration(); + private String localIP = ""; + private int httpPort = -1; + + /** + * Activate the bundle: save properties + * + * @param componentContext + * @param configProperties set of properties from cfg (use same names as in + * thing config) + */ + @Activate + public ShellyHandlerFactory(@Reference NetworkAddressService networkAddressService, + ComponentContext componentContext, Map<String, @Nullable Object> configProperties) { + logger.debug("Activate Shelly HandlerFactory"); + super.activate(componentContext); + + this.coapServer = new ShellyCoapServer(); + Validate.notNull(coapServer, "coapServer creation failed!"); + + Validate.notNull(configProperties); + bindingConfig.updateFromProperties(configProperties); + httpPort = HttpServiceUtil.getHttpServicePort(componentContext.getBundleContext()); + if (httpPort == -1) { + httpPort = 8080; + } + Validate.isTrue(httpPort > 0, "Unable to get OH HTTP port"); + logger.debug("Using OH HTTP port {}", httpPort); + + String lip = networkAddressService.getPrimaryIpv4HostAddress(); + localIP = lip != null ? lip : ""; + } + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + String thingType = thingTypeUID.getId(); + ShellyBaseHandler handler = null; + + if (thingType.equals(THING_TYPE_SHELLYPROTECTED_STR)) { + logger.debug("Create new thing of type {} using ShellyRelayHandler", thingTypeUID.getId()); + handler = new ShellyProtectedHandler(thing, bindingConfig, coapServer, localIP, httpPort); + } else if (thingType.equals(THING_TYPE_SHELLYBULB.getId()) + || thingType.equals(THING_TYPE_SHELLYRGBW2_COLOR.getId()) + || thingType.equals(THING_TYPE_SHELLYRGBW2_WHITE.getId())) { + logger.debug("Create new thing of type {} using ShellyLightHandler", thingTypeUID.getId()); + handler = new ShellyLightHandler(thing, bindingConfig, coapServer, localIP, httpPort); + } else if (SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) { + logger.debug("Create new thing of type {} using ShellyRelayHandler", thingTypeUID.getId()); + handler = new ShellyRelayHandler(thing, bindingConfig, coapServer, localIP, httpPort); + } + + if (handler != null) { + deviceListeners.add(handler); + return handler; + } + + logger.debug("Unable to create Thing Handler instance!"); + return null; + } + + /** + * Remove handler of things. + */ + @SuppressWarnings("unlikely-arg-type") + @Override + protected synchronized void removeHandler(@NonNull ThingHandler thingHandler) { + if (thingHandler instanceof ShellyBaseHandler) { + deviceListeners.remove(thingHandler); + } + } + + /** + * Dispatch event to registered devices. + * + * @param deviceName + * @param componentIndex Index of component, e.g. 2 for relay2 + * @param eventType Type of event, e.g. light + * @param parameters Input parameters from URL, e.g. on sensor reports + */ + public void onEvent(String deviceName, String componentIndex, String eventType, Map<String, String> parameters) { + logger.trace("Dispatch event to device handler {}", deviceName); + for (ShellyDeviceListener listener : deviceListeners) { + try { + if (listener.onEvent(deviceName, componentIndex, eventType, parameters)) { + // event processed + break; + } + } catch (NullPointerException e) { + logger.debug("Unable to process callback: {} ({}), deviceName={}, type={}, index={}, parameters={}\n{}", + e.getMessage(), e.getClass(), deviceName, eventType, componentIndex, parameters.toString(), + e.getStackTrace()); + // continue with next listener + } + } + } + + @Nullable + public ShellyBindingConfiguration getBindingConfig() { + return bindingConfig; + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyUtils.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyUtils.java new file mode 100644 index 0000000000000..0f71af465d18b --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/ShellyUtils.java @@ -0,0 +1,191 @@ +/** + * 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.shelly.internal; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; + +import javax.measure.Unit; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; + +/** + * {@link ShellyUtils} provides general utility functions + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyUtils { + public static String mkChannelId(String group, String channel) { + return group + "#" + channel; + } + + public static String getString(@Nullable String value) { + return value != null ? value : ""; + } + + public static Integer getInteger(@Nullable Integer value) { + return (value != null ? (Integer) value : 0); + } + + public static Long getLong(@Nullable Long value) { + return (value != null ? (Long) value : 0); + } + + public static Double getDouble(@Nullable Double value) { + return (value != null ? (Double) value : 0); + } + + public static Boolean getBool(@Nullable Boolean value) { + return (value != null ? (Boolean) value : false); + } + + // as State + + public static StringType getStringType(@Nullable String value) { + return new StringType(value != null ? value : ""); + } + + public static DecimalType getDecimal(@Nullable Double value) { + return new DecimalType((value != null ? value : 0)); + } + + public static DecimalType getDecimal(@Nullable Integer value) { + return new DecimalType((value != null ? value : 0)); + } + + public static DecimalType getDecimal(@Nullable Long value) { + return new DecimalType((value != null ? value : 0)); + } + + public static OnOffType getOnOff(@Nullable Boolean value) { + return (value != null ? value ? OnOffType.ON : OnOffType.OFF : OnOffType.OFF); + } + + public static OnOffType getOnOff(int value) { + return value == 0 ? OnOffType.OFF : OnOffType.ON; + } + + @SuppressWarnings("null") + public static State toQuantityType(@Nullable Double value, int digits, Unit<?> unit) { + BigDecimal bd = new BigDecimal(value.doubleValue()); + return value == null ? UnDefType.NULL : toQuantityType(bd.setScale(digits, BigDecimal.ROUND_HALF_DOWN), unit); + } + + public static State toQuantityType(@Nullable Number value, Unit<?> unit) { + return value == null ? UnDefType.NULL : new QuantityType<>(value, unit); + } + + public static State toQuantityType(@Nullable PercentType value, Unit<?> unit) { + return value == null ? UnDefType.NULL : toQuantityType(value.toBigDecimal(), unit); + } + + public static void validateRange(String name, Integer value, Integer min, Integer max) { + Validate.isTrue((value >= min) && (value <= max), + "Value " + name + " is out of range (" + min.toString() + "-" + max.toString() + ")"); + } + + public static String buildSetEventUrl(String localIp, String localPort, String deviceName, Integer index, + String deviceType, String urlParm) throws IOException { + return SHELLY_URL_SETTINGS + "/" + deviceType + "/" + index + "?" + urlParm + "=" + + buildCallbackUrl(localIp, localPort, deviceName, index, deviceType, urlParm); + } + + public static String buildCallbackUrl(String localIp, String localPort, String deviceName, Integer index, + String type, String parameter) throws IOException { + String url = "http://" + localIp + ":" + localPort + SHELLY_CALLBACK_URI + "/" + deviceName + "/" + type + "/" + + index + "?type=" + StringUtils.substringBefore(parameter, "_url"); + return urlEncode(url); + } + + public static String urlEncode(String input) throws IOException { + try { + return URLEncoder.encode(input, StandardCharsets.UTF_8.toString()); + } catch (UnsupportedEncodingException e) { + throw new IOException( + "Unsupported encoding format: " + StandardCharsets.UTF_8.toString() + ", input=" + input); + } + } + + public static Long now() { + return System.currentTimeMillis() / 1000L; + } + + public static DateTimeType getTimestamp() { + return new DateTimeType(ZonedDateTime.ofInstant(Instant.ofEpochSecond(now()), ZoneId.systemDefault())); + } + + public static DateTimeType getTimestamp(String zone, long timestamp) { + ZoneId zoneId = ZoneId.of(zone); + ZonedDateTime zdt = LocalDateTime.now().atZone(zoneId); + int delta = zdt.getOffset().getTotalSeconds(); + return new DateTimeType(ZonedDateTime.ofInstant(Instant.ofEpochSecond(timestamp - delta), zoneId)); + } + + public static Integer getLightIdFromGroup(@Nullable String groupName) { + Validate.notNull(groupName); + if (groupName.startsWith(CHANNEL_GROUP_LIGHT_CHANNEL)) { + return Integer.parseInt(StringUtils.substringAfter(groupName, CHANNEL_GROUP_LIGHT_CHANNEL)) - 1; + } + return 0; // only 1 light, e.g. bulb or rgbw2 in color mode + } + + public static String buildControlGroupName(@Nullable ShellyDeviceProfile profile, Integer channelId) { + Validate.notNull(profile); + return profile.isBulb || profile.inColor ? CHANNEL_GROUP_LIGHT_CONTROL + : CHANNEL_GROUP_LIGHT_CHANNEL + channelId.toString(); + } + + public static String buildWhiteGroupName(@Nullable ShellyDeviceProfile profile, Integer channelId) { + Validate.notNull(profile); + return profile.isBulb && !profile.inColor ? CHANNEL_GROUP_WHITE_CONTROL + : CHANNEL_GROUP_LIGHT_CHANNEL + channelId.toString(); + } + + public static DecimalType mapSignalStrength(int dbm) { + int strength = -1; + if (dbm > -60) { + strength = 4; + } else if (dbm > -70) { + strength = 3; + } else if (dbm > -80) { + strength = 2; + } else if (dbm > -90) { + strength = 1; + } else { + strength = 0; + } + return new DecimalType(strength); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyApiJson.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyApiJson.java new file mode 100644 index 0000000000000..e0c55fc9fb049 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyApiJson.java @@ -0,0 +1,751 @@ +/** + * 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.shelly.internal.api; + +import java.util.ArrayList; + +import com.google.gson.annotations.SerializedName; + +/** + * The {@link ShellyApiJson} is used for the JSon/GSon mapping + * + * @author Markus Michels - Initial contribution + */ +public class ShellyApiJson { + + public static final String SHELLY_API_ON = "on"; + public static final String SHELLY_API_OFF = "off"; + public static final String SHELLY_API_TRUE = "true"; + public static final String SHELLY_API_FALSE = "false"; + + public static final String SHELLY_CLASS_RELAY = "relay"; // Relay: relay mode + public static final String SHELLY_CLASS_ROLLER = "roller"; // Relay: roller mode + public static final String SHELLY_CLASS_LIGHT = "light"; // Bulb: color mode + + public static class ShellySettingsDevice { + public String type; + public String mac; + public String hostname; + public String fw; + public Boolean auth; + @SerializedName("num_outputs") + public Integer numOutputs; + @SerializedName("num_meters") + public Integer numMeters; + @SerializedName("num_emeters") + public Integer numEMeters; + @SerializedName("num_rollers") + public Integer numRollers; + } + + public static class ShellySettingsWiFiAp { + public Boolean enabled; + public String ssid; + public String key; + } + + public static class ShellySettingsWiFiNetwork { + public Boolean enabled; + public String ssid; + public Integer rssi; + + @SerializedName("ipv4_method") + public String ipv4Method; + public final String SHELLY_IPM_STATIC = "static"; + public final String SHELLY_IPM_DHCP = "dhcp"; + + public String ip; + public String gw; + public String mask; + public String dns; + } + + public static class ShellySettingsMqtt { + public Boolean enabled; + public String server; + public String user; + @SerializedName("reconnect_timeout_max") + public Double reconnectTimeoutMax; + @SerializedName("reconnect_timeout_min") + public Double reconnectTimeoutMin; + @SerializedName("clean_session") + public Boolean cleanSession; + @SerializedName("keep_alive") + public Integer keepAlive; + @SerializedName("will_topic") + public String willTopic; + @SerializedName("will_message") + public String willMessage; + @SerializedName("max_qos") + public Integer maxQOS; + public Boolean retain; + @SerializedName("update_period") + public Integer updatePeriod; + } + + public static class ShellySettingsSntp { + public String server; + } + + public static class ShellySettingsLogin { + public Boolean enabled; + public Boolean unprotected; + public String username; + public String password; + } + + public static class ShellySettingsBuildInfo { + @SerializedName("build_id") + public String buildId; + @SerializedName("build_timestamp") + public String buildTimestamp; + @SerializedName("build_version") + public String buildVersion; + } + + public static class ShellyStatusCloud { + public Boolean enabled; + public Boolean connected; + } + + public static class ShellyStatusMqtt { + public Boolean connected; + } + + public static class ShellySettingsHwInfo { + @SerializedName("hw_revision") + public String hwRevision; + @SerializedName("batch_id") + public Integer batchId; + } + + public static class ShellySettingsScheduleRules { + } + + public static class ShellySettingsRelay { + public String name; + public Boolean ison; + public Boolean overpower; + @SerializedName("default_state") + public String defaultState; // Accepted values: off, on, last, switch + @SerializedName("btn_type") + public String btnType; // Accepted values: momentary, toggle, edge, detached - // see SHELLY_BTNT_xxx + @SerializedName("has_timer") + public Boolean hasTimer; // Whether a timer is currently armed for this channel + @SerializedName("auto_on") + public Double autoOn; // Automatic flip back timer, seconds. Will engage after turning Shelly1 OFF. + @SerializedName("auto_off") + public Double autoOff; // Automatic flip back timer, seconds. Will engage after turning Shelly1 ON. + @SerializedName("btn_on_url") + public String btnOnUrl; // input is activated + @SerializedName("btnOffUrl") + public String btnOffUrl; // input is deactivated + @SerializedName("out_on_url") + public String outOnUrl; // output is activated + @SerializedName("out_off_url") + public String outOffUrl; // output is deactivated + @SerializedName("roller_open_url") + public String rollerOpenUrl; // to access when roller reaches open position + @SerializedName("roller_close_url") + public String rollerCloseUrl; // to access when roller reaches close position + @SerializedName("roller_stop_url") + public String rollerStopUrl; // to access when roller stopped + @SerializedName("longpush_url") + public String pushLongUrl; // to access when roller stopped + @SerializedName("shortpush_url") + public String pushShortUrl; // to access when roller stopped + + public Boolean schedule; + // ArrayList<ShellySettingsScheduleRules> schedule_rules; + } + + public static class ShellySettingsDimmer { + public String name; // unique name of the device + public Boolean ison; // true: output is ON + @SerializedName("default_state") + public String defaultState; // Accepted values: off, on, last, switch + @SerializedName("auto_on") + public Double autoOn; // Automatic flip back timer, seconds. Will engage after turning Shelly1 OFF. + @SerializedName("auto_off") + public Double autoOff; // Automatic flip back timer, seconds. Will engage after turning Shelly1 ON. + @SerializedName("btn1_on_url") + public String btn1OnUrl; // URL to access when SW input is activated + @SerializedName("btn1_off_url") + public String btn1OffUrl; // URL to access when SW input is deactivated + @SerializedName("btn2_on_url") + public String btn2OnUrl; // URL to access when SW input is activated + @SerializedName("btn2_off_url") + public String btn2OoffUrl; // URL to access when SW input is deactivated + @SerializedName("out_on_url") + public String outOnUrl; // URL to access when output is activated + @SerializedName("out_off_url") + public String outOffUrl; // URL to access when output is deactivated + @SerializedName("longpush_url") + public String pushLongUrl; // long push button event + @SerializedName("shortpush_url") + public String pushShortUrl; // short push button event + @SerializedName("btn_type") + public String btnType; // Accepted values: momentary, toggle, edge, detached - // see SHELLY_BTNT_xxx + @SerializedName("swap_inputs") + public Integer swapInputs; // 0=no + } + + public static final String SHELLY_API_EVENTURL_BTN_ON = "btn_on_url"; + public static final String SHELLY_API_EVENTURL_BTN_OFF = "btn_off_url"; + public static final String SHELLY_API_EVENTURL_BTN1_ON = "btn1_on_url"; + public static final String SHELLY_API_EVENTURL_BTN1_OFF = "btn1_off_url"; + public static final String SHELLY_API_EVENTURL_BTN2_ON = "btn2_on_url"; + public static final String SHELLY_API_EVENTURL_BTN2_OFF = "btn2_off_url"; + public static final String SHELLY_API_EVENTURL_OUT_ON = "out_on_url"; + public static final String SHELLY_API_EVENTURL_OUT_OFF = "out_off_url"; + public static final String SHELLY_API_EVENTURL_SHORT_PUSH = "shortpush_url"; + public static final String SHELLY_API_EVENTURL_LONG_PUSH = "longpush_url"; + public static final String SHELLY_API_EVENTURL_ROLLER_OPEN = "roller_open_url"; + public static final String SHELLY_API_EVENTURL_ROLLER_CLOSE = "roller_close_url"; + public static final String SHELLY_API_EVENTURL_ROLLER_STOP = "roller_stop_url"; + public static final String SHELLY_API_EVENTURL_REPORT = "report_url"; + + public static final String SHELLY_EVENT_BTN_ON = "btn_on"; + public static final String SHELLY_EVENT_BTN_OFF = "btn_off"; + public static final String SHELLY_EVENT_BTN1_OFF = "btn1_on"; + public static final String SHELLY_EVENT_BTN1_ON = "btn1_off"; + public static final String SHELLY_EVENT_BTN2_ON = "btn2_on"; + public static final String SHELLY_EVENT_BTN2_OFF = "btn2_off"; + public static final String SHELLY_EVENT_SHORTPUSH = "shortpush"; + public static final String SHELLY_EVENT_LONGPUSH = "longpush"; + public static final String SHELLY_EVENT_OUT_ON = "btn2_off"; + public static final String SHELLY_EVENT_OUT_OFF = "btn_on"; + public static final String SHELLY_EVENT_ROLLER_OPEN = "roller_open"; + public static final String SHELLY_EVENT_ROLLER_CLOSE = "roller_close"; + public static final String SHELLY_EVENT_ROLLER_STOP = "roller_stop"; + public static final String SHELLY_EVENT_SENSORDATA = "sensordata"; + + public static final String SHELLY_BTNT_MOMENTARY = "momentary"; + public static final String SHELLY_BTNT_TOGGLE = "toggle"; + public static final String SHELLY_BTNT_EDGE = "edge"; + public static final String SHELLY_BTNT_DETACHED = "detached"; + public static final String SHELLY_STATE_LAST = "last"; + public static final String SHELLY_STATE_STOP = "stop"; + public static final String SHELLY_INP_MODE_OPENCLOSE = "openclose"; + public static final String SHELLY_OBSTMODE_DISABLED = "disabled"; + public static final String SHELLY_SAFETYM_WHILEOPENING = "while_opening"; + public static final String SHELLY_ALWD_TRIGGER_NONE = "none"; + public static final String SHELLY_ALWD_ROLLER_TURN_OPEN = "open"; + public static final String SHELLY_ALWD_ROLLER_TURN_CLOSE = "close"; + public static final String SHELLY_ALWD_ROLLER_TURN_STOP = "stop"; + + public static class ShellySettingsRoller { + public Double maxtime; + @SerializedName("maxtime_open") + public Double maxtimeOpen; + @SerializedName("maxtime_close") + public Double maxtimeClose; + @SerializedName("default_state") + public String defaultState; // see SHELLY_STATE_xxx + public Boolean swap; + @SerializedName("swap_inputs") + public Boolean swapInputs; + @SerializedName("input_mode") + public String inputMode; // see SHELLY_INP_MODE_OPENCLOSE + @SerializedName("button_type") + public String buttonType; // // see SHELLY_BTNT_xxx + @SerializedName("btn_Reverse") + public Integer btnReverse; + public String state; + public Double power; + @SerializedName("is_valid") + public Boolean isValid; + @SerializedName("safety_switch") + public Boolean safetySwitch; + public Boolean schedule; + // ArrayList<ShellySettingsScheduleRules> schedule_rules; // not used for now + @SerializedName("obstacle_mode") + public String obstaclMode; // SHELLY_OBSTMODE_ + @SerializedName("obstacle_action") + public String obstacleAction; // see SHELLY_STATE_xxx + @SerializedName("obstacle_power") + public Integer obstaclePower; + @SerializedName("obstacle_delay") + public Integer obstacleDelay; + @SerializedName("safety_mode") + public String safetyMode; // see SHELLY_SAFETYM_xxx + @SerializedName("safety_action") + public String safetyAction; // see SHELLY_STATE_xxx + @SerializedName("safety_allowed_on_trigger") + public String safetyAllowedOnTrigger; // see SHELLY_ALWD_TRIGGER_xxx + @SerializedName("off_power") + public Integer offPower; + public Boolean positioning; + } + + public static class ShellyInputState { + public Integer input; + } + + public static class ShellySettingsMeter { + @SerializedName("is_valid") + public Boolean isValid; + public Double power; + public Double[] counters = { 0.0, 0.0, 0.0 }; + public Double total; + public Long timestamp; + } + + public static class ShellySettingsEMeter { // ShellyEM meter + @SerializedName("is_valid") + public Boolean isValid; // Whether the associated meter is functioning properly + public Double power; // Instantaneous power, Watts + public Double reactive; // Instantaneous reactive power, Watts + public Double voltage; // RMS voltage, Volts + public Double total; // Total consumed energy, Wh + @SerializedName("total_returned") + public Double totalReturned; // Total returned energy, Wh + public Long timestamp; + } + + public static class ShellySettingsUpdate { + public String status; + @SerializedName("has_update") + public Boolean hasUpdate; + @SerializedName("new_version") + public String newVersion; + @SerializedName("old_version") + public String oldVersion; + } + + public static class ShellySettingsGlobal { + // https://shelly-api-docs.shelly.cloud/#shelly1pm-settings + public ShellySettingsDevice device; + @SerializedName("wifi_ap") + public ShellySettingsWiFiAp wifiAp; + @SerializedName("wifi_sta") + public ShellySettingsWiFiNetwork wifiSta; + @SerializedName("wifi_sta1") + public ShellySettingsWiFiNetwork wifiSta1; + // public ShellySettingsMqtt mqtt; // not used for now + // public ShellySettingsSntp sntp; // not used for now + public ShellySettingsLogin login; + @SerializedName("pin_code") + public String pinCode; + @SerializedName("coiot_execute_enable") + public Boolean coiotExecuteEnable; + public String name; + public String fw; + @SerializedName("build_info") + ShellySettingsBuildInfo buildInfo; + ShellyStatusCloud cloud; + public String timezone; + public Double lat; + public Double lng; + public Boolean tzautodetect; + public String time; + public ShellySettingsHwInfo hwinfo; + public String mode; + @SerializedName("max_power") + public Double maxPower; + + public ArrayList<ShellySettingsRelay> relays; + public ArrayList<ShellySettingsDimmer> dimmers; + public ArrayList<ShellySettingsEMeter> emeters; + public ArrayList<ShellyInputState> inputs; // Firmware 1.5.6+ + + @SerializedName("led_status_disable") + public Boolean ledStatusDisable; // PlugS only Disable LED indication for network + // status + @SerializedName("led_power_disable") + public Boolean ledPowerDisable; // PlugS only Disable LED indication for network + // status + @SerializedName("light_sensor") + public String lightSensor; // Sense: sensor type + @SerializedName("rain_sensor") + public Boolean rainSensor; // Flood: true=in rain mode + } + + public static final String SHELLY_API_MODE = "mode"; + public static final String SHELLY_MODE_RELAY = "relay"; // Relay: relay mode + public static final String SHELLY_MODE_ROLLER = "roller"; // Relay: roller mode + public static final String SHELLY_MODE_COLOR = "color"; // Bulb/RGBW2: color mode + public static final String SHELLY_MODE_WHITE = "white"; // Bulb/RGBW2: white mode + + public static final String SHELLY_LED_STATUS_DISABLE = "led_status_disable"; + public static final String SHELLY_LED_POWER_DISABLE = "led_power_disable"; + + public static class ShellySettingsAttributes { + @SerializedName("device_type") + public String deviceType; // Device model identifier + @SerializedName("device_mac") + public String deviceMac; // MAC address of the device in hexadecimal + @SerializedName("wifi_ap") + public String wifiAp; // WiFi access poInteger configuration, see /settings/ap for details + @SerializedName("wifi_sta") + public String wifiSta; // WiFi client configuration. See /settings/sta for details + public String login; // credentials used for HTTP Basic authentication for the REST interface. If + // enabled is + // true clients must include an Authorization: Basic ... HTTP header with valid + // credentials + // when performing TP requests. + public String name; // unique name of the device. + public String fw; // current FW version + } + + public static class ShellySettingsStatus { + @SerializedName("wifi_sta") + public ShellySettingsWiFiNetwork wifiSta; // WiFi client configuration. See /settings/sta for + // details + + public String time; + public Integer serial; + @SerializedName("has_update") + public Boolean hasUpdate; + public String mac; + public ArrayList<ShellySettingsRelay> relays; + public ArrayList<ShellySettingsRoller> rollers; + public ArrayList<ShellyInputState> inputs; + public ArrayList<ShellySettingsLight> lights; + public ArrayList<ShellyShortLightStatus> dimmers; + public ArrayList<ShellySettingsMeter> meters; + public ArrayList<ShellySettingsEMeter> emeters; + + public ShellyStatusSensor.ShellySensorTmp tmp; + public Boolean overtemperature; + + // Shelly Dimmer only + public Boolean loaderror; + public Boolean overload; + + public ShellySettingsUpdate update; + @SerializedName("ram_total") + public Long ramTotal; + @SerializedName("ram_free") + public Long ramFree; + @SerializedName("fs_size") + public Long fsSize; + @SerializedName("fs_free") + public Long fsFree; + public Long uptime; + + public String json; + } + + public static class ShellyControlRelay { + // https://shelly-api-docs.shelly.cloud/#shelly1-1pm-settings-relay-0 + @SerializedName("is_valid") + public Boolean isValid; + @SerializedName("has_timer") + public Boolean hasTimer; // Whether a timer is currently armed for this channel + public Boolean overpower; // Shelly1PM only if maximum allowed power was exceeded + + public String turn; // Accepted values are on and off. This will turn ON/OFF the respective output + // channel when request is sent . + public Integer timer; // A one-shot flip-back timer in seconds. + } + + public static class ShellyShortStatusRelay { + @SerializedName("is_valid") + public Boolean isValid; + public Boolean ison; // Whether output channel is on or off + @SerializedName("has_timer") + public Boolean hasTimer; // Whether a timer is currently armed for this channel + public Boolean overpower; // Shelly1PM only if maximum allowed power was exceeded + public Double temperature; // Internal device temperature + public Boolean overtemperature; // Device over heated + } + + public static class ShellyShortLightStatus { + public Boolean ison; // Whether output channel is on or off + public String mode; // color or white - valid only for Bulb and RGBW2 even Dimmer returns it also + public Integer brightness; // brightness: 0.100% + } + + public static class ShellyStatusRelay { + @SerializedName("wifi_sta") + public ShellySettingsWiFiNetwork wifiSta; // WiFi status + // public ShellyStatusCloud cloud; // Cloud status + // public ShellyStatusMqtt mqtt; // mqtt status + public String time; // current time + public Integer serial; + public String mac; // MAC + public ArrayList<ShellyShortStatusRelay> relays; // relay status + public ArrayList<ShellySettingsMeter> meters; // current meter value + + @SerializedName("has_update") + public Boolean hasUpdate; // If a newer firmware version is available + public ShellySettingsUpdate update; // /status/firmware value + + @SerializedName("ram_total") + public Integer ramTotal; // Total and available amount of system memory in bytes + @SerializedName("ram_free") + public Integer ramFree; + @SerializedName("fs_size") + public Integer fsSize; + @SerializedName("fs_free") + public Integer fsFree; // Total and available amount of file system space in bytes + public Integer uptime; // econds elapsed since boot + } + + public static class ShellyStatusDimmer { + @SerializedName("wifi_sta") + public ShellySettingsWiFiNetwork wifiSta; // WiFi status + // public ShellyStatusCloud cloud; // Cloud status + // public ShellyStatusMqtt mqtt; // mqtt status + public String time; // current time + public Integer serial; + public String mac; // MAC + public ArrayList<ShellyShortLightStatus> lights; // relay status + public ArrayList<ShellySettingsMeter> meters; // current meter value + + public ShellyStatusSensor.ShellySensorTmp tmp; + public Boolean overtemperature; + + public Boolean loaderror; + public Boolean overload; + + @SerializedName("has_update") + public Boolean hasUpdate; // If a newer firmware version is available + public ShellySettingsUpdate update; // /status/firmware value + + @SerializedName("ram_total") + public Integer ramTotal; // Total and available amount of system memory in + // bytes + @SerializedName("ram_free") + public Integer ramFree; + @SerializedName("fs_size") + public Integer fsSize; + @SerializedName("fs_free") + public Integer fsFree; // Total and available amount of file system space in + // bytes + public Integer uptime; // econds elapsed since boot + } + + public static class ShellyControlRoller { + @SerializedName("roller_pos") + public Integer rollerPos; // number Desired position in percent + public Integer duration; // If specified, the motor will move for this period in seconds. If missing, the + // value of + // maxtime in /settings/roller/N will be used. + public String state; // One of stop, open, close + public Double power; // Current power consumption in Watts + @SerializedName("is_valid") + public Boolean isValid; // If the power meter functions properly + @SerializedName("safety_switch") + public Boolean safetySwitch; // Whether the safety input is currently triggered + public Boolean overtemperature; + @SerializedName("stop_reason") + public String stopReason; // Last cause for stopping: normal, safety_switch, obstacle + @SerializedName("last_direction") + public String lastDirection; // Last direction of motion, open or close + public Boolean calibrating; + public Boolean positioning; // true when calibration was performed + @SerializedName("current_pos") + public Integer currentPos; // current position 0..100, 100=open + } + + public static final String SHELLY_STOPR_NORMAL = "normal"; + public static final String SHELLY_STOPR_SAFETYSW = "safety_switch"; + public static final String SHELLY_STOPR_OBSTACLE = "obstacle"; + + public static class ShellySettingsSensor { + @SerializedName("temperature_units") + public String temperatureUnits; // Either'C'or'F' + @SerializedName("temperature_threshold") + public Integer temperatureThreshold; // Temperature delta (in configured degree units) which triggers an update + @SerializedName("humidity_threshold") + public Integer humidityThreshold; // RH delta in % which triggers an update + @SerializedName("sleep_mode_period") + public Integer sleepModePeriod; // Periodic update period in hours, between 1 and 24 + @SerializedName("report_url") + public String reportUrl; // URL gets posted on updates with sensor data + } + + public static class ShellyStatusSensor { + // https://shelly-api-docs.shelly.cloud/#h-amp-t-settings + public static class ShellySensorTmp { + public Double value; // Temperature in configured unites + public String units; // 'C' or 'F' + public Double tC; // temperature in deg C + public Double tF; // temperature in deg F + @SerializedName("is_valid") + public Boolean isValid; // whether the internal sensor is operating properly + } + + public static class ShellySensorHum { + public Double value; // relative humidity in % + } + + public static class ShellySensorBat { + public Double value; // estimated remaining battery capacity in % + public Double voltage; // battery voltage + }; + + public static class ShellySensorLux { + @SerializedName("is_valid") + public Boolean isValid; // whether the internal sensor is operating properly + public Double value; + } + + public ShellySensorTmp tmp; + public ShellySensorHum hum; + public ShellySensorLux lux; + public ShellySensorBat bat; + + public Boolean flood; // Shelly Flood: true = flood condition detected + @SerializedName("rain_sensor") + public Boolean rainSensor; // Shelly Flood: true=in rain mode + + public Boolean motion; // Shelly Sense: true=motion detected + public Boolean charger; // Shelly Sense: true=charger connected + + // @SerializedName("act_reasons") + // public String[] actReasons; // HT/Smoke/Flood: list of reasons which woke up the device + } + + public static class ShellySettingsSmoke { + @SerializedName("temperature_units") + public String temperatureUnits; // Either 'C' or 'F' + @SerializedName("temperature_threshold") + public Integer temperatureThreshold; // Temperature delta (in configured degree units) which triggers an update + @SerializedName("sleep_mode_period") + public Integer sleepModePeriod; // Periodic update period in hours, between 1 and 24 + } + + public static final String SHELLY_TEMP_CELSIUS = "C"; + public static final String SHELLY_TEMP_FAHRENHEIT = "F"; + + public static class ShellySettingsLight { + public Integer red; // red brightness, 0..255, applies in mode="color" + public Integer green; // green brightness, 0..255, applies in mode="color" + public Integer blue; // blue brightness, 0..255, applies in mode="color" + public Integer white; // white brightness, 0..255, applies in mode="color" + public Integer gain; // gain for all channels, 0..100, applies in mode="color" + public Integer temp; // color temperature in K, 3000..6500, applies in mode="white" + public Integer brightness; // brightness, 0..100, applies in mode="white" + public Integer effect; // Currently applied effect, description: 0: Off, 1: Meteor Shower, 2: Gradual + // Change, 3: Breath, + // 4: Flash, 5: On/Off Gradual, 6: Red/Green Change + @SerializedName("default_state") + public String defaultState; // one of on, off or last + @SerializedName("auto_on") + public Double autoOn; // see above + @SerializedName("auto_off") + public Double autoOff; // see above + + public Integer dcpower; // RGW2:Set to true for 24 V power supply, false for 12 V + + // Shelly Dimmer + public String mode; + public Boolean ison; + } + + public static final int SHELLY_MIN_EFFECT = 0; + public static final int SHELLY_MAX_EFFECT = 6; + + public static class ShellyStatusLightChannel { + public Boolean ison; + public Double power; + public Boolean overpower; + @SerializedName("auto_on") + public Double autoOn; // see above + @SerializedName("auto_off") + public Double autoOff; // see above + + public Integer red; // red brightness, 0..255, applies in mode="color" + public Integer green; // green brightness, 0..255, applies in mode="color" + public Integer blue; // blue brightness, 0..255, applies in mode="color" + public Integer white; // white brightness, 0..255, applies in mode="color" + public Integer gain; // gain for all channels, 0..100, applies in mode="color" + public Integer temp; // color temperature in K, 3000..6500, applies in mode="white" + public Integer brightness; // brightness, 0..100, applies in mode="white" + public Integer effect; // Currently applied effect, description: 0: Off, 1: Meteor Shower, 2: Gradual + // Change, 3: Breath, + } + + public static class ShellyStatusLight { + public Boolean ison; // Whether output channel is on or off + public ArrayList<ShellyStatusLightChannel> lights; + public ArrayList<ShellySettingsMeter> meters; + + // not yet used: + // public String mode; // COLOR or WHITE + // public Integer input; + // public Boolean has_update; + // public ShellySettingsUpdate update; + // public ShellySettingsWiFiNetwork wifi_sta; // WiFi client configuration. See + // /settings/sta for details + // public ShellyStatusCloud cloud; + // public ShellyStatusMqtt mqtt; + } + + public static class ShellySenseKeyCode { + String id; // ID of the stored IR code into Shelly Sense. + String name; // Short description or name of the stored IR code. + } + + public static class ShellySendKeyList { + @SerializedName("key_codes") + public ArrayList<ShellySenseKeyCode> keyCodes; + } + + public static final String SHELLY_TIMER_AUTOON = "auto_on"; + public static final String SHELLY_TIMER_AUTOOFF = "auto_off"; + public static final String SHELLY_TIMER_ACTIVE = "has_timer"; + + public static final String SHELLY_LIGHT_TURN = "turn"; + public static final String SHELLY_LIGHT_DEFSTATE = "def_state"; + public static final String SHELLY_LIGHTTIMER = "timer"; + + public static final String SHELLY_COLOR_RED = "red"; + public static final String SHELLY_COLOR_BLUE = "blue"; + public static final String SHELLY_COLOR_GREEN = "green"; + public static final String SHELLY_COLOR_YELLOW = "yellow"; + public static final String SHELLY_COLOR_WHITE = "white"; + public static final String SHELLY_COLOR_GAIN = "gain"; + public static final String SHELLY_COLOR_BRIGHTNESS = "brightness"; + public static final String SHELLY_COLOR_TEMP = "temp"; + public static final String SHELLY_COLOR_EFFECT = "effect"; + + public static final int SHELLY_MIN_ROLLER_POS = 0; + public static final int SHELLY_MAX_ROLLER_POS = 100; + public static final int SHELLY_MIN_BRIGHTNESS = 0; + public static final int SHELLY_MAX_BRIGHTNESS = 100; + public static final int SHELLY_MIN_GAIN = 0; + public static final int SHELLY_MAX_GAIN = 100; + public static final int SHELLY_MIN_COLOR = 0; + public static final int SHELLY_MAX_COLOR = 255; + public static final int SHELLY_DIM_STEPSIZE = 10; + + // color temperature: 3000 = warm, 4750 = white, 6565 = cold; gain: 0..100 + public static final int MIN_COLOR_TEMPERATURE = 3000; + public static final int MAX_COLOR_TEMPERATURE = 6500; + public static final int COLOR_TEMPERATURE_RANGE = MAX_COLOR_TEMPERATURE - MIN_COLOR_TEMPERATURE; + public static final double MIN_BRIGHTNESS = 0.0; + public static final double MAX_BRIGHTNESS = 100.0; + public static final double SATURATION_FACTOR = 2.55; + public static final double GAIN_FACTOR = SHELLY_MAX_GAIN / 100; + public static final double BRIGHTNESS_FACTOR = SHELLY_MAX_BRIGHTNESS / 100; + + /** + * Shelly Dimmer returns light[]. However, the structure doesn't match the lights[] of a Bulb/RGBW2. + * The tag lights[] will be replaced with dimmers[] so this could be mapped to a different Gson structure. + * The function requires that it's only called when the device is a dimmer - on get settings and get status + * + * @param json Input Json as received by the API + * @return Modified Json + */ + public static String fixDimmerJson(String json) { + // + // + return !json.contains("\"lights\":[") ? json + : json.replaceFirst(java.util.regex.Pattern.quote("\"lights\":["), "\"dimmers\":["); + } + +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java new file mode 100644 index 0000000000000..18bdfb7b073c4 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java @@ -0,0 +1,157 @@ +/** + * 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.shelly.internal.api; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.SHELLYDT_DIMMER; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.shelly.internal.ShellyBindingConstants; +import org.openhab.binding.shelly.internal.ShellyUtils; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsGlobal; + +import com.google.gson.Gson; + +/** + * The {@link ShellyDeviceProfile} creates a device profile based on the settings returned from the API's /settings + * call. This is used to be more dynamic in controlling the device, but also to overcome some issues in the API (e.g. + * RGBW2 returns "no meter" even it has one) + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyDeviceProfile { + public String thingName = ""; + public String deviceType = ""; + + public String settingsJson = ""; + public @Nullable ShellySettingsGlobal settings; + + public String hostname = ""; + public String mode = ""; + + public String hwRev = ""; + public String hwBatchId = ""; + public String mac = ""; + public String fwId = ""; + public String fwVersion = ""; + public String fwDate = ""; + + public Boolean hasRelays = false; // true if it has at least 1 power meter + public Integer numRelays = 0; // number of relays/outputs + public Integer numRollers = 9; // number of Rollers, usually 1 + public Boolean isRoller = false; // true for Shelly2 in roller mode + public Boolean isDimmer = false; // true for a Shelly Dimmer (SHDM-1) + + public Boolean hasMeter = false; // true if it has at least 1 power meter + public Integer numMeters = 0; + public Boolean isEMeter = false; // true for ShellyEM + + public Boolean hasBattery = false; // true if battery device + public Boolean hasLed = false; // true if battery device + public Boolean isPlugS = false; // true if it is a Shelly Plug S + public Boolean isLight = false; // true if it is a Shelly Bulb/RGBW2 + public Boolean isBulb = false; // true pnly if it is a Bulb + public Boolean isSense = false; // true if thing is a Shelly Sense + public Boolean inColor = false; // true if bulb/rgbw2 is in color mode + public Boolean isSensor = false; // true for HT & Smoke + public Boolean isSmoke = false; // true for Smoke + + public Map<String, String> irCodes = new HashMap<String, String>(); // Sense: list of stored IR codes + + public Boolean supportsButtonUrls = false; // true if the btn_xxx urls are supported + public Boolean supportsOutUrls = false; // true if the out_xxx urls are supported + public Boolean supportsPushUrls = false; // true if sensor report_url is supported + public Boolean supportsRollerUrls = false; // true if the roller_xxx urls are supported + public Boolean supportsSensorUrls = false; // true if sensor report_url is supported + + @SuppressWarnings("null") + public static ShellyDeviceProfile initialize(String thingType, String json) { + Gson gson = new Gson(); + + ShellyDeviceProfile profile = new ShellyDeviceProfile(); + Validate.notNull(profile); + + profile.settingsJson = json; + profile.settings = gson.fromJson(json, ShellySettingsGlobal.class); + Validate.notNull(profile.settings, "converted device settings must not be null!"); + + // General settings + profile.deviceType = ShellyUtils.getString(profile.settings.device.type); + profile.mac = getString(profile.settings.device.mac); + profile.hostname = profile.settings.device.hostname != null && !profile.settings.device.hostname.isEmpty() + ? profile.settings.device.hostname.toLowerCase() + : "shelly-" + profile.mac.toUpperCase().substring(6, 11); + profile.mode = getString(profile.settings.mode) != null ? getString(profile.settings.mode).toLowerCase() : ""; + profile.hwRev = profile.settings.hwinfo != null ? getString(profile.settings.hwinfo.hwRevision) : ""; + profile.hwBatchId = profile.settings.hwinfo != null ? getString(profile.settings.hwinfo.batchId.toString()) + : ""; + profile.fwDate = getString(StringUtils.substringBefore(profile.settings.fw, "/")); + profile.fwVersion = getString(StringUtils.substringBetween(profile.settings.fw, "/", "@")); + profile.fwId = getString(StringUtils.substringAfter(profile.settings.fw, "@")); + + profile.isRoller = profile.mode.equalsIgnoreCase(SHELLY_MODE_ROLLER); + profile.isPlugS = thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYPLUGS.getId()); + profile.hasLed = profile.isPlugS; + profile.isBulb = thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYBULB.getId()); + profile.isDimmer = profile.deviceType.equalsIgnoreCase(SHELLYDT_DIMMER); + profile.isLight = profile.isBulb + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYRGBW2_COLOR.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYRGBW2_WHITE.getId()); + profile.inColor = profile.isLight && profile.mode.equalsIgnoreCase(SHELLY_MODE_COLOR); + + profile.isSmoke = thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYSMOKE.getId()); + profile.isSense = thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYSENSE.getId()); + profile.isSensor = profile.isSense || profile.isSmoke + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYHT.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYFLOOD.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYSENSE.getId()); + profile.hasBattery = thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYHT.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYSMOKE.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYFLOOD.getId()) + || thingType.equalsIgnoreCase(ShellyBindingConstants.THING_TYPE_SHELLYSENSE.getId()); + + profile.numRelays = !profile.isLight ? getInteger(profile.settings.device.numOutputs) : 0; + if ((profile.numRelays > 0) && (profile.settings.relays == null)) { + profile.numRelays = 0; + } + profile.hasRelays = (profile.numRelays > 0) || profile.isDimmer; + profile.numRollers = getInteger(profile.settings.device.numRollers); + + profile.isEMeter = profile.settings.emeters != null; + profile.numMeters = !profile.isEMeter ? getInteger(profile.settings.device.numMeters) + : getInteger(profile.settings.device.numEMeters); + if ((profile.numMeters == 0) && profile.isLight) { + // RGBW2 doesn't report, but has one + profile.numMeters = profile.inColor ? 1 : getInteger(profile.settings.device.numOutputs); + } + profile.hasMeter = (profile.numMeters > 0); + + profile.supportsButtonUrls = profile.settingsJson.contains(SHELLY_API_EVENTURL_BTN_ON) + || profile.settingsJson.contains(SHELLY_API_EVENTURL_BTN1_ON) + || profile.settingsJson.contains(SHELLY_API_EVENTURL_BTN2_ON); + profile.supportsOutUrls = profile.settingsJson.contains(SHELLY_API_EVENTURL_OUT_ON); + profile.supportsPushUrls = profile.settingsJson.contains(SHELLY_API_EVENTURL_SHORT_PUSH); + profile.supportsRollerUrls = profile.settingsJson.contains(SHELLY_API_EVENTURL_ROLLER_OPEN); + profile.supportsSensorUrls = profile.settingsJson.contains(SHELLY_API_EVENTURL_REPORT); + + return profile; + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyEventServlet.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyEventServlet.java new file mode 100644 index 0000000000000..ca79f8e14f70b --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyEventServlet.java @@ -0,0 +1,164 @@ +/** + * 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.shelly.internal.api; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.shelly.internal.ShellyHandlerFactory; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.ConfigurationPolicy; +import org.osgi.service.component.annotations.Deactivate; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.osgi.service.http.HttpService; +import org.osgi.service.http.NamespaceException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link ShellyEventServlet} implements a servlet. which is called by the Shelly device to signnal events (button, + * relay output, sensor data). The binding automatically sets those vent urls on startup (when not disabled in the thing + * config). + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +@Component(service = HttpServlet.class, configurationPolicy = ConfigurationPolicy.OPTIONAL, immediate = true) +public class ShellyEventServlet extends HttpServlet { + private static final long serialVersionUID = 549582869577534569L; + private final Logger logger = LoggerFactory.getLogger(ShellyEventServlet.class); + + private @Nullable HttpService httpService; + private @Nullable ShellyHandlerFactory handlerFactory; + + @SuppressWarnings("null") + @Activate + protected void activate(Map<String, Object> config) { + try { + httpService.registerServlet(SHELLY_CALLBACK_URI, this, null, httpService.createDefaultHttpContext()); + logger.debug("Shelly: CallbackServlet started at '{}'", SHELLY_CALLBACK_URI); + } catch (NamespaceException | ServletException e) { + logger.warn("Shelly: Could not start CallbackServlet: {} ({})", e.getMessage(), e.getClass()); + } + } + + @Deactivate + @SuppressWarnings("null") + protected void deactivate() { + if (httpService != null) { + httpService.unregister(SHELLY_CALLBACK_URI); + } + logger.debug("Shelly: CallbackServlet stopped"); + } + + @SuppressWarnings("null") + @Override + protected void service(@Nullable HttpServletRequest request, @Nullable HttpServletResponse resp) + throws ServletException, IOException { + String data = inputStreamToString(request); + String path = request.getRequestURI().toLowerCase(); + String deviceName = ""; + String index = ""; + String type = ""; + + try { + String ipAddress = request.getHeader("HTTP_X_FORWARDED_FOR"); + if (ipAddress == null) { + ipAddress = request.getRemoteAddr(); + } + Map<String, String[]> parameters = request.getParameterMap(); + logger.debug("CallbackServlet: {} Request from {}:{}{}?{}", request.getProtocol(), ipAddress, + request.getRemotePort(), path, parameters.toString()); + if (!path.toLowerCase().startsWith(SHELLY_CALLBACK_URI) || !path.contains("/event/shelly")) { + logger.warn("CallbackServlet received unknown request: path = {}, data={}", path, data); + return; + } + + // URL looks like + // <ip address>:<remote port>/shelly/event/shellyrelay-XXXXXX/relay/n?xxxxx or + // <ip address>:<remote port>/shelly/event/shellyrelay-XXXXXX/roller/n?xxxxx or + // <ip address>:<remote port>/shelly/event/shellyht-XXXXXX/sensordata?hum=53,temp=26.50 + deviceName = StringUtils.substringBetween(path, "/event/", "/").toLowerCase(); + if (path.contains("/" + EVENT_TYPE_RELAY + "/") || path.contains("/" + EVENT_TYPE_ROLLER + "/") + || path.contains("/" + EVENT_TYPE_LIGHT + "/")) { + index = StringUtils.substringAfterLast(path, "/").toLowerCase(); + type = StringUtils.substringBetween(path, deviceName + "/", "/" + index); + } else { + index = ""; + type = StringUtils.substringAfterLast(path, "/").toLowerCase(); + } + logger.trace("Process event of type type={} for device {}, index={}", type, deviceName, index); + Map<String, String> parms = new HashMap<String, String>(); + for (Map.Entry<String, String[]> p : parameters.entrySet()) { + parms.put(p.getKey(), p.getValue()[0]); + + } + handlerFactory.onEvent(deviceName, index, type, parms); + + } catch (NullPointerException e) { + logger.debug( + "ERROR: Exception processing callback: {} ({}), path={}, data='{}'; deviceName={}, index={}, type={}, parameters={}\n{}", + e.getMessage(), e.getClass(), path, data, deviceName, index, type, + request.getParameterMap().toString(), e.getStackTrace()); + } finally { + resp.setCharacterEncoding(StandardCharsets.UTF_8.toString()); + resp.getWriter().write(""); + } + } + + @SuppressWarnings("resource") + private String inputStreamToString(@Nullable HttpServletRequest request) throws IOException { + @SuppressWarnings("null") + Scanner scanner = new Scanner(request.getInputStream()).useDelimiter("\\A"); + return scanner.hasNext() ? scanner.next() : ""; + } + + @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC) + public void setShellyHandlerFactory(ShellyHandlerFactory handlerFactory) { + this.handlerFactory = handlerFactory; + logger.debug("Shelly Binding: HandlerFactory bound"); + } + + public void unsetShellyHandlerFactory(ShellyHandlerFactory handlerFactory) { + this.handlerFactory = null; + logger.debug("Shelly Binding: HandlerFactory unbound"); + } + + @Reference + public void setHttpService(HttpService httpService) { + this.httpService = httpService; + logger.debug("Shelly Binding: httpService bound"); + } + + public void unsetHttpService(HttpService httpService) { + this.httpService = null; + logger.debug("Shelly Binding: httpService unbound"); + } + +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java new file mode 100644 index 0000000000000..b57b923ca8ae5 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyHttpApi.java @@ -0,0 +1,498 @@ +/** + * 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.shelly.internal.api; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.io.IOException; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import javax.ws.rs.HttpMethod; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyControlRoller; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySendKeyList; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySenseKeyCode; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsDevice; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsLight; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyShortLightStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusLight; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusRelay; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusSensor; +import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; + +/** + * {@link ShellyHttpApi} wraps the Shelly REST API and provides various low level function to access the device api (not + * cloud api). + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyHttpApi { + private final Logger logger = LoggerFactory.getLogger(ShellyHttpApi.class); + private final ShellyThingConfiguration config; + private final String thingName = ""; + private Gson gson = new Gson(); + + private @Nullable ShellyDeviceProfile profile; + + public ShellyHttpApi(ShellyThingConfiguration config) { + Validate.notNull(config, "Shelly Http Api: Config must not be null!"); + this.config = config; + } + + @Nullable + public ShellySettingsDevice getDevInfo() throws IOException { + String json = request(SHELLY_URL_DEVINFO); + logger.debug("Shelly device info : {}", json); + return gson.fromJson(json, ShellySettingsDevice.class); + } + + /** + * Initialize the device profile + * + * @param thingType Type of DEVICE as returned from the thing properties (based on discovery) + * @return Initialized ShellyDeviceProfile + * @throws IOException + */ + @SuppressWarnings("null") + @Nullable + public ShellyDeviceProfile getDeviceProfile(String thingType) throws IOException { + String json = request(SHELLY_URL_SETTINGS); + if (json.contains("\"type\":\"SHDM-1\"")) { + logger.trace("Detected a Shelly Dimmer: fix Json (replace lights[] tag with dimmers[]"); + json = fixDimmerJson(json); + } + + // Map settings to device profile for Light and Sense + profile = ShellyDeviceProfile.initialize(thingType, json); + Validate.notNull(profile); + + // 2nd level initialization + profile.thingName = profile.hostname; + if (profile.isLight && (profile.numMeters == 0)) { + logger.debug("Get number of meters from light status"); + ShellyStatusLight status = getLightStatus(); + profile.numMeters = status.meters != null ? status.meters.size() : 0; + } + if (profile.isSense) { + profile.irCodes = getIRCodeList(); + logger.debug("{}: Sense stored key list loaded, {} entries.", thingName, profile.irCodes.size()); + } + + return profile; + } + + /** + * Get generic device settings/status. Json returned from API will be mapped to a Gson object + * + * @return Device settings/status as ShellySettingsStatus object + * @throws IOException + */ + @SuppressWarnings("null") + public ShellySettingsStatus getStatus() throws IOException { + String json = request(SHELLY_URL_STATUS); + ShellySettingsStatus status = gson.fromJson(json, ShellySettingsStatus.class); + Validate.notNull(status); + status.json = json; + return status; + } + + @Nullable + public ShellyStatusRelay getRelayStatus(Integer relayIndex) throws IOException { + String result = request(SHELLY_URL_STATUS_RELEAY + "/" + relayIndex.toString()); + return gson.fromJson(result, ShellyStatusRelay.class); + } + + @SuppressWarnings("null") + public void setRelayTurn(Integer relayIndex, String turnMode) throws IOException { + Validate.notNull(profile); + request((!profile.isDimmer ? SHELLY_URL_CONTROL_RELEAY : SHELLY_URL_CONTROL_LIGHT) + "/" + relayIndex.toString() + + "?" + SHELLY_LIGHT_TURN + "=" + turnMode.toLowerCase()); + } + + public void setDimmerBrightness(Integer relayIndex, Integer brightness) throws IOException { + request(SHELLY_URL_CONTROL_LIGHT + "/" + relayIndex.toString() + "?" + SHELLY_LIGHT_TURN + "=" + SHELLY_API_ON + + "&brightness=" + brightness.toString()); + } + + @Nullable + public ShellyControlRoller getRollerStatus(Integer rollerIndex) throws IOException { + String result = request(SHELLY_URL_CONTROL_ROLLER + "/" + rollerIndex.toString() + "/pos"); + return gson.fromJson(result, ShellyControlRoller.class); + } + + public void setRollerTurn(Integer relayIndex, String turnMode) throws IOException { + request(SHELLY_URL_CONTROL_ROLLER + "/" + relayIndex.toString() + "?go=" + turnMode); + } + + public void setRollerPos(Integer relayIndex, Integer position) throws IOException { + request(SHELLY_URL_CONTROL_ROLLER + "/" + relayIndex.toString() + "?go=to_pos&roller_pos=" + + position.toString()); + } + + public void setRollerTimer(Integer relayIndex, Integer timer) throws IOException { + request(SHELLY_URL_CONTROL_ROLLER + "/" + relayIndex.toString() + "?timer=" + timer.toString()); + } + + @Nullable + public ShellyShortLightStatus getLightStatus(Integer index) throws IOException { + String result = request(SHELLY_URL_STATUS_LIGHT + "/" + index.toString()); + return gson.fromJson(result, ShellyShortLightStatus.class); + } + + @SuppressWarnings("null") + public ShellyStatusSensor getSensorStatus() throws IOException { + Validate.notNull(profile); + ShellyStatusSensor status = gson.fromJson(request(SHELLY_URL_STATUS), ShellyStatusSensor.class); + if (profile.isSense) { + // complete reported data + status.tmp.tC = status.tmp.units.equals(SHELLY_TEMP_CELSIUS) ? status.tmp.value : 0; + status.tmp.tF = status.tmp.units.equals(SHELLY_TEMP_FAHRENHEIT) ? status.tmp.value : 0; + } + return status; + } + + @SuppressWarnings("null") + public void setTimer(Integer index, String timerName, Double value) throws IOException { + Validate.notNull(profile); + String type = SHELLY_CLASS_RELAY; + if (profile.isRoller) { + type = SHELLY_CLASS_ROLLER; + } else if (profile.isLight) { + type = SHELLY_CLASS_LIGHT; + } + String uri = SHELLY_URL_SETTINGS + "/" + type + "/" + index + "?" + timerName + "=" + + ((Integer) value.intValue()).toString(); + request(uri); + } + + public void setLedStatus(String ledName, Boolean value) throws IOException { + request(SHELLY_URL_SETTINGS + "?" + ledName + "=" + (value ? SHELLY_API_TRUE : SHELLY_API_FALSE)); + } + + @Nullable + public ShellySettingsLight getLightSettings() throws IOException { + String result = request(SHELLY_URL_SETTINGS_LIGHT); + return gson.fromJson(result, ShellySettingsLight.class); + } + + @Nullable + public ShellyStatusLight getLightStatus() throws IOException { + String result = request(SHELLY_URL_STATUS); + return gson.fromJson(result, ShellyStatusLight.class); + } + + public void setLightSetting(String parm, String value) throws IOException { + request(SHELLY_URL_SETTINGS + "?" + parm + "=" + value); + } + + /** + * Change between White and Color Mode + * + * @param mode + * @throws IOException + */ + @SuppressWarnings("null") + public void setLightMode(String mode) throws IOException { + if (!mode.isEmpty() && !profile.mode.equals(mode)) { + setLightSetting(SHELLY_API_MODE, mode); + profile.mode = mode; + profile.inColor = profile.isLight && profile.mode.equalsIgnoreCase(SHELLY_MODE_COLOR); + } + } + + /** + * Set a single light parameter + * + * @param lightIndex Index of the light, usually 0 for Bulb and 0..3 for RGBW2. + * @param parm Name of the parameter (see API spec) + * @param value The value + * @throws IOException + */ + @SuppressWarnings("null") + public void setLightParm(Integer lightIndex, String parm, String value) throws IOException { + // Bulb, RGW2: /<color mode>/<light id>?parm?value + // Dimmer: /light/<light id>?parm=value + Validate.notNull(profile); + request((!profile.isDimmer ? "/" + profile.mode : SHELLY_URL_CONTROL_LIGHT) + "/" + lightIndex.toString() + "?" + + parm + "=" + value); + } + + public void setLightParms(Integer lightIndex, Map<String, String> parameters) throws IOException { + Validate.notNull(profile); + @SuppressWarnings("null") + String url = (!profile.isDimmer ? "/" + profile.mode : SHELLY_URL_CONTROL_LIGHT) + "/" + lightIndex.toString() + + "?"; + int i = 0; + for (String key : parameters.keySet()) { + if (i > 0) { + url = url + "&"; + } + url = url + key + "=" + parameters.get(key); + i++; + } + request(url); + } + + /** + * Retrieve the IR Code list from the Shelly Sense device. The list could be customized by the user. It defines the + * symbolic key code, which gets + * map into a PRONTO code + * + * @return Map of key codes + * @throws IOException + */ + @SuppressWarnings("null") + public Map<String, String> getIRCodeList() throws IOException { + String result = request(SHELLY_URL_LIST_IR); + + /* + * A string like this is returned with all key codes defined in the device (customizable with the App): + * String result = + * "[[\"1_231_pwr\",\"tv(231) - Power\"],[\"1_231_chdwn\",\"tv(231) - Channel Down\"],[\"1_231_chup\", + * \"tv(231) - Channel Up\"], [\"1_231_voldwn\",\"tv(231) - Volume Down\"],[\"1_231_volup\",\"tv(231) - Volume Up\"],[\"1_231_mute\" + * , + * \"tv(231) - Mute\"],[\"1_231_menu\",\"tv(231) - Menu\"],[\"1_231_inp\",\"tv(231) - Input\"],[\"1_231_info\",\"tv(231) - Info\" + * ], + * [\"1_231_left\",\"tv(231) - Left\"],[\"1_231_up\",\"tv(231) - Up\"],[\"1_231_right\",\"tv(231) - Right\"],[\"1_231_ok\" + * ,\ + * "tv(231) - OK\"],[\"1_231_down\",\"tv(231) - Down\"],[\"1_231_back\",\"tv(231) - Back\"],[\"6_546_pwr\",\"receiver(546) - Power\" + * ], + * [\"6_546_voldwn\",\"receiver(546) - Volume Down\"],[\"6_546_volup\",\"receiver(546) - Volume Up\"],[\"6_546_mute\" + * , + * \"receiver(546) - Mute\"],[\"6_546_menu\",\"receiver(546) - Menu\"],[\"6_546_info\",\"receiver(546) - Info\"],[\"6_546_left\" + * , + * \"receiver(546) - Left\"],[\"6_546_up\",\"receiver(546) - Up\"],[\"6_546_right\",\"receiver(546) - Right\"],[\"6_546_ok\" + * , + * \"receiver(546) - OK\"],[\"6_546_down\",\"receiver(546) - Down\"],[\"6_546_back\",\"receiver(546) - Back\"]]" + * ; + */ + + // take pragmatic approach to make the returned JSon into named arrays, otherwise we need to implement a + // dedicated GSonParser + String keyList = StringUtils.substringAfter(result, "["); + keyList = StringUtils.substringBeforeLast(keyList, "]"); + keyList = keyList.replaceAll(java.util.regex.Pattern.quote("\",\""), "\", \"name\": \""); + keyList = keyList.replaceAll(java.util.regex.Pattern.quote("["), "{ \"id\":"); + keyList = keyList.replaceAll(java.util.regex.Pattern.quote("]"), "} "); + String json = "{\"key_codes\" : [" + keyList + "] }"; + + ShellySendKeyList codes = gson.fromJson(json, ShellySendKeyList.class); + Map<String, String> list = new HashMap<String, String>(); + for (ShellySenseKeyCode key : codes.keyCodes) { + list.put(key.id, key.name); + } + return list; + } + + /** + * Sends a IR key code to the Shelly Sense. + * + * @param keyCode A keyCoud could be a symbolic name (as defined in the key map on the device) or a PRONTO Code in + * plain or hex64 format + * + * @throws IOException + * @throws IllegalArgumentException + */ + @SuppressWarnings("null") + public void sendIRKey(String keyCode) throws IOException, IllegalArgumentException { + Validate.notNull(profile); + String type = ""; + if (profile.irCodes.containsKey(keyCode)) { + type = SHELLY_IR_CODET_STORED; + } else if ((keyCode.length() > 4) && keyCode.contains(" ")) { + type = SHELLY_IR_CODET_PRONTO; + } else { + type = SHELLY_IR_CODET_PRONTO_HEX; + } + String url = SHELLY_URL_SEND_IR + "?type=" + type; + if (type.equals(SHELLY_IR_CODET_STORED)) { + url = url + "&" + "id=" + keyCode; + } else if (type.equals(SHELLY_IR_CODET_PRONTO)) { + String code = Base64.getEncoder().encodeToString(keyCode.getBytes()); + Validate.notNull(code, "Unable to BASE64 encode the pronto code: " + keyCode); + url = url + "&" + SHELLY_IR_CODET_PRONTO + "=" + code; + } else if (type.equals(SHELLY_IR_CODET_PRONTO_HEX)) { + url = url + "&" + SHELLY_IR_CODET_PRONTO_HEX + "=" + keyCode; + } + request(url); + } + + public void setSenseSetting(String setting, String value) throws IOException { + request(SHELLY_URL_SETTINGS + "?" + setting + "=" + value); + } + + /** + * Set event callback URLs. Depending on the device different event types are supported. In fact all of them will be + * redirected to the binding's + * servlet and act as a trigger to schedule a status update + * + * @param deviceName + * @throws IOException + */ + public void setEventURLs() throws IOException { + setRelayEvents(); + setDimmerEvents(); + setSensorEventUrls(); + } + + @SuppressWarnings("null") + private void setRelayEvents() throws IOException { + Validate.notNull(profile); + if (profile.settings.relays != null) { + int num = profile.isRoller ? profile.numRollers : profile.numRelays; + for (int i = 0; i < num; i++) { + setEventUrls(i); + } + } + } + + @SuppressWarnings("null") + private void setDimmerEvents() throws IOException { + Validate.notNull(profile); + if (profile.settings.dimmers != null) { + for (int i = 0; i < profile.settings.dimmers.size(); i++) { + setEventUrls(i); + } + } + } + + /** + * Set event URL for HT (report_url) + * + * @param deviceName + * @throws IOException + */ + @SuppressWarnings("null") + private void setSensorEventUrls() throws IOException { + Validate.notNull(profile); + if (profile.supportsSensorUrls && config.eventsSensorReport) { + logger.debug("Check/set Sensor Reporting URL"); + String eventUrl = "http://" + config.localIp + ":" + config.httpPort.toString() + SHELLY_CALLBACK_URI + "/" + + profile.thingName + "/" + EVENT_TYPE_SENSORDATA; + request(SHELLY_URL_SETTINGS + "?" + SHELLY_API_EVENTURL_REPORT + "=" + urlEncode(eventUrl)); + } + } + + @SuppressWarnings("null") + private void setEventUrls(Integer index) throws IOException { + Validate.notNull(profile); + String lip = config.localIp; + String localPort = config.httpPort.toString(); + String deviceName = profile.thingName; + if (profile.isRoller) { + if (profile.supportsRollerUrls) { + logger.debug("Set Roller event urls"); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_ROLLER, + SHELLY_API_EVENTURL_ROLLER_OPEN)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_ROLLER, + SHELLY_API_EVENTURL_ROLLER_CLOSE)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_ROLLER, + SHELLY_API_EVENTURL_ROLLER_STOP)); + } + } else { + if (profile.supportsButtonUrls && config.eventsButton) { + if (profile.settingsJson.contains(SHELLY_API_EVENTURL_BTN1_ON)) { + // 2 set of URLs, e.g. Dimmer + logger.debug("Set Dimmer event urls"); + + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_LIGHT, + SHELLY_API_EVENTURL_BTN1_ON)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_LIGHT, + SHELLY_API_EVENTURL_BTN1_OFF)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_LIGHT, + SHELLY_API_EVENTURL_BTN2_ON)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_LIGHT, + SHELLY_API_EVENTURL_BTN2_OFF)); + } else { + // Standard relays: btn_xxx URLs + logger.debug("Set Relay event urls"); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_RELAY, + SHELLY_API_EVENTURL_BTN_ON)); + request(buildSetEventUrl(lip, localPort, deviceName, index, EVENT_TYPE_RELAY, + SHELLY_API_EVENTURL_BTN_OFF)); + } + } + if (profile.supportsOutUrls && config.eventsSwitch) { + request(buildSetEventUrl(lip, localPort, deviceName, index, + profile.isDimmer ? EVENT_TYPE_LIGHT : EVENT_TYPE_RELAY, SHELLY_API_EVENTURL_OUT_ON)); + request(buildSetEventUrl(lip, localPort, deviceName, index, + profile.isDimmer ? EVENT_TYPE_LIGHT : EVENT_TYPE_RELAY, SHELLY_API_EVENTURL_OUT_OFF)); + } + if (profile.supportsPushUrls && config.eventsPush) { + request(buildSetEventUrl(lip, localPort, deviceName, index, + profile.isDimmer ? EVENT_TYPE_LIGHT : EVENT_TYPE_RELAY, SHELLY_API_EVENTURL_SHORT_PUSH)); + request(buildSetEventUrl(lip, localPort, deviceName, index, + profile.isDimmer ? EVENT_TYPE_LIGHT : EVENT_TYPE_RELAY, SHELLY_API_EVENTURL_LONG_PUSH)); + } + } + } + + /** + * Submit GET request and return response, check for invalid responses + * + * @param uri: URI (e.g. "/settings") + */ + private String request(String uri) throws IOException { + String httpResponse = "ERROR"; + String url = "http://" + config.deviceIp + uri; + // boolean acquired = false; + try { + logger.trace("HTTP GET for {}: {}", thingName, url); + + Properties headers = new Properties(); + if (!config.userId.isEmpty()) { + String value = config.userId + ":" + config.password; + headers.put(HTTP_HEADER_AUTH, + HTTP_AUTH_TYPE_BASIC + " " + Base64.getEncoder().encodeToString(value.getBytes())); + } + + httpResponse = HttpUtil.executeUrl(HttpMethod.GET, url, headers, null, "", SHELLY_API_TIMEOUT_MS); + Validate.notNull(httpResponse, "httpResponse must not be null"); + // all api responses are returning the result in Json format. If we are getting + // something else it must + // be an error message, e.g. http result code + if (httpResponse.contains(APIERR_HTTP_401_UNAUTHORIZED)) { + throw new IOException( + APIERR_HTTP_401_UNAUTHORIZED + ", set/correct userid and password in the thing/binding config"); + } + if (!httpResponse.startsWith("{") && !httpResponse.startsWith("[")) { + throw new IOException("Unexpected http response: " + httpResponse); + } + + logger.trace("HTTP response from {}: {}", thingName, httpResponse); + return httpResponse; + } catch (IOException e) { + if (e.getMessage().contains("Timeout")) { + throw new IOException("Shelly API call failed: Timeout (" + SHELLY_API_TIMEOUT_MS + " ms)"); + } else { + throw new IOException("Shelly API call failed: " + e.getMessage() + ", url=" + url); + } + } + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapHandler.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapHandler.java new file mode 100644 index 0000000000000..aaf2d973421e3 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapHandler.java @@ -0,0 +1,740 @@ +/** + * 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.shelly.internal.coap; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; +import static org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.Validate; +import org.eclipse.californium.core.CoapClient; +import org.eclipse.californium.core.coap.CoAP.Code; +import org.eclipse.californium.core.coap.CoAP.ResponseCode; +import org.eclipse.californium.core.coap.CoAP.Type; +import org.eclipse.californium.core.coap.MessageObserverAdapter; +import org.eclipse.californium.core.coap.Option; +import org.eclipse.californium.core.coap.OptionNumberRegistry; +import org.eclipse.californium.core.coap.Request; +import org.eclipse.californium.core.coap.Response; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotDescrBlk; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotDescrSen; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotDevDescription; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotGenericSensorList; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotSensor; +import org.openhab.binding.shelly.internal.coap.ShellyCoapJSon.CoIotSensorTypeAdapter; +import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration; +import org.openhab.binding.shelly.internal.handler.ShellyBaseHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * The {@link ShellyCoapHandler} handles the CoIoT/Coap registration and events. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyCoapHandler implements ShellyCoapListener { + private final Logger logger = LoggerFactory.getLogger(ShellyCoapHandler.class); + + private final ShellyBaseHandler thingHandler; + private final ShellyThingConfiguration config; + private final GsonBuilder gsonBuilder; + private final Gson gson; + private String thingName; + + private @Nullable ShellyCoapServer coapServer; + private @Nullable CoapClient statusClient; + private @Nullable Request reqDescription; + private @Nullable Request reqStatus; + + private int lastSerial = -1; + private String lastPayload = ""; + private Map<String, CoIotDescrBlk> blockMap = new HashMap<String, CoIotDescrBlk>(); + private Map<String, CoIotDescrSen> sensorMap = new HashMap<String, CoIotDescrSen>(); + + public ShellyCoapHandler(ShellyThingConfiguration config, ShellyBaseHandler thingHandler, + @Nullable ShellyCoapServer coapServer) { + Validate.notNull(coapServer); + this.thingHandler = thingHandler; + this.coapServer = coapServer; + this.config = config; + this.thingName = thingHandler.thingName; + + gsonBuilder = new GsonBuilder(); + gsonBuilder.registerTypeAdapter(CoIotGenericSensorList.class, new CoIotSensorTypeAdapter()); + gsonBuilder.setPrettyPrinting(); + gson = gsonBuilder.create(); + } + + /* + * Initialize Coap access, send discovery packet and start Status server + */ + @SuppressWarnings("null") + public void start() { + try { + reqDescription = sendRequest(reqDescription, config.deviceIp, COLOIT_URI_DEVDESC, Type.CON); + + if (statusClient == null) { + coapServer.init(config.localIp); + coapServer.addListener(this); + + statusClient = new CoapClient(completeUrl(config.deviceIp, COLOIT_URI_DEVSTATUS)) + .setTimeout((long) SHELLY_API_TIMEOUT_MS).useNONs().setEndpoint(coapServer.getEndpoint()); + + coapServer.start(); + } + } catch (IOException e) { + logger.warn("{}: Unable to start CoIoT: {}", thingName, e.getMessage()); + } catch (NullPointerException e) { + logger.debug("{}: Coap Exception: {} ({})\n{}", thingName, e.getMessage(), e.getClass(), e.getStackTrace()); + } + } + + /** + * Process an inbound Response (or mapped Request) + * - decode Coap options + * - handle discery result or status updates + * + * @param response The Response packet + */ + @Override + public void processResponse(@Nullable Response response) { + if (response == null) { + return; // other device instance + } + String ip = response.getSourceContext().getPeerAddress().toString(); + if (!ip.contains(config.deviceIp)) { + return; + } + + String payload = ""; + String devId = ""; + String uri = ""; + // int validity = 0; + int serial = 0; + try { + logger.debug("{}: CoIoT Message from {}: {}", thingName, response.getSourceContext().getPeerAddress(), + response.toString()); + if (response.isCanceled() || response.isDuplicate() || response.isRejected()) { + logger.debug("{} ({}): Packet was canceled, rejected or is a duplicate -> discard", thingName, devId); + return; + } + + if (response.getCode() == ResponseCode.CONTENT) { + payload = response.getPayloadString(); + List<Option> options = response.getOptions().asSortedList(); + Validate.notNull(options); + int i = 0; + while (i < options.size()) { + @Nullable + Option opt = options.get(i); + Validate.notNull(opt); + switch (opt.getNumber()) { + case OptionNumberRegistry.URI_PATH: + uri = COLOIT_URI_BASE + opt.getStringValue(); + break; + case COIOT_OPTION_GLOBAL_DEVID: + devId = opt.getStringValue(); + break; + case COIOT_OPTION_STATUS_VALIDITY: + // validity = o.getIntegerValue(); + break; + case COIOT_OPTION_STATUS_SERIAL: + serial = opt.getIntegerValue(); + if (serial == lastSerial) { + // ShellyDeviceProfile profile = thingHandler.getProfile(); + // if ((profile != null) && profile.isSensor) { // work around for Shelly HT + + // As per specification the serial changes when any sensor data has changed. The App + // should ignore any updates with + // the same serial. However, as we have seen with the Shelly HT and Shelly 4 Pro this is + // not always the case. The + // device comes up with an status packet having the same serial, but new payload + // information. + // Work Around: Packet will only ignore when Serial AND Payload are the same as last + // time + if (!lastPayload.isEmpty() && !lastPayload.equals(payload)) { + logger.debug( + "{}: Duplicate serial {} will be processed, because payload is different: {} vs. {}", + thingName, serial, payload, lastPayload); + break; + } + logger.debug("{}: Serial {} was already processed, ignore update; payload={}", + thingName, serial, payload); + return; + } + break; + default: + logger.debug("{} ({}): COAP option {} with value {} skipped", thingName, devId, + opt.getNumber(), opt.getValue()); + } + i++; + } + + if (uri.equalsIgnoreCase(COLOIT_URI_DEVDESC) || (uri.isEmpty() && payload.contains(COIOT_TAG_BLK))) { + handleDeviceDescription(devId, payload); + } else if (uri.equalsIgnoreCase(COLOIT_URI_DEVSTATUS) + || (uri.isEmpty() && payload.contains(COIOT_TAG_GENERIC))) { + handleStatusUpdate(devId, payload, serial); + } + } else { + // error handling + logger.debug("{}: Unknown Response Code {} received, payload={}", thingName, response.getCode(), + response.getPayloadString()); + } + + if (reqStatus == null) { + /* + * Observe Status Updates + */ + reqStatus = sendRequest(reqStatus, config.deviceIp, COLOIT_URI_DEVSTATUS, Type.NON); + } + } catch (NullPointerException | IOException e) { + logger.debug("{}: Unable to process CoIoT Message: {} ({}); payload={}\n{}", thingName, e.getMessage(), + e.getClass(), payload, e.getStackTrace()); + resetSerial(); + } + } + + /** + * Process a CoIoT device description message. This includes definitions on device units (Relay0, Relay1, Sensors + * etc.) as well as a definition of + * sensors and actors. This information needs to be stored allowing to map ids from status updates to the device + * units and matching the correct + * thing channel. + * + * @param payload Device desciption in JSon format, example: + * {"blk":[{"I":0,"D":"Relay0"}],"sen":[{"I":112,"T":"Switch","R":"0/1","L":0}],"act":[{"I":211,"D":"Switch","L":0,"P":[{"I":2011,"D":"ToState","R":"0/1"}]}]} + * + * @param devId The device id reported in the CoIoT message. + */ + private void handleDeviceDescription(String devId, String payload) { + // Device description + // payload = StringUtils.substringBefore(payload, "}]}]}") + "}]}]}"; + logger.debug("{}: CoIoT Device Description for {}: {}", thingName, devId, payload); + + // Decode Json + @Nullable + CoIotDevDescription descr = gson.fromJson(payload, CoIotDevDescription.class); + Validate.notNull(descr); + + int i; + for (i = 0; i < descr.blk.size(); i++) { + CoIotDescrBlk blk = descr.blk.get(i); + logger.debug("{}: id={}: {}", thingName, blk.id, blk.desc); + if (!blockMap.containsKey(blk.id)) { + blockMap.put(blk.id, blk); + } else { + blockMap.replace(blk.id, blk); + } + if ((blk.type != null) && !blk.type.isEmpty()) { + // in fact it is a sen entry - that's vioaling the Spec + logger.trace("{}: fix: auto-create sensor definition for id {}/{}!", thingName, blk.id, blk.desc); + CoIotDescrSen sen = new CoIotDescrSen(); + sen.id = blk.id; + sen.desc = blk.desc; + sen.type = blk.type; + sen.range = blk.range; + sen.links = blk.links; + addSensor(sen); + } + } + logger.debug("{}: Adding {} sensor definitions", thingName, descr.sen.size()); + if (descr.sen != null) { + for (i = 0; i < descr.sen.size(); i++) { + addSensor(descr.sen.get(i)); + } + } + + // Save to thing properties + thingHandler.updateProperties(PROPERTY_COAP_DESCR, payload); + } + + private void addSensor(CoIotDescrSen sen) { + logger.debug("{}: id {}: {}, Type={}, Range={}, Links={}", thingName, sen.id, sen.desc, sen.type, sen.range, + sen.links); + try { + CoIotDescrSen fixed = fixDescription(sen); + if (!sensorMap.containsKey(fixed.id)) { + sensorMap.put(sen.id, fixed); + } else { + sensorMap.replace(sen.id, fixed); + } + } catch (NullPointerException e) { + logger.debug("{}: Unable to decode sensor definition -> skip ({})\n{}", thingName, e.getMessage(), + e.getStackTrace()); + } + } + + /** + * Process CoIoT status update message. If a status update is received, but the + * device description has not been received yet a GET is send to query device + * description. + * + * @param devId device id included in the status packet + * @param payload Coap payload (Json format), example: {"G":[[0,112,0]]} + * @param serial Serial for this request. If this the the same as last serial + * the update was already sent and processed so this one gets + * ignored. + * @throws IOException Exception on sending GET for device description. + */ + @SuppressWarnings({ "null", "unused" }) + private void handleStatusUpdate(String devId, String payload, int serial) throws IOException { + // payload = StringUtils.substringBefore(payload, "]]}") + "]]}"; + logger.debug("{}: CoIoT Sensor data {}", thingName, payload); + if (blockMap.size() == 0) { + // send discovery packet + resetSerial(); + reqDescription = sendRequest(reqDescription, config.deviceIp, COLOIT_URI_DEVDESC, Type.CON); + + // try to uses description from last initialization + String savedDescr = thingHandler.getProperty(PROPERTY_COAP_DESCR); + if (savedDescr.isEmpty()) { + logger.debug("{}: Device description not yet received, trigger auto-initialization", thingName); + return; + } + + // simulate received device description to create element table + handleDeviceDescription(devId, savedDescr); + logger.debug("{}: Device description for {} restored: {}", thingName, devId, savedDescr); + } + + // Parse Json, + CoIotGenericSensorList list = gson.fromJson(payload, CoIotGenericSensorList.class); + Validate.notNull(list, "sensor list must not be empty!"); + Map<String, State> updates = new HashMap<String, State>(); + + if (list.generic == null) { + logger.debug("{}: Sensor list is empty! Payload: {}", devId, payload); + return; + } + + Validate.notNull(thingHandler, "thingHandler must not be null!"); + ShellyDeviceProfile profile = thingHandler.getProfile(); + if (profile == null) { + logger.debug("{}: Thing not initialized yet, skip update (ID={})", thingName, devId); + thingHandler.requestUpdates(1, true); + return; + } + + logger.debug("{}: {} status updates received", thingName, list.generic.size()); + for (int i = 0; i < list.generic.size(); i++) { + CoIotSensor s = list.generic.get(i); + CoIotDescrSen sen = sensorMap.get(s.index); + if (sen != null) { + // find matching sensor definition from device description, use the Link ID as + // index + Validate.notNull(sen.links != null, "Coap: sen.L must not be null!"); + sen = fixDescription(sen); + CoIotDescrBlk element = blockMap.get(sen.links); + logger.debug("{}: Sensor value[{}]: Index={}, Value={} ({}, Type={}, Range={}, Link={}: {})", + thingName, i, s.index, s.value, sen.desc, sen.type, sen.range, sen.links, + element != null ? element.desc : "n/a"); + + // Process status information and convert into channel updates + String type = (element != null ? element.desc : "").toLowerCase(); + Integer rIndex = Integer.parseInt(sen.links) + 1; + String rGroup = profile.numRelays <= 1 ? CHANNEL_GROUP_RELAY_CONTROL + : CHANNEL_GROUP_RELAY_CONTROL + rIndex; + + switch (sen.type.toLowerCase()) /* CoIoT_STypes.valueOf(sen.T) */ { + case "b" /* BatteryLevel */: + updateChannel(updates, CHANNEL_GROUP_BATTERY, CHANNEL_SENSOR_BAT_LEVEL, + toQuantityType(s.value, DIGITS_PERCENT, SmartHomeUnits.PERCENT)); + break; + case "t" /* Temperature */: + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_TEMP, + toQuantityType(s.value, DIGITS_TEMP, SIUnits.CELSIUS)); + break; + case "h" /* Humidity */: + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_HUM, + toQuantityType(s.value, DIGITS_PERCENT, SmartHomeUnits.PERCENT)); + break; + case "m" /* Motion */: + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_MOTION, + s.value == 1 ? OnOffType.ON : OnOffType.OFF); + break; + case "l" /* Luminosity */: + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_LUX, + toQuantityType(s.value, DIGITS_LUX, SmartHomeUnits.LUX)); + break; + case "w" /* Watt */: + String mGroup = profile.numMeters == 1 ? CHANNEL_GROUP_METER : CHANNEL_GROUP_METER + rIndex; + updateChannel(updates, mGroup, CHANNEL_METER_CURRENTWATTS, + toQuantityType(s.value, DIGITS_WATT, SmartHomeUnits.WATT)); + break; + case "o": // Overtemp + // will be handled by status update + break; + + case "tc": /* Temp Celsius */ + case "tf": /* Temp Fahrenheit */ + /* + * It seems that tC and tF are the device temperature - currently no channel + */ + break; + + case "s" /* CatchAll */: + switch (sen.desc.toLowerCase()) { + case "relay0": // Shelly1 + case "state": + case "switch": + case "output": + case "vswitch": // ??? + updateChannel(updates, rGroup, CHANNEL_OUTPUT, + s.value == 1 ? OnOffType.ON : OnOffType.OFF); + break; + case "position": + // work around: Roller reports 101% instead max 100 + double pos = Math.max(SHELLY_MIN_ROLLER_POS, Math.min(s.value, SHELLY_MAX_ROLLER_POS)); + updateChannel(updates, CHANNEL_GROUP_ROL_CONTROL, CHANNEL_ROL_CONTROL_CONTROL, + toQuantityType(SHELLY_MAX_ROLLER_POS - pos, SmartHomeUnits.PERCENT)); + updateChannel(updates, CHANNEL_GROUP_ROL_CONTROL, CHANNEL_ROL_CONTROL_POS, + toQuantityType(pos, SmartHomeUnits.PERCENT)); + break; + case "input": + if (!profile.isDimmer) { + // Device has 1 input: 0=off, 1+2 depend on switch mode + updateChannel(updates, rGroup, CHANNEL_INPUT, + s.value == 0 ? OnOffType.OFF : OnOffType.ON); + } else { + // only Dimmer has 2 inputs + Integer idx = getInputId(sen.id); + if (idx != null) { + updateChannel(updates, rGroup, CHANNEL_INPUT + idx.toString(), + s.value == 1 ? OnOffType.ON : OnOffType.OFF); + } + } + break; + case "flood": + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_FLOOD, + s.value == 1 ? OnOffType.ON : OnOffType.OFF); + break; + case "brightness": // Dimmer + updateChannel(updates, rGroup, CHANNEL_BRIGHTNESS, + toQuantityType(s.value, SmartHomeUnits.PERCENT)); + break; + case "charger": // Sense + updateChannel(updates, CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CHARGER, + s.value == 1 ? OnOffType.ON : OnOffType.OFF); + break; + + // RGBW2/Bulb + case "red": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_RED, + new DecimalType(s.value)); + break; + case "green": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_GREEN, + new DecimalType(s.value)); + break; + case "blue": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_BLUE, + new DecimalType(s.value)); + break; + case "white": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_WHITE, + new DecimalType(s.value)); + break; + case "gain": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_GAIN, + new DecimalType(s.value)); + break; + case "temp": + updateChannel(updates, CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_COLOR_TEMP, + new DecimalType(s.value)); + + break; + + default: + logger.debug("{}: Update for unknown sensor type {}/{} received", thingName, sen.type, + sen.desc); + } + break; + + default: + logger.debug("{}: Sensor data for type {} not processed, value={}", thingName, sen.type, + s.value); + break; + } + } else { + logger.debug("{}: Update for unknown sensor[{}]: Dev={}, Index={}, Value={}", thingName, i, devId, + s.index, s.value); + } + } + + if (updates.size() > 0) { + logger.debug("{}: Process {} CoIoT channel updates", thingName, updates.size()); + int i = 0; + for (Map.Entry<String, State> u : updates.entrySet()) { + logger.debug("{}: Update[{}] channel {}, value={}", thingName, i, u.getKey(), u.getValue()); + thingHandler.updateChannel(u.getKey(), u.getValue(), true); + i++; + } + + if (!profile.isSensor) { + // For now the Coap interface is not providing all updates, e.g. currentWatts yes, but not the average + // values for the 3 mins + // To prevent confusing the user we schedule a regular REST update shortly + // This will be removed once Coap returns all values, which have changed since the last update + if (thingHandler.scheduledUpdates == 0) { + thingHandler.requestUpdates(1, false); + } + } + } + + // Remeber serial, new packets with same serial will be ignored + lastSerial = serial; + lastPayload = payload; + } + + private boolean updateChannel(Map<String, State> updates, String group, String channel, State value) { + State v = (State) thingHandler.getChannelValue(group, channel); + if ((v != null) && v.equals(value)) { + return false; + } + logger.trace("{}: Updating channel {}.{} from CoIoT, new value={}", thingName, group, channel, value); + updates.put(mkChannelId(group, channel), value); + return true; + + } + + /** + * Work around to fix inconsistent sensor types and description + * Shelly not uses always the same coding for sen.T and sen.D - this helps to unify the format and simplifies + * processing + * + * @param sen + * @return updated sen + */ + private CoIotDescrSen fixDescription(CoIotDescrSen sen) { + Validate.notNull(sen, "sen must not be null!"); + + // Shelly1: reports null descr+type "Switch" -> map to S + // Shelly1PM: reports null descr+type "Overtemp" -> map to O + // Shelly1PM: reports null descr+type "W" -> add description + // Shelly1PM: reports temp senmsors without desc -> add description + // Shelly Dimmer: sensors are reported without descriptions -> map to S + // SHelly Sense: multiple issues: Description should not be lower case, invalid type for Motion and Battery + // Shelly Sense: Battery is reported with Desc "battery", but type "H" instead of "B" + // Shelly Sense: Motion is reported with Desc "battery", but type "H" instead of "B" + // Shelly Bulb: Colors are coded with Type="Red" etc. rather than Type="S" and color as Descr + if (sen.desc == null) { + sen.desc = ""; + } + + switch (sen.desc.toLowerCase()) { + case "motion": // fix acc to spec it's T=M + sen.type = "M"; + sen.desc = "Motion"; + break; + case "battery": // fix: type is B not H + sen.type = "B"; + sen.desc = "Battery"; + break; + } + + if (sen.desc.isEmpty()) { + switch (sen.type.toLowerCase()) { + case "w": + sen.desc = "Power"; + break; + case "switch": + case "relay0": + sen.type = "S"; + sen.desc = "Switch"; + break; + case "overtemp": + sen.type = "O"; + sen.desc = "Overtemp"; + break; + case "input": + sen.type = "S"; + sen.desc = "Input"; + break; + case "output": + sen.type = "S"; + sen.desc = "Output"; + break; + case "brightness": + sen.type = "S"; + sen.desc = "Brightness"; + break; + case "tc": + case "tf": + sen.desc = "Temperature"; + break; + + case "red": + case "green": + case "blue": + case "white": + case "gain": + case "temp": // Bulb: Color temperature + sen.desc = sen.type; + sen.type = "S"; + break; + + case "vswitch": + // it seems that Shelly tends to break their own spec: T is the description and D is no longer + // included + // -> map D to sen.T and set CatchAll for T + sen.desc = sen.type; + sen.type = "S"; + break; + + // Default: set no description + // (there are no T values defined in the CoIoT spec) + case "tostate": + default: + sen.desc = ""; + } + } + return sen; + } + + /** + * Send a new request (Discovery to get Device Description). Before a pending + * request will be canceled. + * + * @param request The current request (this will be canceled an a new one will + * be created) + * @param ipAddress Device's IP address + * @param uri The URI we are calling (CoIoT = /cit/d or /cit/s) + * @param con true: send as CON, false: send as NON + * @return new packet + * + * @throws IOException + */ + private Request sendRequest(@Nullable Request request, String ipAddress, String uri, Type con) throws IOException { + if ((request != null) && !request.isCanceled()) { + request.cancel(); + } + + resetSerial(); + return newRequest(ipAddress, uri, con).send(); + } + + /** + * Allocate a new Request structure. A message observer will be added to get the + * callback when a response has been received. + * + * @param ipAddress IP address of the device + * @param uri URI to be addressed + * @param uri The URI we are calling (CoIoT = /cit/d or /cit/s) + * @param con true: send as CON, false: send as NON + * @return new packet + * @throws IOException + */ + private Request newRequest(String ipAddress, String uri, Type con) throws IOException { + // We need to build our own Request to set an empty Token + Request request = new Request(Code.GET, con); + request.setURI(completeUrl(ipAddress, uri)); + request.setToken(EMPTY_BYTE); + request.addMessageObserver(new MessageObserverAdapter() { + @Override + public void onResponse(@Nullable Response response) { + processResponse(response); + } + + @Override + public void onCancel() { + logger.debug("{}: Coap Request was canceled", thingName); + } + + @Override + public void onTimeout() { + logger.debug("{}: Coap Request timed out", thingName); + } + + }); + return request; + + } + + private void resetSerial() { + lastSerial = -1; + lastPayload = ""; + } + + /** + * Find index of Input id, which is required to map to channel name + * + * @param sensorId The id from the sensor update + * @return Index of found entry (+1 will be the suffix for the channel name) or null if sensorId is not found + */ + @Nullable + private Integer getInputId(String sensorId) { + Integer idx = 1; + for (Map.Entry<String, CoIotDescrSen> se : sensorMap.entrySet()) { + @Nullable + CoIotDescrSen sen = se.getValue(); + if (sen.id.equalsIgnoreCase(sensorId)) { + logger.trace("{}: map to input{} channel", thingName, idx); + return idx; + } + if (sen.id.equalsIgnoreCase("Input")) { + idx++; // iterate from input1..2..n + } + } + logger.debug("{}: sensorId {} not found in sensorMap!", thingName, sensorId); + return null; + } + + /** + * Cancel pending requests and shutdown the client + */ + @SuppressWarnings("null") + public void stop() { + logger.debug("{}: Stop CoapHandler instance", thingName); + if ((reqDescription != null) && !reqDescription.isCanceled()) { + reqDescription.cancel(); + reqDescription = null; + } + if ((reqStatus != null) && !reqStatus.isCanceled()) { + reqStatus.cancel(); + reqStatus = null; + } + if (statusClient != null) { + statusClient.shutdown(); + statusClient = null; + } + coapServer.removeListener(this); + } + + public void dispose() { + stop(); + } + + private static String completeUrl(String ipAddress, String uri) { + return "coap://" + ipAddress + ":" + COIOT_PORT + uri; + + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapJSon.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapJSon.java new file mode 100644 index 0000000000000..c8c0bc05befcf --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapJSon.java @@ -0,0 +1,151 @@ +/** + * 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.shelly.internal.coap; + +import java.io.IOException; +import java.util.ArrayList; + +import org.apache.commons.lang.Validate; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The {@link ShellyCoapJSon} helps the CoIoT Json into Java objects + * + * @author Markus Michels - Initial contribution + */ +public class ShellyCoapJSon { + + public static final String COIOT_TAG_BLK = "blk"; + public static final String COIOT_TAG_SEN = "sen"; + public static final String COIOT_TAG_ACT = "act"; + public static final String COIOT_TAG_GENERIC = "G"; + + public static class CoIotDescrBlk { + @SerializedName("I") + String id; // ID + @SerializedName("D") + String desc; // Description + + // Sometimes sen entries are part of the blk array - not conforming the Spec! + @SerializedName("T") + public String type; // Type + @SerializedName("R") + public String range; // Range + @SerializedName("L") + public String links; // Links + } + + public static class CoIotDescrSen { + @SerializedName("I") + String id; // ID + @SerializedName("D") + String desc; // Description + @SerializedName("T") + public String type; // Type + @SerializedName("R") + public String range; // Range + @SerializedName("L") + public String links; // Links + } + + public static class CoIotDescrP { + @SerializedName("I") + String id; // ID + @SerializedName("D") + String desc; // Description + @SerializedName("R") + public String range; // Range + } + + public static class CoIotDescrAct { + @SerializedName("I") + String id; // ID + @SerializedName("D") + String desc; // Description + @SerializedName("L") + public String links; // Links + @SerializedName("P") + public ArrayList<CoIotDescrP> pTag; // ? + } + + public static class CoIotDevDescription { + public ArrayList<CoIotDescrBlk> blk; + public ArrayList<CoIotDescrSen> sen; + public ArrayList<CoIotDescrAct> act; + } + + public static class CoIotSensor { + public String index; // id + public double value; // value + } + + public static class CoIotGenericSensorList { + @SerializedName("G") + public ArrayList<CoIotSensor> generic; + + public CoIotGenericSensorList() { + generic = new ArrayList<CoIotSensor>(); + } + } + + protected static class CoIotSensorTypeAdapter extends TypeAdapter<CoIotGenericSensorList> { + @Override + public CoIotGenericSensorList read(final JsonReader in) throws IOException { + CoIotGenericSensorList list = new CoIotGenericSensorList(); + + in.beginObject(); + String generic = in.nextName(); + Validate.notNull(generic, "Invalid JSon format for CoIotSensorList"); + if (generic.equals(COIOT_TAG_GENERIC)) { + in.beginArray(); + while (in.hasNext()) { + in.beginArray(); + final CoIotSensor sensor = new CoIotSensor(); + in.nextInt(); // alway 0 + sensor.index = new Integer(in.nextInt()).toString(); + sensor.value = in.nextDouble(); + in.endArray(); + list.generic.add(sensor); + } + in.endArray(); + } + in.endObject(); + + return list; + } + + @Override + public void write(final JsonWriter out, final CoIotGenericSensorList o) throws IOException { + CoIotGenericSensorList sensors = o; + out.beginObject(); + if (sensors != null) { + out.name(COIOT_TAG_GENERIC).beginArray(); + for (int i = 0; i < sensors.generic.size(); i++) { + out.beginArray(); + out.value(0); + out.value(sensors.generic.get(i).index); + out.value(sensors.generic.get(i).value); + out.endArray(); + } + out.endArray(); + } + out.endObject(); + } + + } + +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapListener.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapListener.java new file mode 100644 index 0000000000000..4dd4eda413801 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapListener.java @@ -0,0 +1,27 @@ +/** + * 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.shelly.internal.coap; + +import org.eclipse.californium.core.coap.Response; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link ShellyCoapListener} describes the listening interface to process Coap responses + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public interface ShellyCoapListener { + public void processResponse(@Nullable Response response); +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapServer.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapServer.java new file mode 100644 index 0000000000000..4b580d2834e54 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/coap/ShellyCoapServer.java @@ -0,0 +1,159 @@ +/** + * 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.shelly.internal.coap; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.COIOT_PORT; + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; + +import org.apache.commons.lang.Validate; +import org.eclipse.californium.core.CoapResource; +import org.eclipse.californium.core.CoapServer; +import org.eclipse.californium.core.coap.CoAP; +import org.eclipse.californium.core.coap.CoAP.Code; +import org.eclipse.californium.core.coap.CoAP.ResponseCode; +import org.eclipse.californium.core.coap.Request; +import org.eclipse.californium.core.coap.Response; +import org.eclipse.californium.core.network.CoapEndpoint; +import org.eclipse.californium.core.network.Exchange; +import org.eclipse.californium.core.network.config.NetworkConfig; +import org.eclipse.californium.elements.UdpMulticastConnector; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ShellyCoapServer} implements the UDP listener and status event processor (for /cit/s messages) + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyCoapServer { + private final Logger logger = LoggerFactory.getLogger(ShellyCoapServer.class); + + private @Nullable CoapEndpoint statusEndpoint; + private @Nullable UdpMulticastConnector statusConnector; + private @Nullable CoapServer server; + boolean started = false; + private final Set<ShellyCoapListener> coapListeners = new CopyOnWriteArraySet<>(); + + @SuppressWarnings("null") + @NonNullByDefault + protected class ShellyStatusListener extends CoapResource { + + private ShellyCoapServer listener; + + public ShellyStatusListener(String uri, ShellyCoapServer listener) { + super(uri, true); + getAttributes().setTitle("ShellyCoapListener"); + this.listener = listener; + } + + @Override + public void handleRequest(@Nullable final Exchange exchange) { + if (exchange != null) { + Request request = exchange.getRequest(); + Code code = exchange.getRequest().getCode(); + switch (code) { + case CUSTOM_30: + listener.processResponse(createResponse(request)); + break; + default: + super.handleRequest(exchange); + } + } + } + + } + + public void addListener(ShellyCoapListener listener) { + coapListeners.add(listener); + } + + public void removeListener(ShellyCoapListener listener) { + coapListeners.remove(listener); + } + + @SuppressWarnings("null") + synchronized void init(String localIp) throws UnknownHostException { + if (server == null) { + logger.debug("Initializing CoIoT listener (local IP={}", localIp); + NetworkConfig nc = NetworkConfig.getStandard(); + InetAddress localAddr = InetAddress.getByName(localIp); + InetSocketAddress localPort = new InetSocketAddress(COIOT_PORT); + + // Join the multicast group on the selected network interface + statusConnector = new UdpMulticastConnector(localAddr, localPort, CoAP.MULTICAST_IPV4); // bind UDP listener + statusEndpoint = new CoapEndpoint.Builder().setNetworkConfig(nc).setConnector(statusConnector).build(); + + server = new CoapServer(NetworkConfig.getStandard(), COIOT_PORT); + Validate.notNull(server); + server.addEndpoint(statusEndpoint); + CoapResource cit = new ShellyStatusListener("cit", this); + CoapResource s = new ShellyStatusListener("s", this); + cit.add(s); + server.add(cit); + } + } + + public void start() { + if (!started) { + logger.debug("Start CoIoT Listener"); + started = true; + } + } + + protected void processResponse(Response response) { + coapListeners.forEach(listener -> listener.processResponse(response)); + } + + public static Response createResponse(Request request) { + Response response = Response.createResponse(request, ResponseCode.CONTENT); + response.setType(request.getType()); + response.setSourceContext(request.getSourceContext()); + response.setMID(request.getMID()); + response.setOptions(request.getOptions()); + response.setPayload(request.getPayload()); + return response; + } + + @Nullable + public CoapEndpoint getEndpoint() { + return statusEndpoint; + } + + /** + * Cancel pending requests and shutdown the client + */ + @SuppressWarnings("null") + public void stop() { + if (started) { + if (server != null) { + server.stop(); + } + if (statusEndpoint != null) { + statusEndpoint.stop(); + } + } + } + + public void dispose() { + stop(); + } + +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyBindingConfiguration.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyBindingConfiguration.java new file mode 100644 index 0000000000000..a50cead9f2f2e --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyBindingConfiguration.java @@ -0,0 +1,65 @@ +/** + * 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.shelly.internal.config; + +import java.util.Collections; +import java.util.Dictionary; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link ShellyBindingConfiguration} class contains fields mapping binding configuration parameters. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyBindingConfiguration { + // Binding Configuration Properties + public static final String CONFIG_DEF_HTTP_USER = "defaultUserId"; + public static final String CONFIG_DEF_HTTP_PWD = "defaultPassword"; + + public String defaultUserId = ""; // default for http basic user id + public String defaultPassword = ""; // default for http basic auth password + + public void updateFromProperties(Map<String, @Nullable Object> properties) { + Validate.notNull(properties); + + for (Map.Entry<String, @Nullable Object> e : properties.entrySet()) { + switch (e.getKey()) { + case CONFIG_DEF_HTTP_USER: + String v = (String) e.getValue(); + defaultUserId = v != null ? v : ""; + break; + case CONFIG_DEF_HTTP_PWD: + v = (String) e.getValue(); + defaultPassword = v != null ? v : ""; + break; + } + + } + } + + public void updateFromProperties(Dictionary<String, Object> properties) { + Validate.notNull(properties); + List<String> keys = Collections.list(properties.keys()); + Map<String, @Nullable Object> dictCopy = keys.stream() + .collect(Collectors.toMap(Function.identity(), properties::get)); + updateFromProperties(dictCopy); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyThingConfiguration.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyThingConfiguration.java new file mode 100755 index 0000000000000..e84f039117a55 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/config/ShellyThingConfiguration.java @@ -0,0 +1,39 @@ +/** + * 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.shelly.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * The {@link ShellyThingConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyThingConfiguration { + public String deviceIp = ""; // ip address of thedevice + public int updateInterval = 60; // schedule interval for the update job + public float lowBattery = 20; // threshold for battery value + + public String userId = ""; // userid for http basic auth + public String password = ""; // password for http basic auth + + public boolean eventsButton = false; // true: register for Relay btn_xxx events + public boolean eventsSwitch = true; // true: register for device out_xxx events + public boolean eventsPush = true; // true: register for short/long push events + public boolean eventsSensorReport = true; // true: register for sensor events + public boolean eventsCoIoT = false; // true: use CoIoT events (based on COAP) + + public String localIp = ""; // local ip addresses used to create callback url + public Integer httpPort = 0; +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyDiscoveryParticipant.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyDiscoveryParticipant.java new file mode 100755 index 0000000000000..9f5e2a0220cb5 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyDiscoveryParticipant.java @@ -0,0 +1,198 @@ +/** + * 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.shelly.internal.discovery; + +import static org.eclipse.smarthome.core.thing.Thing.PROPERTY_MODEL_ID; +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import javax.jmdns.ServiceInfo; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.openhab.binding.shelly.internal.ShellyHandlerFactory; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; +import org.openhab.binding.shelly.internal.api.ShellyHttpApi; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration; +import org.openhab.binding.shelly.internal.handler.ShellyBaseHandler; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Modified; +import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.ReferenceCardinality; +import org.osgi.service.component.annotations.ReferencePolicy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class identifies Shelly devices by their mDNS service information. + * + * @author Hans-Jörg Merk - Initial contribution + */ +@NonNullByDefault +@Component(service = MDNSDiscoveryParticipant.class, immediate = true) +public class ShellyDiscoveryParticipant implements MDNSDiscoveryParticipant { + private final Logger logger = LoggerFactory.getLogger(ShellyDiscoveryParticipant.class); + private @Nullable ShellyBindingConfiguration bindingConfig = new ShellyBindingConfiguration(); + private @Nullable ShellyHandlerFactory handlerFactory; + + @Override + public Set<ThingTypeUID> getSupportedThingTypeUIDs() { + return SUPPORTED_THING_TYPES_UIDS; + } + + @Override + public String getServiceType() { + return SERVICE_TYPE; + } + + /** + * Called at the service activation. + * + * @param componentContext + */ + @SuppressWarnings("null") + @Activate + protected void activate(ComponentContext componentContext) { + logger.debug("Shelly Discovery service activated"); + Validate.notNull(componentContext); + Validate.notNull(bindingConfig); + bindingConfig.updateFromProperties(componentContext.getProperties()); + } + + @Modified + @SuppressWarnings("null") + protected void modified(ComponentContext componentContext) { + logger.debug("Shelly Binding Configuration refreshed"); + bindingConfig.updateFromProperties(componentContext.getProperties()); + } + + @SuppressWarnings("null") + @Nullable + @Override + public DiscoveryResult createResult(@Nullable ServiceInfo service) { + Validate.notNull(bindingConfig); + if ((service == null) || !service.getName().startsWith("shelly")) { + return null; + } + + String address = ""; + String name = ""; + String mode = ""; + String model = "unknown"; + String thingType = ""; + ThingUID thingUID = null; + ShellyDeviceProfile profile = null; + Map<String, Object> properties = new HashMap<String, Object>(); + + try { + name = service.getName().toLowerCase(); + address = StringUtils.substringBetween(service.toString(), "/", ":80"); + if (address == null) { + logger.debug("Shelly device {} discovered with empty IP address", name); + return null; + } + logger.debug("Shelly device discovered: IP-Adress={}, name={}", address, name); + + ShellyThingConfiguration config = new ShellyThingConfiguration(); + if (handlerFactory != null) { + bindingConfig = handlerFactory.getBindingConfig(); + } + + // Get device settings + Validate.notNull(bindingConfig); + config.deviceIp = address; + config.userId = bindingConfig.defaultUserId; + config.password = bindingConfig.defaultPassword; + ShellyHttpApi api = new ShellyHttpApi(config); + + try { + profile = api.getDeviceProfile(thingType); + Validate.notNull(profile); + logger.debug("Shelly settings : {}", profile.settingsJson); + Validate.notNull(profile, "Unable to get device profile: "); + model = profile.settings.device.type; + mode = profile.mode; + + properties = ShellyBaseHandler.fillDeviceProperties(profile); + logger.trace("name={}, thingType={}, deviceType={}, mode={}", name, thingType, profile.deviceType, + mode.isEmpty() ? "<standard>" : mode); + + // get thing type from device name + thingUID = ShellyThingCreator.getThingUID(name, mode, false); + } catch (IOException e) { + if (e.getMessage().contains(APIERR_HTTP_401_UNAUTHORIZED)) { + logger.warn("Device {} ({}) reported 'Access defined' (userid/password mismatch).", name, address); + + // create shellyunknown thing - will be changed during thing initialization with valid credentials + thingUID = ShellyThingCreator.getThingUID(name, mode, true); + } else { + logger.warn("Device discovery failed for device {}, IP {}: {} ({})\n{}", name, address, + e.getMessage(), e.getClass(), e.getStackTrace()); + } + } + + if (thingUID != null) { + addProperty(properties, CONFIG_DEVICEIP, address); + addProperty(properties, PROPERTY_MODEL_ID, model); + addProperty(properties, PROPERTY_SERVICE_NAME, name); + addProperty(properties, PROPERTY_DEV_TYPE, thingType); + addProperty(properties, PROPERTY_DEV_MODE, mode); + + logger.debug("Adding Shelly thing, UID={}", thingUID.getAsString()); + return DiscoveryResultBuilder.create(thingUID).withProperties(properties) + .withLabel(name + " - " + address).withRepresentationProperty(name).build(); + } + } catch (NullPointerException e) { + logger.warn("Device discovery failed for device {}, IP {}, service={}: {}", name, address, name, + e.getMessage(), e); + } + return null; + } + + private void addProperty(Map<String, Object> properties, String key, @Nullable String value) { + properties.put(key, value != null ? value : ""); + } + + @Nullable + @Override + public ThingUID getThingUID(@Nullable ServiceInfo service) { + logger.debug("ServiceInfo {}", service); + Validate.notNull(service); + return ShellyThingCreator.getThingUID(service.getName().toLowerCase(), "", false); + } + + @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC) + public void setShellyHandlerFactory(ShellyHandlerFactory handlerFactory) { + this.handlerFactory = handlerFactory; + logger.trace("Discovery: HandlerFactory bound"); + } + + public void unsetShellyHandlerFactory(ShellyHandlerFactory handlerFactory) { + this.handlerFactory = null; + logger.trace("Discovery: HandlerFactory unbound"); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java new file mode 100644 index 0000000000000..927104f9e64d6 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/discovery/ShellyThingCreator.java @@ -0,0 +1,104 @@ +/** + * 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.shelly.internal.discovery; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; + +/** + * The {@link ShellyThingCreator} implements some helper functions for Thing creation (used by Discovery and Thing + * handler). + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyThingCreator { + + public static ThingUID getThingUID(String serviceName, String mode, boolean unknown) { + String devid = StringUtils.substringAfterLast(serviceName, "-"); + return new ThingUID(!unknown ? getThingTypeUID(serviceName, mode) + : getThingTypeUID(THING_TYPE_SHELLYPROTECTED_STR + "-" + devid, mode), devid); + } + + public static ThingTypeUID getThingTypeUID(String serviceName, String mode) { + return new ThingTypeUID(BINDING_ID, getThingType(serviceName, mode)); + } + + public static ThingTypeUID getUnknownTTUID() { + return new ThingTypeUID(BINDING_ID, THING_TYPE_SHELLYPROTECTED_STR); + } + + public static String getThingType(String name, String mode) { + if (name.startsWith(THING_TYPE_SHELLY1PN_STR)) { + return THING_TYPE_SHELLY1PN_STR; + } + if (name.startsWith(THING_TYPE_SHELLYEM_STR)) { + return THING_TYPE_SHELLYEM_STR; + } + if (name.startsWith(THING_TYPE_SHELLY1_STR)) { + return THING_TYPE_SHELLY1_STR; + } + if (name.startsWith(THING_TYPE_SHELLY25_PREFIX)) { // Shelly v2.5 + return mode.equals(SHELLY_MODE_RELAY) ? THING_TYPE_SHELLY25_RELAY_STR : THING_TYPE_SHELLY25_ROLLER_STR; + } + if (name.startsWith(THING_TYPE_SHELLY2_PREFIX)) { // Shelly v2 + return mode.equals(SHELLY_MODE_RELAY) ? THING_TYPE_SHELLY2_RELAY_STR : THING_TYPE_SHELLY2_ROLLER_STR; + } + if (name.startsWith(THING_TYPE_SHELLY4PRO_STR)) { + return THING_TYPE_SHELLY4PRO_STR; + } + if (name.startsWith(THING_TYPE_SHELLYPLUG_STR)) { + // shellyplug-s needs to be mapped to shellyplugs to follow the schema + // for the thing types: <thing type>-<mode> + if (name.startsWith(THING_TYPE_SHELLYPLUGS_STR) || name.contains("-s")) { + return THING_TYPE_SHELLYPLUGS_STR; + } + return THING_TYPE_SHELLYPLUG_STR; + } + if (name.startsWith(THING_TYPE_SHELLYDIMMER_STR)) { + return THING_TYPE_SHELLYDIMMER_STR; + } + if (name.startsWith(THING_TYPE_SHELLYBULB_STR)) { + return THING_TYPE_SHELLYBULB_STR; + } + if (name.startsWith(THING_TYPE_SHELLYRGBW2_PREFIX)) { + return mode.equals(SHELLY_MODE_COLOR) ? THING_TYPE_SHELLYRGBW2_COLOR_STR : THING_TYPE_SHELLYRGBW2_WHITE_STR; + } + if (name.startsWith(THING_TYPE_SHELLYHT_STR)) { + return THING_TYPE_SHELLYHT_STR; + } + if (name.startsWith(THING_TYPE_SHELLYSMOKE_STR)) { + return THING_TYPE_SHELLYSMOKE_STR; + } + if (name.startsWith(THING_TYPE_SHELLYFLOOD_STR)) { + return THING_TYPE_SHELLYFLOOD_STR; + } + if (name.startsWith(THING_TYPE_SHELLYSENSE_STR)) { + return THING_TYPE_SHELLYSENSE_STR; + } + if (name.startsWith(THING_TYPE_SHELLYEYE_STR)) { + return THING_TYPE_SHELLYEYE_STR; + } + if (name.startsWith(THING_TYPE_SHELLYPROTECTED_STR)) { + return THING_TYPE_SHELLYPROTECTED_STR; + } + + return THING_TYPE_UNKNOWN_STR; + } + +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyBaseHandler.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyBaseHandler.java new file mode 100755 index 0000000000000..47d46e9514320 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyBaseHandler.java @@ -0,0 +1,857 @@ +/** + * 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.shelly.internal.handler; + +import static org.eclipse.smarthome.core.thing.Thing.*; +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; +import static org.openhab.binding.shelly.internal.discovery.ShellyThingCreator.getThingTypeUID; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.CommonTriggerEvents; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsStatus; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; +import org.openhab.binding.shelly.internal.api.ShellyHttpApi; +import org.openhab.binding.shelly.internal.coap.ShellyCoapHandler; +import org.openhab.binding.shelly.internal.coap.ShellyCoapServer; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ShellyBaseHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyBaseHandler extends BaseThingHandler implements ShellyDeviceListener { + protected final Logger logger = LoggerFactory.getLogger(ShellyBaseHandler.class); + + public String thingName = ""; + protected ShellyBindingConfiguration bindingConfig = new ShellyBindingConfiguration(); + protected ShellyThingConfiguration config = new ShellyThingConfiguration(); + protected @Nullable ShellyHttpApi api; + private @Nullable ShellyCoapHandler coap; + protected @Nullable ShellyDeviceProfile profile; + private final @Nullable ShellyCoapServer coapServer; + protected boolean lockUpdates = false; + + @SuppressWarnings("unused") + private long lastUpdateTs = 0; + private long lastUptime = 0; + private long lastAlarmTs = 0; + + private @Nullable ScheduledFuture<?> statusJob; + private int skipUpdate = 0; + public int scheduledUpdates = 0; + private int skipCount = UPDATE_SKIP_COUNT; + + // force settings refresh every x seconds + private int refreshCount = UPDATE_SETTINGS_INTERVAL_SECONDS / UPDATE_STATUS_INTERVAL_SECONDS; + private boolean refreshSettings = false; + + // delay before enabling channel + private final int cacheCount = UPDATE_SETTINGS_INTERVAL_SECONDS / UPDATE_STATUS_INTERVAL_SECONDS; + private boolean channelCache = false; + private Map<String, Object> channelData = new HashMap<>(); + + String localIP = ""; + int httpPort = -1; + + /** + * Constructor + * + * @param thing The Thing object + * @param bindingConfig The binding configuration (beside thing + * configuration) + * @param coapServer coap server instance + * @param localIP local IP address from networkAddressService + * @param httpPort from httpService + */ + public ShellyBaseHandler(Thing thing, ShellyBindingConfiguration bindingConfig, + @Nullable ShellyCoapServer coapServer, String localIP, int httpPort) { + super(thing); + + this.bindingConfig = bindingConfig; + this.coapServer = coapServer; + this.localIP = localIP; + this.httpPort = httpPort; + } + + /** + * Schedule asynchronous Thing initialization, register thing to event dispatcher + */ + @Override + public void initialize() { + updateStatus(ThingStatus.UNKNOWN); + // start background initialization: + scheduler.schedule(() -> { + boolean start = true; + try { + initializeThingConfig(); + Validate.notNull(config); + logger.debug("{}: Device config: ipAddress={}, http user/password={}/{}, update interval={}", + getThing().getLabel(), config.deviceIp, config.userId.isEmpty() ? "<non>" : config.userId, + config.password.isEmpty() ? "<none>" : "***", config.updateInterval); + initializeThing(); + } catch (NullPointerException | IOException e) { + if (authorizationFailed(e.getMessage())) { + start = false; + } + logger.debug("{}: Unable to initialize: {} ({}), retrying later\n{}", getThing().getLabel(), + e.getMessage(), e.getClass(), e.getStackTrace()); + } finally { + // even this initialization failed we start the status update + // the updateJob will then try to auto-initialize the thing + // in this case the thing stays in status INITIALIZING + if (start && (getThing().getStatus() != ThingStatus.OFFLINE)) { + startUpdateJob(); + } + } + }, 2, TimeUnit.SECONDS); + } + + /** + * This routine is called every time the Thing configuration has been changed (e.g. PaperUI) + */ + @Override + public void handleConfigurationUpdate(Map<String, Object> configurationParameters) { + super.handleConfigurationUpdate(configurationParameters); + logger.debug("{}: Thing config updated.", thingName); + initializeThingConfig(); + startUpdateJob(); + refreshSettings = true; // force re-initialization + } + + /** + * Initialize Thing: Initialize API access, get settings and initialize Device Profile + * If the device is password protected and the credentials are missing or don't match the API access will throw an + * Exception. In this case the thing type will be changed to shelly-unknown. The user has the option to edit the + * thing config and set the correct credentials. The thing type will be changed to the requested one if the + * credentials are correct and the API access is initialized successful. + * + * @throws IOException e.g. http returned non-ok response, check e.getMessage() for details. + */ + @SuppressWarnings("null") + private void initializeThing() throws IOException { + // Get the thing global settings and initialize device capabilities + channelData = new HashMap<>(); // clear any cached channels + refreshSettings = false; + lockUpdates = false; + + Map<String, String> properties = getThing().getProperties(); + thingName = properties.get(PROPERTY_SERVICE_NAME) != null ? properties.get(PROPERTY_SERVICE_NAME).toLowerCase() + : ""; + logger.debug("{}: Start initializing, ip address {}, CoIoT: {}", getThing().getLabel(), config.deviceIp, + config.eventsCoIoT); + + // Initialize API access, exceptions will be catched by initialize() + api = new ShellyHttpApi(config); + ShellyDeviceProfile tmpPrf = api.getDeviceProfile(this.getThing().getThingTypeUID().getId()); + thingName = (!thingName.isEmpty() ? thingName : tmpPrf.hostname).toLowerCase(); + Validate.isTrue(!thingName.isEmpty(), "initializeThing(): thingName must not be empty!"); + + if (this.getThing().getThingTypeUID().equals(THING_TYPE_SHELLYUNKNOWN)) { + changeThingType(thingName, tmpPrf.mode); + return; // force re-initialization + } + + logger.debug("{}: Initializing device {}, type {}, Hardware: Rev: {}, batch {}; Firmware: {} / {} ({})", + thingName, tmpPrf.hostname, tmpPrf.deviceType, tmpPrf.hwRev, tmpPrf.hwBatchId, tmpPrf.fwVersion, + tmpPrf.fwDate, tmpPrf.fwId); + logger.debug("{}: Shelly settings info: {}", thingName, tmpPrf.settingsJson); + logger.debug( + "{}: Device has relays: {} (numRelays={}, is roller: {} (numRoller={}), is Plug S: {}, is Dimmer: {}, " + + "has LEDs: {}, is Light: {}, has Meter: {} (numMeter={}, EMeter: {}), is Sensor: {}, is Sense: {}, has Battery: {} {}, " + + "event urls: btn:{},out:{},push{},roller:{},sensor:{}", + tmpPrf.hostname, tmpPrf.hasRelays, tmpPrf.numRelays, tmpPrf.isRoller, tmpPrf.numRollers, tmpPrf.isPlugS, + tmpPrf.isDimmer, tmpPrf.hasLed, tmpPrf.isLight, tmpPrf.hasMeter, tmpPrf.numMeters, tmpPrf.isEMeter, + tmpPrf.isSensor, tmpPrf.isSense, tmpPrf.hasBattery, + tmpPrf.hasBattery ? "(low battery threshold=" + config.lowBattery + "%)" : "", + tmpPrf.supportsButtonUrls, tmpPrf.supportsOutUrls, tmpPrf.supportsPushUrls, tmpPrf.supportsRollerUrls, + tmpPrf.supportsSensorUrls); + + // update thing properties + ShellySettingsStatus status = api.getStatus(); + updateProperties(tmpPrf, status); + if (tmpPrf.fwVersion.compareTo(SHELLY_API_MIN_FWVERSION) < 0) { + logger.warn( + "{}: WARNING: Firmware might be too old (or beta release), installed: {}/{} ({}), required minimal {}. The binding was tested with version 1.50+ only. Older versions might work, but do not support all features or show technical issues. Please consider upgrading to v1.5.0 or newer!", + thingName, tmpPrf.fwVersion, tmpPrf.fwDate, tmpPrf.fwId, SHELLY_API_MIN_FWVERSION); + } + if (status.update.hasUpdate) { + logger.info("{} - INFO: New firmware available: current version: {}, new version: {}", thingName, + status.update.oldVersion, status.update.newVersion); + } + + // Set refresh interval for battery-powered devices to + refreshCount = !tmpPrf.hasBattery + ? refreshCount = UPDATE_SETTINGS_INTERVAL_SECONDS / UPDATE_STATUS_INTERVAL_SECONDS + : skipCount; + + // register event urls + api.setEventURLs(); + + profile = tmpPrf; // all initialization done, so keep the profile + + // Validate device mode + String thingType = getThing().getThingTypeUID().getId(); + String reqMode = thingType.contains("-") ? StringUtils.substringAfter(thingType, "-") : ""; + if (!reqMode.isEmpty() && !tmpPrf.mode.equals(reqMode)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Thing is in mode " + profile.mode + ", required is " + reqMode + + " - going offline. Re-run discovery to find the thing for the requested mode."); + return; + } + + if (config.eventsCoIoT && (coap == null)) { + Validate.notNull(coapServer, "coapServer must not be null!"); + coap = new ShellyCoapHandler(config, this, coapServer); + } + if (coap != null) { + coap.start(); + } + + fillDeviceStatus(status, false); + + logger.debug("{}: Thing successfully initialized.", thingName); + updateStatus(ThingStatus.ONLINE); // if API call was successful the thing must be online + requestUpdates(3, false); // request 3 updates in a row (during the first 2+3*3 sec) + + postAlarm(ALARM_TYPE_NONE, false); + } + + /** + * Handle Channel Command + */ + @SuppressWarnings("null") + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + try { + if (command instanceof RefreshType) { + return; + } + + if (profile == null) { + logger.debug("{}: Thing not yet initialized, command {} triggers initialization", thingName, + command.toString()); + initializeThing(); + } else { + profile = getProfile(false); + } + + boolean update = false; + lockUpdates = true; + + switch (channelUID.getIdWithoutGroup()) { + case CHANNEL_SENSE_KEY: // Shelly Sense: Send Key + logger.debug("{}: Send key {}", thingName, command.toString()); + api.sendIRKey(command.toString()); + update = true; + break; + + default: + update = handleDeviceCommand(channelUID, command); + break; + } + + if (update) { + requestUpdates(1, false); + } + } catch (NullPointerException | IOException e) { + if (authorizationFailed(e.getMessage())) { + return; + } + if (e.getMessage().contains(APIERR_NOT_CALIBRATED)) { + logger.warn("Device is not calibrated, use Shelly App to perform initial roller calibration."); + } else { + logger.warn("{} ERROR: Unable to process command for channel {}: {} ({})\nStack Trace: {}", thingName, + channelUID.toString(), e.getMessage(), e.getClass(), e.getStackTrace()); + } + } finally { + lockUpdates = false; + } + } + + /** + * Update device status and channels + */ + @SuppressWarnings("null") + protected void updateStatus() { + try { + boolean updated = false; + + skipUpdate++; + if (lockUpdates) { + logger.trace("{}: Update locked, try on next cycle", thingName); + return; + } + + if ((skipUpdate % refreshCount == 0) && (profile != null) + && (getThing().getStatus() == ThingStatus.ONLINE)) { + refreshSettings |= !profile.hasBattery; + } + + if (refreshSettings || (scheduledUpdates > 0) || (skipUpdate % skipCount == 0)) { + if ((profile == null) || ((getThing().getStatus() == ThingStatus.OFFLINE) + && (getThing().getStatusInfo().getStatusDetail() != ThingStatusDetail.CONFIGURATION_ERROR))) { + logger.debug("{}: Status update triggered thing initialization", thingName); + initializeThing(); // may fire an exception if initialization failed + } + + // Get profile, if refreshSettings == true reload settings from device + profile = getProfile(refreshSettings); + + logger.trace("{}: Updating status", thingName); + ShellySettingsStatus status = api.getStatus(); + + // If status update was successful the thing must be online + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.debug("{}: Thing {} is now online", thingName, getThing().getLabel()); + updateStatus(ThingStatus.ONLINE); // if API call was successful the thing must be online + } + + // map status to channels + updated |= updateDeviceStatus(status); + updated |= ShellyComponents.updateMeters(this, status); + updated |= ShellyComponents.updateSensors(this, status); + + if (scheduledUpdates <= 1) { + fillDeviceStatus(status, updated); + } + } + } catch (IOException e) { + // http call failed: go offline except for battery devices, which might be in + // sleep mode + // once the next update is successful the device goes back online + if (e.getMessage().contains("Timeout")) { + logger.debug("Device {} is not reachable, update canceled ({} skips, {} scheduledUpdates)!", thingName, + skipCount, scheduledUpdates); + } else if (e.getMessage().contains("Not calibrated!")) { + logger.debug("{}: Roller is not calibrated! Use the Shelly App or Web UI to run calibration.", + thingName); + } else { + logger.debug("{}: Unable to update status: {} ({})", thingName, e.getMessage(), e.getClass()); + } + if (e.getMessage().contains(APIERR_HTTP_401_UNAUTHORIZED) || (profile != null && !profile.isSensor)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } catch (NullPointerException e) { + logger.warn("{}: Unable to update status: {} ({})", thingName, e.getMessage(), e.getClass()); + } finally { + if (scheduledUpdates > 0) { + --scheduledUpdates; + logger.debug("{}: {} more updates requested", thingName, scheduledUpdates); + } else { + + } + if ((skipUpdate >= cacheCount) && !channelCache) { + logger.debug("{}: Enabling channel cache ({} updates / {}s)", thingName, skipUpdate, + cacheCount * UPDATE_STATUS_INTERVAL_SECONDS); + channelCache = true; + } + } + + } + + @SuppressWarnings("null") + private void fillDeviceStatus(ShellySettingsStatus status, boolean updated) { + String alarm = ""; + boolean force = false; + + // Update uptime and WiFi + if (updated) { + lastUpdateTs = now(); + } + long uptime = getLong(status.uptime); + Integer rssi = getInteger(status.wifiSta.rssi); + updateChannel(CHANNEL_GROUP_DEV_STATUS, CHANNEL_DEVST_UPTIME, + toQuantityType(new DecimalType(uptime), SmartHomeUnits.SECOND)); + updateChannel(CHANNEL_GROUP_DEV_STATUS, CHANNEL_DEVST_RSSI, mapSignalStrength(rssi)); + + // Check various device indicators like overheating + if ((status.uptime < lastUptime) && (profile != null) && !profile.hasBattery) { + alarm = ALARM_TYPE_RESTARTED; + force = true; + } + lastUptime = uptime; + + if ((rssi < SIGNAL_ALARM_MIN_RSSI) && ((lastAlarmTs == 0))) { + alarm = ALARM_TYPE_WEAKSIGNAL; + } + if (getBool(status.overtemperature)) { + alarm = ALARM_TYPE_OVERTEMP; + } + if (getBool(status.overload)) { + alarm = ALARM_TYPE_OVERLOAD; + } + if (getBool(status.loaderror)) { + alarm = ALARM_TYPE_LOADERR; + } + + if (!alarm.isEmpty()) { + postAlarm(alarm, force); + } + } + + /** + * Save alarm to the lastAlarm channel + * + * @param alarm Alarm Message + */ + public void postAlarm(String alarm, boolean force) { + String channelId = mkChannelId(CHANNEL_GROUP_DEV_STATUS, CHANNEL_DEVST_ALARM); + Object value = getChannelValue(CHANNEL_GROUP_DEV_STATUS, CHANNEL_DEVST_ALARM); + String lastAlarm = value != null ? value.toString() : null; + + if (force || ((lastAlarm != null) && !lastAlarm.equals(alarm)) + || (now() > (lastAlarmTs + HEALTH_CHECK_INTERVAL_SEC))) { + if (alarm.equals(ALARM_TYPE_NONE)) { + channelData.put(channelId, alarm); // init channel + } else { + logger.warn("{}: Alarm condition: {}", thingName, alarm); + triggerChannel(channelId, alarm); + channelData.replace(channelId, alarm); + lastAlarmTs = now(); + } + } + } + + /** + * Callback for device events + * + * @param deviceName device receiving the event + * @param parameters parameters from the event URL + * @param data the HTML input data + * @return true if event was processed + */ + @SuppressWarnings({ "null" }) + @Override + public boolean onEvent(String deviceName, String deviceIndex, String type, Map<String, String> parameters) { + if (profile == null) { + logger.debug("OnEvent: Thing not yet initialized, skip event"); + } + if (thingName.equalsIgnoreCase(deviceName) || config.deviceIp.equals(deviceName)) { + logger.debug("{}: Event received: class={}, index={}, parameters={}", deviceName, type, deviceIndex, + parameters.toString()); + boolean hasBattery = profile != null && profile.hasBattery ? true : false; + if (profile == null) { + logger.debug("{}: Device is not yet initialized, event triggers initialization", deviceName); + } else { + + String group = ""; + Integer rindex = !deviceIndex.isEmpty() ? Integer.parseInt(deviceIndex) + 1 : -1; + if (type.equals(EVENT_TYPE_RELAY)) { + group = profile.numRelays <= 1 ? CHANNEL_GROUP_RELAY_CONTROL + : CHANNEL_GROUP_RELAY_CONTROL + rindex.toString(); + } + if (type.equals(EVENT_TYPE_ROLLER)) { + group = profile.numRollers <= 1 ? CHANNEL_GROUP_ROL_CONTROL + : CHANNEL_GROUP_ROL_CONTROL + rindex.toString(); + } + if (type.equals(EVENT_TYPE_LIGHT)) { + group = profile.numRelays <= 1 ? CHANNEL_GROUP_LIGHT_CONTROL + : CHANNEL_GROUP_LIGHT_CONTROL + rindex.toString(); + } + if (type.equals(EVENT_TYPE_SENSORDATA)) { + group = CHANNEL_GROUP_SENSOR; + } + if (group.isEmpty()) { + logger.debug("Unsupported event class: {}", type); + return false; + } + + // map some of the events to system defined button triggers + String channel = ""; + String payload = ""; + String event = type.contentEquals(EVENT_TYPE_SENSORDATA) ? SHELLY_EVENT_SENSORDATA + : parameters.get("type"); + switch (event) { + case SHELLY_EVENT_SHORTPUSH: + channel = CHANNEL_BUTTON_TRIGGER; + payload = CommonTriggerEvents.SHORT_PRESSED; + break; + case SHELLY_EVENT_LONGPUSH: + channel = CHANNEL_BUTTON_TRIGGER; + payload = CommonTriggerEvents.LONG_PRESSED; + break; + + case SHELLY_EVENT_ROLLER_OPEN: + case SHELLY_EVENT_ROLLER_CLOSE: + case SHELLY_EVENT_ROLLER_STOP: + channel = CHANNEL_EVENT_TRIGGER; + payload = event; + break; + + default: + // triggered will be provided by input/output channel or sensor channels + } + + if (!payload.isEmpty()) { + // Pass event to trigger channel + payload = payload.toUpperCase(); + logger.debug("{}: Post event {}", thingName, payload); + triggerChannel(mkChannelId(group, channel), payload); + } + } + + // request update on next interval (2x for non-battery devices) + requestUpdates(scheduledUpdates >= 2 ? 0 : !hasBattery ? 2 : 1, true); + return true; + } + return false; + } + + /** + * Initialize the binding's thing configuration, calc update counts + */ + protected void initializeThingConfig() { + config = getConfigAs(ShellyThingConfiguration.class); + config.localIp = localIP; + config.httpPort = httpPort; + if (config.userId.isEmpty() && !bindingConfig.defaultUserId.isEmpty()) { + config.userId = bindingConfig.defaultUserId; + config.password = bindingConfig.defaultPassword; + logger.debug("{}: Using binding default userId", thingName); + } + if (config.updateInterval == 0) { + config.updateInterval = UPDATE_STATUS_INTERVAL_SECONDS * UPDATE_SKIP_COUNT; + } + if (config.updateInterval < UPDATE_MIN_DELAY) { + config.updateInterval = UPDATE_MIN_DELAY; + } + skipCount = config.updateInterval / UPDATE_STATUS_INTERVAL_SECONDS; + } + + /** + * Checks the http response for authorization error. + * If the authorization failed the binding can't access the device settings and determine the thing type. In this + * case the thing type shelly-unknown is set. + * + * @param response exception details including the http respone + * @return true if the authorization failed + */ + private boolean authorizationFailed(String response) { + if (response.contains(APIERR_HTTP_401_UNAUTHORIZED)) { + // If the device is password protected the API doesn't provide settings to the device settings + logger.warn("{}: Device {} reported 'Access Denied' (user id/password mismatch)", getThing().getLabel(), + config.deviceIp); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Access denied, configure user id and password"); + changeThingType(THING_TYPE_SHELLYPROTECTED_STR, ""); + return true; + } + return false; + } + + /** + * Change type of this thing. + * + * @param serviceName mDNS service name from thing discovery - will be used to build the Thing type name + * @param mode + */ + private void changeThingType(String thingType, String mode) { + ThingTypeUID thingTypeUID = getThingTypeUID(thingType, mode); + if (!thingTypeUID.equals(THING_TYPE_SHELLYUNKNOWN)) { + logger.debug("{}: Changing thing type to {}", getThing().getLabel(), thingTypeUID.toString()); + Map<String, String> properties = editProperties(); + properties.replace(PROPERTY_DEV_TYPE, thingType); + updateProperties(properties); + changeThingType(thingTypeUID, getConfig()); + } + } + + /** + * Start the background updates + */ + @SuppressWarnings("null") + protected void startUpdateJob() { + if ((statusJob == null) || statusJob.isCancelled()) { + statusJob = scheduler.scheduleWithFixedDelay(this::updateStatus, 2, UPDATE_STATUS_INTERVAL_SECONDS, + TimeUnit.SECONDS); + Validate.notNull(statusJob, "statusJob must not be null"); + logger.debug("{}: Update status job started, interval={}*{}={}sec.", thingName, skipCount, + UPDATE_STATUS_INTERVAL_SECONDS, skipCount * UPDATE_STATUS_INTERVAL_SECONDS); + } + } + + /** + * Flag the status job to do an exceptional update (something happened) rather + * than waiting until the next regular poll + * + * @param requestCount number of polls to execute + * @param refreshSettings true=force a /settings query + * @return true=Update schedule, false=skipped (too many updates already + * scheduled) + */ + public boolean requestUpdates(int requestCount, boolean refreshSettings) { + this.refreshSettings |= refreshSettings; + if (refreshSettings) { + logger.debug("{}: Request settings refresh", thingName); + scheduledUpdates = 1; + return true; + } + if (scheduledUpdates < 10) { // < 30s + scheduledUpdates += requestCount; + return true; + } + return false; + } + + /** + * Update one channel. Use Channel Cache to avoid unnecessary updates (and avoid + * messing up the log with those updates) + * + * @param channelId Channel id + * @param value Value (State) + * @param forceUpdate true: ignore cached data, force update; false check cache of changed data + * @return true, if successful + */ + @SuppressWarnings("null") + public boolean updateChannel(String channelId, State value, Boolean forceUpdate) { + Validate.notNull(channelData); + Validate.notNull(channelId); + Validate.notNull(value, "updateChannel(): value must not be null!"); + try { + Object current = channelData.get(channelId); + // logger.trace("{}: Predict channel {}.{} to become {} (type {}).", thingName, + // group, channel, value, value.getClass()); + if (!channelCache || forceUpdate || (current == null) || !current.equals(value)) { + updateState(channelId, value); + if (current == null) { + channelData.put(channelId, value); + } else { + channelData.replace(channelId, value); + } + logger.trace("{}: Channel {} updated with {} (type {}).", thingName, channelId, value, + value.getClass()); + return true; + } + } catch (NullPointerException e) { + logger.debug("Unable to update channel {}.{} with {} (type {}): {} ({})", thingName, channelId, value, + value.getClass(), e.getMessage(), e.getClass()); + } + return false; + } + + public boolean updateChannel(String group, String channel, State value) { + return updateChannel(mkChannelId(group, channel), value, false); + } + + /** + * Update thing properties with dynamic values + * + * @param profile The device profile + * @param status the /status result + */ + protected void updateProperties(ShellyDeviceProfile profile, ShellySettingsStatus status) { + Map<String, Object> properties = fillDeviceProperties(profile); + + // add status properties + Validate.notNull(status, "updateProperties(): status must not be null!"); + if (status.wifiSta != null) { + properties.put(PROPERTY_WIFI_NETW, getString(status.wifiSta.ssid)); + properties.put(PROPERTY_WIFI_IP, getString(status.wifiSta.ip)); + } + if (status.update != null) { + properties.put(PROPERTY_UPDATE_STATUS, getString(status.update.status)); + properties.put(PROPERTY_UPDATE_AVAILABLE, getBool(status.update.hasUpdate) ? "yes" : "no"); + properties.put(PROPERTY_UPDATE_CURR_VERS, getString(status.update.oldVersion)); + properties.put(PROPERTY_UPDATE_NEW_VERS, getString(status.update.newVersion)); + } + + Map<String, String> thingProperties = new HashMap<String, String>(); + for (Map.Entry<String, Object> property : properties.entrySet()) { + thingProperties.put(property.getKey(), (String) property.getValue()); + } + updateProperties(thingProperties); + logger.trace("{}: Properties updated", thingName); + } + + /** + * Add one property to the Thing Properties + * + * @param key Name of the property + * @param value Value of the property + */ + public void updateProperties(String key, String value) { + Map<String, String> thingProperties = editProperties(); + if (thingProperties.containsKey(key)) { + thingProperties.replace(key, value); + } else { + thingProperties.put(key, value); + } + updateProperties(thingProperties); + logger.trace("{}: Properties updated", thingName); + } + + /** + * Get one property from the Thing Properties + * + * @param key property name + * @return property value or "" if property is not set + */ + @SuppressWarnings({ "null" }) + public String getProperty(String key) { + Map<String, String> thingProperties = getThing().getProperties(); + @Nullable + String value = thingProperties.get(key); + return value != null ? value : ""; + } + + /** + * Fill Thing Properties with device attributes + * + * @param profile Property Map to full + * @return a full property map + */ + @SuppressWarnings("null") + public static Map<String, Object> fillDeviceProperties(ShellyDeviceProfile profile) { + Map<String, Object> properties = new HashMap<String, Object>(); + + properties.put(PROPERTY_VENDOR, VENDOR); + if (profile != null) { + properties.put(PROPERTY_MODEL_ID, getString(profile.settings.device.type)); + properties.put(PROPERTY_MAC_ADDRESS, profile.mac); + properties.put(PROPERTY_FIRMWARE_VERSION, + profile.fwVersion + "/" + profile.fwDate + "(" + profile.fwId + ")"); + properties.put(PROPERTY_HWREV, profile.hwRev); + properties.put(PROPERTY_HWBATCH, profile.hwBatchId); + properties.put(PROPERTY_DEV_MODE, profile.mode); + properties.put(PROPERTY_NUM_RELAYS, profile.numRelays.toString()); + properties.put(PROPERTY_NUM_ROLLERS, profile.numRollers.toString()); + properties.put(PROPERTY_NUM_METER, profile.numMeters.toString()); + } + return properties; + } + + /** + * Return device profile. + * + * @param ForceRefresh true=force refresh before returning, false=return without + * refresh + * @return ShellyDeviceProfile instance + * @throws IOException + */ + @SuppressWarnings("null") + @Nullable + public ShellyDeviceProfile getProfile(boolean forceRefresh) throws IOException { + try { + refreshSettings |= forceRefresh; + if (refreshSettings) { + logger.debug("{}: Refresh settings", thingName); + profile = api.getDeviceProfile(getThing().getThingTypeUID().getId()); + } + } finally { + refreshSettings = false; + } + return profile; + } + + @Nullable + public ShellyDeviceProfile getProfile() { + return profile; + } + + @Nullable + protected ShellyHttpApi getShellyApi() { + return api; + } + + @Nullable + protected ShellyDeviceProfile getDeviceProfile() { + return profile; + } + + /** + * Get a value from the Channel Cache + * + * @param group Channel Group + * @param channel Channel Name + * @return the data from that channel + */ + @Nullable + public Object getChannelValue(String group, String channel) { + String key = mkChannelId(group, channel); + return channelData.get(key); + } + + public void triggerChannel(String group, String channel, String payload) { + triggerChannel(mkChannelId(group, channel), payload); + } + + /** + * Shutdown thing, make sure background jobs are canceled + */ + @SuppressWarnings("null") + @Override + public void dispose() { + logger.debug("{}: Shutdown thing", thingName); + try { + if (coap != null) { + coap.stop(); + coap = null; + } + if (statusJob != null) { + statusJob.cancel(true); + statusJob = null; + } + logger.debug("{}: Shelly statusJob stopped", thingName); + } catch (Exception e) { + logger.debug("Exception on dispose(): {} ({})", e.getMessage(), e.getClass()); + } finally { + super.dispose(); + } + } + + /** + * Device specific command handlers are overriding this method to do additional stuff + * + * @throws IOException Communication problem on the API call + */ + public boolean handleDeviceCommand(ChannelUID channelUID, Command command) throws IOException { + return false; + } + + /** + * Device specific handlers are overriding this method to do additional stuff + * + * @throws IOException Communication problem on the API call + */ + public boolean updateDeviceStatus(ShellySettingsStatus status) throws IOException { + return false; + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyColorUtils.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyColorUtils.java new file mode 100644 index 0000000000000..abb5f71ce142b --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyColorUtils.java @@ -0,0 +1,186 @@ +/** + * 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.shelly.internal.handler; + +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.math.BigDecimal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.HSBType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.PercentType; + +/** + * The {@link ShellyColorUtils} provides some utility functions around RGBW handling. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyColorUtils { + public ShellyColorUtils() { + } + + public ShellyColorUtils(ShellyColorUtils col) { + setRed(col.red); + setGreen(col.green); + setBlue(col.blue); + setWhite(col.white); + setGain(col.gain); + setBrightness(col.brightness); + setTemp(col.temp); + } + + OnOffType power = OnOffType.OFF; + String mode = ""; + Integer red = 0; + Integer green = 0; + Integer blue = 0; + Integer white = 0; + PercentType percentRed = new PercentType(0); + PercentType percentGreen = new PercentType(0); + PercentType percentBlue = new PercentType(0); + PercentType percentWhite = new PercentType(0); + + void setMode(String mode) { + this.mode = mode; + } + + boolean setRGBW(int red, int green, int blue, int white) { + setRed(red); + setGreen(green); + setBlue(blue); + setWhite(white); + return true; + } + + boolean setRed(int value) { + boolean changed = red != value; + red = value; + percentRed = toPercent(red); + return changed; + } + + boolean setGreen(int value) { + boolean changed = green != value; + green = value; + percentGreen = toPercent(green); + return changed; + } + + boolean setBlue(int value) { + boolean changed = blue != value; + blue = value; + percentBlue = toPercent(blue); + return changed; + } + + boolean setWhite(int value) { + boolean changed = white != value; + white = value; + percentWhite = toPercent(white); + return changed; + } + + Integer gain = 0; + Integer brightness = 0; + Integer temp = 0; + PercentType percentGain = new PercentType(0); + PercentType percentBrightness = new PercentType(0); + PercentType percentTemp = new PercentType(0); + + boolean setBrightness(int value) { + boolean changed = brightness != value; + brightness = value; + percentBrightness = toPercent(brightness, SHELLY_MIN_BRIGHTNESS, SHELLY_MAX_BRIGHTNESS); + return changed; + } + + boolean setGain(int value) { + boolean changed = gain != value; + gain = value; + percentGain = toPercent(gain, SHELLY_MIN_GAIN, SHELLY_MAX_GAIN); + return changed; + } + + boolean setTemp(int value) { + boolean changed = temp != value; + temp = value; + percentTemp = toPercent(temp, MIN_COLOR_TEMPERATURE, MAX_COLOR_TEMPERATURE); + return changed; + } + + Integer effect = 0; + + boolean setEffect(int value) { + boolean changed = effect != value; + effect = value; + return changed; + } + + public HSBType toHSB() { + return HSBType.fromRGB(red, green, blue); + } + + public Integer[] fromRGBW(String rgbwString) { + Integer values[] = new Integer[4]; + values[0] = values[1] = values[2] = values[3] = -1; + try { + /* + * TEST + * StringTokenizer st = new StringTokenizer(rgbw, ","); + * int i = 0; + * while (st.hasMoreElements()) { + * values[i++] = Integer.parseInt((String) st.nextElement()); + * } + */ + String rgbw[] = rgbwString.split(","); + for (int i = 0; i < rgbw.length; i++) { + values[i] = Integer.parseInt(rgbw[i]); + } + } catch (NullPointerException e) { + throw new IllegalArgumentException( + "Unable to convert fullColor value: " + rgbwString + ", " + e.getMessage()); + } + if (values[0] != -1) { + setRed(values[0]); + } + if (values[1] != -1) { + setGreen(values[1]); + } + if (values[2] != -1) { + setBlue(values[2]); + } + if (values[3] != -1) { + setWhite(values[3]); + } + return values; + } + + private static PercentType toPercent(Integer value) { + return toPercent(value, 0, SHELLY_MAX_COLOR); + } + + private static PercentType toPercent(@Nullable Integer _value, Integer min, Integer max) { + Double range = max.doubleValue() - min.doubleValue(); + Double value = _value != null ? _value.doubleValue() : 0; + value = value < min ? min.doubleValue() : value; + value = value > max ? max.doubleValue() : value; + Double percent = 0.0; + if (range > 0) { + percent = new Double(Math.round((value - min) / range * 100)); + } + return new PercentType(new BigDecimal(percent)); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java new file mode 100644 index 0000000000000..717238476a658 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyComponents.java @@ -0,0 +1,228 @@ +/** + * 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.shelly.internal.handler; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.io.IOException; + +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsEMeter; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsMeter; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusSensor; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; + +/*** + * The{@link ShellyComponents} implements updates for supplemental components + * Meter will be used by Relay + Light + * Sensor is also part of Flood, Sense + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyComponents { + /** + * Update Meter channel + * + * @param th Thing Handler instance + * @param profile ShellyDeviceProfile + * @param status Last ShellySettingsStatus + */ + @SuppressWarnings("null") + public static boolean updateMeters(ShellyBaseHandler th, ShellySettingsStatus status) { + Validate.notNull(th); + ShellyDeviceProfile profile = th.getProfile(); + + boolean updated = false; + if (profile.hasMeter && ((status.meters != null) || (status.emeters != null))) { + if (!profile.isRoller) { + th.logger.trace("{}: Updating {} {}meter(s)", th.thingName, profile.numMeters.toString(), + !profile.isEMeter ? "standard " : "e-"); + + // In Relay mode we map eacher meter to the matching channel group + int m = 0; + if (!profile.isEMeter) { + for (ShellySettingsMeter meter : status.meters) { + Integer meterIndex = m + 1; + if (getBool(meter.isValid) || profile.isLight) { // RGBW2-white doesn't report das flag + // correctly in white mode + String groupName = ""; + if (profile.numMeters > 1) { + groupName = CHANNEL_GROUP_METER + meterIndex.toString(); + } else { + groupName = CHANNEL_GROUP_METER; + } + updated |= th.updateChannel(groupName, CHANNEL_METER_CURRENTWATTS, + toQuantityType(getDouble(meter.power), DIGITS_WATT, SmartHomeUnits.WATT)); + // convert Watt/Min to kw/h + if (meter.total != null) { + updated |= th.updateChannel(groupName, CHANNEL_METER_TOTALKWH, toQuantityType( + getDouble(meter.total) / 60 / 1000, DIGITS_KWH, SmartHomeUnits.KILOWATT_HOUR)); + } + if (meter.counters != null) { + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN1, + toQuantityType(getDouble(meter.counters[0]), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN2, + toQuantityType(getDouble(meter.counters[1]), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN3, + toQuantityType(getDouble(meter.counters[2]), DIGITS_WATT, SmartHomeUnits.WATT)); + } + th.updateChannel(groupName, CHANNEL_LAST_UPDATE, + getTimestamp(getString(profile.settings.timezone), getLong(meter.timestamp))); + m++; + } + } + } else { + for (ShellySettingsEMeter emeter : status.emeters) { + Integer meterIndex = m + 1; + if (getBool(emeter.isValid)) { + String groupName = profile.numMeters > 1 ? CHANNEL_GROUP_METER + meterIndex.toString() + : CHANNEL_GROUP_METER; + // convert Watt/Hour tok w/h + updated |= th.updateChannel(groupName, CHANNEL_METER_CURRENTWATTS, + toQuantityType(getDouble(emeter.power), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_TOTALKWH, toQuantityType( + getDouble(emeter.total) / 60 / 1000, DIGITS_KWH, SmartHomeUnits.KILOWATT_HOUR)); + updated |= th.updateChannel(groupName, CHANNEL_EMETER_TOTALRET, toQuantityType( + getDouble(emeter.totalReturned) / 1000, DIGITS_KWH, SmartHomeUnits.KILOWATT_HOUR)); + updated |= th.updateChannel(groupName, CHANNEL_EMETER_REACTWATTS, + toQuantityType(getDouble(emeter.reactive), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_EMETER_VOLTAGE, + toQuantityType(getDouble(emeter.voltage), DIGITS_VOLT, SmartHomeUnits.VOLT)); + th.updateChannel(groupName, CHANNEL_LAST_UPDATE, + getTimestamp(getString(profile.settings.timezone), getLong(emeter.timestamp))); + m++; + } + } + } + } else { + // In Roller Mode we accumulate all meters to a single set of meters + th.logger.trace("{}: Updating roller meter", th.thingName); + Double currentWatts = 0.0; + Double totalWatts = 0.0; + Double lastMin1 = 0.0; + Double lastMin2 = 0.0; + Double lastMin3 = 0.0; + Long timestamp = 0l; + String groupName = CHANNEL_GROUP_METER; + for (ShellySettingsMeter meter : status.meters) { + if (meter.isValid) { + currentWatts += getDouble(meter.power); + totalWatts += getDouble(meter.total); + if (meter.counters != null) { + lastMin1 += getDouble(meter.counters[0]); + lastMin2 += getDouble(meter.counters[1]); + lastMin3 += getDouble(meter.counters[2]); + } + if (getLong(meter.timestamp) > timestamp) { + timestamp = getLong(meter.timestamp); // newest one + } + } + } + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN1, + toQuantityType(getDouble(lastMin1), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN2, + toQuantityType(getDouble(lastMin2), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_LASTMIN3, + toQuantityType(getDouble(lastMin3), DIGITS_WATT, SmartHomeUnits.WATT)); + + // convert totalWatts into kw/h + totalWatts = totalWatts / (60.0 * 10000.0); + updated |= th.updateChannel(groupName, CHANNEL_METER_CURRENTWATTS, + toQuantityType(getDouble(currentWatts), DIGITS_WATT, SmartHomeUnits.WATT)); + updated |= th.updateChannel(groupName, CHANNEL_METER_TOTALKWH, + toQuantityType(getDouble(totalWatts), DIGITS_KWH, SmartHomeUnits.KILOWATT_HOUR)); + + updated |= th.updateChannel(groupName, CHANNEL_LAST_UPDATE, + getTimestamp(getString(profile.settings.timezone), timestamp)); + } + } + return updated; + } + + /** + * Update Sensor channel + * + * @param th Thing Handler instance + * @param profile ShellyDeviceProfile + * @param status Last ShellySettingsStatus + * + * @throws IOException + */ + @SuppressWarnings("null") + public static boolean updateSensors(ShellyBaseHandler th, ShellySettingsStatus status) throws IOException { + Validate.notNull(th); + ShellyDeviceProfile profile = th.getProfile(); + + boolean updated = false; + if (profile.isSensor || profile.hasBattery) { + th.logger.debug("{}: Updating sensor", th.thingName); + ShellyStatusSensor sdata = th.api.getSensorStatus(); + if (sdata != null) { + if (getBool(sdata.tmp.isValid)) { + th.logger.trace("{}: Updating temperature", th.thingName); + DecimalType temp = getString(sdata.tmp.units).toUpperCase().equals(SHELLY_TEMP_CELSIUS) + ? getDecimal(sdata.tmp.tC) + : getDecimal(sdata.tmp.tF); + if (getString(sdata.tmp.units).toUpperCase().equals(SHELLY_TEMP_FAHRENHEIT)) { + // convert Fahrenheit to Celsius + temp = new DecimalType((temp.floatValue() - 32) * 5 / 9.0); + } + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_TEMP, + toQuantityType(temp.doubleValue(), DIGITS_TEMP, SIUnits.CELSIUS)); + } + if (sdata.hum != null) { + th.logger.trace("{}: Updating humidity", th.thingName); + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_HUM, + toQuantityType(getDouble(sdata.hum.value), DIGITS_PERCENT, SmartHomeUnits.PERCENT)); + } + if ((sdata.lux != null) && getBool(sdata.lux.isValid)) { + th.logger.trace("{}: Updating lux", th.thingName); + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_LUX, + toQuantityType(getDouble(sdata.lux.value), DIGITS_LUX, SmartHomeUnits.LUX)); + } + if (sdata.flood != null) { + th.logger.trace("{}: Updating flood", th.thingName); + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_FLOOD, getOnOff(sdata.flood)); + } + if (sdata.bat != null) { + th.logger.trace("{}: Updating battery", th.thingName); + updated |= th.updateChannel(CHANNEL_GROUP_BATTERY, CHANNEL_SENSOR_BAT_LEVEL, + toQuantityType(getDouble(sdata.bat.value), DIGITS_PERCENT, SmartHomeUnits.PERCENT)); + if (sdata.bat.value != null) { // no update for Sense + updated |= th.updateChannel(CHANNEL_GROUP_BATTERY, CHANNEL_SENSOR_BAT_LOW, + getDouble(sdata.bat.value) < th.config.lowBattery ? OnOffType.ON : OnOffType.OFF); + updated |= th.updateChannel(CHANNEL_GROUP_BATTERY, CHANNEL_SENSOR_BAT_VOLT, + toQuantityType(getDouble(sdata.bat.voltage), DIGITS_VOLT, SmartHomeUnits.VOLT)); + th.postAlarm(ALARM_TYPE_LOW_BATTERY, false); + } + } + if (profile.isSense) { + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_MOTION, getOnOff(sdata.motion)); + updated |= th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_SENSOR_CHARGER, getOnOff(sdata.charger)); + } + + th.updateChannel(CHANNEL_GROUP_SENSOR, CHANNEL_LAST_UPDATE, getTimestamp()); + } + } + return updated; + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyDeviceListener.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyDeviceListener.java new file mode 100644 index 0000000000000..4d56ac65298c8 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyDeviceListener.java @@ -0,0 +1,32 @@ +/** + * 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.shelly.internal.handler; + +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; + +/** + * {@link DeviceUpdateListener} can register on the {@link TradfriGatewayHandler} to be informed about details about + * devices. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public interface ShellyDeviceListener { + + /** + * This method is called when new device information is received. + */ + public boolean onEvent(String deviceName, String deviceIndex, String eventType, Map<String, String> parameters); +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyLightHandler.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyLightHandler.java new file mode 100644 index 0000000000000..be3c694ba1a4b --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyLightHandler.java @@ -0,0 +1,509 @@ +/** + * 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.shelly.internal.handler; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.HSBType; +import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyShortLightStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusLight; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusLightChannel; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; +import org.openhab.binding.shelly.internal.coap.ShellyCoapServer; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ShellyLightHandler} handles light (bulb+rgbw2) specific commands and status. All other commands will be + * routet of the generic thing handler. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyLightHandler extends ShellyBaseHandler { + private final Logger logger = LoggerFactory.getLogger(ShellyLightHandler.class); + private @Nullable Map<Integer, ShellyColorUtils> channelColors; + + /** + * Constructor + * + * @param thing The thing passed by the HandlerFactory + * @param bindingConfig configuration of the binding + * @param coapServer coap server instance + * @param localIP local IP of the openHAB host + * @param httpPort port of the openHAB HTTP API + */ + public ShellyLightHandler(Thing thing, ShellyBindingConfiguration bindingConfig, + @Nullable ShellyCoapServer coapServer, String localIP, int httpPort) { + super(thing, bindingConfig, coapServer, localIP, httpPort); + channelColors = new HashMap<Integer, ShellyColorUtils>(); + } + + @Override + public void initialize() { + logger.debug("Thing is using class {}", this.getClass()); + super.initialize(); + } + + @SuppressWarnings("null") + @Override + public boolean handleDeviceCommand(ChannelUID channelUID, Command command) throws IOException { + String groupName = channelUID.getGroupId(); + Integer lightId = getLightIdFromGroup(groupName); + logger.trace("{}: Execute command {} on channel {}, lightId={}", thingName, command.toString(), + channelUID.getAsString(), lightId); + + Validate.notNull(profile, "DeviceProfile must not be null, thing not initialized"); + Validate.notNull(api, "handleCommand(): api must not be null!"); + ShellyColorUtils oldCol = getCurrentColors(lightId); + Validate.notNull(oldCol, "oldCol must not be null"); + oldCol.mode = profile.mode; + ShellyColorUtils col = new ShellyColorUtils(oldCol); + Validate.notNull(oldCol, "copy of oldCol must not be null"); + + boolean update = true; + switch (channelUID.getIdWithoutGroup()) { + default: // non-bulb commands will be handled by the generic handler + return false; + + case CHANNEL_LIGHT_POWER: + logger.debug("{}: Switch light {}", thingName, command.toString()); + Validate.isTrue(command instanceof OnOffType, "Invalid value for power (ON or OFF): {}", + command.toString()); + api.setLightParm(lightId, SHELLY_LIGHT_TURN, + (OnOffType) command == OnOffType.ON ? SHELLY_API_ON : SHELLY_API_OFF); + col.power = (OnOffType) command; + update = (OnOffType) command == OnOffType.ON; + break; + case CHANNEL_LIGHT_COLOR_MODE: + logger.debug("{}: Select color mode {}", thingName, command.toString()); + Validate.isTrue(command instanceof OnOffType, + "Invalid value for color mode (ON or OFF): " + command.toString()); + col.setMode((OnOffType) command == OnOffType.ON ? SHELLY_MODE_COLOR : SHELLY_MODE_WHITE); + break; + case CHANNEL_COLOR_PICKER: + logger.debug("{}: Update colors from color picker", thingName); + update = handleColorPicker(profile, lightId, col, command); + break; + case CHANNEL_COLOR_FULL: + logger.debug("{}: Set colors to {}", thingName, command.toString()); + handleFullColor(col, command); + break; + case CHANNEL_COLOR_RED: + col.setRed(setColor(lightId, SHELLY_COLOR_RED, command, SHELLY_MAX_COLOR)); + break; + case CHANNEL_COLOR_GREEN: + col.setGreen(setColor(lightId, SHELLY_COLOR_GREEN, command, SHELLY_MAX_COLOR)); + break; + case CHANNEL_COLOR_BLUE: + col.setBlue(setColor(lightId, SHELLY_COLOR_BLUE, command, SHELLY_MAX_COLOR)); + break; + case CHANNEL_COLOR_WHITE: + col.setWhite(setColor(lightId, SHELLY_COLOR_WHITE, command, SHELLY_MAX_COLOR)); + break; + case CHANNEL_COLOR_GAIN: + col.setGain(setColor(lightId, SHELLY_COLOR_GAIN, command, SHELLY_MIN_GAIN, SHELLY_MAX_GAIN)); + break; + case CHANNEL_BRIGHTNESS: // only in white mode + Integer value = -1; + if (command instanceof OnOffType) { // Switch + logger.debug("Switch light {}", command.toString()); + api.setRelayTurn(lightId, (OnOffType) command == OnOffType.ON ? SHELLY_API_ON : SHELLY_API_OFF); + requestUpdates(1, false); + break; + } + + if (command instanceof PercentType) { + Float percent = ((PercentType) command).floatValue(); + value = percent.intValue(); // 0..100% = 0..100 + logger.debug("{}: Set brightness to {}%/{}", thingName, percent, value); + } else if (command instanceof DecimalType) { + value = ((DecimalType) command).intValue(); + logger.debug("{}: Set brightness to {} (Integer)", thingName, value); + } + if (value == 0) { + logger.debug("{}: Brightness=0 -> switch light OFF", thingName); + api.setRelayTurn(lightId, SHELLY_API_OFF); + requestUpdates(1, false); + break; + } + + if (command instanceof IncreaseDecreaseType) { + ShellyShortLightStatus light = api.getLightStatus(lightId); + Validate.notNull(light, "Unable to get Light status for brightness"); + + if (((IncreaseDecreaseType) command).equals(IncreaseDecreaseType.INCREASE)) { + value = Math.min(light.brightness + DIM_STEPSIZE, 100); + } else { + value = Math.max(light.brightness - DIM_STEPSIZE, 0); + } + logger.trace("{}: Change brightness from {} to {}", thingName, light.brightness, value); + } + + validateRange("brightness", value, 0, 100); + logger.debug("{}: Set brightness to", value); + col.setBrightness(value); + break; + + case CHANNEL_COLOR_TEMP: + Integer temp = -1; + if (command instanceof PercentType) { + logger.debug("{}: Set color temp to {}%", thingName, ((PercentType) command).floatValue()); + Float percent = ((PercentType) command).floatValue() / 100; + temp = new DecimalType( + MIN_COLOR_TEMPERATURE + ((MAX_COLOR_TEMPERATURE - MIN_COLOR_TEMPERATURE)) * percent) + .intValue(); + logger.debug("{}: Converted color-temp {}% to {}K (from Percent to Integer)", thingName, percent, + temp); + } else if (command instanceof DecimalType) { + temp = ((DecimalType) command).intValue(); + logger.debug("{}: Set color temp to {}K (Integer)", thingName, temp); + } + validateRange(CHANNEL_COLOR_TEMP, temp, MIN_COLOR_TEMPERATURE, MAX_COLOR_TEMPERATURE); + col.setTemp(temp); + break; + + case CHANNEL_COLOR_EFFECT: + Integer effect = ((DecimalType) command).intValue(); + logger.debug("{}: Set color effect to {}", thingName, effect); + validateRange("effect", effect, SHELLY_MIN_EFFECT, SHELLY_MAX_EFFECT); + col.setEffect(effect.intValue()); + break; + } + + if (update) { + // check for switching color mode + if (profile.isBulb && !col.mode.isEmpty() && !col.mode.equals(oldCol.mode)) { + logger.debug("{}: Color mode changed from {} to {}, set new mode", thingName, oldCol.mode, col.mode); + api.setLightMode(col.mode); + } + + // send changed colors to the device + sendColors(profile, lightId, oldCol, col); + } + + return true; + + } + + @SuppressWarnings("null") + private boolean handleColorPicker(@Nullable ShellyDeviceProfile profile, Integer lightId, ShellyColorUtils col, + Command command) throws IOException { + Validate.notNull(profile); + + boolean updated = false; + if (command instanceof HSBType) { + HSBType hsb = (HSBType) command; + + logger.debug("HSB-Info={}, Hue={}, getRGB={}, toRGB={}/{}/{}", hsb.toString(), hsb.getHue(), + String.format("0x%08X", hsb.getRGB()), hsb.toRGB()[0], hsb.toRGB()[1], hsb.toRGB()[2]); + if (hsb.toString().contains("360,")) { + logger.debug("need to fix the Hue value (360->0)"); + HSBType fixHue = new HSBType(new DecimalType(0), hsb.getSaturation(), hsb.getBrightness()); + hsb = fixHue; + } + + col.setRed(getColorFromHSB(hsb.getRed())); // new Double((hsb.getRed().floatValue() * + // SATURATION_FACTOR)).intValue(); + col.setBlue(getColorFromHSB(hsb.getBlue())); // new Double((hsb.getBlue().floatValue() * + // SATURATION_FACTOR)).intValue(); + col.setGreen(getColorFromHSB(hsb.getGreen())); // new Double((hsb.getGreen().floatValue() * + // SATURATION_FACTOR)).intValue(); + col.setBrightness(getColorFromHSB(hsb.getBrightness(), BRIGHTNESS_FACTOR)); // new + // Double((hsb.getBrightness().floatValue() + // * + // white, gain and temp are not part of the HSB color scheme + updated = true; + } else if (command instanceof PercentType) { + if (!profile.inColor) { + col.brightness = SHELLY_MAX_BRIGHTNESS * ((PercentType) command).intValue(); + updated = true; + } + } else if (command instanceof OnOffType) { + logger.debug("{}: Switch light {}", thingName, command); + api.setLightParm(lightId, SHELLY_LIGHT_TURN, + (OnOffType) command == OnOffType.ON ? SHELLY_API_ON : SHELLY_API_OFF); + col.power = (OnOffType) command; + } else if (command instanceof IncreaseDecreaseType) { + if (!profile.inColor) { + logger.debug("{}: {} brightness by {}", thingName, command.toString(), SHELLY_DIM_STEPSIZE); + Double percent = ((PercentType) getChannelValue(CHANNEL_GROUP_COLOR_CONTROL, CHANNEL_BRIGHTNESS)) + .doubleValue(); + Integer currentBrightness = percent.intValue() * SHELLY_MAX_BRIGHTNESS; + Integer newBrightness; + if (command == IncreaseDecreaseType.DECREASE) { + newBrightness = Math.max(currentBrightness - SHELLY_DIM_STEPSIZE, 0); + } else { + newBrightness = Math.min(currentBrightness + SHELLY_DIM_STEPSIZE, SHELLY_MAX_BRIGHTNESS); + } + col.brightness = newBrightness; + updated = true; + } + } + return updated; + } + + private boolean handleFullColor(ShellyColorUtils col, Command command) + throws IOException, IllegalArgumentException { + String color = command.toString().toLowerCase(); + if (color.contains(",")) { + col.fromRGBW(color); + } else if (color.equals(SHELLY_COLOR_RED)) { + col.setRGBW(SHELLY_MAX_COLOR, 0, 0, 0); + } else if (color.equals(SHELLY_COLOR_GREEN)) { + col.setRGBW(0, SHELLY_MAX_COLOR, 0, 0); + } else if (color.equals(SHELLY_COLOR_BLUE)) { + col.setRGBW(0, 0, SHELLY_MAX_COLOR, 0); + } else if (color.equals(SHELLY_COLOR_YELLOW)) { + col.setRGBW(SHELLY_MAX_COLOR, SHELLY_MAX_COLOR, 0, 0); + } else if (color.equals(SHELLY_COLOR_WHITE)) { + col.setRGBW(0, 0, 0, SHELLY_MAX_COLOR); + col.setMode(SHELLY_MODE_WHITE); + } else { + throw new IllegalArgumentException("Invalid full color selection: " + color); + } + col.setMode(color.equals(SHELLY_MODE_WHITE) ? SHELLY_MODE_WHITE : SHELLY_MODE_COLOR); + return true; + } + + @SuppressWarnings({ "null", "unused" }) + private ShellyColorUtils getCurrentColors(Integer lightId) { + Validate.notNull(channelColors); + @Nullable + ShellyColorUtils col = channelColors.get(lightId); + if (col == null) { + col = new ShellyColorUtils(); // create a new entry + logger.trace("Colors entry created for lightId {}", lightId.toString()); + } else { + logger.trace("Colors loaded for lightId {}: RGBW={}/{}/{}/{}, gain={}, brightness={}, color temp={} ", + lightId.toString(), col.red, col.green, col.blue, col.white, col.gain, col.brightness, col.temp); + } + return col; + } + + @SuppressWarnings("null") + @Override + public boolean updateDeviceStatus(ShellySettingsStatus genericStatus) throws IOException { + Validate.notNull(profile, "updateThingStatus(): profile must not be null!"); + Validate.isTrue(profile.isLight, + "ERROR: Device " + profile.hostname + " is not a light. but class ShellyHandlerLight is called!"); + + Validate.notNull(profile); + ShellyStatusLight status = api.getLightStatus(); + Validate.notNull(status, "updateThingStatus(): status must not be null!"); + logger.trace("Updating bulb/rgw2 status for {}, in {} mode, {} channel(s)", profile.hostname, profile.mode, + status.lights.size()); + + // In white mode we have multiple channels + int lightId = 0; + boolean updated = false; + for (ShellyStatusLightChannel light : status.lights) { + Integer channelId = lightId + 1; + logger.trace("Updating lightId {}/{}", lightId, channelId.toString()); + String controlGroup = buildControlGroupName(profile, channelId); + + logger.trace("Updating light channels {}.{} (mode={})", profile.hostname, controlGroup, + getString(profile.settings.mode)); + + // The bulb has a combined channel set for color or white mode + // The RGBW2 uses 2 different thing types: color=1 channel, white=4 channel + if (profile.isBulb) { + updateChannel(CHANNEL_GROUP_LIGHT_CONTROL, CHANNEL_LIGHT_COLOR_MODE, getOnOff(profile.inColor)); + } + + ShellyColorUtils col = getCurrentColors(lightId); + Validate.notNull(col); + col.power = getBool(light.ison) ? OnOffType.ON : OnOffType.OFF; + + // Channel control/timer + // ShellyStatusLightChannel light = status.lights.get(i); + updated |= updateChannel(controlGroup, CHANNEL_LIGHT_POWER, getOnOff(light.ison)); + updated |= updateChannel(controlGroup, CHANNEL_TIMER_AUTOON, getDecimal(light.autoOn)); + updated |= updateChannel(controlGroup, CHANNEL_TIMER_AUTOOFF, getDecimal(light.autoOff)); + if (getBool(light.overpower)) { + postAlarm(ALARM_TYPE_OVERPOWER, false); + } + + if (profile.inColor || profile.isBulb) { + logger.trace("update color settings"); + col.setRGBW(getInteger(light.red), getInteger(light.green), getInteger(light.blue), + getInteger(light.white)); + col.setGain(getInteger(light.gain)); + col.setEffect(getInteger(light.effect)); + + String colorGroup = CHANNEL_GROUP_COLOR_CONTROL; + logger.trace("Update channels for {}: RGBW={}/{}/{}, in %:{}%/{}%/{}%, white={}%, gain={}%", colorGroup, + col.red, col.green, col.blue, col.percentRed, col.percentGreen, col.percentBlue, + col.percentWhite, col.percentGain); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_RED, col.percentRed); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_GREEN, col.percentGreen); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_BLUE, col.percentBlue); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_WHITE, col.percentWhite); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_GAIN, col.percentGain); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_EFFECT, new DecimalType(col.effect)); + setFullColor(colorGroup, col); + + logger.trace("update {}.color picker", colorGroup); + updated |= updateChannel(colorGroup, CHANNEL_COLOR_PICKER, col.toHSB()); + } + if (!profile.inColor || profile.isBulb) { + String whiteGroup = buildWhiteGroupName(profile, channelId); + logger.trace("update white settings for {}.{}", whiteGroup, channelId); + col.setBrightness(getInteger(light.brightness)); + updated |= updateChannel(whiteGroup, CHANNEL_BRIGHTNESS, col.percentBrightness); + if (profile.isBulb) { + col.setTemp(getInteger(light.temp)); + updated |= updateChannel(whiteGroup, CHANNEL_COLOR_TEMP, col.percentTemp); + logger.trace("update {}.color picker", whiteGroup); + updated |= updateChannel(whiteGroup, CHANNEL_COLOR_PICKER, col.toHSB()); + } + } + + // continue with next light + lightId++; + } + return updated; + } + + private Integer setColor(Integer lightId, String colorName, Command command, Integer minValue, Integer maxValue) + throws IOException, IllegalArgumentException { + Integer value = -1; + logger.debug("Set {} to {} ({})", colorName, command, command.getClass()); + if (command instanceof PercentType) { + PercentType percent = (PercentType) command; + Double v = new Double(maxValue) * percent.doubleValue() / 100.0; + value = v.intValue(); + logger.debug("Value for {} is in percent: {}%={}", colorName, percent, value); + } else if (command instanceof DecimalType) { + value = ((DecimalType) command).intValue(); + logger.debug("Value for {} is a number: {}", colorName, value); + } else if (command instanceof OnOffType) { + value = ((OnOffType) command).equals(OnOffType.ON) ? SHELLY_MAX_COLOR : SHELLY_MIN_COLOR; + logger.debug("Value for {} of type OnOff was converted to {}", colorName, value); + } else { + throw new IllegalArgumentException( + "Invalid value type for " + colorName + ": " + value.toString() + " / type " + value.getClass()); + } + validateRange(colorName, value, minValue, maxValue); + return value.intValue(); + } + + private Integer setColor(Integer lightId, String colorName, Command command, Integer maxValue) + throws IOException, IllegalArgumentException { + return setColor(lightId, colorName, command, 0, maxValue); + } + + private void setFullColor(String colorGroup, ShellyColorUtils col) { + if ((col.red == SHELLY_MAX_COLOR) && (col.green == SHELLY_MAX_COLOR) && (col.blue == 0)) { + updateChannel(colorGroup, CHANNEL_COLOR_FULL, new StringType(SHELLY_COLOR_YELLOW)); + } else if ((col.red == SHELLY_MAX_COLOR) && (col.green == 0) && (col.blue == 0)) { + updateChannel(colorGroup, CHANNEL_COLOR_FULL, new StringType(SHELLY_COLOR_RED)); + } else if ((col.red == 0) && (col.green == SHELLY_MAX_COLOR) && (col.blue == 0)) { + updateChannel(colorGroup, CHANNEL_COLOR_FULL, new StringType(SHELLY_COLOR_GREEN)); + } else if ((col.red == 0) && (col.green == 0) && (col.blue == SHELLY_MAX_COLOR)) { + updateChannel(colorGroup, CHANNEL_COLOR_FULL, new StringType(SHELLY_COLOR_BLUE)); + } else if ((col.red == 0) && (col.green == 0) && (col.blue == 0) && (col.white == SHELLY_MAX_COLOR)) { + updateChannel(colorGroup, CHANNEL_COLOR_FULL, new StringType(SHELLY_COLOR_WHITE)); + } + } + + @SuppressWarnings("null") + private void sendColors(@Nullable ShellyDeviceProfile profile, Integer lightId, ShellyColorUtils oldCol, + ShellyColorUtils newCol) throws IOException { + Validate.notNull(profile); + + // boolean updated = false; + Integer channelId = lightId + 1; + Map<String, String> parms = new HashMap<String, String>(); + + logger.trace( + "{}: New color settings for channel {}: RGB {}/{}/{}, white={}, gain={}, brightness={}, color-temp={}", + thingName, channelId, newCol.red, newCol.green, newCol.blue, newCol.white, newCol.gain, + newCol.brightness, newCol.temp); + parms.put(SHELLY_LIGHT_TURN, profile.inColor || newCol.brightness > 0 ? SHELLY_API_ON : SHELLY_API_OFF); + if (profile.inColor) { + if (!oldCol.red.equals(newCol.red) || !oldCol.green.equals(newCol.green) || !oldCol.blue.equals(newCol.blue) + || !oldCol.white.equals(newCol.white)) { + logger.debug("{}: Setting RGBW to {}/{}/{}/{}", thingName, newCol.red, newCol.green, newCol.blue, + newCol.white); + parms.put(SHELLY_COLOR_RED, newCol.red.toString()); + parms.put(SHELLY_COLOR_GREEN, newCol.green.toString()); + parms.put(SHELLY_COLOR_BLUE, newCol.blue.toString()); + parms.put(SHELLY_COLOR_WHITE, newCol.white.toString()); + } + } + if ((!profile.inColor) && !oldCol.temp.equals(newCol.temp)) { + logger.debug("Setting color temp to {}", newCol.temp); + parms.put(SHELLY_COLOR_TEMP, newCol.temp.toString()); + } + if (!oldCol.gain.equals(newCol.gain)) { + logger.debug("Setting gain to {}", newCol.gain); + parms.put(SHELLY_COLOR_GAIN, newCol.gain.toString()); + } + if ((profile.isBulb || !profile.inColor) && !oldCol.brightness.equals(newCol.brightness)) { + logger.debug("Setting brightness to {}", newCol.brightness); + parms.put(SHELLY_COLOR_BRIGHTNESS, newCol.brightness.toString()); + } + if (!oldCol.effect.equals(newCol.effect)) { + logger.debug("Setting effect to {}", newCol.effect); + parms.put(SHELLY_COLOR_EFFECT, newCol.effect.toString()); + } + if (parms.size() > 0) { + logger.debug("Send collor settings: {}", parms.toString()); + Validate.notNull(api); + api.setLightParms(lightId, parms); + updateCurrentColors(lightId, newCol); + } + } + + @SuppressWarnings({ "null", "unused" }) + private void updateCurrentColors(Integer lightId, ShellyColorUtils col) { + if (channelColors.get(lightId) == null) { + channelColors.put(lightId, col); + } else { + channelColors.replace(lightId, col); + } + logger.debug("Colors updated for lightId {}: RGBW={}/{}/{}/{}, Sat/Gain={}, Bright={}, Temp={} ", + lightId.toString(), col.red, col.green, col.blue, col.white, col.gain, col.brightness, col.temp); + } + + private Integer getColorFromHSB(PercentType colorPercent) { + return getColorFromHSB(colorPercent, new Double(SATURATION_FACTOR)); + } + + private Integer getColorFromHSB(PercentType colorPercent, Double factor) { + Double value = new Double(Math.round(colorPercent.doubleValue() * factor)); + logger.trace("convert {}% into {}/{} (factor={})", colorPercent.toString(), value.toString(), value.intValue(), + factor.toString()); + return value.intValue(); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyProtectedHandler.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyProtectedHandler.java new file mode 100644 index 0000000000000..a098ae9c7d2bf --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyProtectedHandler.java @@ -0,0 +1,51 @@ +/** + * 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.shelly.internal.handler; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.thing.Thing; +import org.openhab.binding.shelly.internal.coap.ShellyCoapServer; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link ShellyProtectedHandler} implements a dummy handler for password protected devices. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyProtectedHandler extends ShellyBaseHandler { + private final Logger logger = LoggerFactory.getLogger(ShellyProtectedHandler.class); + + /** + * Constructor + * + * @param thing The thing passed by the HandlerFactory + * @param bindingConfig configuration of the binding + * @param coapServer coap server instance + * @param localIP local IP of the openHAB host + * @param httpPort port of the openHAB HTTP API + */ + public ShellyProtectedHandler(Thing thing, ShellyBindingConfiguration bindingConfig, + @Nullable ShellyCoapServer coapServer, String localIP, int httpPort) { + super(thing, bindingConfig, coapServer, localIP, httpPort); + } + + @Override + public void initialize() { + logger.debug("Thing is using class {}", this.getClass()); + super.initialize(); + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyRelayHandler.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyRelayHandler.java new file mode 100644 index 0000000000000..3116499f70f2c --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/handler/ShellyRelayHandler.java @@ -0,0 +1,486 @@ +/** + * 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.shelly.internal.handler; + +import static org.openhab.binding.shelly.internal.ShellyBindingConstants.*; +import static org.openhab.binding.shelly.internal.ShellyUtils.*; +import static org.openhab.binding.shelly.internal.api.ShellyApiJson.*; + +import java.io.IOException; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.Validate; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.StopMoveType; +import org.eclipse.smarthome.core.library.types.UpDownType; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.shelly.internal.api.ShellyApiJson; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyControlRoller; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyInputState; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsDimmer; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsRelay; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsRoller; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellySettingsStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyShortLightStatus; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyShortStatusRelay; +import org.openhab.binding.shelly.internal.api.ShellyApiJson.ShellyStatusRelay; +import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile; +import org.openhab.binding.shelly.internal.coap.ShellyCoapServer; +import org.openhab.binding.shelly.internal.config.ShellyBindingConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; + +/*** + * The{@link ShellyRelayHandler} handles light (bulb+rgbw2) specific commands and status. All other commands will be + * handled by the generic thing handler. + * + * @author Markus Michels - Initial contribution + */ +@NonNullByDefault +public class ShellyRelayHandler extends ShellyBaseHandler { + private final Logger logger = LoggerFactory.getLogger(ShellyRelayHandler.class); + + /** + * Constructor + * + * @param thing The thing passed by the HandlerFactory + * @param bindingConfig configuration of the binding + * @param coapServer coap server instance + * @param localIP local IP of the openHAB host + * @param httpPort port of the openHAB HTTP API + */ + public ShellyRelayHandler(Thing thing, ShellyBindingConfiguration bindingConfig, + @Nullable ShellyCoapServer coapServer, String localIP, int httpPort) { + super(thing, bindingConfig, coapServer, localIP, httpPort); + } + + @Override + public void initialize() { + logger.debug("Thing is using class {}", this.getClass()); + super.initialize(); + } + + @SuppressWarnings("null") + @Override + public boolean handleDeviceCommand(ChannelUID channelUID, Command command) throws IOException { + // Process command + String groupName = channelUID.getGroupId(); + Integer rIndex = 0; + if (groupName.startsWith(CHANNEL_GROUP_RELAY_CONTROL) + && groupName.length() > CHANNEL_GROUP_RELAY_CONTROL.length()) { + rIndex = Integer.parseInt(StringUtils.substringAfter(channelUID.getGroupId(), CHANNEL_GROUP_RELAY_CONTROL)) + - 1; + } else if (groupName.startsWith(CHANNEL_GROUP_ROL_CONTROL) + && groupName.length() > CHANNEL_GROUP_ROL_CONTROL.length()) { + rIndex = Integer.parseInt(StringUtils.substringAfter(channelUID.getGroupId(), CHANNEL_GROUP_ROL_CONTROL)) + - 1; + } + + switch (channelUID.getIdWithoutGroup()) { + default: + return false; + + case CHANNEL_OUTPUT: + if (!profile.isRoller) { + // extract relay number of group name (relay0->0, relay1->1...) + logger.debug("{}: Set relay output to {}", thingName, command.toString()); + api.setRelayTurn(rIndex, (OnOffType) command == OnOffType.ON ? SHELLY_API_ON : SHELLY_API_OFF); + } else { + logger.debug("{}: Device is in roller mode, channel command {} ignored", thingName, + channelUID.toString()); + } + break; + case CHANNEL_BRIGHTNESS: // e.g.Dimmer + handleBrightness(command, rIndex); + break; + + case CHANNEL_ROL_CONTROL_POS: + case CHANNEL_ROL_CONTROL_CONTROL: + logger.debug("{}: Roller command/position {}", thingName, command.toString()); + handleRoller(command, groupName, rIndex, + channelUID.getIdWithoutGroup().equals(CHANNEL_ROL_CONTROL_CONTROL)); + + // request updates the next 30sec to update roller position after it stopped + requestUpdates(45 / UPDATE_STATUS_INTERVAL_SECONDS, false); + break; + + case CHANNEL_TIMER_AUTOON: + logger.debug("{}: Set Auto-ON timer to {}", thingName, command.toString()); + Validate.isTrue(command instanceof DecimalType, + "Timer AutoOn: Invalid value type: " + command.getClass()); + api.setTimer(rIndex, SHELLY_TIMER_AUTOON, ((DecimalType) command).doubleValue()); + break; + case CHANNEL_TIMER_AUTOOFF: + logger.debug("{}: Set Auto-OFF timer to {}", thingName, command.toString()); + Validate.isTrue(command instanceof DecimalType, "Invalid value type"); + api.setTimer(rIndex, SHELLY_TIMER_AUTOOFF, ((DecimalType) command).doubleValue()); + break; + + case CHANNEL_LED_STATUS_DISABLE: + logger.debug("{}: Set STATUS LED disabled to {}", thingName, command.toString()); + Validate.isTrue(command instanceof OnOffType, "Invalid value type"); + api.setLedStatus(SHELLY_LED_STATUS_DISABLE, (OnOffType) command == OnOffType.ON); + break; + case CHANNEL_LED_POWER_DISABLE: + logger.debug("{}: Set POWER LED disabled to {}", thingName, command.toString()); + Validate.isTrue(command instanceof OnOffType, "Invalid value type"); + api.setLedStatus(SHELLY_LED_POWER_DISABLE, (OnOffType) command == OnOffType.ON); + break; + } + return true; + } + + /** + * PaperUI Control has a combined Slider for Brightness combined with On/Off + * Brightness channel has 2 functions: Switch On/Off (OnOnType) and setting brightness (PercentType) + * There is some more logic in the control + * When brightness is set to 0 the control sends also an OFF command + * When current brightness is 0 and slider will be moved the new brightness will be set, but also a ON command is + * send. + * + * @param command + * @param index + * @throws IOException + */ + @SuppressWarnings("null") + private void handleBrightness(Command command, Integer index) throws IOException { + Integer value = -1; + if (command instanceof PercentType) { // Dimmer + value = ((PercentType) command).intValue(); + } else if (command instanceof DecimalType) { // Number + value = ((DecimalType) command).intValue(); + } + + if (command instanceof OnOffType) { // Switch + logger.debug("Switch output {}", command.toString()); + api.setRelayTurn(index, (OnOffType) command == OnOffType.ON ? SHELLY_API_ON : SHELLY_API_OFF); + requestUpdates(2, false); + return; + } + + // Switch light off on brightness = 0 + if (value == 0) { + logger.debug("{}: Brightness=0 -> switch output OFF", thingName); + api.setRelayTurn(index, SHELLY_API_OFF); + requestUpdates(1, false); + return; + } + + ShellyShortLightStatus light = api.getLightStatus(index); + Validate.notNull(light, "Unable to get Light status for brightness"); + if (command instanceof IncreaseDecreaseType) { + if (((IncreaseDecreaseType) command).equals(IncreaseDecreaseType.INCREASE)) { + value = Math.min(light.brightness + DIM_STEPSIZE, 100); + } else { + value = Math.max(light.brightness - DIM_STEPSIZE, 0); + } + logger.debug("{}: Change brightness from {} to {}", thingName, light.brightness, value); + } + + validateRange("brightness", value, 0, 100); + logger.debug("{}: Setting dimmer brightness to {}", thingName, value); + api.setDimmerBrightness(index, value); + + } + + @Override + public boolean updateDeviceStatus(ShellySettingsStatus status) throws IOException { + // map status to channels + boolean updated = false; + updated |= updateRelays(status); + updated |= updateDimmers(status); + updated |= updateLed(status); + return updated; + } + + /** + * Handle Roller Commands + * + * @param command from handleCommand() + * @param groupName relay, roller... + * @param index relay number + * @param isControl true: is the Rollershutter channel, false: rollerpos channel + * @throws IOException + */ + @SuppressWarnings("null") + private void handleRoller(Command command, String groupName, Integer index, boolean isControl) throws IOException { + Integer position = -1; + + if ((command instanceof UpDownType) || (command instanceof OnOffType)) { + ShellyControlRoller rstatus = api.getRollerStatus(index); + + if (!getString(rstatus.state).isEmpty() && !getString(rstatus.state).equals(SHELLY_ALWD_ROLLER_TURN_STOP)) { + boolean up = command instanceof UpDownType && (UpDownType) command == UpDownType.UP; + boolean down = command instanceof UpDownType && (UpDownType) command == UpDownType.DOWN; + if ((up && getString(rstatus.state).equals(SHELLY_ALWD_ROLLER_TURN_OPEN)) + || (down && getString(rstatus.state).equals(SHELLY_ALWD_ROLLER_TURN_CLOSE))) { + logger.debug("{}: Roller is already moving ({}), ignore command {}", thingName, + getString(rstatus.state), command.toString()); + requestUpdates(1, false); + return; + } + } + + if (((command instanceof UpDownType) && UpDownType.UP.equals(command)) + || ((command instanceof OnOffType) && OnOffType.ON.equals(command))) { + logger.debug("{}: Open roller", thingName); + api.setRollerTurn(index, SHELLY_ALWD_ROLLER_TURN_OPEN); + position = SHELLY_MAX_ROLLER_POS; + + } + if (((command instanceof UpDownType) && UpDownType.DOWN.equals(command)) + || ((command instanceof OnOffType) && OnOffType.OFF.equals(command))) { + logger.debug("{}: Closing roller", thingName); + api.setRollerTurn(index, SHELLY_ALWD_ROLLER_TURN_CLOSE); + position = SHELLY_MIN_ROLLER_POS; + } + } else if ((command instanceof StopMoveType) && StopMoveType.STOP.equals(command)) { + logger.debug("{}: Stop roller", thingName); + api.setRollerTurn(index, SHELLY_ALWD_ROLLER_TURN_STOP); + } else { + logger.debug("{}: Set roller to position {}", thingName, command.toString()); + if (command instanceof PercentType) { + PercentType p = (PercentType) command; + position = p.intValue(); + } else if (command instanceof DecimalType) { + DecimalType d = (DecimalType) command; + position = d.intValue(); + } else { + throw new IllegalArgumentException( + "Invalid value type for roller control/posiution" + command.getClass().toString()); + } + + // take position from RollerShutter control and map to Shelly positon (OH: + // 0=closed, 100=open; Shelly 0=open, 100=closed) + // take position 1:1 from position channel + position = isControl ? SHELLY_MAX_ROLLER_POS - position : position; + validateRange("roller position", position, SHELLY_MIN_ROLLER_POS, SHELLY_MAX_ROLLER_POS); + + logger.debug("{}: Changing roller position to {}", thingName, position); + api.setRollerPos(index, position); + } + if (position != -1) { + // make sure both are in sync + if (isControl) { + int pos = SHELLY_MAX_ROLLER_POS - Math.max(0, Math.min(position, SHELLY_MAX_ROLLER_POS)); + updateChannel(groupName, CHANNEL_ROL_CONTROL_CONTROL, new PercentType(pos)); + } else { + updateChannel(groupName, CHANNEL_ROL_CONTROL_POS, new PercentType(position)); + } + } + + } + + /** + * Update Relay/Roller channels + * + * @param th Thing Handler instance + * @param profile ShellyDeviceProfile + * @param status Last ShellySettingsStatus + * + * @throws IOException + */ + @SuppressWarnings("null") + public boolean updateRelays(ShellySettingsStatus status) throws IOException { + Validate.notNull(status, "status must not be null!"); + ShellyDeviceProfile profile = getProfile(); + + boolean updated = false; + if (profile.hasRelays && !profile.isRoller && !profile.isDimmer) { + logger.trace("{}: Updating {} relay(s)", thingName, profile.numRelays.toString()); + + int i = 0; + ShellyStatusRelay rstatus = api.getRelayStatus(i); + if (rstatus != null) { + for (ShellyShortStatusRelay relay : rstatus.relays) { + if ((relay.isValid == null) || relay.isValid) { + Integer r = i + 1; + String groupName = profile.numRelays <= 1 ? CHANNEL_GROUP_RELAY_CONTROL + : CHANNEL_GROUP_RELAY_CONTROL + r.toString(); + + if (getBool(relay.overpower)) { + postAlarm(ALARM_TYPE_OVERPOWER, false); + } + + updated |= updateChannel(groupName, CHANNEL_OUTPUT, getOnOff(relay.ison)); + updated |= updateChannel(groupName, CHANNEL_TIMER_ACTIVE, getOnOff(relay.hasTimer)); + ShellySettingsRelay rsettings = profile.settings.relays.get(i); + if (rsettings != null) { + updated |= updateChannel(groupName, CHANNEL_TIMER_AUTOON, + toQuantityType(getDouble(rsettings.autoOn), SmartHomeUnits.SECOND)); + updated |= updateChannel(groupName, CHANNEL_TIMER_AUTOOFF, + toQuantityType(getDouble(rsettings.autoOff), SmartHomeUnits.SECOND)); + } + updated |= updateInputs(groupName, status, i); + i++; + } + + } + } + } + if (profile.hasRelays && profile.isRoller && (status.rollers != null)) { + logger.trace("{}: Updating {} rollers", thingName, profile.numRollers.toString()); + int i = 0; + for (ShellySettingsRoller roller : status.rollers) { + if (roller.isValid) { + ShellyControlRoller control = api.getRollerStatus(i); + Integer relayIndex = i + 1; + String groupName = profile.numRollers > 1 ? CHANNEL_GROUP_ROL_CONTROL + relayIndex.toString() + : CHANNEL_GROUP_ROL_CONTROL; + + if (getString(control.state).equals(SHELLY_ALWD_ROLLER_TURN_STOP)) { // only valid in stop state + Integer pos = Math.max(SHELLY_MIN_ROLLER_POS, + Math.min(control.currentPos, SHELLY_MAX_ROLLER_POS)); + updated |= updateChannel(groupName, CHANNEL_ROL_CONTROL_CONTROL, + toQuantityType(new Double(SHELLY_MAX_ROLLER_POS - pos), SmartHomeUnits.PERCENT)); + updated |= updateChannel(groupName, CHANNEL_ROL_CONTROL_POS, + toQuantityType(new Double(pos), SmartHomeUnits.PERCENT)); + scheduledUpdates = 1; // one more poll and then stop + } + + updated |= updateChannel(groupName, CHANNEL_ROL_CONTROL_DIR, getStringType(control.lastDirection)); + updated |= updateChannel(groupName, CHANNEL_ROL_CONTROL_STOPR, getStringType(control.stopReason)); + updated |= updateInputs(groupName, status, i); + + i++; + } + } + } + return updated; + } + + /** + * Update Relay/Roller channels + * + * @param th Thing Handler instance + * @param profile ShellyDeviceProfile + * @param status Last ShellySettingsStatus + * + * @throws IOException + */ + @SuppressWarnings("null") + public boolean updateDimmers(ShellySettingsStatus orgStatus) throws IOException { + ShellyDeviceProfile profile = getProfile(); + + boolean updated = false; + if (profile.isDimmer) { + Validate.notNull(orgStatus, "orgStatus must not be null!"); + + // We need to fixup the returned Json: The dimmer returns light[] element, which is ok, but it doesn't have + // the same structure as lights[] from Bulb and RGBW2. The tag gets replaced by dimmers[] so that Gson maps + // to a different structure (ShellyShortLight). + Gson gson = new Gson(); + ShellySettingsStatus dstatus = gson.fromJson(ShellyApiJson.fixDimmerJson(orgStatus.json), + ShellySettingsStatus.class); + Validate.notNull(dstatus.dimmers, "dstatus.dimmers must not be null!"); + Validate.notNull(dstatus.tmp, "dstatus.tmp must not be null!"); + + logger.trace("{}: Updating {} dimmers(s)", thingName, dstatus.dimmers.size()); + + int l = 0; + logger.trace("{}: Updating dimmers {}", thingName, dstatus.dimmers.size()); + for (ShellyShortLightStatus dimmer : dstatus.dimmers) { + Integer r = l + 1; + String groupName = profile.numRelays <= 1 ? CHANNEL_GROUP_DIMMER_CONTROL + : CHANNEL_GROUP_DIMMER_CONTROL + r.toString(); + // updated |= updateChannel(groupName, CHANNEL_OUTPUT, getOnOff(dimmer.ison)); + + // On a status update we map a dimmer.ison = false to brightness 0 rather than the device's brightness + // and send a OFF status to the same channel. + // When the device's brightness is > 0 we send the new value to the channel and a ON command + if (dimmer.ison) { + updated |= updateChannel(groupName, CHANNEL_BRIGHTNESS, OnOffType.ON); + updated |= updateChannel(groupName, CHANNEL_BRIGHTNESS, toQuantityType( + new Double(getInteger(dimmer.brightness)), DIGITS_NONE, SmartHomeUnits.PERCENT)); + } else { + updated |= updateChannel(groupName, CHANNEL_BRIGHTNESS, OnOffType.OFF); + updated |= updateChannel(groupName, CHANNEL_BRIGHTNESS, + toQuantityType(new Double(0), DIGITS_NONE, SmartHomeUnits.PERCENT)); + } + + ShellySettingsDimmer dsettings = profile.settings.dimmers.get(l); + if (dsettings != null) { + updated |= updateChannel(groupName, CHANNEL_TIMER_AUTOON, + toQuantityType(getDouble(dsettings.autoOn), SmartHomeUnits.SECOND)); + updated |= updateChannel(groupName, CHANNEL_TIMER_AUTOOFF, + toQuantityType(getDouble(dsettings.autoOff), SmartHomeUnits.SECOND)); + } + + updated |= updateInputs(groupName, orgStatus, l); + l++; + } + } + return updated; + } + + /** + * Map input states to channels + * + * @param groupName Channel Group (relay / relay1...) + * + * @param status Shelly device status + * @return true: one or more inputs were updated + */ + @SuppressWarnings("null") + private boolean updateInputs(String groupName, ShellySettingsStatus status, int index) { + boolean updated = false; + if (status.inputs != null) { + if (profile.isDimmer || profile.isRoller) { + ShellyInputState state1 = status.inputs.get(0); + ShellyInputState state2 = status.inputs.get(1); + logger.trace("{}: Updating {}#input1 with {}, input2 with {}", thingName, groupName, + getOnOff(state1.input), getOnOff(state2.input)); + updated |= updateChannel(groupName, CHANNEL_INPUT + "1", getOnOff(state1.input)); + updated |= updateChannel(groupName, CHANNEL_INPUT + "2", getOnOff(state2.input)); + } else { + ShellyInputState state = status.inputs.get(index); + logger.trace("{}: Updating input[{}] with {}", thingName, index, getOnOff(state.input)); + updated |= updateChannel(groupName, CHANNEL_INPUT, getOnOff(state.input)); + } + } + return updated; + } + + /** + * Update LED channels + * + * @param th Thing Handler instance + * @param profile ShellyDeviceProfile + * @param status Last ShellySettingsStatus + */ + @SuppressWarnings("null") + public boolean updateLed(ShellySettingsStatus status) { + boolean updated = false; + if (profile.hasLed) { + Validate.notNull(profile.settings.ledStatusDisable, "LED update: led_status_disable must not be null!"); + Validate.notNull(profile.settings.ledPowerDisable, "LED update: led_power_disable must not be null!"); + logger.debug("{}: LED disabled status: powerLed: {}, : statusLed{}", thingName, + getBool(profile.settings.ledPowerDisable), getBool(profile.settings.ledStatusDisable)); + updated |= updateChannel(CHANNEL_GROUP_LED_CONTROL, CHANNEL_LED_STATUS_DISABLE, + getOnOff(profile.settings.ledStatusDisable)); + updated |= updateChannel(CHANNEL_GROUP_LED_CONTROL, CHANNEL_LED_POWER_DISABLE, + getOnOff(profile.settings.ledPowerDisable)); + } + return updated; + } +} diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/binding/binding.xml new file mode 100755 index 0000000000000..eebd344314f1d --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="shelly" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Shelly Binding</name> + <description>This binding supports the Shelly series of devices.</description> + <author>Markus Michels</author> + + <config-description> + <parameter name="defaultUserId" type="text"> + <default>admin</default> + <label>Default User</label> + <description>Default userId to access protected Shelly devices.</description> + </parameter> + <parameter name="defaultPassword" type="text"> + <default>admin</default> + <label>Default Password</label> + <description>Default password to access protected Shelly devices.</description> + </parameter> + </config-description> + +</binding:binding> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/config/config.xml new file mode 100644 index 0000000000000..0eaf93c0a3baa --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/config/config.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config-description:config-descriptions + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> + + <config-description uri="thing-type:shelly:generic"> + <parameter-group name="advancedOptions"> + <label>Advanced Options</label> + </parameter-group> + + <parameter name="userId" type="text" required="false"> + <label>UserID</label> + <description>User ID for HTTP API access.</description> + </parameter> + <parameter name="password" type="text" required="false"> + <label>Password</label> + <description>Password for HTTP API access.</description> + <context>password</context> + </parameter> + <parameter name="deviceIp" type="text" required="true"> + <label>Device IP Address</label> + <description>IP-Address of the Shelly device.</description> + <context>network-address</context> + </parameter> + <parameter name="eventsButton" type="boolean" required="false"> + <label>Enable Button Events</label> + <description>True if the binding should register to get the Buttons Events.</description> + <advanced>true</advanced> + <default>false</default> + </parameter> + <parameter name="eventsSwitch" type="boolean" required="false"> + <label>Enable Switch Events (Out on/off)</label> + <description>True if the binding should register to get the Relay Switch Events.</description> + <advanced>true</advanced> + <default>true</default> + </parameter> + <parameter name="eventsPush" type="boolean" required="false"> + <label>Enable Push Events (short/long)</label> + <description>True if the binding should register to get the Short/Long Push Events.</description> + <advanced>true</advanced> + <default>true</default> + </parameter> + <parameter name="eventsCoIoT" type="boolean" required="false"> + <label>Enable CoIoT Events</label> + <description>If enabled the Coap protocol will be used to receive status updates.</description> + <advanced>true</advanced> + <default>false</default> + </parameter> + <parameter name="updateInterval" type="integer" required="true"> + <label>Update Interval</label> + <description>Interval in seconds to query an update from the device.</description> + <default>60</default> + <unitLabel>sec</unitLabel> + <advanced>true</advanced> + </parameter> + </config-description> + + <config-description uri="thing-type:shelly:battery"> + <parameter name="userId" type="text" required="false"> + <label>User ID</label> + <description>User ID for HTTP API access.</description> + </parameter> + <parameter name="password" type="text" required="false"> + <label>Password</label> + <description>Password for HTTP API access.</description> + <context>password</context> + </parameter> + <parameter name="deviceIp" type="text" required="true"> + <label>Device IP Address</label> + <description>IP-Address of the Shelly device.</description> + <context>network-address</context> + </parameter> + <parameter name="lowBattery" type="integer" required="false"> + <label>Low Battery</label> + <description>Threshold for the battery level, alert will be signed when battery level is below..</description> + <default>20</default> + <unitLabel>%</unitLabel> + </parameter> + <parameter name="eventsSensorReport" type="boolean" required="false"> + <label>Enable Sensor Events</label> + <description>True: Register event URL for sensor updates. When settings this to false the sensor will not notify the binding about changes!</description> + <advanced>true</advanced> + <default>true</default> + </parameter> + <parameter name="eventsCoIoT" type="boolean" required="false"> + <label>Enable CoIoT Events</label> + <description>If enabled the Coap protocol will be used to receive status updates.</description> + <advanced>true</advanced> + <default>true</default> + </parameter> + <parameter name="updateInterval" type="integer" required="true"> + <label>Update Interval</label> + <description>Interval in seconds to query an update from the device.</description> + <default>3600</default> + <unitLabel>sec</unitLabel> + </parameter> + </config-description> + +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..b0da57f85b9be --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,368 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-type id="timerAutoOn" advanced="true"> + <item-type>Number:Time</item-type> + <label>Auto ON timer</label> + <description>When Off - Turn On After xx seconds; 0 disables the timer</description> + <state min="0" step="1" pattern="%d %unit%" readOnly="false"></state> + </channel-type> + <channel-type id="timerAutoOff" advanced="true"> + <item-type>Number:Time</item-type> + <label>Auto OFF timer</label> + <description>When ON - Turn On After xx seconds; 0 disables the timer</description> + <state min="0" step="1" pattern="%d %unit%" readOnly="false"></state> + </channel-type> + <channel-type id="timerActive" advanced="true"> + <item-type>Switch</item-type> + <label>Auto ON/OFF timer active</label> + <description>ON: A timer is active, OFF: no timer active</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="rollerShutter"> + <item-type>Rollershutter</item-type> + <label>Roller Control (0=open, 100=closed))</label> + <description>Controls the roller</description> + <category>Blinds</category> + </channel-type> + <channel-type id="rollerPosition" advanced="true"> + <item-type>Dimmer</item-type> + <label>Roller Position (100=open, 0=closed)</label> + <description>Position the roller (100..0 in %, where 100%=open, 0%=closed)</description> + <state readOnly="false" min="0" max="100" /> + </channel-type> + <channel-type id="rollerStop"> + <item-type>String</item-type> + <label>Roller stop reason</label> + <description>Last cause for stopping: normal, safety_switch, obstacle</description> + <state readOnly="true"> + <options> + <option value="normal">normal</option> + <option value="safety_switch">safety switch</option> + <option value="obstacle">obstacle detected</option> + </options> + </state> + </channel-type> + <channel-type id="rollerDirection"> + <item-type>String</item-type> + <label>Last Roller Direction</label> + <description>Last direction: open or close</description> + <state readOnly="true"> + <options> + <option value="open">open</option> + <option value="close">close</option> + </options> + </state> + </channel-type> + <channel-type id="dimmerOutput"> + <item-type>Switch</item-type> + <label>Light</label> + <description>Turn light ON or OFF</description> + </channel-type> + <channel-type id="inputState"> + <item-type>Switch</item-type> + <label>Input</label> + <description>Input/Button state</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="inputState1"> + <item-type>Switch</item-type> + <label>Input #1</label> + <description>Input/Button state</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="inputState2"> + <item-type>Switch</item-type> + <label>Input #2</label> + <description>Input/Button state</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="dimmerBrightness"> + <item-type>Dimmer</item-type> + <label>Brightness</label> + <description>Light brightness in %</description> + <category>DimmableLight</category> + </channel-type> + <channel-type id="dimmerLoadError"> + <item-type>Switch</item-type> + <label>Load Error</label> + <description>Error reported load error</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="meterWatts"> + <item-type>Number:Power</item-type> + <label>Watt</label> + <description>Current power consumption in Watt</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="meterReactive"> + <item-type>Number:Power</item-type> + <label>Reactive Watt</label> + <description>Reactive power consumption in Watt</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="lastPower1" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Last Power #1</label> + <description>Last power consumption #1 - one rounded minute</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="lastPower2" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Last Power #2</label> + <description>Last power consumption #2 - one rounded minute</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="lastPower3" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Last Power #3</label> + <description>Last power consumption #3 - one rounded minute</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="meterTotal"> + <item-type>Number:Energy</item-type> + <label>Total Energy</label> + <description>Total power consumption in kw/h</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="meterReturned"> + <item-type>Number:Energy</item-type> + <label>Total Returned Energy (kw/h)</label> + <description>Total returned energy in kw/h</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="meterVoltage"> + <item-type>Number:ElectricPotential</item-type> + <label>Voltage</label> + <description>RMS voltage, Volts </description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="timestamp"> + <item-type>DateTime</item-type> + <label>Last Update</label> + <description>Timestamp of last measurement</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="ledStatusDisable"> + <item-type>Switch</item-type> + <label>Disable Status LED</label> + <description>Disable LED indication for network status</description> + </channel-type> + <channel-type id="ledPowerDisable"> + <item-type>Switch</item-type> + <label>Disable Power LED</label> + <description>Disable LED indication for output status</description> + </channel-type> + + <channel-type id="colorMode"> + <item-type>Switch</item-type> + <label>Mode (ON=color, OFF=white)</label> + <description>ON: Device is in color mode, OFF: Device is in White Mode</description> + </channel-type> + <channel-type id="colorFull"> + <item-type>String</item-type> + <label>Full Color</label> + <description>Setting this channel sets the selected color to 255, all others to 0</description> + <state> + <options> + <option value="red">Red</option> + <option value="green">Green</option> + <option value="blue">Blue</option> + <option value="yellow">Yellow</option> + <option value="white">White</option> + </options> + </state> + </channel-type> + <channel-type id="colorRed" advanced="true"> + <item-type>Dimmer</item-type> + <label>Red</label> + <description>red, 0..255, only in Color Mode</description> + <state min="0" max="255" step="1" readOnly="false"></state> + </channel-type> + <channel-type id="colorGreen" advanced="true"> + <item-type>Dimmer</item-type> + <label>Green</label> + <description>green, 0..255, applies in mode=color</description> + <state min="0" max="255" step="1" readOnly="false"></state> + </channel-type> + <channel-type id="colorBlue" advanced="true"> + <item-type>Dimmer</item-type> + <label>Blue</label> + <description>blue, 0..255, only in Color Mode</description> + <state min="0" max="255" step="1" readOnly="false"></state> + </channel-type> + <channel-type id="colorWhite" advanced="true"> + <item-type>Dimmer</item-type> + <label>White</label> + <description>white, 0..255, applies in mode=color</description> + <state min="0" max="255" step="1" readOnly="false"></state> + </channel-type> + <channel-type id="colorGain" advanced="true"> + <item-type>Dimmer</item-type> + <label>Gain</label> + <description>gain for all channels, 0..100, applies in mode=color</description> + <state min="0" max="100" step="1" readOnly="false"></state> + </channel-type> + <channel-type id="whiteTemp"> + <item-type>Dimmer</item-type> + <label>Light Temperature</label> + <description>Light Temperature 3000..6500K</description> + <state min="3000" max="6500" step="10" readOnly="false"></state> + </channel-type> + <channel-type id="whiteBrightness"> + <item-type>Dimmer</item-type> + <label>Brightness</label> + <description>Brightness: 0..100%</description> + </channel-type> + <channel-type id="colorEffectBulb"> + <item-type>Number</item-type> + <label>Effect</label> + <description>Currently applied effect, description: 0: Off, 1: Meteor Shower, 2: Gradual Change, 3: Breath, 4: Flash, 5: On/Off Gradual, 6: Red/Green Change</description> + <state> + <options> + <option value="0">Off</option> + <option value="1">Meteor Shower</option> + <option value="2">Gradual Change</option> + <option value="3">Breath</option> + <option value="4">Flash</option> + <option value="5">On/Off Gradual</option> + <option value="6">Red/Green Change</option> + </options> + </state> + </channel-type> + <channel-type id="colorEffectRGBW2"> + <item-type>Number</item-type> + <label>Effect</label> + <description>Currently applied effect, description: 0: Off, 1: Meteor Shower, 2: Gradual Change, 3: Flash</description> + <state> + <options> + <option value="0">Off</option> + <option value="1">Meteor Shower</option> + <option value="2">Gradual Change</option> + <option value="3">Flash</option> + </options> + </state> + </channel-type> + + <channel-type id="sensorTemp"> + <item-type>Number:Temperature</item-type> + <label>Temperature</label> + <description>Temperature from the sensor</description> + <category>Temperature</category> + <tags> + <tag>CurrentTemperature</tag> + </tags> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="sensorHumidity"> + <item-type>Number:Dimensionless</item-type> + <label>Humidity</label> + <description>Relative humidity in % (0..100%)</description> + <tags> + <tag>CurrentHumidity</tag> + </tags> + <state readOnly="true" min="0" max="100" pattern="%f %unit%" /> + </channel-type> + <channel-type id="sensorFlood"> + <item-type>Switch</item-type> + <label>Flood Alarm</label> + <description>ON: Indicates flood condition / water detected</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="sensorSmoke"> + <item-type>Switch</item-type> + <label>Smoke Alarm</label> + <description>ON: Indicates smoke detection</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="sensorLux"> + <item-type>Number:Illuminance</item-type> + <label>Lux</label> + <description>Brightness from the sensor (Lux)</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="sensorCharger"> + <item-type>Switch</item-type> + <label>Charger connected</label> + <description>ON: Device is charging, OFF: No charger connected</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="batVoltage" advanced="true"> + <item-type>Number:ElectricPotential</item-type> + <label>Battery voltage</label> + <description>Battery voltage in V</description> + <state readOnly="true" pattern="%f %unit%"> + </state> + </channel-type> + <channel-type id="senseKey"> + <item-type>String</item-type> + <label>IR Key to send</label> + <description>Send a defined key code</description> + </channel-type> + + <channel-type id="uptime" advanced="true"> + <item-type>Number:Time</item-type> + <label>Uptime</label> + <description>Number of seconds since the device was powered up</description> + <state readOnly="true" pattern="%d %unit%"> + </state> + </channel-type> + <channel-type id="lastUpdate" advanced="true"> + <item-type>DateTime</item-type> + <label>Last Update</label> + <description>Timestamp of last status update</description> + <state readOnly="true"> + </state> + </channel-type> + <channel-type id="eventTrigger"> + <kind>trigger</kind> + <label>Event</label> + <description>Event Trigger, e.g. button on/off, Output on/off</description> + <event> + <options> + <option value="ROLLER_OPEN">Roller is open</option> + <option value="ROLLER_CLOSE">Roller is closed</option> + <option value="ROLLER_STOP">Roller has stopped</option> + </options> + </event> + </channel-type> + <channel-type id="alarmTrigger"> + <kind>trigger</kind> + <label>Alarm</label> + <description>Alarm Trigger, e.g. weak WiFi Signal detected or over heating.</description> + <event> + <options> + <option value="NONE">No alarm condition</option> + <option value="WEAK_SIGNAL">WiFi Signal low</option> + <option value="RESTARTED">Device has been restarted</option> + <option value="OVERTEMP">Device is overheating</option> + <option value="OVERLOAD">Device is overloaded</option> + <option value="OVERPOWER">Device is over max power</option> + <option value="LOAD_ERROR">Load error</option> + <option value="LOW_BATTERY">Low battery</option> + </options> + </event> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/device.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/device.xml new file mode 100644 index 0000000000000..7340e11dbd9e3 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/device.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-group-type id="deviceStatus" advanced="true"> + <label>Device Status</label> + <description>Some details on the device status</description> + <channels> + <channel id="uptime" typeId="uptime" /> + <channel id="wifiSignal" typeId="system.signal-strength" /> + <channel id="alarm" typeId="alarmTrigger" /> + </channels> + </channel-group-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/lights.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/lights.xml new file mode 100644 index 0000000000000..e8809e969260a --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/lights.xml @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="shellybulb"> + <label>Shelly Bulb (SHBULB)</label> + <description>Shelly Bulb</description> + <category>Lightbulb</category> + + <channel-groups> + <channel-group id="control" typeId="bulbControl" /> + <channel-group id="color" typeId="colorSettingsBulb" /> + <channel-group id="white" typeId="whiteSettings" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellyrgbw2-color"> + <label>Shelly RGBW2 Color Mode (SHRGBW2)</label> + <description>Shelly RGBW2 Controller - Color Mode</description> + <category>Lightbulb</category> + <channel-groups> + <channel-group id="control" typeId="lightControl" /> + <channel-group id="color" typeId="colorSettingsRGBW2" /> + <channel-group id="meter" typeId="basicMeter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellyrgbw2-white"> + <label>Shelly RGBW2 White Mode (SHRGBW2)</label> + <description>Shelly RGBW2 Controller - White Mode</description> + <category>Lightbulb</category> + + <channel-groups> + <channel-group id="channel1" typeId="rgbw2Channel"> + <label>Channel 1</label> + </channel-group> + <channel-group id="channel2" typeId="rgbw2Channel"> + <label>Channel 2</label> + </channel-group> + <channel-group id="channel3" typeId="rgbw2Channel"> + <label>Channel 3</label> + </channel-group> + <channel-group id="channel4" typeId="rgbw2Channel"> + <label>Channel 4</label> + </channel-group> + <channel-group id="meter1" typeId="basicMeter"> + <label>Power Meter Channel 1</label> + </channel-group> + <channel-group id="meter2" typeId="basicMeter"> + <label>Power Meter Channel 2</label> + </channel-group> + <channel-group id="meter3" typeId="basicMeter"> + <label>Power Meter Channel 3</label> + </channel-group> + <channel-group id="meter4" typeId="basicMeter"> + <label>Power Meter Channel 4</label> + </channel-group> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <channel-group-type id="bulbControl"> + <label>Light Control</label> + <description>Control your light</description> + <channels> + <channel id="power" typeId="system.power" /> + <channel id="mode" typeId="colorMode" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + <channel id="timerActive" typeId="timerActive" /> + </channels> + </channel-group-type> + <channel-group-type id="lightControl"> + <label>Light Control</label> + <description>Control your light channels</description> + <channels> + <channel id="power" typeId="system.power" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + <channel id="timerActive" typeId="timerActive" /> + </channels> + </channel-group-type> + <channel-group-type id="colorSettingsBulb"> + <label>Colors</label> + <description>Light colors</description> + <channels> + <channel id="hsb" typeId="system.color" /> + <channel id="full" typeId="colorFull" /> + <channel id="red" typeId="colorRed" /> + <channel id="green" typeId="colorGreen" /> + <channel id="blue" typeId="colorBlue" /> + <channel id="white" typeId="colorWhite" /> + <channel id="gain" typeId="colorGain" /> + <channel id="effect" typeId="colorEffectBulb" /> + </channels> + </channel-group-type> + <channel-group-type id="colorSettingsRGBW2"> + <label>Colors</label> + <description>Light colors</description> + <channels> + <channel id="hsb" typeId="system.color" /> + <channel id="full" typeId="colorFull" /> + <channel id="red" typeId="colorRed" /> + <channel id="green" typeId="colorGreen" /> + <channel id="blue" typeId="colorBlue" /> + <channel id="white" typeId="colorWhite" /> + <channel id="gain" typeId="colorGain" /> + <channel id="effect" typeId="colorEffectRGBW2" /> + </channels> + </channel-group-type> + <channel-group-type id="whiteSettings"> + <label>White settings</label> + <description>Adjust colors when device is in white mode</description> + <channels> + <channel id="brightness" typeId="whiteBrightness" /> + <channel id="temperature" typeId="whiteTemp" /> + </channels> + </channel-group-type> + <channel-group-type id="rgbw2Channel"> + <label>Control</label> + <description>Switch channel and adjust settings</description> + <channels> + <channel id="power" typeId="system.power" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + <channel id="timerActive" typeId="timerActive" /> + <channel id="brightness" typeId="whiteBrightness" /> + </channels> + </channel-group-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/relay.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/relay.xml new file mode 100644 index 0000000000000..8305b0d94013e --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/relay.xml @@ -0,0 +1,275 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="shelly1"> + <label>Shelly1 (SHSW-1)</label> + <description>Shelly1 device with single relay</description> + <channel-groups> + <channel-group id="relay" typeId="relayChannel" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shelly1pm"> + <label>Shelly1PM (SHSW-PM)</label> + <description>Shelly1PM device with single relay and power meter</description> + <channel-groups> + <channel-group id="relay" typeId="relayChannel" /> + <channel-group id="meter" typeId="meter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellyem"> + <label>ShellyEM (SHEM)</label> + <description>ShellyEM device with single relay and power meter</description> + <channel-groups> + <channel-group id="relay" typeId="relayChannel" /> + <channel-group id="meter1" typeId="emeter"> + <label>Power Meter 1</label> + </channel-group> + <channel-group id="meter2" typeId="emeter"> + <label>Power Meter 2</label> + </channel-group> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shelly2-relay"> + <label>Shelly2 Relay (SHSW-21)</label> + <description>Shelly2 device with two relays</description> + + <channel-groups> + <channel-group id="relay1" typeId="relayChannel"> + <label>Relay 1</label> + </channel-group> + <channel-group id="relay2" typeId="relayChannel"> + <label>Relay 2</label> + </channel-group> + <channel-group id="meter" typeId="meter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + <thing-type id="shelly2-roller"> + <label>Shelly2 Roller (SHSW-21)</label> + <description>Shelly2 in Roller Mode</description> + + <channel-groups> + <channel-group id="roller" typeId="rollerControl" /> + <channel-group id="meter" typeId="meter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shelly25-relay"> + <label>Shelly2.5 Relay (SHSW-25)</label> + <description>Shelly2.5 device with two relays, 2 meters</description> + <channel-groups> + <channel-group id="relay1" typeId="relayChannel"> + <label>Relay 1</label> + </channel-group> + <channel-group id="relay2" typeId="relayChannel"> + <label>Relay 2</label> + </channel-group> + <channel-group id="meter1" typeId="meter"> + <label>Power Meter 1</label> + </channel-group> + <channel-group id="meter2" typeId="meter"> + <label>Power Meter 2</label> + </channel-group> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + <thing-type id="shelly25-roller"> + <label>Shelly2.5 Roller (SHSW-25)</label> + <description>Shelly2 in Roller Mode</description> + + <channel-groups> + <channel-group id="roller" typeId="rollerControl" /> + <channel-group id="meter" typeId="meter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shelly4pro"> + <label>Shelly4 Pro Relay (SHSW-44)</label> + <description>Shelly4Pro device with 4 relays</description> + + <channel-groups> + <channel-group id="relay1" typeId="relayChannel"> + <label>Relay 1</label> + </channel-group> + <channel-group id="relay2" typeId="relayChannel"> + <label>Relay 2</label> + </channel-group> + <channel-group id="relay3" typeId="relayChannel"> + <label>Relay 3</label> + </channel-group> + <channel-group id="relay4" typeId="relayChannel"> + <label>Relay 4</label> + </channel-group> + <channel-group id="meter1" typeId="meter"> + <label>Power Meter 1</label> + </channel-group> + <channel-group id="meter2" typeId="meter"> + <label>Power Meter 2</label> + </channel-group> + <channel-group id="meter3" typeId="meter"> + <label>Power Meter 3</label> + </channel-group> + <channel-group id="meter4" typeId="meter"> + <label>Power Meter 4</label> + </channel-group> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellyplug"> + <label>Shelly Plug</label> + <description>Shelly Plug device with relay and power meter</description> + <channel-groups> + <channel-group id="relay" typeId="relayChannelPlug" /> + <channel-group id="meter" typeId="basicMeter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellyplugs"> + <label>Shelly Plug-S (SHPLG-S)</label> + <description>Shelly Plug-S with relay, meter and LED control</description> + + <channel-groups> + <channel-group id="relay" typeId="relayChannelPlug" /> + <channel-group id="meter" typeId="meter" /> + <channel-group id="led" typeId="ledControl" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + <thing-type id="shellydimmer"> + <label>Shelly Dimmer (SHDM-1)</label> + <description>Shelly Dimmer</description> + <category>DimmableLight</category> + <channel-groups> + <channel-group id="relay" typeId="dimmerChannel" /> + <channel-group id="meter" typeId="meter" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:generic" /> + </thing-type> + + + <channel-group-type id="relayChannel"> + <label>Relay</label> + <description>A Shelly relay channel</description> + <channels> + <channel id="output" typeId="system.power" /> + <channel id="input" typeId="inputState" /> + <channel id="button" typeId="system.button" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + <channel id="timerActive" typeId="timerActive" /> + </channels> + </channel-group-type> + + <channel-group-type id="relayChannelPlug"> + <label>Relay</label> + <description>A Shelly relay channel</description> + <channels> + <channel id="output" typeId="system.power" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + <channel id="timerActive" typeId="timerActive" /> + </channels> + </channel-group-type> + + <channel-group-type id="dimmerChannel"> + <label>Dimmer</label> + <description>A Shelly dimmer channel</description> + <channels> + <channel id="brightness" typeId="dimmerBrightness" /> + <channel id="input1" typeId="inputState1" /> + <channel id="input2" typeId="inputState2" /> + <channel id="button" typeId="system.button" /> + <channel id="autoOn" typeId="timerAutoOn" /> + <channel id="autoOff" typeId="timerAutoOff" /> + </channels> + </channel-group-type> + + <channel-group-type id="rollerControl"> + <label>Roller Control</label> + <description>Controlling the roller mode</description> + <channels> + <channel id="control" typeId="rollerShutter" /> + <channel id="rollerpos" typeId="rollerPosition" /> + <channel id="lastDirection" typeId="rollerDirection" /> + <channel id="stopReason" typeId="rollerStop" /> + <channel id="input1" typeId="inputState1" /> + <channel id="input2" typeId="inputState2" /> + <channel id="event" typeId="eventTrigger" /> + </channels> + </channel-group-type> + <channel-group-type id="meter"> + <label>Power Meter</label> + <description>Power consumption for the relay</description> + <channels> + <channel id="currentWatts" typeId="meterWatts" /> + <channel id="lastPower1" typeId="lastPower1" /> + <channel id="lastPower2" typeId="lastPower2" /> + <channel id="lastPower3" typeId="lastPower3" /> + <channel id="totalKWH" typeId="meterTotal" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + <channel-group-type id="emeter"> + <label>Power Meter</label> + <description>Power consumption for the relay</description> + <channels> + <channel id="currentWatts" typeId="meterWatts" /> + <channel id="totalKWH" typeId="meterTotal" /> + <channel id="returnedKWH" typeId="meterReturned" /> + <channel id="reactiveWatts" typeId="meterReactive" /> + <channel id="voltage" typeId="meterVoltage" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + <channel-group-type id="basicMeter"> + <label>Power Meter</label> + <description>Power consumption</description> + <channels> + <channel id="currentWatts" typeId="meterWatts" /> + </channels> + </channel-group-type> + <channel-group-type id="ledControl"> + <label>LED Control</label> + <description>Control the LEDs</description> + <channels> + <channel id="statusLed" typeId="ledStatusDisable" /> + <channel id="powerLed" typeId="ledPowerDisable" /> + </channels> + </channel-group-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/sensor.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/sensor.xml new file mode 100644 index 0000000000000..5883b428c8995 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/sensor.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="shellyht"> + <label>Shelly HT (SHHT-1)</label> + <description>Shelly HT sensor device (battery powered)</description> + + <channel-groups> + <channel-group id="sensors" typeId="htSensor" /> + <channel-group id="battery" typeId="batteryStatus" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:battery" /> + </thing-type> + + <thing-type id="shellysmoke"> + <label>Shelly Smoke</label> + <description>Shelly Smoke sensor device (battery powered)</description> + + <channel-groups> + <channel-group id="sensors" typeId="smokeSensor" /> + <channel-group id="battery" typeId="batteryStatus" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:battery" /> + </thing-type> + + <thing-type id="shellyflood"> + <label>Shelly Flood (SHWT-1)</label> + <description>Shelly Flood sensor device (battery powered)</description> + <channel-groups> + <channel-group id="sensors" typeId="floodSensor" /> + <channel-group id="battery" typeId="batteryStatus" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:battery" /> + </thing-type> + + <thing-type id="shellysense"> + <label>Shelly Sense (SHSEN-1)</label> + <description>Shelly Sense Remote IR controller</description> + <channel-groups> + <channel-group id="control" typeId="senseControl" /> + <channel-group id="sensors" typeId="senseSensors" /> + <channel-group id="battery" typeId="shortBatteryStatus" /> + <channel-group id="device" typeId="deviceStatus" /> + </channel-groups> + + <config-description-ref uri="thing-type:shelly:battery" /> + </thing-type> + + <channel-group-type id="htSensor"> + <label>Sensor Data</label> + <description>Data from the HT Sensor</description> + <channels> + <channel id="temperature" typeId="sensorTemp" /> + <channel id="humidity" typeId="sensorHumidity" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + + <channel-group-type id="floodSensor"> + <label>Sensor Data</label> + <description>Data from the Flood Sensor</description> + <channels> + <channel id="temperature" typeId="sensorTemp" /> + <channel id="flood" typeId="sensorFlood" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + + <channel-group-type id="smokeSensor"> + <label>Sensor Data</label> + <description>Data from the Flood Sensor</description> + <channels> + <channel id="temperature" typeId="sensorTemp" /> + <channel id="skmoke" typeId="sensorSmoke" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + + <channel-group-type id="senseSensors"> + <label>Sensors</label> + <description>Data from the Sense sensors</description> + <channels> + <channel id="temperature" typeId="sensorTemp" /> + <channel id="humidity" typeId="sensorHumidity" /> + <channel id="lux" typeId="sensorLux" /> + <channel id="motion" typeId="system.motion" /> + <channel id="charger" typeId="sensorCharger" /> + <channel id="lastUpdate" typeId="timestamp" /> + </channels> + </channel-group-type> + <channel-group-type id="batteryStatus"> + <label>Battery Status</label> + <description>Status of the device's battery</description> + <channels> + <channel id="batteryLevel" typeId="system.battery-level" /> + <channel id="voltage" typeId="batVoltage" /> + <channel id="lowBattery" typeId="system.low-battery" /> + </channels> + </channel-group-type> + <channel-group-type id="shortBatteryStatus"> + <label>Battery Status</label> + <description>Status of the device's battery</description> + <channels> + <channel id="batteryLevel" typeId="system.battery-level" /> + <channel id="lowBattery" typeId="system.low-battery" /> + </channels> + </channel-group-type> + + <channel-group-type id="senseControl"> + <label>Sense Control</label> + <description>Sense Settings</description> + <channels> + <channel id="key" typeId="senseKey" /> + </channels> + </channel-group-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/unknown.xml b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/unknown.xml new file mode 100644 index 0000000000000..26ef752bdacc0 --- /dev/null +++ b/bundles/org.openhab.binding.shelly/src/main/resources/ESH-INF/thing/unknown.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="shelly" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="shellydevice"> + <label>Shelly Device</label> + <description>A password protected or unknown device.</description> + + <config-description> + <parameter name="userId" type="text" required="true"> + <label>UserID</label> + <description>User ID for API access.</description> + </parameter> + <parameter name="password" type="text" required="true"> + <label>Password</label> + <description>Password for API access.</description> + <context>password</context> + </parameter> + <parameter name="deviceIp" type="text" required="true"> + <label>IP Address</label> + <description>IP Address of the Shelly device.</description> + <context>network-address</context> + </parameter> + </config-description> + + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.siemensrds/NOTICE b/bundles/org.openhab.binding.siemensrds/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.siemensrds/NOTICE +++ b/bundles/org.openhab.binding.siemensrds/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.siemensrds/README.md b/bundles/org.openhab.binding.siemensrds/README.md index 90dcdb45ed8c0..211d1b44320f5 100644 --- a/bundles/org.openhab.binding.siemensrds/README.md +++ b/bundles/org.openhab.binding.siemensrds/README.md @@ -20,7 +20,7 @@ If the Configuration Parameters are all valid, then the Climatix IC Account Thin If the sign on succeeds, the Thing will indicate its status as Online, otherwise it will show an error status. Once the Thing of the type Climatix IC Account has been created and successfully signed on to the cloud server, it will automatically interrogate the server to discover all the respective RDS Smart Thermostat Things associated with that account. -After a short while, all discovered RDS Smart Thermostat Things will be displayed in the PaperUI Inbox. +After a short while, all discovered RDS Smart Thermostat Things will be displayed in the Paper UI Inbox. If in future you add new RDS Smart Thermostat devices to your Siemens account (e.g. via the Siemens App) then these new devices will also appear in the Inbox. ## Thing Configuration for "Climatix IC Account" @@ -41,7 +41,7 @@ Note: You must create ONLY ONE Thing of the type Climatix IC Account; duplicate ## Thing Configuration for "RDS Smart Thermostat" Each RDS Smart Thermostat Thing is identified in the Climatix IC Account by means of a unique Plant Id code. -The PaperUI automatic discovery process determines the Plant Id codes of all connected thermostats automatically. +The Paper UI automatic discovery process determines the Plant Id codes of all connected thermostats automatically. | Configuration Parameter | Description | |-------------------------|-------------------------------------------------------------------------------------------------------------| @@ -75,7 +75,7 @@ Bridge siemensrds:climatixic:mybridgename "Climatix IC Account" [ userEmail="ema ``` To manually configure an RDS Smart Thermostat Thing requires knowledge of the "Plant Id" which is a unique code used to identify a specific thermostat device in the Siemens Climatix IC cloud server account. -The PaperUI automatic Discovery service (see above) discovers the "Plant Id" codes during the discovery process. +The Paper UI automatic Discovery service (see above) discovers the "Plant Id" codes during the discovery process. ``` Bridge siemensrds:climatixic:mybridgename "Climatix IC Account" [ userEmail="email@example.com", userPassword="secret", apiKey="32-character-code-provided-by-siemens", pollingInterval=60 ] { diff --git a/bundles/org.openhab.binding.siemensrds/pom.xml b/bundles/org.openhab.binding.siemensrds/pom.xml index 45157d870ee83..e09790d50389f 100644 --- a/bundles/org.openhab.binding.siemensrds/pom.xml +++ b/bundles/org.openhab.binding.siemensrds/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.siemensrds</artifactId> diff --git a/bundles/org.openhab.binding.siemensrds/src/main/feature/feature.xml b/bundles/org.openhab.binding.siemensrds/src/main/feature/feature.xml index eaafaf776c0f4..a6754635da43d 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.siemensrds/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.neohub-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-siemensrds" description="Siemens RDS Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsAccessToken.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsAccessToken.java index c62650579c19a..3f54b38510444 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsAccessToken.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsAccessToken.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -114,7 +114,7 @@ private static String httpGetTokenJson(String apiKey, String user, String passwo String json = httpGetTokenJson(apiKey, user, password); return GSON.fromJson(json, RdsAccessToken.class); } catch (JsonSyntaxException | RdsCloudException | IOException e) { - LOGGER.warn("token creation error \"{}\"", e.getMessage(), e); + LOGGER.warn("create {}: \"{}\"", e.getClass().getName(), e.getMessage()); return null; } } diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsBindingConstants.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsBindingConstants.java index 9528cdfa9c99e..ef307d901c0fb 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsBindingConstants.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudConfiguration.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudConfiguration.java index 0594fd2c55872..2d1ac6d240387 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudConfiguration.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudException.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudException.java index bbd541ba8912e..f5ac5eae89a76 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudException.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudHandler.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudHandler.java index 16fa2a70e5423..76865dbe0d58f 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudHandler.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsCloudHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -53,19 +53,19 @@ public void initialize() { if (config == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing configuration, status => offline!"); + "missing configuration"); return; } if (config.userEmail.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing email address, status => offline!"); + "missing email address"); return; } if (config.userPassword.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing password, status => offline!"); + "missing password"); return; } @@ -74,12 +74,10 @@ public void initialize() { if (config.pollingInterval < FAST_POLL_INTERVAL || config.pollingInterval > LAZY_POLL_INTERVAL) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - String.format("polling interval out of range [%d..%d], status => offline!", FAST_POLL_INTERVAL, + String.format("polling interval out of range [%d..%d]", FAST_POLL_INTERVAL, LAZY_POLL_INTERVAL)); return; } - - refreshToken(); } @Override @@ -106,12 +104,13 @@ private synchronized void refreshToken() { if (accessToken != null) { if (getThing().getStatus() != ThingStatus.ONLINE) { - updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, "server responded, status => online.."); + updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, + "cloud server responded"); } } else { if (getThing().getStatus() == ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "server authentication error, status => offline!"); + "cloud server authentication error"); } } } diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsConfiguration.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsConfiguration.java index 4a8c8d9b4a30c..59de4ee01dde3 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsConfiguration.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDataPoints.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDataPoints.java index 04bd96c50f2cf..a824d998fe8ab 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDataPoints.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDataPoints.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -129,9 +129,9 @@ protected static String httpGenericGetJson(String apiKey, String token, String u LOGGER.trace("create: response={}", json); } - return GSON.fromJson(json, RdsDataPoints.class); + return GSON.fromJson(json, RdsDataPoints.class); } catch (JsonSyntaxException | RdsCloudException | IOException e) { - LOGGER.warn("point list creation error \"{}\"", e.getMessage(), e); + LOGGER.warn("create {}: \"{}\"", e.getClass().getName(), e.getMessage()); return null; } } @@ -300,7 +300,7 @@ public void setValue(String apiKey, String token, String hierarchyName, String v try { httpSetPointValueJson(apiKey, token, pointId, json); } catch (RdsCloudException | IOException e) { - LOGGER.warn("setValue: error \"{}\"", e.getMessage(), e); + LOGGER.warn("setValue {} {}: \"{}\"", hierarchyName, e.getClass().getName(), e.getMessage()); return; } } else { @@ -324,6 +324,15 @@ public boolean refresh(String apiKey, String token) { set.add(String.format("\"%s\"", pointId)); } } + + for (Map.Entry<String, BasePoint> entry : points.entrySet()) { + BasePoint point = entry.getValue(); + if (point != null && point.memberName != null && point.memberName.equals("Online")) { + set.add(String.format("\"%s\"", entry.getKey())); + break; + } + } + valueFilter = String.join(",", set); } @@ -371,7 +380,7 @@ public boolean refresh(String apiKey, String token) { return true; } catch (JsonSyntaxException | RdsCloudException | IOException e) { - LOGGER.warn("refresh: error \"{}\"", e.getMessage()); + LOGGER.warn("refresh {}: \"{}\"", e.getClass().getName(), e.getMessage()); return false; } } diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDebouncer.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDebouncer.java index 017e01a51e315..cb0b66283e916 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDebouncer.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDebouncer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDiscoveryService.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDiscoveryService.java index 204fd9cffbcd7..192819e93597b 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDiscoveryService.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -65,6 +65,9 @@ public void deactivate() { @Override protected void startScan() { + if (cloud.getThing().getStatus() != ThingStatus.ONLINE) { + cloud.getToken(); + } if (cloud.getThing().getStatus() == ThingStatus.ONLINE) { discoverPlants(); } @@ -72,8 +75,7 @@ protected void startScan() { @Override protected void startBackgroundDiscovery() { - String msg = "start background discovery.."; - logger.info(msg); + logger.debug("start background discovery.."); if (discoveryScheduler == null || discoveryScheduler.isCancelled()) { discoveryScheduler = scheduler.scheduleWithFixedDelay(this::startScan, 10, @@ -83,8 +85,7 @@ protected void startBackgroundDiscovery() { @Override protected void stopBackgroundDiscovery() { - String msg = "stop background discovery.."; - logger.info(msg); + logger.debug("stop background discovery.."); if (discoveryScheduler != null && !discoveryScheduler.isCancelled()) { discoveryScheduler.cancel(true); diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandler.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandler.java index 3d882232f4a8b..618f907615e51 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandler.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -74,13 +74,13 @@ public void handleCommand(ChannelUID channelUID, Command command) { @Override public void initialize() { - updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.CONFIGURATION_PENDING, "status => unknown.."); + updateStatus(ThingStatus.UNKNOWN, ThingStatusDetail.CONFIGURATION_PENDING); config = getConfigAs(RdsConfiguration.class); if (config == null || config.plantId == null || config.plantId.isEmpty()) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing Plant Id, status => offline!"); + "missing Plant Id"); return; } @@ -88,13 +88,13 @@ public void initialize() { if (cloud == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing cloud handler, status => offline!"); + "missing cloud server handler"); return; } if (cloud.getThing().getStatus() != ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, - "cloud handler not online, status => offline!"); + "cloud server offline"); return; } @@ -108,8 +108,6 @@ public void initializePolling() { int pollInterval = cloud.getPollInterval(); if (pollInterval > 0) { - logger.info("creating polling timers.."); - // create a "lazy" polling scheduler if (lazyPollingScheduler == null || lazyPollingScheduler.isCancelled()) { lazyPollingScheduler = scheduler.scheduleWithFixedDelay(this::lazyPollingSchedulerExecute, @@ -139,8 +137,6 @@ public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { @Override public void dispose() { - logger.info("disposing polling timers.."); - // clean up the lazy polling scheduler if (lazyPollingScheduler != null && !lazyPollingScheduler.isCancelled()) { lazyPollingScheduler.cancel(true); @@ -192,18 +188,19 @@ private void doPollNow() { if (cloud == null) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - "missing cloud handler, status => offline!"); + "missing cloud server handler"); return; } + String token = cloud.getToken(); + if (cloud.getThing().getStatus() != ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, - "cloud handler offline, status => offline!"); + "cloud server offline"); return; } String apiKey = cloud.getApiKey(); - String token = cloud.getToken(); if (points == null || (!points.refresh(apiKey, token))) { points = RdsDataPoints.create(apiKey, token, config.plantId); @@ -212,7 +209,7 @@ private void doPollNow() { if (points == null) { if (getThing().getStatus() == ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - String.format("server has no info for %s, status => offline!", getThing().getLabel())); + "cloud server has no info this device"); } return; } @@ -220,14 +217,14 @@ private void doPollNow() { if (!points.isOnline()) { if (getThing().getStatus() == ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, - String.format("server reports %s offline, status => offline!", getThing().getLabel())); + "cloud server reports device offline"); } return; } if (getThing().getStatus() != ThingStatus.ONLINE) { updateStatus(ThingStatus.ONLINE, ThingStatusDetail.NONE, - String.format("received info for %s from cloud server, status => online..", getThing().getLabel())); + "received info from cloud server"); } for (ChannelMap chan : CHAN_MAP) { @@ -352,7 +349,7 @@ private synchronized void doHandleCommand(String channelId, Command command) { } /* - * private method: returns the cloud handler + * private method: returns the cloud server handler */ private RdsCloudHandler getCloudHandler() { @Nullable Bridge b; diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandlerFactory.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandlerFactory.java index 83088196b1302..160a570c37ce1 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandlerFactory.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsPlants.java b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsPlants.java index 77ab9791283f5..5337d14ff732b 100644 --- a/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsPlants.java +++ b/bundles/org.openhab.binding.siemensrds/src/main/java/org/openhab/binding/siemensrds/internal/RdsPlants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -66,7 +66,7 @@ public Boolean isOnline() { String json = RdsDataPoints.httpGenericGetJson(apiKey, token, URL_PLANTS); return GSON.fromJson(json, RdsPlants.class); } catch (JsonSyntaxException | RdsCloudException | IOException e) { - LOGGER.warn("plant list creation error \"{}\"", e.getMessage(), e); + LOGGER.warn("create {}: \"{}\"", e.getClass().getName(), e.getMessage()); return null; } } diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/NOTICE b/bundles/org.openhab.binding.silvercrestwifisocket/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/NOTICE +++ b/bundles/org.openhab.binding.silvercrestwifisocket/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/README.md b/bundles/org.openhab.binding.silvercrestwifisocket/README.md index 0897d9693ed9d..867a713e963cd 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/README.md +++ b/bundles/org.openhab.binding.silvercrestwifisocket/README.md @@ -4,21 +4,25 @@ This binding integrates the Silvercrest Wifi Socket SWS-A1 sold by Lidl and the ## Supported Things -- Silvercrest Wifi Socket SWS-A1 - [(Owner Manual)](http://www.lidl-service.com/static/118127777/103043_FI.pdf) -- Tested with firmware version: 1.41, 1.60, 1.70 +- Silvercrest Wifi Socket SWS-A1 - [(Owner Manual)](https://www.lidl-service.com/static/118127777/103043_FI.pdf) -- Tested with firmware version: 1.41, 1.60, 1.70 - EasyHome Wifi Socket DIS-124 <https://www.aldi-sued.de/de/infos/aldi-sued-a-bis-z/s/serviceportal/ergebnisliste/sis/si/wifi-steckdose/> ## Discovery -The Discovery of Wifi Sockets is always running in the background. If a command is sent to wifi socket using the Android/iOS app or if the physical button in the device is pressed, the device will be recognized and will be placed in the Inbox. +The Discovery of Wifi Sockets is always running in the background. +If a command is sent to wifi socket using the Android/iOS app or if the physical button in the device is pressed, the device will be recognized and will be placed in the Inbox. ## Binding Configuration -The binding does not require any special configuration. The Wifi Socket should be connected to the same wifi network. +The binding does not require any special configuration. +The Wifi Socket should be connected to the same wifi network. ## Thing Configuration -To configure a Wifi Socket manually the mac address and the vendor is required. You can check the Wifi Socket mac address in your router or using some mobile app. Supported vendors are either Silvercrest (Lidl) or EasyHome (Aldi). +To configure a Wifi Socket manually the mac address and the vendor is required. +You can check the Wifi Socket mac address in your router or using some mobile app. +Supported vendors are either Silvercrest (Lidl) or EasyHome (Aldi). Wifi Socket thing parameters: diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/pom.xml b/bundles/org.openhab.binding.silvercrestwifisocket/pom.xml index e1bc202bd6cfc..8ec67a4a8d764 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/pom.xml +++ b/bundles/org.openhab.binding.silvercrestwifisocket/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.silvercrestwifisocket</artifactId> diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/feature/feature.xml b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/feature/feature.xml index 788e54ce5095f..e35eb849a743d 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.silvercrestwifisocket-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-silvercrestwifisocket" description="Silvercrest Wifi Plug Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketBindingConstants.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketBindingConstants.java index e64d79cf4bf54..c309c126cedc2 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketBindingConstants.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketHandlerFactory.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketHandlerFactory.java index 749a0164f3fd5..b66918592b0a4 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketHandlerFactory.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/SilvercrestWifiSocketHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/discovery/SilvercrestWifiSocketDiscoveryService.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/discovery/SilvercrestWifiSocketDiscoveryService.java index 4c70f33c75d30..9442d1f830450 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/discovery/SilvercrestWifiSocketDiscoveryService.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/discovery/SilvercrestWifiSocketDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketRequest.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketRequest.java index 59a3a11bd9e27..8e5dedb9b3301 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketRequest.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketResponse.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketResponse.java index 490757379a47e..0f6187a18f520 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketResponse.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/entities/SilvercrestWifiSocketResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketRequestType.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketRequestType.java index be2ce377e4d0e..035f74d78cbd5 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketRequestType.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketRequestType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketResponseType.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketResponseType.java index d23c9a4037f72..dc3e4e3d6573e 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketResponseType.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketResponseType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketVendor.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketVendor.java index fb00d56e2d616..0d25bc78a32b1 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketVendor.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/enums/SilvercrestWifiSocketVendor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/MacAddressNotValidException.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/MacAddressNotValidException.java index 9bcc586d5b00f..55fd51dd2bdc7 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/MacAddressNotValidException.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/MacAddressNotValidException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/NotOneResponsePacketException.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/NotOneResponsePacketException.java index b2106ed304bbe..2813eae8b5ecb 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/NotOneResponsePacketException.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/NotOneResponsePacketException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/PacketIntegrityErrorException.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/PacketIntegrityErrorException.java index 7688acde85c45..ac65db70fdb91 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/PacketIntegrityErrorException.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/exceptions/PacketIntegrityErrorException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketHandler.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketHandler.java index 5c8ae8bd713a6..2a3fb250e9a72 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketHandler.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediator.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediator.java index a7b75bc7fa14c..e7073f1218961 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediator.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java index fed173872fa23..744ea79e018dd 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/runnable/SilvercrestWifiSocketUpdateReceiverRunnable.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/runnable/SilvercrestWifiSocketUpdateReceiverRunnable.java index 6ebd00fcaf058..5424fedaf4c11 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/runnable/SilvercrestWifiSocketUpdateReceiverRunnable.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/runnable/SilvercrestWifiSocketUpdateReceiverRunnable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/NetworkUtils.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/NetworkUtils.java index 50e8fcae57693..3e4f64123bff8 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/NetworkUtils.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/NetworkUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/ValidationUtils.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/ValidationUtils.java index ff3685903011d..b467f35e30963 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/ValidationUtils.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/ValidationUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/WifiSocketPacketConverter.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/WifiSocketPacketConverter.java index 4ea80e6a1d2b5..403d0e1be5da0 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/WifiSocketPacketConverter.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/utils/WifiSocketPacketConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/resources/ESH-INF/thing/thing-types.xml index b8c0854e49f59..82e04541aef7d 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/resources/ESH-INF/thing/thing-types.xml @@ -15,16 +15,16 @@ <config-description> <parameter name="macAddress" type="text" required="true"> - <label>MAC address</label> + <label>MAC Address</label> <description>The socket MAC address.</description> </parameter> <parameter name="hostAddress" type="text"> - <label>Host address</label> + <label>Host Address</label> <context>network-address</context> <description>The socket Host address. The binding is able to discover the host address.</description> </parameter> <parameter name="updateInterval" type="integer" min="5"> - <label>Update interval</label> + <label>Update Interval</label> <description>Update time interval in seconds to request the status of the socket.</description> </parameter> <parameter name="vendor" type="text" required="true"> diff --git a/bundles/org.openhab.binding.sinope/.classpath b/bundles/org.openhab.binding.sinope/.classpath index 17eec12a68c9a..1afcd4c448630 100644 --- a/bundles/org.openhab.binding.sinope/.classpath +++ b/bundles/org.openhab.binding.sinope/.classpath @@ -12,7 +12,6 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry combineaccessrules="false" kind="src" path="/core"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> <attributes> <attribute name="maven.pomderived" value="true"/> diff --git a/bundles/org.openhab.binding.sinope/NOTICE b/bundles/org.openhab.binding.sinope/NOTICE index 8312a3009589e..38d625e349232 100644 --- a/bundles/org.openhab.binding.sinope/NOTICE +++ b/bundles/org.openhab.binding.sinope/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons \ No newline at end of file +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.sinope/pom.xml b/bundles/org.openhab.binding.sinope/pom.xml index 924a636178d59..472b8d21457fe 100644 --- a/bundles/org.openhab.binding.sinope/pom.xml +++ b/bundles/org.openhab.binding.sinope/pom.xml @@ -1,13 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sinope</artifactId> diff --git a/bundles/org.openhab.binding.sinope/src/main/feature/feature.xml b/bundles/org.openhab.binding.sinope/src/main/feature/feature.xml index eadc4aa3c4597..9ed99009ca7cf 100644 --- a/bundles/org.openhab.binding.sinope/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sinope/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.sinope-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sinope" description="Sinope Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/SinopeBindingConstants.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/SinopeBindingConstants.java index 83bb39f962601..aa9384faaa6aa 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/SinopeBindingConstants.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/SinopeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeGatewayHandler.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeGatewayHandler.java index 36605668138c9..e618935e41690 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeGatewayHandler.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeGatewayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -76,19 +76,26 @@ public SinopeGatewayHandler(final Bridge bridge) { public void initialize() { logger.debug("Initializing Sinope Gateway"); - SinopeConfig config = getConfigAs(SinopeConfig.class); - if (config.hostname == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Gateway hostname must be set"); - } else if (config.port == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Gateway port must be set"); - } else if (config.gatewayId == null || SinopeConfig.convert(config.gatewayId) == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Gateway Id must be set"); - } else if (config.apiKey == null || SinopeConfig.convert(config.apiKey) == null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Api Key must be set"); - } else { + try { + SinopeConfig config = getConfigAs(SinopeConfig.class); refreshInterval = config.refresh; - schedulePoll(); - updateStatus(ThingStatus.ONLINE); + if (config.hostname == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Gateway hostname must be set"); + } else if (config.port == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Gateway port must be set"); + } else if (config.gatewayId == null || SinopeConfig.convert(config.gatewayId) == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Gateway Id must be set"); + } else if (config.apiKey == null || SinopeConfig.convert(config.apiKey) == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Api Key must be set"); + } else if (connectToBridge()) { + schedulePoll(); + updateStatus(ThingStatus.ONLINE); + return; + } + } catch (IOException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, + "Can't connect to gateway. Please make sure that another instance is not connected."); } } diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeThermostatHandler.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeThermostatHandler.java index 63217618b54c1..628f5443f05b9 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeThermostatHandler.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/handler/SinopeThermostatHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -267,6 +267,7 @@ private synchronized void updateDeviceId() { if (handler != null) { handler.registerThermostatHandler(this); } + updateStatus(ThingStatus.ONLINE); } private @Nullable SinopeGatewayHandler getSinopeGatewayHandler() { diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeConfigStatusMessage.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeConfigStatusMessage.java index fcfcae943adb8..93835a1be2258 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeConfigStatusMessage.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeConfigStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeHandlerFactory.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeHandlerFactory.java index 323339d60424d..741c5915e4f5f 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeHandlerFactory.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/SinopeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/config/SinopeConfig.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/config/SinopeConfig.java index 6d6e522a7c0f8..42b2277afe1d7 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/config/SinopeConfig.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/config/SinopeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginAnswer.java index 3ad452ed7f7ac..ffbf956a0a52a 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -142,4 +142,4 @@ public String toString() { return sb.toString(); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginRequest.java index 2c91d0113e182..03a27a6c3ddd5 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeApiLoginRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyAnswer.java index 992688be58a16..b9b4f0679edfc 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyRequest.java index 309a709dc9ed7..8c5259e024d49 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeAuthenticationKeyRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadAnswer.java index 5b32d6c6fa89e..ff59134e68bf7 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadRequest.java index 8b19bcebd6f4c..be61796889a71 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataReadRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteAnswer.java index 042ab17e21654..653b6f7c6ccc7 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteRequest.java index 17aeb3eb7285f..00cb12f3344c2 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDataWriteRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDeviceReportAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDeviceReportAnswer.java index aaf28e82ac741..072e9b6ad0b28 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDeviceReportAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopeDeviceReportAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingAnswer.java index fe71581b723d3..86d178560c51c 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingRequest.java index 00ab8f6adab07..a4113629ebdd5 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/SinopePingRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeAppData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeAppData.java index a9abd09d59354..76a32d2830aee 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeAppData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeAppData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeHeatLevelData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeHeatLevelData.java index df643b933d76f..244e1f1cf53c4 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeHeatLevelData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeHeatLevelData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeLocalTimeData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeLocalTimeData.java index 5ee9ac2ec078e..4645a544e1099 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeLocalTimeData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeLocalTimeData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeOutTempData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeOutTempData.java index 52faef42bda6f..b8f6d94763ab0 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeOutTempData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeOutTempData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeRoomTempData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeRoomTempData.java index f5bbbb521c25f..4b3fcb75e1bcf 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeRoomTempData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeRoomTempData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointModeData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointModeData.java index ccb6846a0574e..80a9eae8f216c 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointModeData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointModeData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointTempData.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointTempData.java index c465529ac6919..d8d0098b82266 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointTempData.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/appdata/SinopeSetPointTempData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/NotSupportedException.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/NotSupportedException.java index 561c3140f564e..94c17077e9bc2 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/NotSupportedException.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/NotSupportedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeAnswer.java index eaf156fb47730..4756a9980d60a 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataAnswer.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataAnswer.java index d36c9d1a1d74d..1ea1fbb501385 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataAnswer.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataAnswer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataRequest.java index 0821a5f5fd87b..3a75f1da174e0 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeDataRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeFrame.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeFrame.java index 9041c6e7d31e9..7a01173ecae97 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeFrame.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeFrame.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeRequest.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeRequest.java index 4f52782192938..e24a68b3b13fd 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeRequest.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/core/base/SinopeRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -83,4 +83,4 @@ protected void setInternal_payload(byte[] internal_payload) { logger.debug("Request Frame: {}", ByteUtil.toString(internal_payload)); super.setInternal_payload(internal_payload); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/discovery/SinopeThingsDiscoveryService.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/discovery/SinopeThingsDiscoveryService.java index 2fe46afe12bbe..c25d4fe736d38 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/discovery/SinopeThingsDiscoveryService.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/discovery/SinopeThingsDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/ByteUtil.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/ByteUtil.java index e62035caa7563..2ebc16bc914d5 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/ByteUtil.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/ByteUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/CRC8.java b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/CRC8.java index f4726707ec3ba..c0cbcda328d94 100644 --- a/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/CRC8.java +++ b/bundles/org.openhab.binding.sinope/src/main/java/org/openhab/binding/sinope/internal/util/CRC8.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -95,4 +95,4 @@ public void reset() { value = init; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/binding/binding.xml index 771f5c20dd361..f1f7ea0df56b2 100644 --- a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/binding/binding.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="sinope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> +<binding:binding id="sinope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Sinopé Binding</name> <description>This is the binding for Sinopé. Sinopé provides high-quality, energy-efficient products and with innovative technology solutions that will meet customer's current and future needs: low and high voltage thermostats, light switches, water leak detectors and load controllers.</description> diff --git a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/i18n/sinope.properties b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/i18n/sinope.properties index cd8b228f21598..db2cf8e8693f7 100644 --- a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/i18n/sinope.properties +++ b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/i18n/sinope.properties @@ -1,4 +1,4 @@ config-status.error.missing-host-configuration=No host for the sinopé gateway has been provided. config-status.error.missing-port-configuration=No port for the sinopé gateway has been provided. invalid-gateway-id-configuration=Missing or invalid gateway id. -invalid-api-key-configuration=Missing or invalid API key. \ No newline at end of file +invalid-api-key-configuration=Missing or invalid API key. diff --git a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/thing/thing-types.xml index 50b6b8bd45ad9..6d23464a94bad 100644 --- a/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.sinope/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="sinope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="gateway"> <label>Sinopé Gateway</label> <description>A Sinopé Gateway</description> @@ -51,7 +51,7 @@ </channels> <config-description> <parameter name="deviceId" type="text" required="true"> - <label>Thermostat device ID</label> + <label>Thermostat Device ID</label> </parameter> </config-description> </thing-type> diff --git a/bundles/org.openhab.binding.sleepiq/NOTICE b/bundles/org.openhab.binding.sleepiq/NOTICE index 3f6e89d46bc28..2713faafa7fb6 100644 --- a/bundles/org.openhab.binding.sleepiq/NOTICE +++ b/bundles/org.openhab.binding.sleepiq/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.sleepiq/README.md b/bundles/org.openhab.binding.sleepiq/README.md index ef6768ef6dd69..8bafc9f3e2a1a 100644 --- a/bundles/org.openhab.binding.sleepiq/README.md +++ b/bundles/org.openhab.binding.sleepiq/README.md @@ -6,7 +6,7 @@ This binding integrates with the SleepIQ system from Select Comfort for Sleep Nu SleepIQ is a service provided by Select Comfort and sold as an option for Sleep Number beds. The system collects data about the bed (including individual air chamber data for dual chamber beds). -This information includes whether or not a sleeper is in bed, the current sleep number setting, the pressure of the air chamber, and it's link status. +This information includes whether or not a sleeper is in bed, the current sleep number setting, the pressure of the air chamber, and its link status. This data can then be analyzed for any number of purposes, including improving sleep. ## Supported Things diff --git a/bundles/org.openhab.binding.sleepiq/pom.xml b/bundles/org.openhab.binding.sleepiq/pom.xml index 10aacf0a04e0d..ea271d5807f85 100644 --- a/bundles/org.openhab.binding.sleepiq/pom.xml +++ b/bundles/org.openhab.binding.sleepiq/pom.xml @@ -1,24 +1,33 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sleepiq</artifactId> <name>openHAB Add-ons :: Bundles :: SleepIQ Binding</name> + <properties> + <dep.noembedding>provider-gson</dep.noembedding> + </properties> + <dependencies> <dependency> <groupId>org.syphr</groupId> <artifactId>sleepiq-api</artifactId> <version>0.3.0</version> - <scope>provided</scope> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.eclipsesource.jaxrs</groupId> + <artifactId>provider-gson</artifactId> + <version>2.3</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.sleepiq/src/main/feature/feature.xml b/bundles/org.openhab.binding.sleepiq/src/main/feature/feature.xml index e59d3719f8161..1f7c440c1c0bc 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sleepiq/src/main/feature/feature.xml @@ -1,11 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.sleepiq-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sleepiq" description="SleepIQ Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <bundle dependency="true">mvn:com.eclipsesource.jaxrs/provider-gson/2.3</bundle> - <bundle dependency="true">mvn:org.syphr/sleepiq-api/0.3.0</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.sleepiq/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQBindingConstants.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQBindingConstants.java index 010557ccab7bd..e602c99eea416 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQBindingConstants.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQConfigStatusMessage.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQConfigStatusMessage.java index ac0e980c3414e..b77b9afea5a54 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQConfigStatusMessage.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQConfigStatusMessage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQHandlerFactory.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQHandlerFactory.java index 5571ffa8f8c95..c1504609c9994 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQHandlerFactory.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/SleepIQHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQBedConfiguration.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQBedConfiguration.java index af40e794dfc07..9c0cf6a1b9636 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQBedConfiguration.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQBedConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQCloudConfiguration.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQCloudConfiguration.java index 929ddc8a269a0..a7276a3a1a6ee 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQCloudConfiguration.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/config/SleepIQCloudConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/discovery/SleepIQBedDiscoveryService.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/discovery/SleepIQBedDiscoveryService.java index 707895c2be493..75d1b32624ec4 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/discovery/SleepIQBedDiscoveryService.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/discovery/SleepIQBedDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/BedStatusListener.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/BedStatusListener.java index 4c7041e250fab..5ff449ed5ec56 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/BedStatusListener.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/BedStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQCloudHandler.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQCloudHandler.java index ef0e6f070a841..92e22d7a45590 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQCloudHandler.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQCloudHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQDualBedHandler.java b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQDualBedHandler.java index c1ce2d76c6219..cca5d880df1e4 100644 --- a/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQDualBedHandler.java +++ b/bundles/org.openhab.binding.sleepiq/src/main/java/org/openhab/binding/sleepiq/internal/handler/SleepIQDualBedHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/NOTICE b/bundles/org.openhab.binding.smaenergymeter/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.smaenergymeter/NOTICE +++ b/bundles/org.openhab.binding.smaenergymeter/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.smaenergymeter/pom.xml b/bundles/org.openhab.binding.smaenergymeter/pom.xml index b137699deaf19..95d227ce59133 100644 --- a/bundles/org.openhab.binding.smaenergymeter/pom.xml +++ b/bundles/org.openhab.binding.smaenergymeter/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.smaenergymeter</artifactId> diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/feature/feature.xml b/bundles/org.openhab.binding.smaenergymeter/src/main/feature/feature.xml index eba90e2c5eedc..61947bb011ac3 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.smaenergymeter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-smaenergymeter" description="SMA Energy Monitor Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterBindingConstants.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterBindingConstants.java index 318bb6460b0be..61cc131e051c3 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterBindingConstants.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterHandlerFactory.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterHandlerFactory.java index 1872f490d1b69..0f5fc5b6a946b 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterHandlerFactory.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/SMAEnergyMeterHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/configuration/EnergyMeterConfig.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/configuration/EnergyMeterConfig.java index e908c1e9d6b02..bc11fab77df3b 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/configuration/EnergyMeterConfig.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/configuration/EnergyMeterConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/discovery/SMAEnergyMeterDiscoveryService.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/discovery/SMAEnergyMeterDiscoveryService.java index bc57ea44a0e44..07bc966572911 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/discovery/SMAEnergyMeterDiscoveryService.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/discovery/SMAEnergyMeterDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/EnergyMeter.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/EnergyMeter.java index ba6dd83218bf4..f5da54e1117e7 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/EnergyMeter.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/EnergyMeter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/FieldDTO.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/FieldDTO.java index 650f7ecd8f206..032243fd15760 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/FieldDTO.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/FieldDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/SMAEnergyMeterHandler.java b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/SMAEnergyMeterHandler.java index 5fff2d0c59687..f274417cfa2ad 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/SMAEnergyMeterHandler.java +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/java/org/openhab/binding/smaenergymeter/internal/handler/SMAEnergyMeterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smaenergymeter/src/main/resources/ESH-INF/thing/energyMeter.xml b/bundles/org.openhab.binding.smaenergymeter/src/main/resources/ESH-INF/thing/energyMeter.xml index eff5be31ce0b8..12931eda1478d 100644 --- a/bundles/org.openhab.binding.smaenergymeter/src/main/resources/ESH-INF/thing/energyMeter.xml +++ b/bundles/org.openhab.binding.smaenergymeter/src/main/resources/ESH-INF/thing/energyMeter.xml @@ -33,7 +33,7 @@ <advanced>true</advanced> </parameter> <parameter name="pollingPeriod" type="integer" required="false"> - <label>Polling period</label> + <label>Polling Period</label> <description>Polling period for refreshing the data in s</description> <default>30</default> <advanced>true</advanced> @@ -43,25 +43,25 @@ <channel-type id="powerInType"> <item-type>Number</item-type> - <label>Purchased power</label> + <label>Purchased Power</label> <category>Energy</category> <state pattern="%.2f W" readOnly="true" /> </channel-type> <channel-type id="powerOutType"> <item-type>Number</item-type> - <label>Grid feed-in power</label> + <label>Grid Feed-in Power</label> <category>Energy</category> <state pattern="%.2f W" readOnly="true" /> </channel-type> <channel-type id="energyInType"> <item-type>Number</item-type> - <label>Purchased energy</label> + <label>Purchased Energy</label> <category>Energy</category> <state pattern="%.2f kWh" readOnly="true" /> </channel-type> <channel-type id="energyOutType"> <item-type>Number</item-type> - <label>Grid feed-in energy</label> + <label>Grid Feed-in Energy</label> <category>Energy</category> <state pattern="%.2f kWh" readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.smartmeter/NOTICE b/bundles/org.openhab.binding.smartmeter/NOTICE index f0cab074753e7..034766e86201f 100644 --- a/bundles/org.openhab.binding.smartmeter/NOTICE +++ b/bundles/org.openhab.binding.smartmeter/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.smartmeter/pom.xml b/bundles/org.openhab.binding.smartmeter/pom.xml index 74e869dd0eb8d..44d7fec5a07fa 100644 --- a/bundles/org.openhab.binding.smartmeter/pom.xml +++ b/bundles/org.openhab.binding.smartmeter/pom.xml @@ -1,46 +1,41 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.smartmeter</artifactId> <name>openHAB Add-ons :: Bundles :: Smartmeter Binding</name> - <properties> - <bnd.exportpackage>org.openmuc.jrxtx;version="1.1.2"</bnd.exportpackage> - </properties> - <dependencies> <dependency> <groupId>io.reactivex.rxjava2</groupId> <artifactId>rxjava</artifactId> <version>2.2.3</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.reactivestreams</groupId> <artifactId>reactive-streams</artifactId> <version>1.0.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.openmuc</groupId> <artifactId>jsml</artifactId> <version>1.1.2</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.openmuc</groupId> <artifactId>j62056</artifactId> <version>2.1.0</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.smartmeter/src/main/feature/feature.xml b/bundles/org.openhab.binding.smartmeter/src/main/feature/feature.xml index 9e26c632fd459..333737798a0ae 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.smartmeter/src/main/feature/feature.xml @@ -1,14 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.smartmeter-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-smartmeter" description="Smartmeter Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> <feature>openhab-transport-serial</feature> - <bundle dependency="true">mvn:io.reactivex.rxjava2/rxjava/2.2.3</bundle> - <bundle dependency="true">mvn:org.reactivestreams/reactive-streams/1.0.2</bundle> - <bundle dependency="true">mvn:org.openmuc/jsml/1.1.2</bundle> - <bundle dependency="true">mvn:org.openmuc/j62056/2.1.0</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.smartmeter/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterBindingConstants.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterBindingConstants.java index 71cd95c88e986..0f06c48d0ed76 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterBindingConstants.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterConfiguration.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterConfiguration.java index a0dd75779caa7..aef9eafac6c3e 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterConfiguration.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/SmartMeterConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/ConnectorBase.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/ConnectorBase.java index b6187e4915327..2f28b49f2d680 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/ConnectorBase.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/ConnectorBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/IMeterReaderConnector.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/IMeterReaderConnector.java index 204bed24af6ae..062e1d689f815 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/IMeterReaderConnector.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/connectors/IMeterReaderConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDevice.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDevice.java index 02bf89344cced..06a1b4e153217 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDevice.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -291,4 +291,4 @@ private Boolean getPrintMeterInfo() { private void setPrintMeterInfo(Boolean printMeterInfo) { this.printMeterInfo = printMeterInfo; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDeviceFactory.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDeviceFactory.java index 6922cbd00b080..502544416bc36 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDeviceFactory.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterDeviceFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValue.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValue.java index ab3f9b9ecd549..054f9fd87717e 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValue.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -126,4 +126,4 @@ public void setStatus(String status) { this.status = status; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValueListener.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValueListener.java index 02074f40dac52..25e1b74087e00 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValueListener.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/MeterValueListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/ObisCode.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/ObisCode.java index c76d77aaece40..1760ede0e58c5 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/ObisCode.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/ObisCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java index 7a03f92ebfc5e..7d33f2b1e8447 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterChannelTypeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,8 +24,6 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.CoreItemFactory; -import org.eclipse.smarthome.core.thing.type.ChannelGroupType; -import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; @@ -51,10 +49,10 @@ public class SmartMeterChannelTypeProvider implements ChannelTypeProvider, Meter private final Logger logger = LoggerFactory.getLogger(SmartMeterChannelTypeProvider.class); - private Map<String, ChannelType> obisChannelMap = new ConcurrentHashMap<>(); + private final Map<String, ChannelType> obisChannelMap = new ConcurrentHashMap<>(); @Override - public @NonNull Collection<@NonNull ChannelType> getChannelTypes(@Nullable Locale locale) { + public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { return obisChannelMap.values(); } @@ -64,17 +62,6 @@ public class SmartMeterChannelTypeProvider implements ChannelTypeProvider, Meter .findFirst().orElse(null); } - @Override - public @Nullable ChannelGroupType getChannelGroupType(ChannelGroupTypeUID channelGroupTypeUID, - @Nullable Locale locale) { - return null; - } - - @Override - public @Nullable Collection<@NonNull ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { - return null; - } - @Override public void errorOccurred(Throwable e) { // Nothing to do if there is an reading error... @@ -118,7 +105,7 @@ private ChannelType getChannelType(Unit<?> unit, String obis) { /** * Gets the {@link ChannelTypeUID} for the given OBIS code. - * + * * @param obis The obis code. * @return The {@link ChannelTypeUID} or null. */ diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterConfigProvider.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterConfigProvider.java index c1954a8afa28e..801fd8277b2f4 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterConfigProvider.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterConfigProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java index 3e9266c1c7316..4d4d6ffb36851 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandlerFactory.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandlerFactory.java index 66cf87d40710b..0b45d24d57f83 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandlerFactory.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/SmartMeterHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/Conformity.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/Conformity.java index b0ba97b931476..028781a2f4c65 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/Conformity.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/Conformity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitModel.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitModel.java index 37fbdfd5d5f3f..cca74c202b055 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitModel.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitParser.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitParser.java index efc2cd49fd666..7912aa91f0d7d 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitParser.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateBitParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateHandler.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateHandler.java index 52820899b51b9..63f16ebf69284 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateHandler.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/conformity/negate/NegateHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/Baudrate.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/Baudrate.java index 27993a0ec982c..a8582ac7d2b93 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/Baudrate.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/Baudrate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/ProtocolMode.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/ProtocolMode.java index dcadfb1a1172c..fbfacd0a3e9a3 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/ProtocolMode.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/ProtocolMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java index 8199ca6470eec..a040a2326568a 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/helper/SerialParameter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21MeterReader.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21MeterReader.java index 79d2c66034c43..f20d0a2c18e4c 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21MeterReader.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21MeterReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21SerialConnector.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21SerialConnector.java index 0eeb06800327f..d7b51814fd1e1 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21SerialConnector.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21SerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21UnitConversion.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21UnitConversion.java index 4f776f5628c1a..a2dfe2df1fe56 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21UnitConversion.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/iec62056/Iec62056_21UnitConversion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlFileDebugOutput.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlFileDebugOutput.java index 99c2948310c8a..4fb8b4ee8135b 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlFileDebugOutput.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlFileDebugOutput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlMeterReader.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlMeterReader.java index 11140a8d715da..5b5b88c8126f4 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlMeterReader.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlMeterReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlSerialConnector.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlSerialConnector.java index dac30b4f95313..53b75e8b7c6bc 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlSerialConnector.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlUnitConversion.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlUnitConversion.java index f7aa6db715672..7901f1c4a4c6b 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlUnitConversion.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlUnitConversion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlValueExtractor.java b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlValueExtractor.java index f0247d6794dee..724ecaeed1764 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlValueExtractor.java +++ b/bundles/org.openhab.binding.smartmeter/src/main/java/org/openhab/binding/smartmeter/internal/sml/SmlValueExtractor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/config/config-descriptions.xml b/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/config/config-descriptions.xml index 8c3848f545ce7..6e9cd4ec52005 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/config/config-descriptions.xml +++ b/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/config/config-descriptions.xml @@ -9,10 +9,10 @@ <parameter name="negate" type="text"> <advanced>true</advanced> - <label>Negate property</label> + <label>Negate Property</label> <description>e.g. 1-0_1-8-0:5:1:status //negate if status(1-0_1-8-0) and 2^5 = 1</description> </parameter> </config-description> -</config-description:config-descriptions> \ No newline at end of file +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/thing/thing-types.xml index c4169a9ea53ce..a7ce031d4ec0f 100644 --- a/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.smartmeter/src/main/resources/ESH-INF/thing/thing-types.xml @@ -24,7 +24,7 @@ </parameter> <parameter name="baudrateChangeDelay" type="integer"> <advanced>true</advanced> - <label>Delay of baudrate change</label> + <label>Delay of Baudrate Change</label> <unitLabel>ms</unitLabel> <default>0</default> <description>USB to serial converters often require a delay of up to 250ms after the ACK before changing baudrate</description> @@ -38,13 +38,13 @@ </parameter> <parameter name="mode" type="text"> <advanced>true</advanced> - <label>The protocol mode to use</label> + <label>The Protocol Mode to Use</label> <default>SML</default> <description>Can be SML (PUSH mode), Mode A,B,C (PULL)or D (PUSH)</description> </parameter> <parameter name="conformity" type="text"> <advanced>true</advanced> - <label>Conform to specific standard semantics</label> + <label>Conform to Specific Standard Semantics</label> <default>NONE</default> <description>Reserved to conform to special semantics specified in specific standards. EDL_FNN: Currently applies the energy direction to WATT channels (which are absolute values) (see fnn lastenheft edl)</description> <limitToOptions>true</limitToOptions> diff --git a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/MockMeterReaderConnector.java b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/MockMeterReaderConnector.java index dac6672c6d9d0..a44a0a6f423ad 100644 --- a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/MockMeterReaderConnector.java +++ b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/MockMeterReaderConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestMeterReading.java b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestMeterReading.java index 44ed057c339b0..f8aff53d8dbf7 100644 --- a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestMeterReading.java +++ b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestMeterReading.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestNegateBit.java b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestNegateBit.java index 9b9066282138f..5e5f6e3ecf2c6 100644 --- a/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestNegateBit.java +++ b/bundles/org.openhab.binding.smartmeter/src/test/java/org/openhab/binding/smartmeter/TestNegateBit.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/NOTICE b/bundles/org.openhab.binding.snmp/NOTICE index 119f6ac8d3e8d..c8d4a26386656 100644 --- a/bundles/org.openhab.binding.snmp/NOTICE +++ b/bundles/org.openhab.binding.snmp/NOTICE @@ -10,7 +10,9 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content SNMP4J: * License: Apache 2.0 License diff --git a/bundles/org.openhab.binding.snmp/pom.xml b/bundles/org.openhab.binding.snmp/pom.xml index 11ce56732c63d..9bd1115560190 100644 --- a/bundles/org.openhab.binding.snmp/pom.xml +++ b/bundles/org.openhab.binding.snmp/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.snmp</artifactId> @@ -18,7 +17,7 @@ <groupId>org.apache.servicemix.bundles</groupId> <artifactId>org.apache.servicemix.bundles.snmp4j</artifactId> <version>2.6.3_1</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.snmp/src/main/feature/feature.xml b/bundles/org.openhab.binding.snmp/src/main/feature/feature.xml index 87b956e0d3415..5690a78254106 100644 --- a/bundles/org.openhab.binding.snmp/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.snmp/src/main/feature/feature.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.snmp-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-snmp" description="SNMP Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j/2.6.3_1</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.snmp/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpBindingConstants.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpBindingConstants.java index 3164edfc75d58..ef8fca51bce9f 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpBindingConstants.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpChannelMode.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpChannelMode.java index 184360c953d1e..91a98fad8847f 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpChannelMode.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpChannelMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpDatatype.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpDatatype.java index 91c877c39dc53..206e3abd0b9ff 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpDatatype.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpDatatype.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpHandlerFactory.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpHandlerFactory.java index 68807f34af058..2e69a5d4e82d6 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpHandlerFactory.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpProtocolVersion.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpProtocolVersion.java index ae5dda85d7e57..0f58cb91e6270 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpProtocolVersion.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpProtocolVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpService.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpService.java index 857985f3f28fb..49774ee920b42 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpService.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java index b5390ac6b2f68..734bab250836c 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpTargetHandler.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpTargetHandler.java index a9d16d0274378..ba3e33dc5e73f 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpTargetHandler.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpTargetHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -51,6 +51,7 @@ import org.snmp4j.CommandResponderEvent; import org.snmp4j.CommunityTarget; import org.snmp4j.PDU; +import org.snmp4j.PDUv1; import org.snmp4j.event.ResponseEvent; import org.snmp4j.event.ResponseListener; import org.snmp4j.mp.SnmpConstants; @@ -96,6 +97,11 @@ public SnmpTargetHandler(Thing thing, SnmpService snmpService) { @Override public void handleCommand(ChannelUID channelUID, Command command) { + if (target.getAddress() == null && !renewTargetAddress()) { + logger.info("failed to renew target address, can't process '{}' to '{}'.", command, channelUID); + return; + } + try { if (command instanceof RefreshType) { SnmpInternalChannelConfiguration channel = readChannelSet.stream() @@ -204,6 +210,16 @@ public void processPdu(@Nullable CommandResponderEvent event) { final String address = ((UdpAddress) event.getPeerAddress()).getInetAddress().getHostAddress(); final String community = new String(event.getSecurityName()); + if ((pdu.getType() == PDU.V1TRAP) && config.community.equals(community) && (pdu instanceof PDUv1)) { + logger.trace("{} received trap is PDUv1.", thing.getUID()); + PDUv1 pduv1 = (PDUv1) pdu; + OID oidEnterprise = pduv1.getEnterprise(); + int trapValue = pduv1.getGenericTrap(); + if (trapValue == PDUv1.ENTERPRISE_SPECIFIC) { + trapValue = pduv1.getSpecificTrap(); + } + updateChannels(oidEnterprise, new UnsignedInteger32(trapValue), trapChannelSet); + } if ((pdu.getType() == PDU.TRAP || pdu.getType() == PDU.V1TRAP) && config.community.equals(community) && targetAddressString.equals(address)) { pdu.getVariableBindings().forEach(variable -> { @@ -419,7 +435,7 @@ private void refresh() { try { snmpService.send(pdu, target, null, this); } catch (IOException e) { - logger.info("Could not send PDU: {}", e); + logger.info("Could not send PDU", e); } } } diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpChannelConfiguration.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpChannelConfiguration.java index 6206dd257862d..02d4179739e1a 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpChannelConfiguration.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpInternalChannelConfiguration.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpInternalChannelConfiguration.java index 0cdcdb1fe27ea..64b0ee041a308 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpInternalChannelConfiguration.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpInternalChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpServiceConfiguration.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpServiceConfiguration.java index 3fe1e17830b7b..e58a7d6c9d9a8 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpServiceConfiguration.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpServiceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpTargetConfiguration.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpTargetConfiguration.java index 8c6cce1f7282d..d0e8d4e4c7e23 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpTargetConfiguration.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/config/SnmpTargetConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.snmp/src/main/resources/ESH-INF/thing/thing-types.xml index 33fc8129529c7..700936dea2ca3 100644 --- a/bundles/org.openhab.binding.snmp/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.snmp/src/main/resources/ESH-INF/thing/thing-types.xml @@ -16,7 +16,7 @@ </parameter> <!-- optional --> <parameter name="protocol" type="text"> - <label>SNMP version</label> + <label>SNMP Version</label> <options> <option value="v1">V1</option> <option value="v2c">V2c</option> diff --git a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/AbstractSnmpTargetHandlerTest.java b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/AbstractSnmpTargetHandlerTest.java index 01b367832cf74..31700b5d30977 100644 --- a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/AbstractSnmpTargetHandlerTest.java +++ b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/AbstractSnmpTargetHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SnmpTargetHandlerTest.java b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SnmpTargetHandlerTest.java index 171e11493e1a8..1b7ca484bcef6 100644 --- a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SnmpTargetHandlerTest.java +++ b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SnmpTargetHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/StringChannelTest.java b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/StringChannelTest.java index 1599f78fb9113..d70d722a1eaaf 100644 --- a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/StringChannelTest.java +++ b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/StringChannelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SwitchChannelTest.java b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SwitchChannelTest.java index f6c74d07b9040..8bd0fcdb287e7 100644 --- a/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SwitchChannelTest.java +++ b/bundles/org.openhab.binding.snmp/src/test/java/org/openhab/binding/snmp/internal/SwitchChannelTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/NOTICE b/bundles/org.openhab.binding.solaredge/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.solaredge/NOTICE +++ b/bundles/org.openhab.binding.solaredge/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.solaredge/README.md b/bundles/org.openhab.binding.solaredge/README.md index 72c938397f76e..84c46ea8d5135 100644 --- a/bundles/org.openhab.binding.solaredge/README.md +++ b/bundles/org.openhab.binding.solaredge/README.md @@ -15,7 +15,7 @@ While on the one hand the S0 meter is the cheaper solution the solaredge meter o For more details please see here: - [SolarEdge meter](https://www.solaredge.com/products/pv-monitoring/accessories/css-wattnode-modbus-meter) - [Avoiding Feed-In limitations with consumption meters](https://www.solaredge.com/solutions/feed-in-limitation-and-metering-solution#) -- [Detailed description of meter setup](http://solaredge.com/sites/default/files/feed-in_limitation_application_note.pdf) +- [Detailed description of meter setup](https://solaredge.com/sites/default/files/feed-in_limitation_application_note.pdf) ## Discovery diff --git a/bundles/org.openhab.binding.solaredge/pom.xml b/bundles/org.openhab.binding.solaredge/pom.xml index 44fe6a5009860..f6af5f3b10771 100644 --- a/bundles/org.openhab.binding.solaredge/pom.xml +++ b/bundles/org.openhab.binding.solaredge/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.solaredge</artifactId> diff --git a/bundles/org.openhab.binding.solaredge/src/main/feature/feature.xml b/bundles/org.openhab.binding.solaredge/src/main/feature/feature.xml index 92cb9b2c7f90d..4c6d3cb185f4e 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.solaredge/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.solaredge-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-solaredge" description="SolarEdge Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/AtomicReferenceTrait.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/AtomicReferenceTrait.java index 1ab93f85ccba6..2c3bd19467bc2 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/AtomicReferenceTrait.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/AtomicReferenceTrait.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeBindingConstants.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeBindingConstants.java index 5900a3bf49ce1..a62480345b3bc 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeBindingConstants.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeHandlerFactory.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeHandlerFactory.java index c1b950ef7814d..7caba2c09da7a 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeHandlerFactory.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/SolarEdgeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/callback/AbstractCommandCallback.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/callback/AbstractCommandCallback.java index 6ea280ba4adb7..6d3a3daf29c7f 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/callback/AbstractCommandCallback.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/callback/AbstractCommandCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePrivateApi.java index dd372bbef5a4d..17a9c6ea4b14d 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePublicApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePublicApi.java index a97a22cde2f9f..a363f9a99ec05 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePublicApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/AggregateDataUpdatePublicApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdateMeterless.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdateMeterless.java index df41abd4e109c..b05e41fd19738 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdateMeterless.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdateMeterless.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePrivateApi.java index c955d5841ab43..243e79bd87335 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePublicApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePublicApi.java index c4e23afda1a9c..9b9dd8c162bd9 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePublicApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/LiveDataUpdatePublicApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PrivateApiTokenCheck.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PrivateApiTokenCheck.java index ff0d935b4f116..9ffac97af9a57 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PrivateApiTokenCheck.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PrivateApiTokenCheck.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PublicApiKeyCheck.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PublicApiKeyCheck.java index 174c84cd0b1c6..6f6b3bdd2842f 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PublicApiKeyCheck.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/PublicApiKeyCheck.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/SolarEdgeCommand.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/SolarEdgeCommand.java index 8180c1c4d9411..6ae77674c5f4f 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/SolarEdgeCommand.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/command/SolarEdgeCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/config/SolarEdgeConfiguration.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/config/SolarEdgeConfiguration.java index d2a9351db5f5b..93208412f678d 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/config/SolarEdgeConfiguration.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/config/SolarEdgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/CommunicationStatus.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/CommunicationStatus.java index ecfce5b028c31..0cc52830e6f24 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/CommunicationStatus.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/CommunicationStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/StatusUpdateListener.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/StatusUpdateListener.java index 1a4cd068ed038..4cc7a7f1d6079 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/StatusUpdateListener.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/StatusUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/WebInterface.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/WebInterface.java index 156b92bdffa10..aab3d705aef73 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/WebInterface.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/connector/WebInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/GenericSolarEdgeHandler.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/GenericSolarEdgeHandler.java index d2c9a9dd959d3..e1ece3a7b9afb 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/GenericSolarEdgeHandler.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/GenericSolarEdgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeAggregateDataPolling.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeAggregateDataPolling.java index af39f3736e199..0cb0bccc534b1 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeAggregateDataPolling.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeAggregateDataPolling.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeBaseHandler.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeBaseHandler.java index b414d74d8ba09..864b58f51026a 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeBaseHandler.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeBaseHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeHandler.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeHandler.java index 64ee2b6dd3b4f..8e2d2d86e9699 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeHandler.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeLiveDataPolling.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeLiveDataPolling.java index 23f9fd4d335e4..44d9d612a896e 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeLiveDataPolling.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/handler/SolarEdgeLiveDataPolling.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AbstractAggregateDataResponsePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AbstractAggregateDataResponsePrivateApi.java index a3f4187a8f590..e293913359320 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AbstractAggregateDataResponsePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AbstractAggregateDataResponsePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataChannels.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataChannels.java index 7238a93f616c5..1f68fe19c6d11 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataChannels.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataResponsePublicApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataResponsePublicApi.java index df6de952373db..535250d789102 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataResponsePublicApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDataResponsePublicApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDayDataResponsePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDayDataResponsePrivateApi.java index b3d2cf3c90649..5df87b276d716 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDayDataResponsePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateDayDataResponsePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateMonthDataResponsePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateMonthDataResponsePrivateApi.java index 03bed59b5fa22..d985cfa4c4ee2 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateMonthDataResponsePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateMonthDataResponsePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregatePeriod.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregatePeriod.java index e78ead04e2084..0eccaece1c25f 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregatePeriod.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregatePeriod.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateWeekDataResponsePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateWeekDataResponsePrivateApi.java index 467de2ae138d7..0f88e73ecff23 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateWeekDataResponsePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateWeekDataResponsePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateYearDataResponsePrivateApi.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateYearDataResponsePrivateApi.java index 36f246ec1d37b..4c2419737e244 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateYearDataResponsePrivateApi.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/AggregateYearDataResponsePrivateApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/Channel.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/Channel.java index 3ac7948a5e6ce..078779ff3203b 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/Channel.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/Channel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelGroup.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelGroup.java index 48109cdd76cea..a249646a41a90 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelGroup.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelType.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelType.java index 44efbf52985ee..927d8ff4e71aa 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelType.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/ChannelType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/DataResponse.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/DataResponse.java index 7c94195687511..e833a21811c3e 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/DataResponse.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/DataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataChannels.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataChannels.java index 3f86b5ee2f9e4..c3aa9b89ea800 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataChannels.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataChannels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponse.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponse.java index 0b037633d5b1b..3cd71d537da27 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponse.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponseMeterless.java b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponseMeterless.java index 3a6863c8985bc..70095aeee2aae 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponseMeterless.java +++ b/bundles/org.openhab.binding.solaredge/src/main/java/org/openhab/binding/solaredge/internal/model/LiveDataResponseMeterless.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/config/config.xml index b302bd45296cf..1b845eda93ee2 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/config/config.xml @@ -48,4 +48,4 @@ <default>60</default> </parameter> </config-description> -</config-description:config-descriptions> \ No newline at end of file +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/thing/generic-channel-groups.xml b/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/thing/generic-channel-groups.xml index 66953a7ffcbff..05ffed28ccc3a 100644 --- a/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/thing/generic-channel-groups.xml +++ b/bundles/org.openhab.binding.solaredge/src/main/resources/ESH-INF/thing/generic-channel-groups.xml @@ -3,7 +3,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-group-type id="genericweb-live"> - <label>Live data</label> + <label>Live Data</label> <channels> <channel id="production" typeId="live-type-production" /> <channel id="pv_status" typeId="live-type-pv_status" /> @@ -22,7 +22,7 @@ </channel-group-type> <channel-group-type id="genericweb-aggregate-day"> - <label>Aggregate day data</label> + <label>Aggregate Day Data</label> <description>Aggregate data (by day)</description> <channels> <channel id="production" typeId="aggregate-type-production" /> @@ -36,7 +36,7 @@ </channel-group-type> <channel-group-type id="genericweb-aggregate-week"> - <label>Aggregate week data</label> + <label>Aggregate Week Data</label> <description>Aggregate data (by week)</description> <channels> <channel id="production" typeId="aggregate-type-production" /> @@ -50,7 +50,7 @@ </channel-group-type> <channel-group-type id="genericweb-aggregate-month"> - <label>Aggregate month data</label> + <label>Aggregate Month Data</label> <description>Aggregate data (by month)</description> <channels> <channel id="production" typeId="aggregate-type-production" /> @@ -64,7 +64,7 @@ </channel-group-type> <channel-group-type id="genericweb-aggregate-year"> - <label>Aggregate year data</label> + <label>Aggregate Year Data</label> <description>Aggregate data (by year)</description> <channels> <channel id="production" typeId="aggregate-type-production" /> diff --git a/bundles/org.openhab.binding.solarlog/NOTICE b/bundles/org.openhab.binding.solarlog/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.solarlog/NOTICE +++ b/bundles/org.openhab.binding.solarlog/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.solarlog/README.md b/bundles/org.openhab.binding.solarlog/README.md index c8484b703d18c..8175dd3b4be27 100644 --- a/bundles/org.openhab.binding.solarlog/README.md +++ b/bundles/org.openhab.binding.solarlog/README.md @@ -1,6 +1,6 @@ # Solar-Log Binding -The [Solar-Log Family](http://www.solar-log.com/en/home.html) of monitoring devices for PV installations provide a MODBUS (TCP) and JSON-based API to access a number of internal data related to power generation and consumption. This binding implements access to the data via the JSON API. +The [Solar-Log Family](https://www.solar-log.com/en/) of monitoring devices for PV installations provide a MODBUS (TCP) and JSON-based API to access a number of internal data related to power generation and consumption. This binding implements access to the data via the JSON API. ## Use of the binding diff --git a/bundles/org.openhab.binding.solarlog/pom.xml b/bundles/org.openhab.binding.solarlog/pom.xml index 8d8b43ddb3d5e..72113cf2fe843 100644 --- a/bundles/org.openhab.binding.solarlog/pom.xml +++ b/bundles/org.openhab.binding.solarlog/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.solarlog</artifactId> diff --git a/bundles/org.openhab.binding.solarlog/src/main/feature/feature.xml b/bundles/org.openhab.binding.solarlog/src/main/feature/feature.xml index 7ecab311d954e..5d6c31c5aa63f 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.solarlog/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.solarlog-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-solarlog" description="SolarLog Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogBindingConstants.java b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogBindingConstants.java index 6008d0fc75bfd..43c6acd74bf0a 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogBindingConstants.java +++ b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogChannel.java b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogChannel.java index eac48207915b3..567d62e75ad9f 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogChannel.java +++ b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogConfig.java b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogConfig.java index 193667930ba6b..01405ab5437f9 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogConfig.java +++ b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogHandlerFactory.java b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogHandlerFactory.java index 190ce0f723f14..724368e7cb47c 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogHandlerFactory.java +++ b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/SolarLogHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/handler/SolarLogHandler.java b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/handler/SolarLogHandler.java index ee6c084498329..e754f39c31a3a 100644 --- a/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/handler/SolarLogHandler.java +++ b/bundles/org.openhab.binding.solarlog/src/main/java/org/openhab/binding/solarlog/internal/handler/SolarLogHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,7 +80,7 @@ public void initialize() { updateStatus(ThingStatus.ONLINE); // Very rudimentary Exception differentiation } catch (IOException e) { - logger.debug("Error reading response from Solar-Log: {}", e); + logger.debug("Error reading response from Solar-Log", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Communication error with the device. Please retry later."); } catch (JsonSyntaxException je) { @@ -148,7 +148,7 @@ private State getState(String value, SolarLogChannel type) { return new StringType(value); } } catch (IllegalArgumentException e) { - logger.warn("Parsing date failed: {}. Returning nothing", e); + logger.warn("Parsing date failed. Returning nothing", e); return UnDefType.UNDEF; } // All other channels should be numbers @@ -158,7 +158,7 @@ private State getState(String value, SolarLogChannel type) { return new DecimalType(new BigDecimal(value)); } catch (NumberFormatException e) { // Log a warning and return UNDEF - logger.warn("Parsing number failed: {}. Returning nothing", e); + logger.warn("Parsing number failed. Returning nothing", e); return UnDefType.UNDEF; } } diff --git a/bundles/org.openhab.binding.somfytahoma/NOTICE b/bundles/org.openhab.binding.somfytahoma/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.somfytahoma/NOTICE +++ b/bundles/org.openhab.binding.somfytahoma/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.somfytahoma/README.md b/bundles/org.openhab.binding.somfytahoma/README.md index feae2033015f2..df7f69bd15b28 100644 --- a/bundles/org.openhab.binding.somfytahoma/README.md +++ b/bundles/org.openhab.binding.somfytahoma/README.md @@ -24,13 +24,16 @@ home automation systems. - light switches (similar to on/off) - light sensors (luminance value) - occupancy sensors (OPEN/CLOSE contact) -- smoke sensors (OPEN/CLOSE contact) +- smoke sensors (OPEN/CLOSE contact, alarm check) - contact sensors (OPEN/CLOSE contact) -- temperature sensor (get temperature) +- temperature sensors (get temperature) +- electricity sensors (get energy consumption) - door locks (LOCK/UNLOCK, OPEN/CLOSE commands) - heating systems (control temperature, set heating level) - alarms (both interior/external) - pods +- docks (battery info, siren control) +- sirens (battery status full/low/normal/verylow, siren control ON/OFF, setting memorized volume) - action groups (scenarios which can execute predefined Tahoma group of steps, e.g. send to all roller shutters DOWN command, one by one) Both Somfy Tahoma and Somfy Connexoon gateways have been confirmed working. @@ -56,37 +59,50 @@ Please see the example below. ## Channels -| Thing | Channel | Note | -| ------------- |:-------------:| -----:| -| bridge | N.A | bridge does not expose any channel | -| gateway | status | status of your Tahoma gateway | -| gate | gate_command | used for controlling your gate (open, close, stop, pedestrian) | -| gate | gate_state | get state of your gate | -| roller shutter, screen, venetian blind, garage door, awning, window, pergola | control | device controller which reacts to commands UP/DOWN/STOP + closure 0-100 | -| venetian blind | orientation | percentual orientation of the blind's slats, it can have value 0-100). For IO Homecontrol devices only (non RTS)| -| action group | execute_action | switch which reacts to ON command and triggers the predefined Tahoma action | -| onoff, light | switch | reacts to standard ON/OFF commands | -| smoke sensor, occupancy sensor & contact sensor | contact | normal value is CLOSE, changes to OPEN when detection triggered | -| light sensor | luminance | light luminance value in luxes | -| pod | cyclic_button_state | pod cyclic button state | -| pod | battery_status_state | pod battery status state | -| pod | lighting_led_pod_mod_state | lighting led pod mod state | -| interior alarm | alarm_command | used for sending commands to Somfy alarm device | -| interior alarm | intrusion_control | used for alarm external intrusion controlling | -| interior alarm | alarm_state | state of the Somfy alarm | -| interior alarm | target_alarm_state | target state of the Somfy alarm | -| interior alarm | intrusion_state | intrusion state of the Somfy alarm | -| external alarm | active_zones_state | state of external alarm active zones | -| door lock | lock | switch representing unlocked/locked state | -| door lock | open | switch representing open/close state | -| on/off heating system | target_heating_level | target heating level (off, eco, comfort, frostprotection) | -| heating system | current_temperature | current temperature of the heating system | -| heating system | current_state | current state of the heating system| -| heating system | target_temperature | target temperature of the heating system | -| heating system | battery_level | battery level of the heating system | -| temperature sensor | temperature | temperature reported by the sensor | - -When roller shutter-like thing receives STOP command two possible behaviours are possible +| Thing | Channel | Note | +|-------------------------------------------------------------------------------|:---------------------:|------------------------------------------------------------------------------------------------------------------| +| bridge | N.A | bridge does not expose any channel | +| gateway | status | status of your Tahoma gateway | +| gate | gate_command | used for controlling your gate (open, close, stop, pedestrian) | +| gate | gate_state | get state of your gate | +| roller shutter, screen, venetian blind, garage door, awning, pergola, curtain | control | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/MY/STOP + closure 0-100 | +| window | control | device controller which reacts to commands UP/DOWN/ON/OFF/OPEN/CLOSE/STOP + closure 0-100 | +| venetian blind, adjustable slats roller shutter | orientation | percentual orientation of the blind's slats, it can have value 0-100). For IO Homecontrol devices only (non RTS) | +| adjustable slats roller shutter | rocker | used for setting the rocker position of the roller shutter, the only position allowing the slats control | +| action group | execute_action | switch which reacts to ON command and triggers the predefined Tahoma action | +| onoff, light | switch | reacts to standard ON/OFF commands | +| smoke sensor, occupancy sensor & contact sensor | contact | normal value is CLOSE, changes to OPEN when detection triggered | +| smoke sensor | short_check | triggering the smoke sensor's short check | +| smoke sensor | long_check | triggering the smoke sensor's long check | +| light sensor | luminance | light luminance value in luxes | +| electricity sensor | energy_consumption | energy consumption value in watts | +| dock | battery_status | indicates running on battery (yes/no) | +| dock | battery_level | remaining battery percentage | +| dock | siren_status | used for controlling and getting siren state (on, off, cyclic) | +| dock | short_beep | testing of dock's siren - short beep | +| dock | long_beep | testing of dock's siren - long beep | +| siren | battery | battery level full/low/normal/verylow | +| siren | onoff | controlling siren status ON/OFF | +| siren | memorized_volume | setting memorized volume (normal/highest) | +| pod | cyclic_button | pod cyclic button state | +| pod | battery_status | pod battery status state | +| pod | lighting_led_pod_mode | lighting LED pod mod state | +| interior alarm | alarm_command | used for sending commands to Somfy alarm device | +| interior alarm | intrusion_control | used for alarm external intrusion controlling | +| interior alarm | alarm_state | state of the Somfy alarm | +| interior alarm | target_alarm_state | target state of the Somfy alarm | +| interior alarm | intrusion_state | intrusion state of the Somfy alarm | +| external alarm | active_zones_state | state of external alarm active zones | +| door lock | lock | switch representing unlocked/locked state | +| door lock | open | switch representing open/close state | +| on/off heating system | target_heating_level | target heating level (off, eco, comfort, frostprotection) | +| heating system | current_temperature | current temperature of the heating system | +| heating system | current_state | current state of the heating system | +| heating system | target_temperature | target temperature of the heating system | +| heating system | battery_level | battery level of the heating system | +| temperature sensor | temperature | temperature reported by the sensor | + +When a roller shutter-like thing receives STOP command, there are two possible behaviours - when the roller shutter is idle then MY command is interpreted (the roller shutter/exterior screen/awning goes to your favourite position) - when the roller shutter is moving then STOP command is interpreted (the roller shutter/exterior screen/awning stops) @@ -111,6 +127,9 @@ Bridge somfytahoma:bridge:237dbae7 "Somfy Tahoma Bridge" [ email="my@email.com", Thing lightsensor 2c90808c3a0c193f013a743f2f660f12 "Light sensor" [ url="io://0204-4519-8041/13527450" ] Thing occupancysensor 995e16ca-07c4-4111-9cda-504cb5120f82 "Occupancy sensor" [ url="io://0204-4519-8041/4855758" ] Thing smokesensor 9438e6ff-c17e-40d7-a4b4-3e797eca5bf7 "Smoke sensor" [ url="io://0204-4510-8041/13402124" ] + Thing electricitysensor 9998e6ff-c17e-40d7-a4b4-3e797eca5bf7 "Electricity sensor" [ url="io://0204-4510-8041/288702124" ] + Thing dock 1212f2e3-bcde-21dd-b3a6-13ef7abcd134 "Dock" [ url="io://0204-4510-8041/244402124" ] + Thing siren 1212f2e3-aeae-21dd-b3a6-13ef7abcd134 "Siren" [ url="io://0204-4510-8041/244405678" ] } ``` @@ -139,6 +158,7 @@ Switch TahomaZwaveSwitch "Switch" { channel="somfytahoma:onoff:237dbae7:095d6c49 Switch TahomaLightSwitch "Light Switch" { channel="somfytahoma:light:237dbae7:1b8e7d29-bf1e-4ae1-9432-3dfef52ef14d:switch" } Number LightSensor "Light Sensor [%.1f lux]" { channel="somfytahoma:lightsensor:237dbae7:2c90808c3a0c193f013a743f2f660f12:luminance" } +Number:Energy EnergyConsumptionSensor "Energy Consumption [%.1f W]" { channel="somfytahoma:electricitysensor:237dbae7:9998e6ff-c17e-40d7-a4b4-3e797eca5bf7:energy_consumption" } Contact OccupancySensor "Occupancy Sensor is [%s]" { channel="somfytahoma:occupancysensor:237dbae7:995e16ca-07c4-4111-9cda-504cb5120f82:contact" } Contact SmokeSensor "Smoke Sensor is [%s]" { channel="somfytahoma:smokesensor:237dbae7:9438e6ff-c17e-40d7-a4b4-3e797eca5bf7:contact" } @@ -150,6 +170,15 @@ String HeatingSystemLevel "Heating level [%s]" { channel="somfytahoma:onoffheati Switch DoorLock "Lock" { channel="somfytahoma:doorlock:237dbae7:6612f2e3-bcde-21dd-b3a6-13ef7abcd134:lock" } Switch DoorLockOpenClose "Open/Close" { channel="somfytahoma:doorlock:237dbae7:6612f2e3-bcde-21dd-b3a6-13ef7abcd134:open" } +String DockBatteryStatus "Dock battery status [%s]" { somfytahoma:dock:237dbae7:1212f2e3-bcde-21dd-b3a6-13ef7abcd134:battery_status } +String DockBatteryLevel "Dock battery level [%s]" { somfytahoma:dock:237dbae7:1212f2e3-bcde-21dd-b3a6-13ef7abcd134:battery_level } +String DockSiren "Dock siren [%s]" { somfytahoma:dock:237dbae7:1212f2e3-bcde-21dd-b3a6-13ef7abcd134:siren } +Switch DockShortBeep "Dock short beep" { somfytahoma:dock:237dbae7:1212f2e3-bcde-21dd-b3a6-13ef7abcd134:short_beep } +Switch DockLongBeep "Dock long beep" { somfytahoma:dock:237dbae7:1212f2e3-bcde-21dd-b3a6-13ef7abcd134:long_beep } + +String SirenBattery "Siren battery [%s]" { somfytahoma:siren:237dbae7:1212f2e3-aeae-21dd-b3a6-13ef7abcd134:battery } +Switch SirenSwitch "Siren switch" { somfytahoma:siren:237dbae7:1212f2e3-aeae-21dd-b3a6-13ef7abcd134:onoff } +String SirenVolume "Siren volume [%s]" { somfytahoma:siren:237dbae7:1212f2e3-aeae-21dd-b3a6-13ef7abcd134:memorized_volume } ``` .sitemap file @@ -171,10 +200,19 @@ Text item=OccupancySensor Text item=SmokeSensor Text item=ContactSensor Text item=TemperatureSensor +Text item=ElectricitySensor Switch item=HeatingSystemOnOff Selection item=HeatingSystemLevel mappings=["frostprotection"="FROST PROTECTION", "comfort"="COMFORT", "eco"="ECO", "off"="OFF"] Switch item=DoorLock Switch item=DoorLockOpenClose +Text item=DockBatteryStatus +Text item=DockBatteryLevel +Selection item=DockSiren mappings=["off"="OFF", "on"="ON", "cyclic"="CYCLIC"] +Switch item=DockShortBeep +Switch item=DockLongBeep +String item=SirenBattery +Switch item=SirenSwitch +Selection item=SirenVolume mappings=["normal"="NORMAL", "highest"="HIGHEST"] ``` ## Alexa compatibility diff --git a/bundles/org.openhab.binding.somfytahoma/pom.xml b/bundles/org.openhab.binding.somfytahoma/pom.xml index f4f9d726b0e5e..cfc858add46ca 100644 --- a/bundles/org.openhab.binding.somfytahoma/pom.xml +++ b/bundles/org.openhab.binding.somfytahoma/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.somfytahoma</artifactId> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/feature/feature.xml b/bundles/org.openhab.binding.somfytahoma/src/main/feature/feature.xml index db03948e7c9bd..9ccee3c5534bb 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.somfytahoma-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-somfytahoma" description="Somfy Tahoma Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java index 7c945f6e4725b..15dd0f050bfb2 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,8 @@ */ package org.openhab.binding.somfytahoma.internal; +import java.util.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ThingTypeUID; @@ -109,13 +111,31 @@ public class SomfyTahomaBindingConstants { // Gate public static final ThingTypeUID THING_TYPE_GATE = new ThingTypeUID(BINDING_ID, "gate"); + // Curtains + public static final ThingTypeUID THING_TYPE_CURTAIN = new ThingTypeUID(BINDING_ID, "curtain"); + + // Electricity sensor + public static final ThingTypeUID THING_TYPE_ELECTRICITYSENSOR = new ThingTypeUID(BINDING_ID, "electricitysensor"); + + // Dock + public static final ThingTypeUID THING_TYPE_DOCK = new ThingTypeUID(BINDING_ID, "dock"); + + // Siren + public static final ThingTypeUID THING_TYPE_SIREN = new ThingTypeUID(BINDING_ID, "siren"); + + // Adjustable slats roller shutter + public static final ThingTypeUID THING_TYPE_ADJUSTABLE_SLATS_ROLLERSHUTTER = new ThingTypeUID(BINDING_ID, "adjustableslatsrollershutter"); + // List of all Channel ids // Gateway public static final String STATUS = "status"; - // Roller shutter, Awning, Screen, Blind, Garage door, Window + // Roller shutter, Awning, Screen, Blind, Garage door, Window, Curtain public static final String CONTROL = "control"; + // Adjustable slats roller shutter + public static final String ROCKER = "rocker"; + // Silent roller shutter public static final String CONTROL_SILENT = "control_silent"; @@ -135,6 +155,9 @@ public class SomfyTahomaBindingConstants { // Smoke sensor, Occupancy sensor, Contact sensor public static final String CONTACT = "contact"; + // Smoke sensor + public static final String ALARM_CHECK = "alarm_check"; + // Light sensor public static final String LUMINANCE = "luminance"; @@ -148,6 +171,10 @@ public class SomfyTahomaBindingConstants { public static final String INTRUSION_CONTROL = "intrusion_control"; public static final String INTRUSION_STATE = "intrusion_state"; + // Pod + public static final String CYCLIC_BUTTON = "cyclic_button"; + public static final String LIGHTING_LED_POD_MODE = "lighting_led_pod_mode"; + // Heating system public static final String TARGET_TEMPERATURE = "target_temperature"; public static final String CURRENT_TEMPERATURE = "current_temperature"; @@ -162,13 +189,26 @@ public class SomfyTahomaBindingConstants { public static final String GATE_STATE = "gate_state"; public static final String GATE_COMMAND = "gate_command"; + // ElectricitySensor + public static final String ENERGY_CONSUMPTION = "energy_consumption"; + + // Dock + public static final String BATTERY_STATUS = "battery_status"; + public static final String SIREN_STATUS = "siren_status"; + public static final String SHORT_BIP = "short_beep"; + public static final String LONG_BIP = "long_beep"; + + // Siren + public static final String MEMORIZED_VOLUME = "memorized_volume"; + public static final String ONOFF_STATE = "onoff"; + public static final String BATTERY = "battery"; + //Constants - private static final String API_URL = "https://www.tahomalink.com/enduser-mobile-web/"; - public static final String TAHOMA_URL = API_URL + "externalAPI/json/"; - public static final String TAHOMA_EVENT_URL = API_URL + "enduserAPI/events/"; - public static final String SETUP_URL = API_URL + "enduserAPI/setup/gateways/"; - public static final String REFRESH_URL = API_URL + "enduserAPI/setup/devices/states/refresh"; - public static final String EXEC_URL = API_URL + "enduserAPI/exec/"; + public static final String TAHOMA_API_URL = "https://www.tahomalink.com/enduser-mobile-web/enduserAPI/"; + public static final String TAHOMA_EVENTS_URL = TAHOMA_API_URL + "events/"; + public static final String SETUP_URL = TAHOMA_API_URL + "setup/gateways/"; + public static final String REFRESH_URL = TAHOMA_API_URL + "setup/devices/states/refresh"; + public static final String EXEC_URL = TAHOMA_API_URL + "exec/"; public static final String DELETE_URL = EXEC_URL + "current/setup/"; public static final String TAHOMA_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"; public static final int TAHOMA_TIMEOUT = 5; @@ -176,6 +216,7 @@ public class SomfyTahomaBindingConstants { public static final int TYPE_PERCENT = 1; public static final int TYPE_DECIMAL = 2; public static final int TYPE_STRING = 3; + public static final int TYPE_BOOLEAN = 6; public static final String COMMAND_MY = "my"; public static final String COMMAND_SET_CLOSURE = "setClosure"; public static final String COMMAND_SET_DEPLOYMENT = "setDeployment"; @@ -183,48 +224,108 @@ public class SomfyTahomaBindingConstants { public static final String COMMAND_SET_CLOSURESPEED = "setClosureAndLinearSpeed"; public static final String COMMAND_SET_HEATINGLEVEL = "setHeatingLevel"; public static final String COMMAND_SET_PEDESTRIANPOSITION = "setPedestrianPosition"; - public static final String COMMAND_REFRESH_HEATINGLEVEL = "refreshHeatingLevel"; + public static final String COMMAND_SET_ROCKERPOSITION = "setRockerPosition"; public static final String COMMAND_UP = "up"; public static final String COMMAND_DOWN = "down"; public static final String COMMAND_OPEN = "open"; public static final String COMMAND_CLOSE = "close"; public static final String COMMAND_STOP = "stop"; public static final String COMMAND_OFF = "off"; + public static final String COMMAND_CHECK_TRIGGER = "checkEventTrigger"; public static final String STATUS_STATE = "core:StatusState"; + public static final String ENERGY_CONSUMPTION_STATE = "core:ElectricEnergyConsumptionState"; + public static final String CYCLIC_BUTTON_STATE = "core:CyclicButtonState"; + public static final String BATTERY_STATUS_STATE = "internal:BatteryStatusState"; public static final String UNAVAILABLE = "unavailable"; public static final String AUTHENTICATION_CHALLENGE = "HTTP protocol violation: Authentication challenge without WWW-Authenticate header"; public static final String TOO_MANY_REQUESTS = "Too many requests, try again later"; public static final int SUSPEND_TIME = 120; // supported uiClasses - public static final String ROLLERSHUTTER = "RollerShutter"; - public static final String SCREEN = "Screen"; - public static final String VENETIANBLIND = "VenetianBlind"; - public static final String EXTERIORSCREEN = "ExteriorScreen"; - public static final String EXTERIORVENETIANBLIND = "ExteriorVenetianBlind"; - public static final String GARAGEDOOR = "GarageDoor"; - public static final String AWNING = "Awning"; - public static final String ONOFF = "OnOff"; - public static final String LIGHT = "Light"; - public static final String LIGHTSENSOR = "LightSensor"; - public static final String SMOKESENSOR = "SmokeSensor"; - public static final String CONTACTSENSOR = "ContactSensor"; - public static final String OCCUPANCYSENSOR = "OccupancySensor"; - public static final String WINDOW = "Window"; - public static final String ALARM = "Alarm"; - public static final String POD = "Pod"; - public static final String HEATINGSYSTEM = "HeatingSystem"; - public static final String DOORLOCK = "DoorLock"; - public static final String PERGOLA = "Pergola"; - public static final String WINDOWHANDLE = "WindowHandle"; - public static final String TEMPERATURESENSOR = "TemperatureSensor"; - public static final String GATE = "Gate"; + public static final String THING_ROLLER_SHUTTER = "RollerShutter"; + public static final String THING_SCREEN = "Screen"; + public static final String THING_VENETIAN_BLIND = "VenetianBlind"; + public static final String THING_EXTERIOR_SCREEN = "ExteriorScreen"; + public static final String THING_EXTERIOR_VENETIAN_BLIND = "ExteriorVenetianBlind"; + public static final String THING_GARAGE_DOOR = "GarageDoor"; + public static final String THING_AWNING = "Awning"; + public static final String THING_ON_OFF = "OnOff"; + public static final String THING_LIGHT = "Light"; + public static final String THING_LIGHT_SENSOR = "LightSensor"; + public static final String THING_SMOKE_SENSOR = "SmokeSensor"; + public static final String THING_CONTACT_SENSOR = "ContactSensor"; + public static final String THING_OCCUPANCY_SENSOR = "OccupancySensor"; + public static final String THING_WINDOW = "Window"; + public static final String THING_ALARM = "Alarm"; + public static final String THING_POD = "Pod"; + public static final String THING_HEATING_SYSTEM = "HeatingSystem"; + public static final String THING_DOOR_LOCK = "DoorLock"; + public static final String THING_PERGOLA = "Pergola"; + public static final String THING_WINDOW_HANDLE = "WindowHandle"; + public static final String THING_TEMPERATURE_SENSOR = "TemperatureSensor"; + public static final String THING_GATE = "Gate"; + public static final String THING_CURTAIN = "Curtain"; + public static final String THING_ELECTRICITY_SENSOR = "ElectricitySensor"; + public static final String THING_DOCK = "Dock"; + public static final String THING_SIREN = "Siren"; + public static final String THING_ADJUSTABLE_SLATS_ROLLER_SHUTTER = "AdjustableSlatsRollerShutter"; // unsupported uiClasses - public static final String PROTOCOLGATEWAY = "ProtocolGateway"; - public static final String REMOTECONTROLLER = "RemoteController"; - public static final String NETWORKCOMPONENT = "NetworkComponent"; + public static final String THING_PROTOCOL_GATEWAY = "ProtocolGateway"; + public static final String THING_REMOTE_CONTROLLER = "RemoteController"; + public static final String THING_NETWORK_COMPONENT = "NetworkComponent"; // cache timeout public static final int CACHE_EXPIRY = 10000; + + // supported thing types for discovery + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(Arrays.asList( + THING_TYPE_GATEWAY, THING_TYPE_ROLLERSHUTTER, THING_TYPE_ROLLERSHUTTER_SILENT, THING_TYPE_SCREEN, + THING_TYPE_VENETIANBLIND, THING_TYPE_EXTERIORSCREEN, THING_TYPE_EXTERIORVENETIANBLIND, + THING_TYPE_GARAGEDOOR, THING_TYPE_AWNING, THING_TYPE_ACTIONGROUP, THING_TYPE_ONOFF, THING_TYPE_LIGHT, + THING_TYPE_LIGHTSENSOR, THING_TYPE_SMOKESENSOR, THING_TYPE_CONTACTSENSOR, THING_TYPE_OCCUPANCYSENSOR, + THING_TYPE_WINDOW, THING_TYPE_INTERNAL_ALARM, THING_TYPE_EXTERNAL_ALARM, THING_TYPE_POD, + THING_TYPE_HEATING_SYSTEM, THING_TYPE_ONOFF_HEATING_SYSTEM, THING_TYPE_DOOR_LOCK, THING_TYPE_PERGOLA, + THING_TYPE_WINDOW_HANDLE, THING_TYPE_TEMPERATURESENSOR, THING_TYPE_GATE, THING_TYPE_CURTAIN, + THING_TYPE_ELECTRICITYSENSOR, THING_TYPE_DOCK, THING_TYPE_SIREN, THING_TYPE_ADJUSTABLE_SLATS_ROLLERSHUTTER)); + + //somfy gateways + public static Map<Integer, String> gatewayTypes = new HashMap<Integer, String>() { + { + put(0, "VIRTUAL_KIZBOX"); + put(2, "KIZBOX_V1"); + put(15, "TAHOMA"); + put(20, "VERISURE_ALARM_SYSTEM"); + put(21, "KIZBOX_MINI"); + put(24, "KIZBOX_V2"); + put(25, "MYFOX_ALARM_SYSTEM"); + put(27, "KIZBOX_MINI_VMBUS"); + put(28, "KIZBOX_MINI_IO"); + put(29, "TAHOMA_V2"); + put(30, "KIZBOX_V2_3H"); + put(31, "KIZBOX_V2_2H"); + put(34, "CONNEXOON"); + put(35, "JSW_CAMERA"); + put(37, "KIZBOX_MINI_DAUGHTERBOARD"); + put(38, "KIZBOX_MINI_DAUGHTERBOARD_ZWAVE"); + put(39, "KIZBOX_MINI_DAUGHTERBOARD_ENOCEAN"); + put(40, "KIZBOX_MINI_RAILDIN"); + put(41, "TAHOMA_V2_RTS"); + put(42, "KIZBOX_MINI_MODBUS"); + put(43, "KIZBOX_MINI_OVP"); + put(53, "CONNEXOON_RTS"); + put(54, "OPENDOORS_LOCK_SYSTEM"); + put(56, "CONNEXOON_RTS_JAPAN"); + put(58, "HOME_PROTECT_SYSTEM"); + put(62, "CONNEXOON_RTS_AUSTRALIA"); + put(63, "THERMOSTAT_SOMFY_SYSTEM"); + put(64, "BOX_ULTRA_LOW_COST_RTS"); + put(65, "SMARTLY_MINI_DAUGHTERBOARD_ZWAVE"); + put(66, "SMARTLY_MINIBOX_RAILDIN"); + put(67, "TAHOMA_BEE"); + put(72, "TAHOMA_RAIL_DIN"); + put(77, "ELIOT"); + put(88, "WISER"); + } + }; } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java index 32555f7e40f33..a29cad32417ea 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaHandlerFactory.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaHandlerFactory.java index f1b4d6543ba5e..520b7196c86e0 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaHandlerFactory.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/SomfyTahomaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,15 +14,13 @@ import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; -import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Hashtable; import java.util.Map; -import java.util.Set; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; @@ -31,10 +29,13 @@ import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; import org.openhab.binding.somfytahoma.internal.discovery.SomfyTahomaItemDiscoveryService; import org.openhab.binding.somfytahoma.internal.handler.*; import org.osgi.framework.ServiceRegistration; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,20 +50,19 @@ public class SomfyTahomaHandlerFactory extends BaseThingHandlerFactory { private final Logger logger = LoggerFactory.getLogger(SomfyTahomaHandlerFactory.class); - private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = new HashSet<>(Arrays.asList(THING_TYPE_BRIDGE, - THING_TYPE_GATEWAY, THING_TYPE_ROLLERSHUTTER, THING_TYPE_ROLLERSHUTTER_SILENT, THING_TYPE_SCREEN, - THING_TYPE_VENETIANBLIND, THING_TYPE_EXTERIORSCREEN, THING_TYPE_EXTERIORVENETIANBLIND, - THING_TYPE_GARAGEDOOR, THING_TYPE_AWNING, THING_TYPE_ACTIONGROUP, THING_TYPE_ONOFF, THING_TYPE_LIGHT, - THING_TYPE_LIGHTSENSOR, THING_TYPE_SMOKESENSOR, THING_TYPE_CONTACTSENSOR, THING_TYPE_OCCUPANCYSENSOR, - THING_TYPE_WINDOW, THING_TYPE_INTERNAL_ALARM, THING_TYPE_EXTERNAL_ALARM, THING_TYPE_POD, - THING_TYPE_HEATING_SYSTEM, THING_TYPE_ONOFF_HEATING_SYSTEM, THING_TYPE_DOOR_LOCK, THING_TYPE_PERGOLA, - THING_TYPE_WINDOW_HANDLE, THING_TYPE_TEMPERATURESENSOR, THING_TYPE_GATE)); private Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + private final HttpClient httpClient; + + @Activate + public SomfyTahomaHandlerFactory(@Reference HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { - return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + return THING_TYPE_BRIDGE.equals(thingTypeUID) || SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); } @Override @@ -73,86 +73,72 @@ protected ThingHandler createHandler(Thing thing) { logger.debug("Creating handler for {}", thing.getThingTypeUID().getId()); if (thingTypeUID.equals(THING_TYPE_BRIDGE)) { - SomfyTahomaBridgeHandler handler = new SomfyTahomaBridgeHandler((Bridge) thing); + SomfyTahomaBridgeHandler handler = new SomfyTahomaBridgeHandler((Bridge) thing, httpClient); registerItemDiscoveryService(handler); return handler; - } - if (thingTypeUID.equals(THING_TYPE_GATEWAY)) { + } else if (thingTypeUID.equals(THING_TYPE_GATEWAY)) { return new SomfyTahomaGatewayHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_ROLLERSHUTTER)) { + } else if (thingTypeUID.equals(THING_TYPE_ROLLERSHUTTER)) { return new SomfyTahomaRollerShutterHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_ROLLERSHUTTER_SILENT)) { + } else if (thingTypeUID.equals(THING_TYPE_ROLLERSHUTTER_SILENT)) { return new SomfyTahomaSilentRollerShutterHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_SCREEN) || thingTypeUID.equals(THING_TYPE_EXTERIORSCREEN)) { + } else if (thingTypeUID.equals(THING_TYPE_SCREEN) || thingTypeUID.equals(THING_TYPE_EXTERIORSCREEN)) { return new SomfyTahomaRollerShutterHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_VENETIANBLIND) || thingTypeUID.equals(THING_TYPE_EXTERIORVENETIANBLIND)) { + } else if (thingTypeUID.equals(THING_TYPE_VENETIANBLIND) || thingTypeUID.equals(THING_TYPE_EXTERIORVENETIANBLIND)) { return new SomfyTahomaVenetianBlindHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_GARAGEDOOR)) { + } else if (thingTypeUID.equals(THING_TYPE_GARAGEDOOR)) { return new SomfyTahomaRollerShutterHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_AWNING)) { + } else if (thingTypeUID.equals(THING_TYPE_AWNING)) { return new SomfyTahomaAwningHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_ACTIONGROUP)) { + } else if (thingTypeUID.equals(THING_TYPE_ACTIONGROUP)) { return new SomfyTahomaActionGroupHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_ONOFF)) { + } else if (thingTypeUID.equals(THING_TYPE_ONOFF)) { return new SomfyTahomaOnOffHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_LIGHT)) { + } else if (thingTypeUID.equals(THING_TYPE_LIGHT)) { return new SomfyTahomaOnOffHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_LIGHTSENSOR)) { + } else if (thingTypeUID.equals(THING_TYPE_LIGHTSENSOR)) { return new SomfyTahomaLightSensorHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_SMOKESENSOR)) { + } else if (thingTypeUID.equals(THING_TYPE_SMOKESENSOR)) { return new SomfyTahomaSmokeSensorHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_OCCUPANCYSENSOR)) { + } else if (thingTypeUID.equals(THING_TYPE_OCCUPANCYSENSOR)) { return new SomfyTahomaOccupancySensorHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_CONTACTSENSOR)) { + } else if (thingTypeUID.equals(THING_TYPE_CONTACTSENSOR)) { return new SomfyTahomaContactSensorHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_WINDOW)) { + } else if (thingTypeUID.equals(THING_TYPE_WINDOW)) { return new SomfyTahomaWindowHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_INTERNAL_ALARM)) { + } else if (thingTypeUID.equals(THING_TYPE_INTERNAL_ALARM)) { return new SomfyTahomaInternalAlarmHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_EXTERNAL_ALARM)) { + } else if (thingTypeUID.equals(THING_TYPE_EXTERNAL_ALARM)) { return new SomfyTahomaExternalAlarmHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_POD)) { + } else if (thingTypeUID.equals(THING_TYPE_POD)) { return new SomfyTahomaPodHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_HEATING_SYSTEM)) { + } else if (thingTypeUID.equals(THING_TYPE_HEATING_SYSTEM)) { return new SomfyTahomaHeatingSystemHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_ONOFF_HEATING_SYSTEM)) { + } else if (thingTypeUID.equals(THING_TYPE_ONOFF_HEATING_SYSTEM)) { return new SomfyTahomaOnOffHeatingSystemHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_DOOR_LOCK)) { + } else if (thingTypeUID.equals(THING_TYPE_DOOR_LOCK)) { return new SomfyTahomaDoorLockHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_PERGOLA)) { + } else if (thingTypeUID.equals(THING_TYPE_PERGOLA)) { return new SomfyTahomaPergolaHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_WINDOW_HANDLE)) { + } else if (thingTypeUID.equals(THING_TYPE_WINDOW_HANDLE)) { return new SomfyTahomaWindowHandleHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_TEMPERATURESENSOR)) { + } else if (thingTypeUID.equals(THING_TYPE_TEMPERATURESENSOR)) { return new SomfyTahomaTemperatureSensorHandler(thing); - } - if (thingTypeUID.equals(THING_TYPE_GATE)) { + } else if (thingTypeUID.equals(THING_TYPE_GATE)) { return new SomfyTahomaGateHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_CURTAIN)){ + return new SomfyTahomaCurtainHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_ELECTRICITYSENSOR)) { + return new SomfyTahomaElectricitySensorHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_DOCK)) { + return new SomfyTahomaDockHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_SIREN)) { + return new SomfyTahomaSirenHandler(thing); + } else if (thingTypeUID.equals(THING_TYPE_ADJUSTABLE_SLATS_ROLLERSHUTTER)) { + return new SomfyTahomaAdjustableSlatsRollerShutterHandler(thing); + }else { + return null; } - return null; } @Override diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/config/SomfyTahomaConfig.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/config/SomfyTahomaConfig.java index 61ca7bc8275e8..73f7c1a59954d 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/config/SomfyTahomaConfig.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/config/SomfyTahomaConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java index 429cc8505b06c..6f098c1460ba6 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/discovery/SomfyTahomaItemDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,15 @@ */ package org.openhab.binding.somfytahoma.internal.discovery; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; @@ -28,12 +37,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.*; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - /** * The {@link SomfyTahomaItemDiscoveryService} discovers rollershutters and * action groups associated with your TahomaLink cloud account. @@ -101,14 +104,7 @@ protected void stopBackgroundDiscovery() { @Override public Set<ThingTypeUID> getSupportedThingTypes() { - return new HashSet<>(Arrays.asList(THING_TYPE_GATEWAY, THING_TYPE_ROLLERSHUTTER, - THING_TYPE_ROLLERSHUTTER_SILENT, THING_TYPE_SCREEN, THING_TYPE_VENETIANBLIND, THING_TYPE_EXTERIORSCREEN, - THING_TYPE_EXTERIORVENETIANBLIND, THING_TYPE_GARAGEDOOR, THING_TYPE_ACTIONGROUP, THING_TYPE_AWNING, - THING_TYPE_ONOFF, THING_TYPE_LIGHT, THING_TYPE_LIGHTSENSOR, THING_TYPE_SMOKESENSOR, - THING_TYPE_CONTACTSENSOR, THING_TYPE_OCCUPANCYSENSOR, THING_TYPE_WINDOW, THING_TYPE_EXTERNAL_ALARM, - THING_TYPE_INTERNAL_ALARM, THING_TYPE_POD, THING_TYPE_HEATING_SYSTEM, THING_TYPE_ONOFF_HEATING_SYSTEM, - THING_TYPE_DOOR_LOCK, THING_TYPE_PERGOLA, THING_TYPE_WINDOW_HANDLE, THING_TYPE_TEMPERATURESENSOR, - THING_TYPE_GATE)); + return SUPPORTED_THING_TYPES_UIDS; } @Override @@ -120,17 +116,17 @@ private synchronized void runDiscovery() { logger.debug("Starting scanning for things..."); if (bridge.getThing().getStatus().equals(ThingStatus.ONLINE)) { - SomfyTahomaSetup devices = bridge.listDevices(); + SomfyTahomaSetup setup = bridge.getSetup(); - if (devices == null) { + if (setup == null) { return; } - for (SomfyTahomaDevice device : devices.getDevices()) { + for (SomfyTahomaDevice device : setup.getDevices()) { discoverDevice(device); } - for (SomfyTahomaGateway gw : devices.getGateways()) { - gatewayDiscovered(gw.getGatewayId()); + for (SomfyTahomaGateway gw : setup.getGateways()) { + gatewayDiscovered(gw); } List<SomfyTahomaActionGroup> actions = bridge.listActionGroups(); @@ -143,122 +139,165 @@ private synchronized void runDiscovery() { actionGroupDiscovered(label, oid, oid); } } else { - logger.debug("Cannot start discovery since the bridge is not online!"); + logger.debug("Cannot start discovery since the bridge is not online! Rescheduling..."); + scheduler.schedule(this::runDiscovery, 60, TimeUnit.SECONDS); } } private void discoverDevice(SomfyTahomaDevice device) { logger.debug("url: {}", device.getDeviceURL()); switch (device.getUiClass()) { - case AWNING: + case THING_AWNING: deviceDiscovered(device, THING_TYPE_AWNING); break; - case CONTACTSENSOR: + case THING_CONTACT_SENSOR: deviceDiscovered(device, THING_TYPE_CONTACTSENSOR); break; - case EXTERIORSCREEN: + case THING_CURTAIN: + deviceDiscovered(device, THING_TYPE_CURTAIN); + break; + case THING_EXTERIOR_SCREEN: deviceDiscovered(device, THING_TYPE_EXTERIORSCREEN); break; - case EXTERIORVENETIANBLIND: + case THING_EXTERIOR_VENETIAN_BLIND: deviceDiscovered(device, THING_TYPE_EXTERIORVENETIANBLIND); break; - case GARAGEDOOR: + case THING_GARAGE_DOOR: deviceDiscovered(device, THING_TYPE_GARAGEDOOR); break; - case LIGHT: + case THING_LIGHT: deviceDiscovered(device, THING_TYPE_LIGHT); break; - case LIGHTSENSOR: + case THING_LIGHT_SENSOR: deviceDiscovered(device, THING_TYPE_LIGHTSENSOR); break; - case OCCUPANCYSENSOR: + case THING_OCCUPANCY_SENSOR: deviceDiscovered(device, THING_TYPE_OCCUPANCYSENSOR); break; - case ONOFF: + case THING_ON_OFF: deviceDiscovered(device, THING_TYPE_ONOFF); break; - case ROLLERSHUTTER: + case THING_ROLLER_SHUTTER: if (isSilentRollerShutter(device)) { deviceDiscovered(device, THING_TYPE_ROLLERSHUTTER_SILENT); } else { deviceDiscovered(device, THING_TYPE_ROLLERSHUTTER); } break; - case SCREEN: + case THING_SCREEN: deviceDiscovered(device, THING_TYPE_SCREEN); break; - case SMOKESENSOR: + case THING_SMOKE_SENSOR: deviceDiscovered(device, THING_TYPE_SMOKESENSOR); break; - case VENETIANBLIND: + case THING_VENETIAN_BLIND: deviceDiscovered(device, THING_TYPE_VENETIANBLIND); break; - case WINDOW: + case THING_WINDOW: deviceDiscovered(device, THING_TYPE_WINDOW); break; - case ALARM: + case THING_ALARM: if (device.getDeviceURL().startsWith("internal:")) { deviceDiscovered(device, THING_TYPE_INTERNAL_ALARM); } else { deviceDiscovered(device, THING_TYPE_EXTERNAL_ALARM); } break; - case POD: - deviceDiscovered(device, THING_TYPE_POD); + case THING_POD: + if (hasState(device, CYCLIC_BUTTON_STATE)) { + deviceDiscovered(device, THING_TYPE_POD); + } break; - case HEATINGSYSTEM: + case THING_HEATING_SYSTEM: if (isOnOffHeatingSystem(device)) { deviceDiscovered(device, THING_TYPE_ONOFF_HEATING_SYSTEM); } else { deviceDiscovered(device, THING_TYPE_HEATING_SYSTEM); } break; - case DOORLOCK: + case THING_DOOR_LOCK: deviceDiscovered(device, THING_TYPE_DOOR_LOCK); break; - case PERGOLA: + case THING_PERGOLA: deviceDiscovered(device, THING_TYPE_PERGOLA); break; - case WINDOWHANDLE: + case THING_WINDOW_HANDLE: deviceDiscovered(device, THING_TYPE_WINDOW_HANDLE); break; - case TEMPERATURESENSOR: + case THING_TEMPERATURE_SENSOR: deviceDiscovered(device, THING_TYPE_TEMPERATURESENSOR); break; - case GATE: + case THING_GATE: deviceDiscovered(device, THING_TYPE_GATE); break; - case PROTOCOLGATEWAY: - case REMOTECONTROLLER: - case NETWORKCOMPONENT: + case THING_ELECTRICITY_SENSOR: + if (hasEnergyConsumption(device)) { + deviceDiscovered(device, THING_TYPE_ELECTRICITYSENSOR); + } else { + logUnsupportedDevice(device); + } + break; + case THING_DOCK: + deviceDiscovered(device, THING_TYPE_DOCK); + break; + case THING_SIREN: + deviceDiscovered(device, THING_TYPE_SIREN); + break; + case THING_ADJUSTABLE_SLATS_ROLLER_SHUTTER: + deviceDiscovered(device, THING_TYPE_ADJUSTABLE_SLATS_ROLLERSHUTTER); + break; + case THING_PROTOCOL_GATEWAY: + case THING_REMOTE_CONTROLLER: + case THING_NETWORK_COMPONENT: break; default: - logger.info("Detected a new unsupported device: {}", device.getUiClass()); - logger.info("If you want to add the support, please create a new issue and attach the information below"); - logger.info("Supported commands: {}", device.getDefinition().toString()); + logUnsupportedDevice(device); + } + } - StringBuilder sb = new StringBuilder().append('\n'); - for (SomfyTahomaState state : device.getStates()) { - sb.append(state.toString()).append('\n'); - } - logger.info("Device states: {}", sb.toString()); + private boolean isStateLess(SomfyTahomaDevice device) { + return device.getStates().size() == 0 || (device.getStates().size() == 1 && hasState(device, STATUS_STATE)); + } + + private void logUnsupportedDevice(SomfyTahomaDevice device) { + if (!isStateLess(device)) { + logger.info("Detected a new unsupported device: {}", device.getUiClass()); + logger.info("If you want to add the support, please create a new issue and attach the information below"); + logger.info("Supported commands: {}", device.getDefinition()); + + StringBuilder sb = new StringBuilder().append('\n'); + for (SomfyTahomaState state : device.getStates()) { + sb.append(state.toString()).append('\n'); + } + logger.info("Device states: {}", sb); } } - private boolean isSilentRollerShutter(SomfyTahomaDevice device) { - SomfyTahomaDeviceDefinition def = device.getDefinition(); - for (SomfyTahomaDeviceDefinitionCommand cmd : def.getCommands()) { - if (cmd.getCommandName().equals(COMMAND_SET_CLOSURESPEED)) { + private boolean hasState(SomfyTahomaDevice device, String state) { + for (SomfyTahomaState st : device.getStates()) { + if (state.equals(st.getName())) { return true; } } return false; } + private boolean hasEnergyConsumption(SomfyTahomaDevice device) { + return hasState(device, ENERGY_CONSUMPTION_STATE); + } + + private boolean isSilentRollerShutter(SomfyTahomaDevice device) { + return hasCommmand(device, COMMAND_SET_CLOSURESPEED); + } + private boolean isOnOffHeatingSystem(SomfyTahomaDevice device) { + return hasCommmand(device, COMMAND_SET_HEATINGLEVEL); + } + + private boolean hasCommmand(SomfyTahomaDevice device, String command) { SomfyTahomaDeviceDefinition def = device.getDefinition(); for (SomfyTahomaDeviceDefinitionCommand cmd : def.getCommands()) { - if (cmd.getCommandName().equals(COMMAND_SET_HEATINGLEVEL)) { + if (command.equals(cmd.getCommandName())) { return true; } } @@ -286,17 +325,18 @@ private void actionGroupDiscovered(String label, String deviceURL, String oid) { deviceDiscovered(label, deviceURL, oid, THING_TYPE_ACTIONGROUP); } - private void gatewayDiscovered(String id) { + private void gatewayDiscovered(SomfyTahomaGateway gw) { Map<String, Object> properties = new HashMap<>(1); + String type = gatewayTypes.getOrDefault(gw.getType(), "UNKNOWN"); + String id = gw.getGatewayId(); properties.put("id", id); + properties.put("type", type); ThingUID thingUID = new ThingUID(THING_TYPE_GATEWAY, bridge.getThing().getUID(), id); - if (discoveryServiceCallback.getExistingThing(thingUID) == null) { - logger.debug("Detected a gateway with id: {}", id); - thingDiscovered(DiscoveryResultBuilder.create(thingUID).withThingType(THING_TYPE_GATEWAY) - .withProperties(properties).withRepresentationProperty("id").withLabel("Somfy Tahoma Gateway") - .withBridge(bridge.getThing().getUID()).build()); - } + logger.debug("Detected a gateway with id: {} and type: {}", id, type); + thingDiscovered(DiscoveryResultBuilder.create(thingUID).withThingType(THING_TYPE_GATEWAY) + .withProperties(properties).withRepresentationProperty("id").withLabel("Somfy Gateway (" + type + ")") + .withBridge(bridge.getThing().getUID()).build()); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaActionGroupHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaActionGroupHandler.java index 35e43fc7dbf13..42677a38b9f11 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaActionGroupHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaActionGroupHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,8 +20,6 @@ import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.types.Command; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The {@link SomfyTahomaActionGroupHandler} is responsible for handling commands, @@ -32,8 +30,6 @@ @NonNullByDefault public class SomfyTahomaActionGroupHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaActionGroupHandler.class); - public SomfyTahomaActionGroupHandler(Thing thing) { super(thing); } @@ -50,7 +46,7 @@ protected boolean isAlwaysOnline() { @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Action group: {} received command: {}", channelUID.getId(),command.toString()); + super.handleCommand(channelUID, command); if (EXECUTE_ACTION.equals(channelUID.getId()) && command instanceof OnOffType) { if (OnOffType.ON.equals(command)) { executeActionGroup(); diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAdjustableSlatsRollerShutterHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAdjustableSlatsRollerShutterHandler.java new file mode 100644 index 0000000000000..1fc178299b4e5 --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAdjustableSlatsRollerShutterHandler.java @@ -0,0 +1,140 @@ +/** + * 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.somfytahoma.internal.handler; + +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.somfytahoma.internal.model.SomfyTahomaState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link SomfyTahomaAdjustableSlatsRollerShutterHandler} is responsible for handling commands, + * which are sent to one of the channels of the adjustable slats roller shutter thing. + * + * @author Ondrej Pecta - Initial contribution + */ +@NonNullByDefault +public class SomfyTahomaAdjustableSlatsRollerShutterHandler extends SomfyTahomaBaseThingHandler { + + private final Logger logger = LoggerFactory.getLogger(SomfyTahomaAdjustableSlatsRollerShutterHandler.class); + + public SomfyTahomaAdjustableSlatsRollerShutterHandler(Thing thing) { + super(thing); + stateNames.put(CONTROL, "core:ClosureOrRockerPositionState"); + stateNames.put(ROCKER, "core:ClosureOrRockerPositionState"); + stateNames.put(ORIENTATION, "core:SlateOrientationState"); + // override state type because the control may return string 'rocker' + cacheStateType(CONTROL, TYPE_PERCENT); + } + + @Override + public void updateThingChannels(List<SomfyTahomaState> states) { + for (SomfyTahomaState state : states) { + logger.trace("processing state: {} with value: {}", state.getName(), state.getValue()); + updateProperty(state.getName(), state.getValue().toString()); + if ("core:ClosureOrRockerPositionState".equals(state.getName())) { + Channel ch = thing.getChannel(CONTROL); + Channel chRocker = thing.getChannel(ROCKER); + if ("rocker".equals(state.getValue())) { + if (chRocker != null) { + updateState(chRocker.getUID(), OnOffType.ON); + } + } else { + if (chRocker != null) { + updateState(chRocker.getUID(), OnOffType.OFF); + } + if (ch != null) { + State newState = parseTahomaState(state); + if (newState != null) { + updateState(ch.getUID(), newState); + } + } + } + } else if ("core:SlateOrientationState".equals(state.getName())) { + Channel ch = thing.getChannel(ORIENTATION); + if (ch != null) { + State newState = parseTahomaState(state); + if (newState != null) { + updateState(ch.getUID(), newState); + } + } + } + + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + if (!ROCKER.equals(channelUID.getId()) && !CONTROL.equals(channelUID.getId()) + && !ORIENTATION.equals(channelUID.getId())) { + return; + } + + if (RefreshType.REFRESH.equals(command)) { + return; + } else if (ROCKER.equals(channelUID.getId())) { + if (OnOffType.ON.equals(command)) { + sendCommand(COMMAND_SET_ROCKERPOSITION); + } + } else { + String cmd = getTahomaCommand(command.toString(), channelUID.getId()); + if (COMMAND_SET_ROCKERPOSITION.equals(cmd)) { + String executionId = getCurrentExecutions(); + if (executionId != null) { + // Check if the roller shutter is moving and rocker is sent => STOP it + cancelExecution(executionId); + } else { + sendCommand(COMMAND_SET_ROCKERPOSITION); + } + } else { + String param = (COMMAND_SET_CLOSURE.equals(cmd) || COMMAND_SET_ORIENTATION.equals(cmd)) + ? "[" + command.toString() + "]" + : "[]"; + sendCommand(cmd, param); + } + } + } + + protected String getTahomaCommand(String command, String channelId) { + switch (command) { + case "OFF": + case "DOWN": + case "CLOSE": + return COMMAND_DOWN; + case "ON": + case "UP": + case "OPEN": + return COMMAND_UP; + case "STOP": + return COMMAND_SET_ROCKERPOSITION; + default: + if (CONTROL.equals(channelId)) { + return COMMAND_SET_CLOSURE; + } else { + return COMMAND_SET_ORIENTATION; + } + } + } +} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAwningHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAwningHandler.java index 92e9c800a7bfb..5fb62ec7fcf18 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAwningHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaAwningHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaAwningHandler} is responsible for handling commands, @@ -33,24 +29,20 @@ @NonNullByDefault public class SomfyTahomaAwningHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaAwningHandler.class); - public SomfyTahomaAwningHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTROL, "core:DeploymentState"); - }}; + stateNames.put(CONTROL, "core:DeploymentState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (!CONTROL.equals(channelUID.getId())) { return; } if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { String cmd = getTahomaCommand(command.toString()); if (COMMAND_MY.equals(cmd)) { @@ -59,7 +51,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { //Check if the awning is moving and MY is sent => STOP it cancelExecution(executionId); } else { - sendCommand(COMMAND_MY, "[]"); + sendCommand(COMMAND_MY); } } else { String param = COMMAND_SET_DEPLOYMENT.equals(cmd) ? "[" + command.toString() + "]" : "[]"; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java index 036d91374debf..d16973096ce14 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,25 +12,32 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import java.util.HashMap; +import java.util.List; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.eclipse.smarthome.core.cache.ExpiringCache; -import org.eclipse.smarthome.core.library.types.*; -import org.eclipse.smarthome.core.thing.*; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.OpenClosedType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.Channel; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; -import org.eclipse.smarthome.core.thing.type.ChannelTypeUID; +import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.somfytahoma.internal.model.SomfyTahomaState; +import org.openhab.binding.somfytahoma.internal.model.SomfyTahomaStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - /** * The {@link SomfyTahomaBaseThingHandler} is base thing handler for all things. * @@ -43,9 +50,6 @@ public abstract class SomfyTahomaBaseThingHandler extends BaseThingHandler { private HashMap<String, Integer> typeTable = new HashMap<>(); protected HashMap<String, String> stateNames = new HashMap<>(); - //cache - private @Nullable ExpiringCache<List<SomfyTahomaState>> thingStates; - public SomfyTahomaBaseThingHandler(Thing thing) { super(thing); } @@ -56,44 +60,24 @@ public HashMap<String, String> getStateNames() { @Override public void initialize() { - thingStates = new ExpiringCache<>(CACHE_EXPIRY, () -> getThingStates()); - - if (ThingStatus.ONLINE == getBridge().getStatus()) { - SomfyTahomaState state = getCachedThingState(STATUS_STATE); - updateThingStatus(state); - } else { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); - } } - private synchronized @Nullable SomfyTahomaState getCachedThingState(String state) { - logger.debug("Getting cached state: {} for url: {}", state, getURL()); - List<SomfyTahomaState> states = thingStates.getValue(); - if (states != null) { - for (SomfyTahomaState st : states) { - if (st.getName().equals(state)) { - logger.debug("Returning cached value: {} for state name: {}", st.getValue(), st.getName()); - return st; - } - } - } - return null; + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("Received command {} for channel {}", command, channelUID); } protected boolean isAlwaysOnline() { return false; } - protected @Nullable List<SomfyTahomaState> getThingStates() { - return getBridgeHandler() != null ? getBridgeHandler().getAllStates(getStateNames().values(), getURL()) : null; - } - protected @Nullable SomfyTahomaBridgeHandler getBridgeHandler() { return this.getBridge() != null ? (SomfyTahomaBridgeHandler) this.getBridge().getHandler() : null; } private String getURL() { - return getThing().getConfiguration().get("url") != null ? getThing().getConfiguration().get("url").toString() : ""; + return getThing().getConfiguration().get("url") != null ? getThing().getConfiguration().get("url").toString() + : ""; } private void setAvailable() { @@ -112,6 +96,10 @@ private boolean isChannelLinked(Channel channel) { return isLinked(channel.getUID().getId()); } + protected void sendCommand(String cmd) { + sendCommand(cmd, "[]"); + } + protected void sendCommand(String cmd, String param) { if (getBridgeHandler() != null) { getBridgeHandler().sendCommand(getURL(), cmd, param); @@ -137,37 +125,11 @@ protected void cancelExecution(String executionId) { } } - protected @Nullable String getTahomaVersion(String id) { - if (getBridgeHandler() != null) { - return getBridgeHandler().getTahomaVersion(id); - } - return "N/A"; - } - - protected @Nullable String getTahomaStatus(String id) { + protected SomfyTahomaStatus getTahomaStatus(String id) { if (getBridgeHandler() != null) { return getBridgeHandler().getTahomaStatus(id); } - return "N/A"; - } - - private @Nullable State getChannelState(Channel channel, - List<SomfyTahomaState> channelStates) { - ChannelTypeUID channelUID = channel.getChannelTypeUID(); - if (channelUID == null) { - return null; - } - - State newState = null; - @Nullable String stateName = getStateNames().get(channelUID.getId()); - for (SomfyTahomaState state : channelStates) { - if (state.getName().equals(stateName)) { - logger.trace("Parsing state for channel: {} with state name: {}", channel.getUID().getId(), state.getName()); - //sometimes more states are sent in one event, so take the last one - newState = parseTahomaState(channel.getAcceptedItemType(), state); - } - } - return newState; + return new SomfyTahomaStatus(); } private void cacheStateType(SomfyTahomaState state) { @@ -182,6 +144,10 @@ protected void cacheStateType(String stateName, int type) { } } + protected @Nullable State parseTahomaState(@Nullable SomfyTahomaState state) { + return parseTahomaState(null, state); + } + private @Nullable State parseTahomaState(@Nullable String acceptedState, @Nullable SomfyTahomaState state) { if (state == null) { return UnDefType.NULL; @@ -210,6 +176,7 @@ protected void cacheStateType(String stateName, int type) { Double valDec = Double.parseDouble(state.getValue().toString()); return new DecimalType(valDec); case TYPE_STRING: + case TYPE_BOOLEAN: String value = state.getValue().toString().toLowerCase(); if ("String".equals(acceptedState)) { return new StringType(value); @@ -228,10 +195,12 @@ protected void cacheStateType(String stateName, int type) { private State parseStringState(String value) { switch (value) { case "on": + case "true": return OnOffType.ON; case "off": + case "false": return OnOffType.OFF; - case "notdetected": + case "notDetected": case "nopersoninside": case "closed": case "locked": @@ -263,8 +232,8 @@ public void updateThingStatus(List<SomfyTahomaState> states) { private void updateThingStatus(@Nullable SomfyTahomaState state) { if (state == null) { - //Most probably we are dealing with RTS device which does not return states - //so we have to setup ONLINE status manually + // Most probably we are dealing with RTS device which does not return states + // so we have to setup ONLINE status manually setAvailable(); return; } @@ -277,49 +246,21 @@ private void updateThingStatus(@Nullable SomfyTahomaState state) { } } - public void updateChannelState(ChannelUID channelUID) { - String stateName = getStateNames().get(channelUID.getId()); - Channel channel = getChannelByChannelUID(channelUID); - if (channel == null) { - return; - } - if (stateName == null) { - logger.debug("Cannot find corresponding state name for channel: {}!", channelUID.getId()); - return; - } - SomfyTahomaState tahomaState = getCachedThingState(stateName); - State state = parseTahomaState(channel.getAcceptedItemType(), tahomaState); - - if (UnDefType.NULL.equals(state)) { - // relogin - getBridgeHandler().login(); - tahomaState = getCachedThingState(stateName); - state = parseTahomaState(channel.getAcceptedItemType(), tahomaState); - } - - if (state != null) { - updateState(channelUID, state); - } - } - - private @Nullable Channel getChannelByChannelUID(ChannelUID channelUID) { - if (thing.getChannel(channelUID.getId()) != null) { - return thing.getChannel(channelUID.getId()); - } - logger.debug("Cannot find channel for UID: {}", channelUID.getId()); - return null; - } - - public void updateThingChannels(ArrayList<SomfyTahomaState> states) { - // update channel values - for (Channel channel : thing.getChannels()) { - if (isChannelLinked(channel)) { - State channelState = getChannelState(channel, states); - if (channelState != null) { - logger.trace("Updating channel: {} with state: {}", channel.getUID(), channelState); - updateState(channel.getUID(), channelState); - } else { - logger.debug("Cannot find state for channel {}", channel.getUID()); + public void updateThingChannels(List<SomfyTahomaState> states) { + for (SomfyTahomaState state : states) { + logger.trace("processing state: {} with value: {}", state.getName(), state.getValue()); + updateProperty(state.getName(), state.getValue().toString()); + for (HashMap.Entry<String, String> entry : stateNames.entrySet()) { + if (entry.getValue().equals(state.getName())) { + // get channel and update it if linked + Channel ch = thing.getChannel(entry.getKey()); + if (ch != null && isChannelLinked(ch)) { + logger.trace("updating channel: {} with value: {}", entry.getKey(), state.getValue()); + State newState = parseTahomaState(ch.getAcceptedItemType(), state); + if (newState != null) { + updateState(ch.getUID(), newState); + } + } } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java index 9a8baad9c2345..73672035ec361 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,7 +12,19 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + import com.google.gson.Gson; +import com.google.gson.JsonElement; import com.google.gson.JsonSyntaxException; import org.apache.commons.lang.StringUtils; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -23,7 +35,6 @@ import org.eclipse.jetty.client.util.StringContentProvider; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpMethod; -import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.smarthome.config.core.status.ConfigStatusMessage; import org.eclipse.smarthome.core.thing.*; import org.eclipse.smarthome.core.thing.binding.ConfigStatusBridgeHandler; @@ -34,17 +45,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - /** * The {@link SomfyTahomaBridgeHandler} is responsible for handling commands, which are * sent to one of the channels. @@ -56,11 +56,10 @@ public class SomfyTahomaBridgeHandler extends ConfigStatusBridgeHandler { private final Logger logger = LoggerFactory.getLogger(SomfyTahomaBridgeHandler.class); - // Instantiate and configure the SslContextFactory - private SslContextFactory sslContextFactory = new SslContextFactory(); - - // Instantiate HttpClient with the SslContextFactory - private HttpClient httpClient = new HttpClient(sslContextFactory); + /** + * The shared HttpClient + */ + private final HttpClient httpClient; /** * Future to poll for updates @@ -72,6 +71,11 @@ public class SomfyTahomaBridgeHandler extends ConfigStatusBridgeHandler { */ private @Nullable ScheduledFuture<?> statusFuture; + /** + * List of executions + */ + private Map<String, String> executions = new HashMap<>(); + // Too many request flag private boolean tooManyRequests = false; @@ -80,11 +84,17 @@ public class SomfyTahomaBridgeHandler extends ConfigStatusBridgeHandler { */ protected SomfyTahomaConfig thingConfig = new SomfyTahomaConfig(); + /** + * Id of registered events + */ + private String eventsId = ""; + // Gson & parser private final Gson gson = new Gson(); - public SomfyTahomaBridgeHandler(Bridge thing) { + public SomfyTahomaBridgeHandler(Bridge thing, HttpClient httpClient) { super(thing); + this.httpClient = httpClient; } @Override @@ -95,8 +105,6 @@ public void handleCommand(ChannelUID channelUID, Command command) { public void initialize() { thingConfig = getConfigAs(SomfyTahomaConfig.class); - httpClient.setFollowRedirects(false); - scheduler.execute(() -> { login(); initPolling(); @@ -128,17 +136,13 @@ public synchronized void login() { return; } - if (tooManyRequests || ThingStatus.ONLINE == thing.getStatus()) { + if (tooManyRequests) { + logger.debug("Skipping login due to too many requests"); return; } try { - if (httpClient.isStarted()) { - httpClient.stop(); - } - httpClient.start(); - - url = TAHOMA_URL + "login"; + url = TAHOMA_API_URL + "login"; String urlParameters = "userId=" + urlEncode(thingConfig.getEmail()) + "&userPassword=" + urlEncode(thingConfig.getPassword()); ContentResponse response = sendRequestBuilder(url, HttpMethod.POST) @@ -152,28 +156,83 @@ public synchronized void login() { SomfyTahomaLoginResponse data = gson.fromJson(response.getContentAsString(), SomfyTahomaLoginResponse.class); if (data.isSuccess()) { logger.debug("SomfyTahoma version: {}", data.getVersion()); - updateStatus(ThingStatus.ONLINE); + String id = registerEvents(); + if (id != null && !id.equals(UNAUTHORIZED)) { + eventsId = id; + logger.debug("Events id: {}", eventsId); + updateStatus(ThingStatus.ONLINE); + updateThings(); + } else { + logger.debug("Events id error: {}", id); + } } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error logging in: " + data.getError()); if (data.getError().startsWith(TOO_MANY_REQUESTS)) { - logger.debug("Too many requests error, suspending activity for {} seconds", SUSPEND_TIME); - tooManyRequests = true; - scheduler.schedule(this::enableLogin, SUSPEND_TIME, TimeUnit.SECONDS); + setTooManyRequests(); } } } catch (JsonSyntaxException e) { logger.debug("Received invalid data", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); } catch (InterruptedException | ExecutionException | TimeoutException e) { + if (e instanceof ExecutionException) { + if (e.getMessage().contains(AUTHENTICATION_CHALLENGE)) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Authentication challenge"); + setTooManyRequests(); + return; + } + } logger.debug("Cannot get login cookie!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Cannot get login cookie"); - } catch (Exception e) { - logger.debug("Cannot start http client", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Cannot start http client"); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + } catch (UnsupportedEncodingException e) { + logger.debug("Cannot login due to unsupported encoding", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unsupported encoding"); } } + private void setTooManyRequests() { + logger.debug("Too many requests error, suspending activity for {} seconds", SUSPEND_TIME); + tooManyRequests = true; + scheduler.schedule(this::enableLogin, SUSPEND_TIME, TimeUnit.SECONDS); + } + + private @Nullable String registerEvents() { + String url; + + try { + url = TAHOMA_EVENTS_URL + "register"; + + String line = sendDataToTahomaWithCookie(url,""); + SomfyTahomaRegisterEventsResponse response = gson.fromJson(line, SomfyTahomaRegisterEventsResponse.class); + return response.getId(); + } catch (JsonSyntaxException e) { + logger.debug("Received invalid data", e); + return null; + } catch (SomfyTahomaException e) { + login(); + return UNAUTHORIZED; + } catch (ExecutionException e) { + if (isAuthenticationChallenge(e)) { + login(); + return UNAUTHORIZED; + } else { + logger.info("Cannot register events!", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + } + } catch (InterruptedException | TimeoutException e) { + logger.info("Cannot register events!", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + } + return null; + } + private String urlEncode(String text) throws UnsupportedEncodingException { return URLEncoder.encode(text, StandardCharsets.UTF_8.toString()); } @@ -187,7 +246,7 @@ private List<SomfyTahomaEvent> getEvents() { String line = ""; try { - url = TAHOMA_URL + "getEvents"; + url = TAHOMA_API_URL + "events/" + eventsId + "/fetch"; line = sendDataToTahomaWithCookie(url, ""); SomfyTahomaEvent[] array = gson.fromJson(line, SomfyTahomaEvent[].class); @@ -207,6 +266,9 @@ private List<SomfyTahomaEvent> getEvents() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot get Tahoma events!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } return new ArrayList<>(); } @@ -224,12 +286,22 @@ public Collection<ConfigStatusMessage> getConfigStatus() { @Override public void dispose() { + cleanup(); + super.dispose(); + } + + private void cleanup() { + logger.debug("Doing cleanup"); stopPolling(); + executions.clear(); + } - try { - httpClient.stop(); - } catch (Exception e) { - logger.error("Cannot stop http client", e); + + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + super.bridgeStatusChanged(bridgeStatusInfo); + if (ThingStatus.UNINITIALIZED == bridgeStatusInfo.getStatus()) { + cleanup(); } } @@ -258,8 +330,8 @@ public List<SomfyTahomaActionGroup> listActionGroups() { } try { - SomfyTahomaActionGroupResponse data = gson.fromJson(groups, SomfyTahomaActionGroupResponse.class); - return data.getActionGroups(); + SomfyTahomaActionGroup[] list = gson.fromJson(groups, SomfyTahomaActionGroup[].class); + return Arrays.asList(list); } catch (JsonSyntaxException e) { logger.debug("Received data: {} is not JSON", groups, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); @@ -271,10 +343,8 @@ public List<SomfyTahomaActionGroup> listActionGroups() { String url; try { - url = TAHOMA_URL + "getActionGroups"; - String urlParameters = ""; - - return sendDataToTahomaWithCookie(url, urlParameters); + url = TAHOMA_API_URL + "actionGroups"; + return sendGetToTahomaWithCookie(url); } catch (SomfyTahomaException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); return UNAUTHORIZED; @@ -289,21 +359,21 @@ public List<SomfyTahomaActionGroup> listActionGroups() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot send getActionGroups command!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } return null; } - public @Nullable SomfyTahomaSetup listDevices() { + public @Nullable SomfyTahomaSetup getSetup() { String url; String line = ""; try { - url = TAHOMA_URL + "getSetup"; - String urlParameters = ""; - - line = sendDataToTahomaWithCookie(url, urlParameters); - SomfyTahomaSetupResponse data = gson.fromJson(line, SomfyTahomaSetupResponse.class); - return data.getSetup(); + url = TAHOMA_API_URL + "setup"; + line = sendGetToTahomaWithCookie(url); + return gson.fromJson(line, SomfyTahomaSetup.class); } catch (JsonSyntaxException e) { logger.debug("Received data: {} is not JSON", line, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); @@ -319,63 +389,10 @@ public List<SomfyTahomaActionGroup> listActionGroups() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot send getSetup command!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); - } - return null; - } - - - private String getFormattedParameters(Collection<String> stateNames) { - ArrayList<String> uniqueNames = new ArrayList<>(); - for (String name : stateNames) { - if (!uniqueNames.contains(name)) { - uniqueNames.add(name); - } - } - StringBuilder sb = new StringBuilder("{\"name\": \"" + STATUS_STATE + "\"}"); - for (String name : uniqueNames) { - sb.append(','); - sb.append("{\"name\": \"").append(name).append("\"}"); - } - logger.trace("Formatted parameters: {}", sb); - return sb.toString(); - } - - - public @Nullable synchronized List<SomfyTahomaState> getAllStates(Collection<String> stateNames, String deviceUrl) { - String url; - String line = ""; - - logger.debug("Getting states for a device: {}", deviceUrl); - try { - url = TAHOMA_URL + "getStates"; - String urlParameters = "[{\"deviceURL\": \"" + deviceUrl + "\", \"states\": [" - + getFormattedParameters(stateNames) + "]}]"; - - line = sendDataToTahomaWithCookie(url, urlParameters); - - SomfyTahomaStatesResponse data = gson.fromJson(line, SomfyTahomaStatesResponse.class); - SomfyTahomaDeviceWithState device = data.getDevices().get(0); - if (!device.hasStates()) { - logger.debug("Device: {} has not returned any state", deviceUrl); - } - return device.getStates(); - } catch (JsonSyntaxException e) { - logger.debug("Received data: {} is not JSON", line, e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); - } catch (SomfyTahomaException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); - } catch (ExecutionException e) { - if (isAuthenticationChallenge(e)) { - login(); - } else { - logger.debug("Cannot send getStates command!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); } - } catch (InterruptedException | TimeoutException e) { - logger.debug("Cannot send getStates command!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); } - return null; } @@ -386,7 +403,7 @@ private void getTahomaUpdates() { } List<SomfyTahomaEvent> events = getEvents(); - logger.debug("Got total of {} events", events.size()); + logger.trace("Got total of {} events", events.size()); for (SomfyTahomaEvent event : events) { processEvent(event); } @@ -395,23 +412,100 @@ private void getTahomaUpdates() { private void processEvent(SomfyTahomaEvent event) { logger.debug("Got event: {}", event.getName()); switch (event.getName()) { + case "ExecutionRegisteredEvent": + processExecutionRegisteredEvent(event); + break; + case "ExecutionStateChangedEvent": + processExecutionChangedEvent(event); + break; case "DeviceStateChangedEvent": processStateChangedEvent(event); break; case "RefreshAllDevicesStatesCompletedEvent": - scheduler.schedule(() -> { - //force update thing states - updateAllStates(); - }, 1, TimeUnit.SECONDS); + scheduler.schedule(this::updateThings, 1, TimeUnit.SECONDS ); + break; + case "GatewayAliveEvent": + case "GatewayDownEvent": + processGatewayEvent(event); break; default: //ignore other states } } + private synchronized void updateThings() { + boolean forceUpdate = false; + for (Thing th : getThing().getThings()) { + //update gateway status + if (THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) { + SomfyTahomaGatewayHandler gatewayHandler = (SomfyTahomaGatewayHandler) th.getHandler(); + if (gatewayHandler != null) { + gatewayHandler.updateStatus(); + } + } else { + if (ThingStatus.ONLINE != th.getStatus()) { + forceUpdate = true; + } + } + } + + //update all states only if necessary + if (forceUpdate) { + updateAllStates(); + } + } + + private void processExecutionRegisteredEvent(SomfyTahomaEvent event) { + JsonElement el = event.getAction(); + if (el.isJsonArray()) { + SomfyTahomaAction[] actions = gson.fromJson(el, SomfyTahomaAction[].class); + for (SomfyTahomaAction action : actions) { + registerExecution(action.getDeviceURL(), event.getExecId()); + } + } else { + SomfyTahomaAction action = gson.fromJson(el, SomfyTahomaAction.class); + registerExecution(action.getDeviceURL(), event.getExecId()); + } + } + + private void processExecutionChangedEvent(SomfyTahomaEvent event) { + if ("4".equals(event.getNewState()) || "5".equals(event.getNewState())) { + logger.debug("Removing execution id: {}", event.getExecId()); + unregisterExecution(event.getExecId()); + } + } + + private void registerExecution(String url, String execId) { + if (executions.containsKey(url)) { + executions.remove(url); + logger.debug("Previous execution exists for url: {}", url); + } + executions.put(url, execId); + } + + private void unregisterExecution(String execId) { + if( executions.containsValue(execId)) { + executions.values().removeAll(Collections.singleton(execId)); + } else { + logger.debug("Cannot remove execution id: {}, because it is not registered", execId); + } + } + + private void processGatewayEvent(SomfyTahomaEvent event) { + //update gateway status + for (Thing th : getThing().getThings()) { + if (THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) { + SomfyTahomaGatewayHandler gatewayHandler = (SomfyTahomaGatewayHandler) th.getHandler(); + if (gatewayHandler.getGateWayId().equals(event.getGatewayId())) { + gatewayHandler.updateStatus(); + } + } + } + } + private synchronized void updateAllStates() { logger.debug("Updating all states"); - SomfyTahomaSetup setup = listDevices(); + SomfyTahomaSetup setup = getSetup(); if (setup != null) { for (SomfyTahomaDevice device : setup.getDevices()) { String url = device.getDeviceURL(); @@ -423,6 +517,7 @@ private synchronized void updateAllStates() { SomfyTahomaBaseThingHandler handler = (SomfyTahomaBaseThingHandler) th.getHandler(); if (handler != null) { handler.updateThingStatus(states); + handler.updateThingChannels(states); } } } @@ -435,7 +530,7 @@ private void processStateChangedEvent(SomfyTahomaEvent event) { Thing thing = getThingByDeviceUrl(deviceUrl); if (thing != null) { - logger.debug("Updating status of thing: {}", thing.getUID().getId()); + logger.debug("Updating status of thing: {}", thing.getLabel()); SomfyTahomaBaseThingHandler handler = (SomfyTahomaBaseThingHandler) thing.getHandler(); if (handler != null) { @@ -470,9 +565,13 @@ private void refreshTahomaStates() { private void logout() { try { - sendGetToTahomaWithCookie(TAHOMA_URL + "logout"); + eventsId = ""; + sendGetToTahomaWithCookie(TAHOMA_API_URL + "logout"); } catch (InterruptedException | ExecutionException | TimeoutException e) { logger.debug("Cannot send logout command!", e); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } } @@ -550,7 +649,7 @@ public void sendCommand(String io, String command, String params) { String line = ""; try { - url = TAHOMA_URL + "apply"; + url = TAHOMA_API_URL + "exec/apply"; String value = params.equals("[]") ? command : params.replace("\"", ""); String urlParameters = "{\"label\":\"" + getThingLabelByURL(io) + " - " + value + " - OH2\",\"actions\":[{\"deviceURL\":\"" + io + "\",\"commands\":[{\"name\":\"" @@ -562,16 +661,17 @@ public void sendCommand(String io, String command, String params) { if (!StringUtils.isEmpty(data.getExecId())) { logger.debug("Exec id: {}", data.getExecId()); + registerExecution(io, data.getExecId()); } else { logger.warn("Apply command response: {}", line); - throw new SomfyTahomaException(line); + return false; } return true; } catch (JsonSyntaxException e) { logger.debug("Received data: {} is not JSON", line, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); } catch (SomfyTahomaException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); + login(); return false; } catch (ExecutionException e) { if (isAuthenticationChallenge(e)) { @@ -584,6 +684,9 @@ public void sendCommand(String io, String command, String params) { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot send apply command {} with params {}!", command, params, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } return null; } @@ -601,52 +704,9 @@ private String getThingLabelByURL(String io) { return "null"; } - public @Nullable String getCurrentExecutions(String type) { - String execId = getCurrentExecutionsInternal(type); - if (StringUtils.equals(execId, UNAUTHORIZED)) { - execId = getCurrentExecutionsInternal(type); - } - return StringUtils.equals(execId, UNAUTHORIZED) ? null : execId; - } - - private @Nullable String getCurrentExecutionsInternal(String type) { - String url; - String line = ""; - - try { - url = TAHOMA_URL + "getCurrentExecutions"; - String urlParameters = ""; - - line = sendDataToTahomaWithCookie(url, urlParameters); - - SomfyTahomaExecutionsResponse data = gson.fromJson(line, SomfyTahomaExecutionsResponse.class); - for (SomfyTahomaExecution execution : data.getExecutions()) { - String execId = execution.getId(); - SomfyTahomaActionGroup group = execution.getActionGroup(); - for (SomfyTahomaAction action : group.getActions()) { - if (action.getDeviceURL().equals(type)) { - return execId; - } - } - } - return null; - } catch (JsonSyntaxException e) { - logger.debug("Received data: {} is not JSON", line, e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); - } catch (SomfyTahomaException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); - return UNAUTHORIZED; - } catch (ExecutionException e) { - if (isAuthenticationChallenge(e)) { - login(); - return UNAUTHORIZED; - } else { - logger.debug("Cannot send getCurrentExecutions command!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); - } - } catch (InterruptedException | TimeoutException e) { - logger.debug("Cannot send getCurrentExecutions command!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + public @Nullable String getCurrentExecutions(String io) { + if (executions.containsKey(io)) { + return executions.get(io); } return null; } @@ -679,36 +739,9 @@ public void cancelExecution(String executionId) { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot cancel execution!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); - } - return null; - } - - public @Nullable String getTahomaVersion(String gatewayId) { - String line = ""; - try { - String url = SETUP_URL + gatewayId + "/version"; - line = sendGetToTahomaWithCookie(url); - SomfyTahomaVersionResponse data = gson.fromJson(line, SomfyTahomaVersionResponse.class); - logger.debug("Tahoma version: {}", data.getResult()); - - return data.getResult(); - } catch (JsonSyntaxException e) { - logger.debug("Received data: {} is not JSON", line, e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); - } catch (SomfyTahomaException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); - return UNAUTHORIZED; - } catch (ExecutionException e) { - if (isAuthenticationChallenge(e)) { - login(); - return UNAUTHORIZED; - } else { - logger.debug("Cannot get Tahoma gateway version!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); } - } catch (InterruptedException | TimeoutException e) { - logger.debug("Cannot get Tahoma gateway version!", e); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); } return null; } @@ -719,8 +752,12 @@ public void executeActionGroup(String id) { } String execId = executeActionGroupInternal(id); if (UNAUTHORIZED.equals(execId)) { - executeActionGroupInternal(id); + execId = executeActionGroupInternal(id); } + if (!UNAUTHORIZED.equals(execId) && execId != null) { + registerExecution(id, execId); + } + } private boolean reLogin() { @@ -757,6 +794,9 @@ private boolean reLogin() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot exec execution group!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } return null; } @@ -776,27 +816,28 @@ public void refreshDeviceStates() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot refresh device states!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } } - public @Nullable String getTahomaStatus(String gatewayId) { + public SomfyTahomaStatus getTahomaStatus(String gatewayId) { String line = ""; try { String url = SETUP_URL + gatewayId; line = sendGetToTahomaWithCookie(url); SomfyTahomaStatusResponse data = gson.fromJson(line, SomfyTahomaStatusResponse.class); logger.debug("Tahoma status: {}", data.getConnectivity().getStatus()); - return data.getConnectivity().getStatus(); + logger.debug("Tahoma protocol version: {}", data.getConnectivity().getProtocolVersion()); + return data.getConnectivity(); } catch (JsonSyntaxException e) { logger.debug("Received data: {} is not JSON", line, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Received invalid data"); - } catch (SomfyTahomaException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Unauthorized. Please check credentials"); - return UNAUTHORIZED; - } catch (ExecutionException e) { + } catch (SomfyTahomaException | ExecutionException e) { if (isAuthenticationChallenge(e)) { login(); - return UNAUTHORIZED; + return new SomfyTahomaStatus(); } else { logger.debug("Cannot get Tahoma gateway status!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); @@ -804,8 +845,11 @@ public void refreshDeviceStates() { } catch (InterruptedException | TimeoutException e) { logger.debug("Cannot get Tahoma gateway status!", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + if (e instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } } - return null; + return new SomfyTahomaStatus(); } private boolean isAuthenticationChallenge(Exception ex) { diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaContactSensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaContactSensorHandler.java index 83a882790b242..51212dc566079 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaContactSensorHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaContactSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.CONTACT; + import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaContactSensorHandler} is responsible for handling commands, @@ -31,26 +24,10 @@ * @author Ondrej Pecta - Initial contribution */ @NonNullByDefault -public class SomfyTahomaContactSensorHandler extends SomfyTahomaBaseThingHandler { - - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaContactSensorHandler.class); +public class SomfyTahomaContactSensorHandler extends SomfyTahomaBaseThingHandler { public SomfyTahomaContactSensorHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTACT, "core:ContactState"); - }}; - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (!CONTACT.equals(channelUID.getId())) { - return; - } - - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } + stateNames.put(CONTACT, "core:ContactState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaCurtainHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaCurtainHandler.java new file mode 100644 index 0000000000000..0a0b885aa5eb2 --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaCurtainHandler.java @@ -0,0 +1,52 @@ +/** + * 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.somfytahoma.internal.handler; + +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Thing; + +/** + * The {@link SomfyTahomaCurtainHandler} is responsible for handling commands, + * which are sent to one of the channels of the curtain thing. + * + * @author Tobias Ammann - Initial contribution + * @author Ondrej Pecta - Code optimization + */ +@NonNullByDefault +public class SomfyTahomaCurtainHandler extends SomfyTahomaRollerShutterHandler { + + public SomfyTahomaCurtainHandler(Thing thing) { + super(thing); + } + + @Override + protected String getTahomaCommand(String command) { + switch (command) { + case "OFF": + case "DOWN": + case "CLOSE": + return COMMAND_CLOSE; + case "ON": + case "UP": + case "OPEN": + return COMMAND_OPEN; + case "MY": + case "STOP": + return COMMAND_MY; + default: + return COMMAND_SET_CLOSURE; + } + } +} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDockHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDockHandler.java new file mode 100644 index 0000000000000..5730bb888d6ce --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDockHandler.java @@ -0,0 +1,61 @@ +/** + * 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.somfytahoma.internal.handler; + +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; + +/** + * The {@link SomfyTahomaDockHandler} is responsible for handling commands, + * which are sent to one of the channels of the dock thing. + * + * @author Ondrej Pecta - Initial contribution + */ +@NonNullByDefault +public class SomfyTahomaDockHandler extends SomfyTahomaBaseThingHandler { + + public SomfyTahomaDockHandler(Thing thing) { + super(thing); + stateNames.put(BATTERY_STATUS, BATTERY_STATUS_STATE); + stateNames.put(BATTERY_LEVEL, "core:BatteryLevelState"); + stateNames.put(SIREN_STATUS, "internal:SirenStatusState"); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + if (RefreshType.REFRESH.equals(command)) { + return; + } + + if (SIREN_STATUS.equals(channelUID.getId()) && command instanceof StringType) { + sendCommand("siren", "[\"" + command.toString().toLowerCase() + "\"]"); + return; + } + if (SHORT_BIP.equals(channelUID.getId()) && OnOffType.ON.equals(command)) { + sendCommand("shortBip", "[3]"); + return; + } + if (LONG_BIP.equals(channelUID.getId()) && OnOffType.ON.equals(command)) { + sendCommand("longBip", "[3]"); + return; + } + } +} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDoorLockHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDoorLockHandler.java index 4f7ee40116f79..99eaa4e3cba11 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDoorLockHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaDoorLockHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,18 +12,14 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.LOCK; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.OPEN; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaDoorLockHandler} is responsible for handling commands, @@ -34,27 +30,20 @@ @NonNullByDefault public class SomfyTahomaDoorLockHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaDoorLockHandler.class); - public SomfyTahomaDoorLockHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(OPEN, "core:OpenClosedState"); - put(LOCK, "core:LockedUnlockedState"); - }}; + stateNames.put(OPEN, "core:OpenClosedState"); + stateNames.put(LOCK, "core:LockedUnlockedState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.info("DoorLock channel: {} received command: {}", channelUID.getId(),command.toString()); + super.handleCommand(channelUID, command); if (OPEN.equals(channelUID.getId()) && command instanceof OnOffType) { - sendCommand(command.equals(OnOffType.ON) ? "open" : "close", "[]"); + sendCommand(command.equals(OnOffType.ON) ? "open" : "close"); } if (LOCK.equals(channelUID.getId()) && command instanceof OnOffType) { - sendCommand(command.equals(OnOffType.ON) ? "lock" : "unlock", "[]"); - } - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + sendCommand(command.equals(OnOffType.ON) ? "lock" : "unlock"); } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaElectricitySensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaElectricitySensorHandler.java new file mode 100644 index 0000000000000..6167ad441025a --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaElectricitySensorHandler.java @@ -0,0 +1,33 @@ +/** + * 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.somfytahoma.internal.handler; + +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import org.eclipse.smarthome.core.thing.Thing; + +/** + * The {@link SomfyTahomaElectricitySensorHandler} is responsible for handling commands, + * which are sent to one of the channels of the electricity sensor thing. + * + * @author Ondrej Pecta - Initial contribution + */ +public class SomfyTahomaElectricitySensorHandler extends SomfyTahomaBaseThingHandler { + + public SomfyTahomaElectricitySensorHandler(Thing thing) { + super(thing); + stateNames.put(ENERGY_CONSUMPTION, ENERGY_CONSUMPTION_STATE); + //override state type because the cloud sends consumption in percent + cacheStateType(ENERGY_CONSUMPTION_STATE, TYPE_DECIMAL); + } +} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaExternalAlarmHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaExternalAlarmHandler.java index f0c30880fd811..b90fb14173534 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaExternalAlarmHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaExternalAlarmHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,18 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.ALARM_COMMAND; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.ALARM_COMMAND; - -import java.util.HashMap; /** * The {@link SomfyTahomaExternalAlarmHandler} is responsible for handling commands, @@ -34,24 +29,16 @@ @NonNullByDefault public class SomfyTahomaExternalAlarmHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaExternalAlarmHandler.class); - public SomfyTahomaExternalAlarmHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put("active_zones_state", "core:ActiveZonesState"); - }}; + stateNames.put("active_zones_state", "core:ActiveZonesState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (ALARM_COMMAND.equals(channelUID.getId()) && command instanceof StringType) { - sendCommand(command.toString(), "[]"); - } - if (RefreshType.REFRESH.equals(command)) { - sendCommand("refreshState", "[]"); - updateChannelState(channelUID); + sendCommand(command.toString()); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGateHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGateHandler.java index 830338589828a..af4c5608c67fd 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGateHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGateHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; /** * The {@link SomfyTahomaGateHandler} is responsible for handling commands, @@ -33,25 +29,19 @@ @NonNullByDefault public class SomfyTahomaGateHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaGateHandler.class); - public SomfyTahomaGateHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() { - { - put(GATE_STATE, "core:OpenClosedPedestrianState"); - } - }; + stateNames.put(GATE_STATE, "core:OpenClosedPedestrianState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { if (GATE_COMMAND.equals(channelUID.getId())) { - sendCommand(getGateCommand(command.toString().toLowerCase()), "[]"); + sendCommand(getGateCommand(command.toString().toLowerCase())); } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGatewayHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGatewayHandler.java index 99cc9f2495d8b..bff445af729d3 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGatewayHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaGatewayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,17 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.eclipse.smarthome.core.thing.Thing.PROPERTY_FIRMWARE_VERSION; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.STATUS; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.Channel; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.eclipse.smarthome.core.thing.Thing.PROPERTY_FIRMWARE_VERSION; -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.STATUS; +import org.openhab.binding.somfytahoma.internal.model.SomfyTahomaStatus; /** * The {@link SomfyTahomaGatewayHandler} is responsible for handling commands, @@ -33,36 +33,40 @@ @NonNullByDefault public class SomfyTahomaGatewayHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaGatewayHandler.class); - public SomfyTahomaGatewayHandler(Thing thing) { super(thing); } @Override public void initialize() { - updateStatus(getBridge().getStatus()); + if (getBridge().getStatus() == ThingStatus.ONLINE) { + updateStatus(); + } } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } + super.handleCommand(channelUID, command); } - @Override - public void updateChannelState(ChannelUID channelUID) { - if (STATUS.equals(channelUID.getId())) { - String id = getThing().getConfiguration().get("id").toString(); - updateState(channelUID, new StringType(getTahomaStatus(id))); - //update the firmware property - String fw = getTahomaVersion(id); - if (fw != null) { - updateProperty(PROPERTY_FIRMWARE_VERSION, fw); - } + public void updateStatus() { + String id = getGateWayId(); + SomfyTahomaStatus status = getTahomaStatus(id); + String tahomaStatus = status.getStatus(); + Channel ch = thing.getChannel(STATUS); + if (ch != null) { + updateState(ch.getUID(), new StringType(tahomaStatus)); } + //update the firmware property + String fw = status.getProtocolVersion(); + if (fw != null) { + updateProperty(PROPERTY_FIRMWARE_VERSION, fw); + } + updateStatus("DISCONNECTED".equals(tahomaStatus) ? ThingStatus.OFFLINE : ThingStatus.ONLINE); + } + + public String getGateWayId() { + return getThing().getConfiguration().get("id").toString(); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java index 8c0ec7a349c83..fd9f43049b5c2 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaHeatingSystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaHeatingSystemHandler} is responsible for handling commands, @@ -33,25 +29,19 @@ @NonNullByDefault public class SomfyTahomaHeatingSystemHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaHeatingSystemHandler.class); - public SomfyTahomaHeatingSystemHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() { - { - put(TARGET_TEMPERATURE, "core:TargetTemperatureState"); - put(CURRENT_TEMPERATURE, "zwave:SetPointHeatingValueState"); - put(BATTERY_LEVEL, "core:BatteryLevelState"); - put(CURRENT_STATE, "zwave:SetPointTypeState"); - } - }; + stateNames.put(TARGET_TEMPERATURE, "core:TargetTemperatureState"); + stateNames.put(CURRENT_TEMPERATURE, "zwave:SetPointHeatingValueState"); + stateNames.put(BATTERY_LEVEL, "core:BatteryLevelState"); + stateNames.put(CURRENT_STATE, "zwave:SetPointTypeState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { if (TARGET_TEMPERATURE.equals(channelUID.getId())) { String param = "[" + command.toString() + "]"; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaInternalAlarmHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaInternalAlarmHandler.java index 1d71f76b069bd..4445a8ef84c77 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaInternalAlarmHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaInternalAlarmHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,18 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.StringType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaInternalAlarmHandler} is responsible for handling commands, @@ -34,30 +29,21 @@ @NonNullByDefault public class SomfyTahomaInternalAlarmHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaInternalAlarmHandler.class); - public SomfyTahomaInternalAlarmHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() { - { - put(ALARM_STATE, "internal:CurrentAlarmModeState"); - put(TARGET_ALARM_STATE, "internal:TargetAlarmModeState"); - put(INTRUSION_STATE, "internal:IntrusionDetectedState"); - } - }; + stateNames.put(ALARM_STATE, "internal:CurrentAlarmModeState"); + stateNames.put(TARGET_ALARM_STATE, "internal:TargetAlarmModeState"); + stateNames.put(INTRUSION_STATE, "internal:IntrusionDetectedState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (ALARM_COMMAND.equals(channelUID.getId()) && command instanceof StringType) { - sendCommand(command.toString(), "[]"); + sendCommand(command.toString()); } if (INTRUSION_CONTROL.equals(channelUID.getId()) && command instanceof StringType) { sendCommand("setIntrusionDetected", "[\"" + command.toString() + "\"]"); } - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaLightSensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaLightSensorHandler.java index deffc65f76903..3a26903232e12 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaLightSensorHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaLightSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.handler; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.LUMINANCE; -import java.util.HashMap; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Thing; /** * The {@link SomfyTahomaLightSensorHandler} is responsible for handling commands, @@ -33,24 +26,8 @@ @NonNullByDefault public class SomfyTahomaLightSensorHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaLightSensorHandler.class); - public SomfyTahomaLightSensorHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(LUMINANCE, "core:LuminanceState"); - }}; - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (!LUMINANCE.equals(channelUID.getId())) { - return; - } - - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } + stateNames.put(LUMINANCE, "core:LuminanceState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOccupancySensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOccupancySensorHandler.java index 2dcce4a701a88..acf5ca5f6fec3 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOccupancySensorHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOccupancySensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.handler; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.Thing; - import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.CONTACT; -import java.util.HashMap; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Thing; /** * The {@link SomfyTahomaOccupancySensorHandler} is responsible for handling commands, @@ -30,9 +28,7 @@ public class SomfyTahomaOccupancySensorHandler extends SomfyTahomaContactSensorH public SomfyTahomaOccupancySensorHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTACT, "core:OccupancyState"); - }}; + stateNames.put(CONTACT, "core:OccupancyState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHandler.java index d7b6b7f8feada..4a1860be6f0bd 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,19 +12,14 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.SWITCH; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; import org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.SWITCH; - -import java.util.HashMap; /** * The {@link SomfyTahomaOnOffHandler} is responsible for handling commands, @@ -35,23 +30,16 @@ @NonNullByDefault public class SomfyTahomaOnOffHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaOnOffHandler.class); - public SomfyTahomaOnOffHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(SWITCH, "core:OnOffState"); - }}; + stateNames.put(SWITCH, "core:OnOffState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (SomfyTahomaBindingConstants.SWITCH.equals(channelUID.getId()) && command instanceof OnOffType) { - sendCommand(command.toString().toLowerCase(), "[]"); - } - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + sendCommand(command.toString().toLowerCase()); } } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHeatingSystemHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHeatingSystemHandler.java index fdcf0716192d1..bffbba79483a1 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHeatingSystemHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaOnOffHeatingSystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,14 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.COMMAND_SET_HEATINGLEVEL; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.TARGET_HEATING_LEVEL; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaOnOffHeatingSystemHandler} is responsible for handling commands, @@ -33,22 +30,16 @@ @NonNullByDefault public class SomfyTahomaOnOffHeatingSystemHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaOnOffHeatingSystemHandler.class); - public SomfyTahomaOnOffHeatingSystemHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() { - { - put(TARGET_HEATING_LEVEL, "io:TargetHeatingLevelState"); - } - }; + stateNames.put(TARGET_HEATING_LEVEL, "io:TargetHeatingLevelState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { if (TARGET_HEATING_LEVEL.equals(channelUID.getId())) { String param = "[\"" + command.toString() + "\"]"; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPergolaHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPergolaHandler.java index 6d8efe983d0d4..68464b87b4d6a 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPergolaHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPergolaHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,13 +12,11 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.CONTROL; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.Thing; -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; - /** * The {@link SomfyTahomaPergolaHandler} is responsible for handling commands, * which are sent to one of the channels of the pergola thing. @@ -30,8 +28,6 @@ public class SomfyTahomaPergolaHandler extends SomfyTahomaAwningHandler { public SomfyTahomaPergolaHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTROL, "core:TargetClosureState"); - }}; + stateNames.put(CONTROL, "core:TargetClosureState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPodHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPodHandler.java index 65d16b83e656b..1271b61ad0f6c 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPodHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaPodHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,15 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; /** * The {@link SomfyTahomaPodHandler} is responsible for handling commands, @@ -31,24 +26,10 @@ @NonNullByDefault public class SomfyTahomaPodHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaPodHandler.class); - public SomfyTahomaPodHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() { - { - put("cyclic_button_state", "core:CyclicButtonState"); - put("battery_status_state", "internal:BatteryStatusState"); - put("lighting_led_pod_mod_state", "internal:LightingLedPodModeState"); - } - }; - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } + stateNames.put(CYCLIC_BUTTON, CYCLIC_BUTTON_STATE); + stateNames.put(BATTERY_STATUS, BATTERY_STATUS_STATE); + stateNames.put(LIGHTING_LED_POD_MODE, "internal:LightingLedPodModeState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java index 913bc46123a4b..9e4c2c1106e79 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaRollerShutterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaRollerShutterHandler} is responsible for handling commands, @@ -34,24 +30,20 @@ @NonNullByDefault public class SomfyTahomaRollerShutterHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaRollerShutterHandler.class); - public SomfyTahomaRollerShutterHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTROL, "core:ClosureState"); - }}; + stateNames.put(CONTROL, "core:ClosureState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (!CONTROL.equals(channelUID.getId())) { return; } if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { String cmd = getTahomaCommand(command.toString()); if (COMMAND_MY.equals(cmd)) { @@ -60,7 +52,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { //Check if the roller shutter is moving and MY is sent => STOP it cancelExecution(executionId); } else { - sendCommand(COMMAND_MY, "[]"); + sendCommand(COMMAND_MY); } } else { String param = COMMAND_SET_CLOSURE.equals(cmd) ? "[" + command.toString() + "]" : "[]"; @@ -69,14 +61,17 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } - private String getTahomaCommand(String command) { + protected String getTahomaCommand(String command) { switch (command) { case "OFF": case "DOWN": + case "CLOSE": return COMMAND_DOWN; case "ON": case "UP": + case "OPEN": return COMMAND_UP; + case "MY": case "STOP": return COMMAND_MY; default: diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSilentRollerShutterHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSilentRollerShutterHandler.java index 7434c010505b0..125e177e51017 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSilentRollerShutterHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSilentRollerShutterHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaSilentRollerShutterHandler} is responsible for handling commands, @@ -33,25 +29,21 @@ @NonNullByDefault public class SomfyTahomaSilentRollerShutterHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaSilentRollerShutterHandler.class); - public SomfyTahomaSilentRollerShutterHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTROL_SILENT, "core:ClosureState"); - put(CONTROL, "core:ClosureState"); - }}; + stateNames.put(CONTROL_SILENT, "core:ClosureState"); + stateNames.put(CONTROL, "core:ClosureState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (!CONTROL.equals(channelUID.getId()) && !channelUID.getId().equals(CONTROL_SILENT)) { return; } if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { String cmd = getTahomaCommand(command.toString()); if (COMMAND_MY.equals(cmd)) { @@ -60,7 +52,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { //Check if the roller shutter is moving and MY is sent => STOP it cancelExecution(executionId); } else { - sendCommand(COMMAND_MY, "[]"); + sendCommand(COMMAND_MY); } } else { if (CONTROL_SILENT.equals(channelUID.getId()) && COMMAND_SET_CLOSURE.equals(cmd)) { diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSirenHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSirenHandler.java new file mode 100644 index 0000000000000..abbd274fb32dd --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSirenHandler.java @@ -0,0 +1,59 @@ +/** + * 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.somfytahoma.internal.handler; + +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; + +/** + * The {@link SomfyTahomaSirenHandler} is responsible for handling commands, + * which are sent to one of the channels of the siren thing. + * + * @author Ondrej Pecta - Initial contribution + */ +@NonNullByDefault +public class SomfyTahomaSirenHandler extends SomfyTahomaBaseThingHandler { + + public SomfyTahomaSirenHandler(Thing thing) { + super(thing); + stateNames.put(BATTERY, "core:BatteryState"); + stateNames.put(ONOFF_STATE, "core:OnOffState"); + stateNames.put(MEMORIZED_VOLUME, "io:MemorizedSimpleVolumeState"); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + if (RefreshType.REFRESH.equals(command)) { + return; + } + + //it is possible only to disable the siren + if (ONOFF_STATE.equals(channelUID.getId()) && command.equals(OnOffType.OFF)) { + sendCommand(COMMAND_OFF); + } + + // highest or normal memorized volume + if (MEMORIZED_VOLUME.equals(channelUID.getId()) && command instanceof StringType) { + sendCommand("setMemorizedSimpleVolume", "[\"" + command.toString().toLowerCase() + "\"]"); + } + + } +} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSmokeSensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSmokeSensorHandler.java index 46aff5ef3c12a..720747d20b0d9 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSmokeSensorHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaSmokeSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,12 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.CONTACT; - -import java.util.HashMap; +import org.eclipse.smarthome.core.types.Command; /** * The {@link SomfyTahomaSmokeSensorHandler} is responsible for handling commands, @@ -30,8 +31,17 @@ public class SomfyTahomaSmokeSensorHandler extends SomfyTahomaContactSensorHandl public SomfyTahomaSmokeSensorHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTACT, "core:SmokeState"); - }}; + stateNames.put(CONTACT, "core:SmokeState"); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + super.handleCommand(channelUID, command); + if (OnOffType.ON.equals(command)) { + if (ALARM_CHECK.equals(channelUID.getId())) { + sendCommand(COMMAND_CHECK_TRIGGER, "[\"" + command.toString().toLowerCase() + "\"]"); + } + } } } + diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaTemperatureSensorHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaTemperatureSensorHandler.java index b204af52b48dd..865639ed1860a 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaTemperatureSensorHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaTemperatureSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,11 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.TEMPERATURE; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.TYPE_DECIMAL; + import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaTemperatureSensorHandler} is responsible for handling commands, @@ -33,26 +27,11 @@ @NonNullByDefault public class SomfyTahomaTemperatureSensorHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaTemperatureSensorHandler.class); - public SomfyTahomaTemperatureSensorHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(TEMPERATURE, "core:TemperatureState"); - }}; + stateNames.put(TEMPERATURE, "core:TemperatureState"); + //override state type because the cloud sends both percent & decimal cacheStateType("core:TemperatureState", TYPE_DECIMAL); } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (!TEMPERATURE.equals(channelUID.getId())) { - return; - } - - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } - } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaVenetianBlindHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaVenetianBlindHandler.java index 981415bacc6a0..27294fc7c3dae 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaVenetianBlindHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaVenetianBlindHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; - -import java.util.HashMap; /** * The {@link SomfyTahomaVenetianBlindHandler} is responsible for handling commands, @@ -33,25 +29,21 @@ @NonNullByDefault public class SomfyTahomaVenetianBlindHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaVenetianBlindHandler.class); - public SomfyTahomaVenetianBlindHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(CONTROL, "core:ClosureState"); - put(ORIENTATION, "core:SlateOrientationState"); - }}; + stateNames.put(CONTROL, "core:ClosureState"); + stateNames.put(ORIENTATION, "core:SlateOrientationState"); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (!CONTROL.equals(channelUID.getId()) && !ORIENTATION.equals(channelUID.getId())) { return; } if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { String cmd = getTahomaCommand(command.toString(), channelUID.getId()); if (COMMAND_MY.equals(cmd)) { @@ -60,7 +52,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { //Check if the venetian blind is moving and MY is sent => STOP it cancelExecution(executionId); } else { - sendCommand(COMMAND_MY, "[]"); + sendCommand(COMMAND_MY); } } else { String param = (COMMAND_SET_CLOSURE.equals(cmd) || COMMAND_SET_ORIENTATION.equals(cmd)) ? "[" + command.toString() + "]" : "[]"; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandleHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandleHandler.java index 01edf143dd243..7ff51997d20e6 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandleHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandleHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,17 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.handler; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.HANDLE_STATE; -import java.util.HashMap; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.Thing; /** * The {@link SomfyTahomaWindowHandleHandler} is responsible for handling commands, @@ -33,24 +26,8 @@ @NonNullByDefault public class SomfyTahomaWindowHandleHandler extends SomfyTahomaBaseThingHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaWindowHandleHandler.class); - public SomfyTahomaWindowHandleHandler(Thing thing) { super(thing); - stateNames = new HashMap<String, String>() {{ - put(HANDLE_STATE, "core:ThreeWayHandleDirectionState"); - }}; - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); - if (!HANDLE_STATE.equals(channelUID.getId())) { - return; - } - - if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); - } + stateNames.put(HANDLE_STATE, "core:ThreeWayHandleDirectionState"); } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandler.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandler.java index 6f3180b6d72e9..0c1432ad197fa 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandler.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/handler/SomfyTahomaWindowHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,15 +12,13 @@ */ package org.openhab.binding.somfytahoma.internal.handler; +import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; + import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.openhab.binding.somfytahoma.internal.SomfyTahomaBindingConstants.*; /** * The {@link SomfyTahomaWindowHandler} is responsible for handling commands, @@ -31,21 +29,19 @@ @NonNullByDefault public class SomfyTahomaWindowHandler extends SomfyTahomaRollerShutterHandler { - private final Logger logger = LoggerFactory.getLogger(SomfyTahomaWindowHandler.class); - public SomfyTahomaWindowHandler(Thing thing) { super(thing); } @Override public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("Received command {} for channel {}", command, channelUID); + super.handleCommand(channelUID, command); if (!CONTROL.equals(channelUID.getId())) { return; } if (RefreshType.REFRESH.equals(command)) { - updateChannelState(channelUID); + return; } else { String cmd = getTahomaCommand(command.toString()); if (COMMAND_STOP.equals(cmd)) { @@ -63,13 +59,16 @@ public void handleCommand(ChannelUID channelUID, Command command) { } } - private String getTahomaCommand(String command) { + @Override + protected String getTahomaCommand(String command) { switch (command) { case "OFF": case "DOWN": + case "CLOSE": return COMMAND_CLOSE; case "ON": case "UP": + case "OPEN": return COMMAND_OPEN; case "STOP": return COMMAND_STOP; diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaAction.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaAction.java index 57db379fed05e..a42b84612c2ae 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaAction.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaAction} holds information about a list of * commands for one concrete device. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroup.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroup.java index 49d0e1186a5f8..df8515a039a5a 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroup.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaActionGroup} holds information about a action * group and current actions. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroupResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroupResponse.java deleted file mode 100644 index a2d50f720cc76..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaActionGroupResponse.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -import java.util.ArrayList; - -/** - * The {@link SomfyTahomaActionGroupResponse} holds information about response - * to getting action groups command. - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaActionGroupResponse { - private ArrayList<SomfyTahomaActionGroup> actionGroups = new ArrayList<>(); - - public ArrayList<SomfyTahomaActionGroup> getActionGroups() { - return actionGroups; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaApplyResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaApplyResponse.java index 1c7b7a0f00993..0d3747179a897 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaApplyResponse.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaApplyResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaCommand.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaCommand.java index 4535d04d47d47..68593a35db4b1 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaCommand.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaCommand} holds information about a roller shutter * command and command's parameters. @@ -47,7 +47,7 @@ public ArrayList<Object> getParameters() { public ArrayList<Integer> getPercentParameters() { ArrayList<Integer> newList = new ArrayList<>(parameters.size()); - for( Object o : parameters) { + for (Object o : parameters) { Double val = (Double) o; newList.add(val.intValue()); } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDevice.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDevice.java index fa45c47ba7beb..cc6f2b8d2a157 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDevice.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaDevice} holds information about a device bound * to TahomaLink account. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinition.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinition.java index 739891075b078..4da70de8d1a53 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinition.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaDeviceDefinition} holds information about a device definition. * @@ -34,7 +34,7 @@ public ArrayList<SomfyTahomaDeviceDefinitionCommand> getCommands() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{ "); - for( SomfyTahomaDeviceDefinitionCommand cmd: commands) { + for (SomfyTahomaDeviceDefinitionCommand cmd : commands) { sb.append(cmd.toString()).append("; "); } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinitionCommand.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinitionCommand.java index 6d558c57f8f68..56b5088785642 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinitionCommand.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceDefinitionCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceWithState.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceWithState.java deleted file mode 100644 index 153be8545cf3e..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaDeviceWithState.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -import java.util.ArrayList; - -/** - * The {@link SomfyTahomaDeviceWithState} holds information about a device - * with state bound to TahomaLink account. - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaDeviceWithState { - - private ArrayList<SomfyTahomaState> states = new ArrayList<>(); - - public boolean hasStates() { - return states.size() > 0; - } - - public ArrayList<SomfyTahomaState> getStates() { - return states; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaEvent.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaEvent.java index fe69bd7692d15..3ece44376b2d8 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaEvent.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,12 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaEvent} holds information about Tahoma * event. @@ -26,7 +28,11 @@ public class SomfyTahomaEvent { private String name = ""; private String deviceURL = ""; + private String newState = ""; + private String execId = ""; + private String gatewayId = ""; private ArrayList<SomfyTahomaState> deviceStates = new ArrayList<>(); + private JsonElement action = new JsonObject(); public String getName() { return name; @@ -36,7 +42,23 @@ public String getDeviceUrl() { return deviceURL; } + public String getGatewayId() { + return gatewayId; + } + + public String getNewState() { + return newState; + } + + public String getExecId() { + return execId; + } + public ArrayList<SomfyTahomaState> getDeviceStates() { return deviceStates; } + + public JsonElement getAction() { + return action; + } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecution.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecution.java deleted file mode 100644 index ae71a8b4196b1..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecution.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -/** - * The {@link SomfyTahomaExecution} holds information about currently - * running execution (moving device). - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaExecution { - - private String id = ""; - private SomfyTahomaActionGroup actionGroup = new SomfyTahomaActionGroup(); - - public String getId() { - return id; - } - - public SomfyTahomaActionGroup getActionGroup() { - return actionGroup; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecutionsResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecutionsResponse.java deleted file mode 100644 index dc0f33fe95019..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaExecutionsResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -import java.util.ArrayList; - -/** - * The {@link SomfyTahomaExecutionsResponse} holds information about response - * to getting running executions command (moving devices). - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaExecutionsResponse { - - private ArrayList<SomfyTahomaExecution> executions = new ArrayList<>(); - - public ArrayList<SomfyTahomaExecution> getExecutions() { - return executions; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGateway.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGateway.java index 0ca4ce43abe96..47bc7d4c44573 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGateway.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGateway.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,14 +17,20 @@ /** * The {@link SomfyTahomaGateway} holds information about a gateway bound * to TahomaLink account. + * * @author Ondrej Pecta - Initial contribution */ @NonNullByDefault public class SomfyTahomaGateway { private String gatewayId = ""; + private int type; public String getGatewayId() { return gatewayId; } + + public int getType() { + return type; + } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGetEventsResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGetEventsResponse.java deleted file mode 100644 index d8a0e7fa9b0b3..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaGetEventsResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -import java.util.Collection; -import java.util.Collections; - -/** - * The {@link SomfyTahomaGetEventsResponse} holds information about response to getEvents - * command of your TahomaLink account. - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaGetEventsResponse { - - Collection<SomfyTahomaEvent> events = Collections.emptyList(); - - public Collection<SomfyTahomaEvent> getEvents() { - return events; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaLoginResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaLoginResponse.java index d7772046d223d..45ced014bb225 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaLoginResponse.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaLoginResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaVersionResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaRegisterEventsResponse.java similarity index 61% rename from bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaVersionResponse.java rename to bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaRegisterEventsResponse.java index 050f79115c907..dc15a95f78282 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaVersionResponse.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaRegisterEventsResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,17 +15,17 @@ import org.eclipse.jdt.annotation.NonNullByDefault; /** - * The {@link SomfyTahomaVersionResponse} holds information about - * response to getting gateway's firmware version. + * The {@link SomfyTahomaRegisterEventsResponse} holds information about register events + * response to your TahomaLink account. * * @author Ondrej Pecta - Initial contribution */ @NonNullByDefault -public class SomfyTahomaVersionResponse { +public class SomfyTahomaRegisterEventsResponse { - private String result = ""; + private String id = ""; - public String getResult() { - return result; + public String getId() { + return id; } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetup.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetup.java index 131b909f4bc25..86b914baed374 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetup.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,10 +12,10 @@ */ package org.openhab.binding.somfytahoma.internal.model; -import org.eclipse.jdt.annotation.NonNullByDefault; - import java.util.ArrayList; +import org.eclipse.jdt.annotation.NonNullByDefault; + /** * The {@link SomfyTahomaSetup} holds information about devices bound * to TahomaLink account. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetupResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetupResponse.java deleted file mode 100644 index f44d6cc387816..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaSetupResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -/** - * The {@link SomfyTahomaSetupResponse} holds information about - * response to getting devices setup command. - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaSetupResponse { - - private SomfyTahomaSetup setup = new SomfyTahomaSetup(); - - public SomfyTahomaSetup getSetup() { - return setup; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaState.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaState.java index 90c2d2ec856c7..477b03eccf190 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaState.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,6 +30,7 @@ public class SomfyTahomaState { public Object getValue() { return value; } + public int getType() { return type; } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatesResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatesResponse.java deleted file mode 100644 index 72b089ab048dc..0000000000000 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatesResponse.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.somfytahoma.internal.model; - -import org.eclipse.jdt.annotation.NonNullByDefault; - -import java.util.ArrayList; - -/** - * The {@link SomfyTahomaStatesResponse} holds information about - * response to getting device's states command. - * - * @author Ondrej Pecta - Initial contribution - */ -@NonNullByDefault -public class SomfyTahomaStatesResponse { - - private ArrayList<SomfyTahomaDeviceWithState> devices = new ArrayList<>(); - - public ArrayList<SomfyTahomaDeviceWithState> getDevices() { - return devices; - } -} diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatus.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatus.java index 0c7fc6216db6a..89b9264707b41 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatus.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,8 +24,13 @@ public class SomfyTahomaStatus { private String status = "N/A"; + private String protocolVersion = "N/A"; public String getStatus() { return status; } + + public String getProtocolVersion() { + return protocolVersion; + } } diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatusResponse.java b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatusResponse.java index b4381e82586ea..02e66d97b6f1c 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatusResponse.java +++ b/bundles/org.openhab.binding.somfytahoma/src/main/java/org/openhab/binding/somfytahoma/internal/model/SomfyTahomaStatusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/config/config.xml index f543765b27696..188f6a2c3dbf6 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/config/config.xml @@ -5,7 +5,7 @@ <config-description uri="thing-type:somfytahoma:device"> <parameter name="url" type="text"> - <label>Somfy Tahoma device URL</label> + <label>Somfy Tahoma Device URL</label> <description>The identifier of this Somfy device</description> <required>true</required> </parameter> @@ -13,7 +13,7 @@ <config-description uri="thing-type:somfytahoma:gateway"> <parameter name="id" type="text"> - <label>Somfy Tahoma gateway ID</label> + <label>Somfy Tahoma Gateway ID</label> <description>The identifier of this Somfy gateway</description> <required>true</required> </parameter> @@ -40,7 +40,7 @@ </parameter> <parameter name="statusTimeout" type="integer" required="false" min="60"> - <label>Status timeout</label> + <label>Status Timeout</label> <description>Specifies the timeout in seconds after which the status is got from Tahoma cloud</description> <default>300</default> </parameter> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/adjustableslatsrollershutter.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/adjustableslatsrollershutter.xml new file mode 100644 index 0000000000000..e6c89d7676bd6 --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/adjustableslatsrollershutter.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="adjustableslatsrollershutter"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge"/> + </supported-bridge-type-refs> + <label>Somfy AS Roller Shutter</label> + <description>Somfy Adjustable Slats Roller Shutter</description> + <channels> + <channel id="rocker" typeId="rocker"></channel> + <channel id="control" typeId="control"></channel> + <channel id="orientation" typeId="orientation"></channel> + </channels> + <config-description-ref uri="thing-type:somfytahoma:device"/> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/channels.xml index e23f87f86eec9..1ee849d54ac02 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/channels.xml @@ -22,12 +22,6 @@ <state max="100" min="0" step="1" pattern="%d %%" readOnly="false"/> </channel-type> - <channel-type id="switch"> - <item-type>Switch</item-type> - <label>Switch</label> - <description>An ON/OFF switch (zwave/enocean/rts)</description> - </channel-type> - <channel-type id="contact"> <item-type>Contact</item-type> <label>Contact</label> @@ -63,7 +57,7 @@ <state> <options> <option value="detected">DETECTED</option> - <option value="notdetected">NOT DETECTED</option> + <option value="notDetected">NOT DETECTED</option> <option value="pending">PENDING</option> <option value="sos">SOS</option> </options> @@ -91,21 +85,28 @@ <state readOnly="true"/> </channel-type> - <channel-type id="cyclic_button_state"> + <channel-type id="cyclic_button"> <item-type>String</item-type> <label>Cyclic Button State</label> <description>Cyclic Button State</description> <state readOnly="true"/> </channel-type> - <channel-type id="battery_status_state"> + <channel-type id="battery_status"> <item-type>String</item-type> <label>Battery Status State</label> <description>Battery Status State</description> <state readOnly="true"/> </channel-type> - <channel-type id="lighting_led_pod_mod_state"> + <channel-type id="battery"> + <item-type>String</item-type> + <label>Battery State</label> + <description>Battery Condition State (full, low, normal, verylow)</description> + <state readOnly="true"/> + </channel-type> + + <channel-type id="lighting_led_pod_mode"> <item-type>Number</item-type> <label>Lighting Led Pod Mod State</label> <description>Lighting Led Pod Mod State</description> @@ -193,4 +194,66 @@ <description>The temperature value of the sensor</description> <state pattern="%.1f %unit%" readOnly="true"/> </channel-type> + + <channel-type id="energy_consumption"> + <item-type>Number:Energy</item-type> + <label>Energy Consumption</label> + <description>The energy consumption reported by the sensor</description> + <state pattern="%.1f %unit%" readOnly="true" /> + </channel-type> + + <channel-type id="siren_status"> + <item-type>String</item-type> + <label>Siren Status State</label> + <description>A channel for controlling the dock's siren state</description> + <state> + <options> + <option value="on">ON</option> + <option value="off">OFF</option> + <option value="cyclic">CYCLIC</option> + </options> + </state> + </channel-type> + + <channel-type id="memorized_volume"> + <item-type>String</item-type> + <label>Memorized Volume</label> + <description>A channel used for controlling siren's volume state</description> + <state> + <options> + <option value="normal">NORMAL</option> + <option value="highest">HIGHEST</option> + </options> + </state> + </channel-type> + + <channel-type id="short_beep"> + <item-type>Switch</item-type> + <label>Dock Short Beep Test</label> + <description>A channel for testing the dock's short beeping</description> + </channel-type> + + <channel-type id="long_beep"> + <item-type>Switch</item-type> + <label>Dock Long Beep Test</label> + <description>A channel for testing the dock's long beeping</description> + </channel-type> + + <channel-type id="alarm_check"> + <item-type>String</item-type> + <label>Alarm Check Trigger</label> + <description>A channel for triggering the smoke sensor's check</description> + <command> + <options> + <option value="SHORT">Short check</option> + <option value="LONG">Long check</option> + </options> + </command> + </channel-type> + + <channel-type id="rocker"> + <item-type>Switch</item-type> + <label>Rocker Position</label> + <description>A channel for controlling the rocker position</description> + </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/curtain.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/curtain.xml new file mode 100644 index 0000000000000..c7aa762b873be --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/curtain.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="curtain"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge"/> + </supported-bridge-type-refs> + <label>Somfy Curtain</label> + <channels> + <channel id="control" typeId="control"></channel> + </channels> + <config-description-ref uri="thing-type:somfytahoma:device"/> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/dock.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/dock.xml new file mode 100644 index 0000000000000..18bf00f9b9752 --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/dock.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="dock"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + <label>Somfy Dock</label> + <channels> + <channel id="battery_status" typeId="battery_status"></channel> + <channel id="battery_level" typeId="system.battery-level"></channel> + <channel id="siren_status" typeId="siren_status"></channel> + <channel id="short_beep" typeId="short_beep"></channel> + <channel id="long_beep" typeId="long_beep"></channel> + </channels> + <config-description-ref uri="thing-type:somfytahoma:device"/> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/electricitysensor.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/electricitysensor.xml new file mode 100644 index 0000000000000..4377fe0fe907c --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/electricitysensor.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="electricitysensor"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge"/> + </supported-bridge-type-refs> + <label>Somfy Electricity Sensor</label> + <channels> + <channel id="energy_consumption" typeId="energy_consumption"></channel> + </channels> + <config-description-ref uri="thing-type:somfytahoma:device"/> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoff.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoff.xml index 128b7b9a33a4e..640ff52c563b9 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoff.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoff.xml @@ -9,7 +9,7 @@ </supported-bridge-type-refs> <label>Somfy On/Off Switch</label> <channels> - <channel id="switch" typeId="switch"></channel> + <channel id="switch" typeId="system.power"></channel> </channels> <config-description-ref uri="thing-type:somfytahoma:device"/> </thing-type> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoffheatingsystem.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoffheatingsystem.xml index 003fd91f2970d..c223b5e4377ba 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoffheatingsystem.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/onoffheatingsystem.xml @@ -7,7 +7,7 @@ <supported-bridge-type-refs> <bridge-type-ref id="bridge"/> </supported-bridge-type-refs> - <label>Somfy Heating System With On/Off</label> + <label>Somfy Heating System with On/Off</label> <channels> <channel id="target_heating_level" typeId="target_heating_level"></channel> </channels> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/pod.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/pod.xml index d42ec4578c3e9..2e7a7f52d7144 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/pod.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/pod.xml @@ -9,9 +9,9 @@ </supported-bridge-type-refs> <label>Somfy Pod</label> <channels> - <channel id="cyclic_button_state" typeId="cyclic_button_state"></channel> - <channel id="battery_status_state" typeId="battery_status_state"></channel> - <channel id="lighting_led_pod_mod_state" typeId="lighting_led_pod_mod_state"></channel> + <channel id="cyclic_button" typeId="cyclic_button"></channel> + <channel id="battery_status" typeId="battery_status"></channel> + <channel id="lighting_led_pod_mode" typeId="lighting_led_pod_mode"></channel> </channels> <config-description-ref uri="thing-type:somfytahoma:device"/> </thing-type> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/siren.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/siren.xml new file mode 100644 index 0000000000000..0e23c47d2503f --- /dev/null +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/siren.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="somfytahoma" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="siren"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + <label>Somfy Siren</label> + <channels> + <channel id="battery" typeId="battery"></channel> + <channel id="onoff" typeId="system.power"></channel> + <channel id="memorized_volume" typeId="memorized_volume"></channel> + </channels> + <config-description-ref uri="thing-type:somfytahoma:device"/> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/smokesensor.xml b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/smokesensor.xml index d549bee5d5d87..e5210dd02ce2d 100644 --- a/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/smokesensor.xml +++ b/bundles/org.openhab.binding.somfytahoma/src/main/resources/ESH-INF/thing/smokesensor.xml @@ -10,6 +10,7 @@ <label>Somfy Smoke Sensor</label> <channels> <channel id="contact" typeId="contact"></channel> + <channel id="alarm_check" typeId="alarm_check"></channel> </channels> <config-description-ref uri="thing-type:somfytahoma:device"/> </thing-type> diff --git a/bundles/org.openhab.binding.sonos/NOTICE b/bundles/org.openhab.binding.sonos/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.sonos/NOTICE +++ b/bundles/org.openhab.binding.sonos/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.sonos/README.md b/bundles/org.openhab.binding.sonos/README.md index 5a3158d4a85ee..ad6b2759c2012 100644 --- a/bundles/org.openhab.binding.sonos/README.md +++ b/bundles/org.openhab.binding.sonos/README.md @@ -1,10 +1,10 @@ # Sonos Binding -This binding integrates the [Sonos Multi-Room Audio system](http://www.sonos.com). +This binding integrates the [Sonos Multi-Room Audio system](https://www.sonos.com). **Attention:** You might run into trouble if your control system (the binding) is in another subnet than your Sonos device. -Sonos devices make use of multicast which in most cases needs additional router configuration outside of a single subnet. +Sonos devices make use of multicast which in most cases needs additional router configuration outside of a single subnet. If you observe communication errors (COMMUNICATION_ERROR/not registered), you might need to configure your router to increase the TTL of the packets send by your Sonos device. This happens because of a TTL=1 for ALIVE packets send by Sonos devices, resulting in dropped packets after one hop. @@ -14,7 +14,7 @@ All available Sonos (playback) devices are supported by this binding. This inclu When being defined in a \*.things file, the specific thing types One, PLAY1, PLAY3, PLAY5, PLAYBAR, PLAYBASE, Beam, CONNECT and CONNECTAMP should be used. -Please note that these thing types are case sensitive (you need to define them in upper case). +Please note that these thing types are case sensitive (you need to define them **exactly as stated above**). ## Discovery @@ -32,7 +32,7 @@ The binding has the following configuration options, which can be set for "bindi ## Thing Configuration The Sonos Thing requires the UPnP UDN (Unique Device Name) as a configuration value in order for the binding to know how to access it. -All the Sonos UDN have the "RINCON_000E58D8403A0XXXX" format. +All the Sonos UDN have the "RINCON_000E58D8403A0XXXX" format (value to be found via Sonos item in the Paper UI Inbox). Additionally, a refresh interval, used to poll the Sonos device, can be specified (in seconds). You can use the `notificationVolume` property for setting a default volume (in percent) to be used to play notifications. In the thing file, this looks e.g. like @@ -52,7 +52,7 @@ The devices support the following channels: | alarmproperties | String | R | Properties of the alarm currently running | all | | alarmrunning | Switch | R | Set to ON if the alarm was triggered | all | | clearqueue | Switch | W | Suppress all songs from the current queue | all | -| control | Player | RW | Control the Zone Player, e.g. start/stop/next/previous/ffward/rewind | all | +| control | Player | RW | Control the Zone Player, e.g. PLAY/PAUSE/NEXT/PREVIOUS | all | | coordinator | String | R | UDN of the coordinator for the current group | all | | currentalbum | String | R | Name of the album currently playing | all | | currentalbumart | Image | R | Cover art of the album currently playing | all | @@ -63,7 +63,7 @@ The devices support the following channels: | currenttrackuri | String | R | URI of the current track | all | | currenttransporturi | String | R | URI of the current AV transport | all | | favorite | String | W | Play the given favorite entry. The favorite entry has to be predefined in the Sonos Controller app | all | -| led | Switch | RW | Set or get the status of the white led on the front of the Zone Player | all | +| led | Switch | RW | Set or get the status of the white LED on the front of the Zone Player | all | | linein | Switch | R | Indicator set to ON when the line-in of the Zone Player is connected | PLAY5, CONNECT, CONNECTAMP, PLAYBASE | | localcoordinator | Switch | R | Indicator set to ON if the this Zone Player is the Zone Group Coordinator | all | | mute | Switch | RW | Set or get the mute state of the master volume of the Zone Player | all | diff --git a/bundles/org.openhab.binding.sonos/pom.xml b/bundles/org.openhab.binding.sonos/pom.xml index 0065895d84fa9..f54e8eecfdcb8 100644 --- a/bundles/org.openhab.binding.sonos/pom.xml +++ b/bundles/org.openhab.binding.sonos/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sonos</artifactId> diff --git a/bundles/org.openhab.binding.sonos/src/main/feature/feature.xml b/bundles/org.openhab.binding.sonos/src/main/feature/feature.xml index 121816b02c93d..28c262afc76d7 100644 --- a/bundles/org.openhab.binding.sonos/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sonos/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.sonos-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sonos" description="Sonos Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAlarm.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAlarm.java index 01ba0ad94c396..f73e61c05191f 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAlarm.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAlarm.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAudioSink.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAudioSink.java index 5936a7c4d1336..fa7e914a2480a 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAudioSink.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java index d2392aea66bb6..9c3d303c8f035 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosEntry.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosEntry.java index a7392090d2d2e..cbf4a5e8369ca 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosEntry.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosHandlerFactory.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosHandlerFactory.java index 362c224d4f8cc..281890d9d8bac 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosHandlerFactory.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.binding.sonos.internal; +import static org.openhab.binding.sonos.internal.SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS; import static org.openhab.binding.sonos.internal.config.ZonePlayerConfiguration.UDN; import java.util.Dictionary; @@ -25,6 +26,7 @@ import org.eclipse.smarthome.core.net.HttpServiceUtil; import org.eclipse.smarthome.core.net.NetworkAddressService; import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingRegistry; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; @@ -34,6 +36,7 @@ import org.openhab.binding.sonos.internal.handler.ZonePlayerHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; import org.slf4j.Logger; @@ -50,10 +53,13 @@ public class SonosHandlerFactory extends BaseThingHandlerFactory { private final Logger logger = LoggerFactory.getLogger(SonosHandlerFactory.class); - private UpnpIOService upnpIOService; - private AudioHTTPServer audioHTTPServer; - private NetworkAddressService networkAddressService; - private SonosStateDescriptionOptionProvider stateDescriptionProvider; + // Bindings should not use the ThingRegistry! See https://github.com/openhab/openhab-addons/pull/6080 and + // https://github.com/eclipse/smarthome/issues/5182 + private final ThingRegistry thingRegistry; + private final UpnpIOService upnpIOService; + private final AudioHTTPServer audioHTTPServer; + private final NetworkAddressService networkAddressService; + private final SonosStateDescriptionOptionProvider stateDescriptionProvider; private final Map<String, ServiceRegistration<AudioSink>> audioSinkRegistrations = new ConcurrentHashMap<>(); @@ -63,6 +69,18 @@ public class SonosHandlerFactory extends BaseThingHandlerFactory { // url (scheme+server+port) to use for playing notification sounds private String callbackUrl = null; + @Activate + public SonosHandlerFactory(final @Reference ThingRegistry thingRegistry, + final @Reference UpnpIOService upnpIOService, final @Reference AudioHTTPServer audioHTTPServer, + final @Reference NetworkAddressService networkAddressService, + final @Reference SonosStateDescriptionOptionProvider stateDescriptionProvider) { + this.thingRegistry = thingRegistry; + this.upnpIOService = upnpIOService; + this.audioHTTPServer = audioHTTPServer; + this.networkAddressService = networkAddressService; + this.stateDescriptionProvider = stateDescriptionProvider; + } + @Override protected void activate(ComponentContext componentContext) { super.activate(componentContext); @@ -74,7 +92,7 @@ protected void activate(ComponentContext componentContext) { @Override public Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration, ThingUID thingUID, ThingUID bridgeUID) { - if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) { + if (SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) { ThingUID sonosDeviceUID = getPlayerUID(thingTypeUID, thingUID, configuration); logger.debug("Creating a sonos thing with ID '{}'", sonosDeviceUID); return super.createThing(thingTypeUID, configuration, sonosDeviceUID, null); @@ -85,18 +103,19 @@ public Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration, @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { - return SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); } @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); - if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) { + if (SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID)) { logger.debug("Creating a ZonePlayerHandler for thing '{}' with UDN '{}'", thing.getUID(), thing.getConfiguration().get(UDN)); - ZonePlayerHandler handler = new ZonePlayerHandler(thing, upnpIOService, opmlUrl, stateDescriptionProvider); + ZonePlayerHandler handler = new ZonePlayerHandler(thingRegistry, thing, upnpIOService, opmlUrl, + stateDescriptionProvider); // register the speaker as an audio sink String callbackUrl = createCallbackUrl(); @@ -150,39 +169,4 @@ private ThingUID getPlayerUID(ThingTypeUID thingTypeUID, ThingUID thingUID, Conf } } - @Reference - protected void setUpnpIOService(UpnpIOService upnpIOService) { - this.upnpIOService = upnpIOService; - } - - protected void unsetUpnpIOService(UpnpIOService upnpIOService) { - this.upnpIOService = null; - } - - @Reference - protected void setAudioHTTPServer(AudioHTTPServer audioHTTPServer) { - this.audioHTTPServer = audioHTTPServer; - } - - protected void unsetAudioHTTPServer(AudioHTTPServer audioHTTPServer) { - this.audioHTTPServer = null; - } - - @Reference - protected void setNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = networkAddressService; - } - - protected void unsetNetworkAddressService(NetworkAddressService networkAddressService) { - this.networkAddressService = null; - } - - @Reference - protected void setDynamicStateDescriptionProvider(SonosStateDescriptionOptionProvider stateDescriptionProvider) { - this.stateDescriptionProvider = stateDescriptionProvider; - } - - protected void unsetDynamicStateDescriptionProvider(SonosStateDescriptionOptionProvider stateDescriptionProvider) { - this.stateDescriptionProvider = null; - } } diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMetaData.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMetaData.java index 9c8420dd0a2c3..303b1061197c8 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMetaData.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMetaData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMusicService.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMusicService.java index ab0ae6cfb232b..a2cd20c807eab 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMusicService.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosMusicService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosResourceMetaData.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosResourceMetaData.java index b887dab2c30ea..3e4e5f7b2f4b9 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosResourceMetaData.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosResourceMetaData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosStateDescriptionOptionProvider.java index 6015e4ca46de9..5cf87df6bcee4 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosStateDescriptionOptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosXMLParser.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosXMLParser.java index c9cf4003bd298..809e26ee17e94 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosXMLParser.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosXMLParser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZoneGroup.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZoneGroup.java index 3d63fc41e3c13..3123552cb4ab5 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZoneGroup.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZoneGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZonePlayerState.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZonePlayerState.java index e0c9a5596b41f..58608a387f346 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZonePlayerState.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/SonosZonePlayerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/config/ZonePlayerConfiguration.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/config/ZonePlayerConfiguration.java index 9704fd7ff116e..4ae618a4744f8 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/config/ZonePlayerConfiguration.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/config/ZonePlayerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java index 59e0190c4f40d..097a3fea3b20d 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/discovery/ZonePlayerDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -78,10 +78,18 @@ public ThingUID getThingUID(RemoteDevice device) { if (device.getDetails().getManufacturerDetails().getManufacturer() != null) { if (device.getDetails().getManufacturerDetails().getManufacturer().toUpperCase().contains("SONOS")) { String modelName = getModelName(device); - if (modelName.equals("ZP80")) { - modelName = "CONNECT"; - } else if (modelName.equals("ZP100")) { - modelName = "CONNECTAMP"; + switch (modelName) { + case "ZP80": + modelName = "CONNECT"; + break; + case "ZP100": + modelName = "CONNECTAMP"; + break; + case "One SL": + modelName = "One"; + break; + default: + break; } ThingTypeUID thingUID = new ThingTypeUID(SonosBindingConstants.BINDING_ID, modelName); if (!SonosBindingConstants.SUPPORTED_KNOWN_THING_TYPES_UIDS.contains(thingUID)) { diff --git a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java index d2801637baee1..6a63eb1222be9 100644 --- a/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java +++ b/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler/ZonePlayerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -46,6 +46,7 @@ import org.eclipse.smarthome.core.library.types.UpDownType; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingRegistry; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.ThingTypeUID; @@ -78,7 +79,6 @@ * sent to one of the channels. * * @author Karel Goderis - Initial contribution - * */ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOParticipant { @@ -100,6 +100,7 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici private static final String STATE_PAUSED_PLAYBACK = "PAUSED_PLAYBACK"; private static final String STATE_STOPPED = "STOPPED"; + private final ThingRegistry localThingRegistry; private UpnpIOService service; private ScheduledFuture<?> pollingJob; private SonosZonePlayerState savedState = null; @@ -143,7 +144,7 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici private final Object stateLock = new Object(); - private SonosStateDescriptionOptionProvider stateDescriptionProvider; + private final SonosStateDescriptionOptionProvider stateDescriptionProvider; private final Runnable pollingRunnable = () -> { try { @@ -180,9 +181,10 @@ public class ZonePlayerHandler extends BaseThingHandler implements UpnpIOPartici private final String opmlUrl; - public ZonePlayerHandler(Thing thing, UpnpIOService upnpIOService, String opmlUrl, + public ZonePlayerHandler(ThingRegistry thingRegistry, Thing thing, UpnpIOService upnpIOService, String opmlUrl, SonosStateDescriptionOptionProvider stateDescriptionProvider) { super(thing); + this.localThingRegistry = thingRegistry; this.opmlUrl = opmlUrl; logger.debug("Creating a ZonePlayerHandler for thing '{}'", getThing().getUID()); if (upnpIOService != null) { @@ -349,8 +351,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { } private void restoreAllPlayerState() { - Collection<Thing> allThings = thingRegistry.getAll(); - for (Thing aThing : allThings) { + for (Thing aThing : localThingRegistry.getAll()) { if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(aThing.getThingTypeUID())) { ZonePlayerHandler handler = (ZonePlayerHandler) aThing.getHandler(); if (handler != null) { @@ -361,8 +362,7 @@ private void restoreAllPlayerState() { } private void saveAllPlayerState() { - Collection<Thing> allThings = thingRegistry.getAll(); - for (Thing aThing : allThings) { + for (Thing aThing : localThingRegistry.getAll()) { if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(aThing.getThingTypeUID())) { ZonePlayerHandler handler = (ZonePlayerHandler) aThing.getHandler(); if (handler != null) { @@ -1034,7 +1034,7 @@ else if (isPlayingStream(currentURI) || isPlayingRadioStartedByAmazonEcho(curren try { response = HttpUtil.executeUrl("GET", url, SOCKET_TIMEOUT); } catch (IOException e) { - logger.debug("Request to device failed: {}", e); + logger.debug("Request to device failed", e); } if (response != null) { @@ -1157,6 +1157,10 @@ public String getCurrentURI() { return stateMap.get("CurrentURI"); } + public String getCurrentURIMetadataAsString() { + return stateMap.get("CurrentURIMetaData"); + } + public SonosMetaData getCurrentURIMetadata() { if (stateMap.get("CurrentURIMetaData") != null && !stateMap.get("CurrentURIMetaData").isEmpty()) { return SonosXMLParser.getMetaDataFromXML(stateMap.get("CurrentURIMetaData")); @@ -1654,6 +1658,7 @@ public void setCurrentURI(SonosEntry newEntry) { public void setCurrentURI(String URI, String URIMetaData) { if (URI != null && URIMetaData != null) { + logger.debug("setCurrentURI URI {} URIMetaData {}", URI, URIMetaData); Map<String, String> inputs = new HashMap<String, String>(); try { @@ -1971,19 +1976,16 @@ protected List<String> getOtherZoneGroupMembers() { } protected ZonePlayerHandler getHandlerByName(String remotePlayerName) throws IllegalStateException { - if (thingRegistry != null) { - for (ThingTypeUID supportedThingType : SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS) { - Thing thing = thingRegistry.get(new ThingUID(supportedThingType, remotePlayerName)); - if (thing != null) { - return (ZonePlayerHandler) thing.getHandler(); - } + for (ThingTypeUID supportedThingType : SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS) { + Thing thing = localThingRegistry.get(new ThingUID(supportedThingType, remotePlayerName)); + if (thing != null) { + return (ZonePlayerHandler) thing.getHandler(); } - Collection<Thing> allThings = thingRegistry.getAll(); - for (Thing aThing : allThings) { - if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(aThing.getThingTypeUID()) - && aThing.getConfiguration().get(ZonePlayerConfiguration.UDN).equals(remotePlayerName)) { - return (ZonePlayerHandler) aThing.getHandler(); - } + } + for (Thing aThing : localThingRegistry.getAll()) { + if (SonosBindingConstants.SUPPORTED_THING_TYPES_UIDS.contains(aThing.getThingTypeUID()) + && aThing.getConfiguration().get(ZonePlayerConfiguration.UDN).equals(remotePlayerName)) { + return (ZonePlayerHandler) aThing.getHandler(); } } throw new IllegalStateException("Could not find handler for " + remotePlayerName); @@ -2304,6 +2306,8 @@ public void playNotificationSoundURI(Command notificationURL) { ZonePlayerHandler coordinator = getCoordinatorHandler(); String currentURI = coordinator.getCurrentURI(); + logger.debug("playNotificationSoundURI: currentURI {} metadata {}", currentURI, + coordinator.getCurrentURIMetadataAsString()); if (isPlayingStream(currentURI) || isPlayingRadioStartedByAmazonEcho(currentURI) || isPlayingRadio(currentURI)) { @@ -2311,7 +2315,7 @@ public void playNotificationSoundURI(Command notificationURL) { } else if (isPlayingLineIn(currentURI)) { handleLineIn(currentURI, notificationURL, coordinator); } else if (isPlayingQueue(currentURI)) { - handleSharedQueue(notificationURL, coordinator); + handleSharedQueue(currentURI, notificationURL, coordinator); } else if (isPlaylistEmpty(coordinator)) { handleEmptyQueue(notificationURL, coordinator); } @@ -2360,8 +2364,21 @@ private boolean isPlayingLineIn(String currentURI) { if (currentURI == null) { return false; } - return currentURI.contains(ANALOG_LINE_IN_URI) - || (currentURI.startsWith(OPTICAL_LINE_IN_URI) && currentURI.endsWith(SPDIF)); + return isPlayingAnalogLineIn(currentURI) || isPlayingOpticalLineIn(currentURI); + } + + private boolean isPlayingAnalogLineIn(String currentURI) { + if (currentURI == null) { + return false; + } + return currentURI.contains(ANALOG_LINE_IN_URI); + } + + private boolean isPlayingOpticalLineIn(String currentURI) { + if (currentURI == null) { + return false; + } + return currentURI.startsWith(OPTICAL_LINE_IN_URI) && currentURI.endsWith(SPDIF); } /** @@ -2412,19 +2429,23 @@ private void handleLineIn(String currentLineInURI, Command notificationURL, Zone * {@link ZonePlayerHandler#playNotificationSoundURI(Command)} in case * shared queue is currently loaded * + * @param currentQueueURI - the currently loaded queue URI * @param notificationURL - the notification url in the format of //host/folder/filename.mp3 * @param coordinator - {@link ZonePlayerHandler} coordinator for the SONOS device(s) */ - private void handleSharedQueue(Command notificationURL, ZonePlayerHandler coordinator) { + private void handleSharedQueue(String currentQueueURI, Command notificationURL, ZonePlayerHandler coordinator) { String nextAction = coordinator.getTransportState(); String trackPosition = coordinator.getPosition(); long currentTrackNumber = coordinator.getCurrenTrackNr(); + logger.debug("handleSharedQueue: currentQueueURI {} trackPosition {} currentTrackNumber {}", currentQueueURI, + trackPosition, currentTrackNumber); handleNotificationSound(notificationURL, coordinator); - coordinator.setPositionTrack(currentTrackNumber); - coordinator.setPosition(trackPosition); - - restoreLastTransportState(coordinator, nextAction); + if (currentQueueURI.equals(QUEUE_URI + coordinator.getUDN() + "#0")) { + coordinator.setPositionTrack(currentTrackNumber); + coordinator.setPosition(trackPosition); + restoreLastTransportState(coordinator, nextAction); + } } /** @@ -2434,14 +2455,22 @@ private void handleSharedQueue(Command notificationURL, ZonePlayerHandler coordi * @param coordinator - {@link ZonePlayerHandler} coordinator for the SONOS device(s) */ private void handleNotificationSound(Command notificationURL, ZonePlayerHandler coordinator) { + boolean sourceStoppable = !isPlayingOpticalLineIn(coordinator.getCurrentURI()); String originalVolume = (isAdHocGroup() || isStandalonePlayer()) ? getVolume() : coordinator.getVolume(); - coordinator.stop(); - coordinator.waitForNotTransportState(STATE_PLAYING); - applyNotificationSoundVolume(); + if (sourceStoppable) { + coordinator.stop(); + coordinator.waitForNotTransportState(STATE_PLAYING); + applyNotificationSoundVolume(); + } long notificationPosition = coordinator.getQueueSize() + 1; coordinator.addURIToQueue(notificationURL.toString(), "", notificationPosition, false); coordinator.setCurrentURI(QUEUE_URI + coordinator.getUDN() + "#0", ""); coordinator.setPositionTrack(notificationPosition); + if (!sourceStoppable) { + coordinator.stop(); + coordinator.waitForNotTransportState(STATE_PLAYING); + applyNotificationSoundVolume(); + } coordinator.play(); coordinator.waitForFinishedNotification(); if (originalVolume != null) { diff --git a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/config/config.xml index 1da3f66c70944..f72f6da12e757 100644 --- a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/config/config.xml @@ -18,7 +18,7 @@ <description>Specifies the volume in percent applied to a notification sound</description> </parameter> <parameter name="refresh" type="integer" unit="s"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds</description> <default>60</default> </parameter> diff --git a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/channels.xml index 35bfa26df6fc7..6a81cb89ce4f2 100644 --- a/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.sonos/src/main/resources/ESH-INF/thing/channels.xml @@ -26,7 +26,7 @@ <channel-type id="alarmrunning" advanced="true"> <item-type>Switch</item-type> - <label>Alarm is running</label> + <label>Alarm Is Running</label> <description>Set to ON if the alarm was triggered</description> <state readOnly="true" /> </channel-type> @@ -74,14 +74,14 @@ <channel-type id="currenttrackuri" advanced="true"> <item-type>String</item-type> - <label>Current track URI</label> + <label>Current Track URI</label> <description>URI of the current track</description> <state readOnly="true" /> </channel-type> <channel-type id="currenttransporturi" advanced="true"> <item-type>String</item-type> - <label>Current AV transport URI</label> + <label>Current AV Transport URI</label> <description>URI of the current AV transport</description> <state readOnly="true" /> </channel-type> @@ -218,7 +218,7 @@ <channel-type id="speechenhancement" advanced="true"> <item-type>Switch</item-type> - <label>Speech Enhancement </label> + <label>Speech Enhancement</label> <description>Enable or disable the speech enhancement feature</description> </channel-type> @@ -272,7 +272,7 @@ <!-- Extended channels (for SONOS PLAY5, CONNECT & CONNECT:AMP only) --> <channel-type id="linein" advanced="true"> <item-type>Switch</item-type> - <label>Line-in connected</label> + <label>Line-in Connected</label> <description>Indicator set to ON when the line-in of the Zone Player is connected</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.sonyaudio/NOTICE b/bundles/org.openhab.binding.sonyaudio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.sonyaudio/NOTICE +++ b/bundles/org.openhab.binding.sonyaudio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.sonyaudio/pom.xml b/bundles/org.openhab.binding.sonyaudio/pom.xml index 0aa4e17a7fc96..4f24afffe06b3 100644 --- a/bundles/org.openhab.binding.sonyaudio/pom.xml +++ b/bundles/org.openhab.binding.sonyaudio/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sonyaudio</artifactId> diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/feature/feature.xml b/bundles/org.openhab.binding.sonyaudio/src/main/feature/feature.xml index 2e60782144ded..a088f34735471 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sonyaudio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.sonyaudio-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sonyaudio" description="Sony Audio Binding" version="${project.version}"> <feature>openhab-transport-upnp</feature> diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioBindingConstants.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioBindingConstants.java index fe43390dc5580..fdaa6938e3b4a 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioBindingConstants.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioEventListener.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioEventListener.java index 06ec9a9acf1c1..957a629b0ab26 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioEventListener.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioHandlerFactory.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioHandlerFactory.java index 8794566ce0292..413c23947e92e 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioHandlerFactory.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/SonyAudioHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/discovery/SonyAudioDiscoveryParticipant.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/discovery/SonyAudioDiscoveryParticipant.java index 5f79dd7adaa43..75ff9c9b5ebfd 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/discovery/SonyAudioDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/discovery/SonyAudioDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtCt800Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtCt800Handler.java index 221f4c5524970..812ee1142e3c2 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtCt800Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtCt800Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtMt500Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtMt500Handler.java index a9c251020eea4..d1fd2129ba828 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtMt500Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtMt500Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtSt5000Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtSt5000Handler.java index aeab8345e1968..aef2c81dbdb42 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtSt5000Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtSt5000Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZ9fHandler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZ9fHandler.java index cc4879e52e1bb..8135e4c36b4a3 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZ9fHandler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZ9fHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZf9Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZf9Handler.java index abef39d74898a..71667eb32a944 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZf9Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/HtZf9Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SonyAudioHandler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SonyAudioHandler.java index 3acdaff84e626..9a7fde686a496 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SonyAudioHandler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SonyAudioHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SrsZr5Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SrsZr5Handler.java index 370bbda1a0a6a..46fe69f881eb6 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SrsZr5Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/SrsZr5Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/StrDn1080Handler.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/StrDn1080Handler.java index da48580ca054c..3b96ce52ee404 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/StrDn1080Handler.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/handler/StrDn1080Handler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocket.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocket.java index 9e8c5ed877f05..e9c5eac8f7afb 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocket.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocketEventListener.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocketEventListener.java index 4ecaa864ccafe..1f9a73180a052 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocketEventListener.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioClientSocketEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioConnection.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioConnection.java index 23d7904a50a9b..dbaec73bdcf8c 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioConnection.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioMethod.java b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioMethod.java index f46acc221e1ee..e0fb5c747f7f9 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioMethod.java +++ b/bundles/org.openhab.binding.sonyaudio/src/main/java/org/openhab/binding/sonyaudio/internal/protocol/SonyAudioMethod.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/config/config.xml index 8a421bd26f4c5..8f9871b9df43c 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/config/config.xml @@ -10,7 +10,7 @@ <description>The IP or host name of the SONY audio device</description> <context>network-address</context> </parameter> - <parameter name="port" type="integer" min="1" max="65335"> + <parameter name="port" type="integer" min="1" max="65535"> <label>Port</label> <description>Port for the SONY audio device to control. Home Audio products usually use port 10000 and Personal Audio products usually use port 54480.</description> diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/srs-zr5.xml b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/srs-zr5.xml index 9634918ac4eea..9b22c0e6156dd 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/srs-zr5.xml +++ b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/srs-zr5.xml @@ -42,8 +42,8 @@ <!-- SRS-ZR5 Thing Type --> <thing-type id="SRS-ZR5"> - <label>SONY wirelesspeaker SRS-ZR5</label> - <description>SONY wirelesspeaker SRS-ZR5</description> + <label>SONY Wireless Speaker SRS-ZR5</label> + <description>SONY wireless Speaker SRS-ZR5</description> <channels> <channel id="power" typeId="power" /> <channel id="input" typeId="input-zr5" /> diff --git a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/str-dn1080.xml b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/str-dn1080.xml index c089c2f373cd0..b69a66815c252 100644 --- a/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/str-dn1080.xml +++ b/bundles/org.openhab.binding.sonyaudio/src/main/resources/ESH-INF/thing/str-dn1080.xml @@ -52,20 +52,20 @@ <!-- Commands --> <channel-type id="radioBroadcastFreq"> <item-type>Number</item-type> - <label>Broadcast frequency</label> + <label>Broadcast Frequency</label> <description>The broadcast frequency</description> <state pattern="%.2f MHz" readOnly="true"></state> </channel-type> <channel-type id="radioBroadcastStation"> <item-type>Number</item-type> - <label>Broadcast station</label> + <label>Broadcast Station</label> <description>Select preset broadcast station</description> </channel-type> <channel-type id="radioSeekBroadcastStation"> <item-type>String</item-type> - <label>Change broadcast station</label> + <label>Change Broadcast Station</label> <description>Change broadcast station</description> <state> <options> @@ -151,7 +151,7 @@ <!-- STR-DN1080 Thing Type --> <thing-type id="STR-DN1080"> - <label>SONY receiver STR-DN1080</label> + <label>SONY Receiver STR-DN1080</label> <description>SONY receiver STR-DN1080</description> <channel-groups> diff --git a/bundles/org.openhab.binding.sonyprojector/NOTICE b/bundles/org.openhab.binding.sonyprojector/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.sonyprojector/NOTICE +++ b/bundles/org.openhab.binding.sonyprojector/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.sonyprojector/README.md b/bundles/org.openhab.binding.sonyprojector/README.md index e3dafeac86ed3..35489e0581884 100644 --- a/bundles/org.openhab.binding.sonyprojector/README.md +++ b/bundles/org.openhab.binding.sonyprojector/README.md @@ -9,11 +9,11 @@ This binding can be used to conrol Sony Projectors through: For serial connection, you have to use a D-Sub 9 Pin cross (reverse) cable also called null modem. For this cable, you will need a female connector on openHAB server side and a male connector on projector side (projector connector is female). For users without serial connector on server side, of course you can add a serial to USB adapter to this serial cable. -Has been tested successfully using [this cable](https://www.amazon.fr/UGREEN-PL2303-Windows-Chrome-Connecteur/dp/B00QUZY4UG/ref=sr_1_3?ie=UTF8&qid=1548652565&sr=8-3&keywords=serial+usb) connected to a Windows 10 PC and Raspberry PI 2. +Has been tested successfully using [this cable](https://www.amazon.fr/UGREEN-PL2303-Windows-Chrome-Connecteur/dp/B00QUZY4UG/ref=sr_1_3?ie=UTF8&qid=1548652565&sr=8-3&keywords=serial+usb) connected to a Windows 10 PC and Raspberry Pi 2. In such cases, setup a serial connection thing type in openHAB. You don't need to have your projector directly connected to your openHAB server. -You can connect it for example to a Raspberry PI and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). +You can connect it for example to a Raspberry Pi and use [ser2net Linux tool](https://sourceforge.net/projects/ser2net/) to make the serial connection available on LAN (serial over IP). In such a case, setup a serial over IP connection thing type in openHAB. Here is the list of supported Sony projectors based on Sony protocol manuals: @@ -131,7 +131,7 @@ The serial connection thing requires the following configuration parameters: Some notes: * On Linux, you may get an error stating the serial port cannot be opened when the SonyProjector binding tries to load. You can get around this by adding the `openhab` user to the `dialout` group like this: `usermod -a -G dialout openhab`. -* Also on Linux you may have issues with the USB if using two serial USB devices e.g. SonyProjector and RFXcom. See the wiki page for more on symlinking the USB ports [](https://github.com/openhab/openhab1-addons/wiki/symlinks). +* Also on Linux you may have issues with the USB if using two serial USB devices e.g. SonyProjector and RFXcom. See the [general documentation about serial port configuration](/docs/administration/serial.html) for more on symlinking the USB ports. ### Serial over IP connection diff --git a/bundles/org.openhab.binding.sonyprojector/pom.xml b/bundles/org.openhab.binding.sonyprojector/pom.xml index eaa9ececd20bd..0073648ae1278 100644 --- a/bundles/org.openhab.binding.sonyprojector/pom.xml +++ b/bundles/org.openhab.binding.sonyprojector/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.sonyprojector</artifactId> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/feature/feature.xml b/bundles/org.openhab.binding.sonyprojector/src/main/feature/feature.xml index ccdd9ce17289d..b6da5538c9391 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.powermax-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-sonyprojector" description="Sony Projector Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorBindingConstants.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorBindingConstants.java index 19ae64f702fc1..0597772baecdb 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorBindingConstants.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorException.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorException.java index 2d1f01f247f91..b37441d35a3d1 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorException.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorHandlerFactory.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorHandlerFactory.java index bdef95daee96c..73489204a547f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorHandlerFactory.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorModel.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorModel.java index e54f97a831f81..026916973cfcd 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorModel.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorModel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorStateDescriptionOptionProvider.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorStateDescriptionOptionProvider.java index 114b198a155b8..48257a433fe88 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorStateDescriptionOptionProvider.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/SonyProjectorStateDescriptionOptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorAspect.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorAspect.java index 5d2d6302a20f1..2ab8ed14fc68d 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorAspect.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorAspect.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorBlockNr.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorBlockNr.java index 3189ac96ddfe1..13b333572273a 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorBlockNr.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorBlockNr.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorCalibrationPreset.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorCalibrationPreset.java index 623c0b91e6749..d0e5ab08a7033 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorCalibrationPreset.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorCalibrationPreset.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorSpace.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorSpace.java index 6233a047a0f77..8f4067044b53f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorSpace.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorSpace.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorTemp.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorTemp.java index 7ddc70d46abda..37a14daa3e42b 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorTemp.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorColorTemp.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorConnector.java index 91975329b1c8d..915df45486a64 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorContrastEnhancer.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorContrastEnhancer.java index 0e1982c5b06f6..79973f23f00cd 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorContrastEnhancer.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorContrastEnhancer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmMode.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmMode.java index d63325c1dd76f..a163b37f14532 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmMode.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmProjection.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmProjection.java index a8064359f6bd2..7c51a4165693f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmProjection.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorFilmProjection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorGammaCorrection.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorGammaCorrection.java index 690ac86f2730f..169d8021f1f0c 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorGammaCorrection.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorGammaCorrection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorInput.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorInput.java index fa26e64835261..bd0c29721fa96 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorInput.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorInput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisMode.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisMode.java index 34986cfcaaab3..7e525fbc2e932 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisMode.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisSensitivity.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisSensitivity.java index bce2b9508ff69..5ccb7ecb6a165 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisSensitivity.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorIrisSensitivity.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorItem.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorItem.java index d31fda164ccd2..e7c8d69f321b9 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorItem.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorLampControl.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorLampControl.java index 901671004b8d1..f9547a10ac2b5 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorLampControl.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorLampControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMosquitoNr.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMosquitoNr.java index ac06d872b4b22..e2c3208b3a5e0 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMosquitoNr.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMosquitoNr.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMotionEnhancer.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMotionEnhancer.java index 54612f73b9f66..002c480004863 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMotionEnhancer.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMotionEnhancer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMpegNr.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMpegNr.java index 816df7de93dc6..5b0f67163ebc2 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMpegNr.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorMpegNr.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorNr.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorNr.java index 6e9911dfb4518..5475f02d98693 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorNr.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorNr.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorPicturePosition.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorPicturePosition.java index deac070fc24a1..2ea00864b32c7 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorPicturePosition.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorPicturePosition.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorStatusPower.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorStatusPower.java index 137d962449f3d..e61a1c2638de6 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorStatusPower.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorStatusPower.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpConnector.java index b168f55bc8771..b59de06a2e788 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpError.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpError.java index 39f0a0c34ccd3..7ad6f1b342a09 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpError.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpSimuConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpSimuConnector.java index 7f0c5db8e3c2f..05b113dd31b0f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpSimuConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpSimuConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialConnector.java index eb0d904a6e25e..30239e950e8b0 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialError.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialError.java index 9716454e29e24..ba274b5b78c06 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialError.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialOverIpConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialOverIpConnector.java index 0c7c81c73f2f7..cbddc95ef7617 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialOverIpConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialOverIpConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialSimuConnector.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialSimuConnector.java index 557debad3cafc..c937bb1050ffc 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialSimuConnector.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/serial/SonyProjectorSerialSimuConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorEthernetConfiguration.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorEthernetConfiguration.java index 114e689172846..1163793738ed2 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorEthernetConfiguration.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorEthernetConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialConfiguration.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialConfiguration.java index 1238ed23cd5ef..d0997fe84852f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialConfiguration.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialOverIpConfiguration.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialOverIpConfiguration.java index 8e9a91dc37d5b..1a9185241c987 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialOverIpConfiguration.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/configuration/SonyProjectorSerialOverIpConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/handler/SonyProjectorHandler.java b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/handler/SonyProjectorHandler.java index c9c34aa10730a..d1f8c0a790bf8 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/handler/SonyProjectorHandler.java +++ b/bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/handler/SonyProjectorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/binding/binding.xml index 7c097b760744b..0a1c6ce6c61d3 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="sonyprojector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>SonyProjector Binding</name> <description>The SonyProjector binding controls a Sony projector through Ethernet (PJ Talk) or serial.</description> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/channels.xml index 5590237afe94b..5c5c7c66dc383 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/channels.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="sonyprojector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <channel-type id="power"> <item-type>Switch</item-type> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/ethernet.xml b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/ethernet.xml index 9f551cc7fc07f..f0cb458edfe33 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/ethernet.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/ethernet.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="sonyprojector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Sony Ethernet Connection Thing Type --> <thing-type id="ethernetconnection"> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serial.xml b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serial.xml index bcd21d3a7f8dc..b0bb7a4bbf4ec 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serial.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serial.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="sonyprojector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Sony Serial Connection Thing Type --> <thing-type id="serialconnection"> diff --git a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serialoverip.xml b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serialoverip.xml index d1720b9c6c848..3003419f70d5f 100644 --- a/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serialoverip.xml +++ b/bundles/org.openhab.binding.sonyprojector/src/main/resources/ESH-INF/thing/serialoverip.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="sonyprojector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Sony Serial over IP Connection Thing Type --> <thing-type id="serialoveripconnection"> diff --git a/bundles/org.openhab.binding.spotify/NOTICE b/bundles/org.openhab.binding.spotify/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.spotify/NOTICE +++ b/bundles/org.openhab.binding.spotify/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.spotify/README.md b/bundles/org.openhab.binding.spotify/README.md index a40380096363d..05335e27fb29c 100644 --- a/bundles/org.openhab.binding.spotify/README.md +++ b/bundles/org.openhab.binding.spotify/README.md @@ -179,18 +179,18 @@ Bridge spotify:player:user1 "Me" [clientId="<your client id>", clientSecret="<yo spotify.items: ``` -Player spotifyTrackPlayer label="Player" {channel="spotify:player:user1:trackPlayer"} -String spotifyDevices label="Active device [%s]" {channel="spotify:player:user1:devices"} -Switch spotifyDeviceShuffle label="Shuffle mode" {channel="spotify:player:user1:deviceShuffle"} -String spotifyTrackRepeat label="Repeat mode: [%s]" {channel="spotify:player:user1:trackRepeat"} -String spotifyTrackProgress label="Track progress: [%s]" {channel="spotify:player:user1:trackProgress"} -String spotifyTrackDuration label="Track duration: [%s]" {channel="spotify:player:user1:trackDuration"} -String spotifyTrackName label="Track Name: [%s]" {channel="spotify:player:user1:trackName"} -String spotifyAlbumName label="Album Name: [%s]" {channel="spotify:player:user1:albumName"} -String spotifyArtistName label="Artist Name: [%s]" {channel="spotify:player:user1:artistName"} -Image spotifyAlbumImage label="Album Art" {channel="spotify:player:user1:albumImage"} -String spotifyPlaylists label="Playlists [%s]" {channel="spotify:player:user1:playlists"} -String spotifyPlayName label="Playlist [%s]" {channel="spotify:player:user1:playlistName"} +Player spotifyTrackPlayer "Player" {channel="spotify:player:user1:trackPlayer"} +String spotifyDevices "Active device [%s]" {channel="spotify:player:user1:devices"} +Switch spotifyDeviceShuffle "Shuffle mode" {channel="spotify:player:user1:deviceShuffle"} +String spotifyTrackRepeat "Repeat mode: [%s]" {channel="spotify:player:user1:trackRepeat"} +String spotifyTrackProgress "Track progress: [%s]" {channel="spotify:player:user1:trackProgress"} +String spotifyTrackDuration "Track duration: [%s]" {channel="spotify:player:user1:trackDuration"} +String spotifyTrackName "Track Name: [%s]" {channel="spotify:player:user1:trackName"} +String spotifyAlbumName "Album Name: [%s]" {channel="spotify:player:user1:albumName"} +String spotifyArtistName "Artist Name: [%s]" {channel="spotify:player:user1:artistName"} +Image spotifyAlbumImage "Album Art" {channel="spotify:player:user1:albumImage"} +String spotifyPlaylists "Playlists [%s]" {channel="spotify:player:user1:playlists"} +String spotifyPlayName "Playlist [%s]" {channel="spotify:player:user1:playlistName"} String device1DeviceName {channel="spotify:device:user1:device1:deviceName"} Player device1Player {channel="spotify:device:user1:device1:devicePlayer"} diff --git a/bundles/org.openhab.binding.spotify/pom.xml b/bundles/org.openhab.binding.spotify/pom.xml index c22813c7110c3..63ee8434a9829 100644 --- a/bundles/org.openhab.binding.spotify/pom.xml +++ b/bundles/org.openhab.binding.spotify/pom.xml @@ -1,11 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?><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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.spotify</artifactId> diff --git a/bundles/org.openhab.binding.spotify/src/main/feature/feature.xml b/bundles/org.openhab.binding.spotify/src/main/feature/feature.xml index 05a1863cf0ab7..cc01b7a9fb061 100644 --- a/bundles/org.openhab.binding.spotify/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.spotify/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.spotify-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-spotify" description="Spotify Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAccountHandler.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAccountHandler.java index c557b7cd5ebf2..0fca0c82c450c 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAccountHandler.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAccountHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthService.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthService.java index c75a2ce5d7e1b..d12fed02cc59b 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthService.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthServlet.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthServlet.java index 879aa862e59b9..409dae902539b 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthServlet.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyAuthServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBindingConstants.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBindingConstants.java index f8fb038a890fb..76bccc6cb7d54 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBindingConstants.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBridgeConfiguration.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBridgeConfiguration.java index 608dda307a2a1..ad18b3cc505d1 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBridgeConfiguration.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyHandlerFactory.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyHandlerFactory.java index 90d905acb7da1..9ab055a6f7b6d 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyHandlerFactory.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/SpotifyHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyApi.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyApi.java index d86a51f04cc00..69a8c46cbb6db 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyApi.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyConnector.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyConnector.java index aebd2901ac04a..d03843e2d7612 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyConnector.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/SpotifyConnector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyAuthorizationException.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyAuthorizationException.java index db91fa3b13ade..fc1100de5bd49 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyAuthorizationException.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyAuthorizationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyException.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyException.java index fdbbcf4d3e9ef..e72dfab18d463 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyException.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyTokenExpiredException.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyTokenExpiredException.java index 9aad5ad3f463e..87334d9c96f57 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyTokenExpiredException.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/exception/SpotifyTokenExpiredException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Album.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Album.java index 1616a78b436d3..5a75b25d96902 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Album.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Album.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Artist.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Artist.java index 92ef72c7617a9..3660b7bd1740d 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Artist.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Artist.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Context.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Context.java index 58ec148bc1ead..12d91475e1f73 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Context.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Context.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/CurrentlyPlayingContext.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/CurrentlyPlayingContext.java index 8cd5c9250d498..cff930e0ed2eb 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/CurrentlyPlayingContext.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/CurrentlyPlayingContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Device.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Device.java index cda38288fb206..48cce0bed1afd 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Device.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Device.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Devices.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Devices.java index 1904528a133dd..02ca734b93240 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Devices.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Devices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalIds.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalIds.java index a458a66147cfd..f0ff20f179955 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalIds.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalIds.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalUrl.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalUrl.java index 8c42c2bf3ef36..225e59a537a9b 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalUrl.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ExternalUrl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Image.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Image.java index 8241d3bd36a26..9beae98183f1f 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Image.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Image.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Item.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Item.java index 5ed802328741f..4b689d302216b 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Item.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Item.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Me.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Me.java index 7e06346534e96..0abd5a8d39aae 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Me.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Me.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ModelUtil.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ModelUtil.java index 486543e56b7a0..78a2883da1823 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ModelUtil.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/ModelUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Paging.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Paging.java index 264927eb4fd98..d4923e9f32a5c 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Paging.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Paging.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlist.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlist.java index aff4c8ff6248e..5b483a55ccd00 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlist.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlist.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlists.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlists.java index f478507d44248..85fbf2f371ab7 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlists.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/api/model/Playlists.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/discovery/SpotifyDeviceDiscoveryService.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/discovery/SpotifyDeviceDiscoveryService.java index fe7340eedc075..8e90ddbfa6d93 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/discovery/SpotifyDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/discovery/SpotifyDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java index a7820d31c87a1..5f301d91c38a4 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,6 +16,7 @@ import java.io.IOException; import java.text.SimpleDateFormat; +import java.time.Duration; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -82,13 +83,17 @@ public class SpotifyBridgeHandler extends BaseBridgeHandler implements SpotifyAccountHandler, AccessTokenRefreshListener { - private static final CurrentlyPlayingContext EMPTY_CURRENTLYPLAYINGCONTEXT = new CurrentlyPlayingContext(); + private static final CurrentlyPlayingContext EMPTY_CURRENTLY_PLAYING_CONTEXT = new CurrentlyPlayingContext(); private static final Album EMPTY_ALBUM = new Album(); private static final Artist EMPTY_ARTIST = new Artist(); private static final Item EMPTY_ITEM = new Item(); private static final Device EMPTY_DEVICE = new Device(); private static final SimpleDateFormat MUSIC_TIME_FORMAT = new SimpleDateFormat("m:ss"); private static final int MAX_IMAGE_SIZE = 500000; + /** + * Only poll playlist once per hour (or when refresh is called). + */ + private static final Duration POLL_PLAY_LIST_HOURS = Duration.ofHours(1); /** * After a command is handles. With the given delay a status poll request is triggered. The delay is to give Spotify * some time to handle the update. @@ -147,12 +152,19 @@ public Collection<Class<? extends ThingHandlerService>> getServices() { @Override public void handleCommand(ChannelUID channelUID, Command command) { if (command instanceof RefreshType) { - if (CHANNEL_PLAYED_ALBUMIMAGE.equals(channelUID.getId())) { - albumUpdater.refreshAlbumImage(channelUID); - } else if (CHANNEL_ACCESSTOKEN.equals(channelUID.getId())) { - onAccessTokenResponse(getAccessTokenResponse()); - } else { - lastTrackId = StringType.EMPTY; + switch (channelUID.getId()) { + case CHANNEL_PLAYED_ALBUMIMAGE: + albumUpdater.refreshAlbumImage(channelUID); + break; + case CHANNEL_PLAYLISTS: + playlistCache.invalidateValue(); + break; + case CHANNEL_ACCESSTOKEN: + onAccessTokenResponse(getAccessTokenResponse()); + break; + default: + lastTrackId = StringType.EMPTY; + break; } } else { try { @@ -276,13 +288,15 @@ public void initialize() { spotifyApi = new SpotifyApi(oAuthService, scheduler, httpClient); handleCommand = new SpotifyHandleCommands(spotifyApi); playingContextCache = new ExpiringCache<>(configuration.refreshPeriod, spotifyApi::getPlayerInfo); - playlistCache = new ExpiringCache<>(configuration.refreshPeriod, spotifyApi::getPlaylists); + playlistCache = new ExpiringCache<>(POLL_PLAY_LIST_HOURS, spotifyApi::getPlaylists); devicesCache = new ExpiringCache<>(configuration.refreshPeriod, spotifyApi::getDevices); // Start with update status by calling Spotify. If no credentials available no polling should be started. - if (pollStatus()) { - startPolling(); - } + scheduler.execute(() -> { + if (pollStatus()) { + startPolling(); + } + }); } @Override @@ -340,22 +354,32 @@ private boolean pollStatus() { synchronized (pollSynchronization) { try { onAccessTokenResponse(getAccessTokenResponse()); - // Collect devices and populate selection with available devices. - final List<Device> ld = devicesCache.getValue(); - final List<Device> devices = ld == null ? Collections.emptyList() : ld; - spotifyDynamicStateDescriptionProvider.setDevices(devicesChannelUID, devices); // Collect currently playing context. final CurrentlyPlayingContext pc = playingContextCache.getValue(); - final CurrentlyPlayingContext playingContext = pc == null ? EMPTY_CURRENTLYPLAYINGCONTEXT : pc; - final List<Playlist> lp = playlistCache.getValue(); - final List<Playlist> playlists = lp == null ? Collections.emptyList() : lp; - updateStatus(ThingStatus.ONLINE); + // If Spotify returned a 204. Meaning everything is ok, but we got no data. + // Happens when no song is playing. And we know no device was active + // No need to continue because no new information will be available. + final boolean hasPlayData = pc != null && pc.getDevice() != null; + final CurrentlyPlayingContext playingContext = pc == null ? EMPTY_CURRENTLY_PLAYING_CONTEXT : pc; - handleCommand.setLists(devices, playlists); - updatePlayerInfo(playingContext, playlists); - spotifyDynamicStateDescriptionProvider.setPlayLists(playlistsChannelUID, playlists); + // Collect devices and populate selection with available devices. + if (hasPlayData || hasAnyDeviceStatusUnknown()) { + final List<Device> ld = devicesCache.getValue(); + final List<Device> devices = ld == null ? Collections.emptyList() : ld; + spotifyDynamicStateDescriptionProvider.setDevices(devicesChannelUID, devices); + handleCommand.setDevices(devices); + updateDevicesStatus(devices, playingContext.isPlaying()); + } - updateDevicesStatus(devices, playingContext.isPlaying()); + // Update play status information. + if (hasPlayData || getThing().getStatus() == ThingStatus.UNKNOWN) { + final List<Playlist> lp = playlistCache.getValue(); + final List<Playlist> playlists = lp == null ? Collections.emptyList() : lp; + handleCommand.setPlaylists(playlists); + updatePlayerInfo(playingContext, playlists); + spotifyDynamicStateDescriptionProvider.setPlayLists(playlistsChannelUID, playlists); + } + updateStatus(ThingStatus.ONLINE); return true; } catch (SpotifyAuthorizationException e) { logger.debug("Authorization error during polling: ", e); @@ -407,6 +431,12 @@ private void updateDevicesStatus(List<Device> spotifyDevices, boolean playing) { .forEach(thing -> ((SpotifyDeviceHandler) thing.getHandler()).setStatusGone()); } + private boolean hasAnyDeviceStatusUnknown() { + return getThing().getThings().stream() // + .filter(thing -> thing.getHandler() instanceof SpotifyDeviceHandler) // + .anyMatch(sd -> ((SpotifyDeviceHandler) sd.getHandler()).getThing().getStatus() == ThingStatus.UNKNOWN); + } + /** * Update the player data. * @@ -415,7 +445,7 @@ private void updateDevicesStatus(List<Device> spotifyDevices, boolean playing) { */ private void updatePlayerInfo(CurrentlyPlayingContext playerInfo, List<Playlist> playlists) { updateChannelState(CHANNEL_TRACKPLAYER, playerInfo.isPlaying() ? PlayPauseType.PLAY : PlayPauseType.PAUSE); - updateChannelState(CHANNEL_DEVICESHUFFLE, playerInfo.isShuffleState() ? OnOffType.ON : OnOffType.OFF); + updateChannelState(CHANNEL_DEVICESHUFFLE, OnOffType.from(playerInfo.isShuffleState())); updateChannelState(CHANNEL_TRACKREPEAT, playerInfo.getRepeatState()); final boolean hasItem = playerInfo.getItem() != null; @@ -464,7 +494,7 @@ private void updatePlayerInfo(CurrentlyPlayingContext playerInfo, List<Playlist> updateChannelState(CHANNEL_PLAYED_ARTISTTYPE, valueOrEmpty(firstArtist.getType())); } final Device device = playerInfo.getDevice() == null ? EMPTY_DEVICE : playerInfo.getDevice(); - // Only update activeDeviceId if it has a value, otherwise keep old value. + // Only update lastKnownDeviceId if it has a value, otherwise keep old value. if (device.getId() != null) { lastKnownDeviceId = device.getId(); updateChannelState(CHANNEL_DEVICEID, valueOrEmpty(lastKnownDeviceId)); @@ -472,7 +502,7 @@ private void updatePlayerInfo(CurrentlyPlayingContext playerInfo, List<Playlist> updateChannelState(CHANNEL_DEVICENAME, valueOrEmpty(device.getName())); } lastKnownDeviceActive = device.isActive(); - updateChannelState(CHANNEL_DEVICEACTIVE, lastKnownDeviceActive ? OnOffType.ON : OnOffType.OFF); + updateChannelState(CHANNEL_DEVICEACTIVE, OnOffType.from(lastKnownDeviceActive)); updateChannelState(CHANNEL_DEVICETYPE, valueOrEmpty(device.getType())); // experienced situations where volume seemed to be undefined... diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDeviceHandler.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDeviceHandler.java index f5cde7fd66f14..106dbd80663cb 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDeviceHandler.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -154,14 +154,16 @@ && getThing().getStatusInfo().getStatusDetail() != ThingStatusDetail.GONE) { */ private boolean setOnlineStatus(boolean restricted) { updateChannelState(CHANNEL_DEVICERESTRICTED, OnOffType.from(restricted)); + final boolean statusUnknown = thing.getStatus() == ThingStatus.UNKNOWN; + if (restricted) { // Only change status if device is currently online - if (thing.getStatus() == ThingStatus.ONLINE) { + if (thing.getStatus() == ThingStatus.ONLINE || statusUnknown) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Restricted. No Web API commands will be accepted by this device."); } return false; - } else if (thing.getStatus() != ThingStatus.ONLINE) { + } else if (statusUnknown || thing.getStatus() == ThingStatus.OFFLINE) { updateStatus(ThingStatus.ONLINE); } return true; diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDynamicStateDescriptionProvider.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDynamicStateDescriptionProvider.java index da2128cae9281..4e4a65d3f4c7c 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDynamicStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyDynamicStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyHandleCommands.java b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyHandleCommands.java index b49e06be4d5ee..3f2fe9f9b051a 100644 --- a/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyHandleCommands.java +++ b/bundles/org.openhab.binding.spotify/src/main/java/org/openhab/binding/spotify/internal/handler/SpotifyHandleCommands.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -57,8 +57,11 @@ public SpotifyHandleCommands(SpotifyApi spotifyApi) { this.spotifyApi = spotifyApi; } - public void setLists(List<Device> devices, List<Playlist> playlists) { + public void setDevices(final List<Device> devices) { this.devices = devices; + } + + public void setPlaylists(final List<Playlist> playlists) { this.playlists = playlists; } @@ -110,12 +113,8 @@ public boolean handleCommand(ChannelUID channelUID, Command command, boolean act } case CHANNEL_DEVICEVOLUME: if (command instanceof DecimalType) { - final PercentType volume = new PercentType(((DecimalType) command).intValue()); - - spotifyApi.setVolume(deviceId, volume.intValue()); - commandRun = true; - } else if (command instanceof PercentType) { - final PercentType volume = (PercentType) command; + final PercentType volume = command instanceof PercentType ? (PercentType) command + : new PercentType(((DecimalType) command).intValue()); spotifyApi.setVolume(deviceId, volume.intValue()); commandRun = true; diff --git a/bundles/org.openhab.binding.spotify/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.spotify/src/main/resources/ESH-INF/thing/thing-types.xml index 17a6b26590431..96d42e670b35d 100644 --- a/bundles/org.openhab.binding.spotify/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.spotify/src/main/resources/ESH-INF/thing/thing-types.xml @@ -77,7 +77,7 @@ Account. Go to https://developer.spotify.com/</description> <parameter name="refreshPeriod" type="integer" min="1" max="60"> <required>true</required> <default>10</default> - <label>Connect refresh period (seconds)</label> + <label>Connect Refresh Period (seconds)</label> <description>This is the frequency of the polling requests to the Spotify Connect Web API. There are limits to the number of requests that can be sent to the Web API. The more often you poll, the better status updates - at the risk of running out of your request quota.</description> </parameter> @@ -167,7 +167,7 @@ bridge you have configured.</description> <channel-type id="trackPlay" advanced="true"> <item-type>String</item-type> - <label>Track To Play</label> + <label>Track to Play</label> <description>Assign track, album, or playlist to play. Accepts Spotify Uri's and links.</description> </channel-type> <channel-type id="trackRepeat"> @@ -197,7 +197,7 @@ bridge you have configured.</description> <channel-type id="currentlyPlayedTrackUri" advanced="true"> <item-type>String</item-type> <label>Track URI</label> - <description>The Spotify URI for the track currenlty played</description> + <description>The Spotify URI for the track currently played</description> <state readOnly="true" /> </channel-type> <channel-type id="currentlyPlayedTrackType" advanced="true"> @@ -208,13 +208,13 @@ bridge you have configured.</description> </channel-type> <channel-type id="currentlyPlayedTrackDurationMs" advanced="true"> <item-type>Number</item-type> - <label>Track Duration ms</label> + <label>Track Duration (ms)</label> <description>The duration of the currently played track (ms)</description> <state readOnly="true" /> </channel-type> <channel-type id="currentlyPlayedTrackProgressMs" advanced="true"> <item-type>Number</item-type> - <label>Track Progress ms</label> + <label>Track Progress (ms)</label> <description>The progress of the currently played track (ms)</description> <state readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.spotify/src/main/resources/templates/index.html b/bundles/org.openhab.binding.spotify/src/main/resources/templates/index.html index 2364009298946..36c32d0bd9b22 100644 --- a/bundles/org.openhab.binding.spotify/src/main/resources/templates/index.html +++ b/bundles/org.openhab.binding.spotify/src/main/resources/templates/index.html @@ -75,4 +75,4 @@ <h3>Authorize openHAB binding for Spotify</h3> </p> ${error} ${authorizedUser} ${players} </body> -</html> \ No newline at end of file +</html> diff --git a/bundles/org.openhab.binding.squeezebox/NOTICE b/bundles/org.openhab.binding.squeezebox/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.squeezebox/NOTICE +++ b/bundles/org.openhab.binding.squeezebox/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.squeezebox/README.md b/bundles/org.openhab.binding.squeezebox/README.md index 3f8630539cfe5..8d834f3ce93c7 100644 --- a/bundles/org.openhab.binding.squeezebox/README.md +++ b/bundles/org.openhab.binding.squeezebox/README.md @@ -1,6 +1,6 @@ # Logitech Squeezebox Binding -This binding integrates the [Logitech Media Server](http://www.mysqueezebox.com) and compatible Squeeze players. +This binding integrates the [Logitech Media Server](https://www.mysqueezebox.com) and compatible Squeeze players. ## Introduction @@ -15,7 +15,7 @@ In 2006, Slim Devices was acquired by Logitech for $20 million USD. Logitech continued the development of the player until they announced in August 2012 that it would be discontinued. Given the cross-platform nature of the server and software client, some users have ensured the continued use of the platform by utilizing the Raspberry Pi as dedicated Squeezebox device (both client and server). -Taken from: [Wiki](http://en.wikipedia.org/wiki/Squeezebox_%28network_music_player%29) +Taken from: [Wiki](https://en.wikipedia.org/wiki/Squeezebox_%28network_music_player%29) ## Supported Things @@ -38,8 +38,7 @@ The binding has the following configuration options, which can be set for "bindi When a SqueezeBox is used as an audio sink, the SqueezeBox player connects to openHAB to get the audio stream. By default, the binding sends the SqueezeBox the URL for getting the audio stream based on the Primary Address (Network Settings configuration) and the openHAB HTTP port. -Sometimes it's necessary to use the Callback URL to override the default, such as when using a reverse proxy or with -some docker implementations. +Sometimes it is necessary to use the Callback URL to override the default, such as when using a reverse proxy or with some Docker implementations. ## Thing Configuration diff --git a/bundles/org.openhab.binding.squeezebox/pom.xml b/bundles/org.openhab.binding.squeezebox/pom.xml index ceb3eac5a753f..9bec77ce23190 100644 --- a/bundles/org.openhab.binding.squeezebox/pom.xml +++ b/bundles/org.openhab.binding.squeezebox/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.squeezebox</artifactId> diff --git a/bundles/org.openhab.binding.squeezebox/src/main/feature/feature.xml b/bundles/org.openhab.binding.squeezebox/src/main/feature/feature.xml index 1d53d4659d22a..f14d0edfca05e 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.squeezebox/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.squeezebox-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-squeezebox" description="Squeezebox Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxAudioSink.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxAudioSink.java index 0170f416b51e3..ad93383dbf4ef 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxAudioSink.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxBindingConstants.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxBindingConstants.java index 4af91b26d646f..75a7ca309cfe3 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxBindingConstants.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxHandlerFactory.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxHandlerFactory.java index f8c1b23cabacb..1e9267f638ce7 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxHandlerFactory.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java index 3523bec3ff568..ec8b60a4be0ba 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/SqueezeBoxStateDescriptionOptionsProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxPlayerConfig.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxPlayerConfig.java index a98bdf1b93651..e322f81e42dc2 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxPlayerConfig.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxPlayerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxServerConfig.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxServerConfig.java index b5fe420c5a52a..8315d2503c145 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxServerConfig.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/config/SqueezeBoxServerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxPlayerDiscoveryParticipant.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxPlayerDiscoveryParticipant.java index d80830c12bfd8..bcdad735ddca6 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxPlayerDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxPlayerDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxServerDiscoveryParticipant.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxServerDiscoveryParticipant.java index 6d919f93258be..d302cec96e87f 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxServerDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/discovery/SqueezeBoxServerDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationListener.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationListener.java index 281f6b04c30ba..e68aa93f5e5b4 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationListener.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationPlayer.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationPlayer.java index 468c84f414415..68154231ebaf1 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationPlayer.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxNotificationPlayer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayer.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayer.java index 52a7bfe8ce2cc..c3996211fe1cd 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayer.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerEventListener.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerEventListener.java index d5652e79ee523..28b14121ab801 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerEventListener.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerEventListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerHandler.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerHandler.java index 11e32c8b0c78a..42f2b4a1339c0 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerHandler.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerPlayState.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerPlayState.java index 4ae57d1d230b4..8f06c098333a5 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerPlayState.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerPlayState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerState.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerState.java index 0d1f70fc011e1..c59f7ddf0c7d8 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerState.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxPlayerState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxServerHandler.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxServerHandler.java index 44355f8551814..2cd9c414b614c 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxServerHandler.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/handler/SqueezeBoxServerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/model/Favorite.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/model/Favorite.java index 25b0e632c4893..7ad3bc51dfc69 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/model/Favorite.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/model/Favorite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/HttpUtils.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/HttpUtils.java index 40f722224fd1f..9bc78d7c649d2 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/HttpUtils.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/HttpUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxCommunicationException.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxCommunicationException.java index 31d4fb55c2640..85babdd8ddcc8 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxCommunicationException.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxNotAuthorizedException.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxNotAuthorizedException.java index 7f34dbf9250b8..24d826e50c582 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxNotAuthorizedException.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxNotAuthorizedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxTimeoutException.java b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxTimeoutException.java index c87ae7a3d17df..2750674725763 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxTimeoutException.java +++ b/bundles/org.openhab.binding.squeezebox/src/main/java/org/openhab/binding/squeezebox/internal/utils/SqueezeBoxTimeoutException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.squeezebox/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.squeezebox/src/main/resources/ESH-INF/thing/thing-types.xml index 9c26323266e7a..c03991dd93e4c 100644 --- a/bundles/org.openhab.binding.squeezebox/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.squeezebox/src/main/resources/ESH-INF/thing/thing-types.xml @@ -17,12 +17,12 @@ <description>The IP or host name of the SqueezeServer </description> </parameter> - <parameter name="webport" type="integer" required="true" min="1" max="65335"> + <parameter name="webport" type="integer" required="true" min="1" max="65535"> <label>SqueezeServer Web Port</label> <description>Webport interface of the SqueezeServer</description> <default>9000</default> </parameter> - <parameter name="cliport" type="integer" required="true" min="1" max="65335"> + <parameter name="cliport" type="integer" required="true" min="1" max="65535"> <label>SqueezeServer CLI Port</label> <description>Port of the CLI interface of the SqueezeServer</description> <default>9090</default> diff --git a/bundles/org.openhab.binding.synopanalyzer/NOTICE b/bundles/org.openhab.binding.synopanalyzer/NOTICE index bc4595b4b761a..7392bb9dbf2d0 100644 --- a/bundles/org.openhab.binding.synopanalyzer/NOTICE +++ b/bundles/org.openhab.binding.synopanalyzer/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.synopanalyzer/README.md b/bundles/org.openhab.binding.synopanalyzer/README.md index 2cab08c414047..93baadde37833 100644 --- a/bundles/org.openhab.binding.synopanalyzer/README.md +++ b/bundles/org.openhab.binding.synopanalyzer/README.md @@ -12,7 +12,7 @@ There is exactly one supported thing, which represents a Synop message. It has t ## Thing Configuration -Besides the Synop Station Number (as ```synopID``` as a [StationID](http://www.ogimet.com/gsynop_nav.phtml.en) string), the second configuration parameter is ```refreshInterval``` which defines the refresh interval in minutes. +Besides the Synop Station Number (as ```synopID``` as a [StationID](https://www.ogimet.com/gsynop_nav.phtml.en) string), the second configuration parameter is ```refreshInterval``` which defines the refresh interval in minutes. Synop message are typically updated every hour. diff --git a/bundles/org.openhab.binding.synopanalyzer/pom.xml b/bundles/org.openhab.binding.synopanalyzer/pom.xml index a853068413893..b4a485d468828 100644 --- a/bundles/org.openhab.binding.synopanalyzer/pom.xml +++ b/bundles/org.openhab.binding.synopanalyzer/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.synopanalyzer</artifactId> diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/feature/feature.xml b/bundles/org.openhab.binding.synopanalyzer/src/main/feature/feature.xml index 8788668bc5398..53dfacf2df3f1 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.synopanalyzer-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-synopanalyzer" description="Synop Analyzer Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Constants.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Constants.java index 7087e576ebfbe..e92afa0a95474 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Constants.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Constants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -159,4 +159,4 @@ public class Constants { public static final String TD_TRACE = "990"; public static final String TD_SOD_LOWER_LIMIT = "991"; public static final String TD_SOD_UPPER_LIMIT = "999"; -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Synop.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Synop.java index 3fa39211e7560..6e0cd92564fea 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Synop.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/Synop.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopLand.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopLand.java index ee5f57ab4f956..83391e16c1064 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopLand.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopLand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobile.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobile.java index fa4ae61880243..7ad09fefad8b0 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobile.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobileLand.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobileLand.java index 20c266767c06a..9132c0468be90 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobileLand.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopMobileLand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopShip.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopShip.java index 216c1168e7b26..54133f2df9b01 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopShip.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyser/internal/synop/SynopShip.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerBindingConstants.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerBindingConstants.java index fa50e46045fb7..4bfb8f1b36dd1 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerBindingConstants.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerHandlerFactory.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerHandlerFactory.java index b6d0357a34d8d..856efac8c72cd 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerHandlerFactory.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/SynopAnalyzerHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/config/SynopAnalyzerConfiguration.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/config/SynopAnalyzerConfiguration.java index ade5d80bcf44f..de4abe687f485 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/config/SynopAnalyzerConfiguration.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/config/SynopAnalyzerConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/handler/SynopAnalyzerHandler.java b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/handler/SynopAnalyzerHandler.java index 6eddc15174d64..d3d9e87402f6f 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/handler/SynopAnalyzerHandler.java +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/java/org/openhab/binding/synopanalyzer/internal/handler/SynopAnalyzerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.synopanalyzer/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.synopanalyzer/src/main/resources/ESH-INF/thing/thing-types.xml index d98afc1ee634e..461525fe6c6e1 100644 --- a/bundles/org.openhab.binding.synopanalyzer/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.synopanalyzer/src/main/resources/ESH-INF/thing/thing-types.xml @@ -64,7 +64,7 @@ <channel-type id="attenuation-factor"> <item-type>Number</item-type> - <label>Mitigation factor</label> + <label>Mitigation Factor</label> <description>Cloud layer mitigation factor</description> <state readOnly="true" pattern="%.1f"> </state> diff --git a/bundles/org.openhab.binding.systeminfo/NOTICE b/bundles/org.openhab.binding.systeminfo/NOTICE index 4306bd5d86d46..ec297b278e66f 100644 --- a/bundles/org.openhab.binding.systeminfo/NOTICE +++ b/bundles/org.openhab.binding.systeminfo/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.systeminfo/README.md b/bundles/org.openhab.binding.systeminfo/README.md index a5ad9ce46f898..7f66ce5fe1bf0 100644 --- a/bundles/org.openhab.binding.systeminfo/README.md +++ b/bundles/org.openhab.binding.systeminfo/README.md @@ -29,7 +29,7 @@ The thing has the following properties: - `os_family` - The family of the operating system If multiple storage or display devices support is needed, new thing type has to be defined. -This is workaround until [this issue] (https://github.com/eclipse/smarthome/issues/588) is resolved and it is possible to add dynamically channels to DSL defined thing. +This is workaround until [this issue](https://github.com/eclipse/smarthome/issues/588) is resolved and it is possible to add dynamically channels to DSL defined thing. ## Discovery @@ -37,7 +37,7 @@ The discovery service implementation tries to resolve the computer name. If the resolving process fails, the computer name is set to "Unknown". In both cases it creates a Discovery Result with thing type **computer**. -When [this issue] (https://github.com/eclipse/smarthome/issues/1118) is resolved it will be possible to implement creation of dynamic channels (e.g. the binding will scan how much storage devices are present and create channel groups for them). +When [this issue](https://github.com/eclipse/smarthome/issues/1118) is resolved it will be possible to implement creation of dynamic channels (e.g. the binding will scan how much storage devices are present and create channel groups for them). At the moment this is not supported. ## Binding configuration diff --git a/bundles/org.openhab.binding.systeminfo/pom.xml b/bundles/org.openhab.binding.systeminfo/pom.xml index 588eb7bd2bb96..f7a8d7fdf18e0 100644 --- a/bundles/org.openhab.binding.systeminfo/pom.xml +++ b/bundles/org.openhab.binding.systeminfo/pom.xml @@ -1,42 +1,39 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.systeminfo</artifactId> <name>openHAB Add-ons :: Bundles :: Systeminfo Binding</name> + <properties> + <dep.noembedding>jna,jna-platform</dep.noembedding> + </properties> + <dependencies> <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna-platform</artifactId> - <version>5.4.0</version> - <scope>provided</scope> + <version>5.5.0</version> + <scope>compile</scope> </dependency> <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>5.4.0</version> - <scope>provided</scope> + <version>5.5.0</version> + <scope>compile</scope> </dependency> <dependency> <groupId>com.github.oshi</groupId> <artifactId>oshi-core</artifactId> - <version>4.0.0</version> - <scope>provided</scope> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </exclusion> - </exclusions> + <version>4.2.1</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.systeminfo/src/main/feature/feature.xml b/bundles/org.openhab.binding.systeminfo/src/main/feature/feature.xml index f16e2e4982bc2..dc89ee6cb00c5 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.systeminfo/src/main/feature/feature.xml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.systeminfo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-systeminfo" description="System Info Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <bundle dependency="true">mvn:net.java.dev.jna/jna/5.4.0</bundle> - <bundle dependency="true">mvn:net.java.dev.jna/jna-platform/5.4.0</bundle> - <bundle dependency="true">mvn:com.github.oshi/oshi-core/4.0.0</bundle> + <bundle dependency="true">mvn:net.java.dev.jna/jna/5.5.0</bundle> + <bundle dependency="true">mvn:net.java.dev.jna/jna-platform/5.5.0</bundle> + <bundle dependency="true">mvn:com.github.oshi/oshi-core/4.2.1</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.systeminfo/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoBindingConstants.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoBindingConstants.java index d65529fef72a1..ef94b2bc88592 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoBindingConstants.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoHandlerFactory.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoHandlerFactory.java index caae1556a11aa..898efe4f3bda6 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoHandlerFactory.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/SysteminfoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/discovery/SysteminfoDiscoveryService.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/discovery/SysteminfoDiscoveryService.java index 1707e9eb41ac6..5a0cc7de612af 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/discovery/SysteminfoDiscoveryService.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/discovery/SysteminfoDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/handler/SysteminfoHandler.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/handler/SysteminfoHandler.java index 71fdfadf0e6b6..30af4296f1679 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/handler/SysteminfoHandler.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/handler/SysteminfoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/DeviceNotFoundException.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/DeviceNotFoundException.java index ddd6e74bf2c5c..fde37a1b3f0d5 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/DeviceNotFoundException.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/DeviceNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/OSHISysteminfo.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/OSHISysteminfo.java index a8c018210d346..ab0ff060242ed 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/OSHISysteminfo.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/OSHISysteminfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/SysteminfoInterface.java b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/SysteminfoInterface.java index 8ffdd78334e5c..ea3eee02dbe86 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/SysteminfoInterface.java +++ b/bundles/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/internal/model/SysteminfoInterface.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/config/computerConfig.xml b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/config/computerConfig.xml index 0eb7416caccb5..16dff923bb951 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/config/computerConfig.xml +++ b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/config/computerConfig.xml @@ -9,13 +9,13 @@ <config-description uri="thing-type:systeminfo:computerConfig"> <parameter name="interval_high" type="integer"> - <label>Interval for high priority tasks</label> + <label>Interval for High Priority Tasks</label> <description>Refresh interval in seconds.</description> <default>1</default> </parameter> <parameter name="interval_medium" type="integer"> - <label>Interval for medium priority tasks</label> + <label>Interval for Medium Priority Tasks</label> <description>Refresh interval in seconds.</description> <default>60</default> </parameter> diff --git a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/channels.xml index 2d633a8953953..95302f30cdfb1 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/channels.xml @@ -7,7 +7,7 @@ channel is assigned a default priority configuration. For more info about priorities see ESH-INF/config/channelConfig.xml --> <channel-group-type id="memoryGroup"> - <label>Physical memory</label> + <label>Physical Memory</label> <description>Physical memory information</description> <channels> <channel id="total" typeId="total" /> @@ -206,7 +206,7 @@ <channel-type id="serial" advanced="true"> <item-type>String</item-type> - <label>Serial number</label> + <label>Serial Number</label> <description>The serial number of the device</description> <state readOnly="true" pattern="%s" /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -246,7 +246,7 @@ <channel-type id="fanSpeed" advanced="true"> <item-type>Number</item-type> - <label>Fan speed</label> + <label>Fan Speed</label> <description>Fan speed in rpm</description> <state readOnly="true" pattern="%d rpm" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -254,7 +254,7 @@ <channel-type id="remainingTime"> <item-type>Number</item-type> - <label>Remaining time</label> + <label>Remaining Time</label> <description>Remaining time in minutes</description> <state readOnly="true" pattern="%.1f Minutes" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -262,7 +262,7 @@ <channel-type id="remainingCapacity"> <item-type>Number</item-type> - <label>Remaining capacity</label> + <label>Remaining Capacity</label> <description>Remaining capacity in percent</description> <state readOnly="true" pattern="%.1f %%" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -278,7 +278,7 @@ <channel-type id="loadAverage" advanced="true"> <item-type>Number</item-type> - <label>Load average</label> + <label>Load Average</label> <description>Load as a number of processes for the last 1,5 or 15 minutes</description> <state readOnly="true" pattern="%.1f" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -286,7 +286,7 @@ <channel-type id="uptime" advanced="true"> <item-type>Number</item-type> - <label>System uptime</label> + <label>System Uptime</label> <description>System uptime (time after start) in minutes</description> <state readOnly="true" pattern="%.1f Minutes" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -294,7 +294,7 @@ <channel-type id="threads" advanced="true"> <item-type>Number</item-type> - <label>Number of threads</label> + <label>Number of Threads</label> <description>Number of threads currently running</description> <state readOnly="true" pattern="%d" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -302,7 +302,7 @@ <channel-type id="threads_process" advanced="true"> <item-type>Number</item-type> - <label>Number of threads</label> + <label>Number of Threads</label> <description>Number of threads currently running</description> <state readOnly="true" pattern="%d" /> <config-description-ref uri="systeminfo:channels:mediumpriority_process" /> @@ -310,7 +310,7 @@ <channel-type id="information" advanced="true"> <item-type>String</item-type> - <label>Display information</label> + <label>Display Information</label> <description>Product, manufacturer, SN, width and height of the display in cm</description> <state readOnly="true" pattern="%s " /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -318,7 +318,7 @@ <channel-type id="ip"> <item-type>String</item-type> - <label>IP address </label> + <label>IP Address</label> <description>Host IP address of the network</description> <state readOnly="true" pattern="%s " /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -326,7 +326,7 @@ <channel-type id="mac" advanced="true"> <item-type>String</item-type> - <label>Mac address </label> + <label>Mac Address</label> <description>Mac address of the network</description> <state readOnly="true" pattern="%s " /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -334,7 +334,7 @@ <channel-type id="networkName"> <item-type>String</item-type> - <label>Network name</label> + <label>Network Name</label> <description>The name of the network.</description> <state readOnly="true" pattern="%s " /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -342,7 +342,7 @@ <channel-type id="networkDisplayName"> <item-type>String</item-type> - <label>Network display name</label> + <label>Network Display Name</label> <description>The display name of the network</description> <state readOnly="true" pattern="%s " /> <config-description-ref uri="systeminfo:channels:lowpriority" /> @@ -350,7 +350,7 @@ <channel-type id="packetsSent" advanced="true"> <item-type>Number</item-type> - <label>Packets sent</label> + <label>Packets Sent</label> <description>Number of packets sent</description> <state readOnly="true" pattern="%d " /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -358,7 +358,7 @@ <channel-type id="packetsReceived" advanced="true"> <item-type>Number</item-type> - <label>Packets received</label> + <label>Packets Received</label> <description>Number of packets received</description> <state readOnly="true" pattern="%d " /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -366,7 +366,7 @@ <channel-type id="dataSent" advanced="true"> <item-type>Number</item-type> - <label>Data sent</label> + <label>Data Sent</label> <description>Data sent in MB</description> <state readOnly="true" pattern="%d MB" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> @@ -374,7 +374,7 @@ <channel-type id="dataReceived" advanced="true"> <item-type>Number</item-type> - <label>Data received</label> + <label>Data Received</label> <description>Data received in MB</description> <state readOnly="true" pattern="%d MB" /> <config-description-ref uri="systeminfo:channels:mediumpriority" /> diff --git a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/computer.xml b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/computer.xml index 87428442b1915..cb94477da88c6 100644 --- a/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/computer.xml +++ b/bundles/org.openhab.binding.systeminfo/src/main/resources/ESH-INF/thing/computer.xml @@ -8,7 +8,7 @@ channel creation is not supported from the binding. --> <thing-type id="computer"> <label>Systeminfo</label> - <description>Sample thing for systeminfo Binding</description> + <description>The computer operating system and hardware information</description> <channel-groups> <channel-group id="memory" typeId="memoryGroup" /> diff --git a/bundles/org.openhab.binding.tado/.classpath b/bundles/org.openhab.binding.tado/.classpath index 2669451039905..615608997a6c5 100644 --- a/bundles/org.openhab.binding.tado/.classpath +++ b/bundles/org.openhab.binding.tado/.classpath @@ -28,6 +28,5 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/tado-api-client-1.2.jar"/> <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/bundles/org.openhab.binding.tado/NOTICE b/bundles/org.openhab.binding.tado/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.tado/NOTICE +++ b/bundles/org.openhab.binding.tado/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.tado/README.md b/bundles/org.openhab.binding.tado/README.md index e6a7a5be77c94..5cc7a1a10277d 100644 --- a/bundles/org.openhab.binding.tado/README.md +++ b/bundles/org.openhab.binding.tado/README.md @@ -1,12 +1,14 @@ # tado° Binding -The tado° binding integrates devices from [tado°](http://www.tado.com). +The tado° binding integrates devices from [tado°](https://www.tado.com). -It requires a fully functional tado° installation. You can then monitor and control all zone types (Heating, AC, Hot Water) as well as retrieve the HOME/AWAY status of mobile devices. +It requires a fully functional tado° installation. +You can then monitor and control all zone types (Heating, AC, Hot Water) as well as retrieve the HOME/AWAY status of mobile devices. ## `home` Thing (the Bridge) -The binding supports discovery, but a `home` thing type has to be configured first. It serves as bridge to the tado° cloud services. +The binding supports discovery, but a `home` thing type has to be configured first. +It serves as bridge to the tado° cloud services. Parameter | Required | Description -|-|- @@ -24,7 +26,9 @@ Afterwards the discovery will show all zones and mobile devices associated with ## `zone` Thing -A *zone* is an area/room of your home. You've defined them during installation. One zone relates to one page in the tado° mobile- or webapp. +A *zone* is an area/room of your home. +You have defined them during installation. +One zone relates to one page in the tado° mobile- or webapp. Parameter | Required | Description | Default -|-|-|- @@ -49,13 +53,15 @@ Zone id and name can be found in discovery results. ### Channels A zone is either of type `HEATING`, `AC` or `DHW` (domestic hot water). -The availability of items as well as their allowed values depend on type and capabilities of the HVAC setup. If you are unsure, have a look at the tado° app and see if the functionality is available and what values are supported. +The availability of items as well as their allowed values depend on type and capabilities of the HVAC setup. +If you are unsure, have a look at the tado° app and see if the functionality is available and what values are supported. Name | Type | Description | Read/Write | Zone type -|-|-|-|- `currentTemperature` | Number:Temperature | Current inside temperature | R | `HEATING`, `AC` `humidity` | Number | Current relative inside humidity in percent | R | `HEATING`, `AC` `heatingPower` | Number | Amount of heating power currently present | R | `HEATING` +`acPower` | Switch | Indicates if the Air-Conditioning is Off or On | R | `AC` `hvacMode` | String | Active mode, one of `OFF`, `HEAT`, `COOL`, `DRY`, `FAN`, `AUTO` | RW | `HEATING` and `DHW` support `OFF` and `HEAT`, `AC` can support more `targetTemperature` | Number:Temperature | Set point | RW | `HEATING`, `AC`, `DHW` `fanspeed` | String | Fan speed, one of `AUTO`, `LOW`, `MIDDLE`, `HIGH` | RW | `AC` @@ -63,6 +69,8 @@ Name | Type | Description | Read/Write | Zone type `overlayExpiry` | DateTime | End date and time of a timer | R | `HEATING`, `AC`, `DHW` `timerDuration` | Number | Timer duration in minutes | RW | `HEATING`, `AC`, `DHW` `operationMode` | String | Operation mode the zone is currently in. One of `SCHEDULE` (follow smart schedule), `MANUAL` (override until ended manually), `TIMER` (override for a given time), `UNTIL_CHANGE` (active until next smart schedule block or until AWAY mode becomes active) | RW | `HEATING`, `AC`, `DHW` +`batteryLowAlarm` | Switch | A control device in the Zone has a low battery (if applicable) | R | Any Zone +`openWindowDetected` | Switch | An open window has been detected in the Zone | R | Any Zone The `RW` items are used to either override the schedule or to return to it (if `hvacMode` is set to `SCHEDULE`). @@ -70,11 +78,13 @@ The `RW` items are used to either override the schedule or to return to it (if ` Item changes are not immediately applied, but instead collected and only when no change is done for 5 seconds (by default - see `hvacChangeDebounce` above), the combined HVAC change is sent to the server. This way, you can for example set a timer for 15 minutes, with target temperature 22° and mode `HEAT` in one go, without intermediate partial overrides. -It's still fine to only change one item, like setting the target temperature to 22°, but you have the opportunity to set more items and have less defaults applied. +It is still fine to only change one item, like setting the target temperature to 22°, but you have the opportunity to set more items and have less defaults applied. ### Default Handling -To set an override, the tado° cloud API requires a full setting (`hvacMode`, `targetTemperature`, `fanspeed`, `swing`) and a termination condition (`operationMode`, `timerDuration`). If only some of the properties are set, the binding fills the missing pieces automatically. It tries to keep the current state wherever possible. +To set an override, the tado° cloud API requires a full setting (`hvacMode`, `targetTemperature`, `fanspeed`, `swing`) and a termination condition (`operationMode`, `timerDuration`). +If only some of the properties are set, the binding fills the missing pieces automatically. +It tries to keep the current state wherever possible. If parts of the setting are missing, then the currently active zone setting is used to fill the gap. Only if the setting is not compatible with the requested change, then hard-coded defaults are applied. @@ -83,7 +93,9 @@ If parts of the setting are missing, then the currently active zone setting is u - `fanspeed` is set to first supported value, for example `AUTO` - `swing` is set to `OFF`, if supported -If the termination condition is missing, the binding first checks if an override is active. If that's the case, the existing termination condition is used. An existing timer, for example, just keeps running. +If the termination condition is missing, the binding first checks if an override is active. +If that is the case, the existing termination condition is used. +An existing timer, for example, just keeps running. In case the zone is currently in smart-schedule mode and thus doesn't have a termination condition, then the default termination condition is used, as configured in the tado° app (settings -> select zone -> manual control on tado° device). ## `mobiledevice` Thing @@ -95,7 +107,8 @@ Parameter | Required | Description | Default `id` | yes | Mobile Device Id | - `refreshInterval` | no | Refresh interval of state updates in seconds | 60 -Mobile devices are part of discovery, but can also be configured manually. It's again easiest to refer to discovery in order to find the `id`. +Mobile devices are part of discovery, but can also be configured manually. +It is again easiest to refer to discovery in order to find the `id`. Example `tado.things`: @@ -148,6 +161,7 @@ Switch AC_swing "Swing" { channe DateTime AC_overlay_expiry "Overlay Expiry" { channel="tado:zone:demo:ac:overlayExpiry" } Number AC_timer_duration "Timer Duration" { channel="tado:zone:demo:ac:timerDuration" } String AC_operation_mode "Operation Mode" { channel="tado:zone:demo:ac:operationMode" } +Switch AC_power "Air-Con Power" { channel="tado:zone:demo:ac:acPower" } String DHW_hvac_mode "HVAC Mode" { channel="tado:zone:demo:hotwater:hvacMode" } Number:Temperature DHW_target_temperature "Set Point" { channel="tado:zone:demo:hotwater:targetTemperature" } @@ -155,6 +169,8 @@ DateTime DHW_overlay_expiry "Overlay Expiry" { channe Number DHW_timer_duration "Timer Duration" { channel="tado:zone:demo:hotwater:timerDuration" } String DHW_operation_mode "Operation Mode" { channel="tado:zone:demo:hotwater:operationMode" } +Switch Battery_Low_Alarm "Battery Low Alarm" { channel="tado:zone:demo:heating:batteryLowAlarm" } + Switch Phone_atHome "Phone location [MAP(presence.map):%s]" { channel="tado:mobiledevice:demo:phone:atHome" } ``` @@ -196,6 +212,10 @@ sitemap tado label="Tado" Text item=DHW_overlay_expiry } + Frame label="Battery Low Alarm" { + Text item=Battery_Low_Alarm valuecolor=[OFF="green", ON="red"] + } + Frame label="Mobile Devices" { Text item=Phone_atHome } diff --git a/bundles/org.openhab.binding.tado/lib/tado-api-client-1.2.jar b/bundles/org.openhab.binding.tado/lib/tado-api-client-1.2.jar deleted file mode 100644 index b8e6ab9b3fa03..0000000000000 Binary files a/bundles/org.openhab.binding.tado/lib/tado-api-client-1.2.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tado/pom.xml b/bundles/org.openhab.binding.tado/pom.xml index d84932df05fa4..377f163847127 100644 --- a/bundles/org.openhab.binding.tado/pom.xml +++ b/bundles/org.openhab.binding.tado/pom.xml @@ -1,15 +1,24 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tado</artifactId> <name>openHAB Add-ons :: Bundles :: Tado Binding</name> + + <dependencies> + <dependency> + <groupId>org.openhab.binding.tado</groupId> + <artifactId>api-client</artifactId> + <version>1.3.0</version> + <scope>compile</scope> + </dependency> + </dependencies> + </project> diff --git a/bundles/org.openhab.binding.tado/src/main/api/pom.xml b/bundles/org.openhab.binding.tado/src/main/api/pom.xml index bdbd3b49b793a..e885b7bc250f2 100644 --- a/bundles/org.openhab.binding.tado/src/main/api/pom.xml +++ b/bundles/org.openhab.binding.tado/src/main/api/pom.xml @@ -5,7 +5,7 @@ <groupId>org.openhab.binding.tado</groupId> <artifactId>tado-api-client</artifactId> - <version>1.2</version> + <version>1.3</version> <properties> <maven.compiler.source>1.8</maven.compiler.source> diff --git a/bundles/org.openhab.binding.tado/src/main/api/tado-api.yaml b/bundles/org.openhab.binding.tado/src/main/api/tado-api.yaml index 3974d6cdb039c..363ab0ca90c7f 100644 --- a/bundles/org.openhab.binding.tado/src/main/api/tado-api.yaml +++ b/bundles/org.openhab.binding.tado/src/main/api/tado-api.yaml @@ -377,6 +377,26 @@ definitions: - HOT_WATER readOnly: true + ControlDevice: + type: object + description: A Tado control device. + properties: + deviceType: + type: string + description: The type of Tado control device. + readOnly: true + serialNo: + type: string + description: The serial number of the device. + readOnly: true + batteryState: + type: string + description: The state of the device battery (if applicable). + readOnly: true + required: + - deviceType + - serialNo + Zone: type: object properties: @@ -390,6 +410,10 @@ definitions: type: string type: $ref: "#/definitions/TadoSystemType" + devices: + type: array + items: + $ref: "#/definitions/ControlDevice" required: - id - name @@ -486,7 +510,23 @@ definitions: properties: heatingPower: $ref: "#/definitions/PercentageDataPoint" + acPower: + $ref: "#/definitions/AcPowerDataPoint" + AcPowerDataPoint: + type: object + properties: + timestamp: + description: Measurement timestamp + type: string + format: date-time + value: + description: AC Power state (OFF, ON) + type: string + required: + - timestamp + - value + SensorDataPoints: type: object properties: @@ -580,12 +620,15 @@ definitions: overlay: description: The currently active overlay for the zone, `null` if none. $ref: "#/definitions/Overlay" - openWindow: - description: The currently active open window for the zone, `null` if none. - $ref: "#/definitions/OpenWindow" setting: description: Current setting of the zone. $ref: "#/definitions/GenericZoneSetting" + openWindow: + description: The currently active open window for the zone, `null` if none. + $ref: "#/definitions/OpenWindow" + openWindowDetected: + description: Indicates is an open window has been detected + type: boolean link: description: Link object of current zone connection. $ref: "#/definitions/Link" diff --git a/bundles/org.openhab.binding.tado/src/main/feature/feature.xml b/bundles/org.openhab.binding.tado/src/main/feature/feature.xml index 385467e492ace..9a72b91a7c383 100644 --- a/bundles/org.openhab.binding.tado/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tado/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tado-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tado" description="Tado Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoBindingConstants.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoBindingConstants.java index a128e13c83654..c9a7447fa46ff 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoBindingConstants.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,6 +19,8 @@ * used across the whole binding. * * @author Dennis Frommknecht - Initial contribution + * @author Andrew Fiddian-Green - Added Low Battery Alarm, A/C Power and Open Window channels + * */ public class TadoBindingConstants { @@ -41,6 +43,8 @@ public static enum TemperatureUnit { public final static String CHANNEL_ZONE_HUMIDITY = "humidity"; public final static String CHANNEL_ZONE_HEATING_POWER = "heatingPower"; + // air conditioning power + public final static String CHANNEL_ZONE_AC_POWER = "acPower"; public final static String CHANNEL_ZONE_HVAC_MODE = "hvacMode"; @@ -78,6 +82,11 @@ public static enum OperationMode { public final static String CHANNEL_ZONE_TIMER_DURATION = "timerDuration"; public final static String CHANNEL_ZONE_OVERLAY_EXPIRY = "overlayExpiry"; + // battery low alarm channel + public final static String CHANNEL_ZONE_BATTERY_LOW_ALARM = "batteryLowAlarm"; + // open window detected channel + public final static String CHANNEL_ZONE_OPEN_WINDOW_DETECTED = "openWindowDetected"; + public final static String CHANNEL_MOBILE_DEVICE_AT_HOME = "atHome"; // Configuration diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoHvacChange.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoHvacChange.java index 29d7d79c5aa6f..d0f05474d7129 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoHvacChange.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/TadoHvacChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/adapter/TadoZoneStateAdapter.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/adapter/TadoZoneStateAdapter.java index c538d87eb0ef4..cded9eeab1e3f 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/adapter/TadoZoneStateAdapter.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/adapter/TadoZoneStateAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,9 +24,11 @@ import org.eclipse.smarthome.core.library.unit.SIUnits; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; + import org.openhab.binding.tado.internal.TadoBindingConstants.HvacMode; import org.openhab.binding.tado.internal.TadoBindingConstants.OperationMode; import org.openhab.binding.tado.internal.TadoBindingConstants.TemperatureUnit; +import org.openhab.binding.tado.internal.api.model.AcPowerDataPoint; import org.openhab.binding.tado.internal.api.model.ActivityDataPoints; import org.openhab.binding.tado.internal.api.model.CoolingZoneSetting; import org.openhab.binding.tado.internal.api.model.GenericZoneSetting; @@ -46,6 +48,8 @@ * Adapter from API-level zone state to the binding's item-based zone state. * * @author Dennis Frommknecht - Initial contribution + * @author Andrew Fiddian-Green - Added Low Battery Alarm, A/C Power and Open Window channels + * */ public class TadoZoneStateAdapter { private ZoneState zoneState; @@ -73,6 +77,18 @@ public DecimalType getHeatingPower() { : DecimalType.ZERO; } + public OnOffType getAcPower() { + ActivityDataPoints dataPoints = zoneState.getActivityDataPoints(); + AcPowerDataPoint acPower = dataPoints.getAcPower(); + if (acPower != null) { + String acPowerValue = acPower.getValue(); + if (acPowerValue != null) { + return OnOffType.from(acPowerValue); + } + } + return null; + } + public StringType getMode() { GenericZoneSetting setting = zoneState.getSetting(); @@ -211,4 +227,13 @@ private static State toTemperatureState(TemperatureDataPoint temperature, Temper ? new QuantityType<>(temperature.getFahrenheit(), ImperialUnits.FAHRENHEIT) : new QuantityType<>(temperature.getCelsius(), SIUnits.CELSIUS); } + + public State getOpenWindowDetected() { + Boolean openWindowDetected = zoneState.isOpenWindowDetected(); + if (openWindowDetected != null) { + return OnOffType.from(openWindowDetected); + } + return UnDefType.UNDEF; + } + } diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/HomeApiFactory.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/HomeApiFactory.java index 01465fd6fb179..733361488c4a8 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/HomeApiFactory.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/HomeApiFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/TadoApiTypeUtils.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/TadoApiTypeUtils.java index d62a1ead9eb27..ab6bc16f24278 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/TadoApiTypeUtils.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/api/TadoApiTypeUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/AirConditioningZoneSettingsBuilder.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/AirConditioningZoneSettingsBuilder.java index 16f36d2a5ee4f..3fd2379ebf0e0 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/AirConditioningZoneSettingsBuilder.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/AirConditioningZoneSettingsBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HeatingZoneSettingsBuilder.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HeatingZoneSettingsBuilder.java index e2d809ff53a96..77f5f7c0e86c0 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HeatingZoneSettingsBuilder.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HeatingZoneSettingsBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HotWaterZoneSettingsBuilder.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HotWaterZoneSettingsBuilder.java index 4a1bac7b30b5d..77fec684dd343 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HotWaterZoneSettingsBuilder.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/HotWaterZoneSettingsBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/TerminationConditionBuilder.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/TerminationConditionBuilder.java index 050dfb7e6ace9..40f13dc374e3f 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/TerminationConditionBuilder.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/TerminationConditionBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneSettingsBuilder.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneSettingsBuilder.java index e109d2664223f..a6b11377a912f 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneSettingsBuilder.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneSettingsBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneStateProvider.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneStateProvider.java index 749cc04b6a29d..f89ba3efcc1d9 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneStateProvider.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/builder/ZoneStateProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoHomeConfig.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoHomeConfig.java index 416d2c4c66766..34bce34690c79 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoHomeConfig.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoHomeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoMobileDeviceConfig.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoMobileDeviceConfig.java index 203b1d79f9b22..f3b327c58a261 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoMobileDeviceConfig.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoMobileDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoZoneConfig.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoZoneConfig.java index 913e1b7b4baa5..972c1344a1671 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoZoneConfig.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/config/TadoZoneConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/discovery/TadoDiscoveryService.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/discovery/TadoDiscoveryService.java index b465e87007075..0706393c70a67 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/discovery/TadoDiscoveryService.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/discovery/TadoDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/BaseHomeThingHandler.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/BaseHomeThingHandler.java index 3bc37c4275c96..daf72894fddbe 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/BaseHomeThingHandler.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/BaseHomeThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,7 +30,8 @@ public BaseHomeThingHandler(Thing thing) { } public Long getHomeId() { - return getHomeHandler().getHomeId(); + TadoHomeHandler handler = getHomeHandler(); + return handler != null ? handler.getHomeId() : new Long(0); } protected TadoHomeHandler getHomeHandler() { @@ -39,7 +40,8 @@ protected TadoHomeHandler getHomeHandler() { } protected HomeApi getApi() { - return getHomeHandler().getApi(); + TadoHomeHandler handler = getHomeHandler(); + return handler != null ? handler.getApi() : null; } protected void onSuccessfulOperation() { diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoBatteryChecker.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoBatteryChecker.java new file mode 100644 index 0000000000000..b7439468cdd5c --- /dev/null +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoBatteryChecker.java @@ -0,0 +1,93 @@ +/** + * 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.tado.internal.handler; + +import java.io.IOException; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.tado.internal.api.ApiException; +import org.openhab.binding.tado.internal.api.model.ControlDevice; +import org.openhab.binding.tado.internal.api.model.Zone; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link TadoBatteryChecker} checks the battery state of Tado control + * devices. + * + * @author Andrew Fiddian-Green - Initial contribution + * + */ +public class TadoBatteryChecker { + private final Logger logger = LoggerFactory.getLogger(TadoBatteryChecker.class); + + private List<Zone> zoneList = null; + private Date refreshTime = new Date(); + private TadoHomeHandler homeHandler; + + public TadoBatteryChecker(TadoHomeHandler homeHandler) { + this.homeHandler = homeHandler; + } + + private synchronized void refreshZoneList() { + Date now = new Date(); + if (homeHandler != null && (now.after(refreshTime) || zoneList == null)) { + // be frugal, we only need to refresh the battery state hourly + Calendar calendar = Calendar.getInstance(); + calendar.setTime(now); + calendar.add(Calendar.HOUR, 1); + refreshTime = calendar.getTime(); + + Long homeId = homeHandler.getHomeId(); + if (homeId != null) { + logger.debug("Fetching (battery state) zone list for HomeId {}", homeId); + try { + zoneList = homeHandler.getApi().listZones(homeId); + } catch (IOException | ApiException e) { + zoneList = null; + logger.debug("Fetch (battery state) zone list exception", e); + } + } + } + } + + public State getBatteryLowAlarm(long zoneId) { + refreshZoneList(); + boolean hasBatteryStateValue = false; + if (zoneList != null) { + // logger.debug("Fetching battery state for ZoneId {}", zoneId); + for (Zone zone : zoneList) { + if (zoneId == zone.getId()) { + for (ControlDevice device : zone.getDevices()) { + String batteryState = device.getBatteryState(); + if (batteryState != null) { + if (!batteryState.equals("NORMAL")) { + return OnOffType.ON; + } + hasBatteryStateValue = true; + } + } + break; + } + } + } + return hasBatteryStateValue ? OnOffType.OFF : UnDefType.UNDEF; + } + +} diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHandlerFactory.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHandlerFactory.java index 60b9a8eff9d00..b1fcf688a4a23 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHandlerFactory.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHomeHandler.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHomeHandler.java index 1fbceb11f7607..ea8bcef9be677 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHomeHandler.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoHomeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,10 @@ import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; + import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; + import org.openhab.binding.tado.internal.TadoBindingConstants; import org.openhab.binding.tado.internal.TadoBindingConstants.TemperatureUnit; import org.openhab.binding.tado.internal.api.ApiException; @@ -30,6 +33,7 @@ import org.openhab.binding.tado.internal.api.model.HomeInfo; import org.openhab.binding.tado.internal.api.model.User; import org.openhab.binding.tado.internal.config.TadoHomeConfig; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,10 +50,13 @@ public class TadoHomeHandler extends BaseBridgeHandler { private HomeApi api; private Long homeId; + private TadoBatteryChecker batteryChecker; + private ScheduledFuture<?> initializationFuture; public TadoHomeHandler(Bridge bridge) { super(bridge); + batteryChecker = new TadoBatteryChecker(this); } public TemperatureUnit getTemperatureUnit() { @@ -126,4 +133,9 @@ public Long getHomeId() { public void handleCommand(ChannelUID channelUID, Command command) { // Nothing to do for a bridge } + + public State getBatteryLowAlarm(long zoneId) { + return batteryChecker.getBatteryLowAlarm(zoneId); + } + } diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoMobileDeviceHandler.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoMobileDeviceHandler.java index ce0ea9a68b333..0b9bb4b2e4e75 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoMobileDeviceHandler.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoMobileDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoZoneHandler.java b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoZoneHandler.java index 8d73af6a9025a..11a11703e0d8c 100644 --- a/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoZoneHandler.java +++ b/bundles/org.openhab.binding.tado/src/main/java/org/openhab/binding/tado/internal/handler/TadoZoneHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -42,6 +42,7 @@ import org.openhab.binding.tado.internal.TadoHvacChange; import org.openhab.binding.tado.internal.adapter.TadoZoneStateAdapter; import org.openhab.binding.tado.internal.api.ApiException; +import org.openhab.binding.tado.internal.api.client.HomeApi; import org.openhab.binding.tado.internal.api.model.GenericZoneCapabilities; import org.openhab.binding.tado.internal.api.model.Overlay; import org.openhab.binding.tado.internal.api.model.OverlayTemplate; @@ -56,6 +57,8 @@ * The {@link TadoZoneHandler} is responsible for handling commands of zones and update their state. * * @author Dennis Frommknecht - Initial contribution + * @author Andrew Fiddian-Green - Added Low Battery Alarm, A/C Power and Open Window channels + * */ public class TadoZoneHandler extends BaseHomeThingHandler { private Logger logger = LoggerFactory.getLogger(TadoZoneHandler.class); @@ -64,7 +67,6 @@ public class TadoZoneHandler extends BaseHomeThingHandler { private ScheduledFuture<?> refreshTimer; private ScheduledFuture<?> scheduledHvacChange; private GenericZoneCapabilities capabilities; - TadoHvacChange pendingHvacChange; public TadoZoneHandler(Thing thing) { @@ -90,7 +92,8 @@ public OverlayTerminationCondition getDefaultTerminationCondition() throws IOExc } public ZoneState getZoneState() throws IOException, ApiException { - return getApi().showZoneState(getHomeId(), getZoneId()); + HomeApi api = getApi(); + return api != null ? api.showZoneState(getHomeId(), getZoneId()) : null; } public GenericZoneCapabilities getZoneCapabilities() { @@ -232,7 +235,9 @@ private void updateZoneState(boolean forceUpdate) { TadoZoneStateAdapter state = new TadoZoneStateAdapter(zoneState, getTemperatureUnit()); updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_CURRENT_TEMPERATURE, state.getInsideTemperature()); updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_HUMIDITY, state.getHumidity()); + updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_HEATING_POWER, state.getHeatingPower()); + updateStateIfNotNull(TadoBindingConstants.CHANNEL_ZONE_AC_POWER, state.getAcPower()); updateState(TadoBindingConstants.CHANNEL_ZONE_OPERATION_MODE, state.getOperationMode()); @@ -245,11 +250,18 @@ private void updateZoneState(boolean forceUpdate) { updateState(TadoBindingConstants.CHANNEL_ZONE_OVERLAY_EXPIRY, state.getOverlayExpiration()); + updateState(TadoBindingConstants.CHANNEL_ZONE_OPEN_WINDOW_DETECTED, state.getOpenWindowDetected()); + onSuccessfulOperation(); } catch (IOException | ApiException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Could not connect to server due to " + e.getMessage()); } + + TadoHomeHandler home = getHomeHandler(); + if (home != null) { + updateState(TadoBindingConstants.CHANNEL_ZONE_BATTERY_LOW_ALARM, home.getBatteryLowAlarm(getZoneId())); + } } private void scheduleZoneStateUpdate() { diff --git a/bundles/org.openhab.binding.tado/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.tado/src/main/resources/ESH-INF/thing/thing-types.xml index 847511cbd64aa..4615a260ffa20 100644 --- a/bundles/org.openhab.binding.tado/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.tado/src/main/resources/ESH-INF/thing/thing-types.xml @@ -10,7 +10,7 @@ <config-description> <parameter name="username" type="text" required="true"> - <label>User name</label> + <label>User Name</label> <description>User name of tado login used for API access</description> </parameter> @@ -45,6 +45,14 @@ <channel typeId="timerDuration" id="timerDuration"></channel> <channel typeId="operationMode" id="operationMode"></channel> + + <channel typeId="system.low-battery" id="batteryLowAlarm"> + <label>Battery Low Alarm</label> + <description>ON if one or more devices in the zone have a low battery</description> + </channel> + + <channel typeId="acPower" id="acPower"></channel> + <channel typeId="openWindowDetected" id="openWindowDetected"></channel> </channels> <config-description> @@ -53,19 +61,19 @@ <description>Id of the zone</description> </parameter> <parameter name="refreshInterval" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval of home data</description> <default>30</default> <advanced>true</advanced> </parameter> <parameter name="fallbackTimerDuration" type="integer"> - <label>Fallback timer duration</label> + <label>Fallback Timer Duration</label> <description>Timer duration used if no other duration can be determined</description> <default>30</default> <advanced>true</advanced> </parameter> <parameter name="hvacChangeDebounce" type="integer"> - <label>HVAC Change debounce delay</label> + <label>HVAC Change Debounce Delay</label> <description>Duration in seconds to combine multiple HVAC changes into one.</description> <default>5</default> <advanced>true</advanced> @@ -91,7 +99,7 @@ <description>Id of the mobile device</description> </parameter> <parameter name="refreshInterval" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval of location state</description> <default>60</default> <advanced>true</advanced> @@ -148,7 +156,7 @@ <channel-type id="fanspeed"> <item-type>String</item-type> - <label>Fan speed</label> + <label>Fan Speed</label> <description>AC fan speed (only if supported by AC)</description> <state readOnly="false"> <options> @@ -189,15 +197,30 @@ <channel-type id="overlayExpiry"> <item-type>DateTime</item-type> - <label>Overlay end time</label> + <label>Overlay End Time</label> <description>Time until when the overlay is active. Null if no overlay is set or overlay type is manual.</description> <state readOnly="true" pattern="%1$tF %1$tR" /> </channel-type> <channel-type id="atHome"> <item-type>Switch</item-type> - <label>At home</label> + <label>At Home</label> <description>ON if at home, OFF if away</description> </channel-type> + <channel-type id="acPower"> + <item-type>Switch</item-type> + <label>AirCon Power State</label> + <description>Indicates if the air-conditioning is Off or On</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="openWindowDetected"> + <item-type>Switch</item-type> + <label>Open Window Detected</label> + <description>Indicates if an open window has been detected</description> + <category>window</category> + <state readOnly="true"></state> + </channel-type> + </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tankerkoenig/NOTICE b/bundles/org.openhab.binding.tankerkoenig/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.tankerkoenig/NOTICE +++ b/bundles/org.openhab.binding.tankerkoenig/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.tankerkoenig/README.md b/bundles/org.openhab.binding.tankerkoenig/README.md index a638f4bc3d02d..e7ae11d68aa95 100644 --- a/bundles/org.openhab.binding.tankerkoenig/README.md +++ b/bundles/org.openhab.binding.tankerkoenig/README.md @@ -114,31 +114,31 @@ java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLH ...... ``` -This indicates a missing certificate of a certification authority (CA) in the certificate-store of the java jdk under which openHAB is running. -In most cases, updating to the latest version of jdk solves this because the store of cacerts are maintained and updated in java releases. +This indicates a missing certificate of a certification authority (CA) in the certificate-store of the Java JDK under which openHAB is running. +In most cases, updating to the latest version of JDK solves this because the store of cacerts are maintained and updated in Java releases. -Note: You must restart openHAB after a java update. +Note: You must restart openHAB after a Java update. -If you receive the error because you are running an old linux installation which does not have the latest java-versions available in its package-repositories, you may be able to fix the issue using one of the three options below: +If you receive the error because you are running an old Linux installation which does not have the latest java-versions available in its package-repositories, you may be able to fix the issue using one of the three options below: - 1.) Update the linux-system and install the latest java-versions + 1.) Update the Linux system and install the latest Java version - 2.) Download the most recent jdk and install it directly on to your system without using a pre-composed package + 2.) Download the most recent JDK and install it directly on to your system without using a pre-composed package - On debian based systems one can use: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html + On Debian based systems one can use: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html 3.) Update the cacerts store by importing the missing certificate Note: Using this version, loaded certificates will expire! If you still want to import the missing certificate, the example below may help: - Check which java package you have installed: + Check which Java package you have installed: ```java >> sudo dpkg -l | grep java >> ii oracle-java8-jdk 8u65 armhf Javaâ„¢ Platform, Standard Edition 8 Development Kit ``` -Find the ca-store of your jdk +Find the ca-store of your JDK ```java >> sudo dpkg -L oracle-java8-jdk | grep cacerts @@ -168,7 +168,7 @@ Restart your server Either the web-request to Tankerkönig returned a failure or no valid response was received (this could be caused by a banned API-key). In both cases the Webservice and the Station(s) go OFFLINE. -If the Tankerkönig return indicates an error a descriptive message (in German) is added next to the OFFLINE which will be displayed on the Webservice and Station(s) pages on PaperUI. +If the Tankerkönig return indicates an error a descriptive message (in German) is added next to the OFFLINE which will be displayed on the Webservice and Station(s) pages on Paper UI. On the next receipt of a valid message Webservice and Station(s) will go ONLINE again. The scheduled polling of price-data is canceled in case of no valid response. Users should check the log for any reports to solve the reason for the OFFLINE status. @@ -180,7 +180,7 @@ Note: If the API-key is banned by Tankerkönig, the reason has to be cleared wit The correct usage of opening times needs the information if the actual day is a holiday. The binding expects a switch item linked to the Webservice channel holiday. -This switch can be set either manually (only suggested for testing!), by a rule [openHAB1-addons rules] or by the usage of the CALDAV binding with a calendar. +This switch can be set either manually (only suggested for testing!) or by a rule which uses the [ephemeris action](https://www.openhab.org/docs/configuration/actions.html#ephemeris) to set that switch. ## Tankerkönig API diff --git a/bundles/org.openhab.binding.tankerkoenig/pom.xml b/bundles/org.openhab.binding.tankerkoenig/pom.xml index 5cf01ef29641f..64def54491cc6 100644 --- a/bundles/org.openhab.binding.tankerkoenig/pom.xml +++ b/bundles/org.openhab.binding.tankerkoenig/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tankerkoenig</artifactId> diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/feature/feature.xml b/bundles/org.openhab.binding.tankerkoenig/src/main/feature/feature.xml index 94aa121ccd29d..ec5018cae257d 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tankerkoenig-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tankerkoenig" description="Tankerkoenig Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigBindingConstants.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigBindingConstants.java index 707c7bcff48f5..8ae5c917fe8d2 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigBindingConstants.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigHandlerFactory.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigHandlerFactory.java index 4c253103eedee..aa472a47a9929 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigHandlerFactory.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/TankerkoenigHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/LittleStation.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/LittleStation.java index 51f93b1f1f871..1a3b0418e3d32 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/LittleStation.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/LittleStation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTime.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTime.java index a20c9cb7fce09..e638ca7ec4568 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTime.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTimes.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTimes.java index 3e477bf892c8f..575bee9e59d70 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTimes.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/OpeningTimes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Prices.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Prices.java index 770d6e1ffd566..17c0aab9c5064 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Prices.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Prices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Station.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Station.java index 0052a593ba37d..80a8f5b29e649 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Station.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/Station.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigDetailResult.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigDetailResult.java index 86ec2a31ad0b2..086a871d1abec 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigDetailResult.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigDetailResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigListResult.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigListResult.java index fd436fddec9a0..336a8e79e9d0b 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigListResult.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/config/TankerkoenigListResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/data/TankerkoenigService.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/data/TankerkoenigService.java index ef2c06b1ec50a..053b62451b969 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/data/TankerkoenigService.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/data/TankerkoenigService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/StationHandler.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/StationHandler.java index 43c7cc3269a7f..6621be11f18d6 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/StationHandler.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/StationHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -95,8 +95,7 @@ public void initialize() { logger.debug("Try to refresh detail data"); updateDetailData(); } catch (RuntimeException r) { - logger.debug("Caught exception in ScheduledExecutorService of TankerkoenigHandler. RuntimeExcetion: {}", - r); + logger.debug("Caught exception in ScheduledExecutorService of TankerkoenigHandler", r); // no status change, since in case of error in here, // the old values for opening time will be continue to be used } diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/WebserviceHandler.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/WebserviceHandler.java index 7e36423bc8cf4..bb52860fcb53e 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/WebserviceHandler.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/handler/WebserviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigDetailResultDeserializer.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigDetailResultDeserializer.java index 4f2e03332f8d5..5d788c9b5df0f 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigDetailResultDeserializer.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigDetailResultDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigListResultDeserializer.java b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigListResultDeserializer.java index 57f73ed918b80..82f9ec4a91dc7 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigListResultDeserializer.java +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/java/org/openhab/binding/tankerkoenig/internal/serializer/CustomTankerkoenigListResultDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/station.xml b/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/station.xml index ab2763cfef740..c570dcead8650 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/station.xml +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/station.xml @@ -42,7 +42,7 @@ </channel-type> <channel-type id="station_open"> <item-type>Contact</item-type> - <label>Opening state</label> + <label>Opening State</label> <description>The reported opening-state of that Station.</description> <state pattern="%s" readOnly="true"></state> </channel-type> diff --git a/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/webservice.xml b/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/webservice.xml index 12d93dd3e967a..16663200e13d2 100644 --- a/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/webservice.xml +++ b/bundles/org.openhab.binding.tankerkoenig/src/main/resources/ESH-INF/thing/webservice.xml @@ -2,7 +2,7 @@ <thing:thing-descriptions bindingId="tankerkoenig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="webservice"> <label>Tankerkönig Webservice</label> <description>The Tankerkönig Webservice can handle 1 to 10 gas stations.</description> diff --git a/bundles/org.openhab.binding.telegram/.classpath b/bundles/org.openhab.binding.telegram/.classpath new file mode 100644 index 0000000000000..5d788f3a5f722 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/.classpath @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <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="test" value="true"/> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" 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="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="target/generated-sources/annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + <attribute name="ignore_optional_problems" value="true"/> + <attribute name="m2e-apt" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + <attribute name="ignore_optional_problems" value="true"/> + <attribute name="m2e-apt" value="true"/> + <attribute name="test" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/bundles/org.openhab.binding.telegram/.project b/bundles/org.openhab.binding.telegram/.project new file mode 100644 index 0000000000000..bdbfb24eed036 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.telegram</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> diff --git a/bundles/org.openhab.binding.telegram/NOTICE b/bundles/org.openhab.binding.telegram/NOTICE new file mode 100644 index 0000000000000..e433653cb7bf1 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/NOTICE @@ -0,0 +1,25 @@ +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 + +== Third-party Content + +Java Telegram Bot API +* License: Apache License 2.0 +* Project: https://github.com/pengrad/java-telegram-bot-api +* Source: https://github.com/pengrad/java-telegram-bot-api + +okhttp +* License: Apache License 2.0 +* Project: https://square.github.io/okhttp/ +* Source: https://github.com/square/okhttp \ No newline at end of file diff --git a/bundles/org.openhab.binding.telegram/README.md b/bundles/org.openhab.binding.telegram/README.md new file mode 100644 index 0000000000000..6b4874b38bd73 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/README.md @@ -0,0 +1,285 @@ +# Telegram Binding + +The Telegram binding allows sending and receiving messages to and from Telegram clients (https://telegram.org), by using the Telegram Bot API. + +# Prerequisites + +As described in the Telegram Bot API, this is the manual procedure needed in order to get the necessary information. + +1. Create the Bot and get the Token + +- On a Telegram client open a chat with BotFather. +- Send `/newbot` to BotFather and fill in all the needed information. The authentication token that is given will be needed in the next steps. + +2. Create the destination chat + +- Open a chat with your new Bot and send any message to it. The next step will not work unless you send a message to your bot first. + +3. Get the chatId + +- Open a browser and invoke `https://api.telegram.org/bot<token>/getUpdates` (where `<token>` is the authentication token previously obtained) +- Look at the JSON result to find the value of `id`. That is the chatId. Note that if using a Telegram group chat, the group chatIds are prefixed with a dash that must be included in the config file. (e.g. bot1.chatId: -22334455) + +4. Test the bot + +- Open this URL in your web browser, replacing <token> with the authentication token and <chatId> with the chatId: +- `https://api.telegram.org/bot<token>/sendMessage?chat_id=<chatId>&text=testing` +- Your Telegram-bot should send you a message with the text: `testing` + +**Notice:** By default your bot will only receive messages that either start with the '/' symbol or mention the bot by username (or if you talk to it directly). However, if you add your bot to a group you must either talk to BotFather and send the command "/setprivacy" and then disable it or you give admin rights to your bot in that group. Otherwise you will not be able to receive those messages. + +## Supported Things + +**telegramBot** - A Telegram Bot that can send and receive messages. + +The Telegram binding supports the following things which origin from the latest message sent to the Telegram bot: + +* message text +* message date +* full name of sender (first name + last name) +* username of sender +* chat id (used to identify the chat of the last message) +* reply id (used to identify an answer from a user of a previously sent message by the binding) + +Please note that the things cannot be used to send messages. In order to send a message, an action must be used instead. + +## Thing Configuration + +**telegramBot** parameters: + +| Property | Default | Required | Description | +|-------------------------|---------|:--------:|----------------------------------------------------------------------------------------------| +| `chatIds` | | Yes | Comma-separated list of chat ids | +| `botToken` | | Yes | authentication token | +| `parseMode` | None | No | Support for formatted messages, values: Markdown or HTML. | + +## Channels + +| Channel Type ID | Item Type | Description | +|--------------------------------------|-----------|-----------------------------------------------------------------| +| lastMessageText | String | The last received message | +| lastMessageDate | DateTime | The date of the last received message (UTC) | +| lastMessageName | String | The full name of the sender of the last received message | +| lastMessageUsername | String | The username of the sender of the last received message | +| chatId | String | The id of the chat of the last received meesage | +| replyId | String | The id of the reply which was passed to sendTelegram() as replyId argument. This id can be used to have an unambiguous assignment of the users reply to the message which was sent by the bot | + + +## Rule Actions + +This binding includes a rule action, which allows to send Telegram messages from within rules. + +``` +val telegramAction = getActions("telegram","telegram:telegramBot:<uid>") +``` + +where uid is the Thing UID of the Telegram thing (not the chat id!). + + +Once this action instance is retrieved, you can invoke the `sendTelegram' method on it: + +``` +telegramAction.sendTelegram("Hello world!") +``` + +The following actions are supported. +Each of the actions returns true on success or false on failure. + +### Actions to send messages to all configured chats + +These actions will send a message to all chat ids configured for this bot. + +| Action | Description | +|----------------------------|--------------| +| sendTelegram(String message) | Sends a message. | +| sendTelegram(String format, Object... args) | Sends a formatted message (See https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html for more information). +| sendTelegramQuery(String message, String replyId, String... buttons) | Sends a question to the user that can be answered via the defined buttons. The replyId can be freely choosen and is sent back with the answer. Then, the id is required to identify what question has been answered (e.g. in case of multiple open questions). The final result looks like this: ![Telegram Inline Keyboard](doc/queryExample.png). | +| sendTelegramAnswer(String replyId, String message) | Sends a message after the user has answered a question. You should *always* call this method after you received an answer. It will remove buttons from the specific question and will also stop the progress bar displayed at the client side. If no message is necessary, just pass `null` here. | +| sendTelegramPhoto(String photoURL, String caption) | Sends a picture. The URL can be specified using the http, https, and file protocols or a base64 encoded image (simple base64 data or data URI scheme). | +| sendTelegramPhoto(String photoURL, String caption, String username, String password) | Sends a picture which is downloaded from a username/password protected http/https address. | + +### Actions to send messages to a particular chat + +Just put the chat id (must be a long value!) as the first argument to one of the above mentioned APIs: + +``` +telegramAction.sendTelegram(1234567L, "Hello world!") +``` + +## Full Example + +### Send a text message to telegram chat + +telegram.rules + +```java +rule "Send telegram with Fixed Message" +when + Item Foo changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegram("item Foo changed") +end +``` + +### Send a text message with a formatted message + +telegram.rules + +```java +rule "Send telegram with Formatted Message" +when + Item Foo changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegram("item Foo changed to %s and number is %.1f", Foo.state.toString, 23.56) +end +``` + +### Send an image to telegram chat + +`http`, `https`, and `file` are the only protocols allowed or a base64 encoded image. + +telegram.rules + +```java +rule "Send telegram with image and caption from image accessible by url" +when + Item Light_GF_Living_Table changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramPhoto("http://www.openhab.org/assets/images/openhab-logo-top.png", + "sent from openHAB") +end +``` + +telegram.rules + +```java +rule "Send telegram with image without caption from image accessible by url" +when + Item Light_GF_Living_Table changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramPhoto("http://www.openhab.org/assets/images/openhab-logo-top.png", + null) +end +``` + +telegram.rules + +```java +rule "Send telegram with image from password protected http source" +when + Item Light_GF_Living_Table changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramPhoto("http://192.168.1.5/doorcam/picture.jpg", "Door Camera", "user", "mypassword") +end +``` + +To send a base64 jpeg or png image: + +telegram.rules + +```java +rule "Send telegram with base64 image and caption" +when + Item Light_GF_Living_Table changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + // image as base64 string + var String base64Image = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAS1BMVEUAAABAQEA9QUc7P0Y0OD88QEY+QUhmaW7c3N3w8PBlaG0+QUjb29w5PUU3O0G+vsigoas6P0WfoKo4O0I9QUdkZ2w9Qkg+QkkkSUnT3FKbAAAAGXRSTlMACJbx//CV9v//9pT/7Ur//+z/SfD2kpMHrnfDaAAAAGhJREFUeAHt1bUBAzAMRFGZmcL7LxpOalN5r/evLIlgGwBgXMhxSjP64sa6cdYH+hLWzYiKvqSbI4kQeEt5PlBealsMFIkAAgi8HNriOLcjduLTafWwBB9n3p8v/+Ma1Mxxvd4IAGCzB4xDPuBRkEZiAAAAAElFTkSuQmCC" + telegramAction.sendTelegramPhoto(base64Image, "battery of motion sensor is empty") + + // image as base64 string in data URI scheme + var String base64ImageDataURI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAS1BMVEUAAABAQEA9QUc7P0Y0OD88QEY+QUhmaW7c3N3w8PBlaG0+QUjb29w5PUU3O0G+vsigoas6P0WfoKo4O0I9QUdkZ2w9Qkg+QkkkSUnT3FKbAAAAGXRSTlMACJbx//CV9v//9pT/7Ur//+z/SfD2kpMHrnfDaAAAAGhJREFUeAHt1bUBAzAMRFGZmcL7LxpOalN5r/evLIlgGwBgXMhxSjP64sa6cdYH+hLWzYiKvqSbI4kQeEt5PlBealsMFIkAAgi8HNriOLcjduLTafWwBB9n3p8v/+Ma1Mxxvd4IAGCzB4xDPuBRkEZiAAAAAElFTkSuQmCC" + telegramAction.sendTelegramPhoto(base64ImageDataURI, "battery of motion sensor is empty") +end +``` + +To send an image that resides on the local computer file system: + +telegram.rules + +```java +rule "Send telegram with local image and caption" +when + Item Light_GF_Living_Table changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramPhoto("file://C:/mypicture.jpg", "sent from openHAB") +end +``` + +To send an image based on an Image Item: + +telegram.rules + +```java +rule "Send telegram with Image Item image and caption" +when + Item Webcam_Image changed +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramPhoto(Webcam_Image.state.toFullString, "sent from openHAB") +end +``` + +To receive a message and react on that: + +telegram.items + +```php +String telegramMessage "Telegram Message" { channel = "telegram:telegramBot:2b155b22:lastMessageText" } +``` + +telegram.rules + +```java +rule "Receive telegram" +when + Item telegramMessage received update "lights off" +then + gLights.sendCommand(OFF) +end +``` + +To send a question with two alternatives and a reply from the bot: + +telegram.items + +```php +String telegramReplyId "Telegram Reply Id" { channel = "telegram:telegramBot:2b155b22:replyId" } +``` + +telegram.rules + +```java +rule "Send telegram with question" +when + Item Presence changed to OFF +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + telegramAction.sendTelegramQuery("No one is at home, but some lights are still on. Do you want me to turn off the lights?", "Reply_Lights", "Yes", "No") +end + + +rule "Reply handler for lights" +when + Item telegramReplyId received update Reply_Lights +then + val telegramAction = getActions("telegram","telegram:telegramBot:2b155b22") + + if (telegramMessage.state.toString == "Yes") + { + gLights.sendCommand(OFF) + telegramAction.sendTelegramAnswer(telegramReplyId.state.toString, "Ok, lights are *off* now.") + } + else + { + telegramAction.sendTelegramAnswer(telegramReplyId.state.toString, "Ok, I'll leave them *on*.") + } +end +``` + diff --git a/bundles/org.openhab.binding.telegram/doc/queryExample.png b/bundles/org.openhab.binding.telegram/doc/queryExample.png new file mode 100644 index 0000000000000..eb76c72d7bb3c Binary files /dev/null and b/bundles/org.openhab.binding.telegram/doc/queryExample.png differ diff --git a/bundles/org.openhab.binding.telegram/pom.xml b/bundles/org.openhab.binding.telegram/pom.xml new file mode 100644 index 0000000000000..91948452022f3 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/pom.xml @@ -0,0 +1,47 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.telegram</artifactId> + + <name>openHAB Add-ons :: Bundles :: Telegram Binding</name> + + <properties> + <bnd.importpackage>!android.*,!com.android.org.*,!dalvik.*,!javax.annotation.meta.*,!org.apache.harmony.*,!org.conscrypt.*,!sun.*</bnd.importpackage> + </properties> + + <dependencies> + <dependency> + <groupId>com.github.pengrad</groupId> + <artifactId>java-telegram-bot-api</artifactId> + <version>4.4.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>3.12.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.squareup.okio</groupId> + <artifactId>okio</artifactId> + <version>1.15.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>logging-interceptor</artifactId> + <version>3.12.3</version> + <scope>compile</scope> + </dependency> + </dependencies> +</project> \ No newline at end of file diff --git a/bundles/org.openhab.binding.telegram/src/main/feature/feature.xml b/bundles/org.openhab.binding.telegram/src/main/feature/feature.xml new file mode 100644 index 0000000000000..e3f4686b3141d --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/feature/feature.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.telegram-${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-telegram" description="Telegram Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.telegram/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/bot/TelegramActions.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/bot/TelegramActions.java new file mode 100644 index 0000000000000..d445ddd24ba4b --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/bot/TelegramActions.java @@ -0,0 +1,507 @@ +/** + * 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.telegram.bot; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; +import java.util.Base64; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.apache.commons.io.IOUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.Authentication; +import org.eclipse.jetty.client.api.AuthenticationStore; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.util.B64Code; +import org.eclipse.smarthome.core.thing.binding.ThingActions; +import org.eclipse.smarthome.core.thing.binding.ThingActionsScope; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.openhab.binding.telegram.internal.TelegramHandler; +import org.openhab.core.automation.annotation.ActionInput; +import org.openhab.core.automation.annotation.RuleAction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.pengrad.telegrambot.model.request.InlineKeyboardButton; +import com.pengrad.telegrambot.model.request.InlineKeyboardMarkup; +import com.pengrad.telegrambot.request.AnswerCallbackQuery; +import com.pengrad.telegrambot.request.EditMessageReplyMarkup; +import com.pengrad.telegrambot.request.SendMessage; +import com.pengrad.telegrambot.request.SendPhoto; +import com.pengrad.telegrambot.response.BaseResponse; +import com.pengrad.telegrambot.response.SendResponse; + +/** + * Provides the actions for the Telegram API. + * + * @author Alexander Krasnogolowy - Initial contribution + * + */ +@ThingActionsScope(name = "telegram") +@NonNullByDefault +public class TelegramActions implements ThingActions { + private final Logger logger = LoggerFactory.getLogger(TelegramActions.class); + private @Nullable TelegramHandler handler; + + private boolean evaluateResponse(@Nullable BaseResponse response) { + if (response != null && !response.isOk()) { + logger.warn("Failed to send telegram message: {}", response.description()); + return false; + } + return true; + } + + @NonNullByDefault + private static class BasicResult implements Authentication.Result { + + private final HttpHeader header; + private final URI uri; + private final String value; + + public BasicResult(HttpHeader header, URI uri, String value) { + this.header = header; + this.uri = uri; + this.value = value; + } + + @Override + public URI getURI() { + return this.uri; + } + + @Override + public void apply(@Nullable Request request) { + if (request != null) { + request.header(this.header, this.value); + } + } + + public String toString() { + return String.format("Basic authentication result for %s", this.uri); + } + } + + @RuleAction(label = "Telegram answer", description = "Sends a Telegram answer via Telegram API") + public boolean sendTelegramAnswer(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "replyId") @Nullable String replyId, + @ActionInput(name = "message") @Nullable String message) { + if (replyId == null) { + logger.warn("ReplyId not defined; action skipped."); + return false; + } + if (chatId == null) { + logger.warn("chatId not defined; action skipped."); + return false; + } + TelegramHandler localHandler = handler; + if (localHandler != null) { + String callbackId = localHandler.getCallbackId(chatId, replyId); + if (callbackId != null) { + AnswerCallbackQuery answerCallbackQuery = new AnswerCallbackQuery( + localHandler.getCallbackId(chatId, replyId)); + logger.debug("AnswerCallbackQuery for chatId {} and replyId {} is the callbackId {}", chatId, replyId, + localHandler.getCallbackId(chatId, replyId)); + // we could directly set the text here, but this + // doesn't result in a real message only in a + // little popup or in an alert, so the only purpose + // is to stop the progress bar on client side + if (!evaluateResponse(localHandler.execute(answerCallbackQuery))) { + return false; + } + } + Integer messageId = localHandler.removeMessageId(chatId, replyId); + logger.debug("remove messageId {} for chatId {} and replyId {}", messageId, chatId, replyId); + + EditMessageReplyMarkup editReplyMarkup = new EditMessageReplyMarkup(chatId, messageId.intValue()) + .replyMarkup(new InlineKeyboardMarkup(new InlineKeyboardButton[0]));// remove reply markup from + // old message + if (!evaluateResponse(localHandler.execute(editReplyMarkup))) { + return false; + } + return message != null ? sendTelegram(chatId, message) : true; + } + return false; + } + + @RuleAction(label = "Telegram answer", description = "Sends a Telegram answer via Telegram API") + public boolean sendTelegramAnswer(@ActionInput(name = "replyId") @Nullable String replyId, + @ActionInput(name = "message") @Nullable String message) { + TelegramHandler localHandler = handler; + if (localHandler != null) { + for (Long chatId : localHandler.getChatIds()) { + if (!sendTelegramAnswer(chatId, replyId, message)) { + return false; + } + } + } + return true; + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegram(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "message") @Nullable String message) { + return sendTelegramGeneral(chatId, message, (String) null); + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegram(@ActionInput(name = "message") @Nullable String message) { + TelegramHandler localHandler = handler; + if (localHandler != null) { + for (Long chatId : localHandler.getChatIds()) { + if (!sendTelegram(chatId, message)) { + return false; + } + } + } + return true; + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegramQuery(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "message") @Nullable String message, + @ActionInput(name = "replyId") @Nullable String replyId, + @ActionInput(name = "buttons") @Nullable String... buttons) { + return sendTelegramGeneral(chatId, message, replyId, buttons); + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegramQuery(@ActionInput(name = "message") @Nullable String message, + @ActionInput(name = "replyId") @Nullable String replyId, + @ActionInput(name = "buttons") @Nullable String... buttons) { + TelegramHandler localHandler = handler; + if (localHandler != null) { + for (Long chatId : localHandler.getChatIds()) { + if (!sendTelegramQuery(chatId, message, replyId, buttons)) { + return false; + } + } + } + return true; + } + + private boolean sendTelegramGeneral(@ActionInput(name = "chatId") @Nullable Long chatId, @Nullable String message, + @Nullable String replyId, @Nullable String... buttons) { + if (message == null) { + logger.warn("Message not defined; action skipped."); + return false; + } + if (chatId == null) { + logger.warn("chatId not defined; action skipped."); + return false; + } + TelegramHandler localHandler = handler; + if (localHandler != null) { + SendMessage sendMessage = new SendMessage(chatId, message); + if (localHandler.getParseMode() != null) { + sendMessage.parseMode(localHandler.getParseMode()); + } + if (replyId != null) { + if (!replyId.contains(" ")) { + if (buttons.length > 0) { + InlineKeyboardButton[][] keyboard2D = new InlineKeyboardButton[1][]; + InlineKeyboardButton[] keyboard = new InlineKeyboardButton[buttons.length]; + keyboard2D[0] = keyboard; + for (int i = 0; i < buttons.length; i++) { + keyboard[i] = new InlineKeyboardButton(buttons[i]).callbackData(replyId + " " + buttons[i]); + } + InlineKeyboardMarkup keyBoardMarkup = new InlineKeyboardMarkup(keyboard2D); + sendMessage.replyMarkup(keyBoardMarkup); + } else { + logger.warn( + "The replyId {} for message {} is given, but no buttons are defined. ReplyMarkup will be ignored.", + replyId, message); + } + } else { + logger.warn("replyId {} must not contain spaces. ReplyMarkup will be ignored.", replyId); + } + } + SendResponse retMessage = localHandler.execute(sendMessage); + if (!evaluateResponse(retMessage)) { + return false; + } + if (replyId != null && retMessage != null) { + logger.debug("Adding chatId {}, replyId {} and messageId {}", chatId, replyId, + retMessage.message().messageId()); + localHandler.addMessageId(chatId, replyId, retMessage.message().messageId()); + } + return true; + } + return false; + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegram(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "message") @Nullable String format, + @ActionInput(name = "args") @Nullable Object... args) { + return sendTelegram(chatId, String.format(format, args)); + } + + @RuleAction(label = "Telegram message", description = "Sends a Telegram via Telegram API") + public boolean sendTelegram(@ActionInput(name = "message") @Nullable String format, + @ActionInput(name = "args") @Nullable Object... args) { + TelegramHandler localHandler = handler; + if (localHandler != null) { + for (Long chatId : localHandler.getChatIds()) { + if (!sendTelegram(chatId, format, args)) { + return false; + } + } + } + return true; + } + + @RuleAction(label = "Telegram photo", description = "Sends a Picture via Telegram API") + public boolean sendTelegramPhoto(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "photoURL") @Nullable String photoURL, + @ActionInput(name = "caption") @Nullable String caption) { + return sendTelegramPhoto(chatId, photoURL, caption, null, null); + } + + @RuleAction(label = "Telegram photo", description = "Sends a Picture via Telegram API") + public boolean sendTelegramPhoto(@ActionInput(name = "chatId") @Nullable Long chatId, + @ActionInput(name = "photoURL") @Nullable String photoURL, + @ActionInput(name = "caption") @Nullable String caption, + @ActionInput(name = "username") @Nullable String username, + @ActionInput(name = "password") @Nullable String password) { + if (photoURL == null) { + logger.warn("Photo URL not defined; unable to retrieve photo for sending."); + return false; + } + if (chatId == null) { + logger.warn("chatId not defined; action skipped."); + return false; + } + + TelegramHandler localHandler = handler; + if (localHandler != null) { + final SendPhoto sendPhoto; + + if (photoURL.toLowerCase().startsWith("http")) { + // load image from url + logger.debug("Photo URL provided."); + HttpClient client = localHandler.getClient(); + if (client == null) { + return false; + } + Request request = client.newRequest(photoURL).method(HttpMethod.GET).timeout(30, TimeUnit.SECONDS); + if (username != null && password != null) { + AuthenticationStore auth = client.getAuthenticationStore(); + URI uri = URI.create(photoURL); + auth.addAuthenticationResult(new BasicResult(HttpHeader.AUTHORIZATION, uri, + "Basic " + B64Code.encode(username + ":" + password, StandardCharsets.ISO_8859_1))); + } + try { + ContentResponse contentResponse = request.send(); + if (contentResponse.getStatus() == 200) { + byte[] fileContent = contentResponse.getContent(); + sendPhoto = new SendPhoto(chatId, fileContent); + } else { + logger.warn("Download from {} failed with status: {}", photoURL, contentResponse.getStatus()); + return false; + } + } catch (InterruptedException | TimeoutException | ExecutionException e) { + logger.warn("Download from {} failed with exception: {}", photoURL, e.getMessage()); + return false; + } + } else if (photoURL.toLowerCase().startsWith("file")) { + // Load image from local file system + logger.debug("Read file from local file system: {}", photoURL); + try { + URL url = new URL(photoURL); + sendPhoto = new SendPhoto(chatId, Paths.get(url.getPath()).toFile()); + } catch (MalformedURLException e) { + logger.warn("Malformed URL: {}", photoURL); + return false; + } + } else { + // Load image from provided base64 image + logger.debug("Photo base64 provided; converting to binary."); + final String photoB64Data; + if (photoURL.startsWith("data:")) { // support data URI scheme + String[] photoURLParts = photoURL.split(","); + if (photoURLParts.length > 1) { + photoB64Data = photoURLParts[1]; + } else { + logger.warn("The provided base64 string is not a valid data URI scheme"); + return false; + } + } else { + photoB64Data = photoURL; + } + InputStream is = Base64.getDecoder() + .wrap(new ByteArrayInputStream(photoB64Data.getBytes(StandardCharsets.UTF_8))); + try { + byte[] photoBytes = IOUtils.toByteArray(is); + sendPhoto = new SendPhoto(chatId, photoBytes); + } catch (IOException e) { + logger.warn("Malformed base64 string: {}", e.getMessage()); + return false; + } + } + sendPhoto.caption(caption); + if (localHandler.getParseMode() != null) { + sendPhoto.parseMode(localHandler.getParseMode()); + } + return evaluateResponse(localHandler.execute(sendPhoto)); + } + return false; + } + + @RuleAction(label = "Telegram photo", description = "Sends a Picture via Telegram API") + public boolean sendTelegramPhoto(@ActionInput(name = "photoURL") @Nullable String photoURL, + @ActionInput(name = "caption") @Nullable String caption, + @ActionInput(name = "username") @Nullable String username, + @ActionInput(name = "password") @Nullable String password) { + TelegramHandler localHandler = handler; + if (localHandler != null) { + for (Long chatId : localHandler.getChatIds()) { + if (!sendTelegramPhoto(chatId, photoURL, caption, username, password)) { + return false; + } + } + } + return true; + } + + @RuleAction(label = "Telegram photo", description = "Sends a Picture via Telegram API") + public boolean sendTelegramPhoto(@ActionInput(name = "photoURL") @Nullable String photoURL, + @ActionInput(name = "caption") @Nullable String caption) { + return sendTelegramPhoto(photoURL, caption, null, null); + } + + // legacy delegate methods + /* APIs without chatId parameter */ + public static boolean sendTelegram(@Nullable ThingActions actions, @Nullable String format, + @Nullable Object... args) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegram(format, args); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramQuery(@Nullable ThingActions actions, @Nullable String message, + @Nullable String replyId, @Nullable String... buttons) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramQuery(message, replyId, buttons); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramPhoto(@Nullable ThingActions actions, @Nullable String photoURL, + @Nullable String caption) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramPhoto(photoURL, caption); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramPhoto(@Nullable ThingActions actions, @Nullable String photoURL, + @Nullable String caption, @Nullable String username, @Nullable String password) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramPhoto(photoURL, caption, username, password); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramAnswer(@Nullable ThingActions actions, @Nullable String replyId, + @Nullable String message) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramAnswer(replyId, message); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + /* APIs with chatId parameter */ + + public static boolean sendTelegram(@Nullable ThingActions actions, @Nullable Long chatId, @Nullable String format, + @Nullable Object... args) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegram(chatId, format, args); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramQuery(@Nullable ThingActions actions, @Nullable Long chatId, + @Nullable String message, @Nullable String replyId, @Nullable String... buttons) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramQuery(chatId, message, replyId, buttons); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramPhoto(@Nullable ThingActions actions, @Nullable Long chatId, + @Nullable String photoURL, @Nullable String caption) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramPhoto(chatId, photoURL, caption); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramPhoto(@Nullable ThingActions actions, @Nullable Long chatId, + @Nullable String photoURL, @Nullable String caption, @Nullable String username, @Nullable String password) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramPhoto(chatId, photoURL, caption, username, password); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramAnswer(@Nullable ThingActions actions, @Nullable Long chatId, + @Nullable String replyId, @Nullable String message) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramAnswer(chatId, replyId, message); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + public static boolean sendTelegramAnswer(@Nullable ThingActions actions, @Nullable String chatId, + @Nullable String replyId, @Nullable String message) { + if (actions instanceof TelegramActions) { + return ((TelegramActions) actions).sendTelegramAnswer(Long.valueOf(chatId), replyId, message); + } else { + throw new IllegalArgumentException("Instance is not a TelegramActions class."); + } + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + this.handler = (TelegramHandler) handler; + } + + @Override + public @Nullable ThingHandler getThingHandler() { + return handler; + } +} diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java new file mode 100644 index 0000000000000..cfdf39a359707 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramBindingConstants.java @@ -0,0 +1,39 @@ +/** + * 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.telegram.internal; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.smarthome.core.thing.ThingTypeUID; + +/** + * The {@link TelegramBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Jens Runge - Initial contribution + */ +@NonNullByDefault +public class TelegramBindingConstants { + + private static final String BINDING_ID = "telegram"; + + // List of all Thing Type UIDs + public static final ThingTypeUID TELEGRAM_THING = new ThingTypeUID(BINDING_ID, "telegramBot"); + + // List of all Channel ids + public static final String LASTMESSAGETEXT = "lastMessageText"; + public static final String LASTMESSAGEDATE = "lastMessageDate"; + public static final String LASTMESSAGENAME = "lastMessageName"; + public static final String LASTMESSAGEUSERNAME = "lastMessageUsername"; + public static final String CHATID = "chatId"; + public static final String REPLYID = "replyId"; +} diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramConfiguration.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramConfiguration.java new file mode 100644 index 0000000000000..4d966d04da58c --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramConfiguration.java @@ -0,0 +1,52 @@ +/** + * 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.telegram.internal; + +import java.util.List; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link TelegramConfiguration} class contains fields mapping thing configuration parameters. + * + * @author Jens Runge - Initial contribution + */ +@NonNullByDefault +public class TelegramConfiguration { + + /** + * Sample configuration parameter. Replace with your own. + */ + private @Nullable String botUsername; + private @Nullable String botToken; + private @Nullable List<String> chatIds; + private String parseMode = ""; + + public @Nullable String getBotUsername() { + return botUsername; + } + + public @Nullable String getBotToken() { + return botToken; + } + + public @Nullable List<String> getChatIds() { + return chatIds; + } + + public String getParseMode() { + return parseMode; + } + +} diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java new file mode 100644 index 0000000000000..3a03f52708fc9 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java @@ -0,0 +1,314 @@ +/** + * 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.telegram.internal; + +import static org.openhab.binding.telegram.internal.TelegramBindingConstants.*; + +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.telegram.bot.TelegramActions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.pengrad.telegrambot.TelegramBot; +import com.pengrad.telegrambot.UpdatesListener; +import com.pengrad.telegrambot.model.Message; +import com.pengrad.telegrambot.model.Update; +import com.pengrad.telegrambot.model.request.ParseMode; +import com.pengrad.telegrambot.request.BaseRequest; +import com.pengrad.telegrambot.response.BaseResponse; + +import okhttp3.OkHttpClient; + +/** + * The {@link TelegramHandler} is responsible for handling commands, which are + * sent to one of the channels. + * + * @author Jens Runge - Initial contribution + * @author Alexander Krasnogolowy - using Telegram library from pengrad + */ +@NonNullByDefault +public class TelegramHandler extends BaseThingHandler { + + @NonNullByDefault + private class ReplyKey { + + final Long chatId; + final String replyId; + + public ReplyKey(Long chatId, String replyId) { + this.chatId = chatId; + this.replyId = replyId; + } + + @Override + public int hashCode() { + return Objects.hash(chatId, replyId); + } + + @Override + public boolean equals(@Nullable Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + ReplyKey other = (ReplyKey) obj; + return Objects.equals(chatId, other.chatId) && Objects.equals(replyId, other.replyId); + } + } + + private final List<Long> chatIds = new ArrayList<Long>(); + private final Logger logger = LoggerFactory.getLogger(TelegramHandler.class); + private @Nullable ScheduledFuture<?> thingOnlineStatusJob; + + // Keep track of the callback id created by Telegram. This must be sent back in + // the answerCallbackQuery + // to stop the progress bar in the Telegram client + private final Map<ReplyKey, String> replyIdToCallbackId = new HashMap<>(); + // Keep track of message id sent with reply markup because we want to remove the + // markup after the user provided an + // answer and need the id of the original message + private final Map<ReplyKey, Integer> replyIdToMessageId = new HashMap<>(); + + private @Nullable TelegramBot bot; + private @Nullable OkHttpClient botLibClient; + private @Nullable HttpClient downloadDataClient; + private @Nullable ParseMode parseMode; + + public TelegramHandler(Thing thing, @Nullable HttpClient httpClient) { + super(thing); + downloadDataClient = httpClient; + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + // no commands to handle + } + + @Override + public void initialize() { + TelegramConfiguration config = getConfigAs(TelegramConfiguration.class); + + String botToken = config.getBotToken(); + chatIds.clear(); + for (String chatIdStr : config.getChatIds()) { + try { + chatIds.add(Long.valueOf(chatIdStr)); + } catch (NumberFormatException e) { + logger.warn("The chat id {} is not a number and will be ignored", chatIdStr); + } + } + if (config.getParseMode() != null) { + try { + parseMode = ParseMode.valueOf(config.getParseMode()); + } catch (IllegalArgumentException e) { + logger.warn("parseMode is invalid and will be ignored. Only Markdown or HTML are allowed values"); + } + } + + botLibClient = new OkHttpClient.Builder().connectTimeout(75, TimeUnit.SECONDS).readTimeout(75, TimeUnit.SECONDS) + .build(); + updateStatus(ThingStatus.UNKNOWN); + delayThingOnlineStatus(); + TelegramBot localBot = bot = new TelegramBot.Builder(botToken).okHttpClient(botLibClient).build(); + localBot.setUpdatesListener(updates -> { + cancelThingOnlineStatusJob(); + updateStatus(ThingStatus.ONLINE); + for (Update update : updates) { + String lastMessageText = null; + Integer lastMessageDate = null; + String lastMessageFirstName = null; + String lastMessageLastName = null; + String lastMessageUsername = null; + Long chatId = null; + String replyId = null; + if (update.message() != null && update.message().text() != null) { + Message message = update.message(); + chatId = message.chat().id(); + if (!chatIds.contains(chatId)) { + logger.warn( + "Ignored message from unknown chat id {}. If you know the sender of that chat, add it to the list of chat ids in the thing configuration to authorize it", + chatId); + continue; // this is very important regarding security to avoid commands from an unknown + // chat + } + + lastMessageText = message.text(); + lastMessageDate = message.date(); + lastMessageFirstName = message.from().firstName(); + lastMessageLastName = message.from().lastName(); + lastMessageUsername = message.from().username(); + } else if (update.callbackQuery() != null && update.callbackQuery().message() != null + && update.callbackQuery().message().text() != null) { + String[] callbackData = update.callbackQuery().data().split(" ", 2); + + if (callbackData.length == 2) { + replyId = callbackData[0]; + lastMessageText = callbackData[1]; + lastMessageDate = update.callbackQuery().message().date(); + lastMessageFirstName = update.callbackQuery().from().firstName(); + lastMessageLastName = update.callbackQuery().from().lastName(); + lastMessageUsername = update.callbackQuery().from().username(); + chatId = update.callbackQuery().message().chat().id(); + replyIdToCallbackId.put(new ReplyKey(chatId, replyId), update.callbackQuery().id()); + logger.debug("Received callbackId {} for chatId {} and replyId {}", update.callbackQuery().id(), + chatId, replyId); + } else { + logger.warn( + "The received callback query {} has not the right format (must be seperated by spaces)", + update.callbackQuery().data()); + } + } + updateChannel(LASTMESSAGETEXT, + lastMessageText != null ? new StringType(lastMessageText) : UnDefType.NULL); + updateChannel(LASTMESSAGEDATE, + lastMessageDate != null + ? new DateTimeType(ZonedDateTime + .ofInstant(Instant.ofEpochSecond(lastMessageDate.intValue()), ZoneOffset.UTC)) + : UnDefType.NULL); + updateChannel(LASTMESSAGENAME, (lastMessageFirstName != null || lastMessageLastName != null) + ? new StringType((lastMessageFirstName != null ? lastMessageFirstName + " " : "") + + (lastMessageLastName != null ? lastMessageLastName : "")) + : UnDefType.NULL); + updateChannel(LASTMESSAGEUSERNAME, + lastMessageUsername != null ? new StringType(lastMessageUsername) : UnDefType.NULL); + updateChannel(CHATID, chatId != null ? new StringType(chatId.toString()) : UnDefType.NULL); + updateChannel(REPLYID, replyId != null ? new StringType(replyId) : UnDefType.NULL); + } + return UpdatesListener.CONFIRMED_UPDATES_ALL; + }, exception -> { + if (exception != null) { + if (exception.response() != null) { + BaseResponse localResponse = exception.response(); + if (localResponse.errorCode() == 401) { // unauthorized + cancelThingOnlineStatusJob(); + localBot.removeGetUpdatesListener(); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Unauthorized attempt to connect to the Telegram server, please check if the bot token is valid"); + return; + } + } + if (exception.getCause() != null) { // cause is only non-null in case of an IOException + cancelThingOnlineStatusJob(); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, exception.getMessage()); + delayThingOnlineStatus(); + return; + } + logger.warn("Telegram exception: {}", exception.getMessage()); + } + }); + } + + private synchronized void delayThingOnlineStatus() { + thingOnlineStatusJob = scheduler.schedule(() -> { + // if no error was returned within 10s, we assume the initialization went well + updateStatus(ThingStatus.ONLINE); + }, 10, TimeUnit.SECONDS); + } + + private synchronized void cancelThingOnlineStatusJob() { + if (thingOnlineStatusJob != null) { + thingOnlineStatusJob.cancel(true); + thingOnlineStatusJob = null; + } + } + + @Override + public void dispose() { + logger.debug("Trying to dispose Telegram client"); + cancelThingOnlineStatusJob(); + OkHttpClient localClient = botLibClient; + TelegramBot localBot = bot; + if (localClient != null && localBot != null) { + localBot.removeGetUpdatesListener(); + localClient.dispatcher().executorService().shutdown(); + localClient.connectionPool().evictAll(); + logger.debug("Telegram client closed"); + } + super.dispose(); + } + + public void updateChannel(String channelName, State state) { + updateState(new ChannelUID(getThing().getUID(), channelName), state); + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singleton(TelegramActions.class); + } + + public List<Long> getChatIds() { + return chatIds; + } + + public void addMessageId(Long chatId, String replyId, Integer messageId) { + replyIdToMessageId.put(new ReplyKey(chatId, replyId), messageId); + } + + @Nullable + public String getCallbackId(Long chatId, String replyId) { + return replyIdToCallbackId.get(new ReplyKey(chatId, replyId)); + } + + public Integer removeMessageId(Long chatId, String replyId) { + return replyIdToMessageId.remove(new ReplyKey(chatId, replyId)); + } + + @Nullable + public ParseMode getParseMode() { + return parseMode; + } + + @SuppressWarnings("rawtypes") + @Nullable + public <T extends BaseRequest, R extends BaseResponse> R execute(BaseRequest<T, R> request) { + TelegramBot localBot = bot; + return localBot != null ? localBot.execute(request) : null; + } + + @Nullable + public HttpClient getClient() { + return downloadDataClient; + } + +} diff --git a/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandlerFactory.java b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandlerFactory.java new file mode 100644 index 0000000000000..6e1e096165258 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandlerFactory.java @@ -0,0 +1,68 @@ +/** + * 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.telegram.internal; + +import static org.openhab.binding.telegram.internal.TelegramBindingConstants.TELEGRAM_THING; + +import java.util.Collections; +import java.util.Set; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link TelegramHandlerFactory} is responsible for creating things and + * thing handlers. + * + * @author Jens Runge - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.telegram", service = ThingHandlerFactory.class) +public class TelegramHandlerFactory extends BaseThingHandlerFactory { + + private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(TELEGRAM_THING); + private @Nullable HttpClient httpClient; + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (TELEGRAM_THING.equals(thingTypeUID)) { + return new TelegramHandler(thing, httpClient); + } + return null; + } + + @Reference + protected void setHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = httpClientFactory.getCommonHttpClient(); + } + + protected void unsetHttpClientFactory(HttpClientFactory httpClientFactory) { + this.httpClient = null; + } +} diff --git a/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..4f7e3db69e427 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="telegram" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>Telegram Binding</name> + <description>This is the binding for Telegram. It allows to send and receive messages.</description> + <author>Alexander Krasnogolowy</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..5d3de1c1293f2 --- /dev/null +++ b/bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="telegram" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="telegramBot"> + <label>Telegram Bot</label> + <description>Thing to receive the latest message send to a Telegram Bot.</description> + + <channels> + <channel id="lastMessageText" typeId="lastMessageText" /> + <channel id="lastMessageDate" typeId="lastMessageDate" /> + <channel id="lastMessageName" typeId="lastMessageName" /> + <channel id="lastMessageUsername" typeId="lastMessageUsername" /> + <channel id="chatId" typeId="chatId" /> + <channel id="replyId" typeId="replyId" /> + </channels> + + <config-description> + <parameter name="botToken" type="text" required="true"> + <label>Bot Token</label> + <description>Enter the bot token you received from the "BotFather".</description> + </parameter> + <parameter name="chatIds" type="text" required="true" multiple="true"> + <label>Chat Id(s)</label> + <description>Enter your chat id(s). Only messages from this id(s) will be send to openHAB.</description> + </parameter> + <parameter name="parseMode" type="text" required="false"> + <label>Parse Mode</label> + <options> + <option value="">No Formatting</option> + <option value="HTML">HTML</option> + <option value="Markdown">Markdown</option> + </options> + <default></default> + <description>Support for formatted messages, values: Markdown or HTML. Default: no formatting is used.</description> + </parameter> + </config-description> + </thing-type> + + <channel-type id="lastMessageText"> + <item-type>String</item-type> + <label>Last Message Text</label> + <description>Contains the latest message text as a string</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="lastMessageDate"> + <item-type>DateTime</item-type> + <label>Last Message Date</label> + <description>Contains the latest message date as a DateTime</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="lastMessageName"> + <item-type>String</item-type> + <label>Last Message Name</label> + <description>Contains the latest message senders name as a string</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="lastMessageUsername"> + <item-type>String</item-type> + <label>Last Message Username</label> + <description>Contains the latest message senders username as a string</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="chatId"> + <item-type>String</item-type> + <label>Chat Id</label> + <description>Contains the id of chat from where the message was received.</description> + <state readOnly="true" /> + </channel-type> + + <channel-type id="replyId"> + <item-type>String</item-type> + <label>Reply Id</label> + <description>Contains the id of the reply which was passed to sendTelegram() as replyId. This id can be used to have + an unambiguous assignment of the user reply to the message which was sent by the bot.</description> + <state readOnly="true" /> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tellstick/.classpath b/bundles/org.openhab.binding.tellstick/.classpath index 6f1b789aaa35d..a5d95095ccaaf 100644 --- a/bundles/org.openhab.binding.tellstick/.classpath +++ b/bundles/org.openhab.binding.tellstick/.classpath @@ -18,14 +18,6 @@ <attribute name="test" value="true"/> </attributes> </classpathentry> - <classpathentry kind="lib" path="lib/async-http-client-2.0.19.jar"/> - <classpathentry kind="lib" path="lib/async-http-client-netty-utils-2.0.19.jar"/> - <classpathentry kind="lib" path="lib/javatellstick-1.1.jar"/> - <classpathentry kind="lib" path="lib/netty-all-4.0.42.Final.jar"/> - <classpathentry kind="lib" path="lib/netty-reactive-streams-1.0.8.jar"/> - <classpathentry kind="lib" path="lib/netty-resolver-2.0.19.jar"/> - <classpathentry kind="lib" path="lib/netty-resolver-dns-2.0.19.jar"/> - <classpathentry kind="lib" path="lib/reactive-streams-1.0.0.jar"/> <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"/> diff --git a/bundles/org.openhab.binding.tellstick/NOTICE b/bundles/org.openhab.binding.tellstick/NOTICE index 134bf3b51625a..b32b88412ad25 100644 --- a/bundles/org.openhab.binding.tellstick/NOTICE +++ b/bundles/org.openhab.binding.tellstick/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content @@ -33,3 +33,9 @@ reactive-streams * License: CC0 1.0 License * Project: https://www.reactive-streams.org * Source: https://github.com/reactive-streams/reactive-streams-jvm + +jna +* License: Apache 2.0 License +* Project: https://github.com/java-native-access/jna +* Source: https://github.com/java-native-access/jna + diff --git a/bundles/org.openhab.binding.tellstick/README.md b/bundles/org.openhab.binding.tellstick/README.md index 03f2fcfd4c299..8f96752a1ea1d 100644 --- a/bundles/org.openhab.binding.tellstick/README.md +++ b/bundles/org.openhab.binding.tellstick/README.md @@ -35,7 +35,7 @@ Additionally the binding have two types of bridge things which correspond to ava Devices which is added to *Telldus Core* and *Telldus Live* can be discovered by openHAB. When you add this binding it will try to discover the *Telldus Core Bridge*. -If it's installed correct its devices will show up. +If it is installed correct its devices will show up. If you want to use the *Telldus Live* its bridge, *Telldus Live bridge* need to be added manually. ## Binding Configuration @@ -60,7 +60,7 @@ The binding implements two different API: **1)** *Telldus Core* which is a local only interface supported by USB based device. <br> **2)** *Telldus Live* which is a REST based cloud service maintained by Telldus. <br> -> Not implemented yet but supported by some new devices, contributions are welcome. [API documention.](http://api.telldus.net/localapi/api.html) <br> +> Not implemented yet but supported by some new devices, contributions are welcome. [API documention.](https://api.telldus.net/localapi/api.html) <br> > **3)** *Local Rest API* is a local API which would work similar to Telldus Live but local. Depending on your Tellstick model, different bridge-types are available: @@ -78,7 +78,7 @@ Depending on your Tellstick model, different bridge-types are available: > To enable communication between openhab and tellstick-core service (Telldus center) they must use same architecture, eg. 32-bit or 64-bit. The supplied version from Telldus is compiled against 32-bit architecture. Therefore, it is better to use 32-bit java for openHAB. To check which version of Java is currently in use, run: `java -d32 -version` > -> *For changing architecture in linux check out: `dpkg --add-architecture`* +> *For changing architecture in Linux check out: `dpkg --add-architecture`* The telldus-core bridge uses a library on the local computer which is a `.dll` file for Windows and a `.so` file for Linux. The default one is usually correct. @@ -93,8 +93,8 @@ Optional: #### Telldus Live Bridge -To configure Telldus Live you have request OAuth tokens from Telldus. Goto this page -<http://api.telldus.com/keys/index> and request your keys and update the config. +To configure Telldus Live you have request OAuth tokens from Telldus. +Goto this page <https://api.telldus.com/keys/index> and request your keys and update the config. ``` Bridge tellstick:telldus-live:2 "Tellstick ZWave" [publicKey="XXX", privateKey="YYYY", token= "ZZZZ", tokenSecret="UUUU"] diff --git a/bundles/org.openhab.binding.tellstick/lib/async-http-client-2.0.19.jar b/bundles/org.openhab.binding.tellstick/lib/async-http-client-2.0.19.jar deleted file mode 100644 index 2422ae7e56970..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/async-http-client-2.0.19.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/async-http-client-netty-utils-2.0.19.jar b/bundles/org.openhab.binding.tellstick/lib/async-http-client-netty-utils-2.0.19.jar deleted file mode 100644 index 7865add75bc11..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/async-http-client-netty-utils-2.0.19.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/javatellstick-1.1.jar b/bundles/org.openhab.binding.tellstick/lib/javatellstick-1.1.jar deleted file mode 100644 index 6eccd7e2aeb57..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/javatellstick-1.1.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/netty-all-4.0.42.Final.jar b/bundles/org.openhab.binding.tellstick/lib/netty-all-4.0.42.Final.jar deleted file mode 100644 index 53da45fef71e8..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/netty-all-4.0.42.Final.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/netty-reactive-streams-1.0.8.jar b/bundles/org.openhab.binding.tellstick/lib/netty-reactive-streams-1.0.8.jar deleted file mode 100644 index bb69a22983ec7..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/netty-reactive-streams-1.0.8.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/netty-resolver-2.0.19.jar b/bundles/org.openhab.binding.tellstick/lib/netty-resolver-2.0.19.jar deleted file mode 100644 index 26be99996456d..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/netty-resolver-2.0.19.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/netty-resolver-dns-2.0.19.jar b/bundles/org.openhab.binding.tellstick/lib/netty-resolver-dns-2.0.19.jar deleted file mode 100644 index 50a6b7024e3dc..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/netty-resolver-dns-2.0.19.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/lib/reactive-streams-1.0.0.jar b/bundles/org.openhab.binding.tellstick/lib/reactive-streams-1.0.0.jar deleted file mode 100644 index fe6b2832c7789..0000000000000 Binary files a/bundles/org.openhab.binding.tellstick/lib/reactive-streams-1.0.0.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.tellstick/pom.xml b/bundles/org.openhab.binding.tellstick/pom.xml index 356444d4a4116..fa518f48703ad 100644 --- a/bundles/org.openhab.binding.tellstick/pom.xml +++ b/bundles/org.openhab.binding.tellstick/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tellstick</artifactId> @@ -14,7 +13,8 @@ <name>openHAB Add-ons :: Bundles :: Tellstick Binding</name> <properties> - <bnd.importpackage>com.barchart.udt*;resolution:=optional,com.google.protobuf;resolution:=optional,com.jcraft.jzlib;resolution:=optional,com.luckycatlabs.sunrisesunset*;resolution:=optional,io.netty.handler.codec.dns;resolution:=optional,javax.activation;resolution:=optional,org.apache.commons.cli;resolution:=optional,org.apache.tomcat*;resolution:=optional,org.bouncycastle*;resolution:=optional,org.eclipse.jetty*;resolution:=optional,org.eclipse.swt*;resolution:=optional,org.jboss.marshalling*;resolution:=optional,sun.net.dns*;resolution:=optional,sun.security*;resolution:=optional</bnd.importpackage> + <bnd.importpackage>!com.luckycatlabs.*,!com.jcraft.jzlib.*,!org.apache.commons.cli.*,!org.eclipse.swt.*</bnd.importpackage> + <dep.noembedding>netty-transport-native-unix-common,netty-common,netty-transport,netty-transport-native-epoll,netty-buffer,netty-resolver,netty-codec,netty-codec-http,netty-handler</dep.noembedding> </properties> <dependencies> @@ -22,8 +22,92 @@ <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>4.2.1</version> - <scope>provided</scope> + <version>4.5.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.tellstick</groupId> + <artifactId>javatellstick</artifactId> + <version>1.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.asynchttpclient</groupId> + <artifactId>async-http-client</artifactId> + <version>2.0.19</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.asynchttpclient</groupId> + <artifactId>async-http-client-netty-utils</artifactId> + <version>2.0.19</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.typesafe.netty</groupId> + <artifactId>netty-reactive-streams</artifactId> + <version>1.0.8</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-transport-native-unix-common</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-codec</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-codec-http</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-common</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-handler</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-resolver</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-transport</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-transport-native-epoll</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-buffer</artifactId> + <version>4.1.34.Final</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.reactivestreams</groupId> + <artifactId>reactive-streams</artifactId> + <version>1.0.0</version> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.tellstick/src/main/feature/feature.xml b/bundles/org.openhab.binding.tellstick/src/main/feature/feature.xml index dfff86c4a325e..6e3ce9620eb5d 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tellstick/src/main/feature/feature.xml @@ -1,12 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tellstick-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tellstick" description="Tellstick Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> - <feature>openhab-runtime-jna</feature> <feature>openhab-transport-serial</feature> + <feature dependency="true">openhab.tp-netty</feature> <feature dependency="true">openhab.tp-jaxb</feature> + <bundle dependency="true">mvn:net.java.dev.jna/jna/4.5.2</bundle> + <bundle dependency="true">mvn:net.java.dev.jna/jna-platform/4.5.2</bundle> <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.tellstick/${project.version}</bundle> </feature> </features> diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TelldusBindingException.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TelldusBindingException.java index 6267c4f77e0c1..4fc944e526579 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TelldusBindingException.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TelldusBindingException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickBindingConstants.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickBindingConstants.java old mode 100755 new mode 100644 index 683e29b38ad26..7e71fc62a3e6d --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickBindingConstants.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickHandlerFactory.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickHandlerFactory.java old mode 100755 new mode 100644 index 47a59ad074a9a..29cf7232814a8 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickHandlerFactory.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickRuntimeException.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickRuntimeException.java index b4a65412bb4ce..cb7eba5007d04 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickRuntimeException.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/TellstickRuntimeException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TelldusLiveConfiguration.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TelldusLiveConfiguration.java old mode 100755 new mode 100644 index ce7b27f75fdd1..f342e4945f046 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TelldusLiveConfiguration.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TelldusLiveConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TellstickBridgeConfiguration.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TellstickBridgeConfiguration.java old mode 100755 new mode 100644 index d1bce11d57b70..1192181929b72 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TellstickBridgeConfiguration.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/conf/TellstickBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java old mode 100755 new mode 100644 index 86c4b8411c7ce..c3acb897ccdc6 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java old mode 100755 new mode 100644 index 1442ac056aecf..af35b9ec04a54 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickBridgeDiscovery.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickBridgeDiscovery.java old mode 100755 new mode 100644 index e23728c72bd1b..a49b6723b152c --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickBridgeDiscovery.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickDiscoveryService.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickDiscoveryService.java old mode 100755 new mode 100644 index 262202515fbe0..c9a00d78f504f --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickDiscoveryService.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/discovery/TellstickDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/DeviceStatusListener.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/DeviceStatusListener.java old mode 100755 new mode 100644 index 5d3da1dd17202..4fe94b49e923a --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/DeviceStatusListener.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/DeviceStatusListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusBridgeHandler.java old mode 100755 new mode 100644 index a6933022a158a..0b77d53eb163c --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDeviceController.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDeviceController.java old mode 100755 new mode 100644 index 92ba71d1806d2..4338a32c1d1d2 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDeviceController.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDeviceController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDevicesHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDevicesHandler.java old mode 100755 new mode 100644 index 568712ba349ee..590589977caba --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDevicesHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/handler/TelldusDevicesHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java old mode 100755 new mode 100644 index fe1c465d9070c..e3d3214dd6ff3 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveDeviceController.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveDeviceController.java old mode 100755 new mode 100644 index 1a459f30ae0b5..5ceef791489c6 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveDeviceController.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveDeviceController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveException.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveException.java index e3f344fbe1e51..bb22e54ca16bf 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveException.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/TelldusLiveException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/DataTypeValue.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/DataTypeValue.java old mode 100755 new mode 100644 index 41ba6773971b0..caafb3c5cb578 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/DataTypeValue.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/DataTypeValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/LiveDataType.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/LiveDataType.java index 9b63b11ecb95f..10e7fa6156355 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/LiveDataType.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/LiveDataType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NameToDataType.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NameToDataType.java old mode 100755 new mode 100644 index 69a24ba8493c1..975250fb3cc29 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NameToDataType.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NameToDataType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NumberToBooleanMapper.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NumberToBooleanMapper.java old mode 100755 new mode 100644 index 10b79c6736ec5..2b1050d1f5dc1 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NumberToBooleanMapper.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/NumberToBooleanMapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TelldusLiveResponse.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TelldusLiveResponse.java old mode 100755 new mode 100644 index e25f87f6d58b8..09b6faf9dab65 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TelldusLiveResponse.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TelldusLiveResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevice.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevice.java old mode 100755 new mode 100644 index 2cfc8cfad41bb..45bb179ed22a4 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevice.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevices.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevices.java old mode 100755 new mode 100644 index f2eb60faf309c..0d8fc7115e169 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevices.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetDevices.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensor.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensor.java old mode 100755 new mode 100644 index 52c3aab481c3d..326e69d4136cc --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensor.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensorEvent.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensorEvent.java index 2812f5a1e1d4b..a9cb4aaeb82d9 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensorEvent.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensorEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensors.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensors.java old mode 100755 new mode 100644 index bb3fb43956c1d..c3a9b0a13838e --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensors.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/live/xml/TellstickNetSensors.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/binding/binding.xml old mode 100755 new mode 100644 diff --git a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/config/config.xml old mode 100755 new mode 100644 index 862c8fbb0ff67..22b1cdd5db59a --- a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/config/config.xml @@ -6,7 +6,7 @@ <config-description uri="thing-type:tellstick:config"> <parameter name="interval" type="integer" min="1" max="86400"> - <label>interval</label> + <label>Interval</label> <description>Refresh interval for positional data calculation in seconds.</description> <default>300</default> </parameter> diff --git a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/bridge.xml old mode 100755 new mode 100644 index 15435ac8a3ea8..da1ca16a0d627 --- a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/bridge.xml @@ -5,12 +5,12 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="telldus-core"> - <label>Telldus Core gateway</label> + <label>Telldus Core Gateway</label> <description>This bridge represents the telldus center on a local computer.</description> <config-description> <parameter name="libraryPath" type="text" required="false"> - <label>The location of Telldus Core DLL/SO</label> + <label>The Location of Telldus Core DLL/SO</label> <description>The location of Telldus Core DLL/SO </description> <default>C:/Program Files/Telldus/;C:/Program Files (x86)/Telldus/</default> @@ -24,18 +24,18 @@ </bridge-type> <bridge-type id="telldus-live"> - <label>Telldus Live gateway</label> + <label>Telldus Live Gateway</label> <description>This bridge represents the telldus live cloud service.</description> <config-description> <parameter name="privateKey" type="text" required="true"> <context>password</context> - <label>Private key</label> + <label>Private Key</label> <description>The private key from telldus</description> </parameter> <parameter name="publicKey" type="text" required="true"> <context>credentials</context> - <label>Public key</label> + <label>Public Key</label> <description>The public key from telldus</description> </parameter> <parameter name="token" type="text" required="true"> diff --git a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/devices.xml b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/devices.xml old mode 100755 new mode 100644 index c7692ffad4051..ec7e4eb21f5b3 --- a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/devices.xml +++ b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/devices.xml @@ -54,7 +54,7 @@ <bridge-type-ref id="telldus-core" /> </supported-bridge-type-refs> - <label>On/Off device</label> + <label>On/Off Device</label> <description>This Thing defines a Switch Device</description> <channels> @@ -108,7 +108,7 @@ <channel-type id="timestamp"> <item-type>DateTime</item-type> - <label>Last device update</label> + <label>Last Device Update</label> <description>Last device update</description> </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/sensor.xml b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/sensor.xml old mode 100755 new mode 100644 index 65c2a58b62d55..142e9c05a6f39 --- a/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/sensor.xml +++ b/bundles/org.openhab.binding.tellstick/src/main/resources/ESH-INF/thing/sensor.xml @@ -144,7 +144,7 @@ <channel-type id="timestamp"> <item-type>DateTime</item-type> - <label>Last device update</label> + <label>Last Device Update</label> <description>Last device update</description> <state readOnly="true"> </state> diff --git a/bundles/org.openhab.binding.tesla/NOTICE b/bundles/org.openhab.binding.tesla/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.tesla/NOTICE +++ b/bundles/org.openhab.binding.tesla/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.tesla/README.md b/bundles/org.openhab.binding.tesla/README.md index d711b87677dd6..bd7289c0351a0 100644 --- a/bundles/org.openhab.binding.tesla/README.md +++ b/bundles/org.openhab.binding.tesla/README.md @@ -1,59 +1,182 @@ # Tesla Binding -This binding integrates the [Tesla Electrical Vehicle](http://www.teslamotors.com). +This binding integrates [Tesla Electrical Vehicles](https://www.tesla.com). The integration happens through the Tesla Owners Remote API. ## Supported Things -Currently, the Tesla Model S is supported by this binding. +All current Tesla models are supported by this binding. Access is established through a Tesla account as a bridge. + +| Thing Type | Description | +|------------|----------------------------------------------| +| account | The account provides access to the vehicles. | +| models | A Tesla Model S | +| model3 | A Tesla Model 3 | +| modelx | A Tesla Model X | +| modely | A Tesla Model Y | ![Tesla](doc/tesla.jpg) -## Binding Configuration +## Auto Discovery + +If the authentication with the Tesla Account is done through the openHAB console (see "Bridge Configuration" option 1 below), the account is automatically added to the Inbox. + +Furthermore, once an account is configured, it is automatically queried for associated vehicles and an Inbox entry is created for each of them. -The binding uses a the owner's email address and password in order to access the Tesla Owners Remote API. -This is the same email address and password as used in the Tesla smartphone app, that allows to remotely control the Tesla Model S. +## Bridge Configuration -## Alternative secure configuration +The `account` bridge requires an OAuth2 refresh token as the only parameter `refreshToken`. -After a successful connection (Thing is online), you can clear the username and password field from the configuration, leaving only the VIN. Instead of using the username and password, from now on, only the access token will be stored and used (access token + refresh token). -This is a better approach for many reasons, one being that you cannot start the car without the password. -If you really don't like the thought of your username and password being stored temporarily, there is also a third option: Leave username/password blank, go into the openHAB console (ssh -p 8101 openhab@localhost), and run the following command: +There are different ways of getting hold of the token: + +1. Use the openHAB console + +Run the following command on the console and provide your Tesla account credentials (the same that you use in the official Tesla app): ``` -openhab> smarthome:tesla logon 1 +openhab> smarthome:tesla login Username (email): mail@example.com -Password: -Attempting logon... -Successfully logged on and stored token. +Password: topsecret +Attempting login...Attempting login... +Refresh token: xxxxxxxxxx ``` +When successfully doing the login through the console, openHAB will automatically create an Inbox entry that is preconfigured with the refresh token, which you can now simply approve. + +Alternatively, you can use the refresh token to textually configure your `account` bridge or to enter it in a manually created "Tesla Account" thing in the UI. -This command will perform a single logon, store the auth tokens and forget it ever saw your username and password. -In the second parameter to the logon comand above, "1" is the thing id. +2. Provide your credentials in the UI + +If you do not want to use the openHAB console, you can also manually create a "Tesla Account" thing in the UI and provide your username and password as parameters (to show them, use the "Show More" button) in the "Edit Thing" view and leave the refresh token parameter field empty. + +openHAB will use the provided credentials to retrieve and set the refresh token and automatically delete your password from the configuration afterwards for safety reasons. ## Thing Configuration -The Tesla Thing requires the username and password as a configuration value in order for the binding to log into the Tesla service, as well as the VIN (Vehicle Identfication Number) to identify the vehicle tracked by the Thing. -In the thing file, this looks e.g. like +The vehicle Things requires the vehicle's VIN as a configuration parameter `vin`. -``` -Thing tesla:models:1 [ username="mail@example.com", password="somepassword", vin="5YJSA7H25FFP53746"] -``` +Additionally, the optional boolean parameter `allowWakeup` can be set. This determines whether openHAB is allowed to wake up the vehicle in order to retrieve data from it. This setting is not recommended as it will result in a significant vampire drain (i.e. energy consumption although the vehicle is parking). ## Channels -All devices support the following channels (non exhaustive): +All vehicles support a huge number of channels - the following list shows the standard ones: + +| Channel ID | Item Type | Label | Description | +|------------------|--------------------|--------------------|---------------------------------------------------------------------------------------------| +| autoconditioning | Switch | Auto Conditioning | Turns on auto-conditioning (a/c or heating) | +| batterylevel | Number | Battery Level | State of the battery in % | +| chargingstate | String | Charging State | “Startingâ€, “Completeâ€, “Chargingâ€, “Disconnectedâ€, “Stoppedâ€, “NoPower†| +| chargeport | Switch | Charge Port | Open the Charge Port (ON) or indicates the state of the Charge Port (ON/OFF if Open/Closed) | +| climate | Switch | Climate | Climate status indicator | +| doorlock | Switch | Door Lock | Lock or unlock the car | +| insidetemp | Number:Temperature | Inside Temperature | Indicates the inside temperature of the vehicle | +| location | Location | Location | The actual position of the vehicle | +| odometer | Number:Length | Odometer | Odometer of the vehicle | +| speed | Number:Speed | Speed | Vehicle speed | + + +Additionally, these advanced channels are available (while not all of them are available on all vehicle types, like e.g. the sunroof): + +| Channel ID | Item Type | Label | Description | +|---------------------------|--------------------------|-------------------------------|------------------------------------------------------------------------------------------------------------------| +| autoparkstate | String | Autopark State | Undocumented / To be defined | +| autoparkstyle | String | Autopark Style | Undocumented / To be defined | +| batterycurrent | Number:ElectricCurrent | Battery Current | Current (Ampere) floating into (+) or out (-) of the battery | +| batteryheater | Switch | Battery Heater | Indicates if the battery heater is switched on | +| batteryheaternopower | Switch | Battery Heater Power | Indicates if there is enough power to use the battery heater | +| batteryrange | Number:Length | Battery Range | Range of the battery | +| calendarenabled | Switch | Calendar Enabled | Indicates if access to a remote calendar is enabled | +| centerdisplay | Switch | Central Display State | Indicates the state of the central display in the vehicle | +| centerrearseatheater | Switch | Center Rear Seat Heater | Indicates if the center rear seat heater is switched on | +| charge | Switch | Charge | Start (ON) or stop (OFF) charging | +| chargecable | String | Charge Cable | Undocumented / To be defined | +| chargecurrent | Number:ElectricCurrent | Charge Current | Current (Ampere) requested from the charger | +| chargeenablerequest | Switch | Charge Enable Request | Undocumented / To be defined | +| chargeenergyadded | Number:Energy | Charge Energy Added | Energy added, in kWh, during the last charging session | +| chargelimit | Dimmer | Charge Limit | Limit charging of the vehicle to the given % | +| chargelimitmaximum | Dimmer | Charge Limit Maximum | Maximum charging limit of the vehicle, as % | +| chargelimitminimum | Dimmer | Charge Limit Minimum | Minimum charging limit of the vehicle, as % | +| chargelimitsocstandard | Dimmer | Charge Limit SOC Standard | Standard charging limity of the vehicle, in % | +| chargeidealdistanceadded | Number:Length | "Ideal" Charge Distance Added | "Ideal" range added during the last charging session | +| chargemaxcurrent | Number:ElectricCurrent | Charge Max Current | Maximum current (Ampere) that can be requested from the charger | +| chargerateddistanceadded | Number:Length | "Rated" Charge Distance Added | "Rated" range added during the last charging session | +| chargerate | Number:Speed | Charge Rate | Distance per hour charging rate | +| chargestartingrange | String | Charge Starting Range | Undocumented / To be defined | +| chargestartingsoc | String | Charge Starting SOC | Undocumented / To be defined | +| chargetomax | Switch | Charge To Max Range | Indicates if the charging to the maximum range is enabled | +| chargercurrent | Number:ElectricCurrent | Charge Current | Current (Ampere) actually being drawn from the charger | +| chargerphases | Number | Charger Phases | Indicates the number of phases (1 to 3) used for charging | +| chargermaxcurrent | Number:ElectricCurrent | Charger Maximum Current | Maximum current (Ampere) that can be delivered by the charger | +| chargerpower | Number | Charger Power | Power actually delivered by the charger | +| chargervoltage | Number:ElectricPotential | Charger Voltage | Voltage (V) actually presented by the charger | +| driverfrontdoor | Contact | Driver Front Door | Indicates if the front door at the driver's side is opened | +| driverreardoor | Contact | Driver Rear Door | Indicates if the rear door at the driver's side is opened | +| drivertemp | Number:Temperature | Driver Temperature | Indicates the auto conditioning temperature set at the driver's side | +| eventstamp | DateTime | Event Timestamp | Timestamp of the last event received from the Tesla streaming service | +| estimatedbatteryrange | Number:Length | Estimated Battery Range | Estimated battery range | +| estimatedrange | Number | Estimated Range | Estimated range of the vehicle | +| fan | Number | Fan | Indicates the speed (0-7) of the fan | +| flashlights | Switch | Flash Lights | Flash the lights of the car (when ON is received) | +| frontdefroster | Switch | Front Defroster | Indicates if the front defroster is enabled | +| fronttrunk | Switch | Front Trunk | Indicates if the front trunk is opened, or open the front trunk when ON is received | +| gpstimestamp | DateTime | GPS Time Stamp | Time stamp of the most recent GPS location of the vehicle | +| heading | Number | Heading | Indicates the (compass) heading of the car, in 0-360 degrees | +| headingestimation | Number | Estimated Heading | Estimated (compass) heading of the car, in 0 to 360 degrees | +| honkhorn | Switch | Honk the Horn | Honk the horn of the vehicle, when ON is received | +| homelink | Switch | Homelink Nearby | Indicates if the Home Link is nearby | +| idealbatteryrange | Number:Length | Ideal Battery Range | Indicates the Batter Range | +| lefttempdirection | Number | Left Temperature Direction | Not documented / To be defined | +| lastautoparkerror | String | Last Autopark Error | Not documented / To be defined | +| location" advanced="false | Location | Location | The actual position of the vehicle | +| leftseatheater | Switch | Left Seat Heater | Indicates if the left seat heater is switched on | +| leftrearseatheater | Switch | Left Rear Seat Heater | Indicates if the left rear seat heater is switched on | +| leftrearbackseatheater | Number | Left Rear Backseat Heater | Indicates the level (0,1,2 or 3) of the left rear backseat heater | +| managedcharging | Switch | Managed Charging | Indicates managed charging is active | +| managedchargingcancelled | Switch | Managed Charging Cancelled | Indicates managed charging is cancelled by the user | +| managedchargingstart | String | Managed Charging Start Time | Not documented / To be defined | +| maxcharges | Number | Max Charges | Indicates the number of consecutive "Max Range Charges" performed by the vehicle | +| minavailabletemp | Number:Temperature | Minimum Temperature | Indicates the minimal inside temperature of the vehicle | +| maxavailabletemp | Number:Temperature | Maximum Temperature | Indicates the maximum inside temperature of the vehicle | +| mobileenabled | Switch | Mobile Enabled | Indicates whether the vehicle can be remotely controlled | +| notenoughpower | Switch | Not Enought Power | Indicates if not enough power (ON) is available to heat the vehicle | +| notificationsenabled | Switch | Notifications Enabled | Not documented / To be defined | +| notificationssupported | Switch | Notifications Supported | Not documented / To be defined | +| outsidetemp | Number:Temperature | Outside Temperature | Indicates the outside temperature of the vehicle | +| parsedcalendar | Switch | Parsed Calendar Supported | Not documented / To be defined | +| passengertemp | Number | Passenger Temperature | Indicates the auto conditioning temperature set at the passenger's side | +| passengerfrontdoor | Contact | Passenger Front Door | Indicates if the front door at the passenger's side is opened | +| passengerreardoor | Contact | Passenger Rear Door | Indicates if the rear door at the passenger's side is opened | +| power | Number | Power | Net kW flowing in (+) or out (-) of the battery | +| preconditioning | Switch | Preconditioning | Indicates if preconditioning is activated | +| range | Number | Range | Vehicle range - Not documented / To be defined | +| reardefroster | Switch | Rear Defroster | Indicates if the rear defroster is enabled | +| remotestartenabled | Switch | Remote Start | Not documented / To be defined | +| reartrunk | Switch | Rear Trunk | Indicates if the rear trunk is opened, or open/close the rear trunk when ON/OFF is received | +| remotestart | Switch | Remote Start | Not documented / To be defined | +| remotestartsupported | Switch | Remote Start Supported | Not documented / To be defined | +| rightseatheater | Switch | Right Seat Heater | Indicates if the right seat heater is switched on | +| rightrearseatheater | Switch | Right Rear Seat Heater | Indicates if the right rear seat heater is switched on | +| rightrearbackseatheater | Number | Right Rear Backseat Heater | Indicates the level (0,1,2 or 3) of the right rear backseat heater | +| righttempdirection | Number | Right Temperature Direction | Not documented / To be defined | +| scheduledchargingpending | Switch | Scheduled Charging Pending | Indicates if a scheduled charging session is still pending | +| scheduledchargingstart | DateTime | Scheduled Charging Start | Indicates when the scheduled charging session will start, in yyyy-MM-dd'T'HH:mm:ss format | +| shiftstate | String | Shift State | Indicates the state of the transmission, “Pâ€, “Dâ€, “Râ€, or “N†| +| sidemirrorheaters | Switch | Side Mirror Heaters | Indicates if the side mirror heaters are switched on | +| smartpreconditioning | Switch | Smart Preconditioning | Indicates if smart preconditioning is switched on | +| soc | Number | State of Charge | State of Charge, in % | +| state | String | State | “onlineâ€, “asleepâ€, “waking†| +| steeringwheelheater | Switch | Steering Wheel Heater | Indicates if the steering wheel heater is switched on | +| sunroofstate | String | Sunroof State | “unknownâ€, “openâ€, “closedâ€, “ventâ€, “comfort†| +| sunroof | Dimmer | Sunroof | Open or close the sunroof to provided % (0 closed, 100 fully open) | +| temperature | Number:Temperature | Temperature | Set the temperature of the autoconditioning system. The temperature for the driver and passenger will be synced. | +| timetofullcharge | Number | Time To Full Charge | Number of hours to fully charge the battery | +| tripcharging | Switch | Trip Charging | Not documented / To be defined | +| usablebatterylevel | Number | Usable Battery Level | Indicates the % of battery that can be used for vehicle functions like driving | +| userchargeenablerequest | String | User Charge Enable Request | Not documented / To be defined | +| valetmode | Switch | Valet Mode | Enable or disable Valet Mode | +| valetpin | Switch | Valet PIN Required | Indicates if a PIN code is required to disable valet mode | +| wakeup | Switch | Wake Up | Wake up the vehicle from a (deep) sleep | +| wiperbladeheater | Switch | Wiperblade Heater | Indicates if the wiperblade heater is switched on | -| Channel Type ID | Item Type | Description | -|-----------------|-----------|-----------------------------------------------------------------------------------------------------------------------------| -| allowwakeup | Switch | This channel supports the vehicle to be waken up in order to fetch vehicle information and data | -| enableevents | Switch | This channel supports starting or stopping the event stream generated by the vehicle | -| charge | Switch | This channel supports starting or stopping the charging process of the vehicle | -| location | Location | This channel indicates the actual location (latitude, longitude, elevation) of the vehicle | -| doorlock | Switch | This channel supports locking or unlocking the doors of the vehicle | -| insidetemp | Number | This channel indicates the inside temperature of the vehicle | -| odometer | Number | This channel indicates the actual state of the vehicle's odometer, in km or miles along the build of the vehicle (EU or US) | -| batterylevel | Number | This channel indicates the actual state of the vehicle's battery, in % | ## Example @@ -61,38 +184,37 @@ All devices support the following channels (non exhaustive): demo.Things: ``` -Thing tesla:models:1 [ username="mail@example.com", password="somepassword", vin="5YJSA7H25FFP53746"] +Bridge tesla:account:myaccount "My Tesla Account" [ refreshToken="xxxx" ] { + model3 mycar "My favorite car" [ vin="5YJSA7H25FFP53736"] +} ``` demo.items: ``` -Switch TeslaCharge {channel="tesla:models:1:charge"} -Location TeslaLocation {channel="tesla:models:1:location"} -Dimmer TeslaChargeLimit {channel="tesla:models:1:chargelimit"} -String TeslaChargeRate {channel="tesla:models:1:chargerate"} -String TeslaChargingState {channel="tesla:models:1:chargingstate"} -Number TeslaTimeToFullCharge {channel="tesla:models:1:timetofullcharge"} -Number TeslaChargerPower {channel="tesla:models:1:chargerpower"} -DateTime TeslaScheduledChargingStart {channel="tesla:models:1:scheduledchargingstart"} -Dimmer TeslaSoC "State of Charge [%.1f %%]" {channel="tesla:models:1:soc"} -Number TeslaSpeed {channel="tesla:models:1:speed"} -String TeslaState {channel="tesla:models:1:state"} -Number TeslaPower {channel="tesla:models:1:power"} -Number TeslaInsideTemperature {channel="tesla:models:1:insidetemp"} -Number TeslaOutsideTemperature {channel="tesla:models:1:outsidetemp"} -Switch TeslaAutoconditioning {channel="tesla:models:1:autoconditioning"} -Number TeslaTemperature {channel="tesla:models:1:temperature"} -String TeslaShiftState {channel="tesla:models:1:shiftstate"} -Number TeslaBatteryCurrent {channel="tesla:models:1:batterycurrent"} -Number TeslaBatteryLevel {channel="tesla:models:1:batterylevel"} -DateTime TeslaEventstamp {channel="tesla:models:1:eventstamp"} -Number TeslaOdometer {channel="tesla:models:1:odometer"} -Number TeslaLatitude {channel="tesla:models:1:latitude"} -Number TeslaLongitude {channel="tesla:models:1:longitude"} -Number TeslaElevation {channel="tesla:models:1:elevation"} -Number TeslaHeading {channel="tesla:models:1:heading"} -DateTime TeslaGPSStamp {channel="tesla:models:1:gpstimestamp"} +Switch TeslaCharge {channel="tesla:model3:myaccount:mycar:charge"} +Location TeslaLocation {channel="tesla:model3:myaccount:mycar:location"} +Dimmer TeslaChargeLimit {channel="tesla:model3:myaccount:mycar:chargelimit"} +String TeslaChargeRate {channel="tesla:model3:myaccount:mycar:chargerate"} +String TeslaChargingState {channel="tesla:model3:myaccount:mycar:chargingstate"} +Number TeslaTimeToFullCharge {channel="tesla:model3:myaccount:mycar:timetofullcharge"} +Number TeslaChargerPower {channel="tesla:model3:myaccount:mycar:chargerpower"} +DateTime TeslaScheduledChargingStart {channel="tesla:model3:myaccount:mycar:scheduledchargingstart"} +Dimmer TeslaSoC {channel="tesla:model3:myaccount:mycar:soc"} +Number:Speed TeslaSpeed {channel="tesla:model3:myaccount:mycar:speed"} +String TeslaState {channel="tesla:model3:myaccount:mycar:state"} +Number TeslaPower {channel="tesla:model3:myaccount:mycar:power"} +Number:Temperature TeslaInsideTemperature {channel="tesla:model3:myaccount:mycar:insidetemp"} +Number:Temperature TeslaOutsideTemperature {channel="tesla:model3:myaccount:mycar:outsidetemp"} +Switch TeslaAutoconditioning {channel="tesla:model3:myaccount:mycar:autoconditioning"} +Number:Temperature TeslaTemperature {channel="tesla:model3:myaccount:mycar:temperature"} +String TeslaShiftState {channel="tesla:model3:myaccount:mycar:shiftstate"} +Number TeslaBatteryCurrent {channel="tesla:model3:myaccount:mycar:batterycurrent"} +Number TeslaBatteryLevel {channel="tesla:model3:myaccount:mycar:batterylevel"} +DateTime TeslaEventstamp {channel="tesla:model3:myaccount:mycar:eventstamp"} +Number:Length TeslaOdometer {channel="tesla:model3:myaccount:mycar:odometer"} +Number TeslaHeading {channel="tesla:model3:myaccount:mycar:heading"} +DateTime TeslaGPSStamp {channel="tesla:model3:myaccount:mycar:gpstimestamp"} ``` demo.sitemap: diff --git a/bundles/org.openhab.binding.tesla/doc/tesla.jpg b/bundles/org.openhab.binding.tesla/doc/tesla.jpg index 9ae99f5f8c719..4351086219561 100644 Binary files a/bundles/org.openhab.binding.tesla/doc/tesla.jpg and b/bundles/org.openhab.binding.tesla/doc/tesla.jpg differ diff --git a/bundles/org.openhab.binding.tesla/pom.xml b/bundles/org.openhab.binding.tesla/pom.xml index 5b4da12d47aee..198cfed761451 100644 --- a/bundles/org.openhab.binding.tesla/pom.xml +++ b/bundles/org.openhab.binding.tesla/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tesla</artifactId> diff --git a/bundles/org.openhab.binding.tesla/src/main/feature/feature.xml b/bundles/org.openhab.binding.tesla/src/main/feature/feature.xml index 40fd266b0d59e..523caf20e1d77 100644 --- a/bundles/org.openhab.binding.tesla/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tesla/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tesla-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tesla" description="Tesla Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaBindingConstants.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaBindingConstants.java index c26b849968f20..111e9439b4619 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaBindingConstants.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -27,7 +27,6 @@ public class TeslaBindingConstants { // REST URI constants public static final String API_NAME = "Tesla Client API"; public static final String API_VERSION = "api/1/"; - public static final String PASSWORD = "password"; public static final String PATH_COMMAND = "command/{cmd}"; public static final String PATH_DATA_REQUEST = "data_request/{cmd}"; public static final String PATH_VEHICLE_ID = "/{vid}/"; @@ -35,7 +34,6 @@ public class TeslaBindingConstants { public static final String URI_ACCESS_TOKEN = "oauth/token"; public static final String URI_EVENT = "https://streaming.vn.teslamotors.com/stream/"; public static final String URI_OWNERS = "https://owner-api.teslamotors.com/"; - public static final String USERNAME = "username"; public static final String VALETPIN = "valetpin"; public static final String VEHICLES = "vehicles"; public static final String VIN = "vin"; @@ -69,11 +67,16 @@ public class TeslaBindingConstants { public static final String GUI_STATE = "gui_settings"; public static final String MOBILE_ENABLED_STATE = "mobile_enabled"; public static final String VEHICLE_STATE = "vehicle_state"; + public static final String VEHICLE_CONFIG = "vehicle_config"; public static final String BINDING_ID = "tesla"; // List of all Thing Type UIDs + public static final ThingTypeUID THING_TYPE_ACCOUNT = new ThingTypeUID(BINDING_ID, "account"); public static final ThingTypeUID THING_TYPE_MODELS = new ThingTypeUID(BINDING_ID, "models"); + public static final ThingTypeUID THING_TYPE_MODEL3 = new ThingTypeUID(BINDING_ID, "model3"); + public static final ThingTypeUID THING_TYPE_MODELX = new ThingTypeUID(BINDING_ID, "modelx"); + public static final ThingTypeUID THING_TYPE_MODELY = new ThingTypeUID(BINDING_ID, "modely"); public enum EventKeys { timestamp, @@ -91,9 +94,14 @@ public enum EventKeys { heading } - // List of all Channels public static final String CHANNEL_CHARGE = "charge"; - public static final String CHANNEL_ALLOWWAKEUP = "allowwakeup"; - public static final String CHANNEL_ENABLEEVENTS = "enableevents"; + public static final String CHANNEL_COMBINED_TEMP = "combinedtemp"; + + // thing configurations + public static final String CONFIG_ALLOWWAKEUP = "allowWakeup"; + public static final String CONFIG_ENABLEEVENTS = "enableEvents"; + public static final String CONFIG_REFRESHTOKEN = "refreshToken"; + public static final String CONFIG_USERNAME = "username"; + public static final String CONFIG_PASSWORD = "password"; } diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java index 0ec559b8c10b9..f553ffa473691 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaChannelSelectorProxy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; @@ -24,10 +25,16 @@ import org.eclipse.smarthome.core.library.types.OpenClosedType; import org.eclipse.smarthome.core.library.types.PercentType; import org.eclipse.smarthome.core.library.types.PointType; +import org.eclipse.smarthome.core.library.types.QuantityType; import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.Type; +import tec.uom.se.unit.MetricPrefix; + /** * The {@link TeslaChannelSelectorProxy} class is a helper class to instantiate * and parameterize the {@link TeslaChannelSelector} Enum @@ -84,12 +91,8 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); } }, CALENDAR_SUPPORTED("calendar_supported", "calendarsupported", OnOffType.class, true) { @@ -162,40 +165,28 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str CHARGE_LIMIT_SOC_MIN("charge_limit_soc_min", "chargelimitminimum", PercentType.class, false), CHARGE_LIMIT_SOC_STD("charge_limit_soc_std", "chargelimitsocstandard", PercentType.class, false), CHARGE_PORT_LATCH("charge_port_latch", "chargeportlatch", StringType.class, false), - CHARGE_MILES_ADDED_IDEAL("charge_miles_added_ideal", "chargeidealmilesadded", DecimalType.class, false) { + CHARGE_MILES_ADDED_IDEAL("charge_miles_added_ideal", "chargeidealdistanceadded", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILES_PER_HOUR); } }, - CHARGE_MILES_ADDED_RANGE("charge_miles_added_rated", "chargeratedmilesadded", DecimalType.class, false) { + CHARGE_MILES_ADDED_RANGE("charge_miles_added_rated", "chargerateddistanceadded", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILES_PER_HOUR); } }, CHARGE_RATE("charge_rate", "chargerate", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("chargerateunits") && properties.get("chargerateunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILES_PER_HOUR); } }, CHARGE_STARTING_RANGE("charge_starting_range", "chargestartingrange", StringType.class, false), @@ -299,11 +290,8 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - if (properties.containsKey("temperatureunits") && properties.get("temperatureunits").equals("F")) { - return super.getState(String.valueOf(celsiusToFahrenheit(((DecimalType) someState)))); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SIUnits.CELSIUS); } }, ELEVATION("elevation", "location", DecimalType.class, false) { @@ -319,25 +307,24 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); + } + }, + EST_HEADING("est_heading", "headingestimation", DecimalType.class, false) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SmartHomeUnits.DEGREE_ANGLE); } }, - EST_HEADING("est_heading", "estimatedheading", DecimalType.class, false), EST_RANGE("est_range", "estimatedrange", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); } }, EU_VEHICLE("eu_vehicle", "european", OnOffType.class, true) { @@ -379,18 +366,6 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str return super.getState(s); } }, - FORCE_REFRESH(null, "forcerefresh", OnOffType.class, false) { - @Override - public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { - if (s.equals("true") || s.equals("1")) { - return super.getState("ON"); - } - if (s.equals("false") || s.equals("0")) { - return super.getState("OFF"); - } - return super.getState(s); - } - }, FRONT_DEFROSTER("is_front_defroster_on", "frontdefroster", OnOffType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { @@ -442,7 +417,14 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str return super.getState(s); } }, - HEADING("heading", "heading", DecimalType.class, false), + HEADING("heading", "heading", DecimalType.class, false) { + @Override + public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SmartHomeUnits.DEGREE_ANGLE); + } + }, HONK_HORN(null, "honkhorn", OnOffType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { @@ -471,23 +453,16 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); } }, INSIDE_TEMP("inside_temp", "insidetemp", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - if (properties.containsKey("temperatureunits") && properties.get("temperatureunits").equals("F")) { - return super.getState(String.valueOf(celsiusToFahrenheit(((DecimalType) someState)))); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SIUnits.CELSIUS); } }, LAST_AUTOPARK_ERROR("last_autopark_error", "lastautoparkerror", StringType.class, false), @@ -640,12 +615,9 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str ODOMETER("odometer", "odometer", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { - double odo = Math.round(((DecimalType) super.getState(s)).doubleValue() * 10.0) / 10.0; - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - odo = odo * 1.609344; - } - - return super.getState(String.valueOf(odo)); + State someState = super.getState(s); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILE); } }, OPEN_FRUNK(null, "openfrunk", OnOffType.class, false) { @@ -677,11 +649,8 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - if (properties.containsKey("temperatureunits") && properties.get("temperatureunits").equals("F")) { - return super.getState(String.valueOf(celsiusToFahrenheit(((DecimalType) someState)))); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SIUnits.CELSIUS); } }, PARSED_CALENDAR("parsed_calendar_supported", "parsedcalendar", OnOffType.class, false) { @@ -700,11 +669,8 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - if (properties.containsKey("temperatureunits") && properties.get("temperatureunits").equals("F")) { - return super.getState(String.valueOf(celsiusToFahrenheit(((DecimalType) someState)))); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SIUnits.CELSIUS); } }, PERF_CONFIG("perf_config", "configuration", StringType.class, true), @@ -749,11 +715,11 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - double odo = ((DecimalType) someState).doubleValue(); + BigDecimal value = ((DecimalType) someState).toBigDecimal(); if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); + return new QuantityType<>(value, MetricPrefix.KILO(SIUnits.METRE)); } else { - return someState; + return new QuantityType<>(value, ImperialUnits.MILE); } } }, @@ -805,7 +771,7 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str return super.getState(s); } }, - REMOTE_START_SUPPORTED("remote_start_supported", "remotestartsuported", OnOffType.class, false) { + REMOTE_START_SUPPORTED("remote_start_supported", "remotestartsupported", OnOffType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { if (s.equals("true") || s.equals("1")) { @@ -917,14 +883,10 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); if (someState != null) { - double odo = ((DecimalType) someState).doubleValue(); - if (properties.containsKey("distanceunits") && properties.get("distanceunits").equals("km/hr")) { - return super.getState(String.valueOf(odo * 1.609344)); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, ImperialUnits.MILES_PER_HOUR); } else { - return someState; + return null; } } }, @@ -955,15 +917,12 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str }, SUN_ROOF_STATE("sun_roof_state", "sunroofstate", StringType.class, false), SUN_ROOF("sun_roof_percent_open", "sunroof", PercentType.class, false), - TEMPERATURE(null, "temperature", DecimalType.class, false) { + COMBINED_TEMP(null, "combinedtemp", DecimalType.class, false) { @Override public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { State someState = super.getState(s); - if (properties.containsKey("temperatureunits") && properties.get("temperatureunits").equals("F")) { - return super.getState(String.valueOf(celsiusToFahrenheit(((DecimalType) someState)))); - } else { - return someState; - } + BigDecimal value = ((DecimalType) someState).toBigDecimal(); + return new QuantityType<>(value, SIUnits.CELSIUS); } }, TIME_TO_FULL_CHARGE("time_to_full_charge", "timetofullcharge", DecimalType.class, false), @@ -1044,30 +1003,6 @@ public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, Str return super.getState(s); } }, - ALLOWWAKEUP(null, "allowwakeup", OnOffType.class, false) { - @Override - public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { - if (s.equals("true") || s.equals("1")) { - return super.getState("ON"); - } - if (s.equals("false") || s.equals("0")) { - return super.getState("OFF"); - } - return super.getState(s); - } - }, - ENABLEEVENTS(null, "enableevents", OnOffType.class, false) { - @Override - public State getState(String s, TeslaChannelSelectorProxy proxy, Map<String, String> properties) { - if (s.equals("true") || s.equals("1")) { - return super.getState("ON"); - } - if (s.equals("false") || s.equals("0")) { - return super.getState("OFF"); - } - return super.getState(s); - } - }, WHEEL_TYPE("wheel_type", "wheeltype", StringType.class, true); private final String restID; @@ -1153,9 +1088,4 @@ public State getState(String s, TeslaChannelSelector selector, Map<String, Strin return selector.getState(s, this, properties); } - private static int celsiusToFahrenheit(DecimalType c) { - float cTemp = c.floatValue(); - return (int) Math.round((cTemp * 9.0 / 5.0) + 32.0); - } - } diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaHandlerFactory.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaHandlerFactory.java index bb9546af8aadc..f1d3a2b2097ce 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaHandlerFactory.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/TeslaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,20 +12,21 @@ */ package org.openhab.binding.tesla.internal; -import static org.openhab.binding.tesla.internal.TeslaBindingConstants.THING_TYPE_MODELS; +import static org.openhab.binding.tesla.internal.TeslaBindingConstants.*; -import java.util.Collections; import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; -import org.eclipse.smarthome.core.storage.StorageService; +import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; -import org.openhab.binding.tesla.internal.handler.TeslaHandler; +import org.openhab.binding.tesla.internal.handler.TeslaAccountHandler; +import org.openhab.binding.tesla.internal.handler.TeslaVehicleHandler; import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Reference; /** * The {@link TeslaHandlerFactory} is responsible for creating things and thing @@ -33,13 +34,14 @@ * * @author Karel Goderis - Initial contribution * @author Nicolai Grødum - Adding token based auth + * @author Kai Kreuzer - Introduced account handler */ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.tesla") public class TeslaHandlerFactory extends BaseThingHandlerFactory { - private StorageService storageService; - - private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_MODELS); + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Stream + .of(THING_TYPE_ACCOUNT, THING_TYPE_MODELS, THING_TYPE_MODEL3, THING_TYPE_MODELX, THING_TYPE_MODELY) + .collect(Collectors.toSet()); @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { @@ -50,19 +52,10 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); - if (thingTypeUID.equals(THING_TYPE_MODELS)) { - return new TeslaHandler(thing, storageService); + if (thingTypeUID.equals(THING_TYPE_ACCOUNT)) { + return new TeslaAccountHandler((Bridge) thing); + } else { + return new TeslaVehicleHandler(thing); } - - return null; - } - - @Reference - public void setStorageService(StorageService storageService) { - this.storageService = storageService; - } - - public void unsetStorageService(StorageService storageService) { - this.storageService = null; } } diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/command/TeslaCommandExtension.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/command/TeslaCommandExtension.java index 8561caa2b6eaa..43dd85f300cb7 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/command/TeslaCommandExtension.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/command/TeslaCommandExtension.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,13 +26,15 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import org.apache.commons.lang.StringUtils; -import org.eclipse.smarthome.core.storage.Storage; -import org.eclipse.smarthome.core.storage.StorageService; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.util.UIDUtils; import org.eclipse.smarthome.io.console.Console; import org.eclipse.smarthome.io.console.extensions.AbstractConsoleCommandExtension; import org.eclipse.smarthome.io.console.extensions.ConsoleCommandExtension; import org.openhab.binding.tesla.internal.TeslaBindingConstants; +import org.openhab.binding.tesla.internal.discovery.TeslaAccountDiscoveryService; import org.openhab.binding.tesla.internal.protocol.TokenRequest; import org.openhab.binding.tesla.internal.protocol.TokenRequestPassword; import org.openhab.binding.tesla.internal.protocol.TokenResponse; @@ -46,31 +48,42 @@ /** * Console commands for interacting with the Tesla integration * - * @author Nicolai Grødum + * @author Nicolai Grødum - Initial contribution + * @author Kai Kreuzer - refactored to use Tesla account thing */ @Component(service = ConsoleCommandExtension.class, immediate = true) public class TeslaCommandExtension extends AbstractConsoleCommandExtension { - private static final String CMD_LOGON = "logon"; + private static final String CMD_LOGIN = "login"; private final Logger logger = LoggerFactory.getLogger(TeslaCommandExtension.class); - private StorageService storageService; private final Client teslaClient = ClientBuilder.newClient(); private final WebTarget teslaTarget = teslaClient.target(URI_OWNERS); private final WebTarget tokenTarget = teslaTarget.path(URI_ACCESS_TOKEN); + private TeslaAccountDiscoveryService teslaAccountDiscoveryService; + public TeslaCommandExtension() { super("tesla", "Interact with the Tesla integration."); } + @Reference + protected void setTeslaAccountDiscoveryService(TeslaAccountDiscoveryService ds) { + this.teslaAccountDiscoveryService = ds; + } + + protected void unsetTeslaAccountDiscoveryService(TeslaAccountDiscoveryService ds) { + this.teslaAccountDiscoveryService = null; + } + @Override public void execute(String[] args, Console console) { if (args.length > 0) { String subCommand = args[0]; switch (subCommand) { - case CMD_LOGON: - if (args.length == 2) { + case CMD_LOGIN: + if (args.length == 1) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); console.print("Username (email): "); @@ -81,13 +94,13 @@ public void execute(String[] args, Console console) { String pwd = br.readLine(); console.println(""); - console.println("Attempting logon..."); - logon(console, args[1], username, pwd); + console.println("Attempting login..."); + login(console, username, pwd); } catch (Exception e) { console.println(e.toString()); } - } else if (args.length == 4) { - logon(console, args[1], args[2], args[3]); + } else if (args.length == 3) { + login(console, args[1], args[2]); } else { printUsage(console); } @@ -103,20 +116,11 @@ public void execute(String[] args, Console console) { @Override public List<String> getUsages() { - return Arrays.asList(new String[] { buildCommandUsage(CMD_LOGON + " <thingid> [<user email>] [<password>]", - "Authenticates and stores the access and refresh token. Does not store the username/password."), }); - } - - @Reference - public void setStorageService(StorageService storageService) { - this.storageService = storageService; - } - - public void unsetStorageService(StorageService storageService) { - this.storageService = null; + return Arrays.asList(new String[] { buildCommandUsage(CMD_LOGIN + " [<user email>] [<password>]", + "Authenticates the user and provides a refresh token."), }); } - private void logon(Console console, String thingId, String username, String password) { + private void login(Console console, String username, String password) { try { Gson gson = new Gson(); @@ -129,21 +133,23 @@ private void logon(Console console, String thingId, String username, String pass if (response.getStatus() == 200 && response.hasEntity()) { String responsePayLoad = response.readEntity(String.class); TokenResponse tokenResponse = gson.fromJson(responsePayLoad.trim(), TokenResponse.class); - - if (tokenResponse != null && !StringUtils.isEmpty(tokenResponse.access_token)) { - Storage storage = storageService.getStorage(TeslaBindingConstants.BINDING_ID); - storage.put(thingId, gson.toJson(tokenResponse)); - } - console.println("Successfully logged on and stored token."); - + console.println("Refresh token: " + tokenResponse.refresh_token); + + ThingUID thingUID = new ThingUID(TeslaBindingConstants.THING_TYPE_ACCOUNT, + UIDUtils.encode(username)); + DiscoveryResult result = DiscoveryResultBuilder.create(thingUID).withLabel("Tesla Account") + .withProperty(TeslaBindingConstants.CONFIG_REFRESHTOKEN, tokenResponse.refresh_token) + .withProperty(TeslaBindingConstants.CONFIG_USERNAME, username) + .withRepresentationProperty(TeslaBindingConstants.CONFIG_USERNAME).build(); + teslaAccountDiscoveryService.thingDiscovered(result); } else { console.println( - "Failure:" + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase()); + "Failure: " + response.getStatus() + " " + response.getStatusInfo().getReasonPhrase()); } } } catch (Exception e) { - console.println("Failed to store token:" + e.getMessage()); - logger.error("Could not get Tesla token", e); + console.println("Failed to retrieve token: " + e.getMessage()); + logger.error("Could not get refresh token.", e); } } } diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaAccountDiscoveryService.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaAccountDiscoveryService.java new file mode 100644 index 0000000000000..ca083caf704b2 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaAccountDiscoveryService.java @@ -0,0 +1,58 @@ +/** + * 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.tesla.internal.discovery; + +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.openhab.binding.tesla.internal.TeslaHandlerFactory; +import org.openhab.binding.tesla.internal.command.TeslaCommandExtension; +import org.osgi.service.component.annotations.Component; + +/** + * This is a discovery service, is used by the {@link TeslaCommandExtension} for + * automatically creating Tesla accounts. + * + * @author Kai Kreuzer - Initial contribution + * + */ +@Component(service = { TeslaAccountDiscoveryService.class, DiscoveryService.class }) +public class TeslaAccountDiscoveryService extends AbstractDiscoveryService { + + public TeslaAccountDiscoveryService() throws IllegalArgumentException { + super(TeslaHandlerFactory.SUPPORTED_THING_TYPES_UIDS, 10, true); + } + + @Override + protected void startScan() { + } + + @Override + public void activate(@Nullable Map<@NonNull String, @Nullable Object> configProperties) { + super.activate(configProperties); + } + + @Override + public void deactivate() { + super.deactivate(); + } + + @Override + public void thingDiscovered(DiscoveryResult discoveryResult) { + super.thingDiscovered(discoveryResult); + } +} diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaVehicleDiscoveryService.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaVehicleDiscoveryService.java new file mode 100644 index 0000000000000..2eadefd860b8f --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/discovery/TeslaVehicleDiscoveryService.java @@ -0,0 +1,113 @@ +/** + * 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.tesla.internal.discovery; + +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResult; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.openhab.binding.tesla.internal.TeslaBindingConstants; +import org.openhab.binding.tesla.internal.TeslaHandlerFactory; +import org.openhab.binding.tesla.internal.handler.TeslaAccountHandler; +import org.openhab.binding.tesla.internal.handler.VehicleListener; +import org.openhab.binding.tesla.internal.protocol.Vehicle; +import org.openhab.binding.tesla.internal.protocol.VehicleConfig; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This service is used by {@link TeslaAccountHandler} instances in order to + * automatically provide vehicle information from the account. + * + * @author Kai Kreuzer - Initial contribution + * + */ +@Component(service = ThingHandlerService.class) +public class TeslaVehicleDiscoveryService extends AbstractDiscoveryService + implements DiscoveryService, VehicleListener, ThingHandlerService { + private final Logger logger = LoggerFactory.getLogger(TeslaVehicleDiscoveryService.class); + + public TeslaVehicleDiscoveryService() throws IllegalArgumentException { + super(TeslaHandlerFactory.SUPPORTED_THING_TYPES_UIDS, 10, true); + } + + private TeslaAccountHandler handler; + + @Override + public void setThingHandler(ThingHandler handler) { + this.handler = (TeslaAccountHandler) handler; + this.handler.addVehicleListener(this); + } + + @Override + public ThingHandler getThingHandler() { + return handler; + } + + @Override + protected void startScan() { + handler.scanForVehicles(); + } + + @Override + public void activate(@Nullable Map<@NonNull String, @Nullable Object> configProperties) { + super.activate(configProperties); + } + + @Override + public void deactivate() { + super.deactivate(); + if (handler != null) { + handler.removeVehicleListener(this); + } + } + + @Override + public void vehicleFound(Vehicle vehicle, VehicleConfig vehicleConfig) { + ThingTypeUID type = identifyModel(vehicleConfig); + if (type != null) { + ThingUID thingUID = new ThingUID(type, handler.getThing().getUID(), vehicle.vin); + DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withLabel(vehicle.display_name) + .withBridge(handler.getThing().getUID()).withProperty(TeslaBindingConstants.VIN, vehicle.vin) + .build(); + thingDiscovered(discoveryResult); + } + } + + private ThingTypeUID identifyModel(VehicleConfig vehicleConfig) { + logger.debug("Found a {} vehicle", vehicleConfig.car_type); + switch (vehicleConfig.car_type) { + case "models": + case "models2": + return TeslaBindingConstants.THING_TYPE_MODELS; + case "modelx": + return TeslaBindingConstants.THING_TYPE_MODELX; + case "model3": + return TeslaBindingConstants.THING_TYPE_MODEL3; + case "modely": + return TeslaBindingConstants.THING_TYPE_MODELY; + default: + logger.debug("Found unknown vehicle type '{}' - ignoring it.", vehicleConfig.car_type); + return null; + } + } +} diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaAccountHandler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaAccountHandler.java new file mode 100644 index 0000000000000..d9d453e8043e0 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaAccountHandler.java @@ -0,0 +1,545 @@ +/** + * 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.tesla.internal.handler; + +import static org.openhab.binding.tesla.internal.TeslaBindingConstants.*; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Base64; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; + +import javax.ws.rs.ProcessingException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientRequestFilter; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; +import org.eclipse.smarthome.core.types.Command; +import org.openhab.binding.tesla.internal.TeslaBindingConstants; +import org.openhab.binding.tesla.internal.discovery.TeslaVehicleDiscoveryService; +import org.openhab.binding.tesla.internal.protocol.TokenRequest; +import org.openhab.binding.tesla.internal.protocol.TokenRequestPassword; +import org.openhab.binding.tesla.internal.protocol.TokenRequestRefreshToken; +import org.openhab.binding.tesla.internal.protocol.TokenResponse; +import org.openhab.binding.tesla.internal.protocol.Vehicle; +import org.openhab.binding.tesla.internal.protocol.VehicleConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +/** + * The {@link TeslaAccountHandler} is responsible for handling commands, which are sent + * to one of the channels. + * + * @author Karel Goderis - Initial contribution + * @author Nicolai Grødum - Adding token based auth + * @author Kai Kreuzer - refactored to use separate vehicle handlers + */ +public class TeslaAccountHandler extends BaseBridgeHandler { + + public static final int API_MAXIMUM_ERRORS_IN_INTERVAL = 2; + public static final int API_ERROR_INTERVAL_SECONDS = 15; + private static final int CONNECT_RETRY_INTERVAL = 15000; + private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + .withZone(ZoneId.systemDefault()); + + private final Logger logger = LoggerFactory.getLogger(TeslaAccountHandler.class); + + // REST Client API variables + private final Client teslaClient = ClientBuilder.newClient(); + private final WebTarget teslaTarget = teslaClient.target(URI_OWNERS); + private final WebTarget tokenTarget = teslaTarget.path(URI_ACCESS_TOKEN); + final WebTarget vehiclesTarget = teslaTarget.path(API_VERSION).path(VEHICLES); + final WebTarget vehicleTarget = vehiclesTarget.path(PATH_VEHICLE_ID); + final WebTarget dataRequestTarget = vehicleTarget.path(PATH_DATA_REQUEST); + final WebTarget commandTarget = vehicleTarget.path(PATH_COMMAND); + final WebTarget wakeUpTarget = vehicleTarget.path(PATH_WAKE_UP); + + // Threading and Job related variables + protected ScheduledFuture<?> connectJob; + + protected long lastTimeStamp; + protected long apiIntervalTimestamp; + protected int apiIntervalErrors; + protected long eventIntervalTimestamp; + protected int eventIntervalErrors; + protected ReentrantLock lock; + + private final Gson gson = new Gson(); + private final JsonParser parser = new JsonParser(); + + private TokenResponse logonToken; + private final Set<VehicleListener> vehicleListeners = new HashSet<>(); + + public TeslaAccountHandler(Bridge bridge) { + super(bridge); + } + + @Override + public void initialize() { + logger.trace("Initializing the Tesla account handler for {}", this.getStorageKey()); + + updateStatus(ThingStatus.UNKNOWN); + + lock = new ReentrantLock(); + lock.lock(); + + try { + if (connectJob == null || connectJob.isCancelled()) { + connectJob = scheduler.scheduleWithFixedDelay(connectRunnable, 0, CONNECT_RETRY_INTERVAL, + TimeUnit.MILLISECONDS); + } + } finally { + lock.unlock(); + } + } + + @Override + public void dispose() { + logger.trace("Disposing the Tesla account handler for {}", getThing().getUID()); + + lock.lock(); + try { + if (connectJob != null && !connectJob.isCancelled()) { + connectJob.cancel(true); + connectJob = null; + } + } finally { + lock.unlock(); + } + } + + public void scanForVehicles() { + scheduler.execute(() -> queryVehicles()); + } + + public void addVehicleListener(VehicleListener listener) { + this.vehicleListeners.add(listener); + } + + public void removeVehicleListener(VehicleListener listener) { + this.vehicleListeners.remove(listener); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + // we do not have any channels -> nothing to do here + } + + public String getAuthHeader() { + if (logonToken != null) { + return "Bearer " + logonToken.access_token; + } else { + return null; + } + } + + protected boolean checkResponse(Response response, boolean immediatelyFail) { + if (response != null && response.getStatus() == 200) { + return true; + } else { + apiIntervalErrors++; + if (immediatelyFail || apiIntervalErrors >= API_MAXIMUM_ERRORS_IN_INTERVAL) { + if (immediatelyFail) { + logger.warn("Got an unsuccessful result, setting vehicle to offline and will try again"); + } else { + logger.warn("Reached the maximum number of errors ({}) for the current interval ({} seconds)", + API_MAXIMUM_ERRORS_IN_INTERVAL, API_ERROR_INTERVAL_SECONDS); + } + + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + } else if ((System.currentTimeMillis() - apiIntervalTimestamp) > 1000 * API_ERROR_INTERVAL_SECONDS) { + logger.trace("Resetting the error counter. ({} errors in the last interval)", apiIntervalErrors); + apiIntervalTimestamp = System.currentTimeMillis(); + apiIntervalErrors = 0; + } + } + + return false; + } + + protected Vehicle[] queryVehicles() { + + String authHeader = getAuthHeader(); + + if (authHeader != null) { + // get a list of vehicles + Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE) + .header("Authorization", authHeader).get(); + + logger.debug("Querying the vehicle: Response: {}:{}", response.getStatus(), response.getStatusInfo()); + + if (!checkResponse(response, true)) { + logger.error("An error occurred while querying the vehicle"); + return null; + } + + JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject(); + Vehicle[] vehicleArray = gson.fromJson(jsonObject.getAsJsonArray("response"), Vehicle[].class); + + for (Vehicle vehicle : vehicleArray) { + String responseString = invokeAndParse(vehicle.id, VEHICLE_CONFIG, null, dataRequestTarget); + if (StringUtils.isBlank(responseString)) { + continue; + } + VehicleConfig vehicleConfig = gson.fromJson(responseString, VehicleConfig.class); + for (VehicleListener listener : vehicleListeners) { + listener.vehicleFound(vehicle, vehicleConfig); + } + for (Thing vehicleThing : getThing().getThings()) { + if (vehicle.vin.equals(vehicleThing.getConfiguration().get(VIN))) { + TeslaVehicleHandler vehicleHandler = (TeslaVehicleHandler) vehicleThing.getHandler(); + if (vehicleHandler != null) { + logger.debug("Querying the vehicle: VIN {}", vehicle.vin); + String vehicleJSON = gson.toJson(vehicle); + vehicleHandler.parseAndUpdate("queryVehicle", null, vehicleJSON); + logger.trace("Vehicle is id {}/vehicle_id {}/tokens {}", vehicle.id, vehicle.vehicle_id, + vehicle.tokens); + } + } + } + } + return vehicleArray; + } else { + return new Vehicle[0]; + } + } + + private String getStorageKey() { + return this.getThing().getUID().getId(); + } + + private ThingStatusInfo authenticate() { + TokenResponse token = logonToken; + + boolean hasExpired = true; + + if (token != null) { + Instant tokenCreationInstant = Instant.ofEpochMilli(token.created_at * 1000); + logger.debug("Found a request token created at {}", dateFormatter.format(tokenCreationInstant)); + Instant tokenExpiresInstant = Instant.ofEpochMilli(token.created_at * 1000 + 60 * token.expires_in); + + if (tokenExpiresInstant.isBefore(Instant.now())) { + logger.debug("The token has expired at {}", dateFormatter.format(tokenExpiresInstant)); + hasExpired = true; + } else { + hasExpired = false; + } + } + + if (hasExpired) { + String username = (String) getConfig().get(CONFIG_USERNAME); + String refreshToken = (String) getConfig().get(CONFIG_REFRESHTOKEN); + if (refreshToken == null || StringUtils.isEmpty(refreshToken)) { + if (!StringUtils.isEmpty(username)) { + String password = (String) getConfig().get(CONFIG_PASSWORD); + return authenticate(username, password); + } else { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Neither a refresh token nor credentials are provided."); + } + } + + TokenRequestRefreshToken tokenRequest = null; + try { + tokenRequest = new TokenRequestRefreshToken(refreshToken); + } catch (GeneralSecurityException e) { + logger.error("An exception occurred while requesting a new token: '{}'", e.getMessage(), e); + } + + String payLoad = gson.toJson(tokenRequest); + Response response = null; + try { + response = tokenTarget.request().post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); + } catch (ProcessingException e) { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + + logger.debug("Authenticating: Response: {}:{}", response.getStatus(), response.getStatusInfo()); + + if (response.getStatus() == 200 && response.hasEntity()) { + String responsePayLoad = response.readEntity(String.class); + TokenResponse tokenResponse = gson.fromJson(responsePayLoad.trim(), TokenResponse.class); + if (!refreshToken.equals(tokenResponse.refresh_token)) { + Configuration configuration = editConfiguration(); + configuration.put(CONFIG_REFRESHTOKEN, tokenResponse.refresh_token); + updateConfiguration(configuration); + } + + if (!StringUtils.isEmpty(tokenResponse.access_token)) { + this.logonToken = tokenResponse; + logger.trace("Access Token is {}", logonToken.access_token); + } + return new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, null); + } else if (response.getStatus() == 401) { + if (!StringUtils.isEmpty(username)) { + String password = (String) getConfig().get(CONFIG_PASSWORD); + return authenticate(username, password); + } else { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Refresh token is not valid and no credentials are provided."); + } + } else { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "HTTP returncode " + response.getStatus()); + } + } + return new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, null); + } + + private ThingStatusInfo authenticate(String username, String password) { + TokenRequest token = null; + try { + token = new TokenRequestPassword(username, password); + } catch (GeneralSecurityException e) { + logger.error("An exception occurred while building a password request token: '{}'", e.getMessage(), e); + } + + if (token != null) { + String payLoad = gson.toJson(token); + + Response response = tokenTarget.request().post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); + + if (response != null) { + logger.debug("Authenticating: Response : {}:{}", response.getStatus(), response.getStatusInfo()); + + if (response.getStatus() == 200 && response.hasEntity()) { + String responsePayLoad = response.readEntity(String.class); + TokenResponse tokenResponse = gson.fromJson(responsePayLoad.trim(), TokenResponse.class); + + if (StringUtils.isNotEmpty(tokenResponse.access_token)) { + this.logonToken = tokenResponse; + Configuration cfg = editConfiguration(); + cfg.put(TeslaBindingConstants.CONFIG_REFRESHTOKEN, logonToken.refresh_token); + cfg.remove(TeslaBindingConstants.CONFIG_PASSWORD); + updateConfiguration(cfg); + return new ThingStatusInfo(ThingStatus.ONLINE, ThingStatusDetail.NONE, null); + } + } else if (response.getStatus() == 401) { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Invalid credentials."); + } else { + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "HTTP returncode " + response.getStatus()); + } + } else { + logger.debug("Authenticating: Response was null"); + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + "Failed retrieving a response from the server."); + } + } + return new ThingStatusInfo(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, + "Cannot build request from credentials."); + } + + protected String invokeAndParse(String vehicleId, String command, String payLoad, WebTarget target) { + logger.debug("Invoking: {}", command); + + if (vehicleId != null) { + Response response; + + if (payLoad != null) { + if (command != null) { + response = target.resolveTemplate("cmd", command).resolveTemplate("vid", vehicleId).request() + .header("Authorization", "Bearer " + logonToken.access_token) + .post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); + } else { + response = target.resolveTemplate("vid", vehicleId).request() + .header("Authorization", "Bearer " + logonToken.access_token) + .post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); + } + } else { + if (command != null) { + response = target.resolveTemplate("cmd", command).resolveTemplate("vid", vehicleId) + .request(MediaType.APPLICATION_JSON_TYPE) + .header("Authorization", "Bearer " + logonToken.access_token).get(); + } else { + response = target.resolveTemplate("vid", vehicleId).request(MediaType.APPLICATION_JSON_TYPE) + .header("Authorization", "Bearer " + logonToken.access_token).get(); + } + } + + if (!checkResponse(response, false)) { + logger.debug("An error occurred while communicating with the vehicle during request {}: {}:{}", command, + (response != null) ? response.getStatus() : "", + (response != null) ? response.getStatusInfo() : "No Response"); + return null; + } + + try { + JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject(); + logger.trace("Request : {}:{}:{} yields {}", command, payLoad, target, jsonObject.get("response")); + return jsonObject.get("response").toString(); + } catch (Exception e) { + logger.error("An exception occurred while invoking a REST request: '{}'", e.getMessage()); + } + } + + return null; + } + + protected Runnable connectRunnable = () -> { + try { + lock.lock(); + + if (getThing().getStatus() != ThingStatus.ONLINE) { + logger.debug("Setting up an authenticated connection to the Tesla back-end"); + + ThingStatusInfo authenticationResult = authenticate(); + updateStatus(authenticationResult.getStatus(), authenticationResult.getStatusDetail(), + authenticationResult.getDescription()); + + if (authenticationResult.getStatus() == ThingStatus.ONLINE) { + // get a list of vehicles + Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE) + .header("Authorization", "Bearer " + logonToken.access_token).get(); + + if (response != null && response.getStatus() == 200 && response.hasEntity()) { + updateStatus(ThingStatus.ONLINE); + for (Vehicle vehicle : queryVehicles()) { + Bridge bridge = getBridge(); + if (bridge != null) { + List<Thing> things = bridge.getThings(); + for (int i = 0; i < things.size(); i++) { + Thing thing = things.get(i); + TeslaVehicleHandler handler = (TeslaVehicleHandler) thing.getHandler(); + if (handler != null) { + if (vehicle.vin.equals(thing.getConfiguration().get(VIN))) { + logger.debug( + "Found the vehicle with VIN '{}' in the list of vehicles you own", + getConfig().get(VIN)); + apiIntervalErrors = 0; + apiIntervalTimestamp = System.currentTimeMillis(); + } else { + logger.warn( + "Unable to find the vehicle with VIN '{}' in the list of vehicles you own", + getConfig().get(VIN)); + handler.updateStatus(ThingStatus.OFFLINE, + ThingStatusDetail.CONFIGURATION_ERROR, + "Vin is not available through this account."); + } + } + } + } + } + } else { + if (response != null) { + logger.error("Error fetching the list of vehicles : {}:{}", response.getStatus(), + response.getStatusInfo()); + updateStatus(ThingStatus.OFFLINE); + } + } + } + } + } catch (Exception e) { + logger.error("An exception occurred while connecting to the Tesla back-end: '{}'", e.getMessage(), e); + } finally { + lock.unlock(); + } + }; + + public static class Authenticator implements ClientRequestFilter { + private final String user; + private final String password; + + public Authenticator(String user, String password) { + this.user = user; + this.password = password; + } + + @Override + public void filter(ClientRequestContext requestContext) throws IOException { + MultivaluedMap<String, Object> headers = requestContext.getHeaders(); + final String basicAuthentication = getBasicAuthentication(); + headers.add("Authorization", basicAuthentication); + } + + private String getBasicAuthentication() { + String token = this.user + ":" + this.password; + return "Basic " + Base64.getEncoder().encodeToString(token.getBytes(StandardCharsets.UTF_8)); + } + } + + protected class Request implements Runnable { + + private TeslaVehicleHandler handler; + private String request; + private String payLoad; + private WebTarget target; + + public Request(TeslaVehicleHandler handler, String request, String payLoad, WebTarget target) { + this.handler = handler; + this.request = request; + this.payLoad = payLoad; + this.target = target; + } + + @Override + public void run() { + try { + String result = ""; + + if (getThing().getStatus() == ThingStatus.ONLINE) { + result = invokeAndParse(handler.getVehicleId(), request, payLoad, target); + if (result != null && !"".equals(result)) { + handler.parseAndUpdate(request, payLoad, result); + } + } + } catch (Exception e) { + logger.error("An exception occurred while executing a request to the vehicle: '{}'", e.getMessage(), e); + } + } + + } + + public Request newRequest(TeslaVehicleHandler teslaVehicleHandler, String command, String payLoad, + WebTarget target) { + return new Request(teslaVehicleHandler, command, payLoad, target); + } + + @Override + public Collection<Class<? extends ThingHandlerService>> getServices() { + return Collections.singletonList(TeslaVehicleDiscoveryService.class); + } + +} diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaHandler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaVehicleHandler.java similarity index 62% rename from bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaHandler.java rename to bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaVehicleHandler.java index 526247c2b32f3..ea08e01d52fe1 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaHandler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/TeslaVehicleHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,11 +19,8 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.math.BigDecimal; -import java.nio.charset.StandardCharsets; -import java.security.GeneralSecurityException; +import java.math.RoundingMode; import java.text.SimpleDateFormat; -import java.util.Base64; -import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -32,24 +29,23 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; +import javax.measure.quantity.Temperature; +import javax.ws.rs.ProcessingException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.ClientRequestContext; -import javax.ws.rs.client.ClientRequestFilter; -import javax.ws.rs.client.Entity; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import org.apache.commons.lang.StringUtils; -import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.library.types.QuantityType; import org.eclipse.smarthome.core.library.types.StringType; -import org.eclipse.smarthome.core.storage.Storage; -import org.eclipse.smarthome.core.storage.StorageService; +import org.eclipse.smarthome.core.library.unit.SIUnits; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; @@ -64,14 +60,12 @@ import org.openhab.binding.tesla.internal.TeslaBindingConstants.EventKeys; import org.openhab.binding.tesla.internal.TeslaChannelSelectorProxy; import org.openhab.binding.tesla.internal.TeslaChannelSelectorProxy.TeslaChannelSelector; +import org.openhab.binding.tesla.internal.handler.TeslaAccountHandler.Authenticator; +import org.openhab.binding.tesla.internal.handler.TeslaAccountHandler.Request; import org.openhab.binding.tesla.internal.protocol.ChargeState; import org.openhab.binding.tesla.internal.protocol.ClimateState; import org.openhab.binding.tesla.internal.protocol.DriveState; import org.openhab.binding.tesla.internal.protocol.GUIState; -import org.openhab.binding.tesla.internal.protocol.TokenRequest; -import org.openhab.binding.tesla.internal.protocol.TokenRequestPassword; -import org.openhab.binding.tesla.internal.protocol.TokenRequestRefreshToken; -import org.openhab.binding.tesla.internal.protocol.TokenResponse; import org.openhab.binding.tesla.internal.protocol.Vehicle; import org.openhab.binding.tesla.internal.protocol.VehicleState; import org.openhab.binding.tesla.internal.throttler.QueueChannelThrottler; @@ -85,29 +79,29 @@ import com.google.gson.JsonParser; /** - * The {@link TeslaHandler} is responsible for handling commands, which are sent - * to one of the channels. + * The {@link TeslaVehicleHandler} is responsible for handling commands, which are sent + * to one of the channels of a specific vehicle. * * @author Karel Goderis - Initial contribution - * @author Nicolai Grødum - Adding token based auth + * @author Kai Kreuzer - Refactored to use separate account handler and improved configuration options */ -public class TeslaHandler extends BaseThingHandler { +public class TeslaVehicleHandler extends BaseThingHandler { private static final int EVENT_STREAM_CONNECT_TIMEOUT = 3000; private static final int EVENT_STREAM_READ_TIMEOUT = 200000; + private static final int EVENT_STREAM_PAUSE = 5000; private static final int EVENT_TIMESTAMP_AGE_LIMIT = 3000; private static final int EVENT_TIMESTAMP_MAX_DELTA = 10000; private static final int FAST_STATUS_REFRESH_INTERVAL = 15000; private static final int SLOW_STATUS_REFRESH_INTERVAL = 60000; - private static final int CONNECT_RETRY_INTERVAL = 15000; - private static final int API_MAXIMUM_ERRORS_IN_INTERVAL = 2; - private static final int API_ERROR_INTERVAL_SECONDS = 15; private static final int EVENT_MAXIMUM_ERRORS_IN_INTERVAL = 10; private static final int EVENT_ERROR_INTERVAL_SECONDS = 15; - private static final int API_SLEEP_INTERVAL_MINUTES = 15; + private static final int API_SLEEP_INTERVAL_MINUTES = 20; private static final int MOVE_THRESHOLD_INTERVAL_MINUTES = 5; - private final Logger logger = LoggerFactory.getLogger(TeslaHandler.class); + private final Logger logger = LoggerFactory.getLogger(TeslaVehicleHandler.class); + + protected WebTarget eventTarget; // Vehicle state variables protected Vehicle vehicle; @@ -118,26 +112,8 @@ public class TeslaHandler extends BaseThingHandler { protected ChargeState chargeState; protected ClimateState climateState; - // REST Client API variables - protected final Client teslaClient = ClientBuilder.newClient(); - protected Client eventClient = ClientBuilder.newClient(); - public final WebTarget teslaTarget = teslaClient.target(URI_OWNERS); - public final WebTarget tokenTarget = teslaTarget.path(URI_ACCESS_TOKEN); - public final WebTarget vehiclesTarget = teslaTarget.path(API_VERSION).path(VEHICLES); - public final WebTarget vehicleTarget = vehiclesTarget.path(PATH_VEHICLE_ID); - public final WebTarget dataRequestTarget = vehicleTarget.path(PATH_DATA_REQUEST); - public final WebTarget commandTarget = vehicleTarget.path(PATH_COMMAND); - public final WebTarget wakeUpTarget = vehicleTarget.path(PATH_WAKE_UP); - protected WebTarget eventTarget; - - // Threading and Job related variables - protected ScheduledFuture<?> connectJob; - protected Thread eventThread; - protected ScheduledFuture<?> fastStateJob; - protected ScheduledFuture<?> slowStateJob; - protected QueueChannelThrottler stateThrottler; - - protected boolean allowWakeUp = false; + protected boolean allowWakeUp; + protected boolean enableEvents = false; protected long lastTimeStamp; protected long apiIntervalTimestamp; protected int apiIntervalErrors; @@ -153,31 +129,38 @@ public class TeslaHandler extends BaseThingHandler { protected String lastState = ""; protected boolean isInactive = false; - private StorageService storageService; - protected Gson gson = new Gson(); + protected TeslaAccountHandler account; + + protected QueueChannelThrottler stateThrottler; + protected Client eventClient = ClientBuilder.newClient(); protected TeslaChannelSelectorProxy teslaChannelSelectorProxy = new TeslaChannelSelectorProxy(); - private TokenResponse logonToken; + protected Thread eventThread; + protected ScheduledFuture<?> fastStateJob; + protected ScheduledFuture<?> slowStateJob; - public TeslaHandler(Thing thing, StorageService storageService) { + private final Gson gson = new Gson(); + private final JsonParser parser = new JsonParser(); + + public TeslaVehicleHandler(Thing thing) { super(thing); - this.storageService = storageService; } + @SuppressWarnings("null") @Override public void initialize() { - logger.trace("Initializing the Tesla handler for {}", this.getStorageKey()); - + logger.trace("Initializing the Tesla handler for {}", getThing().getUID()); updateStatus(ThingStatus.UNKNOWN); + allowWakeUp = (boolean) getConfig().get(TeslaBindingConstants.CONFIG_ALLOWWAKEUP); + // the streaming API seems to be broken - let's keep the code, if it comes back one day + // enableEvents = (boolean) getConfig().get(TeslaBindingConstants.CONFIG_ENABLEEVENTS); + + account = (TeslaAccountHandler) getBridge().getHandler(); lock = new ReentrantLock(); + scheduler.execute(() -> queryVehicleAndUpdate()); lock.lock(); try { - if (connectJob == null || connectJob.isCancelled()) { - connectJob = scheduler.scheduleWithFixedDelay(connectRunnable, 0, CONNECT_RETRY_INTERVAL, - TimeUnit.MILLISECONDS); - } - Map<Object, Rate> channels = new HashMap<>(); channels.put(DATA_THROTTLE, new Rate(1, 1, TimeUnit.SECONDS)); channels.put(COMMAND_THROTTLE, new Rate(20, 1, TimeUnit.MINUTES)); @@ -199,12 +182,18 @@ public void initialize() { } finally { lock.unlock(); } + + if (enableEvents) { + if (eventThread == null) { + eventThread = new Thread(eventRunnable, "openHAB-Tesla-Events-" + getThing().getUID()); + eventThread.start(); + } + } } @Override public void dispose() { logger.trace("Disposing the Tesla handler for {}", getThing().getUID()); - lock.lock(); try { if (fastStateJob != null && !fastStateJob.isCancelled()) { @@ -221,27 +210,39 @@ public void dispose() { eventThread.interrupt(); eventThread = null; } - - if (connectJob != null && !connectJob.isCancelled()) { - connectJob.cancel(true); - connectJob = null; - } } finally { lock.unlock(); } + + eventClient.close(); + } + + /** + * Retrieves the unique vehicle id this handler is associated with + * + * @return the vehicle id + */ + public String getVehicleId() { + return vehicle.id; } @Override public void handleCommand(ChannelUID channelUID, Command command) { + logger.debug("handleCommand {} {}", channelUID, command); String channelID = channelUID.getId(); TeslaChannelSelector selector = TeslaChannelSelector.getValueSelectorFromChannelID(channelID); if (command instanceof RefreshType) { - if (isAwake()) { - // Request the state of all known variables. This is sub-optimal, but the requests get scheduled and - // throttled so we are safe not to break the Tesla SLA - requestAllData(); + if (!isAwake()) { + logger.debug("Waking vehicle to refresh all data"); + wakeUp(); } + + setActive(); + + // Request the state of all known variables. This is sub-optimal, but the requests get scheduled and + // throttled so we are safe not to break the Tesla SLA + requestAllData(); } else { if (selector != null) { try { @@ -262,16 +263,24 @@ public void handleCommand(ChannelUID channelUID, Command command) { } break; } - case TEMPERATURE: { - if (command instanceof DecimalType) { - if (getThing().getProperties().containsKey("temperatureunits") - && getThing().getProperties().get("temperatureunits").equals("F")) { - float fTemp = ((DecimalType) command).floatValue(); - float cTemp = ((fTemp - 32.0f) * 5.0f / 9.0f); - setTemperature(cTemp); - } else { - setTemperature(((DecimalType) command).floatValue()); - } + case COMBINED_TEMP: { + QuantityType<Temperature> quantity = commandToQuantityType(command); + if (quantity != null) { + setCombinedTemperature(quanityToRoundedFloat(quantity)); + } + break; + } + case DRIVER_TEMP: { + QuantityType<Temperature> quantity = commandToQuantityType(command); + if (quantity != null) { + setDriverTemperature(quanityToRoundedFloat(quantity)); + } + break; + } + case PASSENGER_TEMP: { + QuantityType<Temperature> quantity = commandToQuantityType(command); + if (quantity != null) { + setPassengerTemperature(quanityToRoundedFloat(quantity)); } break; } @@ -369,41 +378,6 @@ && getThing().getProperties().get("temperatureunits").equals("F")) { } break; } - case FORCE_REFRESH: { - if (command instanceof OnOffType) { - if (((OnOffType) command) == OnOffType.ON) { - if (!isOnline()) { - wakeUp(); - } else { - setActive(); - } - } - } - break; - } - case ALLOWWAKEUP: { - if (command instanceof OnOffType) { - allowWakeUp = (((OnOffType) command) == OnOffType.ON); - } - break; - } - case ENABLEEVENTS: { - if (command instanceof OnOffType) { - if (((OnOffType) command) == OnOffType.ON) { - if (eventThread == null) { - eventThread = new Thread(eventRunnable, - "openHAB-Tesla-Events-" + getThing().getUID()); - eventThread.start(); - } - } else { - if (eventThread != null) { - eventThread.interrupt(); - eventThread = null; - } - } - } - break; - } case FT: { if (command instanceof OnOffType) { if (((OnOffType) command) == OnOffType.ON) { @@ -459,9 +433,11 @@ && getThing().getProperties().get("temperatureunits").equals("F")) { } public void sendCommand(String command, String payLoad, WebTarget target) { - Request request = new Request(command, payLoad, target); - if (stateThrottler != null) { - stateThrottler.submit(COMMAND_THROTTLE, request); + if (command.equals(COMMAND_WAKE_UP) || isAwake()) { + Request request = account.newRequest(this, command, payLoad, target); + if (stateThrottler != null) { + stateThrottler.submit(COMMAND_THROTTLE, request); + } } } @@ -470,32 +446,53 @@ public void sendCommand(String command) { } public void sendCommand(String command, String payLoad) { - Request request = new Request(command, payLoad, commandTarget); - if (stateThrottler != null) { - stateThrottler.submit(COMMAND_THROTTLE, request); + if (command.equals(COMMAND_WAKE_UP) || isAwake()) { + Request request = account.newRequest(this, command, payLoad, account.commandTarget); + if (stateThrottler != null) { + stateThrottler.submit(COMMAND_THROTTLE, request); + } } } public void sendCommand(String command, WebTarget target) { - Request request = new Request(command, "{}", target); - if (stateThrottler != null) { - stateThrottler.submit(COMMAND_THROTTLE, request); + if (command.equals(COMMAND_WAKE_UP) || isAwake()) { + Request request = account.newRequest(this, command, "{}", target); + if (stateThrottler != null) { + stateThrottler.submit(COMMAND_THROTTLE, request); + } } } public void requestData(String command, String payLoad) { - Request request = new Request(command, payLoad, dataRequestTarget); - if (stateThrottler != null) { - stateThrottler.submit(DATA_THROTTLE, request); + if (command.equals(COMMAND_WAKE_UP) || isAwake()) { + Request request = account.newRequest(this, command, payLoad, account.dataRequestTarget); + if (stateThrottler != null) { + stateThrottler.submit(DATA_THROTTLE, request); + } } } + @Override + protected void updateStatus(@NonNull ThingStatus status) { + super.updateStatus(status); + } + + @Override + protected void updateStatus(@NonNull ThingStatus status, @NonNull ThingStatusDetail statusDetail) { + super.updateStatus(status, statusDetail); + } + + @Override + protected void updateStatus(ThingStatus status, ThingStatusDetail statusDetail, @Nullable String description) { + super.updateStatus(status, statusDetail, description); + } + public void requestData(String command) { requestData(command, null); } public void queryVehicle(String parameter) { - WebTarget target = vehicleTarget.path(parameter); + WebTarget target = account.vehicleTarget.path(parameter); sendCommand(parameter, null, target); } @@ -507,63 +504,250 @@ public void requestAllData() { requestData(GUI_STATE); } - protected String invokeAndParse(String command, String payLoad, WebTarget target) { - logger.debug("Invoking: {}", command); + protected boolean isAwake() { + return vehicle != null && "online".equals(vehicle.state) && vehicle.vehicle_id != null; + } - if (vehicle.id != null) { - Response response; + protected boolean isInMotion() { + if (driveState != null) { + if (driveState.speed != null && driveState.shift_state != null) { + return !"Undefined".equals(driveState.speed) + && (!"P".equals(driveState.shift_state) || !"Undefined".equals(driveState.shift_state)); + } + } + return false; + } - if (payLoad != null) { - if (command != null) { - response = target.resolveTemplate("cmd", command).resolveTemplate("vid", vehicle.id).request() - .header("Authorization", "Bearer " + logonToken.access_token) - .post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); - } else { - response = target.resolveTemplate("vid", vehicle.id).request() - .header("Authorization", "Bearer " + logonToken.access_token) - .post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); - } - } else { - if (command != null) { - response = target.resolveTemplate("cmd", command).resolveTemplate("vid", vehicle.id) - .request(MediaType.APPLICATION_JSON_TYPE) - .header("Authorization", "Bearer " + logonToken.access_token).get(); + protected boolean isInactive() { + // vehicle is inactive in case + // - it does not charge + // - it has not moved in the observation period + return isInactive && !isCharging() && !hasMovedInSleepInterval(); + } + + protected boolean isCharging() { + return chargeState != null && "Charging".equals(chargeState.charging_state); + } + + protected boolean hasMovedInSleepInterval() { + return lastLocationChangeTimestamp > (System.currentTimeMillis() + - (MOVE_THRESHOLD_INTERVAL_MINUTES * 60 * 1000)); + } + + protected boolean allowQuery() { + return (isAwake() && !isInactive()); + } + + protected void setActive() { + isInactive = false; + lastLocationChangeTimestamp = System.currentTimeMillis(); + lastLatitude = 0; + lastLongitude = 0; + } + + protected boolean checkResponse(Response response, boolean immediatelyFail) { + + if (response != null && response.getStatus() == 200) { + return true; + } else { + apiIntervalErrors++; + if (immediatelyFail || apiIntervalErrors >= TeslaAccountHandler.API_MAXIMUM_ERRORS_IN_INTERVAL) { + if (immediatelyFail) { + logger.warn("Got an unsuccessful result, setting vehicle to offline and will try again"); } else { - response = target.resolveTemplate("vid", vehicle.id).request(MediaType.APPLICATION_JSON_TYPE) - .header("Authorization", "Bearer " + logonToken.access_token).get(); + logger.warn("Reached the maximum number of errors ({}) for the current interval ({} seconds)", + TeslaAccountHandler.API_MAXIMUM_ERRORS_IN_INTERVAL, + TeslaAccountHandler.API_ERROR_INTERVAL_SECONDS); } + + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); + eventClient.close(); + } else if ((System.currentTimeMillis() - apiIntervalTimestamp) > 1000 + * TeslaAccountHandler.API_ERROR_INTERVAL_SECONDS) { + logger.trace("Resetting the error counter. ({} errors in the last interval)", apiIntervalErrors); + apiIntervalTimestamp = System.currentTimeMillis(); + apiIntervalErrors = 0; } + } - JsonParser parser = new JsonParser(); + return false; + } - if (!checkResponse(response, false)) { - logger.error("An error occurred while communicating with the vehicle during request {} : {}:{}", - new Object[] { command, (response != null) ? response.getStatus() : "", - (response != null) ? response.getStatusInfo() : "No Response" }); - return null; - } + public void setChargeLimit(int percent) { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("percent", percent); + sendCommand(COMMAND_SET_CHARGE_LIMIT, gson.toJson(payloadObject), account.commandTarget); + requestData(CHARGE_STATE); + } + + public void setSunroof(String state) { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("state", state); + sendCommand(COMMAND_SUN_ROOF, gson.toJson(payloadObject), account.commandTarget); + requestData(VEHICLE_STATE); + } + + public void moveSunroof(int percent) { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("state", "move"); + payloadObject.addProperty("percent", percent); + sendCommand(COMMAND_SUN_ROOF, gson.toJson(payloadObject), account.commandTarget); + requestData(VEHICLE_STATE); + } + + /** + * Sets the driver and passenger temperatures. + * + * While setting different temperature values is supported by the API, in practice this does not always work + * reliably, possibly if the the + * only reliable method is to set the driver and passenger temperature to the same value + * + * @param driverTemperature in Celsius + * @param passenegerTemperature in Celsius + */ + public void setTemperature(float driverTemperature, float passenegerTemperature) { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("driver_temp", driverTemperature); + payloadObject.addProperty("passenger_temp", passenegerTemperature); + sendCommand(COMMAND_SET_TEMP, gson.toJson(payloadObject), account.commandTarget); + requestData(CLIMATE_STATE); + } + + public void setCombinedTemperature(float temperature) { + setTemperature(temperature, temperature); + } + + public void setDriverTemperature(float temperature) { + setTemperature(temperature, climateState != null ? climateState.passenger_temp_setting : temperature); + } + + public void setPassengerTemperature(float temperature) { + setTemperature(climateState != null ? climateState.driver_temp_setting : temperature, temperature); + } + + public void openFrunk() { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("which_trunk", "front"); + sendCommand(COMMAND_TRUNK_OPEN, gson.toJson(payloadObject), account.commandTarget); + requestData(VEHICLE_STATE); + } + + public void openTrunk() { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("which_trunk", "rear"); + sendCommand(COMMAND_TRUNK_OPEN, gson.toJson(payloadObject), account.commandTarget); + requestData(VEHICLE_STATE); + } + + public void closeTrunk() { + openTrunk(); + } + + public void setValetMode(boolean b, Integer pin) { + JsonObject payloadObject = new JsonObject(); + payloadObject.addProperty("on", b); + if (pin != null) { + payloadObject.addProperty("password", String.format("%04d", pin)); + } + sendCommand(COMMAND_SET_VALET_MODE, gson.toJson(payloadObject), account.commandTarget); + requestData(VEHICLE_STATE); + } + + public void resetValetPin() { + sendCommand(COMMAND_RESET_VALET_PIN, account.commandTarget); + requestData(VEHICLE_STATE); + } + public void setMaxRangeCharging(boolean b) { + sendCommand(b ? COMMAND_CHARGE_MAX : COMMAND_CHARGE_STD, account.commandTarget); + requestData(CHARGE_STATE); + } + + public void charge(boolean b) { + sendCommand(b ? COMMAND_CHARGE_START : COMMAND_CHARGE_STOP, account.commandTarget); + requestData(CHARGE_STATE); + } + + public void flashLights() { + sendCommand(COMMAND_FLASH_LIGHTS, account.commandTarget); + } + + public void honkHorn() { + sendCommand(COMMAND_HONK_HORN, account.commandTarget); + } + + public void openChargePort() { + sendCommand(COMMAND_OPEN_CHARGE_PORT, account.commandTarget); + requestData(CHARGE_STATE); + } + + public void lockDoors(boolean b) { + sendCommand(b ? COMMAND_DOOR_LOCK : COMMAND_DOOR_UNLOCK, account.commandTarget); + requestData(VEHICLE_STATE); + } + + public void autoConditioning(boolean b) { + sendCommand(b ? COMMAND_AUTO_COND_START : COMMAND_AUTO_COND_STOP, account.commandTarget); + requestData(CLIMATE_STATE); + } + + public void wakeUp() { + sendCommand(COMMAND_WAKE_UP, account.wakeUpTarget); + } + + protected Vehicle queryVehicle() { + String authHeader = account.getAuthHeader(); + + if (authHeader != null) { try { + // get a list of vehicles + Response response = account.vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE) + .header("Authorization", authHeader).get(); + + logger.debug("Querying the vehicle : Response : {}:{}", response.getStatus(), response.getStatusInfo()); + + if (!checkResponse(response, true)) { + logger.error("An error occurred while querying the vehicle"); + return null; + } + JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject(); - logger.trace("Request : {}:{}:{} yields {}", - new Object[] { command, payLoad, target.toString(), jsonObject.get("response").toString() }); - return jsonObject.get("response").toString(); - } catch (Exception e) { - logger.error("An exception occurred while invoking a REST request : '{}'", e.getMessage()); + Vehicle[] vehicleArray = gson.fromJson(jsonObject.getAsJsonArray("response"), Vehicle[].class); + + for (Vehicle vehicle : vehicleArray) { + logger.debug("Querying the vehicle: VIN {}", vehicle.vin); + if (vehicle.vin.equals(getConfig().get(VIN))) { + vehicleJSON = gson.toJson(vehicle); + parseAndUpdate("queryVehicle", null, vehicleJSON); + if (logger.isTraceEnabled()) { + logger.trace("Vehicle is id {}/vehicle_id {}/tokens {}", vehicle.id, vehicle.vehicle_id, + vehicle.tokens); + } + return vehicle; + } + } + } catch (ProcessingException e) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } - return null; } + protected void queryVehicleAndUpdate() { + vehicle = queryVehicle(); + if (vehicle != null) { + parseAndUpdate("queryVehicle", null, vehicleJSON); + } + } + public void parseAndUpdate(String request, String payLoad, String result) { final Double LOCATION_THRESHOLD = .0000001; - JsonParser parser = new JsonParser(); JsonObject jsonObject = null; try { if (request != null && result != null && !"null".equals(result)) { + updateStatus(ThingStatus.ONLINE); // first, update state objects switch (request) { case DRIVE_STATE: { @@ -600,15 +784,18 @@ public void parseAndUpdate(String request, String payLoad, String result) { } case CLIMATE_STATE: { climateState = gson.fromJson(result, ClimateState.class); + BigDecimal avgtemp = roundBigDecimal(new BigDecimal( + (climateState.driver_temp_setting + climateState.passenger_temp_setting) / 2.0f)); + updateState(CHANNEL_COMBINED_TEMP, new QuantityType<>(avgtemp, SIUnits.CELSIUS)); break; } case "queryVehicle": { if (vehicle != null && !lastState.equals(vehicle.state)) { lastState = vehicle.state; - // in case vehicle changed to online, refresh all data - if (isOnline()) { - logger.debug("Vehicle is now online, updating all data"); + // in case vehicle changed to awake, refresh all data + if (isAwake()) { + logger.debug("Vehicle is now awake, updating all data"); lastLocationChangeTimestamp = System.currentTimeMillis(); requestAllData(); } @@ -734,350 +921,42 @@ public void parseAndUpdate(String request, String payLoad, String result) { } } - protected boolean isAwake() { - return vehicle != null && "online".equals(vehicle.state) && vehicle.vehicle_id != null; + @SuppressWarnings("unchecked") + protected QuantityType<Temperature> commandToQuantityType(Command command) { + if (command instanceof QuantityType) { + return ((QuantityType<Temperature>) command).toUnit(SIUnits.CELSIUS); + } + return new QuantityType<Temperature>(new BigDecimal(command.toString()), SIUnits.CELSIUS); } - protected boolean isOnline() { - return vehicle != null && "online".equals(vehicle.state) && vehicle.vehicle_id != null; + protected float quanityToRoundedFloat(QuantityType<Temperature> quantity) { + return roundBigDecimal(quantity.toBigDecimal()).floatValue(); } - protected boolean isInMotion() { - if (driveState != null) { - if (driveState.speed != null && driveState.shift_state != null) { - return !"Undefined".equals(driveState.speed) - && (!"P".equals(driveState.shift_state) || !"Undefined".equals(driveState.shift_state)); - } - } - return false; + protected BigDecimal roundBigDecimal(BigDecimal value) { + return value.setScale(1, RoundingMode.HALF_EVEN); } - protected boolean isInactive() { - // vehicle is inactive in case - // - it does not charge - // - it has not moved in the observation period - return isInactive && !isCharging() && !hasMovedInSleepInterval(); - } + protected Runnable slowStateRunnable = () -> { + queryVehicleAndUpdate(); - protected boolean isCharging() { - return chargeState != null && "Charging".equals(chargeState.charging_state); - } - - protected boolean hasMovedInSleepInterval() { - return lastLocationChangeTimestamp > (System.currentTimeMillis() - - (MOVE_THRESHOLD_INTERVAL_MINUTES * 60 * 1000)); - } - - protected boolean allowQuery() { - return allowWakeUp || (isOnline() && !isInactive()); - } - - protected void setActive() { - isInactive = false; - lastLocationChangeTimestamp = System.currentTimeMillis(); - lastLatitude = 0; - lastLongitude = 0; - } - - protected boolean checkResponse(Response response, boolean immediatelyFail) { - - if (response != null && response.getStatus() == 200) { - return true; - } else { - apiIntervalErrors++; - if (immediatelyFail || apiIntervalErrors >= API_MAXIMUM_ERRORS_IN_INTERVAL) { - if (immediatelyFail) { - logger.warn("Got an unsuccessful result, setting vehicle to offline and will try again"); - } else { - logger.warn("Reached the maximum number of errors ({}) for the current interval ({} seconds)", - API_MAXIMUM_ERRORS_IN_INTERVAL, API_ERROR_INTERVAL_SECONDS); - } - - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); - eventClient.close(); - } else if ((System.currentTimeMillis() - apiIntervalTimestamp) > 1000 * API_ERROR_INTERVAL_SECONDS) { - logger.trace("Resetting the error counter. ({} errors in the last interval)", apiIntervalErrors); - apiIntervalTimestamp = System.currentTimeMillis(); - apiIntervalErrors = 0; - } - } - - return false; - } - - public void setChargeLimit(int percent) { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("percent", percent); - sendCommand(COMMAND_SET_CHARGE_LIMIT, gson.toJson(payloadObject), commandTarget); - requestData(CHARGE_STATE); - } - - public void setSunroof(String state) { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("state", state); - sendCommand(COMMAND_SUN_ROOF, gson.toJson(payloadObject), commandTarget); - requestData(VEHICLE_STATE); - } - - public void moveSunroof(int percent) { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("state", "move"); - payloadObject.addProperty("percent", percent); - sendCommand(COMMAND_SUN_ROOF, gson.toJson(payloadObject), commandTarget); - requestData(VEHICLE_STATE); - } - - public void setTemperature(float temperature) { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("driver_temp", temperature); - payloadObject.addProperty("passenger_temp", temperature); - sendCommand(COMMAND_SET_TEMP, gson.toJson(payloadObject), commandTarget); - requestData(CLIMATE_STATE); - } - - public void openFrunk() { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("which_trunk", "front"); - sendCommand(COMMAND_TRUNK_OPEN, gson.toJson(payloadObject), commandTarget); - requestData(VEHICLE_STATE); - } - - public void openTrunk() { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("which_trunk", "rear"); - sendCommand(COMMAND_TRUNK_OPEN, gson.toJson(payloadObject), commandTarget); - requestData(VEHICLE_STATE); - } - - public void closeTrunk() { - openTrunk(); - } - - public void setValetMode(boolean b, Integer pin) { - JsonObject payloadObject = new JsonObject(); - payloadObject.addProperty("on", b); - if (pin != null) { - payloadObject.addProperty("password", String.format("%04d", pin)); - } - sendCommand(COMMAND_SET_VALET_MODE, gson.toJson(payloadObject), commandTarget); - requestData(CLIMATE_STATE); - } - - public void resetValetPin() { - sendCommand(COMMAND_RESET_VALET_PIN, commandTarget); - requestData(CLIMATE_STATE); - } - - public void setMaxRangeCharging(boolean b) { - if (b) { - sendCommand(COMMAND_CHARGE_MAX, commandTarget); - } else { - sendCommand(COMMAND_CHARGE_STD, commandTarget); - } - requestData(CHARGE_STATE); - } + boolean allowQuery = allowQuery(); - public void charge(boolean b) { - if (b) { - sendCommand(COMMAND_CHARGE_START, commandTarget); - } else { - sendCommand(COMMAND_CHARGE_STOP, commandTarget); - } - requestData(CHARGE_STATE); - } - - public void flashLights() { - sendCommand(COMMAND_FLASH_LIGHTS, commandTarget); - } - - public void honkHorn() { - sendCommand(COMMAND_HONK_HORN, commandTarget); - } - - public void openChargePort() { - sendCommand(COMMAND_OPEN_CHARGE_PORT, commandTarget); - requestData(CHARGE_STATE); - } - - public void lockDoors(boolean b) { - if (b) { - sendCommand(COMMAND_DOOR_LOCK, commandTarget); + if (allowQuery) { + requestData(CHARGE_STATE); + requestData(CLIMATE_STATE); + requestData(GUI_STATE); + queryVehicle(MOBILE_ENABLED_STATE); } else { - sendCommand(COMMAND_DOOR_UNLOCK, commandTarget); - } - requestData(VEHICLE_STATE); - } - - public void autoConditioning(boolean b) { - if (b) { - sendCommand(COMMAND_AUTO_COND_START, commandTarget); - } else { - sendCommand(COMMAND_AUTO_COND_STOP, commandTarget); - } - requestData(CLIMATE_STATE); - } - - public void wakeUp() { - sendCommand(COMMAND_WAKE_UP, wakeUpTarget); - } - - protected Vehicle queryVehicle() { - // get a list of vehicles - Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE) - .header("Authorization", "Bearer " + logonToken.access_token).get(); - - logger.debug("Querying the vehicle : Response : {}:{}", response.getStatus(), response.getStatusInfo()); - - if (!checkResponse(response, true)) { - logger.error("An error occurred while querying the vehicle"); - return null; - } - - JsonParser parser = new JsonParser(); - - JsonObject jsonObject = parser.parse(response.readEntity(String.class)).getAsJsonObject(); - Vehicle[] vehicleArray = gson.fromJson(jsonObject.getAsJsonArray("response"), Vehicle[].class); - - for (int i = 0; i < vehicleArray.length; i++) { - logger.debug("Querying the vehicle : VIN : {}", vehicleArray[i].vin); - if (vehicleArray[i].vin.equals(getConfig().get(VIN))) { - vehicleJSON = gson.toJson(vehicleArray[i]); - parseAndUpdate("queryVehicle", null, vehicleJSON); - if (logger.isTraceEnabled()) { - logger.trace("Vehicle is id {}/vehicle_id {}/tokens {}", vehicleArray[i].id, - vehicleArray[i].vehicle_id, vehicleArray[i].tokens); - } - return vehicleArray[i]; - } - } - - return null; - } - - protected void queryVehicleAndUpdate() { - vehicle = queryVehicle(); - parseAndUpdate("queryVehicle", null, vehicleJSON); - } - - private String getStorageKey() { - return this.getThing().getUID().getId(); - } - - private ThingStatusDetail authenticate() { - Storage<Object> storage = storageService.getStorage(TeslaBindingConstants.BINDING_ID); - - String storedToken = (String) storage.get(getStorageKey()); - TokenResponse token = storedToken == null ? null : gson.fromJson(storedToken, TokenResponse.class); - SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); - - boolean hasExpired = true; - - if (token != null) { - Calendar calendar = Calendar.getInstance(); - calendar.setTimeInMillis(token.created_at * 1000); - logger.info("Found a request token created at {}", dateFormatter.format(calendar.getTime())); - calendar.setTimeInMillis(token.created_at * 1000 + 60 * token.expires_in); - - Date now = new Date(); - - if (calendar.getTime().before(now)) { - logger.info("The token has expired at {}", dateFormatter.format(calendar.getTime())); - hasExpired = true; + if (allowWakeUp) { + wakeUp(); } else { - hasExpired = false; - } - } - - String username = (String) getConfig().get(USERNAME); - - if (!StringUtils.isEmpty(username) && hasExpired) { - String password = (String) getConfig().get(PASSWORD); - return authenticate(username, password); - } - - if (token == null || StringUtils.isEmpty(token.refresh_token)) { - return ThingStatusDetail.CONFIGURATION_ERROR; - } - - TokenRequestRefreshToken tokenRequest = null; - try { - tokenRequest = new TokenRequestRefreshToken(token.refresh_token); - } catch (GeneralSecurityException e) { - logger.error("An exception occurred while requesting a new token : '{}'", e.getMessage(), e); - } - - String payLoad = gson.toJson(tokenRequest); - - Response response = tokenTarget.request().post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); - - if (response == null) { - logger.debug("Authenticating : Response was null"); - } else { - logger.debug("Authenticating : Response : {}:{}", response.getStatus(), response.getStatusInfo()); - - if (response.getStatus() == 200 && response.hasEntity()) { - String responsePayLoad = response.readEntity(String.class); - TokenResponse tokenResponse = gson.fromJson(responsePayLoad.trim(), TokenResponse.class); - - if (tokenResponse != null && !StringUtils.isEmpty(tokenResponse.access_token)) { - storage.put(getStorageKey(), gson.toJson(tokenResponse)); - this.logonToken = tokenResponse; - if (logger.isTraceEnabled()) { - logger.trace("Access Token is {}", logonToken.access_token); - } - return ThingStatusDetail.NONE; - } - - return ThingStatusDetail.NONE; - } else if (response.getStatus() == 401) { - if (!StringUtils.isEmpty(username)) { - String password = (String) getConfig().get(PASSWORD); - return authenticate(username, password); - } else { - return ThingStatusDetail.CONFIGURATION_ERROR; + if (isAwake()) { + logger.debug("Vehicle is neither charging nor moving, skipping updates to allow it to sleep"); } - } else if (response.getStatus() == 503 || response.getStatus() == 502) { - return ThingStatusDetail.COMMUNICATION_ERROR; } } - return ThingStatusDetail.CONFIGURATION_ERROR; - } - - private ThingStatusDetail authenticate(String username, String password) { - TokenRequest token = null; - try { - token = new TokenRequestPassword(username, password); - } catch (GeneralSecurityException e) { - logger.error("An exception occurred while building a password request token : '{}'", e.getMessage(), e); - } - - if (token != null) { - String payLoad = gson.toJson(token); - - Response response = tokenTarget.request().post(Entity.entity(payLoad, MediaType.APPLICATION_JSON_TYPE)); - - if (response != null) { - logger.debug("Authenticating : Response : {}:{}", response.getStatus(), response.getStatusInfo()); - - if (response.getStatus() == 200 && response.hasEntity()) { - String responsePayLoad = response.readEntity(String.class); - TokenResponse tokenResponse = gson.fromJson(responsePayLoad.trim(), TokenResponse.class); - - if (StringUtils.isNotEmpty(tokenResponse.access_token)) { - Storage<Object> storage = storageService.getStorage(TeslaBindingConstants.BINDING_ID); - storage.put(getStorageKey(), gson.toJson(tokenResponse)); - this.logonToken = tokenResponse; - return ThingStatusDetail.NONE; - } - } else if (response.getStatus() == 401) { - return ThingStatusDetail.CONFIGURATION_ERROR; - } else if (response.getStatus() == 503 || response.getStatus() == 502) { - return ThingStatusDetail.COMMUNICATION_ERROR; - } - } - } - return ThingStatusDetail.CONFIGURATION_ERROR; - } + }; protected Runnable fastStateRunnable = () -> { if (getThing().getStatus() == ThingStatus.ONLINE) { @@ -1087,52 +966,10 @@ private ThingStatusDetail authenticate(String username, String password) { requestData(DRIVE_STATE); requestData(VEHICLE_STATE); } else { - if (vehicle == null) { - vehicle = queryVehicle(); - } else if (allowWakeUp) { - wakeUp(); - } else { - queryVehicleAndUpdate(); - - if (isOnline()) { - logger.debug("Vehicle is neither charging nor moving, skipping updates to allow it to sleep"); - } - } - } - } - - if (allowWakeUp) { - updateState(CHANNEL_ALLOWWAKEUP, OnOffType.ON); - } else { - updateState(CHANNEL_ALLOWWAKEUP, OnOffType.OFF); - } - - if (eventThread != null) { - updateState(CHANNEL_ENABLEEVENTS, OnOffType.ON); - } else { - updateState(CHANNEL_ENABLEEVENTS, OnOffType.OFF); - } - }; - - protected Runnable slowStateRunnable = () -> { - if (getThing().getStatus() == ThingStatus.ONLINE) { - boolean allowQuery = allowQuery(); - - if (allowQuery) { - requestData(CHARGE_STATE); - requestData(CLIMATE_STATE); - requestData(GUI_STATE); - queryVehicle(MOBILE_ENABLED_STATE); - parseAndUpdate("queryVehicle", null, vehicleJSON); - } else { - if (vehicle == null) { - vehicle = queryVehicle(); - } else if (allowWakeUp) { + if (allowWakeUp) { wakeUp(); } else { - queryVehicleAndUpdate(); - - if (isOnline()) { + if (isAwake()) { logger.debug("Vehicle is neither charging nor moving, skipping updates to allow it to sleep"); } } @@ -1140,50 +977,6 @@ private ThingStatusDetail authenticate(String username, String password) { } }; - protected Runnable connectRunnable = () -> { - try { - lock.lock(); - - if (getThing().getStatus() != ThingStatus.ONLINE) { - logger.debug("Setting up an authenticated connection to the Tesla back-end"); - - ThingStatusDetail authenticationResult = authenticate(); - - if (authenticationResult != ThingStatusDetail.NONE) { - updateStatus(ThingStatus.OFFLINE, authenticationResult); - } else { - // get a list of vehicles - Response response = vehiclesTarget.request(MediaType.APPLICATION_JSON_TYPE) - .header("Authorization", "Bearer " + logonToken.access_token).get(); - - if (response != null && response.getStatus() == 200 && response.hasEntity()) { - if ((vehicle = queryVehicle()) != null) { - logger.debug("Found the vehicle with VIN '{}' in the list of vehicles you own", - getConfig().get(VIN)); - updateStatus(ThingStatus.ONLINE); - apiIntervalErrors = 0; - apiIntervalTimestamp = System.currentTimeMillis(); - } else { - logger.warn("Unable to find the vehicle with VIN '{}' in the list of vehicles you own", - getConfig().get(VIN)); - updateStatus(ThingStatus.OFFLINE); - } - } else { - if (response != null) { - logger.error("Error fetching the list of vehicles : {}:{}", response.getStatus(), - response.getStatusInfo()); - updateStatus(ThingStatus.OFFLINE); - } - } - } - } - } catch (Exception e) { - logger.error("An exception occurred while connecting to the Tesla back-end: '{}'", e.getMessage()); - } finally { - lock.unlock(); - } - }; - protected Runnable eventRunnable = new Runnable() { Response eventResponse; BufferedReader eventBufferedReader; @@ -1198,12 +991,12 @@ protected boolean establishEventStream() { eventClient = ClientBuilder.newClient() .property(ClientProperties.CONNECT_TIMEOUT, EVENT_STREAM_CONNECT_TIMEOUT) .property(ClientProperties.READ_TIMEOUT, EVENT_STREAM_READ_TIMEOUT) - .register(new Authenticator((String) getConfig().get(USERNAME), vehicle.tokens[0])); + .register(new Authenticator((String) getConfig().get(CONFIG_USERNAME), vehicle.tokens[0])); eventTarget = eventClient.target(URI_EVENT).path(vehicle.vehicle_id + "/").queryParam("values", StringUtils.join(EventKeys.values(), ',', 1, EventKeys.values().length)); eventResponse = eventTarget.request(MediaType.TEXT_PLAIN_TYPE).get(); - logger.debug("Event Stream : Establishing the event stream : Response : {}:{}", + logger.debug("Event Stream: Establishing the event stream: Response: {}:{}", eventResponse.getStatus(), eventResponse.getStatusInfo()); if (eventResponse.getStatus() == 200) { @@ -1238,7 +1031,7 @@ protected boolean establishEventStream() { } } catch (Exception e) { logger.error( - "Event Stream : An exception occurred while establishing the event stream for the vehicle: '{}'", + "Event stream: An exception occurred while establishing the event stream for the vehicle: '{}'", e.getMessage()); isEstablished = false; } @@ -1256,7 +1049,7 @@ public void run() { String line = eventBufferedReader.readLine(); while (line != null) { - logger.debug("Event Stream : Received an event: '{}'", line); + logger.debug("Event stream: Received an event: '{}'", line); String vals[] = line.split(","); long currentTimeStamp = Long.valueOf(vals[0]); long systemTimeStamp = System.currentTimeMillis(); @@ -1274,7 +1067,7 @@ public void run() { if (logger.isDebugEnabled()) { SimpleDateFormat dateFormatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS"); - logger.debug("Event Stream : Event stamp is {}", + logger.debug("Event Stream: Event stamp is {}", dateFormatter.format(new Date(lastTimeStamp))); } for (int i = 0; i < EventKeys.values().length; i++) { @@ -1300,7 +1093,7 @@ public void run() { SimpleDateFormat dateFormatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS"); logger.debug( - "Event Stream : Discarding an event with an out of sync timestamp {} (last is {})", + "Event stream: Discarding an event with an out of sync timestamp {} (last is {})", dateFormatter.format(new Date(currentTimeStamp)), dateFormatter.format(new Date(lastTimeStamp))); } @@ -1310,112 +1103,48 @@ public void run() { SimpleDateFormat dateFormatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS"); logger.debug( - "Event Stream : Discarding an event that differs {} ms from the system time: {} (system is {})", + "Event Stream: Discarding an event that differs {} ms from the system time: {} (system is {})", systemTimeStamp - currentTimeStamp, dateFormatter.format(currentTimeStamp), dateFormatter.format(systemTimeStamp)); } if (systemTimeStamp - currentTimeStamp > EVENT_TIMESTAMP_MAX_DELTA) { - if (logger.isTraceEnabled()) { - logger.trace("Event Stream : The event stream will be reset"); - } + logger.trace("Event stream: The event stream will be reset"); isEstablished = false; } } - line = eventBufferedReader.readLine(); } - - if (line == null) { - if (logger.isTraceEnabled()) { - logger.trace("Event Stream : The end of stream was reached"); - } - isEstablished = false; - } + logger.trace("Event stream: The end of stream was reached"); + isEstablished = false; } } else { - logger.debug("Event stream : The vehicle is not awake"); - if (vehicle != null && allowWakeUp) { - // wake up the vehicle until streaming token <> 0 - logger.debug("Event stream : Waking up the vehicle"); - wakeUp(); + logger.debug("Event stream: The vehicle is not awake"); + if (vehicle != null) { + if (allowWakeUp) { + // wake up the vehicle until streaming token <> 0 + logger.debug("Event stream: Waking up the vehicle"); + wakeUp(); + } } else { - logger.debug("Event stream : Querying the vehicle"); vehicle = queryVehicle(); } + Thread.sleep(EVENT_STREAM_PAUSE); } - } else { - Thread.sleep(250); } } catch (IOException | NumberFormatException e) { - if (logger.isErrorEnabled()) { - logger.error("Event Stream : An exception occurred while reading events : '{}'", - e.getMessage()); - } + logger.debug("Event stream: An exception occurred while reading events: '{}'", e.getMessage()); isEstablished = false; } catch (InterruptedException e) { isEstablished = false; } if (Thread.interrupted()) { - logger.debug("Event Stream : the Event Stream was interrupted"); + logger.debug("Event stream: the event stream was interrupted"); return; } } } }; - protected class Request implements Runnable { - - private String request; - private String payLoad; - private WebTarget target; - - public Request(String request, String payLoad, WebTarget target) { - this.request = request; - this.payLoad = payLoad; - this.target = target; - } - - @Override - public void run() { - try { - String result = ""; - - if (getThing().getStatus() == ThingStatus.ONLINE) { - if (request.equals(COMMAND_WAKE_UP) || isAwake()) { - result = invokeAndParse(request, payLoad, target); - } - } - - if (result != null && !"".equals(result)) { - parseAndUpdate(request, payLoad, result); - } - } catch (Exception e) { - logger.error("An exception occurred while executing a request to the vehicle: '{}'", e.getMessage()); - } - } - } - - protected class Authenticator implements ClientRequestFilter { - private final String user; - private final String password; - - public Authenticator(String user, String password) { - this.user = user; - this.password = password; - } - - @Override - public void filter(ClientRequestContext requestContext) throws IOException { - MultivaluedMap<String, Object> headers = requestContext.getHeaders(); - final String basicAuthentication = getBasicAuthentication(); - headers.add("Authorization", basicAuthentication); - } - - private String getBasicAuthentication() { - String token = this.user + ":" + this.password; - return "Basic " + Base64.getEncoder().encodeToString(token.getBytes(StandardCharsets.UTF_8)); - } - } } diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/VehicleListener.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/VehicleListener.java new file mode 100644 index 0000000000000..fbdfc189f2a77 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/handler/VehicleListener.java @@ -0,0 +1,32 @@ +/** + * 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.tesla.internal.handler; + +import org.openhab.binding.tesla.internal.protocol.Vehicle; +import org.openhab.binding.tesla.internal.protocol.VehicleConfig; + +/** + * The {@link VehicleListener} interface can be implemented by classes that want to be informed about + * existing vehicles of a given account. They need to register on an {@link TeslaAccountHandler}. + * + * @author Kai Kreuzer - Initial contribution + */ +public interface VehicleListener { + + /** + * This method is called by the {@link TeslaAccountHandler}, if a vehicle is identified. + * + * @param vehicle a vehicle that was found within an account. + */ + void vehicleFound(Vehicle vehicle, VehicleConfig vehicleConfig); +} diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ChargeState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ChargeState.java index 133ab911010b2..217166f9c4388 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ChargeState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ChargeState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ClimateState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ClimateState.java index 2baec321bbdb8..d9f3c98173bee 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ClimateState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/ClimateState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java index 55b383c74b63a..205c95539b1d2 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/DriveState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/GUIState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/GUIState.java index 4d803960f111a..b287eb3a86153 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/GUIState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/GUIState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequest.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequest.java index e6b2f64f610e7..5ef00a9774ff1 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequest.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,6 +33,7 @@ * @author Karel Goderis - Initial contribution * @author Nicolai Grødum - Adding token based auth */ +@SuppressWarnings("unused") public abstract class TokenRequest { private String client_id; private String client_secret; diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestPassword.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestPassword.java index c9f81ae53fa9e..6931c65868c96 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestPassword.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestPassword.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ * @author Karel Goderis - Initial contribution * @author Nicolai Grødum - Adding token based auth */ +@SuppressWarnings("unused") public class TokenRequestPassword extends TokenRequest { private String grant_type = "password"; diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestRefreshToken.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestRefreshToken.java index 7a08d1f041c8b..b8fc693c5f4aa 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestRefreshToken.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenRequestRefreshToken.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenResponse.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenResponse.java index 350f30bcfe98f..232b99855c2b8 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenResponse.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/TokenResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/Vehicle.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/Vehicle.java index 139e649599057..fb94398128d8f 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/Vehicle.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/Vehicle.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleConfig.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleConfig.java new file mode 100644 index 0000000000000..21e2709a5b8fb --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleConfig.java @@ -0,0 +1,48 @@ +/** + * 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.tesla.internal.protocol; + +/** + * The {@link VehicleConfig} is a data structure to capture + * vehicle configuration variables sent by the Tesla Vehicle + * + * @author Dan Cunningham - Initial contribution + */ +public class VehicleConfig { + public boolean can_accept_navigation_requests; + public boolean can_actuate_trunks; + public boolean eu_vehicle; + public boolean has_air_suspension; + public boolean has_ludicrous_mode; + public boolean motorized_charge_port; + public boolean plg; + public boolean rhd; + public boolean use_range_badging; + public int rear_seat_heaters; + public int rear_seat_type; + public int sun_roof_installed; + public long timestamp; + public String car_special_type; + public String car_type; + public String charge_port_type; + public String exterior_color; + public String roof_color; + public String spoiler_type; + public String third_row_seats; + public String trim_badging; + public String wheel_type; + + VehicleConfig() { + + } +} diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleState.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleState.java index 4b1170b7864b4..8c06b6064777a 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleState.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/protocol/VehicleState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractChannelThrottler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractChannelThrottler.java index f48f239fdc939..8b9f3f312df65 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractChannelThrottler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractChannelThrottler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractMultiRateChannelThrottler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractMultiRateChannelThrottler.java index 8da0ae4941b7e..9d489cefa4488 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractMultiRateChannelThrottler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/AbstractMultiRateChannelThrottler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ChannelThrottler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ChannelThrottler.java index 6c19dcde51978..b8e0c2dd74060 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ChannelThrottler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ChannelThrottler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/QueueChannelThrottler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/QueueChannelThrottler.java index 29d4b0b7997c8..f8f24721b75c0 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/QueueChannelThrottler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/QueueChannelThrottler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/Rate.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/Rate.java index 3b88a05e07ff8..bfbcb6b50d717 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/Rate.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/Rate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ScheduledChannelThrottler.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ScheduledChannelThrottler.java index 36aa52ed75888..f8479ca1cc74a 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ScheduledChannelThrottler.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/ScheduledChannelThrottler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/TimeProvider.java b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/TimeProvider.java index 74b894ad52dd7..14e45574c97e0 100644 --- a/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/TimeProvider.java +++ b/bundles/org.openhab.binding.tesla/src/main/java/org/openhab/binding/tesla/internal/throttler/TimeProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/account.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/account.xml new file mode 100644 index 0000000000000..42a39b6396664 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/account.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tesla" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <bridge-type id="account"> + <label>Tesla Account</label> + <description>Tesla Owner Account</description> + + <config-description> + <parameter name="refreshToken" type="text" required="false"> + <label>Refresh Token</label> + <description>Refresh token for account authentication. Use "smarthome:tesla" to retrieve it.</description> + </parameter> + <parameter name="username" type="text" required="false"> + <advanced>true</advanced> + <label>Username</label> + <description>Username for the Tesla Remote Service, e.g email address.</description> + </parameter> + <parameter name="password" type="text" required="false"> + <advanced>true</advanced> + <context>password</context> + <label>Password</label> + <description>Password for the Tesla Remote Service</description> + </parameter> + </config-description> + </bridge-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/channels.xml new file mode 100644 index 0000000000000..26395a998a9c9 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/channels.xml @@ -0,0 +1,648 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tesla" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <channel-type id="autoconditioning"> + <item-type>Switch</item-type> + <label>Auto Conditioning</label> + <description>Turns on auto-conditioning (a/c or heating)</description> + </channel-type> + <channel-type id="autoparkstate" advanced="true"> + <item-type>String</item-type> + <label>Autopark State</label> + <description>Undocumented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="autoparkstyle" advanced="true"> + <item-type>String</item-type> + <label>Autopark Style</label> + <description>Undocumented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="batterycurrent" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Battery Current</label> + <description>Current (Ampere) floating into (+) or out (-) of the battery</description> + <state pattern="%.1f A" readOnly="true"></state> + </channel-type> + <channel-type id="batteryheater" advanced="true"> + <item-type>Switch</item-type> + <label>Battery Heater</label> + <description>Indicates if the battery heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="batteryheaternopower" advanced="true"> + <item-type>Switch</item-type> + <label>Battery Heater Power</label> + <description>Indicates if there is enough power to use the battery heater</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="batterylevel"> + <item-type>Number</item-type> + <label>Battery Level</label> + <description>State of the battery in %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="batteryrange" advanced="true"> + <item-type>Number:Length</item-type> + <label>Battery Range</label> + <description>Range of the battery</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="calendarenabled" advanced="true"> + <item-type>Switch</item-type> + <label>Calendar Enabled</label> + <description>Indicates if access to a remote calendar is enabled</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="centerdisplay" advanced="true"> + <item-type>Switch</item-type> + <label>Central Display State</label> + <description>Indicates the state of the central display in the vehicle</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="centerrearseatheater" advanced="true"> + <item-type>Switch</item-type> + <label>Center Rear Seat Heater</label> + <description>Indicates if the center rear seat heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="charge" advanced="true"> + <item-type>Switch</item-type> + <label>Charge</label> + <description>Start (ON) or stop (OFF) charging</description> + </channel-type> + <channel-type id="chargecable" advanced="true"> + <item-type>String</item-type> + <label>Charge Cable</label> + <description>Undocumented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="chargecurrent" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Charge Current</label> + <description>Current (Ampere) requested from the charger</description> + <state pattern="%.1f A" readOnly="true"></state> + </channel-type> + <channel-type id="chargeenablerequest" advanced="true"> + <item-type>Switch</item-type> + <label>Charge Enable Request</label> + <description>Undocumented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="chargeenergyadded" advanced="true"> + <item-type>Number:Energy</item-type> + <label>Charge Energy Added</label> + <description>Energy added, in kWh, during the last charging session</description> + <state pattern="%d kWh" readOnly="true"></state> + </channel-type> + <channel-type id="chargelimit" advanced="true"> + <item-type>Dimmer</item-type> + <label>Charge Limit</label> + <description>Limit charging of the vehicle to the given %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="chargelimitmaximum" advanced="true"> + <item-type>Dimmer</item-type> + <label>Charge Limit Maximum</label> + <description>Maximum charging limit of the vehicle, as %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="chargelimitminimum" advanced="true"> + <item-type>Dimmer</item-type> + <label>Charge Limit Minimum</label> + <description>Minimum charging limit of the vehicle, as %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="chargelimitsocstandard" advanced="true"> + <item-type>Dimmer</item-type> + <label>Charge Limit SOC Standard</label> + <description>Standard charging limity of the vehicle, in %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="chargeidealdistanceadded" advanced="true"> + <item-type>Number:Length</item-type> + <label>"Ideal" Charge Distance Added</label> + <description>"Ideal" range added during the last charging session</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="chargemaxcurrent" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Charge Max Current</label> + <description>Maximum current (Ampere) that can be requested from the charger</description> + <state pattern="%.1f A" readOnly="true"></state> + </channel-type> + <channel-type id="chargerateddistanceadded" advanced="true"> + <item-type>Number:Length</item-type> + <label>"Rated" Charge Distance Added</label> + <description>"Rated" range added during the last charging session</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="chargerate" advanced="true"> + <item-type>Number:Speed</item-type> + <label>Charge Rate</label> + <description>Distance per hour charging rate</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="chargestartingrange" advanced="true"> + <item-type>String</item-type> + <label>Charge Starting Range</label> + <description>Undocumented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="chargestartingsoc" advanced="true"> + <item-type>String</item-type> + <label>Charge Starting SOC</label> + <description>Undocumented / To be defined</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="chargingstate"> + <item-type>String</item-type> + <label>Charging State</label> + <description>“Startingâ€, “Completeâ€, “Chargingâ€, “Disconnectedâ€, “Stoppedâ€, “NoPowerâ€</description> + <state readOnly="true"> + <options> + <option value="Starting">Starting</option> + <option value="Complete">Complete</option> + <option value="Charging">Charging</option> + <option value="Disconnected">Disconnected</option> + <option value="Stopped">Stopped</option> + <option value="NoPower">No Power</option> + </options> + </state> + </channel-type> + <channel-type id="chargetomax" advanced="true"> + <item-type>Switch</item-type> + <label>Charge To Max Range</label> + <description>Indicates if the charging to the maximum range is enabled</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="chargeport"> + <item-type>Switch</item-type> + <label>Charge Port</label> + <description>Open the Charge Port (ON) or indicates the state of the Charge Port (ON/OFF if Open/Closed)</description> + </channel-type> + <channel-type id="chargercurrent" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Charge Current</label> + <description>Current (Ampere) actually being drawn from the charger</description> + <state pattern="%.1f A" readOnly="true"></state> + </channel-type> + <channel-type id="chargerphases" advanced="true"> + <item-type>Number</item-type> + <label>Charger Phases</label> + <description>Indicates the number of phases (1 to 3) used for charging</description> + <state pattern="%d" readOnly="true"></state> + </channel-type> + <channel-type id="chargermaxcurrent" advanced="true"> + <item-type>Number:ElectricCurrent</item-type> + <label>Charger Maximum Current</label> + <description>Maximum current (Ampere) that can be delivered by the charger</description> + <state pattern="%.1f A" readOnly="true"></state> + </channel-type> + <channel-type id="chargerpower" advanced="true"> + <item-type>Number</item-type> + <label>Charger Power</label> + <description>Power actually delivered by the charger</description> + <state pattern="%.1f kW" readOnly="true"></state> + </channel-type> + <channel-type id="chargervoltage" advanced="true"> + <item-type>Number:ElectricPotential</item-type> + <label>Charger Voltage</label> + <description>Voltage (V) actually presented by the charger</description> + <state pattern="%.1f V" readOnly="true"></state> + </channel-type> + <channel-type id="climate"> + <item-type>Switch</item-type> + <label>Climate</label> + <description>Climate status indicator</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="driverfrontdoor" advanced="true"> + <item-type>Contact</item-type> + <label>Driver Front Door</label> + <description>Indicates if the front door at the driver's side is opened</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="doorlock"> + <item-type>Switch</item-type> + <label>Door Lock</label> + <description>Lock or unlock the car</description> + </channel-type> + <channel-type id="driverreardoor" advanced="true"> + <item-type>Contact</item-type> + <label>Driver Rear Door</label> + <description>Indicates if the rear door at the driver's side is opened</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="drivertemp" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>Driver Temperature</label> + <description>Indicates the auto conditioning temperature set at the driver's side</description> + <state pattern="%.1f %unit%"></state> + </channel-type> + <channel-type id="eventstamp" advanced="true"> + <item-type>DateTime</item-type> + <label>Event Timestamp</label> + <description>Timestamp of the last event received from the Tesla streaming service</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="estimatedbatteryrange" advanced="true"> + <item-type>Number:Length</item-type> + <label>Estimated Battery Range</label> + <description>Estimated battery range</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="estimatedrange" advanced="true"> + <item-type>Number</item-type> + <label>Estimated Range</label> + <description>Estimated range of the vehicle</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="fan" advanced="true"> + <item-type>Number</item-type> + <label>Fan</label> + <description>Indicates the speed (0-7) of the fan</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="flashlights" advanced="true"> + <item-type>Switch</item-type> + <label>Flash Lights</label> + <description>Flash the lights of the car (when ON is received)</description> + </channel-type> + <channel-type id="frontdefroster" advanced="true"> + <item-type>Switch</item-type> + <label>Front Defroster</label> + <description>Indicates if the front defroster is enabled</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="fronttrunk" advanced="true"> + <item-type>Switch</item-type> + <label>Front Trunk</label> + <description>Indicates if the front trunk is opened, or open the front trunk when ON is received</description> + </channel-type> + <channel-type id="gpstimestamp" advanced="true"> + <item-type>DateTime</item-type> + <label>GPS Time Stamp</label> + <description>Time stamp of the most recent GPS location of the vehicle</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="heading" advanced="true"> + <item-type>Number:Angle</item-type> + <label>Heading</label> + <description>Indicates the (compass) heading of the car, in 0-360 degrees</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="headingestimation" advanced="true"> + <item-type>Number:Angle</item-type> + <label>Estimated Heading</label> + <description>Estimated (compass) heading of the car, in 0 to 360 degrees</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="honkhorn" advanced="true"> + <item-type>Switch</item-type> + <label>Honk the Horn</label> + <description>Honk the horn of the vehicle, when ON is received</description> + </channel-type> + <channel-type id="homelink" advanced="true"> + <item-type>Switch</item-type> + <label>Homelink Nearby</label> + <description>Indicates if the Home Link is nearby</description> + </channel-type> + <channel-type id="idealbatteryrange" advanced="true"> + <item-type>Number:Length</item-type> + <label>Ideal Battery Range</label> + <description>Indicates the Batter Range</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="insidetemp"> + <item-type>Number:Temperature</item-type> + <label>Inside Temperature</label> + <description>Indicates the inside temperature of the vehicle</description> + <state pattern="%.1f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="lefttempdirection" advanced="true"> + <item-type>Number</item-type> + <label>Left Temperature Direction</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="lastautoparkerror" advanced="true"> + <item-type>String</item-type> + <label>Last Autopark Error</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="location" advanced="false"> + <item-type>Location</item-type> + <label>Location</label> + <description>The actual position of the vehicle</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="leftseatheater" advanced="true"> + <item-type>Switch</item-type> + <label>Left Seat Heater</label> + <description>Indicates if the left seat heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="leftrearseatheater" advanced="true"> + <item-type>Switch</item-type> + <label>Left Rear Seat Heater</label> + <description>Indicates if the left rear seat heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="leftrearbackseatheater" advanced="true"> + <item-type>Number</item-type> + <label>Left Rear Backseat Heater</label> + <description>Indicates the level (0,1,2 or 3) of the left rear backseat heater</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="managedcharging" advanced="true"> + <item-type>Switch</item-type> + <label>Managed Charging</label> + <description>Indicates managed charging is active</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="managedchargingcancelled" advanced="true"> + <item-type>Switch</item-type> + <label>Managed Charging Cancelled</label> + <description>Indicates managed charging is cancelled by the user</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="managedchargingstart" advanced="true"> + <item-type>String</item-type> + <label>Managed Charging Start Time</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="maxcharges" advanced="true"> + <item-type>Number</item-type> + <label>Max Charges</label> + <description>Indicates the number of consecutive "Max Range Charges" performed by the vehicle</description> + <state pattern="%d" readOnly="true"></state> + </channel-type> + <channel-type id="minavailabletemp" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>Minimum Temperature</label> + <description>Indicates the minimal inside temperature of the vehicle</description> + <state pattern="%.1f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="maxavailabletemp" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>Maximum Temperature</label> + <description>Indicates the maximum inside temperature of the vehicle</description> + <state pattern="%.1f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="mobileenabled" advanced="true"> + <item-type>Switch</item-type> + <label>Mobile Enabled</label> + <description>Indicates whether the vehicle can be remotely controlled</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="notenoughpower" advanced="true"> + <item-type>Switch</item-type> + <label>Not Enought Power </label> + <description>Indicates if not enough power (ON) is available to heat the vehicle</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="notificationsenabled" advanced="true"> + <item-type>Switch</item-type> + <label>Notifications Enabled</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="notificationssupported" advanced="true"> + <item-type>Switch</item-type> + <label>Notifications Supported</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="odometer"> + <item-type>Number:Length</item-type> + <label>Odometer</label> + <description>Odometer of the vehicle</description> + <state pattern="%.1f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="outsidetemp" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>Outside Temperature</label> + <description>Indicates the outside temperature of the vehicle</description> + <state pattern="%.1f %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="parsedcalendar" advanced="true"> + <item-type>Switch</item-type> + <label>Parsed Calendar Supported</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="passengertemp" advanced="true"> + <item-type>Number</item-type> + <label>Passenger Temperature</label> + <description>Indicates the auto conditioning temperature set at the passenger's side</description> + <state pattern="%.1f %unit%"></state> + </channel-type> + <channel-type id="passengerfrontdoor" advanced="true"> + <item-type>Contact</item-type> + <label>Passenger Front Door</label> + <description>Indicates if the front door at the passenger's side is opened</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="passengerreardoor" advanced="true"> + <item-type>Contact</item-type> + <label>Passenger Rear Door</label> + <description>Indicates if the rear door at the passenger's side is opened</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="power" advanced="true"> + <item-type>Number</item-type> + <label>Power</label> + <description>Net kW flowing in (+) or out (-) of the battery</description> + <state pattern="%.1f kW" readOnly="true"></state> + </channel-type> + <channel-type id="preconditioning" advanced="true"> + <item-type>Switch</item-type> + <label>Preconditioning</label> + <description>Indicates if preconditioning is activated</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="range" advanced="true"> + <item-type>Number</item-type> + <label>Range</label> + <description>Vehicle range - Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="reardefroster" advanced="true"> + <item-type>Switch</item-type> + <label>Rear Defroster</label> + <description>Indicates if the rear defroster is enabled</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="remotestartenabled" advanced="true"> + <item-type>Switch</item-type> + <label>Remote Start</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="reartrunk" advanced="true"> + <item-type>Switch</item-type> + <label>Rear Trunk</label> + <description>Indicates if the rear trunk is opened, or open/close the rear trunk when ON/OFF is received</description> + </channel-type> + <channel-type id="remotestart" advanced="true"> + <item-type>Switch</item-type> + <label>Remote Start</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="remotestartsupported" advanced="true"> + <item-type>Switch</item-type> + <label>Remote Start Supported</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="rightseatheater" advanced="true"> + <item-type>Switch</item-type> + <label>Right Seat Heater</label> + <description>Indicates if the right seat heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="rightrearseatheater" advanced="true"> + <item-type>Switch</item-type> + <label>Right Rear Seat Heater</label> + <description>Indicates if the right rear seat heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="rightrearbackseatheater" advanced="true"> + <item-type>Number</item-type> + <label>Right Rear Backseat Heater</label> + <description>Indicates the level (0,1,2 or 3) of the right rear backseat heater</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="righttempdirection" advanced="true"> + <item-type>Number</item-type> + <label>Right Temperature Direction</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="scheduledchargingpending" advanced="true"> + <item-type>Switch</item-type> + <label>Scheduled Charging Pending</label> + <description>Indicates if a scheduled charging session is still pending</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="scheduledchargingstart" advanced="true"> + <item-type>DateTime</item-type> + <label>Scheduled Charging Start</label> + <description>Indicates when the scheduled charging session will start, in yyyy-MM-dd'T'HH:mm:ss format</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="shiftstate" advanced="true"> + <item-type>String</item-type> + <label>Shift State</label> + <description>Indicates the state of the transmission, “Pâ€, “Dâ€, “Râ€, or “Nâ€</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="sidemirrorheaters" advanced="true"> + <item-type>Switch</item-type> + <label>Side Mirror Heaters</label> + <description>Indicates if the side mirror heaters are switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="smartpreconditioning" advanced="true"> + <item-type>Switch</item-type> + <label>Smart Preconditioning</label> + <description>Indicates if smart preconditioning is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="soc" advanced="true"> + <item-type>Number</item-type> + <label>State of Charge</label> + <description>State of Charge, in %</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="speed"> + <item-type>Number:Speed</item-type> + <label>Speed</label> + <description>Vehicle speed</description> + <state pattern="%d %unit%" readOnly="true"></state> + </channel-type> + <channel-type id="state" advanced="true"> + <item-type>String</item-type> + <label>State</label> + <description>“onlineâ€, “asleepâ€, “wakingâ€</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="steeringwheelheater" advanced="true"> + <item-type>Switch</item-type> + <label>Steering Wheel Heater</label> + <description>Indicates if the steering wheel heater is switched on</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="sunroofstate" advanced="true"> + <item-type>String</item-type> + <label>Sunroof State</label> + <description>“unknownâ€, “openâ€, “closedâ€, “ventâ€, “comfortâ€</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="sunroof"> + <item-type>Dimmer</item-type> + <label>Sunroof</label> + <description>Open or close the sunroof to provided % (0 closed, 100 fully open)</description> + <state pattern="%d %%"></state> + </channel-type> + <channel-type id="combinedtemp" advanced="true"> + <item-type>Number:Temperature</item-type> + <label>Combined Temperature</label> + <description>Combined average temperature of the driver and passenger autoconditioning settings. The temperature for the + driver and passenger will be synced when set.</description> + <state pattern="%.1f %unit%"></state> + </channel-type> + <channel-type id="timetofullcharge" advanced="true"> + <item-type>Number</item-type> + <label>Time To Full Charge</label> + <description>Number of hours to fully charge the battery</description> + <state pattern="%.1f h" readOnly="true"></state> + </channel-type> + <channel-type id="tripcharging" advanced="true"> + <item-type>Switch</item-type> + <label>Trip Charging</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="usablebatterylevel" advanced="true"> + <item-type>Number</item-type> + <label>Usable Battery Level</label> + <description>Indicates the % of battery that can be used for vehicle functions like driving</description> + <state pattern="%.1f %%" readOnly="true"></state> + </channel-type> + <channel-type id="userchargeenablerequest" advanced="true"> + <item-type>String</item-type> + <label>User Charge Enable Request</label> + <description>Not documented / To be defined</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="valetmode" advanced="true"> + <item-type>Switch</item-type> + <label>Valet Mode</label> + <description>Enable or disable Valet Mode</description> + </channel-type> + <channel-type id="valetpin" advanced="true"> + <item-type>Switch</item-type> + <label>Valet PIN Required</label> + <description>Indicates if a PIN code is required to disable valet mode</description> + <state readOnly="true"></state> + </channel-type> + <channel-type id="wakeup" advanced="true"> + <item-type>Switch</item-type> + <label>Wake Up</label> + <description>Wake up the vehicle from a (deep) sleep</description> + </channel-type> + <channel-type id="wiperbladeheater" advanced="true"> + <item-type>Switch</item-type> + <label>Wiperblade Heater</label> + <description>Indicates if the wiperblade heater is switched on</description> + <state readOnly="true"></state> + </channel-type> +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/model3.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/model3.xml new file mode 100644 index 0000000000000..caa4f64812231 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/model3.xml @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tesla" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="model3"> + + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Tesla Model 3</label> + <description>A Tesla Model 3 Vehicle</description> + + <channels> + <channel id="autoconditioning" typeId="autoconditioning" /> + <channel id="autoparkstate" typeId="autoparkstate" /> + <channel id="autoparkstate2" typeId="autoparkstate" /> + <channel id="autoparkstyle" typeId="autoparkstyle" /> + <channel id="batterycurrent" typeId="batterycurrent" /> + <channel id="batterylevel" typeId="batterylevel" /> + <channel id="batteryrange" typeId="batteryrange" /> + <channel id="calendarenabled" typeId="calendarenabled" /> + <channel id="centerdisplay" typeId="centerdisplay" /> + <channel id="centerrearseatheater" typeId="centerrearseatheater" /> + <channel id="charge" typeId="charge" /> + <channel id="chargecable" typeId="chargecable" /> + <channel id="chargecurrent" typeId="chargecurrent" /> + <channel id="chargeenablerequest" typeId="chargeenablerequest" /> + <channel id="chargeenergyadded" typeId="chargeenergyadded" /> + <channel id="chargeidealdistanceadded" typeId="chargeidealdistanceadded" /> + <channel id="chargelimit" typeId="chargelimit" /> + <channel id="chargelimitmaximum" typeId="chargelimitmaximum" /> + <channel id="chargelimitminimum" typeId="chargelimitminimum" /> + <channel id="chargelimitsocstandard" typeId="chargelimitsocstandard" /> + <channel id="chargemaxcurrent" typeId="chargemaxcurrent" /> + <channel id="chargeport" typeId="chargeport" /> + <channel id="chargerate" typeId="chargerate" /> + <channel id="chargerateddistanceadded" typeId="chargerateddistanceadded" /> + <channel id="chargercurrent" typeId="chargercurrent" /> + <channel id="chargermaxcurrent" typeId="chargermaxcurrent" /> + <channel id="chargerphases" typeId="chargerphases" /> + <channel id="chargerpower" typeId="chargerpower" /> + <channel id="chargervoltage" typeId="chargervoltage" /> + <channel id="chargestartingrange" typeId="chargestartingrange" /> + <channel id="chargestartingsoc" typeId="chargestartingsoc" /> + <channel id="chargetomax" typeId="chargetomax" /> + <channel id="chargingstate" typeId="chargingstate" /> + <channel id="climate" typeId="climate" /> + <channel id="doorlock" typeId="doorlock" /> + <channel id="driverfrontdoor" typeId="driverfrontdoor" /> + <channel id="driverreardoor" typeId="driverreardoor" /> + <channel id="drivertemp" typeId="drivertemp" /> + <channel id="estimatedbatteryrange" typeId="estimatedbatteryrange" /> + <channel id="estimatedrange" typeId="estimatedrange" /> + <channel id="eventstamp" typeId="eventstamp" /> + <channel id="fan" typeId="fan" /> + <channel id="flashlights" typeId="flashlights" /> + <channel id="frontdefroster" typeId="frontdefroster" /> + <channel id="fronttrunk" typeId="fronttrunk" /> + <channel id="gpstimestamp" typeId="gpstimestamp" /> + <channel id="heading" typeId="heading" /> + <channel id="headingestimation" typeId="headingestimation" /> + <channel id="homelink" typeId="homelink" /> + <channel id="honkhorn" typeId="honkhorn" /> + <channel id="idealbatteryrange" typeId="idealbatteryrange" /> + <channel id="insidetemp" typeId="insidetemp" /> + <channel id="leftrearbackseatheater" typeId="leftrearbackseatheater" /> + <channel id="leftrearseatheater" typeId="leftrearseatheater" /> + <channel id="leftseatheater" typeId="leftseatheater" /> + <channel id="lefttempdirection" typeId="lefttempdirection" /> + <channel id="location" typeId="location" /> + <channel id="managedcharging" typeId="managedcharging" /> + <channel id="managedchargingcancelled" typeId="managedchargingcancelled" /> + <channel id="managedchargingstart" typeId="managedchargingstart" /> + <channel id="maxavailabletemp" typeId="maxavailabletemp" /> + <channel id="maxcharges" typeId="maxcharges" /> + <channel id="mobileenabled" typeId="mobileenabled" /> + <channel id="minavailabletemp" typeId="minavailabletemp" /> + <channel id="notenoughpower" typeId="notenoughpower" /> + <channel id="notificationsenabled" typeId="notificationsenabled" /> + <channel id="notificationssupported" typeId="notificationssupported" /> + <channel id="odometer" typeId="odometer" /> + <channel id="outsidetemp" typeId="outsidetemp" /> + <channel id="parsedcalendar" typeId="parsedcalendar" /> + <channel id="passengerfrontdoor" typeId="passengerfrontdoor" /> + <channel id="passengerreardoor" typeId="passengerreardoor" /> + <channel id="passengertemp" typeId="passengertemp" /> + <channel id="power" typeId="power" /> + <channel id="preconditioning" typeId="preconditioning" /> + <channel id="range" typeId="range" /> + <channel id="reardefroster" typeId="reardefroster" /> + <channel id="reartrunk" typeId="reartrunk" /> + <channel id="remotestart" typeId="remotestart" /> + <channel id="remotestartenabled" typeId="remotestartenabled" /> + <channel id="remotestartsupported" typeId="remotestartsupported" /> + <channel id="rightrearbackseatheater" typeId="rightrearbackseatheater" /> + <channel id="rightrearseatheater" typeId="rightrearseatheater" /> + <channel id="rightseatheater" typeId="rightseatheater" /> + <channel id="scheduledchargingpending" typeId="scheduledchargingpending" /> + <channel id="scheduledchargingstart" typeId="scheduledchargingstart" /> + <channel id="shiftstate" typeId="shiftstate" /> + <channel id="sidemirrorheaters" typeId="sidemirrorheaters" /> + <channel id="smartpreconditioning" typeId="smartpreconditioning" /> + <channel id="soc" typeId="soc" /> + <channel id="speed" typeId="speed" /> + <channel id="state" typeId="state" /> + <channel id="combinedtemp" typeId="combinedtemp" /> + <channel id="timetofullcharge" typeId="timetofullcharge" /> + <channel id="tripcharging" typeId="tripcharging" /> + <channel id="usablebatterylevel" typeId="usablebatterylevel" /> + <channel id="userchargeenablerequest" typeId="userchargeenablerequest" /> + <channel id="valetmode" typeId="valetmode" /> + <channel id="valetpin" typeId="valetpin" /> + <channel id="wakeup" typeId="wakeup" /> + </channels> + + <config-description> + <parameter name="vin" type="text" required="true"> + <label>Vehicle Identification Number</label> + <description>VIN of the vehicle</description> + </parameter> + <parameter name="valetpin" type="integer" min="0" max="9999" required="false"> + <context>password</context> + <label>Valet PIN</label> + <description>PIN to use when enabling Valet Mode</description> + </parameter> + <parameter name="allowWakeup" type="boolean" required="false"> + <default>false</default> + <label>Allow Wake-Up</label> + <description>Allows waking up the vehicle. Caution: This can result in huge vampire drain!</description> + </parameter> + </config-description> + + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/models.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/models.xml index 0b23d0d1628b9..3859eec9fa90e 100644 --- a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/models.xml +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/models.xml @@ -5,11 +5,15 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="models"> + + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + <label>Tesla Model S</label> - <description>Thing for the Tesla Model S</description> + <description>A Tesla Model S Vehicle</description> <channels> - <channel id="allowwakeup" typeId="allowwakeup" /> <channel id="autoconditioning" typeId="autoconditioning" /> <channel id="autoparkstate" typeId="autoparkstate" /> <channel id="autoparkstate2" typeId="autoparkstate" /> @@ -27,7 +31,7 @@ <channel id="chargecurrent" typeId="chargecurrent" /> <channel id="chargeenablerequest" typeId="chargeenablerequest" /> <channel id="chargeenergyadded" typeId="chargeenergyadded" /> - <channel id="chargeidealmilesadded" typeId="chargeidealmilesadded" /> + <channel id="chargeidealdistanceadded" typeId="chargeidealdistanceadded" /> <channel id="chargelimit" typeId="chargelimit" /> <channel id="chargelimitmaximum" typeId="chargelimitmaximum" /> <channel id="chargelimitminimum" typeId="chargelimitminimum" /> @@ -35,7 +39,7 @@ <channel id="chargemaxcurrent" typeId="chargemaxcurrent" /> <channel id="chargeport" typeId="chargeport" /> <channel id="chargerate" typeId="chargerate" /> - <channel id="chargeratedmilesadded" typeId="chargeratedmilesadded" /> + <channel id="chargerateddistanceadded" typeId="chargerateddistanceadded" /> <channel id="chargercurrent" typeId="chargercurrent" /> <channel id="chargermaxcurrent" typeId="chargermaxcurrent" /> <channel id="chargerphases" typeId="chargerphases" /> @@ -50,13 +54,11 @@ <channel id="driverfrontdoor" typeId="driverfrontdoor" /> <channel id="driverreardoor" typeId="driverreardoor" /> <channel id="drivertemp" typeId="drivertemp" /> - <channel id="enableevents" typeId="enableevents" /> <channel id="estimatedbatteryrange" typeId="estimatedbatteryrange" /> <channel id="estimatedrange" typeId="estimatedrange" /> <channel id="eventstamp" typeId="eventstamp" /> <channel id="fan" typeId="fan" /> <channel id="flashlights" typeId="flashlights" /> - <channel id="forcerefresh" typeId="forcerefresh" /> <channel id="frontdefroster" typeId="frontdefroster" /> <channel id="fronttrunk" typeId="fronttrunk" /> <channel id="gpstimestamp" typeId="gpstimestamp" /> @@ -66,8 +68,6 @@ <channel id="honkhorn" typeId="honkhorn" /> <channel id="idealbatteryrange" typeId="idealbatteryrange" /> <channel id="insidetemp" typeId="insidetemp" /> - <channel id="ispreconditioning" typeId="ispreconditioning" /> - <channel id="lastautopartkerror" typeId="lastautopartkerror" /> <channel id="leftrearbackseatheater" typeId="leftrearbackseatheater" /> <channel id="leftrearseatheater" typeId="leftrearseatheater" /> <channel id="leftseatheater" typeId="leftseatheater" /> @@ -80,9 +80,7 @@ <channel id="maxcharges" typeId="maxcharges" /> <channel id="mobileenabled" typeId="mobileenabled" /> <channel id="minavailabletemp" typeId="minavailabletemp" /> - <channel id="nativelocationsupported" typeId="nativelocationsupported" /> <channel id="nativelocation" typeId="location" /> - <channel id="nativetype" typeId="nativelocationsupported" /> <channel id="notenoughpower" typeId="notenoughpower" /> <channel id="notificationsenabled" typeId="notificationsenabled" /> <channel id="notificationssupported" typeId="notificationssupported" /> @@ -100,11 +98,9 @@ <channel id="remotestart" typeId="remotestart" /> <channel id="remotestartenabled" typeId="remotestartenabled" /> <channel id="remotestartsupported" typeId="remotestartsupported" /> - <channel id="resetvaletpin" typeId="resetvaletpin" /> <channel id="rightrearbackseatheater" typeId="rightrearbackseatheater" /> <channel id="rightrearseatheater" typeId="rightrearseatheater" /> <channel id="rightseatheater" typeId="rightseatheater" /> - <channel id="righttempdirection" typeId="rightempdirection" /> <channel id="scheduledchargingpending" typeId="scheduledchargingpending" /> <channel id="scheduledchargingstart" typeId="scheduledchargingstart" /> <channel id="shiftstate" typeId="shiftstate" /> @@ -116,7 +112,7 @@ <channel id="steeringwheelheater" typeId="steeringwheelheater" /> <channel id="sunroof" typeId="sunroof" /> <channel id="sunroofstate" typeId="sunroofstate" /> - <channel id="temperature" typeId="temperature" /> + <channel id="combinedtemp" typeId="combinedtemp" /> <channel id="timetofullcharge" typeId="timetofullcharge" /> <channel id="tripcharging" typeId="tripcharging" /> <channel id="usablebatterylevel" typeId="usablebatterylevel" /> @@ -128,673 +124,22 @@ </channels> <config-description> - <parameter name="username" type="text" required="false"> - <label>Username</label> - <description>Username for the Tesla Remote Service, e.g email address</description> - </parameter> - <parameter name="password" type="text" required="false"> - <context>password</context> - <label>Password</label> - <description>Password for the Tesla Remote Service</description> - </parameter> <parameter name="vin" type="text" required="true"> <label>Vehicle Identification Number</label> - <description>VIN of the vehicle associated with this Thing</description> + <description>VIN of the vehicle</description> </parameter> <parameter name="valetpin" type="integer" min="0" max="9999" required="false"> <context>password</context> <label>Valet PIN</label> <description>PIN to use when enabling Valet Mode</description> </parameter> + <parameter name="allowWakeup" type="boolean" required="false"> + <default>false</default> + <label>Allow Wake-Up</label> + <description>Allows waking up the vehicle. Caution: This can result in huge vampire drain!</description> + </parameter> </config-description> </thing-type> - <channel-type id="allowwakeup" advanced="true"> - <item-type>Switch</item-type> - <label>Allow Wake Up</label> - <description>Allow the vehicle to be waken up</description> - </channel-type> - <channel-type id="autoconditioning"> - <item-type>Switch</item-type> - <label>Auto Conditioning</label> - <description>Indicates if the auto conditioning (A/C only) is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="autoparkstate" advanced="true"> - <item-type>String</item-type> - <label>Autopark State</label> - <description>Undocumented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="autoparkstyle" advanced="true"> - <item-type>String</item-type> - <label>Autopark Style</label> - <description>Undocumented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="batterycurrent" advanced="true"> - <item-type>Number</item-type> - <label>Battery Current</label> - <description>Current (Ampere) floating into (+) or out (-) of the battery</description> - <state pattern="%.1f A" readOnly="true"></state> - </channel-type> - <channel-type id="batteryheater" advanced="true"> - <item-type>Switch</item-type> - <label>Battery Heater</label> - <description>Indicates if the battery heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="batteryheaternopower" advanced="true"> - <item-type>Switch</item-type> - <label>Battery Heater Power</label> - <description>Indicates if there is enough power to use the battery heater</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="batterylevel"> - <item-type>Number</item-type> - <label>Battery Level</label> - <description>State of the battery in %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="batteryrange" advanced="true"> - <item-type>Number</item-type> - <label>Battery Range</label> - <description>Range, in km or miles, of the battery</description> - <state pattern="%d km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="calendarenabled" advanced="true"> - <item-type>Switch</item-type> - <label>Calendar Enabled</label> - <description>Indicates if access to a remote calendar is enabled</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="centerdisplay" advanced="true"> - <item-type>Switch</item-type> - <label>Central Display State</label> - <description>Indicates the state of the central display in the vehicle</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="centerrearseatheater" advanced="true"> - <item-type>Switch</item-type> - <label>Center Rear Seat Heater</label> - <description>Indicates if the center rear seat heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="charge"> - <item-type>Switch</item-type> - <label>Charge</label> - <description>Start (ON) or stop (OFF) charging</description> - </channel-type> - <channel-type id="chargecable"> - <item-type>String</item-type> - <label>Charge Cable</label> - <description>Undocumented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargecurrent" advanced="true"> - <item-type>Number</item-type> - <label>Charge Current</label> - <description>Current (Ampere) requested from the charger</description> - <state pattern="%.1f A" readOnly="true"></state> - </channel-type> - <channel-type id="chargeenablerequest" advanced="true"> - <item-type>Switch</item-type> - <label>Charge Enable Request</label> - <description>Undocumented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargeenergyadded" advanced="true"> - <item-type>Number</item-type> - <label>Charge Energy Added</label> - <description>Energy added, in kWh, during the last charging session</description> - <state pattern="%d kWh" readOnly="true"></state> - </channel-type> - <channel-type id="chargelimit" advanced="true"> - <item-type>Dimmer</item-type> - <label>Charge Limit</label> - <description>Limit charging of the vehicle to the given %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="chargelimitmaximum" advanced="true"> - <item-type>Dimmer</item-type> - <label>Charge Limit Maximum</label> - <description>Maximum charging limit of the vehicle, as %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="chargelimitminimum" advanced="true"> - <item-type>Dimmer</item-type> - <label>Charge Limit Minimum</label> - <description>Minimum charging limit of the vehicle, as %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="chargelimitsocstandard" advanced="true"> - <item-type>Dimmer</item-type> - <label>Charge Limit SOC Standard</label> - <description>Standard charging limity of the vehicle, in %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="chargeidealmilesadded" advanced="true"> - <item-type>Number</item-type> - <label>"Ideal" Charge Miles Added</label> - <description>"Ideal" range added, in miles or km, during the last charging session</description> - <state pattern="%d km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="chargemaxcurrent" advanced="true"> - <item-type>Number</item-type> - <label>Charge Max Current</label> - <description>Maximum current (Ampere) that can be requested from the charger</description> - <state pattern="%.1f A" readOnly="true"></state> - </channel-type> - <channel-type id="chargeratedmilesadded" advanced="true"> - <item-type>Number</item-type> - <label>"Rated" Charge Miles Added</label> - <description>"Rated" range added, in miles or km, during the last charging session</description> - <state pattern="%d km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="chargerate" advanced="true"> - <item-type>Number</item-type> - <label>Charge Rate</label> - <description>Not documented / To be defined (-1 if not charging)</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargestartingrange" advanced="true"> - <item-type>String</item-type> - <label>Charge Starting Range</label> - <description>Undocumented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargestartingsoc" advanced="true"> - <item-type>String</item-type> - <label>Charge Starting SOC</label> - <description>Undocumented / To be defined</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="chargingstate"> - <item-type>String</item-type> - <label>Charging State</label> - <description>“Startingâ€, “Completeâ€, “Chargingâ€, “Disconnectedâ€, “Stoppedâ€, “NoPowerâ€</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargetomax" advanced="true"> - <item-type>Switch</item-type> - <label>Charge To Max Range</label> - <description>Indicates if the charging to the maximum range is enabled</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="chargeport"> - <item-type>Switch</item-type> - <label>Charge Port</label> - <description>Open the Charge Port (ON) or indicates the state of the Charge Port (ON/OFF if Open/Closed)</description> - </channel-type> - <channel-type id="chargercurrent" advanced="true"> - <item-type>Number</item-type> - <label>Charge Current</label> - <description>Current (Ampere) actually being drawn from the charger</description> - <state pattern="%.1f A" readOnly="true"></state> - </channel-type> - <channel-type id="chargerphases" advanced="true"> - <item-type>Number</item-type> - <label>Charger Phases</label> - <description>Indicates the number of phases (1 to 3) used for charging</description> - <state pattern="%d" readOnly="true"></state> - </channel-type> - <channel-type id="chargermaxcurrent" advanced="true"> - <item-type>Number</item-type> - <label>Charger Maximum Current</label> - <description>Maximum current (Ampere) that can be delivered by the charger</description> - <state pattern="%.1f A" readOnly="true"></state> - </channel-type> - <channel-type id="chargerpower" advanced="true"> - <item-type>Number</item-type> - <label>Charger Power</label> - <description>Power actually delivered by the charger</description> - <state pattern="%.1f kW" readOnly="true"></state> - </channel-type> - <channel-type id="chargervoltage" advanced="true"> - <item-type>Number</item-type> - <label>Charger Voltage</label> - <description>Voltage (V) actually presented by the charger</description> - <state pattern="%.1f V" readOnly="true"></state> - </channel-type> - <channel-type id="climate"> - <item-type>Switch</item-type> - <label>Climate</label> - <description>Climate status indicator</description> - </channel-type> - <channel-type id="driverfrontdoor" advanced="true"> - <item-type>Contact</item-type> - <label>Driver Front Door</label> - <description>Indicates if the front door at the driver's side is opened</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="doorlock"> - <item-type>Switch</item-type> - <label>Door Lock</label> - <description>Lock or unlock the car</description> - </channel-type> - <channel-type id="driverreardoor" advanced="true"> - <item-type>Contact</item-type> - <label>Driver Rear Door</label> - <description>Indicates if the rear door at the driver's side is opened</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="drivertemp" advanced="true"> - <item-type>Number</item-type> - <label>Driver Temperature</label> - <description>Indicates the auto conditioning temperature set at the driver's side in Celsius or Fahrenheit</description> - <state pattern="%.1f°" readOnly="true"></state> - </channel-type> - <channel-type id="enableevents" advanced="true"> - <item-type>Switch</item-type> - <label>Enable Events</label> - <description>Enable the event stream from the vehicle</description> - </channel-type> - <channel-type id="eventstamp" advanced="true"> - <item-type>DateTime</item-type> - <label>Event Timestamp</label> - <description>Timestamp of the last event received from the Tesla streaming service</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="estimatedbatteryrange" advanced="true"> - <item-type>Number</item-type> - <label>Estimated Battery Range</label> - <description>Estimated battery range, in km or miles</description> - <state pattern="%d km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="estimatedrange" advanced="true"> - <item-type>Number</item-type> - <label>Estimated Range</label> - <description>Estimated range of the vehicle</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="fan" advanced="true"> - <item-type>Number</item-type> - <label>Fan</label> - <description>Indicates the speed (0-7) of the fan</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="flashlights"> - <item-type>Switch</item-type> - <label>Flash Lights</label> - <description>Flash the lights of the car (when ON is received)</description> - </channel-type> - <channel-type id="forcerefresh"> - <item-type>Switch</item-type> - <label>Force refresh</label> - <description>Forcefully refreshes all data from the car (when ON is received), possibly waking up the car in the process.</description> - </channel-type> - <channel-type id="frontdefroster" advanced="true"> - <item-type>Switch</item-type> - <label>Front Defroster</label> - <description>Indicates if the front defroster is enabled</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="fronttrunk" advanced="true"> - <item-type>Switch</item-type> - <label>Front Trunk</label> - <description>Indicates if the front trunk is opened, or open the front trunk when ON is received</description> - </channel-type> - <channel-type id="gpstimestamp" advanced="true"> - <item-type>DateTime</item-type> - <label>GPS Time Stamp</label> - <description>Time stamp of the most recent GPS location of the vehicle</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="heading" advanced="true"> - <item-type>Number</item-type> - <label>Heading</label> - <description>Indicates the (compass) heading of the car, in 0-360 degrees</description> - <state pattern="%d degrees" readOnly="true"></state> - </channel-type> - <channel-type id="headingestimation" advanced="true"> - <item-type>Number</item-type> - <label>Estimated Heading</label> - <description>Estimated (compass) heading of the car, in 0 to 360 degrees</description> - <state pattern="%d degrees" readOnly="true"></state> - </channel-type> - <channel-type id="honkhorn"> - <item-type>Switch</item-type> - <label>Honk the Horn</label> - <description>Honk the horn of the vehicle, when ON is received</description> - </channel-type> - <channel-type id="homelink"> - <item-type>Switch</item-type> - <label>Homelink Nearby</label> - <description>Indicates if the Home Link is nearby</description> - </channel-type> - <channel-type id="idealbatteryrange" advanced="true"> - <item-type>Number</item-type> - <label>Ideal Battery Range</label> - <description>Indicates the Batter Range, expressed in Ideal km or miles</description> - <state pattern="%d km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="insidetemp"> - <item-type>Number</item-type> - <label>Inside Temperature</label> - <description>Indicates the inside temperature of the vehicle in Celsius or Fahrenheit</description> - <state pattern="%.1f°" readOnly="true"></state> - </channel-type> - <channel-type id="lefttempdirection" advanced="true"> - <item-type>Number</item-type> - <label>Left Temperature Direction</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="lastautoparkerror" advanced="true"> - <item-type>String</item-type> - <label>Last Autopark Error</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="location" advanced="false"> - <item-type>Location</item-type> - <label>Location</label> - <description>The actual position of the vehicle</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="leftseatheater" advanced="true"> - <item-type>Switch</item-type> - <label>Left Seat Heater</label> - <description>Indicates if the left seat heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="leftrearseatheater" advanced="true"> - <item-type>Switch</item-type> - <label>Left Rear Seat Heater</label> - <description>Indicates if the left rear seat heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="leftrearbackseatheater" advanced="true"> - <item-type>Number</item-type> - <label>Left Rear Backseat Heater</label> - <description>Indicates the level (0,1,2 or 3) of the left rear backseat heater</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="managedcharging" advanced="true"> - <item-type>Switch</item-type> - <label>Managed Charging</label> - <description>Indicates managed charging is active</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="managedchargingcancelled" advanced="true"> - <item-type>Switch</item-type> - <label>Managed Charging Cancelled</label> - <description>Indicates managed charging is cancelled by the user</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="managedchargingstart" advanced="true"> - <item-type>String</item-type> - <label>Managed Charging Start Time</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="maxcharges" advanced="true"> - <item-type>Number</item-type> - <label>Max Charges</label> - <description>Indicates the number of consecutive "Max Range Charges" performed by the vehicle</description> - <state pattern="%d" readOnly="true"></state> - </channel-type> - <channel-type id="minavailabletemp"> - <item-type>Number</item-type> - <label>Minimum Temperature</label> - <description>Indicates the minimal inside temperature of the vehicle in Celsius or Fahrenheit</description> - <state pattern="%.1f°" readOnly="true"></state> - </channel-type> - <channel-type id="maxavailabletemp"> - <item-type>Number</item-type> - <label>Maximum Temperature</label> - <description>Indicates the maximum inside temperature of the vehicle in Celsius or Fahrenheit</description> - <state pattern="%.1f°" readOnly="true"></state> - </channel-type> - <channel-type id="mobileenabled" advanced="true"> - <item-type>Switch</item-type> - <label>Mobile Enabled</label> - <description>Indicates whether the vehicle can be remotely controlled</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="notenoughpower" advanced="true"> - <item-type>Switch</item-type> - <label>Not Enought Power </label> - <description>Indicates if not enough power (ON) is available to heat the vehicle</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="notificationsenabled" advanced="true"> - <item-type>Switch</item-type> - <label>Notifications Enabled</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="notificationssupported" advanced="true"> - <item-type>Switch</item-type> - <label>Notifications Supported</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="odometer"> - <item-type>Number</item-type> - <label>Odometer</label> - <description>Odometer of the vehicle, in km or miles</description> - <state pattern="%.1f km|miles" readOnly="true"></state> - </channel-type> - <channel-type id="outsidetemp" advanced="true"> - <item-type>Number</item-type> - <label>Outside Temperature</label> - <description>Indicates the outside temperature of the vehicle in Celsius or Fahrenheit</description> - <state pattern="%.1f°" readOnly="true"></state> - </channel-type> - <channel-type id="parsedcalendar" advanced="true"> - <item-type>Switch</item-type> - <label>Parsed Calendar Supported</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="passengertemp" advanced="true"> - <item-type>Number</item-type> - <label>Passenger Temperature</label> - <description>Indicates the auto conditioning temperature set at the passenger's side</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="passengerfrontdoor" advanced="true"> - <item-type>Contact</item-type> - <label>Passenger Front Door</label> - <description>Indicates if the front door at the passenger's side is opened</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="passengerreardoor" advanced="true"> - <item-type>Contact</item-type> - <label>Passenger Rear Door</label> - <description>Indicates if the rear door at the passenger's side is opened</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="power" advanced="true"> - <item-type>Number</item-type> - <label>Power</label> - <description>Net kW flowing in (+) or out (-) of the battery</description> - <state pattern="%.1f kW" readOnly="true"></state> - </channel-type> - <channel-type id="preconditioning" advanced="true"> - <item-type>Switch</item-type> - <label>Preconditioning</label> - <description>Indicates if preconditioning is activated</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="range" advanced="true"> - <item-type>Number</item-type> - <label>Range</label> - <description>Vehicle range - Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="reardefroster" advanced="true"> - <item-type>Switch</item-type> - <label>Rear Defroster</label> - <description>Indicates if the rear defroster is enabled</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="remotestartenabled" advanced="true"> - <item-type>Switch</item-type> - <label>Remote Start</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="reartrunk" advanced="true"> - <item-type>Switch</item-type> - <label>Rear Trunk</label> - <description>Indicates if the rear trunk is opened, or open/close the rear trunk when ON/OFF is received</description> - </channel-type> - <channel-type id="remotestart" advanced="true"> - <item-type>Switch</item-type> - <label>Remote Start</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="remotestartsupported" advanced="true"> - <item-type>Switch</item-type> - <label>Remote Start Supported</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="rightseatheater" advanced="true"> - <item-type>Switch</item-type> - <label>Right Seat Heater</label> - <description>Indicates if the right seat heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="rightrearseatheater" advanced="true"> - <item-type>Switch</item-type> - <label>Right Rear Seat Heater</label> - <description>Indicates if the right rear seat heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="rightrearbackseatheater" advanced="true"> - <item-type>Number</item-type> - <label>Right Rear Backseat Heater</label> - <description>Indicates the level (0,1,2 or 3) of the right rear backseat heater</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="righttempdirection" advanced="true"> - <item-type>Number</item-type> - <label>Right Temperature Direction</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="scheduledchargingpending" advanced="true"> - <item-type>Switch</item-type> - <label>Scheduled Charging Pending</label> - <description>Indicates if a scheduled charging session is still pending</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="scheduledchargingstart" advanced="true"> - <item-type>DateTime</item-type> - <label>Scheduled Charging Start</label> - <description>Indicates when the scheduled charging session will start, in yyyy-MM-dd'T'HH:mm:ss format</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="shiftstate" advanced="true"> - <item-type>String</item-type> - <label>Shift State</label> - <description>Indicates the state of the transmission, “Pâ€, “Dâ€, “Râ€, or “Nâ€</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="sidemirrorheaters" advanced="true"> - <item-type>Switch</item-type> - <label>Side Mirror Heaters</label> - <description>Indicates if the side mirror heaters are switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="smartpreconditioning" advanced="true"> - <item-type>Switch</item-type> - <label>Smart Preconditioning</label> - <description>Indicates if smart preconditioning is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="soc" advanced="true"> - <item-type>Dimmer</item-type> - <label>State of Charge</label> - <description>State of Charge, in %</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="speed"> - <item-type>Number</item-type> - <label>Speed</label> - <description>Vehicle speed, in km/hr or miles/hr</description> - <state pattern="%d km|miles/h" readOnly="true"></state> - </channel-type> - <channel-type id="state" advanced="true"> - <item-type>String</item-type> - <label>State</label> - <description>“onlineâ€, “asleepâ€, “wakingâ€</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="steeringwheelheater" advanced="true"> - <item-type>Switch</item-type> - <label>Steering Wheel Heater</label> - <description>Indicates if the steering wheel heater is switched on</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="sunroofstate" advanced="true"> - <item-type>String</item-type> - <label>Sunroof State</label> - <description>“unknownâ€, “openâ€, “closedâ€, “ventâ€, “comfortâ€</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="sunroof"> - <item-type>Dimmer</item-type> - <label>Sunroof</label> - <description>Open or close the sunroof to provided % (0 closed, 100 fully open)</description> - <state pattern="%d %%"></state> - </channel-type> - <channel-type id="temperature" advanced="true"> - <item-type>Number</item-type> - <label>Temperature</label> - <description>Set the temperature of the autoconditioning system in Celsius or Fahrenheit. The temperature for the - driver and passenger will be synced</description> - <state pattern="%.1f°"></state> - </channel-type> - <channel-type id="timetofullcharge" advanced="true"> - <item-type>Number</item-type> - <label>Time To Full Charge</label> - <description>Number of hours to fully charge the battery</description> - <state pattern="%.1f h" readOnly="true"></state> - </channel-type> - <channel-type id="tripcharging" advanced="true"> - <item-type>Switch</item-type> - <label>Trip Charging</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="usablebatterylevel" advanced="true"> - <item-type>Number</item-type> - <label>Usable Battery Level</label> - <description>Indicates the % of battery that can be used for vehicle functions like driving</description> - <state pattern="%.1f %%" readOnly="true"></state> - </channel-type> - <channel-type id="userchargeenablerequest" advanced="true"> - <item-type>String</item-type> - <label>User Charge Enable Request</label> - <description>Not documented / To be defined</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="valetmode" advanced="true"> - <item-type>Switch</item-type> - <label>Valet Mode</label> - <description>Enable or disable Valet Mode</description> - </channel-type> - <channel-type id="valetpin" advanced="true"> - <item-type>Switch</item-type> - <label>Valet PIN Required</label> - <description>Indicates if a PIN code is required to disable valet mode</description> - <state readOnly="true"></state> - </channel-type> - <channel-type id="wakeup" advanced="true"> - <item-type>Switch</item-type> - <label>Wake Up</label> - <description>Wake up the vehicle from a (deep) sleep</description> - </channel-type> - <channel-type id="wiperbladeheater" advanced="true"> - <item-type>Switch</item-type> - <label>Wiperblade Heater</label> - <description>Indicates if the wiperblade heater is switched on</description> - <state readOnly="true"></state> - </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modelx.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modelx.xml new file mode 100644 index 0000000000000..00bb0367b1048 --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modelx.xml @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tesla" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="modelx"> + + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Tesla Model X</label> + <description>A Tesla Model X Vehicle</description> + + <channels> + <channel id="autoconditioning" typeId="autoconditioning" /> + <channel id="autoparkstate" typeId="autoparkstate" /> + <channel id="autoparkstate2" typeId="autoparkstate" /> + <channel id="autoparkstyle" typeId="autoparkstyle" /> + <channel id="batterycurrent" typeId="batterycurrent" /> + <channel id="batteryheater" typeId="batteryheater" /> + <channel id="batteryheaternopower" typeId="batteryheaternopower" /> + <channel id="batterylevel" typeId="batterylevel" /> + <channel id="batteryrange" typeId="batteryrange" /> + <channel id="calendarenabled" typeId="calendarenabled" /> + <channel id="centerdisplay" typeId="centerdisplay" /> + <channel id="centerrearseatheater" typeId="centerrearseatheater" /> + <channel id="charge" typeId="charge" /> + <channel id="chargecable" typeId="chargecable" /> + <channel id="chargecurrent" typeId="chargecurrent" /> + <channel id="chargeenablerequest" typeId="chargeenablerequest" /> + <channel id="chargeenergyadded" typeId="chargeenergyadded" /> + <channel id="chargeidealdistanceadded" typeId="chargeidealdistanceadded" /> + <channel id="chargelimit" typeId="chargelimit" /> + <channel id="chargelimitmaximum" typeId="chargelimitmaximum" /> + <channel id="chargelimitminimum" typeId="chargelimitminimum" /> + <channel id="chargelimitsocstandard" typeId="chargelimitsocstandard" /> + <channel id="chargemaxcurrent" typeId="chargemaxcurrent" /> + <channel id="chargeport" typeId="chargeport" /> + <channel id="chargerate" typeId="chargerate" /> + <channel id="chargerateddistanceadded" typeId="chargerateddistanceadded" /> + <channel id="chargercurrent" typeId="chargercurrent" /> + <channel id="chargermaxcurrent" typeId="chargermaxcurrent" /> + <channel id="chargerphases" typeId="chargerphases" /> + <channel id="chargerpower" typeId="chargerpower" /> + <channel id="chargervoltage" typeId="chargervoltage" /> + <channel id="chargestartingrange" typeId="chargestartingrange" /> + <channel id="chargestartingsoc" typeId="chargestartingsoc" /> + <channel id="chargetomax" typeId="chargetomax" /> + <channel id="chargingstate" typeId="chargingstate" /> + <channel id="climate" typeId="climate" /> + <channel id="doorlock" typeId="doorlock" /> + <channel id="driverfrontdoor" typeId="driverfrontdoor" /> + <channel id="driverreardoor" typeId="driverreardoor" /> + <channel id="drivertemp" typeId="drivertemp" /> + <channel id="estimatedbatteryrange" typeId="estimatedbatteryrange" /> + <channel id="estimatedrange" typeId="estimatedrange" /> + <channel id="eventstamp" typeId="eventstamp" /> + <channel id="fan" typeId="fan" /> + <channel id="flashlights" typeId="flashlights" /> + <channel id="frontdefroster" typeId="frontdefroster" /> + <channel id="fronttrunk" typeId="fronttrunk" /> + <channel id="gpstimestamp" typeId="gpstimestamp" /> + <channel id="heading" typeId="heading" /> + <channel id="headingestimation" typeId="headingestimation" /> + <channel id="homelink" typeId="homelink" /> + <channel id="honkhorn" typeId="honkhorn" /> + <channel id="idealbatteryrange" typeId="idealbatteryrange" /> + <channel id="insidetemp" typeId="insidetemp" /> + <channel id="leftrearbackseatheater" typeId="leftrearbackseatheater" /> + <channel id="leftrearseatheater" typeId="leftrearseatheater" /> + <channel id="leftseatheater" typeId="leftseatheater" /> + <channel id="lefttempdirection" typeId="lefttempdirection" /> + <channel id="location" typeId="location" /> + <channel id="managedcharging" typeId="managedcharging" /> + <channel id="managedchargingcancelled" typeId="managedchargingcancelled" /> + <channel id="managedchargingstart" typeId="managedchargingstart" /> + <channel id="maxavailabletemp" typeId="maxavailabletemp" /> + <channel id="maxcharges" typeId="maxcharges" /> + <channel id="mobileenabled" typeId="mobileenabled" /> + <channel id="minavailabletemp" typeId="minavailabletemp" /> + <channel id="nativelocation" typeId="location" /> + <channel id="notenoughpower" typeId="notenoughpower" /> + <channel id="notificationsenabled" typeId="notificationsenabled" /> + <channel id="notificationssupported" typeId="notificationssupported" /> + <channel id="odometer" typeId="odometer" /> + <channel id="outsidetemp" typeId="outsidetemp" /> + <channel id="parsedcalendar" typeId="parsedcalendar" /> + <channel id="passengerfrontdoor" typeId="passengerfrontdoor" /> + <channel id="passengerreardoor" typeId="passengerreardoor" /> + <channel id="passengertemp" typeId="passengertemp" /> + <channel id="power" typeId="power" /> + <channel id="preconditioning" typeId="preconditioning" /> + <channel id="range" typeId="range" /> + <channel id="reardefroster" typeId="reardefroster" /> + <channel id="reartrunk" typeId="reartrunk" /> + <channel id="remotestart" typeId="remotestart" /> + <channel id="remotestartenabled" typeId="remotestartenabled" /> + <channel id="remotestartsupported" typeId="remotestartsupported" /> + <channel id="rightrearbackseatheater" typeId="rightrearbackseatheater" /> + <channel id="rightrearseatheater" typeId="rightrearseatheater" /> + <channel id="rightseatheater" typeId="rightseatheater" /> + <channel id="scheduledchargingpending" typeId="scheduledchargingpending" /> + <channel id="scheduledchargingstart" typeId="scheduledchargingstart" /> + <channel id="shiftstate" typeId="shiftstate" /> + <channel id="sidemirrorheaters" typeId="sidemirrorheaters" /> + <channel id="smartpreconditioning" typeId="smartpreconditioning" /> + <channel id="soc" typeId="soc" /> + <channel id="speed" typeId="speed" /> + <channel id="state" typeId="state" /> + <channel id="steeringwheelheater" typeId="steeringwheelheater" /> + <channel id="sunroof" typeId="sunroof" /> + <channel id="sunroofstate" typeId="sunroofstate" /> + <channel id="combinedtemp" typeId="combinedtemp" /> + <channel id="timetofullcharge" typeId="timetofullcharge" /> + <channel id="tripcharging" typeId="tripcharging" /> + <channel id="usablebatterylevel" typeId="usablebatterylevel" /> + <channel id="userchargeenablerequest" typeId="userchargeenablerequest" /> + <channel id="valetmode" typeId="valetmode" /> + <channel id="valetpin" typeId="valetpin" /> + <channel id="wakeup" typeId="wakeup" /> + <channel id="wiperbladeheater" typeId="wiperbladeheater" /> + </channels> + + <config-description> + <parameter name="vin" type="text" required="true"> + <label>Vehicle Identification Number</label> + <description>VIN of the vehicle</description> + </parameter> + <parameter name="valetpin" type="integer" min="0" max="9999" required="false"> + <context>password</context> + <label>Valet PIN</label> + <description>PIN to use when enabling Valet Mode</description> + </parameter> + <parameter name="allowWakeup" type="boolean" required="false"> + <default>false</default> + <label>Allow Wake-Up</label> + <description>Allows waking up the vehicle. Caution: This can result in huge vampire drain!</description> + </parameter> + </config-description> + + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modely.xml b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modely.xml new file mode 100644 index 0000000000000..ec2be2850f67e --- /dev/null +++ b/bundles/org.openhab.binding.tesla/src/main/resources/ESH-INF/thing/modely.xml @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tesla" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="modely"> + + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Tesla Model Y</label> + <description>A Tesla Model Y Vehicle</description> + + <channels> + <channel id="allowwakeup" typeId="allowwakeup" /> + <channel id="autoconditioning" typeId="autoconditioning" /> + <channel id="autoparkstate" typeId="autoparkstate" /> + <channel id="autoparkstate2" typeId="autoparkstate" /> + <channel id="autoparkstyle" typeId="autoparkstyle" /> + <channel id="batterycurrent" typeId="batterycurrent" /> + <channel id="batterylevel" typeId="batterylevel" /> + <channel id="batteryrange" typeId="batteryrange" /> + <channel id="calendarenabled" typeId="calendarenabled" /> + <channel id="centerdisplay" typeId="centerdisplay" /> + <channel id="centerrearseatheater" typeId="centerrearseatheater" /> + <channel id="charge" typeId="charge" /> + <channel id="chargecable" typeId="chargecable" /> + <channel id="chargecurrent" typeId="chargecurrent" /> + <channel id="chargeenablerequest" typeId="chargeenablerequest" /> + <channel id="chargeenergyadded" typeId="chargeenergyadded" /> + <channel id="chargeidealdistanceadded" typeId="chargeidealdistanceadded" /> + <channel id="chargelimit" typeId="chargelimit" /> + <channel id="chargelimitmaximum" typeId="chargelimitmaximum" /> + <channel id="chargelimitminimum" typeId="chargelimitminimum" /> + <channel id="chargelimitsocstandard" typeId="chargelimitsocstandard" /> + <channel id="chargemaxcurrent" typeId="chargemaxcurrent" /> + <channel id="chargeport" typeId="chargeport" /> + <channel id="chargerate" typeId="chargerate" /> + <channel id="chargerateddistanceadded" typeId="chargerateddistanceadded" /> + <channel id="chargercurrent" typeId="chargercurrent" /> + <channel id="chargermaxcurrent" typeId="chargermaxcurrent" /> + <channel id="chargerphases" typeId="chargerphases" /> + <channel id="chargerpower" typeId="chargerpower" /> + <channel id="chargervoltage" typeId="chargervoltage" /> + <channel id="chargestartingrange" typeId="chargestartingrange" /> + <channel id="chargestartingsoc" typeId="chargestartingsoc" /> + <channel id="chargetomax" typeId="chargetomax" /> + <channel id="chargingstate" typeId="chargingstate" /> + <channel id="climate" typeId="climate" /> + <channel id="doorlock" typeId="doorlock" /> + <channel id="driverfrontdoor" typeId="driverfrontdoor" /> + <channel id="driverreardoor" typeId="driverreardoor" /> + <channel id="drivertemp" typeId="drivertemp" /> + <channel id="estimatedbatteryrange" typeId="estimatedbatteryrange" /> + <channel id="estimatedrange" typeId="estimatedrange" /> + <channel id="eventstamp" typeId="eventstamp" /> + <channel id="fan" typeId="fan" /> + <channel id="flashlights" typeId="flashlights" /> + <channel id="frontdefroster" typeId="frontdefroster" /> + <channel id="fronttrunk" typeId="fronttrunk" /> + <channel id="gpstimestamp" typeId="gpstimestamp" /> + <channel id="heading" typeId="heading" /> + <channel id="headingestimation" typeId="headingestimation" /> + <channel id="homelink" typeId="homelink" /> + <channel id="honkhorn" typeId="honkhorn" /> + <channel id="idealbatteryrange" typeId="idealbatteryrange" /> + <channel id="insidetemp" typeId="insidetemp" /> + <channel id="leftrearbackseatheater" typeId="leftrearbackseatheater" /> + <channel id="leftrearseatheater" typeId="leftrearseatheater" /> + <channel id="leftseatheater" typeId="leftseatheater" /> + <channel id="lefttempdirection" typeId="lefttempdirection" /> + <channel id="location" typeId="location" /> + <channel id="managedcharging" typeId="managedcharging" /> + <channel id="managedchargingcancelled" typeId="managedchargingcancelled" /> + <channel id="managedchargingstart" typeId="managedchargingstart" /> + <channel id="maxavailabletemp" typeId="maxavailabletemp" /> + <channel id="maxcharges" typeId="maxcharges" /> + <channel id="mobileenabled" typeId="mobileenabled" /> + <channel id="minavailabletemp" typeId="minavailabletemp" /> + <channel id="nativelocation" typeId="location" /> + <channel id="notenoughpower" typeId="notenoughpower" /> + <channel id="notificationsenabled" typeId="notificationsenabled" /> + <channel id="notificationssupported" typeId="notificationssupported" /> + <channel id="odometer" typeId="odometer" /> + <channel id="outsidetemp" typeId="outsidetemp" /> + <channel id="parsedcalendar" typeId="parsedcalendar" /> + <channel id="passengerfrontdoor" typeId="passengerfrontdoor" /> + <channel id="passengerreardoor" typeId="passengerreardoor" /> + <channel id="passengertemp" typeId="passengertemp" /> + <channel id="power" typeId="power" /> + <channel id="preconditioning" typeId="preconditioning" /> + <channel id="range" typeId="range" /> + <channel id="reardefroster" typeId="reardefroster" /> + <channel id="reartrunk" typeId="reartrunk" /> + <channel id="remotestart" typeId="remotestart" /> + <channel id="remotestartenabled" typeId="remotestartenabled" /> + <channel id="remotestartsupported" typeId="remotestartsupported" /> + <channel id="rightrearbackseatheater" typeId="rightrearbackseatheater" /> + <channel id="rightrearseatheater" typeId="rightrearseatheater" /> + <channel id="rightseatheater" typeId="rightseatheater" /> + <channel id="scheduledchargingpending" typeId="scheduledchargingpending" /> + <channel id="scheduledchargingstart" typeId="scheduledchargingstart" /> + <channel id="shiftstate" typeId="shiftstate" /> + <channel id="sidemirrorheaters" typeId="sidemirrorheaters" /> + <channel id="smartpreconditioning" typeId="smartpreconditioning" /> + <channel id="soc" typeId="soc" /> + <channel id="speed" typeId="speed" /> + <channel id="state" typeId="state" /> + <channel id="combinedtemp" typeId="combinedtemp" /> + <channel id="timetofullcharge" typeId="timetofullcharge" /> + <channel id="tripcharging" typeId="tripcharging" /> + <channel id="usablebatterylevel" typeId="usablebatterylevel" /> + <channel id="userchargeenablerequest" typeId="userchargeenablerequest" /> + <channel id="valetmode" typeId="valetmode" /> + <channel id="valetpin" typeId="valetpin" /> + <channel id="wakeup" typeId="wakeup" /> + </channels> + + <config-description> + <parameter name="vin" type="text" required="true"> + <label>Vehicle Identification Number</label> + <description>VIN of the vehicle</description> + </parameter> + <parameter name="valetpin" type="integer" min="0" max="9999" required="false"> + <context>password</context> + <label>Valet PIN</label> + <description>PIN to use when enabling Valet Mode</description> + </parameter> + <parameter name="allowWakeup" type="boolean" required="false"> + <default>false</default> + <label>Allow Wake-Up</label> + <description>Allows waking up the vehicle. Caution: This can result in huge vampire drain!</description> + </parameter> + </config-description> + + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.toon/README.md b/bundles/org.openhab.binding.toon/README.md deleted file mode 100644 index 9f7756434368a..0000000000000 --- a/bundles/org.openhab.binding.toon/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# Toon Binding - -The Toon bindings shows among others current room temperature, setpoint, energy and gas usage information. -It can control the setpoint and current program. -Connected smart plugs can also be controlled. - -## Supported Things - -### Toon Webaccount - -Before the binding can be used, a Toon Webaccount must be added. -This needs to be done manually. Select `Toon Webaccount`, and enter your username and password. -Afterwards start discovery so your display and connected plugs are discovered. - -### Toon display unit - -The display unit holds all channels that represent current room temperature, setpoint, setpoint mode, gas and energy meter readings. - -### Toon plug - -A Toon plug represents a connected wall plug that can be controlled via Toon. - -## Discovery - -Once the binding is authorized, and the `Toon Webaccount` is added, you can start the discovery. -This will find your Toon Display and put it in the Inbox. - -Currently only the display and plugs are discovered. So no Alarms or Hue lights will be discovered. - -## Binding Configuration - - - -## Thing Configuration - -demo.things - -``` -toon:toonapi:toontest [ username="xxxx", password="yyyy" ] -``` - -## Items - -demo.items: - -``` -Group Toon -// Display items -Number ToonTemp (Toon) {channel="toon:main:toontest:zzzz:Temperature"} -Number ToonSetpoint (Toon) {channel="toon:main:toontest:zzzz:Setpoint"} -Number ToonSetpointMode (Toon) {channel="toon:main:toontest:zzzz:SetpointMode"} - -Number Gas (Toon) {channel="toon:main:toontest:zzzz:GasMeterReading"} -Number Power (Toon) {channel="toon:main:toontest:zzzz:PowerMeterReading"} -Number PowerLow (Toon) {channel="toon:main:toontest:zzzz:PowerMeterReadingLow"} -Number PowerConsumption (Toon) {channel="toon:main:toontest:zzzz:PowerConsumption"} - -Number Modulation (Toon) {channel="toon:main:toontest:zzzz:ModulationLevel"} -Switch Heater (Toon) {channel="toon:main:toontest:zzzz:Heating"} -Switch Tapwater (Toon) {channel="toon:main:toontest:zzzz:Tapwater"} -Switch PreHeat (Toon) {channel="toon:main:toontest:zzzz:Preheat"} - -// Plug items -Switch Plug (Toon) {channel="toon:plug:toontest:pppp:switch_binary"} -Number PlugConsumption (Toon) {channel="toon:plug:toontest:pppp:PowerConsumption"} -``` - -Replace zzzz and pppp with the discovered values. - - -## Sitemaps - -demo.sitemaps - -``` - Frame { - Group item=Toon - Setpoint item=ToonSetpoint minValue=16 maxValue=28 step=0.5 - Selection item=ToonSetpointMode label="Toon Program Selection" mappings=[0=Comfort, 1=Active, 2=Sleep, 3=Away] - } -``` diff --git a/bundles/org.openhab.binding.toon/pom.xml b/bundles/org.openhab.binding.toon/pom.xml deleted file mode 100644 index 08240eb4f9b15..0000000000000 --- a/bundles/org.openhab.binding.toon/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_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.0-SNAPSHOT</version> - </parent> - - <artifactId>org.openhab.binding.toon</artifactId> - - <name>openHAB Add-ons :: Bundles :: Toon Binding</name> - -</project> diff --git a/bundles/org.openhab.binding.toon/src/main/feature/feature.xml b/bundles/org.openhab.binding.toon/src/main/feature/feature.xml deleted file mode 100644 index 84eaca20866f4..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/feature/feature.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<features name="org.openhab.binding.toon-${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/${project.version}/xml/features</repository> - - <feature name="openhab-binding-toon" description="Toon Binding" version="${project.version}"> - <feature>openhab-runtime-base</feature> - <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.toon/${project.version}</bundle> - </feature> -</features> diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonApiClient.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonApiClient.java deleted file mode 100644 index 766be62bb26bd..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonApiClient.java +++ /dev/null @@ -1,266 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.UUID; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.apache.commons.lang.StringUtils; -import org.openhab.binding.toon.internal.api.Agreement; -import org.openhab.binding.toon.internal.api.ToonConnectionException; -import org.openhab.binding.toon.internal.api.ToonState; -import org.openhab.binding.toon.internal.config.ToonBridgeConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.FieldNamingPolicy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - -/** - * The {@link ToonApiClient} class is capable of retrieving the current states and change the setpoint and thermostat - * program. It is based on the legacy api. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonApiClient { - private Logger logger = LoggerFactory.getLogger(ToonApiClient.class); - - private static final String TOON_HOST = "https://toonopafstand.eneco.nl"; - private static final String TOON_LOGIN_PATH = "/toonMobileBackendWeb/client/login"; - private static final String TOON_LOGOUT_PATH = "/toonMobileBackendWeb/client/auth/logout"; - private static final String TOON_START_PATH = "/toonMobileBackendWeb/client/auth/start"; - private static final String TOON_UPDATE_PATH = "/toonMobileBackendWeb/client/auth/retrieveToonState"; - private static final String TOON_TEMPSET_PATH = "/toonMobileBackendWeb/client/auth/setPoint"; - private static final String TOON_CHANGE_SCHEME_PATH = "/toonMobileBackendWeb/client/auth/schemeState"; - private static final String TOON_SWITCH_PLUG_PATH = "/toonMobileBackendWeb/client/auth/smartplug/setTarget"; - - protected Client client = ClientBuilder.newClient(); - protected WebTarget toonTarget = client.target(TOON_HOST); - protected WebTarget updateTarget = client.target(TOON_HOST); - - private String clientId; - private String clientIdChecksum; - - private final JsonParser jsonParser; - private final Gson gson; - private final ToonBridgeConfiguration configuration; - - public ToonApiClient(ToonBridgeConfiguration configuration) { - this.configuration = configuration; - this.jsonParser = new JsonParser(); - this.gson = createGsonBuilder().create(); - } - - public void login() throws ToonConnectionException { - logger.debug("login start"); - - if (configuration == null || StringUtils.isEmpty(configuration.username)) { - throw new ToonConnectionException("Username not provided"); - } - if (StringUtils.isEmpty(configuration.password)) { - throw new ToonConnectionException("Password not provided"); - } - - Form form = new Form(); - form.param("username", configuration.username); - form.param("password", configuration.password); - - Response response = toonTarget.path(TOON_LOGIN_PATH).request(MediaType.APPLICATION_JSON_TYPE) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); - - JsonObject json = validateResponse(response); - // logger.debug("json {}", json); - - clientId = json.get("clientId").getAsString(); - clientIdChecksum = json.get("clientIdChecksum").getAsString(); - - form = new Form(); - JsonObject agreement = json.getAsJsonArray("agreements").get(0).getAsJsonObject(); - form.param("agreementId", agreement.get("agreementId").getAsString()); - form.param("agreementIdChecksum", agreement.get("agreementIdChecksum").getAsString()); - form.param("clientId", clientId); - form.param("clientIdChecksum", clientIdChecksum); - form.param("random", UUID.randomUUID().toString()); - - response = toonTarget.path(TOON_START_PATH).request(MediaType.APPLICATION_JSON_TYPE) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); - - validateResponse(response); - - logger.debug("login ok"); - } - - public List<Agreement> getAgreements() throws ToonConnectionException { - logger.debug("getAgreements start"); - - if (configuration == null) { - throw new ToonConnectionException("Configuration is missing or corrupted"); - } else if (StringUtils.isEmpty(configuration.username)) { - throw new ToonConnectionException("Username not provided"); - } else if (StringUtils.isEmpty(configuration.password)) { - throw new ToonConnectionException("Password not provided"); - } - - Form form = new Form(); - form.param("username", configuration.username); - form.param("password", configuration.password); - - Response response = toonTarget.path(TOON_LOGIN_PATH).request(MediaType.APPLICATION_JSON_TYPE) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); - - JsonObject json = validateResponse(response); - logger.debug("json {}", json); - JsonArray agreements = json.get("agreements").getAsJsonArray(); - if (agreements != null) { - return Arrays.asList(gson.fromJson(agreements, Agreement[].class)); - } - return Collections.emptyList(); - } - - private JsonObject validateResponse(Response response) throws ToonConnectionException { - if (response.getStatus() != 200) { - logger.debug("response status {}", response.getStatus()); - clientId = clientIdChecksum = null; - throw new ToonConnectionException("invalid api response status: " + response.getStatus()); - } - if (!response.hasEntity()) { - logger.debug("empty response from api"); - return new JsonObject(); - } - JsonObject json = jsonParser.parse(response.readEntity(String.class)).getAsJsonObject(); - if (!json.get("success").getAsBoolean()) { - logger.debug("validateResponse {}", json); - clientId = clientIdChecksum = null; - throw new ToonConnectionException(json.get("reason").getAsString()); - } - return json; - } - - private ToonState getToonState() throws ToonConnectionException { - logger.debug("get ToonState"); - if (clientId == null) { - logger.debug("not logged in"); - return null; - } - Form form = new Form(); - form.param("clientId", clientId); - form.param("clientIdChecksum", clientIdChecksum); - form.param("random", UUID.randomUUID().toString()); - - Response response = client.target(TOON_HOST).path(TOON_UPDATE_PATH).queryParam("clientId", clientId) - .queryParam("clientIdChecksum", clientIdChecksum).request(MediaType.APPLICATION_JSON_TYPE).get(); - - JsonObject json = validateResponse(response); - logger.debug("toon state: {}", json); - return gson.fromJson(json, ToonState.class); - } - - public void logout() { - logger.debug("logout"); - - if (clientId == null) { - logger.debug("not logged in"); - return; - } - - Form form = new Form(); - form.param("clientId", clientId); - form.param("clientIdChecksum", clientIdChecksum); - form.param("random", UUID.randomUUID().toString()); - - clientId = clientIdChecksum = null; - - toonTarget.path(TOON_LOGOUT_PATH).request(MediaType.APPLICATION_JSON_TYPE) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE)); - } - - public void setSetpoint(int value) throws ToonConnectionException { - logger.debug("setSetpoint {}", value); - - if (clientId == null) { - logger.debug("not logged in"); - return; - } - - Response response = client.target(TOON_HOST).path(TOON_TEMPSET_PATH).queryParam("clientId", clientId) - .queryParam("clientIdChecksum", clientIdChecksum).queryParam("value", String.format("%d", value)) - .queryParam("random", UUID.randomUUID().toString()).request(MediaType.APPLICATION_JSON_TYPE).get(); - - validateResponse(response); - } - - public void setSetpointMode(int value) throws ToonConnectionException { - logger.debug("setSetpointMode {}", value); - - if (clientId == null) { - logger.debug("not logged in"); - return; - } - Response response = client.target(TOON_HOST).path(TOON_CHANGE_SCHEME_PATH).queryParam("clientId", clientId) - .queryParam("clientIdChecksum", clientIdChecksum).queryParam("state", "2") - .queryParam("temperatureState", value).queryParam("random", UUID.randomUUID().toString()) - .request(MediaType.APPLICATION_JSON_TYPE).get(); - - validateResponse(response); - } - - public void setPlugState(int value, String uuid) throws ToonConnectionException { - logger.debug("setPlugState {} {}", value, uuid); - - if (clientId == null) { - logger.debug("not logged in"); - return; - } - Response response = client.target(TOON_HOST).path(TOON_SWITCH_PLUG_PATH).queryParam("clientId", clientId) - .queryParam("clientIdChecksum", clientIdChecksum).queryParam("devUuid", uuid).queryParam("state", value) - .queryParam("random", UUID.randomUUID().toString()).request(MediaType.APPLICATION_JSON_TYPE).get(); - - validateResponse(response); - } - - public ToonState collect() throws ToonConnectionException { - try { - if (clientId == null) { - login(); - } - return getToonState(); - } catch (ToonConnectionException e) { - clientId = clientIdChecksum = null; - throw e; - } catch (Exception e) { - clientId = clientIdChecksum = null; - throw new ToonConnectionException(e.getMessage(), e); - } - } - - private GsonBuilder createGsonBuilder() { - GsonBuilder gsonBuilder = new GsonBuilder(); - gsonBuilder.setFieldNamingPolicy(FieldNamingPolicy.IDENTITY); - return gsonBuilder; - } - -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonBindingConstants.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonBindingConstants.java deleted file mode 100644 index 64494297a44a3..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonBindingConstants.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.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 {@link ToonBindingConstants} class defines common constants, which are - * used across the whole binding. - * - * @author Jorg de Jong - Initial contribution - */ -@NonNullByDefault -public class ToonBindingConstants { - - public static final String BINDING_ID = "toon"; - - // List of all Thing Type UIDs - public static final ThingTypeUID APIBRIDGE_THING_TYPE = new ThingTypeUID(BINDING_ID, "toonapi"); - public static final ThingTypeUID MAIN_THING_TYPE = new ThingTypeUID(BINDING_ID, "main"); - public static final ThingTypeUID PLUG_THING_TYPE = new ThingTypeUID(BINDING_ID, "plug"); - public static final ThingTypeUID SMOKE_THING_TYPE = new ThingTypeUID(BINDING_ID, "smoke"); - - // List of all Channel ids - public static final String CHANNEL_TEMPERATURE = "Temperature"; - public static final String CHANNEL_SETPOINT = "Setpoint"; - public static final String CHANNEL_SETPOINT_MODE = "SetpointMode"; - public static final String CHANNEL_MODULATION_LEVEL = "ModulationLevel"; - - public static final String CHANNEL_HEATING_SWITCH = "Heating"; - public static final String CHANNEL_TAPWATER_SWITCH = "Tapwater"; - public static final String CHANNEL_PREHEAT_SWITCH = "Preheat"; - - // gasUsage - public static final String CHANNEL_GAS_METER_READING = "GasMeterReading"; - - // powerUsage - public static final String CHANNEL_POWER_METER_READING = "PowerMeterReading"; - public static final String CHANNEL_POWER_METER_READING_LOW = "PowerMeterReadingLow"; - public static final String CHANNEL_POWER_CONSUMPTION = "PowerConsumption"; - - // plug channels - public static final String CHANNEL_SWITCH_BINARY = "SwitchBinary"; - - // main unit property names - public static final String PROPERTY_AGREEMENT_ID = "agreementId"; - public static final String PROPERTY_COMMON_NAME = "toon_displayCommonName"; - public static final String PROPERTY_ADDRESS = "toon_address"; - - // plug property names - public static final String PROPERTY_DEV_UUID = "devUUID"; - public static final String PROPERTY_DEV_TYPE = "devType"; - - // List of all supported physical devices and modules - public static final Set<ThingTypeUID> SUPPORTED_DEVICE_THING_TYPES_UIDS = Collections - .unmodifiableSet(Stream.of(MAIN_THING_TYPE, SMOKE_THING_TYPE, PLUG_THING_TYPE).collect(Collectors.toSet())); - - // List of all adressable things in OH = SUPPORTED_DEVICE_THING_TYPES_UIDS + the virtual bridge - public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet(Stream - .of(MAIN_THING_TYPE, SMOKE_THING_TYPE, PLUG_THING_TYPE, APIBRIDGE_THING_TYPE).collect(Collectors.toSet())); -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonHandlerFactory.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonHandlerFactory.java deleted file mode 100644 index cbf2158c95268..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/ToonHandlerFactory.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal; - -import static org.openhab.binding.toon.internal.ToonBindingConstants.*; - -import java.util.Hashtable; - -import org.eclipse.smarthome.config.discovery.DiscoveryService; -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; -import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; -import org.openhab.binding.toon.internal.discovery.ToonDiscoveryService; -import org.openhab.binding.toon.internal.handler.ToonBridgeHandler; -import org.openhab.binding.toon.internal.handler.ToonDisplayHandler; -import org.openhab.binding.toon.internal.handler.ToonPlugHandler; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.component.annotations.Component; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ToonHandlerFactory} is responsible for creating things and thing - * handlers. - * - * @author Jorg de Jong - Initial contribution - */ -@Component(service = ThingHandlerFactory.class, configurationPid = "binding.toon") -public class ToonHandlerFactory extends BaseThingHandlerFactory { - private Logger logger = LoggerFactory.getLogger(ToonHandlerFactory.class); - - private ServiceRegistration<?> discoveryServiceReg; - - @Override - public boolean supportsThingType(ThingTypeUID thingTypeUID) { - return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); - } - - @Override - protected ThingHandler createHandler(Thing thing) { - logger.debug("createHandler for {} {}", thing, thing.getThingTypeUID()); - ThingTypeUID thingTypeUID = thing.getThingTypeUID(); - if (thingTypeUID.equals(APIBRIDGE_THING_TYPE)) { - ToonBridgeHandler bridgeHandler = new ToonBridgeHandler((Bridge) thing); - registerDeviceDiscoveryService(bridgeHandler); - return bridgeHandler; - } else if (thingTypeUID.equals(PLUG_THING_TYPE)) { - return new ToonPlugHandler(thing); - } else if (thingTypeUID.equals(MAIN_THING_TYPE)) { - return new ToonDisplayHandler(thing); - } else { - logger.warn("ThingHandler not found for {}", thing.getThingTypeUID()); - return null; - } - } - - private void registerDeviceDiscoveryService(ToonBridgeHandler toonBridgeHandler) { - ToonDiscoveryService discoveryService = new ToonDiscoveryService(toonBridgeHandler); - discoveryServiceReg = bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, - new Hashtable<String, Object>()); - } - - @Override - protected void removeHandler(ThingHandler thingHandler) { - logger.debug("removeHandler"); - if (discoveryServiceReg != null && thingHandler.getThing().getThingTypeUID().equals(APIBRIDGE_THING_TYPE)) { - discoveryServiceReg.unregister(); - discoveryServiceReg = null; - } - super.removeHandler(thingHandler); - } - -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/Agreement.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/Agreement.java deleted file mode 100644 index 0a642abffdf13..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/Agreement.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link Agreement} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class Agreement { - private String agreementId; - private String street; - private String houseNumber; - private String postalCode; - private String city; - private String displayCommonName; - - public String getAgreementId() { - return agreementId; - } - - public void setAgreementId(String agreementId) { - this.agreementId = agreementId; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getHouseNumber() { - return houseNumber; - } - - public void setHouseNumber(String houseNumber) { - this.houseNumber = houseNumber; - } - - public String getPostalCode() { - return postalCode; - } - - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getDisplayCommonName() { - return displayCommonName; - } - - public void setDisplayCommonName(String displayCommonName) { - this.displayCommonName = displayCommonName; - } - -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfig.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfig.java deleted file mode 100644 index 8c7a3dda5544c..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfig.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link DeviceConfig} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class DeviceConfig { - // shared fields - private String devUUID; - private String name; - - // deviceConfigInfo fields - private String devType; - private Long usageCapable; - - // deviceStatusInfo fields - private Long currentState; - private Long isConnected; - private Double currentUsage; - - public String getDevUUID() { - return devUUID; - } - - public void setDevUUID(String devUUID) { - this.devUUID = devUUID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDevType() { - return devType; - } - - public void setDevType(String devType) { - this.devType = devType; - } - - public Long getUsageCapable() { - return usageCapable; - } - - public void setUsageCapable(Long usageCapable) { - this.usageCapable = usageCapable; - } - - public Long getCurrentState() { - return currentState; - } - - public void setCurrentState(Long currentState) { - this.currentState = currentState; - } - - public Long getIsConnected() { - return isConnected; - } - - public void setIsConnected(Long isConnected) { - this.isConnected = isConnected; - } - - public Double getCurrentUsage() { - return currentUsage; - } - - public void setCurrentUsage(Double currentUsage) { - this.currentUsage = currentUsage; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfigInfo.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfigInfo.java deleted file mode 100644 index decbeee302729..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceConfigInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -import java.util.List; - -/** - * The {@link DeviceConfigInfo} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class DeviceConfigInfo { - private List<DeviceConfig> device; - - public List<DeviceConfig> getDevice() { - return device; - } - - public void setDevice(List<DeviceConfig> device) { - this.device = device; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceStatusInfo.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceStatusInfo.java deleted file mode 100644 index 33a25c2bfe08d..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/DeviceStatusInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -import java.util.List; - -/** - * The {@link DeviceStatusInfo} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class DeviceStatusInfo { - private List<DeviceConfig> device; - - public List<DeviceConfig> getDevice() { - return device; - } - - public void setDevice(List<DeviceConfig> device) { - this.device = device; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/GasUsage.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/GasUsage.java deleted file mode 100644 index bfe01c91437e7..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/GasUsage.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link GasUsage} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class GasUsage { - private Long meterReading; - - public Long getMeterReading() { - return meterReading; - } - - public void setMeterReading(Long meterReading) { - this.meterReading = meterReading; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/PowerUsage.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/PowerUsage.java deleted file mode 100644 index 372ef0bcdb3eb..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/PowerUsage.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link PowerUsage} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class PowerUsage { - private Long meterReading; - private Long meterReadingLow; - private Long value; - - public Long getMeterReading() { - return meterReading; - } - - public void setMeterReading(Long meterReading) { - this.meterReading = meterReading; - } - - public Long getMeterReadingLow() { - return meterReadingLow; - } - - public void setMeterReadingLow(Long meterReadingLow) { - this.meterReadingLow = meterReadingLow; - } - - public Long getValue() { - return value; - } - - public void setValue(Long value) { - this.value = value; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ThermostatInfo.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ThermostatInfo.java deleted file mode 100644 index 62053352cc528..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ThermostatInfo.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link ThermostatInfo} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class ThermostatInfo { - private Long currentSetpoint; - private Long currentDisplayTemp; - private Long currentTemp; - private Long activeState; - private Long programState; - private Long nextState; - private Long currentModulationLevel; - private String burnerInfo; - - public Long getCurrentSetpoint() { - return currentSetpoint; - } - - public void setCurrentSetpoint(Long currentSetpoint) { - this.currentSetpoint = currentSetpoint; - } - - public Long getCurrentDisplayTemp() { - return currentDisplayTemp; - } - - public void setCurrentDisplayTemp(Long currentDisplayTemp) { - this.currentDisplayTemp = currentDisplayTemp; - } - - public Long getCurrentTemp() { - return currentTemp; - } - - public void setCurrentTemp(Long currentTemp) { - this.currentTemp = currentTemp; - } - - public Long getActiveState() { - return activeState; - } - - public void setActiveState(Long activeState) { - this.activeState = activeState; - } - - public Long getProgramState() { - return programState; - } - - public void setProgramState(Long programState) { - this.programState = programState; - } - - public Long getNextState() { - return nextState; - } - - public void setNextState(Long nextState) { - this.nextState = nextState; - } - - public Long getCurrentModulationLevel() { - return currentModulationLevel; - } - - public void setCurrentModulationLevel(Long currentModulationLevel) { - this.currentModulationLevel = currentModulationLevel; - } - - public String getBurnerInfo() { - return burnerInfo; - } - - public void setBurnerInfo(String burnerInfo) { - this.burnerInfo = burnerInfo; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonConnectionException.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonConnectionException.java deleted file mode 100644 index 8e64f33568cef..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonConnectionException.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link ToonConnectionException} class indicates communication issues encountered by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonConnectionException extends Exception { - - private static final long serialVersionUID = -6854850123941151190L; - - public ToonConnectionException(String message) { - super(message); - } - - public ToonConnectionException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonState.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonState.java deleted file mode 100644 index a86e2ed666700..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/api/ToonState.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.api; - -/** - * The {@link ToonState} class defines the json object as received by the api. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonState { - private ThermostatInfo thermostatInfo; - private PowerUsage powerUsage; - private GasUsage gasUsage; - private Boolean success; - private DeviceStatusInfo deviceStatusInfo; - private DeviceConfigInfo deviceConfigInfo; - - public ThermostatInfo getThermostatInfo() { - return thermostatInfo; - } - - public void setThermostatInfo(ThermostatInfo thermostatInfo) { - this.thermostatInfo = thermostatInfo; - } - - public PowerUsage getPowerUsage() { - return powerUsage; - } - - public void setPowerUsage(PowerUsage powerUsage) { - this.powerUsage = powerUsage; - } - - public GasUsage getGasUsage() { - return gasUsage; - } - - public void setGasUsage(GasUsage gasUsage) { - this.gasUsage = gasUsage; - } - - public Boolean getSuccess() { - return success; - } - - public void setSuccess(Boolean success) { - this.success = success; - } - - public DeviceStatusInfo getDeviceStatusInfo() { - return deviceStatusInfo; - } - - public void setDeviceStatusInfo(DeviceStatusInfo deviceStatusInfo) { - this.deviceStatusInfo = deviceStatusInfo; - } - - public DeviceConfigInfo getDeviceConfigInfo() { - return deviceConfigInfo; - } - - public void setDeviceConfigInfo(DeviceConfigInfo deviceConfigInfo) { - this.deviceConfigInfo = deviceConfigInfo; - } - -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/config/ToonBridgeConfiguration.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/config/ToonBridgeConfiguration.java deleted file mode 100644 index 8927ec5817395..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/config/ToonBridgeConfiguration.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.config; - -/** - * The {@link ToonBridgeConfiguration} class defines the configuration properties as used by the bridge. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonBridgeConfiguration { - public String username; - public String password; - public int refreshInterval; -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/discovery/ToonDiscoveryService.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/discovery/ToonDiscoveryService.java deleted file mode 100644 index 2a107cd4278bc..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/discovery/ToonDiscoveryService.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.discovery; - -import static org.openhab.binding.toon.internal.ToonBindingConstants.*; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; -import org.eclipse.smarthome.config.discovery.DiscoveryResult; -import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; -import org.eclipse.smarthome.core.thing.ThingTypeUID; -import org.eclipse.smarthome.core.thing.ThingUID; -import org.openhab.binding.toon.internal.ToonApiClient; -import org.openhab.binding.toon.internal.api.Agreement; -import org.openhab.binding.toon.internal.api.DeviceConfig; -import org.openhab.binding.toon.internal.api.DeviceConfigInfo; -import org.openhab.binding.toon.internal.api.ToonConnectionException; -import org.openhab.binding.toon.internal.api.ToonState; -import org.openhab.binding.toon.internal.handler.ToonBridgeHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ToonDiscoveryService} class is capable of discovering the available displays and plugs - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonDiscoveryService extends AbstractDiscoveryService { - private Logger logger = LoggerFactory.getLogger(ToonDiscoveryService.class); - private static final int SEARCH_TIME = 2; - private ToonBridgeHandler toonBridgeHandler; - - public ToonDiscoveryService(ToonBridgeHandler toonBridgeHandler) { - super(SUPPORTED_DEVICE_THING_TYPES_UIDS, SEARCH_TIME); - this.toonBridgeHandler = toonBridgeHandler; - } - - @Override - public void startScan() { - logger.debug("Toon start scan"); - if (toonBridgeHandler != null && toonBridgeHandler.getApiClient() != null) { - try { - ToonApiClient api = toonBridgeHandler.getApiClient(); - api.logout(); - discoverAgreement(api.getAgreements()); - ToonState state = api.collect(); - discoverPlugs(state.getDeviceConfigInfo()); - } catch (Exception e) { - logger.warn("{}", e.getMessage(), e); - } - } - stopScan(); - } - - private void discoverAgreement(List<Agreement> agreements) - throws IllegalArgumentException, ToonConnectionException { - for (Agreement agreement : agreements) { - ThingUID thingUID = findThingUID(MAIN_THING_TYPE.getId(), agreement.getAgreementId()); - Map<String, Object> properties = new HashMap<>(); - - properties.put(PROPERTY_AGREEMENT_ID, agreement.getAgreementId()); - properties.put(PROPERTY_COMMON_NAME, agreement.getDisplayCommonName()); - properties.put(PROPERTY_ADDRESS, - String.format("%s %s, %s", agreement.getStreet(), agreement.getHouseNumber(), agreement.getCity())); - - String name = String.format("Toon display @ %s %s", agreement.getStreet(), agreement.getHouseNumber()); - - addDiscoveredThing(thingUID, properties, name); - - // only the first agreement is handled at the moment - return; - } - } - - private void discoverPlugs(DeviceConfigInfo info) throws IllegalArgumentException, ToonConnectionException { - if (info == null || info.getDevice() == null) { - return; - } - for (DeviceConfig device : info.getDevice()) { - ThingUID thingUID = findThingUID(PLUG_THING_TYPE.getId(), device.getDevUUID()); - Map<String, Object> properties = new HashMap<>(); - - properties.put(PROPERTY_DEV_TYPE, device.getDevType()); - properties.put(PROPERTY_DEV_UUID, device.getDevUUID()); - - String name = device.getName(); - logger.debug("found plug name:{} type:{} uuid:{}", name, device.getDevType(), device.getDevUUID()); - - addDiscoveredThing(thingUID, properties, name); - } - } - - private void addDiscoveredThing(ThingUID thingUID, Map<String, Object> properties, String displayLabel) { - DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) - .withBridge(toonBridgeHandler.getThing().getUID()).withLabel(displayLabel).build(); - - thingDiscovered(discoveryResult); - } - - private ThingUID findThingUID(String thingType, String thingId) throws IllegalArgumentException { - for (ThingTypeUID supportedThingTypeUID : getSupportedThingTypes()) { - String uid = supportedThingTypeUID.getId(); - - if (uid.equalsIgnoreCase(thingType)) { - return new ThingUID(supportedThingTypeUID, toonBridgeHandler.getThing().getUID(), - thingId.replaceAll("[^a-zA-Z0-9_]", "")); - } - } - - throw new IllegalArgumentException("Unsupported device type discovered: " + thingType); - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/AbstractToonHandler.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/AbstractToonHandler.java deleted file mode 100644 index 4b654a4cc0531..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/AbstractToonHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.handler; - -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.Channel; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; -import org.eclipse.smarthome.core.types.State; -import org.openhab.binding.toon.internal.api.ToonState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link AbstractToonHandler} is the base class for the various Toon handlers. - * - * @author Jorg de Jong - Initial contribution - */ -public abstract class AbstractToonHandler extends BaseThingHandler { - private Logger logger = LoggerFactory.getLogger(AbstractToonHandler.class); - protected ToonBridgeHandler bridgeHandler; - - public AbstractToonHandler(Thing thing) { - super(thing); - } - - protected void updateChannel(String channelName, State state) { - Channel channel = getThing().getChannel(channelName); - if (channel != null) { - updateState(channel.getUID(), state); - } - } - - abstract void updateChannels(ToonState state); - - protected ToonBridgeHandler getToonBridgeHandler() { - if (this.bridgeHandler == null) { - Bridge bridge = getBridge(); - if (bridge == null) { - logger.debug("Required bridge not defined for device {}.", this.getThing().getUID()); - return null; - } - ThingHandler handler = bridge.getHandler(); - if (handler instanceof ToonBridgeHandler) { - this.bridgeHandler = (ToonBridgeHandler) handler; - } else { - logger.debug("No available bridge handler found for device {} bridge {} .", this.getThing().getUID(), - bridge.getUID()); - return null; - } - } - return this.bridgeHandler; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonBridgeHandler.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonBridgeHandler.java deleted file mode 100644 index 120c009b9ce93..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonBridgeHandler.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.handler; - -import static org.eclipse.smarthome.core.thing.ThingStatus.OFFLINE; -import static org.eclipse.smarthome.core.thing.ThingStatus.ONLINE; -import static org.eclipse.smarthome.core.thing.ThingStatusDetail.*; - -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.lang.StringUtils; -import org.eclipse.smarthome.core.thing.Bridge; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.ThingStatusDetail; -import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; -import org.eclipse.smarthome.core.thing.binding.ThingHandler; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.openhab.binding.toon.internal.ToonApiClient; -import org.openhab.binding.toon.internal.api.ToonState; -import org.openhab.binding.toon.internal.config.ToonBridgeConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ToonBridgeHandler} class connects bridges the Toon api and connected displays . - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonBridgeHandler extends BaseBridgeHandler { - private Logger logger = LoggerFactory.getLogger(ToonBridgeHandler.class); - private ToonBridgeConfiguration configuration; - private ToonApiClient apiClient; - - protected ScheduledFuture<?> refreshJob; - - public ToonBridgeHandler(Bridge bridge) { - super(bridge); - } - - @Override - public void initialize() { - logger.debug("Initializing Toon API bridge handler."); - - configuration = getConfigAs(ToonBridgeConfiguration.class); - logger.debug("refresh interval {}", configuration.refreshInterval); - - disposeApiClient(); - apiClient = new ToonApiClient(configuration); - - updateStatus(); - startAutomaticRefresh(); - } - - @Override - public void dispose() { - refreshJob.cancel(true); - disposeApiClient(); - } - - private void startAutomaticRefresh() { - if (refreshJob != null) { - refreshJob.cancel(true); - } - - refreshJob = scheduler.scheduleWithFixedDelay(this::updateChannels, 50, configuration.refreshInterval, - TimeUnit.MILLISECONDS); - } - - public void requestRefresh() { - if (configuration == null) { - return; - } - startAutomaticRefresh(); - } - - private void updateChannels() { - if (getThing().getThings().isEmpty()) { - return; - } - logger.debug("updateChannels"); - try { - ToonState state; - try { - state = apiClient.collect(); - } catch (Exception e) { - updateStatus(OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - return; - } - - // prevent spamming the log file - if (!ONLINE.equals(getThing().getStatus())) { - updateStatus(ONLINE); - } - - for (Thing handler : getThing().getThings()) { - ThingHandler thingHandler = handler.getHandler(); - if (thingHandler instanceof AbstractToonHandler) { - AbstractToonHandler moduleHandler = (AbstractToonHandler) thingHandler; - moduleHandler.updateChannels(state); - } - } - } catch (Exception e) { - logger.debug("updateChannels acting up", e); - } - } - - private void disposeApiClient() { - if (apiClient != null) { - apiClient.logout(); - } - apiClient = null; - } - - private void updateStatus() { - try { - if (configuration == null) { - updateStatus(OFFLINE, CONFIGURATION_ERROR, "Configuration is missing or corrupted"); - } else if (StringUtils.isEmpty(configuration.username)) { - updateStatus(OFFLINE, CONFIGURATION_ERROR, "Username not configured"); - } else if (StringUtils.isEmpty(configuration.password)) { - updateStatus(OFFLINE, CONFIGURATION_ERROR, "Password not configured"); - } else { - getApiClient().login(); - updateStatus(ONLINE); - } - } catch (Exception e) { - updateStatus(OFFLINE, NONE, e.getMessage()); - } - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - if (command == RefreshType.REFRESH) { - requestRefresh(); - } else { - logger.warn("This Bridge can only handle the REFRESH command"); - } - } - - public ToonApiClient getApiClient() { - return apiClient; - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonDisplayHandler.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonDisplayHandler.java deleted file mode 100644 index eb327933c6d73..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonDisplayHandler.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.handler; - -import static org.openhab.binding.toon.internal.ToonBindingConstants.*; - -import java.math.BigDecimal; - -import org.eclipse.smarthome.core.library.types.DecimalType; -import org.eclipse.smarthome.core.library.types.OnOffType; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.ThingStatus; -import org.eclipse.smarthome.core.thing.ThingStatusDetail; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.openhab.binding.toon.internal.api.GasUsage; -import org.openhab.binding.toon.internal.api.PowerUsage; -import org.openhab.binding.toon.internal.api.ThermostatInfo; -import org.openhab.binding.toon.internal.api.ToonConnectionException; -import org.openhab.binding.toon.internal.api.ToonState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ToonDisplayHandler} is responsible for handling commands, which are - * sent to one of the channels. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonDisplayHandler extends AbstractToonHandler { - private Logger logger = LoggerFactory.getLogger(ToonDisplayHandler.class); - - public ToonDisplayHandler(Thing thing) { - super(thing); - } - - private void updateThermostatInfo(ThermostatInfo info) { - if (info == null) { - return; - } - - if (info.getCurrentDisplayTemp() != null) { - BigDecimal d = new BigDecimal(info.getCurrentTemp() / 100.0).setScale(2, BigDecimal.ROUND_HALF_UP); - updateChannel(CHANNEL_TEMPERATURE, new DecimalType(d)); - } - if (info.getCurrentSetpoint() != null) { - BigDecimal d = new BigDecimal(info.getCurrentSetpoint() / 100.0).setScale(2, BigDecimal.ROUND_HALF_UP); - updateChannel(CHANNEL_SETPOINT, new DecimalType(d)); - } - if (info.getCurrentModulationLevel() != null) { - updateChannel(CHANNEL_MODULATION_LEVEL, new DecimalType(info.getCurrentModulationLevel())); - } - if (info.getActiveState() != null) { - updateChannel(CHANNEL_SETPOINT_MODE, new DecimalType(info.getActiveState())); - } - - if (info.getBurnerInfo() != null) { - switch (info.getBurnerInfo()) { - case "1": - updateChannel(CHANNEL_HEATING_SWITCH, OnOffType.ON); - updateChannel(CHANNEL_TAPWATER_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_PREHEAT_SWITCH, OnOffType.OFF); - break; - case "2": - updateChannel(CHANNEL_HEATING_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_TAPWATER_SWITCH, OnOffType.ON); - updateChannel(CHANNEL_PREHEAT_SWITCH, OnOffType.OFF); - break; - case "3": - updateChannel(CHANNEL_HEATING_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_TAPWATER_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_PREHEAT_SWITCH, OnOffType.ON); - break; - default: - updateChannel(CHANNEL_HEATING_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_TAPWATER_SWITCH, OnOffType.OFF); - updateChannel(CHANNEL_PREHEAT_SWITCH, OnOffType.OFF); - } - } - } - - private void updateGasUsage(GasUsage info) { - if (info == null) { - return; - } - - if (info.getMeterReading() != null) { - updateChannel(CHANNEL_GAS_METER_READING, new DecimalType(info.getMeterReading())); - } - } - - private void updatePowerUsage(PowerUsage info) { - if (info == null) { - return; - } - - if (info.getMeterReading() != null) { - updateChannel(CHANNEL_POWER_METER_READING, new DecimalType(info.getMeterReading())); - } - if (info.getMeterReadingLow() != null) { - updateChannel(CHANNEL_POWER_METER_READING_LOW, new DecimalType(info.getMeterReadingLow())); - } - if (info.getValue() != null) { - updateChannel(CHANNEL_POWER_CONSUMPTION, new DecimalType(info.getValue())); - } - } - - @Override - protected void updateChannels(ToonState state) { - logger.debug("Updating channels"); - - // bridge has collected new data samples - // process results - updateThermostatInfo(state.getThermostatInfo()); - updateGasUsage(state.getGasUsage()); - updatePowerUsage(state.getPowerUsage()); - - if (!ThingStatus.ONLINE.equals(getThing().getStatus())) { - updateStatus(ThingStatus.ONLINE); - } - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("handleCommand {} for {}", command, channelUID.getAsString()); - try { - if (command == RefreshType.REFRESH) { - getToonBridgeHandler().requestRefresh(); - return; - } - - switch (channelUID.getId()) { - case CHANNEL_SETPOINT: - if (command instanceof DecimalType) { - BigDecimal setpoint = ((DecimalType) command).toBigDecimal(); - setpoint = setpoint.setScale(2, BigDecimal.ROUND_HALF_UP).movePointRight(2); - getToonBridgeHandler().getApiClient().setSetpoint(setpoint.intValue()); - } - break; - case CHANNEL_SETPOINT_MODE: - if (command instanceof DecimalType) { - DecimalType d = (DecimalType) command; - getToonBridgeHandler().getApiClient().setSetpointMode(d.intValue()); - } - break; - default: - logger.warn("unknown channel:{} / command:{}", channelUID.getAsString(), command); - } - } catch (ToonConnectionException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - } - } - - @Override - public void initialize() { - updateStatus(ThingStatus.ONLINE); - } -} diff --git a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonPlugHandler.java b/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonPlugHandler.java deleted file mode 100644 index f8a8d6f8c1faf..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/java/org/openhab/binding/toon/internal/handler/ToonPlugHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.toon.internal.handler; - -import static org.openhab.binding.toon.internal.ToonBindingConstants.*; - -import java.math.BigDecimal; - -import org.eclipse.smarthome.core.library.types.DecimalType; -import org.eclipse.smarthome.core.library.types.OnOffType; -import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.Thing; -import org.eclipse.smarthome.core.thing.ThingStatus; -import org.eclipse.smarthome.core.thing.ThingStatusDetail; -import org.eclipse.smarthome.core.types.Command; -import org.eclipse.smarthome.core.types.RefreshType; -import org.openhab.binding.toon.internal.api.DeviceConfig; -import org.openhab.binding.toon.internal.api.ToonConnectionException; -import org.openhab.binding.toon.internal.api.ToonState; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The {@link ToonPlugHandler} is responsible for handling commands, which are - * sent to one of the channels. - * - * @author Jorg de Jong - Initial contribution - */ -public class ToonPlugHandler extends AbstractToonHandler { - private Logger logger = LoggerFactory.getLogger(ToonPlugHandler.class); - - public ToonPlugHandler(Thing thing) { - super(thing); - } - - private void updateDevice(DeviceConfig info) { - if (info == null) { - return; - } - - if (info.getIsConnected() != null) { - if (info.getIsConnected() != 0) { - if (!ThingStatus.ONLINE.equals(getThing().getStatus())) { - updateStatus(ThingStatus.ONLINE); - } - } else { - if (!ThingStatus.OFFLINE.equals(getThing().getStatus())) { - updateStatus(ThingStatus.OFFLINE); - } - } - } - - if (info.getCurrentState() != null) { - updateChannel(CHANNEL_SWITCH_BINARY, info.getCurrentState() == 0 ? OnOffType.OFF : OnOffType.ON); - } - if (info.getCurrentUsage() != null) { - BigDecimal d = new BigDecimal(info.getCurrentUsage()).setScale(1, BigDecimal.ROUND_HALF_UP); - updateChannel(CHANNEL_POWER_CONSUMPTION, new DecimalType(d)); - } - } - - @Override - protected void updateChannels(ToonState state) { - logger.debug("Updating channels"); - - // bridge has collect new data samples - String uuid = getThing().getProperties().get(PROPERTY_DEV_UUID); - - // process results - if (state.getDeviceStatusInfo() != null && state.getDeviceStatusInfo().getDevice() != null) { - for (DeviceConfig config : state.getDeviceStatusInfo().getDevice()) { - if (uuid.equals(config.getDevUUID())) { - updateDevice(config); - break; - } - } - } - } - - @Override - public void handleCommand(ChannelUID channelUID, Command command) { - logger.debug("handleCommand {} for {}", command, channelUID.getAsString()); - try { - if (command == RefreshType.REFRESH) { - getToonBridgeHandler().requestRefresh(); - return; - } - - if (CHANNEL_SWITCH_BINARY.equals(channelUID.getId())) { - int value = 0; - if (command instanceof OnOffType) { - value = command == OnOffType.ON ? 1 : 0; - } - if (command instanceof DecimalType) { - DecimalType d = (DecimalType) command; - value = d.intValue(); - } - - getToonBridgeHandler().getApiClient().setPlugState(value, - getThing().getProperties().get(PROPERTY_DEV_UUID)); - } else { - logger.warn("unknown channel:{} / command:{}", channelUID.getAsString(), command); - } - } catch (ToonConnectionException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - } - } - - @Override - public void initialize() { - updateStatus(ThingStatus.ONLINE); - } - -} diff --git a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/binding/binding.xml deleted file mode 100644 index 1a6009cebfff7..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/binding/binding.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="toon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> - - <name>Toon Binding</name> - <description> - The Toon bindings shows among others current room temperature, setpoint, energy and gas usage information. - It can control the setpoint and current program. Connected smart plugs can also be controlled. - </description> - <author>Jorg de Jong</author> - -</binding:binding> diff --git a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/bridge.xml deleted file mode 100644 index de0426f1b746b..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/bridge.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="toon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - <!-- Toon API Bridge --> - <bridge-type id="toonapi"> - <label>Toon Webaccount</label> - <description> - The Toon Webaccount is used to connect to your Toon via the Eneco Service Center and - uses your 'My Eneco' Username and password. - </description> - - <config-description> - <parameter-group name="auth"> - <context>communication</context> - <label>Authentication</label> - <description></description> - </parameter-group> - - <parameter name="username" type="text" required="true" groupName="auth"> - <label>Username</label> - <description>Your Toon Username</description> - <default></default> - </parameter> - <parameter name="password" type="text" required="true" groupName="auth"> - <label>Password</label> - <description>Your Toon Password</description> - <default></default> - </parameter> - - <parameter name="refreshInterval" type="integer" required="false"> - <label>Refresh Interval</label> - <description>The refresh interval to poll Toon (in ms).</description> - <default>30000</default> - <advanced>true</advanced> - </parameter> - </config-description> - </bridge-type> - -</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/channels.xml deleted file mode 100644 index 0d3169a2a40d0..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/channels.xml +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="toon" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - - <channel-type id="temperature"> - <item-type>Number</item-type> - <label>Temperature</label> - <description>Current room temperature</description> - <category>temperature</category> - <state readOnly="true" pattern="%.1f °C"> - </state> - </channel-type> - - <channel-type id="setpoint"> - <item-type>Number</item-type> - <label>Setpoint</label> - <description>Thermostat setpoint</description> - <category>heating</category> - <state min="4.5" max="30" step="0.1" pattern="%.1f °C" readOnly="false" /> - </channel-type> - - <channel-type id="setpointMode"> - <item-type>Number</item-type> - <label>Setpoint Mode</label> - <description>Chosen setpoint mode (Comfort, Active, Sleep, Away)</description> - <category>heating</category> - <state readOnly="false"> - <options> - <option value="-1">Override</option> - <option value="0">Comfort</option> - <option value="1">Active</option> - <option value="2">Sleep</option> - <option value="3">Away</option> - <option value="4">Holiday</option> - </options> - </state> - </channel-type> - - <channel-type id="gasMeterReading" advanced="true"> - <item-type>Number</item-type> - <label>Gas</label> - <description>Current Gas Meter reading in L</description> - <category>gas</category> - <state readOnly="true" pattern="%d" /> - </channel-type> - - <channel-type id="currentMeterReading" advanced="true"> - <item-type>Number</item-type> - <label>Energy</label> - <description>Current energy meter reading in Wh</description> - <category>energy</category> - <state readOnly="true" pattern="%d" /> - </channel-type> - - <channel-type id="powerConsumption"> - <item-type>Number</item-type> - <label>Power</label> - <description>Current power consumption</description> - <category>energy</category> - <state pattern="%.1f W" readOnly="true" /> - </channel-type> - - - <channel-type id="modulationLevel" advanced="true"> - <item-type>Number</item-type> - <label>Modulation Level</label> - <description>Current burner modulation level</description> - <category>heating</category> - <state readOnly="true" pattern="%d %%" /> - </channel-type> - - <channel-type id="heating" advanced="true"> - <item-type>Switch</item-type> - <label>Heating</label> - <description>Indicates if the boiler is burning</description> - <category>fire</category> - <state readOnly="true" /> - </channel-type> - - <channel-type id="tapwater" advanced="true"> - <item-type>Switch</item-type> - <label>Tapwater</label> - <description>Indicates if the boiler is burning</description> - <category>fire</category> - <state readOnly="true" /> - </channel-type> - - <channel-type id="preheat" advanced="true"> - <item-type>Switch</item-type> - <label>Preheat</label> - <description>Indicates if the boiler is burning</description> - <category>fire</category> - <state readOnly="true" /> - </channel-type> - - <!-- Switch Channel --> - <channel-type id="switch_binary" advanced="true"> - <item-type>Switch</item-type> - <label>Switch</label> - <description>Switch the plug on and off</description> - <category>poweroutlet</category> - </channel-type> - -</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/thing-types.xml deleted file mode 100644 index f583ab14e7f2c..0000000000000 --- a/bundles/org.openhab.binding.toon/src/main/resources/ESH-INF/thing/thing-types.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="toon" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - <!-- start --> - <thing-type id="main" listed="false"> - <supported-bridge-type-refs> - <bridge-type-ref id="toonapi" /> - </supported-bridge-type-refs> - - <label>Toon display unit</label> - <description>This represents the Toon display unit.</description> - - <channels> - <channel id="Temperature" typeId="temperature" /> - <channel id="Setpoint" typeId="setpoint" /> - <channel id="SetpointMode" typeId="setpointMode" /> - <channel id="GasMeterReading" typeId="gasMeterReading" /> - <channel id="PowerMeterReading" typeId="currentMeterReading"> - <label>Energy, high rate</label> - </channel> - <channel id="PowerMeterReadingLow" typeId="currentMeterReading"> - <label>Energy, low rate</label> - </channel> - <channel id="PowerConsumption" typeId="powerConsumption" /> - - <channel id="ModulationLevel" typeId="modulationLevel" /> - <channel id="Heating" typeId="heating" /> - <channel id="Tapwater" typeId="tapwater" /> - <channel id="Preheat" typeId="preheat" /> - - </channels> - </thing-type> - - <thing-type id="plug" listed="false"> - <supported-bridge-type-refs> - <bridge-type-ref id="toonapi" /> - </supported-bridge-type-refs> - - <label>Toon plug</label> - <description>A Wall plug controlled via Toon.</description> - - <channels> - <channel id="SwitchBinary" typeId="switch_binary" /> - <channel id="PowerConsumption" typeId="powerConsumption" /> - </channels> - - </thing-type> - -</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tplinksmarthome/NOTICE b/bundles/org.openhab.binding.tplinksmarthome/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/NOTICE +++ b/bundles/org.openhab.binding.tplinksmarthome/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.tplinksmarthome/README.md b/bundles/org.openhab.binding.tplinksmarthome/README.md index a1fda7cea85e0..462ac586247f5 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/README.md +++ b/bundles/org.openhab.binding.tplinksmarthome/README.md @@ -8,57 +8,57 @@ The following TP-Link Smart Devices are supported: ### HS100 Smart Wi-Fi Plug -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS103 Smart Wi-Fi Plug Lite -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS105 Smart Wi-Fi Plug -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS107 Smart Wi-Fi Plug, 2-Outlets -* Switch On/Off Group -* Switch On/Off Outlets -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off Group +* Power On/Off Outlets +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS110 Smart Wi-Fi Plug -* Switch On/Off +* Power On/Off * Energy readings -* Led On/Off -* Wi-Fi signal strength (rssi) +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS200 Smart Wi-Fi Switch -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS210 Smart Wi-Fi Light Switch 3-Way Kit -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### HS220 Smart Wi-Fi Light Switch, Dimmer -* Switch On/Off +* Power On/Off * Adjust the brightness -* Led On/Off -* Wi-Fi signal strength (rssi) +* LED On/Off +* Wi-Fi signal strength (RSSI) Use the brightness channel on the HS220 with a Switch item can be used to switch the device on and off. -It won't change the brightness value. +It will not change the brightness value. The default refresh for switch devices is set to 1 second. So it polls the switch for status changes. If you don't use the switch manually often, you can set it to a higher refresh. @@ -67,153 +67,160 @@ Switching via openHAB activates the switch directly. ### HS300 Smart Wi-Fi Power Strip -* Switch On/Off Group -* Switch On/Off Outlets +* Power On/Off Group +* Power On/Off Outlets * Energy readings Outlets -* Led On/Off -* Wi-Fi signal strength (rssi) +* LED On/Off +* Wi-Fi signal strength (RSSI) ### KB100 Kasa Smart Light Bulb -* Switch On/Off +* Power On/Off * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### KB130 Kasa Multi-color Smart Light Bulb -* Switch On/Off +* Power On/Off * Fine-tune colors * Adjust light appearance from soft white (2500k) to daylight (9000k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching, Brightness and Color is done using the `color` channel. ### KP100 Kasa Wi-Fi Smart Plug - Slim Edition -* Switch On/Off -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off +* LED On/Off +* Wi-Fi signal strength (RSSI) ### KP200 Smart Wi-Fi Power Outlet, 2-Sockets -* Switch On/Off Group -* Switch On/Off Outlets -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off Group +* Power On/Off Outlets +* LED On/Off +* Wi-Fi signal strength (RSSI) + +### KP303 Smart Wi-Fi Power Outlet, 3-Sockets + +* Power On/Off Group +* Power On/Off Outlets +* LED On/Off +* Wi-Fi signal strength (RSSI) ### KP400 Smart Outdoor Plug -* Switch On/Off Group -* Switch On/Off Outlets -* Led On/Off -* Wi-Fi signal strength (rssi) +* Power On/Off Group +* Power On/Off Outlets +* LED On/Off +* Wi-Fi signal strength (RSSI) ### LB100 Smart Wi-Fi LED Bulb with Dimmable Light -* Switch On/Off +* Power On/Off * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### LB110 Smart Wi-Fi LED Bulb with Dimmable Light -* Switch On/Off +* Power On/Off * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### LB120 Smart Wi-Fi LED Bulb with Tunable White Light -* Switch On/Off +* Power On/Off * Adjust light appearance from soft white (2700k) to daylight (6500k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### LB130 Smart Wi-Fi LED Bulb with Color Changing Hue -* Switch On/Off +* Power On/Off * Fine-tune colors * Adjust light appearance from soft white (2500k) to daylight (9000k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching, Brightness and Color is done using the `color` channel. ### LB200 Smart Wi-Fi LED Bulb with Dimmable Light -* Switch On/Off +* Power On/Off * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### LB230 Smart Wi-Fi LED Bulb with Color Changing Hue -* Switch On/Off +* Power On/Off * Fine-tune colors * Adjust light appearance from soft white (2500k) to daylight (9000k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching, Brightness and Color is done using the `color` channel. ### KL110 Smart Wi-Fi LED Bulb with Dimmable Light -* Switch On/Off +* Power On/Off * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### KL120 Smart Wi-Fi LED Bulb with Tunable White Light -* Switch On/Off +* Power On/Off * Adjust light appearance from soft white (2700k) to daylight (6500k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching and Brightness is done using the `brightness` channel. ### KL130 Smart Wi-Fi LED Bulb with Color Changing Hue -* Switch On/Off +* Power On/Off * Fine-tune colors * Adjust light appearance from soft white (2500k) to daylight (9000k) * Adjust the brightness * Actual power usage -* Wi-Fi signal strength (rssi) +* Wi-Fi signal strength (RSSI) Switching, Brightness and Color is done using the `color` channel. ### RE270K AC750 Wi-Fi Range Extender with Smart Plug -* Switch On/Off (readonly) -* Wi-Fi signal strength (rssi) +* Power On/Off (readonly) +* Wi-Fi signal strength (RSSI) ### RE370K AC1200 Wi-Fi Range Extender with Smart Plug -* Switch On/Off (readonly) -* Wi-Fi signal strength (rssi) +* Power On/Off (readonly) +* Wi-Fi signal strength (RSSI) -It's not possible to set the switch state on the Range Extender. -This is because it's not known what command to send to the device to make this possible. +It is not possible to set the switch state on the Range Extender. +This is because it is not known what command to send to the device to make this possible. ## Prerequisites @@ -223,8 +230,8 @@ This can be done using the TP-Link provided mobile app Kasa. ## Discovery Devices can be auto discovered in the same local network as the openHAB application. -It's possible to connect to devices on a different network, but these must be added manually by ipAddress. -It's not possible to connect to devices on a different network using `deviceId` as configuration. +It is possible to connect to devices on a different network, but these must be added manually by `ipAddress`. +It is not possible to connect to devices on a different network using `deviceId` as configuration. ## Thing Configuration @@ -232,18 +239,22 @@ The thingId is the product type in lower case. For example `HS100` has thingId ` The thing can be configured by `ipAddress` or by `deviceId`. If the one of them is used the other is automatically set by the binding. -When manually configured it's preferred to set the `deviceId` because if the ip address of the device would change this will be automatically updated. +When manually configured it is preferred to set the `deviceId` because if the ip address of the device would change this will be automatically updated. +The `deviceId` is the unique identifier each TP-Link device has. +The `deviceId` can be seen when using discovery in openHAB. +Discovery will set the `deviceId` automatically. + Using a configuration with `deviceId` depends on the discovery service of the binding. The binding supports background discovery and this will update the ip address in case it changes within a minute. With background discovery disabled the ip address, which is needed to communicate with the device, needs to be set by starting a manual discovery. -It won't update the ip address if background discovery is disabled and the ip address of the device changes. +It will not update the ip address if background discovery is disabled and the ip address of the device changes. Manually starting a discovery can also be used to set the ip address directly instead of waiting for the 1 minute background discovery refresh period. The thing has the following configuration parameters: | Parameter | Description | |--------------------|----------------------------------------------------------------------------------------------| -| deviceId | The id of the device. | +| deviceId | The TP-Link id of the device. | | ipAddress | IP Address of the device. | | refresh | Refresh interval in seconds. Optional. The default is 30 seconds, and 1 second for switches. | | transitionPeriod | Duration of state changes in milliseconds, only for light bulbs, default 0. | @@ -254,19 +265,19 @@ Either `deviceId` or `ipAddress` must be set. All devices support some of the following channels: -| Channel Type ID | Item Type | Description | Thing types supporting this channel | -|---------------------|--------------------------|----------------------------------------------------|---------------------------------------------------------------------------------------------| -| switch | Switch | Switch the Smart Home device on or off. | HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS300, KP100, KP200, KP400, RE270K, RE370K | -| brightness | Dimmer | Set the brightness of Smart Home device or dimmer. | HS220, KB100, KL110, KL120, LB100, LB110, LB120, LB200 | -| colorTemperature | Dimmer | Set the color temperature in percentage. | KB130, KL120, KL130, LB120, LB130, LB230 | -| colorTemperatureAbs | Number | Set the color temperature in Kelvin. | KB130, KL120, KL130, LB120, LB130, LB230 | -| color | Color | Set the color of the Smart Home light. | KB130, KL130, LB130, LB230 | -| power | Number:Power | Actual energy usage in Watt. | HS110, HS300, KLxxx, LBxxx | -| eneryUsage | Number:Energy | Energy Usage in kWh. | HS110, HS300 | -| current | Number:ElectricCurrent | Actual current usage in Ampere. | HS110, HS300 | -| voltage | Number:ElectricPotential | Actual voltage usage in Volt. | HS110, HS300 | -| led | Switch | Switch the status led on the device on or off. | HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS220, HS300, KP100, KP200, KP400 | -| rssi | Number:Power | Wi-Fi signal strength indicator in dBm. | All | +| Channel Type ID | Item Type | Description | Thing types supporting this channel | +|---------------------|--------------------------|------------------------------------------------|----------------------------------------------------------------------------------------------------| +| switch | Switch | Power the device on or off. | HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS300, KP100, KP200, KP303, KP400, RE270K, RE370K | +| brightness | Dimmer | Set the brightness of device or dimmer. | HS220, KB100, KL110, KL120, LB100, LB110, LB120, LB200 | +| colorTemperature | Dimmer | Set the color temperature in percentage. | KB130, KL120, KL130, LB120, LB130, LB230 | +| colorTemperatureAbs | Number | Set the color temperature in Kelvin. | KB130, KL120, KL130, LB120, LB130, LB230 | +| color | Color | Set the color of the light. | KB130, KL130, LB130, LB230 | +| power | Number:Power | Actual energy usage in Watt. | HS110, HS300, KLxxx, LBxxx | +| eneryUsage | Number:Energy | Energy Usage in kWh. | HS110, HS300 | +| current | Number:ElectricCurrent | Actual current usage in Ampere. | HS110, HS300 | +| voltage | Number:ElectricPotential | Actual voltage usage in Volt. | HS110, HS300 | +| led | Switch | Switch the status LED on the device on or off. | HS100, HS103, HS105, HS107, HS110, HS200, HS210, HS220, HS300, KP100, KP303, KP200, KP400 | +| rssi | Number:Power | Wi-Fi signal strength indicator in dBm. | All | The outlet devices (HS107, HS300, KP200, KP400) have group channels. This means the channel is prefixed with the group id. @@ -274,14 +285,14 @@ The following group ids are available: | Group ID | Description | |-------------------|-------------------------------------------------------------------------------------------------------| -| groupSwitch | General channels. e.g. `groupSwitch#switch` | +| groupSwitch | Group id for all general channels. e.g. `groupSwitch#switch` | | outlet<number> | The outlet to control. <number> is the number of the outlet (starts with 1). e.g. `outlet1#switch` | ### Channel Refresh When the thing receives a `RefreshType` command the channel state is updated from an internal cache. This cache is updated per refresh interval as configured in the thing. -However for some use cases it's preferable to set the refresh interval higher than the default. +However for some use cases it is preferable to set the refresh interval higher than the default. For example for switches the 1 second refresh interval may cause a burden to the network traffic. Therefore if the refresh interval for switches is set to a value higher than 5 seconds, and for the other devices higher than 1 minute. Than the a `RefreshType` command will fetch the device state and update the internal cache. diff --git a/bundles/org.openhab.binding.tplinksmarthome/pom.xml b/bundles/org.openhab.binding.tplinksmarthome/pom.xml index ab45f565443a6..975ab9ede0df6 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/pom.xml +++ b/bundles/org.openhab.binding.tplinksmarthome/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tplinksmarthome</artifactId> diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/feature/feature.xml b/bundles/org.openhab.binding.tplinksmarthome/src/main/feature/feature.xml index 162bd2c62fd05..ea22be47f8643 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tplinksmarthome-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tplinksmarthome" description="TP-Link Smart Home Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Commands.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Commands.java index 59594c3b437f1..d46ff9d45b0e7 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Commands.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Commands.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Connection.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Connection.java index 76076d84758c8..732f91301bfb2 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Connection.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/Connection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -33,8 +33,9 @@ public class Connection { public static final int TP_LINK_SMART_HOME_PORT = 9999; + private static final int SOCKET_TIMEOUT_MILLISECONDS = 3_000; - private Logger logger = LoggerFactory.getLogger(Connection.class); + private final Logger logger = LoggerFactory.getLogger(Connection.class); private @Nullable String ipAddress; @@ -43,7 +44,7 @@ public class Connection { * * @param ipAddress ip address of the connection */ - public Connection(@Nullable String ipAddress) { + public Connection(@Nullable final String ipAddress) { this.ipAddress = ipAddress; } @@ -52,7 +53,7 @@ public Connection(@Nullable String ipAddress) { * * @param ipAddress The ip address to connect to */ - public void setIpAddress(String ipAddress) { + public void setIpAddress(final String ipAddress) { this.ipAddress = ipAddress; } @@ -63,7 +64,7 @@ public void setIpAddress(String ipAddress) { * @return decrypted returned json result from the device * @throws IOException exception in case device not reachable */ - public String sendCommand(String command) throws IOException { + public synchronized String sendCommand(final String command) throws IOException { logger.trace("Executing command: {}", command); try (Socket socket = createSocket(); final OutputStream outputStream = socket.getOutputStream()) { outputStream.write(CryptUtil.encryptWithLength(command)); @@ -81,7 +82,7 @@ public String sendCommand(String command) throws IOException { * @return decrypted result * @throws IOException exception in case device not reachable */ - private String readReturnValue(Socket socket) throws IOException { + private String readReturnValue(final Socket socket) throws IOException { try (InputStream is = socket.getInputStream()) { return CryptUtil.decryptWithLength(is); } @@ -92,12 +93,15 @@ private String readReturnValue(Socket socket) throws IOException { * * @return new Socket instance * @throws UnknownHostException exception in case the host could not be determined - * @throws IOException exception in case device not reachable + * @throws IOException exception in case device not reachable */ protected Socket createSocket() throws UnknownHostException, IOException { if (ipAddress == null) { throw new IOException("Ip address not set. Wait for discovery or manually trigger discovery process."); } - return new Socket(ipAddress, TP_LINK_SMART_HOME_PORT); + final Socket socket = new Socket(ipAddress, TP_LINK_SMART_HOME_PORT); + + socket.setSoTimeout(SOCKET_TIMEOUT_MILLISECONDS); + return socket; } } diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/CryptUtil.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/CryptUtil.java index a861c12f05abe..8b9789404ee3d 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/CryptUtil.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/CryptUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import org.eclipse.jdt.annotation.NonNullByDefault; @@ -72,15 +73,16 @@ public static String decryptWithLength(InputStream inputStream) throws IOExcepti * @throws IOException exception in case device not reachable */ private static String decrypt(InputStream inputStream, int length) throws IOException { - StringBuilder sb = new StringBuilder(); + final byte[] decryptedData = new byte[length]; int in; int key = KEY; - while (sb.length() < length && (in = inputStream.read()) != -1) { - int nextKey = in; - sb.append((char) (in ^ key)); + int i = 0; + while (i < length && (in = inputStream.read()) != -1) { + final int nextKey = in; + decryptedData[i++] = (byte) (in ^ key); key = nextKey; } - return sb.toString(); + return new String(decryptedData, StandardCharsets.UTF_8); } /** diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollector.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollector.java index 5dbfcc15f5ab8..6a32d71b77f1c 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollector.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkIpAddressService.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkIpAddressService.java index 91e7d7992131f..ba86a33eb368e 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkIpAddressService.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkIpAddressService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeBindingConstants.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeBindingConstants.java index aae31bdfcc925..fde0466e62bb2 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeBindingConstants.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeConfiguration.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeConfiguration.java index 4bb52c98fe5b3..db51ec7c25002 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeConfiguration.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryService.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryService.java index 3a2f1e94aca51..aa88fafe9b9af 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryService.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactory.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactory.java index bd255a4b758db..142146896a83a 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactory.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -88,7 +88,7 @@ protected ThingHandler createHandler(Thing thing) { device = new RangeExtenderDevice(); break; case STRIP: - device = new PowerStripDevice(thingTypeUID); + device = new PowerStripDevice(type); break; default: return null; diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java index 2c8080890f00e..e5c6856aac601 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeThingType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -60,10 +60,11 @@ public enum TPLinkSmartHomeThingType { HS220("hs220", DeviceType.DIMMER), // Power Strip Thing Type UIDs. - HS107("hs107", DeviceType.STRIP), - HS300("hs300", DeviceType.STRIP), - KP200("kp200", DeviceType.STRIP), - KP400("kp400", DeviceType.STRIP), + HS107("hs107", DeviceType.STRIP, 2), + HS300("hs300", DeviceType.STRIP, 6), + KP200("kp200", DeviceType.STRIP, 2), + KP303("kp303", DeviceType.STRIP, 3), + KP400("kp400", DeviceType.STRIP, 2), // Range Extender Thing Type UIDs RE270K("re270", DeviceType.RANGE_EXTENDER), @@ -91,12 +92,18 @@ public enum TPLinkSmartHomeThingType { private static final List<TPLinkSmartHomeThingType> BULB_WITH_TEMPERATURE_COLOR_2 = Stream .of(KB130, KL130, LB130, LB230).collect(Collectors.toList()); - private ThingTypeUID thingTypeUID; - private DeviceType type; + private final ThingTypeUID thingTypeUID; + private final DeviceType type; + private final int sockets; TPLinkSmartHomeThingType(final String name, final DeviceType type) { + this(name, type, 0); + } + + TPLinkSmartHomeThingType(final String name, final DeviceType type, int sockets) { thingTypeUID = new ThingTypeUID(TPLinkSmartHomeBindingConstants.BINDING_ID, name); this.type = type; + this.sockets = sockets; } /** @@ -113,6 +120,13 @@ public ThingTypeUID thingTypeUID() { return thingTypeUID; } + /** + * @return Returns the number of sockets. Only for Strip devices. + */ + public int getSockets() { + return sockets; + } + /** * Returns true if the given {@link ThingTypeUID} matches a device that is a bulb with color temperature ranges 1 * (2700 to 6500k). diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDevice.java index a1ed56e5c256e..4ce065c00e539 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceState.java index f9db4262fc1f2..59030d23c80e1 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDevice.java index b2566119c30ce..505148a606fb0 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDevice.java index 2af74eda497a0..4e600d9a6304b 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDevice.java index 640991ebd639c..1271b142549d8 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -13,7 +13,6 @@ package org.openhab.binding.tplinksmarthome.internal.device; import static org.openhab.binding.tplinksmarthome.internal.TPLinkSmartHomeBindingConstants.*; -import static org.openhab.binding.tplinksmarthome.internal.TPLinkSmartHomeThingType.HS300; import java.io.IOException; import java.util.ArrayList; @@ -22,11 +21,12 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.ChannelUID; -import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.tplinksmarthome.internal.Commands; +import org.openhab.binding.tplinksmarthome.internal.TPLinkSmartHomeThingType; import org.openhab.binding.tplinksmarthome.internal.model.Realtime; import org.openhab.binding.tplinksmarthome.internal.model.Sysinfo.Outlet; import org.slf4j.Logger; @@ -45,14 +45,9 @@ public class PowerStripDevice extends EnergySwitchDevice { private final List<@Nullable Realtime> realTimeCacheList; private final List<@Nullable String> childIds; - public PowerStripDevice(ThingTypeUID thingTypeUID) { - final int nrOfSockets; + public PowerStripDevice(final TPLinkSmartHomeThingType type) { + final int nrOfSockets = type.getSockets(); - if (HS300.is(thingTypeUID)) { - nrOfSockets = 6; - } else { - nrOfSockets = 2; - } realTimeCacheList = new ArrayList<>(nrOfSockets); childIds = new ArrayList<>(Collections.nCopies(nrOfSockets, "")); } @@ -63,7 +58,7 @@ public String getUpdateCommand() { } @Override - public void refreshedDeviceState(@Nullable DeviceState deviceState) { + public void refreshedDeviceState(@Nullable final DeviceState deviceState) { if (deviceState != null) { for (int i = 0; i < childIds.size(); i++) { childIds.set(i, deviceState.getSysinfo().getChildren().get(i).getId()); @@ -73,7 +68,14 @@ public void refreshedDeviceState(@Nullable DeviceState deviceState) { } @Override - public State updateChannel(ChannelUID channelUid, DeviceState deviceState) { + protected State getOnOffState(final DeviceState deviceState) { + // Global On/Off state is determined by the combined state of all sockets. If 1 socket is on, the state is on. + return OnOffType + .from(deviceState.getSysinfo().getChildren().stream().anyMatch(e -> OnOffType.ON.equals(e.getState()))); + } + + @Override + public State updateChannel(final ChannelUID channelUid, final DeviceState deviceState) { final int idx = channelToIndex(channelUid); if (idx >= 0 && idx < childIds.size()) { @@ -97,7 +99,7 @@ public State updateChannel(ChannelUID channelUid, DeviceState deviceState) { } @Override - protected @Nullable String getChildId(ChannelUID channelUid) { + protected @Nullable String getChildId(final ChannelUID channelUid) { final int idx = channelToIndex(channelUid); return idx >= 0 && idx < childIds.size() ? childIds.get(idx) : null; @@ -111,15 +113,15 @@ private int channelToIndex(final ChannelUID channelUid) { : 0) - 1; } - private @Nullable Realtime refreshCache(int idx) { + private @Nullable Realtime refreshCache(final int idx) { try { final String childId = childIds.get(idx); return childId == null ? null : commands.getRealtimeResponse(connection.sendCommand(Commands.getRealtimeWithContext(childId))); - } catch (IOException e) { + } catch (final IOException e) { return null; - } catch (RuntimeException e) { + } catch (final RuntimeException e) { logger.debug( "Obtaining realtime data for channel-'{}' unexpectedly crashed. If this keeps happening please report: ", idx, e); diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDevice.java index 7956067ea0f8c..2ca3d0c2cd041 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SmartHomeDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SmartHomeDevice.java index 10b55b24030f0..f49afe9f9ee3e 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SmartHomeDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SmartHomeDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDevice.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDevice.java index bfcaa6e46d7a1..1be04813a1ac3 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDevice.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandler.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandler.java index 55711789ec1e8..b5d021268a8b0 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandler.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ContextState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ContextState.java index 2505abf96a537..7bbff3916a274 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ContextState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ContextState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ErrorResponse.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ErrorResponse.java index 3609070a9dbb6..1c7a5dc847d89 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ErrorResponse.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/ErrorResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetRealtime.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetRealtime.java index e83640941fe55..c1dd6a4bb37af 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetRealtime.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetRealtime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetSysinfo.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetSysinfo.java index e0956c5e80faf..1cc4e6466b20e 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetSysinfo.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GetSysinfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GsonUtil.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GsonUtil.java index bc6bc3d1088c0..dc73232784f56 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GsonUtil.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/GsonUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/HasErrorResponse.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/HasErrorResponse.java index bb7724c86313b..917e179a25e49 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/HasErrorResponse.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/HasErrorResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/LightState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/LightState.java index 61a273eaf18f7..c962dfcb6a1f6 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/LightState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/LightState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Realtime.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Realtime.java index 6127c379aae8f..9e1963bc217a3 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Realtime.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Realtime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetBrightness.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetBrightness.java index a880a26b935ac..cd9c18d97780e 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetBrightness.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetBrightness.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetLedOff.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetLedOff.java index 6093859d71a25..ff424abe86788 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetLedOff.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetLedOff.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetRelayState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetRelayState.java index 5033ccffe50d5..ed506af2ecef5 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetRelayState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetRelayState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetSwitchState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetSwitchState.java index 69805f6220ea4..80b8710af3330 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetSwitchState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/SetSwitchState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Sysinfo.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Sysinfo.java index 5e28ce3189d02..11ea0363657c2 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Sysinfo.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/Sysinfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightState.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightState.java index 3debe0dc6af7a..69c782abfd949 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightState.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightStateResponse.java b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightStateResponse.java index d1d2ac37b02ec..40634cf02d72f 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightStateResponse.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/java/org/openhab/binding/tplinksmarthome/internal/model/TransitionLightStateResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/config/config.xml index 51629624a4bcd..29a0876c0a1f8 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/config/config.xml @@ -16,13 +16,13 @@ <description>The id of the device.</description> </parameter> <parameter name="transitionPeriod" type="integer" min="0"> - <label>Transition period</label> + <label>Transition Period</label> <description>Time the transition to the new state takes in milliseconds.</description> <unitLabel>milliseconds</unitLabel> <default>0</default> </parameter> <parameter name="refresh" type="integer" min="1"> - <label>Refresh rate</label> + <label>Refresh Rate</label> <description>Refresh of device state in seconds.</description> <unitLabel>seconds</unitLabel> <default>30</default> @@ -40,7 +40,7 @@ <description>The id of the device.</description> </parameter> <parameter name="refresh" type="integer" min="1"> - <label>Refresh rate</label> + <label>Refresh Rate</label> <description>Refresh of device state in seconds.</description> <unitLabel>seconds</unitLabel> <default>30</default> @@ -58,7 +58,7 @@ <description>The id of the device.</description> </parameter> <parameter name="refresh" type="integer" min="1"> - <label>Refresh rate</label> + <label>Refresh Rate</label> <description>Refresh of device state in seconds.</description> <unitLabel>seconds</unitLabel> <default>1</default> diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KL110.xml b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KL110.xml index acc27164499cd..81a0c507cb4d7 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KL110.xml +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KL110.xml @@ -4,7 +4,7 @@ xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - <thing-type id="kl10"> + <thing-type id="kl110"> <label>KL110</label> <description>TP-Link KL110 Smart Wi-Fi LED Bulb with Brightness</description> <category>Lightbulb</category> diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KP303.xml b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KP303.xml new file mode 100644 index 0000000000000..4b9601a8a2fb0 --- /dev/null +++ b/bundles/org.openhab.binding.tplinksmarthome/src/main/resources/ESH-INF/thing/KP303.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="tplinksmarthome" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="kp303"> + <label>KP303</label> + <description>TP-Link HS300 Smart Wi-Fi Power Strip, 3-Outlets</description> + <category>PowerOutlet</category> + + <channel-groups> + <channel-group id="group" typeId="switch-group" /> + <channel-group id="outlet1" typeId="switch-outlet"> + <label>Outlet 1</label> + </channel-group> + <channel-group id="outlet2" typeId="switch-outlet"> + <label>Outlet 2</label> + </channel-group> + <channel-group id="outlet3" typeId="switch-outlet"> + <label>Outlet 3</label> + </channel-group> + </channel-groups> + + <representation-property>deviceId</representation-property> + + <config-description-ref uri="thing-type:device:plug" /> + </thing-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/ChannelUIDConstants.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/ChannelUIDConstants.java index 5a24fe1084079..ec144dc375bc4 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/ChannelUIDConstants.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/ChannelUIDConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/CryptUtilTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/CryptUtilTest.java index e37f0a09f3312..8c7f1b3248bc5 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/CryptUtilTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/CryptUtilTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollectorTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollectorTest.java index 19b6e3bcb189c..fa7f3e5eb24a1 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollectorTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/PropertiesCollectorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryServiceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryServiceTest.java index ea6675d613e9d..9b36d3b9ab5f5 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactoryTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactoryTest.java index 182a5dcc5a75e..63df313e60824 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactoryTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/TPLinkSmartHomeHandlerFactoryTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDeviceTest.java index 1e71739e15f54..a54d5fd362993 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/BulbDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceTestBase.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceTestBase.java index 870a625a644fe..02a080dc27bc2 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceTestBase.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DeviceTestBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -97,7 +97,6 @@ protected void setSocketReturnAssert(String... responseFilenames) throws IOExcep return new ByteArrayInputStream(CryptUtil.encryptWithLength(stateResponse)); }).when(socket).getInputStream(); - } /** diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDeviceTest.java index 7c3ef0ea0aaf5..dda86aabfc669 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/DimmerDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EncodingTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EncodingTest.java new file mode 100644 index 0000000000000..7ce3f4cb61457 --- /dev/null +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EncodingTest.java @@ -0,0 +1,39 @@ +/** + * 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.tplinksmarthome.internal.device; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; + +import java.io.IOException; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.junit.Test; + +/** + * Test class to test if text read from the device is correctly decoded to handle special characters. + * + * @author Hilbrand Bouwkamp - Initial contribution + */ +@NonNullByDefault +public class EncodingTest extends DeviceTestBase<SwitchDevice> { + + public EncodingTest() throws IOException { + super(new SwitchDevice(), "encoding_test"); + } + + @Test + public void testCorrectDecodingOfText() throws IOException { + assertThat("Alias incorrectly decoded", deviceState.getSysinfo().getAlias(), is("MyßmärtPlug")); + } +} diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDeviceTest.java index b9965852dd63f..98afb1e46c1df 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/EnergySwitchDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,6 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.smarthome.core.library.types.QuantityType; -import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.junit.Test; diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDeviceTest.java index dcc94e909275a..04a30e56dcfe3 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/PowerStripDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -52,7 +52,7 @@ public class PowerStripDeviceTest extends DeviceTestBase<PowerStripDevice> { .collect(Collectors.toList()).toArray(new String[0]); public PowerStripDeviceTest() throws IOException { - super(new PowerStripDevice(HS300.thingTypeUID()), "hs300_get_sysinfo_response"); + super(new PowerStripDevice(HS300), "hs300_get_sysinfo_response"); } @Override diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDeviceTest.java index 01c72ae239a9b..fcea0700f06c8 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/RangeExtenderDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDeviceTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDeviceTest.java index c045a4c319e27..82325af5ce716 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDeviceTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/device/SwitchDeviceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandlerTest.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandlerTest.java index 0abbbb8556e24..77b61a6dbe805 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandlerTest.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/handler/SmartHomeHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -74,7 +74,7 @@ public class SmartHomeHandlerTest { public void setUp() throws IOException { initMocks(this); configuration.put(CONFIG_IP, "localhost"); - configuration.put(CONFIG_REFRESH, 0); + configuration.put(CONFIG_REFRESH, 1); when(thing.getConfiguration()).thenReturn(configuration); when(smartHomeDevice.getUpdateCommand()).thenReturn(Commands.getSysinfo()); when(connection.sendCommand(Commands.getSysinfo())) diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/model/ModelTestUtil.java b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/model/ModelTestUtil.java index cbf44bfc425c1..8a7f24fb5ee70 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/model/ModelTestUtil.java +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/java/org/openhab/binding/tplinksmarthome/internal/model/ModelTestUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -46,7 +46,6 @@ private ModelTestUtil() { */ public static <T> T jsonFromFile(String filename, Class<T> clazz) throws IOException { return GSON.fromJson(readJson(filename), clazz); - } /** diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/encoding_test.json b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/encoding_test.json new file mode 100644 index 0000000000000..2741af0bb487c --- /dev/null +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/encoding_test.json @@ -0,0 +1,29 @@ +{ + "system": { + "get_sysinfo": { + "err_code": 0, + "sw_ver": "1.0.8 Build 151101 Rel.24452", + "hw_ver": "1.0", + "model": "HS100(EU)", + "deviceId": "DEVICEID_HERE", + "hwId": "HWID_HERE", + "oemId": "OEMID_HERE", + "alias": "MyßmärtPlug", + "active_mode": "schedule", + "rssi": -53, + "type": "smartplug", + "mac": "MAC_ADD_HERE", + "fwId": "FWID_HERE", + "dev_name": "Wi-Fi Smart Plug", + "icon_hash": "", + "relay_state": 1, + "on_time": 451, + "feature": "TIM", + "updating": 0, + "led_off": 0, + "latitude": 0.0, + "longitude": 0.0, + "is_factory": false + } + } +} diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_off.json b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_off.json index 1b8cfee69ee66..190e2e4febc3c 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_off.json +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_off.json @@ -47,4 +47,4 @@ "err_code": 0 } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_on.json b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_on.json index 37c2744eb3e4f..ce4c427c520bc 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_on.json +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/hs220_get_sysinfo_response_on.json @@ -47,4 +47,4 @@ "err_code": 0 } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/rangeextender_get_sysinfo_response.json b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/rangeextender_get_sysinfo_response.json index ee7c72cdd25d8..83ae41530c21e 100644 --- a/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/rangeextender_get_sysinfo_response.json +++ b/bundles/org.openhab.binding.tplinksmarthome/src/test/resources/org/openhab/binding/tplinksmarthome/internal/model/rangeextender_get_sysinfo_response.json @@ -46,4 +46,4 @@ } } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.binding.tradfri/NOTICE b/bundles/org.openhab.binding.tradfri/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.tradfri/NOTICE +++ b/bundles/org.openhab.binding.tradfri/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.tradfri/README.md b/bundles/org.openhab.binding.tradfri/README.md index af4c9fe0b3a9c..70a0b928f993d 100644 --- a/bundles/org.openhab.binding.tradfri/README.md +++ b/bundles/org.openhab.binding.tradfri/README.md @@ -41,7 +41,8 @@ For first pairing - the gateway requires a `host` parameter for the hostname or Optionally, a `port` can be configured, but any standard gateway uses the default port 5684. The gateway requires at least firmware version 1.2.42 to connect to this binding. -The `code` is used during the initialization for retrieving unique identity and pre-shared key from the gateway and then it's discarded from the configuration. The newly created authentication data is stored in advanced parameters `identity` and `preSharedKey`. +The `code` is used during the initialization for retrieving unique identity and pre-shared key from the gateway and then it is discarded from the configuration. +The newly created authentication data is stored in advanced parameters `identity` and `preSharedKey`. On each initialization if the code is present in the thing configuration - the `identity` and `preSharedKey` are recreated and the `code` is again discarded. The devices require only a single (integer) parameter, which is their instance id. Unfortunately, this is not displayed anywhere in the IKEA app, but it seems that they are sequentially numbered starting with 65537 for the first device. If in doubt, use the auto-discovered things to find out the correct instance ids. diff --git a/bundles/org.openhab.binding.tradfri/pom.xml b/bundles/org.openhab.binding.tradfri/pom.xml index f2a7954278ce7..8b2dcfa84d116 100644 --- a/bundles/org.openhab.binding.tradfri/pom.xml +++ b/bundles/org.openhab.binding.tradfri/pom.xml @@ -1,29 +1,15 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.tradfri</artifactId> <name>openHAB Add-ons :: Bundles :: TRÃ…DFRI Binding</name> - <dependencies> - <dependency> - <groupId>org.eclipse.californium</groupId> - <artifactId>californium-core</artifactId> - <version>1.0.7</version> - </dependency> - <dependency> - <groupId>org.eclipse.californium</groupId> - <artifactId>scandium</artifactId> - <version>1.0.7</version> - </dependency> - </dependencies> - </project> diff --git a/bundles/org.openhab.binding.tradfri/src/main/feature/feature.xml b/bundles/org.openhab.binding.tradfri/src/main/feature/feature.xml index dd7f59b10b5c2..9eed501971973 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.tradfri/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.tradfri-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-tradfri" description="TRÃ…DFRI Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/CoapCallback.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/CoapCallback.java index 9baab7e4c7db2..eaa6c942f9e82 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/CoapCallback.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/CoapCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/DeviceUpdateListener.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/DeviceUpdateListener.java index e3e2f9a8621cb..f90f7903be185 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/DeviceUpdateListener.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/DeviceUpdateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriBindingConstants.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriBindingConstants.java index 44320be464729..a5776df916f57 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriBindingConstants.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapClient.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapClient.java index fc496b27d3fd4..19de4dc245f0a 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapClient.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,7 +35,7 @@ @NonNullByDefault public class TradfriCoapClient extends CoapClient { - private static final int TIMEOUT = 2000; + private static final long TIMEOUT = 2000; private static final int DEFAULT_DELAY_MILLIS = 600; private final Logger logger = LoggerFactory.getLogger(TradfriCoapClient.class); private final LinkedList<PayloadCallbackPair> commandsQueue = new LinkedList<>(); diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapEndpoint.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapEndpoint.java deleted file mode 100644 index 457169028a030..0000000000000 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapEndpoint.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.tradfri.internal; - -import org.eclipse.californium.core.network.CoapEndpoint; -import org.eclipse.californium.core.network.config.NetworkConfig; -import org.eclipse.californium.scandium.DTLSConnector; -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class wraps {@link CoapEndpoint} from californium for the sole purpose of adding some debug logging to it in - * order to figure out when the endpoint is destroyed. - * See https://github.com/eclipse/californium/pull/452#issuecomment-341703735 - * - * @author Kai Kreuzer - Initial contribution - */ -@NonNullByDefault -public class TradfriCoapEndpoint extends CoapEndpoint { - - private final Logger logger = LoggerFactory.getLogger(TradfriCoapEndpoint.class); - - public TradfriCoapEndpoint(DTLSConnector dtlsConnector, NetworkConfig standard) { - super(dtlsConnector, standard); - } - - @Override - public synchronized void destroy() { - if (logger.isDebugEnabled()) { - logger.debug("Destroying CoAP endpoint.", new RuntimeException("Endpoint destroyed")); - } - super.destroy(); - } -} diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapHandler.java index 258fbc8ec1ae3..b942f2adbad5b 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriCoapHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriColor.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriColor.java index b46b37544f933..4425353480bdc 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriColor.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriColor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriHandlerFactory.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriHandlerFactory.java index cec9b265aa9c0..1e2e72778faab 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriHandlerFactory.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/TradfriHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriDeviceConfig.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriDeviceConfig.java index 9576b6d9a1319..4f489c281ac0c 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriDeviceConfig.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriGatewayConfig.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriGatewayConfig.java index 59cab382d4673..26318384ecbdf 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriGatewayConfig.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/config/TradfriGatewayConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java index 17d941a46c621..d4e6fe6d59366 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryService.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryService.java index cb1e613539e94..98279e6e48a9d 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryService.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -57,7 +57,7 @@ public class TradfriDiscoveryService extends AbstractDiscoveryService implements "FLOALT panel WS 30x30", "FLOALT panel WS 60x60", "FLOALT panel WS 30x90", "TRADFRI bulb E12 WS opal 400lm" }; - private static final String COLOR_MODELS_IDENTIFIER = "CWS"; + private static final String[] COLOR_MODEL_IDENTIFIER_HINTS = new String[] { "CWS", " C/WS " }; public TradfriDiscoveryService(TradfriGatewayHandler bridgeHandler) { super(Stream.concat(SUPPORTED_LIGHT_TYPES_UIDS.stream(), SUPPORTED_CONTROLLER_TYPES_UIDS.stream()) @@ -108,7 +108,7 @@ public void onUpdate(@Nullable String instanceId, @Nullable JsonObject data) { // As the protocol does not distinguishes between color and full-color lights, // we check if the "CWS" identifier is given in the model name ThingTypeUID thingType = null; - if (model != null && model.contains(COLOR_MODELS_IDENTIFIER)) { + if (model != null && Arrays.stream(COLOR_MODEL_IDENTIFIER_HINTS).anyMatch(model::contains)) { thingType = THING_TYPE_COLOR_LIGHT; } if (thingType == null && // diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriControllerHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriControllerHandler.java index a360ef6627c65..a8d3fd8217bd7 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriControllerHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriControllerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriGatewayHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriGatewayHandler.java index f0215aa2ba032..86613cebb2859 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriGatewayHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriGatewayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,6 +14,7 @@ import static org.openhab.binding.tradfri.internal.TradfriBindingConstants.*; +import java.io.IOException; import java.net.InetSocketAddress; import java.net.URI; import java.net.URISyntaxException; @@ -26,10 +27,9 @@ import org.eclipse.californium.core.CoapClient; import org.eclipse.californium.core.CoapResponse; import org.eclipse.californium.core.network.CoapEndpoint; -import org.eclipse.californium.core.network.config.NetworkConfig; +import org.eclipse.californium.elements.exception.ConnectorException; import org.eclipse.californium.scandium.DTLSConnector; import org.eclipse.californium.scandium.config.DtlsConnectorConfig; -import org.eclipse.californium.scandium.dtls.InMemoryConnectionStore; import org.eclipse.californium.scandium.dtls.pskstore.StaticPskStore; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -46,7 +46,6 @@ import org.openhab.binding.tradfri.internal.DeviceUpdateListener; import org.openhab.binding.tradfri.internal.TradfriBindingConstants; import org.openhab.binding.tradfri.internal.TradfriCoapClient; -import org.openhab.binding.tradfri.internal.TradfriCoapEndpoint; import org.openhab.binding.tradfri.internal.TradfriCoapHandler; import org.openhab.binding.tradfri.internal.config.TradfriGatewayConfig; import org.openhab.binding.tradfri.internal.model.TradfriVersion; @@ -147,10 +146,12 @@ private void establishConnection() { return; } - DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); + DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(); builder.setPskStore(new StaticPskStore(configuration.identity, configuration.preSharedKey.getBytes())); - dtlsConnector = new DTLSConnector(builder.build(), new InMemoryConnectionStore(100, 60)); - endPoint = new TradfriCoapEndpoint(dtlsConnector, NetworkConfig.getStandard()); + builder.setMaxConnections(100); + builder.setStaleConnectionThreshold(60); + dtlsConnector = new DTLSConnector(builder.build()); + endPoint = new CoapEndpoint.Builder().setConnector(dtlsConnector).build(); deviceClient.setEndpoint(endPoint); updateStatus(ThingStatus.UNKNOWN); @@ -175,11 +176,13 @@ protected boolean obtainIdentityAndPreSharedKey() { String authUrl = null; String responseText = null; try { - DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(new InetSocketAddress(0)); + DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder(); builder.setPskStore(new StaticPskStore("Client_identity", configuration.code.getBytes())); DTLSConnector dtlsConnector = new DTLSConnector(builder.build()); - CoapEndpoint authEndpoint = new CoapEndpoint(dtlsConnector, NetworkConfig.getStandard()); + CoapEndpoint.Builder authEndpointBuilder = new CoapEndpoint.Builder(); + authEndpointBuilder.setConnector(dtlsConnector); + CoapEndpoint authEndpoint = authEndpointBuilder.build(); authUrl = "coaps://" + configuration.host + ":" + configuration.port + "/15011/9063"; CoapClient deviceClient = new CoapClient(new URI(authUrl)); @@ -237,9 +240,13 @@ protected boolean obtainIdentityAndPreSharedKey() { logger.error("Illegal gateway URI '{}'", authUrl, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); } catch (JsonParseException e) { - logger.warn("Invalid response recieved from gateway '{}'", responseText, e); + logger.warn("Invalid response received from gateway '{}'", responseText, e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, - String.format("Invalid response recieved from gateway '%s'", responseText)); + String.format("Invalid response received from gateway '%s'", responseText)); + } catch (ConnectorException |IOException e) { + logger.debug("Error connecting to gateway ",e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, + String.format("Error connecting to gateway.")); } return false; } diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriLightHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriLightHandler.java index 8f75ed408f41f..099a50f2cb22e 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriLightHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriLightHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriPlugHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriPlugHandler.java index 19feb2cd38a11..f687305fed8ed 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriPlugHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriPlugHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriSensorHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriSensorHandler.java index 3433965d8abb2..c40d0ddd1f45e 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriSensorHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriThingHandler.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriThingHandler.java index e024622afbc3d..f6037a98e4f9f 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriThingHandler.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/handler/TradfriThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriControllerData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriControllerData.java index 2053ffa40f0cd..3afd87a0e61a0 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriControllerData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriControllerData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriDeviceData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriDeviceData.java index 85b1ffe1ea654..ec860c316d0d6 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriDeviceData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriDeviceData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriLightData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriLightData.java index 4382408cf2d19..36723df5c9073 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriLightData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriLightData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriPlugData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriPlugData.java index 91cee9da77424..c103282c34c11 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriPlugData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriPlugData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriSensorData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriSensorData.java index 0f26981115b34..44dd6c02b1faf 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriSensorData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriSensorData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriVersion.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriVersion.java index f4e3c8f404926..fe6c1308f4852 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriVersion.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriWirelessDeviceData.java b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriWirelessDeviceData.java index fa0ff7fd902ae..125274541e048 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriWirelessDeviceData.java +++ b/bundles/org.openhab.binding.tradfri/src/main/java/org/openhab/binding/tradfri/internal/model/TradfriWirelessDeviceData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.tradfri/src/main/resources/ESH-INF/config/config.xml index 059f67fae59a3..51cc802dafecf 100644 --- a/bundles/org.openhab.binding.tradfri/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.tradfri/src/main/resources/ESH-INF/config/config.xml @@ -28,7 +28,7 @@ <parameter name="preSharedKey" type="text" required="false"> <advanced>true</advanced> <context>password</context> - <label>Pre-Shared security key</label> + <label>Pre-Shared Security Key</label> <description>Security key obtained during first initialization of the gateway</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/TradfriColorTest.java b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/TradfriColorTest.java index ac96c2b38d45d..cb5dd02426d2a 100644 --- a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/TradfriColorTest.java +++ b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/TradfriColorTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryServiceTest.java b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryServiceTest.java index e09a0485b4a95..237caba3abc71 100644 --- a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryServiceTest.java +++ b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/discovery/TradfriDiscoveryServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -163,6 +163,22 @@ public void validDiscoveryResultColorLightCWS() { assertThat(discoveryResult.getRepresentationProperty(), is(CONFIG_ID)); } + @Test + public void validDiscoveryResultAlternativeColorLightCWS() { + String json = "{\"3311\":[{\"5850\":1,\"5709\":32886,\"5851\":216,\"5707\":5309,\"5708\":52400,\"5710\":27217,\"5706\":\"efd275\",\"9003\":0}],\"9001\":\"Mushroom lamp\",\"9002\":1571036916,\"9020\":1571588312,\"9003\":65539,\"9054\":0,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI bulb E27 C\\/WS opal 600\",\"2\":\"\",\"3\":\"1.3.009\",\"6\":1},\"5750\":2}"; + JsonObject data = new JsonParser().parse(json).getAsJsonObject(); + + discovery.onUpdate("65539", data); + + assertNotNull(discoveryResult); + assertThat(discoveryResult.getFlag(), is(DiscoveryResultFlag.NEW)); + assertThat(discoveryResult.getThingUID(), is(new ThingUID("tradfri:0210:1:65539"))); + assertThat(discoveryResult.getThingTypeUID(), is(THING_TYPE_COLOR_LIGHT)); + assertThat(discoveryResult.getBridgeUID(), is(GATEWAY_THING_UID)); + assertThat(discoveryResult.getProperties().get(CONFIG_ID), is(65539)); + assertThat(discoveryResult.getRepresentationProperty(), is(CONFIG_ID)); + } + @Test public void validDiscoveryResultRemoteControl() { String json = "{\"9001\":\"TRADFRI remote control\",\"9002\":1492843083,\"9020\":1506977986,\"9003\":65536,\"9054\":0,\"5750\":0,\"9019\":1,\"3\":{\"0\":\"IKEA of Sweden\",\"1\":\"TRADFRI remote control\",\"2\":\"\",\"3\":\"1.2.214\",\"6\":3,\"9\":47},\"15009\":[{\"9003\":0}]}"; diff --git a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/model/TradfriVersionTest.java b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/model/TradfriVersionTest.java index d88513952f769..cc0a2175eb730 100644 --- a/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/model/TradfriVersionTest.java +++ b/bundles/org.openhab.binding.tradfri/src/test/java/org/openhab/binding/tradfri/internal/model/TradfriVersionTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/NOTICE b/bundles/org.openhab.binding.unifi/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.unifi/NOTICE +++ b/bundles/org.openhab.binding.unifi/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.unifi/README.md b/bundles/org.openhab.binding.unifi/README.md index 07f72da2ffc78..6fdd0a2436b1a 100644 --- a/bundles/org.openhab.binding.unifi/README.md +++ b/bundles/org.openhab.binding.unifi/README.md @@ -63,7 +63,7 @@ The priority essentially means the binding attempts to lookup by MAC address, th The `site` parameter is optional. If you leave it blank, the client will appear `ONLINE` if found in *any* site defined on the controller. -You may use the `site` parameter as a filter if you only want the client to appear home if it's found in the site defined in the `site` parameter. +You may use the `site` parameter as a filter if you only want the client to appear home if it is found in the site defined in the `site` parameter. Additionally, you may use friendly site names as they appear in the controller UI. diff --git a/bundles/org.openhab.binding.unifi/pom.xml b/bundles/org.openhab.binding.unifi/pom.xml index f0a19836676d2..34f03ff76f345 100644 --- a/bundles/org.openhab.binding.unifi/pom.xml +++ b/bundles/org.openhab.binding.unifi/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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-v4_0_0.xsd"> +<?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-v4_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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.unifi</artifactId> diff --git a/bundles/org.openhab.binding.unifi/src/main/feature/feature.xml b/bundles/org.openhab.binding.unifi/src/main/feature/feature.xml index 3fa06ed89db30..ceb9e45eb6fae 100644 --- a/bundles/org.openhab.binding.unifi/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.unifi/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.unifi-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-unifi" description="UniFi Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiBindingConstants.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiBindingConstants.java index 0dd321138edc9..2e31c78aa45af 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiBindingConstants.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiClientThingConfig.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiClientThingConfig.java index 506b6f180b4ed..8159e992b5b98 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiClientThingConfig.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiClientThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiControllerThingConfig.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiControllerThingConfig.java index 878e003d82869..2eea87d94aaca 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiControllerThingConfig.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiControllerThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiThingHandlerFactory.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiThingHandlerFactory.java index c9be488dcb732..52014c546ce83 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiThingHandlerFactory.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/UniFiThingHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiCommunicationException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiCommunicationException.java index 57d04ad6ec27d..d50e68db6feba 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiCommunicationException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiCommunicationException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiException.java index 29dea067357bc..7716b94573b13 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiExpiredSessionException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiExpiredSessionException.java index 2c19f1ac5c34e..8dded35fc3855 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiExpiredSessionException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiExpiredSessionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidCredentialsException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidCredentialsException.java index 4bafe2b0d4d81..94896bd4a811f 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidCredentialsException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidCredentialsException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidHostException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidHostException.java index 68a93edfced7d..7470eb0b4f5a7 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidHostException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiInvalidHostException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiNotAuthorizedException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiNotAuthorizedException.java index 15f5d758af27e..7567fbdbec1cf 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiNotAuthorizedException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiNotAuthorizedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiSSLException.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiSSLException.java index f70fc40547507..9dc691a110446 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiSSLException.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/UniFiSSLException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiCache.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiCache.java index 440a2d826edd0..d483956511d4e 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiCache.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiClientCache.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiClientCache.java index bccfd1071fa51..75485a10f6c22 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiClientCache.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiClientCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiDeviceCache.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiDeviceCache.java index 786edf5e0efcd..0f993e434d220 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiDeviceCache.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiDeviceCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiSiteCache.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiSiteCache.java index d70307fc4c683..9b8fb800bc2e9 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiSiteCache.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/cache/UniFiSiteCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiClient.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiClient.java index 65406a2275c11..8616e5519f84c 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiClient.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiController.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiController.java index 6257dabeb54a3..2a3000ae67c54 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiController.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiController.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiControllerRequest.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiControllerRequest.java index e575d278a5bd3..94cbd99dadae1 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiControllerRequest.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiControllerRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiDevice.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiDevice.java index 62d0add88d879..daed14182c2e5 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiDevice.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiSite.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiSite.java index 325bd4efe5893..054b444851a8b 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiSite.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiSite.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiUnknownClient.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiUnknownClient.java index 6b2dda12cb4d5..97946cd52bfad 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiUnknownClient.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiUnknownClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWiredClient.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWiredClient.java index 5f343fac62255..edb2388d134fc 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWiredClient.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWiredClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWirelessClient.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWirelessClient.java index 1e1d38bb72187..b6a105ea1ac8c 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWirelessClient.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/model/UniFiWirelessClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientDeserializer.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientDeserializer.java index 4f8e603c3b5a7..bf9c026903f76 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientDeserializer.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientInstanceCreator.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientInstanceCreator.java index ad4ea992c9a24..caab536eabb9a 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientInstanceCreator.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiClientInstanceCreator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiDeviceInstanceCreator.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiDeviceInstanceCreator.java index a884e834ccb08..f5aadd94a284e 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiDeviceInstanceCreator.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiDeviceInstanceCreator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiSiteInstanceCreator.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiSiteInstanceCreator.java index 818d42af1b4d4..f0a100e9cc4de 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiSiteInstanceCreator.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiSiteInstanceCreator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTidyLowerCaseStringDeserializer.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTidyLowerCaseStringDeserializer.java index f62e2746e0fdd..7a4d89c053dab 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTidyLowerCaseStringDeserializer.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTidyLowerCaseStringDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTimestampDeserializer.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTimestampDeserializer.java index d2d87d6463206..64b4a738dd6ab 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTimestampDeserializer.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/api/util/UniFiTimestampDeserializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java index 71a2d2b6e2331..885d4642f73d5 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java index 1b408b673df15..64c9517c9bfc6 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiClientThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiControllerThingHandler.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiControllerThingHandler.java index b85e08dd6a00c..a296b4fdc55d2 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiControllerThingHandler.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/handler/UniFiControllerThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManager.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManager.java index f0841463caa17..6b99faee7ad21 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManager.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManagerProvider.java b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManagerProvider.java index 8c1d85661f3b5..195ff33a76567 100644 --- a/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManagerProvider.java +++ b/bundles/org.openhab.binding.unifi/src/main/java/org/openhab/binding/unifi/internal/ssl/UniFiTrustManagerProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/NOTICE b/bundles/org.openhab.binding.urtsi/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.urtsi/NOTICE +++ b/bundles/org.openhab.binding.urtsi/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.urtsi/pom.xml b/bundles/org.openhab.binding.urtsi/pom.xml index b81404bf8b111..4640c6f6ee961 100644 --- a/bundles/org.openhab.binding.urtsi/pom.xml +++ b/bundles/org.openhab.binding.urtsi/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.urtsi</artifactId> diff --git a/bundles/org.openhab.binding.urtsi/src/main/feature/feature.xml b/bundles/org.openhab.binding.urtsi/src/main/feature/feature.xml index 8c772af0eda4e..359df10d4b70f 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.urtsi/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.urtsi-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-urtsi" description="Somfy URTSI II Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiBindingConstants.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiBindingConstants.java index 26076ab3611d3..8d27e7d70c4bb 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiBindingConstants.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiHandlerFactory.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiHandlerFactory.java index d9413d5c09029..a95399a2c087c 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiHandlerFactory.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/UrtsiHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/RtsDeviceConfig.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/RtsDeviceConfig.java index 2ac6a2ff70f0e..86b521f616aa2 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/RtsDeviceConfig.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/RtsDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/UrtsiDeviceConfig.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/UrtsiDeviceConfig.java index fafe15962e6e5..8db9918a88251 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/UrtsiDeviceConfig.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/config/UrtsiDeviceConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsCommand.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsCommand.java index 86143456aeeaf..3a31a3f1cd3b7 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsCommand.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsDeviceHandler.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsDeviceHandler.java index 5180ca88fd7f6..3363bbec7062f 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsDeviceHandler.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/RtsDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/UrtsiDeviceHandler.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/UrtsiDeviceHandler.java index f48dd9464b2f9..3c2b3f339fd9e 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/UrtsiDeviceHandler.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/handler/UrtsiDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/mapping/UrtsiChannelMapping.java b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/mapping/UrtsiChannelMapping.java index 88736542044da..613f1f4fcbf3e 100644 --- a/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/mapping/UrtsiChannelMapping.java +++ b/bundles/org.openhab.binding.urtsi/src/main/java/org/openhab/binding/urtsi/internal/mapping/UrtsiChannelMapping.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/.classpath b/bundles/org.openhab.binding.valloxmv/.classpath index 5e8a55fefbd91..a5d95095ccaaf 100644 --- a/bundles/org.openhab.binding.valloxmv/.classpath +++ b/bundles/org.openhab.binding.valloxmv/.classpath @@ -6,6 +6,11 @@ <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"/> diff --git a/bundles/org.openhab.binding.valloxmv/NOTICE b/bundles/org.openhab.binding.valloxmv/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.valloxmv/NOTICE +++ b/bundles/org.openhab.binding.valloxmv/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.valloxmv/pom.xml b/bundles/org.openhab.binding.valloxmv/pom.xml index 1b062e008fa4d..378a4cd850cff 100644 --- a/bundles/org.openhab.binding.valloxmv/pom.xml +++ b/bundles/org.openhab.binding.valloxmv/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.valloxmv</artifactId> diff --git a/bundles/org.openhab.binding.valloxmv/src/main/feature/feature.xml b/bundles/org.openhab.binding.valloxmv/src/main/feature/feature.xml index 86525be62db66..09cede85d31fc 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.valloxmv/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.valloxmv-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-valloxmv" description="ValloxMV Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVBindingConstants.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVBindingConstants.java index 8d4dc5b39ffcf..eccbac8dc61ab 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVBindingConstants.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVConfig.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVConfig.java index 6916f021d9b00..9796b17d80761 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVConfig.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandler.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandler.java index 50948e1559390..7807cde9a375e 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandler.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandlerFactory.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandlerFactory.java index df3b6ed89ef5f..94965703d6ee5 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandlerFactory.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java index 398833fdbb95e..1d0c26630af03 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java +++ b/bundles/org.openhab.binding.valloxmv/src/main/java/org/openhab/binding/valloxmv/internal/ValloxMVWebSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/binding/binding.xml similarity index 100% rename from bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/binding/binding.xml rename to bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/binding/binding.xml diff --git a/bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/i18n/valloxmv_de.properties b/bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/i18n/valloxmv_de.properties similarity index 100% rename from bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/i18n/valloxmv_de.properties rename to bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/i18n/valloxmv_de.properties diff --git a/bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/thing/thing-types.xml similarity index 91% rename from bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/thing/thing-types.xml rename to bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/thing/thing-types.xml index 3372edbff13d9..6a3039d3b8a0c 100644 --- a/bundles/org.openhab.binding.valloxmv/src/main/ressources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.valloxmv/src/main/resources/ESH-INF/thing/thing-types.xml @@ -40,7 +40,7 @@ <description>IP address or host name of online interface of ventilation unit</description> </parameter> <parameter name="updateinterval" type="integer" required="false"> - <label>Update interval</label> + <label>Update Interval</label> <description>Data update interval in seconds (default: 60s)</description> <required>false</required> <default>60</default> @@ -70,28 +70,28 @@ <channel-type id="fanspeed"> <item-type>Number:Dimensionless</item-type> - <label>Fan speed</label> + <label>Fan Speed</label> <description>Fan speed in % (0-100)</description> <state readOnly="true" min="0" max="1" pattern="%d %unit%" /> </channel-type> <channel-type id="fanspeedextract" advanced="true"> <item-type>Number</item-type> - <label>Fan speed extracting</label> + <label>Fan Speed Extracting</label> <description>Fan speed of extracting fan (1/min)</description> <state pattern="%d 1/min" readOnly="true"></state> </channel-type> <channel-type id="fanspeedsupply" advanced="true"> <item-type>Number</item-type> - <label>Fan speed supplying</label> + <label>Fan Speed Supplying</label> <description>Fan speed of supplying fan (1/min)</description> <state pattern="%d 1/min" readOnly="true"></state> </channel-type> <channel-type id="tempinside"> <item-type>Number:Temperature</item-type> - <label>Temperature inside</label> + <label>Temperature Inside</label> <description>Current temperature inside the building.</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="true" /> @@ -99,7 +99,7 @@ <channel-type id="tempoutside"> <item-type>Number:Temperature</item-type> - <label>Temperature outside</label> + <label>Temperature Outside</label> <description>Current temperature outside the building.</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="true" /> @@ -107,7 +107,7 @@ <channel-type id="tempexhaust"> <item-type>Number:Temperature</item-type> - <label>Temperature exhaust</label> + <label>Temperature Exhaust</label> <description>Current temperature of the air flow exhausting the building.</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="true" /> @@ -115,7 +115,7 @@ <channel-type id="tempincomingbeforeheating" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Temperature incoming before heating</label> + <label>Temperature Incoming Before Heating</label> <description> Current temperature of the air flow incoming to the building before heating (if optional heating module included in ventilation unit). @@ -126,7 +126,7 @@ <channel-type id="tempincoming"> <item-type>Number:Temperature</item-type> - <label>Temperature incoming</label> + <label>Temperature Incoming</label> <description>Current temperature of the air flow incoming to the building.</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="true" /> @@ -141,7 +141,7 @@ <channel-type id="cellstate"> <item-type>Number</item-type> - <label>Cell state</label> + <label>Cell State</label> <description>Current cell state</description> <state readOnly="true"> <options> @@ -155,21 +155,21 @@ <channel-type id="uptimeyears"> <item-type>Number</item-type> - <label>Total uptime years</label> + <label>Total Uptime Years</label> <description>Total uptime in years (+ uptime in hours = total uptime)</description> <state pattern="%d Y" readOnly="true" /> </channel-type> <channel-type id="uptimehours"> <item-type>Number</item-type> - <label>Total uptime hours</label> + <label>Total Uptime Hours</label> <description>Total uptime in hours (+ uptime in years = total uptime)</description> <state pattern="%d h" readOnly="true" /> </channel-type> <channel-type id="uptimehourscurrent"> <item-type>Number</item-type> - <label>Current uptime hours</label> + <label>Current Uptime Hours</label> <description>Current uptime in hours</description> <state pattern="%d h" readOnly="true" /> </channel-type> @@ -190,42 +190,42 @@ <channel-type id="extrfanbalancebase" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Extract fan base speed</label> + <label>Extract Fan Base Speed</label> <description>Extract fan base speed in % (0-100)</description> <state readOnly="false" min="0" max="100" pattern="%d %%" /> </channel-type> <channel-type id="suppfanbalancebase" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Supply fan base speed</label> + <label>Supply Fan Base Speed</label> <description>Supply fan base speed in % (0-100)</description> <state readOnly="false" min="0" max="100" pattern="%d %%" /> </channel-type> <channel-type id="homespeedsetting" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Home fan speed</label> + <label>Home Fan Speed</label> <description>Home fan speed in % (0-100)</description> <state readOnly="false" min="0" max="100" pattern="%d %%" /> </channel-type> <channel-type id="awayspeedsetting" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Away fan speed</label> + <label>Away Fan Speed</label> <description>Away fan speed in % (0-100)</description> <state readOnly="false" min="0" max="100" pattern="%d %%" /> </channel-type> <channel-type id="boostspeedsetting" advanced="true"> <item-type>Number:Dimensionless</item-type> - <label>Boost fan speed</label> + <label>Boost Fan Speed</label> <description>Boost fan speed in % (0-100)</description> <state readOnly="false" min="0" max="100" pattern="%d %%" /> </channel-type> <channel-type id="homeairtemptarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Home target temperature</label> + <label>Home Target Temperature</label> <description>Target temperature in home state</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="false" /> @@ -233,7 +233,7 @@ <channel-type id="awayairtemptarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Away target temperature</label> + <label>Away Target Temperature</label> <description>Target temperature in away state</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="false" /> @@ -241,7 +241,7 @@ <channel-type id="boostairtemptarget" advanced="true"> <item-type>Number:Temperature</item-type> - <label>Boost target temperature</label> + <label>Boost Target Temperature</label> <description>Target temperature in boost state</description> <category>Temperature</category> <state pattern="%.2f %unit%" readOnly="false" /> diff --git a/bundles/org.openhab.binding.vektiva/NOTICE b/bundles/org.openhab.binding.vektiva/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.vektiva/NOTICE +++ b/bundles/org.openhab.binding.vektiva/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.vektiva/README.md b/bundles/org.openhab.binding.vektiva/README.md index 035f9de8c48d3..18abcf0b8f933 100644 --- a/bundles/org.openhab.binding.vektiva/README.md +++ b/bundles/org.openhab.binding.vektiva/README.md @@ -1,22 +1,18 @@ # Vektiva Binding -This binding allows control of Vektiva products. (http://vektiva.com) +This binding allows control of [Vektiva](https://vektiva.com) products. ## Supported Things -The currently supported thing is Smarwi (https://vektiva.com/smarwi) +The only supported thing is the [SMARWI](https://vektiva.com/en/about-smarwi/how-it-works). ## Discovery -The automatic discovery is not currently supported by thing's API. +Automatic discovery is currently not supported by the Vektiva API. -## Binding Configuration +## SMARWI Configuration -This binding does not require specific configuration. - -## Smarwi Configuration - -To manually add a Smarwi thing just enter the local network IP address of the device. +To manually add a SMARWI thing just enter the local network IP address of the device. If you want to change the polling frequency of thing availability and status, please change the advanced parameter _refreshInterval_. If you are running 203.2.4 or newer firmware you can enable the websockets support for better user experience by setting the _useWebSockets_ parameter. @@ -24,10 +20,10 @@ If you are running 203.2.4 or newer firmware you can enable the websockets suppo The exposed channels are : -| name | type | descripton | -| --- |:---:|:-----:| -| control | Rollershutter | It reacts to standard roller shutter commands _UP/DOWN/STOP_. The percentual closure (dimmer) is also supported - you can partially open window, but thing state is only open/close. | -| status | String | Shows the window status (Stopped, Moving, Not ready, Blocked) | +| Name | Type | Description | +| ------- |:--------------:|:-----------:| +| control | Rollershutter | It reacts to standard roller shutter commands _UP/DOWN/STOP_. The percentual closure (dimmer) is also supported - you can partially open window, but thing state is only open/close. | +| status | String | Shows the window status (Stopped, Moving, Not ready, Blocked) | ## Full Example diff --git a/bundles/org.openhab.binding.vektiva/pom.xml b/bundles/org.openhab.binding.vektiva/pom.xml index d72c12176eb06..4c5cf8d5c7e29 100644 --- a/bundles/org.openhab.binding.vektiva/pom.xml +++ b/bundles/org.openhab.binding.vektiva/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<?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> <artifactId>org.openhab.addons.reactor.bundles</artifactId> <groupId>org.openhab.addons.bundles</groupId> - <version>2.5.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.vektiva</artifactId> diff --git a/bundles/org.openhab.binding.vektiva/src/main/feature/feature.xml b/bundles/org.openhab.binding.vektiva/src/main/feature/feature.xml index dc8cb9d64177f..62fdca5de94bd 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.vektiva/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.vektiva-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-vektiva" description="Vektiva Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaBindingConstants.java b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaBindingConstants.java index db1f49f4d79ba..44c5e0d2164d7 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaBindingConstants.java +++ b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaHandlerFactory.java b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaHandlerFactory.java index 468b84d04903d..74b3700b12eb5 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaHandlerFactory.java +++ b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/VektivaHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/config/VektivaSmarwiConfiguration.java b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/config/VektivaSmarwiConfiguration.java index fddd8d1dd7c73..10ad3ee7bcbe1 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/config/VektivaSmarwiConfiguration.java +++ b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/config/VektivaSmarwiConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/handler/VektivaSmarwiHandler.java b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/handler/VektivaSmarwiHandler.java index 53c54ddb85c57..51a82113cfc78 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/handler/VektivaSmarwiHandler.java +++ b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/handler/VektivaSmarwiHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/net/VektivaSmarwiSocket.java b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/net/VektivaSmarwiSocket.java index bae7c00a7abcc..4ed75b3d3033b 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/net/VektivaSmarwiSocket.java +++ b/bundles/org.openhab.binding.vektiva/src/main/java/org/openhab/binding/vektiva/internal/net/VektivaSmarwiSocket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vektiva/src/main/resources/ESH-INF/thing/smarwi.xml b/bundles/org.openhab.binding.vektiva/src/main/resources/ESH-INF/thing/smarwi.xml index 17a6e2a9fce70..d000f479048f6 100644 --- a/bundles/org.openhab.binding.vektiva/src/main/resources/ESH-INF/thing/smarwi.xml +++ b/bundles/org.openhab.binding.vektiva/src/main/resources/ESH-INF/thing/smarwi.xml @@ -16,7 +16,7 @@ <config-description> <parameter name="ip" type="text" required="true"> - <label>Smarwi IP address</label> + <label>Smarwi IP Address</label> <context>network-address</context> <description>IP address of the Smarwi thing on the local network.</description> </parameter> @@ -27,7 +27,7 @@ <advanced>true</advanced> </parameter> <parameter name="useWebSockets" type="boolean"> - <label>Use WebSockets feature for faster state update.</label> + <label>Use WebSockets Feature for Faster State Update.</label> <description>Enable web sockets technology. FW 203.2.4+ required</description> <default>false</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.velbus/NOTICE b/bundles/org.openhab.binding.velbus/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.velbus/NOTICE +++ b/bundles/org.openhab.binding.velbus/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.velbus/pom.xml b/bundles/org.openhab.binding.velbus/pom.xml index 1a40f77b69626..d1677e34887b7 100644 --- a/bundles/org.openhab.binding.velbus/pom.xml +++ b/bundles/org.openhab.binding.velbus/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.velbus</artifactId> diff --git a/bundles/org.openhab.binding.velbus/src/main/feature/feature.xml b/bundles/org.openhab.binding.velbus/src/main/feature/feature.xml index 19555730fe595..fca4915fd350d 100644 --- a/bundles/org.openhab.binding.velbus/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.velbus/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.velbus-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-velbus" description="Velbus Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java index e198110b824f4..65f11f98bdeb7 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusChannelIdentifier.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusChannelIdentifier.java index 3e0e4483a121a..f3a75eaad2deb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusChannelIdentifier.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusChannelIdentifier.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java index 48519bb1be5ab..f675d30d8fa39 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModule.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModule.java index 3cc508bac2127..8ce4b2010e734 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModule.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModule.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java index 8dd00d078ffee..87e555dbdb039 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusModuleAddress.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketInputStream.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketInputStream.java index f97a61eb6bbad..9619a6153c57f 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketInputStream.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketInputStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java index 22814c6f01077..3557ee651b363 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/VelbusPacketListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java index b2e83ed93138f..bae3643f8561b 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/discovery/VelbusThingDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java index c40a1f0faf046..55b60f6e410d4 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBlindsHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java index 6aa46350414f7..74a4f374c29c5 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java index 9fd93e39bdbaf..22dab183e60bc 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusDimmerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java index 4cbac51ffd71f..473c23cda22f0 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusRelayHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java index 3b0468bf27dfb..d8eeca8b7ac0c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java index 74b8264d130e7..67d1d297f91ea 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusTemperatureSensorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java index bca91136b8205..1affaa6a4aa8e 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java index 9659e5e7abba0..6dcafe8069dfb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java index 7655e2c73d9f1..6c896413c10ba 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBGPOHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java index 260acef1bc2bd..164df695c22b2 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMBPIROHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindOffPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindOffPacket.java index 2d1452199e50c..ecdc4fffc398c 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindOffPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindOffPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindPositionPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindPositionPacket.java index ef5c73e416681..f46d190f2fa3b 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindPositionPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindPositionPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindUpDownPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindUpDownPacket.java index 47ddd4300ac90..b35637e6ec208 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindUpDownPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusBlindUpDownPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusChannelNameRequestPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusChannelNameRequestPacket.java index 91754d0e0edb0..8e9f61f91d3db 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusChannelNameRequestPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusChannelNameRequestPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDimmerPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDimmerPacket.java index 0847746d0b1fe..fd5be5bb41296 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDimmerPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusDimmerPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusPacket.java index 2d3730d300517..c6ac7c47821c0 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java index 27513d66c3d08..8aa299d2f2c3f 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusRelayPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusScanPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusScanPacket.java index 054edffb86065..f0cb90b918154 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusScanPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusScanPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSensorTemperatureRequestPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSensorTemperatureRequestPacket.java index cbd75ba266f81..fda2df6c1ac11 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSensorTemperatureRequestPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusSensorTemperatureRequestPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusStatusRequestPacket.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusStatusRequestPacket.java index 706243911c81d..df8182bfdb488 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusStatusRequestPacket.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/packets/VelbusStatusRequestPacket.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.velbus/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.velbus/src/main/resources/ESH-INF/config/config.xml index bae333a4cb990..9eac44d9345cf 100644 --- a/bundles/org.openhab.binding.velbus/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.velbus/src/main/resources/ESH-INF/config/config.xml @@ -7,7 +7,7 @@ <config-description uri="bridge-type:velbus:bridge"> <parameter name="port" type="text"> <context>serial-port</context> - <label>Serial port</label> + <label>Serial Port</label> <description>Select serial port (COM1, /dev/ttyS0, ...)</description> <required>true</required> </parameter> @@ -19,7 +19,7 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> @@ -32,13 +32,13 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> @@ -51,25 +51,25 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> @@ -82,31 +82,31 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> @@ -119,37 +119,37 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> </parameter> <parameter name="CH6" type="text"> - <label>CH6 name</label> + <label>CH6 Name</label> <description>The name of CH6.</description> <default>CH6</default> <advanced>true</advanced> @@ -162,43 +162,43 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> </parameter> <parameter name="CH6" type="text"> - <label>CH6 name</label> + <label>CH6 Name</label> <description>The name of CH6.</description> <default>CH6</default> <advanced>true</advanced> </parameter> <parameter name="CH7" type="text"> - <label>CH7 name</label> + <label>CH7 Name</label> <description>The name of CH7.</description> <default>CH7</default> <advanced>true</advanced> @@ -211,49 +211,49 @@ <description>The velbus address of the device</description> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> </parameter> <parameter name="CH6" type="text"> - <label>CH6 name</label> + <label>CH6 Name</label> <description>The name of CH6.</description> <default>CH6</default> <advanced>true</advanced> </parameter> <parameter name="CH7" type="text"> - <label>CH7 name</label> + <label>CH7 Name</label> <description>The name of CH7.</description> <default>CH7</default> <advanced>true</advanced> </parameter> <parameter name="CH8" type="text"> - <label>CH8 name</label> + <label>CH8 Name</label> <description>The name of CH8.</description> <default>CH8</default> <advanced>true</advanced> @@ -266,61 +266,61 @@ <description>The velbus address of the device</description> </parameter> <parameter name="refresh" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled.</description> <default>300</default> <advanced>true</advanced> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> </parameter> <parameter name="CH6" type="text"> - <label>CH6 name</label> + <label>CH6 Name</label> <description>The name of CH6.</description> <default>CH6</default> <advanced>true</advanced> </parameter> <parameter name="CH7" type="text"> - <label>CH7 name</label> + <label>CH7 Name</label> <description>The name of CH7.</description> <default>CH7</default> <advanced>true</advanced> </parameter> <parameter name="CH8" type="text"> - <label>CH8 name</label> + <label>CH8 Name</label> <description>The name of CH8.</description> <default>CH8</default> <advanced>true</advanced> </parameter> <parameter name="CH9" type="text"> - <label>CH9 name</label> + <label>CH9 Name</label> <description>The name of CH9 (temperature sensor channel).</description> <default>Temperature</default> <advanced>true</advanced> @@ -333,205 +333,205 @@ <description>The velbus address of the device</description> </parameter> <parameter name="refresh" type="integer"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for the temperature sensor (in seconds), default 300. If set to 0 or left empty, no refresh will be scheduled.</description> <default>300</default> <advanced>true</advanced> </parameter> <parameter name="CH1" type="text"> - <label>CH1 name</label> + <label>CH1 Name</label> <description>The name of CH1.</description> <default>CH1</default> <advanced>true</advanced> </parameter> <parameter name="CH2" type="text"> - <label>CH2 name</label> + <label>CH2 Name</label> <description>The name of CH2.</description> <default>CH2</default> <advanced>true</advanced> </parameter> <parameter name="CH3" type="text"> - <label>CH3 name</label> + <label>CH3 Name</label> <description>The name of CH3.</description> <default>CH3</default> <advanced>true</advanced> </parameter> <parameter name="CH4" type="text"> - <label>CH4 name</label> + <label>CH4 Name</label> <description>The name of CH4.</description> <default>CH4</default> <advanced>true</advanced> </parameter> <parameter name="CH5" type="text"> - <label>CH5 name</label> + <label>CH5 Name</label> <description>The name of CH5.</description> <default>CH5</default> <advanced>true</advanced> </parameter> <parameter name="CH6" type="text"> - <label>CH6 name</label> + <label>CH6 Name</label> <description>The name of CH6.</description> <default>CH6</default> <advanced>true</advanced> </parameter> <parameter name="CH7" type="text"> - <label>CH7 name</label> + <label>CH7 Name</label> <description>The name of CH7.</description> <default>CH7</default> <advanced>true</advanced> </parameter> <parameter name="CH8" type="text"> - <label>CH8 name</label> + <label>CH8 Name</label> <description>The name of CH8.</description> <default>CH8</default> <advanced>true</advanced> </parameter> <parameter name="CH9" type="text"> - <label>CH9 name</label> + <label>CH9 Name</label> <description>The name of CH9.</description> <default>CH9</default> <advanced>true</advanced> </parameter> <parameter name="CH10" type="text"> - <label>CH10 name</label> + <label>CH10 Name</label> <description>The name of CH10.</description> <default>CH10</default> <advanced>true</advanced> </parameter> <parameter name="CH11" type="text"> - <label>CH11 name</label> + <label>CH11 Name</label> <description>The name of CH11.</description> <default>CH11</default> <advanced>true</advanced> </parameter> <parameter name="CH12" type="text"> - <label>CH12 name</label> + <label>CH12 Name</label> <description>The name of CH12.</description> <default>CH12</default> <advanced>true</advanced> </parameter> <parameter name="CH13" type="text"> - <label>CH13 name</label> + <label>CH13 Name</label> <description>The name of CH13.</description> <default>CH13</default> <advanced>true</advanced> </parameter> <parameter name="CH14" type="text"> - <label>CH14 name</label> + <label>CH14 Name</label> <description>The name of CH14.</description> <default>CH14</default> <advanced>true</advanced> </parameter> <parameter name="CH15" type="text"> - <label>CH15 name</label> + <label>CH15 Name</label> <description>The name of CH15.</description> <default>CH15</default> <advanced>true</advanced> </parameter> <parameter name="CH16" type="text"> - <label>CH16 name</label> + <label>CH16 Name</label> <description>The name of CH16.</description> <default>CH16</default> <advanced>true</advanced> </parameter> <parameter name="CH17" type="text"> - <label>CH17 name</label> + <label>CH17 Name</label> <description>The name of CH17.</description> <default>CH17</default> <advanced>true</advanced> </parameter> <parameter name="CH18" type="text"> - <label>CH18 name</label> + <label>CH18 Name</label> <description>The name of CH18.</description> <default>CH18</default> <advanced>true</advanced> </parameter> <parameter name="CH19" type="text"> - <label>CH19 name</label> + <label>CH19 Name</label> <description>The name of CH19.</description> <default>CH19</default> <advanced>true</advanced> </parameter> <parameter name="CH20" type="text"> - <label>CH20 name</label> + <label>CH20 Name</label> <description>The name of CH20.</description> <default>CH20</default> <advanced>true</advanced> </parameter> <parameter name="CH21" type="text"> - <label>CH21 name</label> + <label>CH21 Name</label> <description>The name of CH21.</description> <default>CH21</default> <advanced>true</advanced> </parameter> <parameter name="CH22" type="text"> - <label>CH22 name</label> + <label>CH22 Name</label> <description>The name of CH22.</description> <default>CH22</default> <advanced>true</advanced> </parameter> <parameter name="CH23" type="text"> - <label>CH23 name</label> + <label>CH23 Name</label> <description>The name of CH23.</description> <default>CH23</default> <advanced>true</advanced> </parameter> <parameter name="CH24" type="text"> - <label>CH24 name</label> + <label>CH24 Name</label> <description>The name of CH24.</description> <default>CH24</default> <advanced>true</advanced> </parameter> <parameter name="CH25" type="text"> - <label>CH25 name</label> + <label>CH25 Name</label> <description>The name of CH25.</description> <default>CH25</default> <advanced>true</advanced> </parameter> <parameter name="CH26" type="text"> - <label>CH26 name</label> + <label>CH26 Name</label> <description>The name of CH26.</description> <default>CH26</default> <advanced>true</advanced> </parameter> <parameter name="CH27" type="text"> - <label>CH27 name</label> + <label>CH27 Name</label> <description>The name of CH27.</description> <default>CH27</default> <advanced>true</advanced> </parameter> <parameter name="CH28" type="text"> - <label>CH28 name</label> + <label>CH28 Name</label> <description>The name of CH28.</description> <default>CH28</default> <advanced>true</advanced> </parameter> <parameter name="CH29" type="text"> - <label>CH29 name</label> + <label>CH29 Name</label> <description>The name of CH29.</description> <default>CH29</default> <advanced>true</advanced> </parameter> <parameter name="CH30" type="text"> - <label>CH30 name</label> + <label>CH30 Name</label> <description>The name of CH30.</description> <default>CH30</default> <advanced>true</advanced> </parameter> <parameter name="CH31" type="text"> - <label>CH31 name</label> + <label>CH31 Name</label> <description>The name of CH31.</description> <default>CH31</default> <advanced>true</advanced> </parameter> <parameter name="CH32" type="text"> - <label>CH32 name</label> + <label>CH32 Name</label> <description>The name of CH32.</description> <default>CH32</default> <advanced>true</advanced> </parameter> <parameter name="CH33" type="text"> - <label>CH33 name</label> + <label>CH33 Name</label> <description>The name of CH33 (temperature sensor channel).</description> <default>Temperature</default> <advanced>true</advanced> diff --git a/bundles/org.openhab.binding.vitotronic/NOTICE b/bundles/org.openhab.binding.vitotronic/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.vitotronic/NOTICE +++ b/bundles/org.openhab.binding.vitotronic/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.vitotronic/README.md b/bundles/org.openhab.binding.vitotronic/README.md index 0edbff1504acc..a2ba260855ae5 100644 --- a/bundles/org.openhab.binding.vitotronic/README.md +++ b/bundles/org.openhab.binding.vitotronic/README.md @@ -1,15 +1,15 @@ # Vitotronic Binding -Viessmann heating systems with Vitotronic has a optolink Interface for maintenance. +Viessmann heating systems with Vitotronic has an optolink Interface for maintenance. This interface can use for get/set data in the heating system. [see on openv](https://github.com/openv/openv/wiki/) -The Vitotronic binding is a solution to bind this interface into openHAB2. -It supports the separation of the heating adaption from the integration in [openHAB2](http://www.openhab.org/). +The Vitotronic binding is a solution to bind this interface into openHAB. +It supports the separation of the heating adaption from the integration in [openHAB](https://www.openhab.org/). -![Architectur](doc/architecture_vitotronic.jpg) +![Architecture](doc/architecture_vitotronic.jpg) -The adapter transform the address oriented raw interface of the Vitotronic to a abstract format. -The adapter itself is not a part of the openhab2 binding. +The adapter transforms the address oriented raw interface of the Vitotronic to an abstract format. +The adapter itself is not a part of the binding. [A alpha version is available here](https://github.com/steand/optolink) [More Information about the adapter](https://github.com/steand/optolink/wiki) @@ -35,9 +35,13 @@ Note: The mapping of things and channels to the heating system addresses must be ## Discovery -The binding discovers the adapter with broadcast and put the found `vitotronic:bridge` into the inbox. For automatic detection the adapter and **openHAB** must be on the same LAN. The discovery itself must be start in the Paper-UI. -If the bridge isn't on the same LAN the bridge can also add manually. In this case the `IP-Address` and the `adapterID` is required. -Ãf the `vitotronic:bridge` added a second discovery will be start. It discovers all things, define in the adapter and put found things into the inbox. +The binding discovers the adapter with broadcast and put the found `vitotronic:bridge` into the inbox. +For automatic detection the adapter and **openHAB** must be on the same LAN. +The discovery itself must be start in the Paper UI. +If the bridge isn't on the same LAN the bridge can also add manually. +In this case the `IP-Address` and the `adapterID` is required. +Ãf the `vitotronic:bridge` added a second discovery will be start. +It discovers all things, define in the adapter and put found things into the inbox. ## Binding Configuration @@ -49,13 +53,16 @@ Binding itself has 4 configuration parameters: * refreshInterval (Refresh time for data in seconds. Default: 600 seconds) If the adapter is automatic discovered the ipAddress, and adapterID will be set by discovery. -The rereshInterval can be set between 60 and 600 seconds. The minimal setting is dependent of the performance of the adapter. +The rereshInterval can be set between 60 and 600 seconds. +The minimal setting is dependent of the performance of the adapter. ## Thing Configuration -There is no configuration of Things necessary. Only some channels are set active by default. If this channels are defined in the adapter and will be used in **openHAB** it must set active manually. +There is no configuration of Things necessary. +Only some channels are set active by default. +If this channels are defined in the adapter and will be used in **openHAB** it must set active manually. Don't change the Thing Name. It is the reference to the name in the adapter. ## Channels @@ -124,6 +131,3 @@ The follow channels are implemented: | temperature | Number | Generic temperature sensor | | valve | Number | Value of a generic valve | -## Example - -t.b.d diff --git a/bundles/org.openhab.binding.vitotronic/pom.xml b/bundles/org.openhab.binding.vitotronic/pom.xml index 96134fd4d019e..8760e8720ee99 100644 --- a/bundles/org.openhab.binding.vitotronic/pom.xml +++ b/bundles/org.openhab.binding.vitotronic/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.vitotronic</artifactId> diff --git a/bundles/org.openhab.binding.vitotronic/src/main/feature/feature.xml b/bundles/org.openhab.binding.vitotronic/src/main/feature/feature.xml index b15a4c2c063be..33b874d7da03d 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.vitotronic/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.vitotronic-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-vitotronic" description="Vitotronic Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConfiguration.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConfiguration.java index f347b6440c937..6b3c101364112 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConfiguration.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConstants.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConstants.java index 93f9276e4a7ec..95a442b6fb914 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConstants.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicHandlerFactory.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicHandlerFactory.java index 6ca015400f9a9..3132761fe43db 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicHandlerFactory.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/VitotronicHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicBridgeDiscovery.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicBridgeDiscovery.java index 7b89ac4ddbd41..0ac58a7e4acae 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicBridgeDiscovery.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicBridgeDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicDiscoveryService.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicDiscoveryService.java index 8f190febfdf82..37a590514a3d0 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicDiscoveryService.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/discovery/VitotronicDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java index 2ed683c60e0be..c6e6e62f5394e 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicThingHandler.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicThingHandler.java index b7af6bcc96671..0ce4440ce78c0 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicThingHandler.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/bridge.xml index 10e5009003511..b7d95751dc6d3 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/bridge.xml @@ -2,35 +2,34 @@ <thing:thing-descriptions bindingId="vitotronic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 org.eclipse.smarthome.thing-description.xsd"> + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="bridge"> - <label>Bridge Vitotronic Optolink adapter</label> + <label>Bridge Vitotronic Optolink Adapter</label> <description>This bridge represents the Vitotronic Optolink adapter </description> <config-description> <parameter name="ipAddress" type="text" required="true"> <context>network-address</context> - <label>IP Address of the Optolink Adapter </label> - <description>The IP address of the Optolink adapter - </description> + <label>IP Address</label> + <description>The IP address of the Optolink adapter</description> </parameter> <parameter name="port" type="integer" required="false" min="1024" max="49151"> <context>network-address</context> - <label>Optolink adapter port</label> + <label>Adapter Port</label> <description>Port of the LAN gateway</description> <default>31113</default> </parameter> <parameter name="adapterID" type="text" required="true"> - <label>adapterID</label> + <label>Adapter ID</label> <description>The ID of the adapter.</description> </parameter> <parameter name="refreshInterval" type="integer" required="false" min="60" max="600"> <context>refresh</context> - <label>refreshInterval</label> + <label>Refresh Interval</label> <description>Refreshtime in seconds.</description> <default>300</default> </parameter> diff --git a/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/thing-types.xml index aaa1eb471b4c0..093efa5cae886 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.vitotronic/src/main/resources/ESH-INF/thing/thing-types.xml @@ -122,7 +122,7 @@ <channel id="gradient" typeId="gradient" /> <channel id="niveau" typeId="niveau" /> <channel id="timer_MO" typeId="timer"> - <label>Monday heatingtimer</label> + <label>Monday Heating Timer</label> <description>On/Off timer for Monday. Up to 4 timers can be set</description> <properties> <property name="address">3000</property> @@ -131,7 +131,7 @@ </properties> </channel> <channel id="timer_TU" typeId="timer"> - <label>Tuesday heatingtimer</label> + <label>Tuesday Heating Timer</label> <description>On/Off timer for Tuesday. Up to 4 timers can be set</description> <properties> <property name="address">3008</property> @@ -140,7 +140,7 @@ </properties> </channel> <channel id="timer_WE" typeId="timer"> - <label>Wednesday heatingtimer</label> + <label>Wednesday Heating Timer</label> <description>On/Off timer for Wednesday. Up to 4 timers can be set</description> <properties> <property name="address">3010</property> @@ -149,7 +149,7 @@ </properties> </channel> <channel id="timer_TH" typeId="timer"> - <label>Thursday heatingtimer</label> + <label>Thursday Heating Timer</label> <description>On/Off timer for Thursday. Up to 4 timers can be set</description> <properties> <property name="address">3018</property> @@ -158,7 +158,7 @@ </properties> </channel> <channel id="timer_FR" typeId="timer"> - <label>Friday heatingtimer</label> + <label>Friday Heating Timer</label> <description>On/Off timer for Friday. Up to 4 timers can be set</description> <properties> <property name="address">3020</property> @@ -167,7 +167,7 @@ </properties> </channel> <channel id="timer_SA" typeId="timer"> - <label>Saturday heatingtimer</label> + <label>Saturday Heating Timer</label> <description>On/Off timer for Saturday. Up to 4 timers can be set</description> <properties> <property name="address">3028</property> @@ -176,7 +176,7 @@ </properties> </channel> <channel id="timer_SU" typeId="timer"> - <label>Sunday heatingtimer</label> + <label>Sunday Heating Timer</label> <description>On/Off timer for Sunday. Up to 4 timers can be set</description> <properties> <property name="address">3030</property> @@ -185,7 +185,7 @@ </properties> </channel> <channel id="timer_ww_MO" typeId="timer"> - <label>Monday hotwatertimer</label> + <label>Monday Hot Water Timer</label> <description>On/Off timer for Monday. Up to 4 timers can be set</description> <properties> <property name="address">2100</property> @@ -194,7 +194,7 @@ </properties> </channel> <channel id="timer_ww_TU" typeId="timer"> - <label>Tuesday hotwatertimer</label> + <label>Tuesday Hot Water Timer</label> <description>On/Off timer for Tuesday. Up to 4 timers can be set</description> <properties> <property name="address">2108</property> @@ -203,7 +203,7 @@ </properties> </channel> <channel id="timer_ww_WE" typeId="timer"> - <label>Wednesday hotwatertimer</label> + <label>Wednesday Hot Water Timer</label> <description>On/Off timer for Wednesday. Up to 4 timers can be set</description> <properties> <property name="address">2110</property> @@ -212,7 +212,7 @@ </properties> </channel> <channel id="timer_ww_TH" typeId="timer"> - <label>Thursday hotwatertimer</label> + <label>Thursday Hot Water Timer</label> <description>On/Off timer for Thursday. Up to 4 timers can be set</description> <properties> <property name="address">2118</property> @@ -221,7 +221,7 @@ </properties> </channel> <channel id="timer_ww_FR" typeId="timer"> - <label>Friday hotwatertimer</label> + <label>Friday Hot Water Timer</label> <description>On/Off timer for Friday. Up to 4 timers can be set</description> <properties> <property name="address">2120</property> @@ -230,7 +230,7 @@ </properties> </channel> <channel id="timer_ww_SA" typeId="timer"> - <label>Saturday hotwatertimer</label> + <label>Saturday Hot Water Timer</label> <description>On/Off timer for Saturday. Up to 4 timers can be set</description> <properties> <property name="address">2128</property> @@ -239,7 +239,7 @@ </properties> </channel> <channel id="timer_ww_SU" typeId="timer"> - <label>Sunday hotwatertimer</label> + <label>Sunday Hot Water Timer</label> <description>On/Off timer for Sunday. Up to 4 timers can be set</description> <properties> <property name="address">2130</property> @@ -309,7 +309,7 @@ <channel-type id="systemtime"> <item-type>DateTime</item-type> - <label>DateTime of the heating system</label> + <label>DateTime of the Heating System</label> <state readOnly="true" /> </channel-type> @@ -346,7 +346,7 @@ <channel-type id="exhaust_temp"> <item-type>Number</item-type> - <label>Exhaust temperature</label> + <label>Exhaust Temperature</label> <description>Actual temperature of the exhaust</description> <category>Temperature</category> <state pattern="%.1f °C" readOnly="true" /> @@ -392,14 +392,14 @@ <channel-type id="fanspeed"> <item-type>Number</item-type> - <label>Fan speed</label> + <label>Fan Speed</label> <description>Fan Speed in rpm</description> <state pattern="%d rpm" readOnly="true" /> </channel-type> <channel-type id="fanspeed_target" advanced="true"> <item-type>Number</item-type> - <label>Target Fan speed</label> + <label>Target Fan Speed</label> <description>Fan Speed in rpm</description> <state pattern="%d rpm" readOnly="true" /> </channel-type> @@ -589,7 +589,7 @@ <channel-type id="timer" advanced="true"> <item-type>String</item-type> - <label>Timer for heating or warm water</label> + <label>Timer for Heating or Warm Water</label> <state pattern="%s" readOnly="true" /> </channel-type> @@ -613,21 +613,21 @@ <channel-type id="bufferload"> <item-type>Switch</item-type> - <label>Buffer load pump</label> + <label>Buffer Load Pump</label> <description>State of the pump (on/off)</description> <state readOnly="true" /> </channel-type> <channel-type id="loadsuppression" advanced="true"> <item-type>Switch</item-type> - <label>Load suppression</label> + <label>Load Suppression</label> <description>State of the load suppression (on/off)</description> <state readOnly="true" /> </channel-type> <channel-type id="producedheat" advanced="true"> <item-type>Number</item-type> - <label>Produced heat</label> + <label>Produced Heat</label> <description>Produced heat since starting solar system</description> <state pattern="%.2f kWh" readOnly="true" /> </channel-type> diff --git a/bundles/org.openhab.binding.volvooncall/NOTICE b/bundles/org.openhab.binding.volvooncall/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.volvooncall/NOTICE +++ b/bundles/org.openhab.binding.volvooncall/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.volvooncall/README.md b/bundles/org.openhab.binding.volvooncall/README.md index 1c07b5795da5f..1f1cedfc21d42 100644 --- a/bundles/org.openhab.binding.volvooncall/README.md +++ b/bundles/org.openhab.binding.volvooncall/README.md @@ -20,7 +20,7 @@ The binding has no configuration options itself, all configuration is done at 'T The 'VolvoOnCall API' bridge uses the owner's email address and password in order to access the VOC Remote API. This is the same email address and password as used in the VolvoOnCall smartphone app, that allows to remotely control your car(s). -Once the bridge created, you'll be able to launch discovery of the vehicles attached to it. +Once the bridge created, you will be able to launch discovery of the vehicles attached to it. ## Channels @@ -94,15 +94,28 @@ sitemap voc label="Volvo On Call" { ## Rule Actions -Multiple actions are supported by this binding. In classic rules these are accessible as shown in this example (adjust getActions with your ThingId): +Multiple actions are supported by this binding. In classic rules these are accessible as shown in the example below: -Example +Example 1a: If Thing has been created using autodiscovery ``` - val actions = getActions("volvooncall","volvooncall:vehicle:myVinNumber") + val actions = getActions("volvooncall","volvooncall:vehicle:thingId") if(null === actions) { logInfo("actions", "Actions not found, check thing ID") return + } else { + actions.openCarCommand() + } +``` +Example 1b: If Thing has been created using script + +``` + val actions = getActions("volvooncall","volvooncall:vehicle:bridgeId:thingId") + if(null === actions) { + logInfo("actions", "Actions not found, check thing ID") + return + } else { + actions.openCarCommand() } ``` @@ -126,11 +139,19 @@ Sends the command to start the engine for a given runtime. Default 5 minutes. ### heaterStartCommand() -Sends the command to start the car heater. +Sends the command to start the car heater (if remoteHeaterSupported). ### heaterStopCommand() -Sends the command to stop the car heater. +Sends the command to stop the car heater (if remoteHeaterSupported). + + ### preclimatizationStartCommand() + +Sends the command to start the car heater (if preclimatizationSupported). + + ### preclimatizationStopCommand() + +Sends the command to stop the car heater (if preclimatizationSupported). ### honkBlinkCommand(honk, blink) diff --git a/bundles/org.openhab.binding.volvooncall/pom.xml b/bundles/org.openhab.binding.volvooncall/pom.xml index fde81e88c448c..bf2a3fa053931 100644 --- a/bundles/org.openhab.binding.volvooncall/pom.xml +++ b/bundles/org.openhab.binding.volvooncall/pom.xml @@ -1,11 +1,11 @@ -<?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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.volvooncall</artifactId> diff --git a/bundles/org.openhab.binding.volvooncall/src/main/feature/feature.xml b/bundles/org.openhab.binding.volvooncall/src/main/feature/feature.xml index 15886900a2ba3..860c11cba7993 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.volvooncall/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.astro-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-volvooncall" description="Volvo On Call Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallBindingConstants.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallBindingConstants.java index 5bf330c2c5532..5c5a1b154aba2 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallBindingConstants.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallHandlerFactory.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallHandlerFactory.java index 83a58859510a1..26cf351f91e66 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallHandlerFactory.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/VolvoOnCallHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/action/VolvoOnCallActions.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/action/VolvoOnCallActions.java index 6023a7a484d1e..ae54c02f1934d 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/action/VolvoOnCallActions.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/action/VolvoOnCallActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -125,6 +125,24 @@ public static void heaterStartCommand(@Nullable ThingActions actions) { } } + @RuleAction(label = "Volvo On Call : Preclimatization Start", description = "Starts car heater") + public void preclimatizationStartCommand() { + logger.debug("preclimatizationStartCommand called"); + if (handler != null) { + handler.actionPreclimatization(true); + } else { + logger.warn("VolvoOnCall Action service ThingHandler is null!"); + } + } + + public static void preclimatizationStartCommand(@Nullable ThingActions actions) { + if (actions instanceof VolvoOnCallActions) { + ((VolvoOnCallActions) actions).preclimatizationStartCommand(); + } else { + throw new IllegalArgumentException("Instance is not an VolvoThingActionsService class."); + } + } + @RuleAction(label = "Volvo On Call : Heater Stop", description = "Stops car heater") public void heaterStopCommand() { logger.debug("heaterStopCommand called"); @@ -143,6 +161,24 @@ public static void heaterStopCommand(@Nullable ThingActions actions) { } } + @RuleAction(label = "Volvo On Call : Preclimatization Stop", description = "Stops car heater") + public void preclimatizationStopCommand() { + logger.debug("preclimatizationStopCommand called"); + if (handler != null) { + handler.actionPreclimatization(false); + } else { + logger.warn("VolvoOnCall Action service ThingHandler is null!"); + } + } + + public static void preclimatizationStopCommand(@Nullable ThingActions actions) { + if (actions instanceof VolvoOnCallActions) { + ((VolvoOnCallActions) actions).preclimatizationStopCommand(); + } else { + throw new IllegalArgumentException("Instance is not an VolvoThingActionsService class."); + } + } + @RuleAction(label = "Volvo On Call : Honk-blink", description = "Activates the horn and or lights of the car") public void honkBlinkCommand(@ActionInput(name = "honk", label = "Honk") Boolean honk, @ActionInput(name = "blink", label = "Blink") Boolean blink) { @@ -161,5 +197,4 @@ public static void honkBlinkCommand(@Nullable ThingActions actions, Boolean honk throw new IllegalArgumentException("Instance is not an VolvoThingActionsService class."); } } - } diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VehicleConfiguration.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VehicleConfiguration.java index 6af733e87a9b5..8422d0983236e 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VehicleConfiguration.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VehicleConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VolvoOnCallBridgeConfiguration.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VolvoOnCallBridgeConfiguration.java index 97288c61a1092..7388cc4f29104 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VolvoOnCallBridgeConfiguration.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/config/VolvoOnCallBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/discovery/VolvoOnCallDiscoveryService.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/discovery/VolvoOnCallDiscoveryService.java index 408c949c3d5da..69620a75f49de 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/discovery/VolvoOnCallDiscoveryService.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/discovery/VolvoOnCallDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/AccountVehicleRelation.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/AccountVehicleRelation.java index ed74aae20979e..70460d19abb02 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/AccountVehicleRelation.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/AccountVehicleRelation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Attributes.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Attributes.java index 7375048c4c82b..7c1bcafa82819 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Attributes.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Attributes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/CustomerAccounts.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/CustomerAccounts.java index fd7c2705a8850..a123dd8f083cc 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/CustomerAccounts.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/CustomerAccounts.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/DoorsStatus.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/DoorsStatus.java index 6ae2db5623530..1f191c6b3304f 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/DoorsStatus.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/DoorsStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/ERSStatus.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/ERSStatus.java index cd33cdfe1f0d7..9a7b31bd9f662 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/ERSStatus.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/ERSStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Position.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Position.java index 5f1aeaebc3977..cb630d16dc97f 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Position.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Position.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PositionData.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PositionData.java index e8cc0cef7b96b..39e10e7dfdaaa 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PositionData.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PositionData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PostResponse.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PostResponse.java index 89151251d7a7b..828c18c7829fe 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PostResponse.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/PostResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Status.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Status.java index f28d119d8b867..e1a39d3867041 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Status.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Status.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trip.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trip.java index 1d1fc8e947d03..43d908f31be90 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trip.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trip.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TripDetail.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TripDetail.java index 114ae2dab6963..c9375d4364a6d 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TripDetail.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TripDetail.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trips.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trips.java index 8bcfa0364ded5..5c886684771b9 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trips.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Trips.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TyrePressure.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TyrePressure.java index 6cc705ada89e8..317f8b871dbad 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TyrePressure.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/TyrePressure.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Vehicles.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Vehicles.java index 64710bc243221..4fe7fcd2954b9 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Vehicles.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/Vehicles.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/WindowsStatus.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/WindowsStatus.java index f5034748cf5c0..33a94ccda55ee 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/WindowsStatus.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/dto/WindowsStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleHandler.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleHandler.java index 97373dced2cf9..75db58a5a1a82 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleHandler.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -217,6 +217,8 @@ public void handleCommand(ChannelUID channelUID, Command command) { actionStart(5); } else if (REMOTE_HEATER.equals(channelID)) { actionHeater(onOffCommand == OnOffType.ON); + } else if (PRECLIMATIZATION.equals(channelID)) { + actionPreclimatization(onOffCommand == OnOffType.ON); } else if (CAR_LOCKED.equals(channelID)) { if (onOffCommand == OnOffType.ON) { actionClose(); @@ -362,7 +364,8 @@ private void actionOpenClose(String action, OnOffType controlState) { if (activeOptions.containsKey(action)) { if (vehicleStatus.carLocked != controlState) { try { - bridgeHandler.postURL(SERVICE_URL + "vehicles/" + configuration.vin + "/" + action, null); + String address = SERVICE_URL + "vehicles/" + configuration.vin + "/" + action; + bridgeHandler.postURL(address, "{}"); } catch (JsonSyntaxException | IOException e) { logger.warn("Exception occurred during execution: {}", e.getMessage(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); @@ -381,8 +384,15 @@ private void actionHeater(String action, Boolean start) { if (bridgeHandler != null) { if (activeOptions.containsKey(action)) { try { - String command = start ? "start" : "stop"; - bridgeHandler.postURL(SERVICE_URL + "vehicles/" + configuration.vin + "/heater/" + command, null); + if (action.contains(REMOTE_HEATER)) { + String command = start ? "start" : "stop"; + String address = SERVICE_URL + "vehicles/" + configuration.vin + "/heater/" + command; + bridgeHandler.postURL(address, start ? "{}" : null); + } else if (action.contains(PRECLIMATIZATION)) { + String command = start ? "start" : "stop"; + String address = SERVICE_URL + "vehicles/" + configuration.vin + "/preclimatization/" + command; + bridgeHandler.postURL(address, start ? "{}" : null); + } } catch (JsonSyntaxException | IOException e) { logger.warn("Exception occurred during execution: {}", e.getMessage(), e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); @@ -397,6 +407,10 @@ public void actionHeater(Boolean start) { actionHeater(REMOTE_HEATER, start); } + public void actionPreclimatization(Boolean start) { + actionHeater(PRECLIMATIZATION, start); + } + public void actionOpen() { actionOpenClose(UNLOCK, OnOffType.OFF); } @@ -409,8 +423,8 @@ public void actionStart(Integer runtime) { VolvoOnCallBridgeHandler bridgeHandler = getBridgeHandler(); if (bridgeHandler != null) { if (activeOptions.containsKey(ENGINE_START)) { - String url = new String(SERVICE_URL + "vehicles/" + vehicle.vehicleId + "/engine/start"); - String json = new String("{\"runtime\":" + runtime.toString() + "}"); + String url = SERVICE_URL + "vehicles/" + vehicle.vehicleId + "/engine/start"; + String json = "{\"runtime\":" + runtime.toString() + "}"; try { bridgeHandler.postURL(url, json); @@ -451,5 +465,4 @@ public void updateIfMatches(String vin) { public Collection<Class<? extends ThingHandlerService>> getServices() { return Collections.singletonList(VolvoOnCallActions.class); } - } diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java index 64c52769d5840..df41dd0fcdd95 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VehicleStateDescriptionProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VolvoOnCallBridgeHandler.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VolvoOnCallBridgeHandler.java index 0347dde540fc4..0b273471c9d5c 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VolvoOnCallBridgeHandler.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/handler/VolvoOnCallBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -67,9 +67,11 @@ public VolvoOnCallBridgeHandler(Bridge bridge) { super(bridge); httpHeader.put("cache-control", "no-cache"); - httpHeader.put("X-OS-Type", "Android"); - httpHeader.put("X-Originator-Type", "App"); - httpHeader.put("Content-Type", JSON_CONTENT_TYPE); + httpHeader.put("content-type", JSON_CONTENT_TYPE); + httpHeader.put("x-device-id", "Device"); + httpHeader.put("x-originator-type", "App"); + httpHeader.put("x-os-type", "Android"); + httpHeader.put("x-os-version", "22"); gson = new GsonBuilder() .registerTypeAdapter(ZonedDateTime.class, @@ -159,6 +161,7 @@ public void run() { public void postURL(String URL, @Nullable String body) throws IOException, JsonSyntaxException { InputStream inputStream = body != null ? new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8)) : null; String jsonString = HttpUtil.executeUrl("POST", URL, httpHeader, inputStream, null, REQUEST_TIMEOUT); + logger.debug("Post URL: {} Attributes {}", URL, httpHeader); PostResponse postResponse = gson.fromJson(jsonString, PostResponse.class); if (postResponse.errorLabel == null) { pendingActions diff --git a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/wrapper/VehiclePositionWrapper.java b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/wrapper/VehiclePositionWrapper.java index c296a21d56cee..5461f88cfaf72 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/wrapper/VehiclePositionWrapper.java +++ b/bundles/org.openhab.binding.volvooncall/src/main/java/org/openhab/binding/volvooncall/internal/wrapper/VehiclePositionWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/binding/binding.xml index 3657e7152e30b..cfc5fedfbb8bc 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="volvooncall" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>VolvoOnCall Binding</name> <description>This binding enables the access to VolvoOnCall features.</description> diff --git a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/config/config.xml index 95661bc7181d4..10d60607bb718 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/config/config.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:config-description="http://eclipse.org/smarthome/schemas/config-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/config-description/v1.0.0 - http://eclipse.org/smarthome/schemas/config-description-1.0.0.xsd"> + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 + https://openhab.org/schemas/config-description-1.0.0.xsd"> <config-description uri="thing-type:volvooncall:vocapi"> <parameter name="username" type="text"> diff --git a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/bridge.xml index 221763ef46765..84174a8e89567 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="volvooncall" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- VOC API Bridge --> <bridge-type id="vocapi"> diff --git a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/vehicle.xml b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/vehicle.xml index d13241e14cb32..ac3dd34a187b3 100644 --- a/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/vehicle.xml +++ b/bundles/org.openhab.binding.volvooncall/src/main/resources/ESH-INF/thing/vehicle.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="volvooncall" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Volvo Vehicle --> <thing-type id="vehicle"> @@ -67,7 +67,7 @@ <label>End Time</label> <description>Trip end time</description> </channel> - <channel id="tripDuration" typeId="tripDuration"/> + <channel id="tripDuration" typeId="tripDuration" /> <channel id="tripStartOdometer" typeId="odometer"> <label>Start Odometer</label> </channel> @@ -75,12 +75,12 @@ <label>Stop Odometer</label> </channel> <channel id="startPosition" typeId="location"> - <label>From</label> - <description>Starting location of the car</description> + <label>From</label> + <description>Starting location of the car</description> </channel> <channel id="endPosition" typeId="location"> - <label>To</label> - <description>Stopping location of the car</description> + <label>To</label> + <description>Stopping location of the car</description> </channel> </channels> </channel-group-type> @@ -88,22 +88,22 @@ <channel-group-type id="doors"> <label>Doors Opening Status</label> <channels> - <channel id="tailgate" typeId="door" > + <channel id="tailgate" typeId="door"> <label>Tailgate</label> </channel> - <channel id="rearRight" typeId="door" > - <label>Rear right</label> + <channel id="rearRight" typeId="door"> + <label>Rear Right</label> </channel> - <channel id="rearLeft" typeId="door" > - <label>Rear left</label> + <channel id="rearLeft" typeId="door"> + <label>Rear Left</label> </channel> - <channel id="frontRight" typeId="door" > - <label>Front right</label> + <channel id="frontRight" typeId="door"> + <label>Front Right</label> </channel> - <channel id="frontLeft" typeId="door" > - <label>Front left</label> + <channel id="frontLeft" typeId="door"> + <label>Front Left</label> </channel> - <channel id="hood" typeId="door" > + <channel id="hood" typeId="door"> <label>Hood</label> </channel> <channel id="carLocked" typeId="carLocked" /> @@ -116,13 +116,13 @@ <channel id="rearRightWnd" typeId="window"> <label>Rear Right</label> </channel> - <channel id="rearLeftWnd" typeId="window" > + <channel id="rearLeftWnd" typeId="window"> <label>Rear Left</label> </channel> - <channel id="frontRightWnd" typeId="window" > + <channel id="frontRightWnd" typeId="window"> <label>Front Right</label> </channel> - <channel id="frontLeftWnd" typeId="window" > + <channel id="frontLeftWnd" typeId="window"> <label>Front Left</label> </channel> </channels> @@ -142,7 +142,7 @@ </channel-group-type> <channel-group-type id="tank"> - <label>Tank info</label> + <label>Tank Info</label> <channels> <channel id="fuelAmount" typeId="fuelQuantity"> <label>Fuel Amount</label> @@ -162,9 +162,9 @@ <label>Location Info</label> <channels> <channel id="location" typeId="location"> - <label>Location</label> - <description>The position of the vehicle</description> - </channel> + <label>Location</label> + <description>The position of the vehicle</description> + </channel> <channel id="calculatedLocation" typeId="calculatedLocation" /> <channel id="heading" typeId="heading" /> <channel id="locationTimestamp" typeId="timestamp"> @@ -246,7 +246,7 @@ <item-type>DateTime</item-type> <label>Timestamp</label> <description>Data timestamp</description> - <state readOnly="true"/> + <state readOnly="true" /> </channel-type> <channel-type id="engineStart"> @@ -276,28 +276,28 @@ <channel-type id="remoteHeater"> <item-type>Switch</item-type> <label>Remote Heater</label> - <description>(De)Activates remote heater</description> + <description>(De)Activates remote heater</description> + </channel-type> + + <channel-type id="washerFluidLevel"> + <item-type>String</item-type> + <label>Washer Fluid</label> + <description>“VeryLowâ€,"Low", "Normal"</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="serviceWarningStatus"> + <item-type>String</item-type> + <label>Service Warning</label> + <description>Is car service needed ?</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="fuelAlert"> + <item-type>Switch</item-type> + <label>Fuel Alarm</label> + <description>set to 'ON' when the tank level is low</description> + <state readOnly="true" /> </channel-type> - - <channel-type id="washerFluidLevel"> - <item-type>String</item-type> - <label>Washer Fluid</label> - <description>“VeryLowâ€,"Low", "Normal"</description> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="serviceWarningStatus"> - <item-type>String</item-type> - <label>Service Warning</label> - <description>Is car service needed ?</description> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="fuelAlert"> - <item-type>Switch</item-type> - <label>Fuel Alarm</label> - <description>set to 'ON' when the tank level is low</description> - <state readOnly="true" /> - </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.weathercompany/.classpath b/bundles/org.openhab.binding.weathercompany/.classpath new file mode 100644 index 0000000000000..d223a57c7967a --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/.classpath @@ -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> diff --git a/bundles/org.openhab.binding.weathercompany/.project b/bundles/org.openhab.binding.weathercompany/.project new file mode 100644 index 0000000000000..1cd1d716881c1 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.openhab.binding.weathercompany</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> diff --git a/bundles/org.openhab.binding.weathercompany/NOTICE b/bundles/org.openhab.binding.weathercompany/NOTICE new file mode 100644 index 0000000000000..5ecc0bb97a828 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/NOTICE @@ -0,0 +1,20 @@ +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 + +== Third-party Content + +Weather Company Icons +* License: WeatherUnderground Terms of Use +* Project: https://www.wunderground.com/company/legal +* Source: https://docs.google.com/document/d/1dNCf6nF6cjm4oOxQxjtqNuAvG_iEe5f9MQH1xlCeV4s diff --git a/bundles/org.openhab.binding.weathercompany/README.md b/bundles/org.openhab.binding.weathercompany/README.md new file mode 100644 index 0000000000000..7f541c0f1b779 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/README.md @@ -0,0 +1,351 @@ +# The Weather Company Binding + +Provides 5-day weather forecast and *Personal Weather Station* (PWS) current +observations from **The Weather Company**. +This service is available only for PWS users who upload their PWS +weather data to WeatherUnderground. + +## Supported Things + +The following thing types are supported: + +| Thing | ID | Description | +|--------------|----------------------|--------------| +| Account | account | Maintains API key for accessing Weather Company API | +| Forecast | weather-forecast | Provides the Weather Company 5-day forecast | +| Observations | weather-observations | Provides the Personal Weather Station current observations | + +## Discovery + +Once an Account thing is configured with a valid API key, the binding will auto-discover +a *Local Weather Forecast* thing if the location (i.e. latitude and longitude) +and locale are set in the openHAB configuration. + +## Thing Configuration + +### Account + +The following configuration parameters are available on the Account thing: + +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|-------------------|-------------------|-------------| +| API Key | apiKey | Required | Get the API key from your Weather Underground PWS page. Old Weather Underground API keys will not work with this binding. | + +### Weather Forecast + +The following configuration parameters are available on the Weather Forecast thing: + +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|-------------------|----------------------------------------|-------------| +| Location Type | locationType | Required | The following location types are available: Postal Code (postalCode), Geocode (geocode), IATA Code (iataCode). | +| Postal Code | postalCode | Required for Postal Code location type | Available for the following countries: US, UK, DE, FR, IT, CA. The format is a concatenation of the postal code and the 2-character country code (e.g. 10001:US, W6C:CA). | +| Geocode | geocode | Required for Geocode location type | Specify latitude and longitude of the location for which the forecast is desired (e.g. 25.762272,-80.216425). | +| IATA Code | iataCode | Required for IATA Code location type | Three character airport code (e.g. BWI, FCO). | +| Language | language | Optional | Languages supported by The Weather Company API. If the language not specified in the thing configuration, the binding will try to select the language based on the locale set in openHAB. | +| Refresh Interval | refreshInterval | Required | Frequency with which forecast will be updated. Defaults to 30 minutes. Minimum is 2 minutes. | + +### Weather Observations + +The following configuration parameters are available on the Weather Observations thing: + +| Parameter | Parameter ID | Required/Optional | Description | +|------------------|-------------------|-------------------|-------------| +| Station ID | pwsStationId | Required | This is the Personal Weather Station (PWS) station ID on Weather Underground. | +| Refresh Interval | refreshInterval | Required | Frequency with which PWS observations will be updated. Defaults to 30 minutes. Minimum is 2 minutes. | + +## Channels + +#### Channels for Personal Weather Station (PWS) Current Observations + +| Channel ID | Item Type | Description | +|---------------------------------|-------------------------|------------------------------------------| +| observationTimeLocal | DateTime | Time when conditions were observed | +| neighborhood | String | Neighborhood | +| currentTemperature | Number:Temperature | Current temperature | +| currentTemperatureDewPoint | Number:Temperature | Current dew point temperature | +| currentTemperatureHeatIndex | Number:Temperature | Current heat index temperature | +| currentTemperatureWindChill | Number:Temperature | Current wind chill temperature | +| currentHumidity | Number:Dimensionless | Current relative humidity | +| currentPressure | Number:Pressure | Current atmospheric pressure | +| currentPrecipitationRate | Number:Speed | Current precipitation rate | +| currentPrecipitationTotal | Number:Length | Current precipitation total | +| currentSolarRadiation | Number:Intensity | Current solar radiation | +| currentUv | Number | Current UV index | +| currentWindSpeed | Number:Speed | Current wind speed | +| currentWindSpeedGust | Number:Speed | Current wind speed gust | +| currentWindDirection | Number:Angle | Current wind direction | +| stationId | String | Station Id | +| country | String | Country | +| location | Location | Latitude & longitude of weather station | +| elevation | Number:Length | Elevation of weather station | +| qcStatus | Number | QC status | +| softwareType | String | Software type | + +#### Channels for Daily Forecast (Today, Tomorrow, Day 2, Day 3, Day 4, Day 5) + +| Channel Group ID | Channel ID | Item Type | Description | +|------------------------------|---------------------------------|-------------------------|----------------------------------------------------| +| forecastDay(0-5) | dayOfWeek | String | Day of week (Sunday, Monday, etc.) | +| forecastDay(0-5) | narrative | String | Narrative forecast for the 24-hour period | +| forecastDay(0-5) | temperatureMax | Number:Temperature | Daily maximum temperature | +| forecastDay(0-5) | temperatureMin | Number:Temperature | Daily minimum temperature | +| forecastDay(0-5) | precipitationRain | Number:Length | The forecasted measurable liquid precipitation | +| forecastDay(0-5) | precipitationSnow | Number:Length | The forecasted measurable precipitation as snow | +| forecastDay(0-5) | validTimeLocal | DateTime | Time the forecast is valid in local apparent time | +| forecastDay(0-5) | expirationTimeLocal | DateTime | Time the forecast expires | + +#### Channels for Daypart Forecast (Today, Tonight, Tomorrow, Tomorrow Night, etc.) + +| Channel Group ID | Channel ID | Item Type | Description | +|------------------------------|---------------------------------|-------------------------|----------------------------------------------------------------| +| forcastDay(0-5)(Day\|Night) | dayPartName | String | Name of 12 hour daypart (e.g. Today, Tonight) | +| forcastDay(0-5)(Day\|Night) | dayOrNight | String | Day or night indicator (D or N) | +| forcastDay(0-5)(Day\|Night) | narrative | String | The narrative forecast for the daypart period | +| forcastDay(0-5)(Day\|Night) | wxPhraseShort | String | Sensible weather phrase | +| forcastDay(0-5)(Day\|Night) | wxPhraseLong | String | Sensible weather phrase | +| forcastDay(0-5)(Day\|Night) | temperature | Number:Temperature | Maximum temperature for daytime, minimum temperature nighttime | +| forcastDay(0-5)(Day\|Night) | temperatureHeatIndex | Number:Temperature | Maximum heat index | +| forcastDay(0-5)(Day\|Night) | temperatureWindChill | Number:Temperature | Minimum wind chill | +| forcastDay(0-5)(Day\|Night) | relativeHumidity | Number:Dimensionless | The relative humidity of the air | +| forcastDay(0-5)(Day\|Night) | cloudCover | String | Daytime average cloud cover expressed as a percentage | +| forcastDay(0-5)(Day\|Night) | windSpeed | Number:Speed | The maximum forecasted wind speed | +| forcastDay(0-5)(Day\|Night) | windDirection | Number:Angle | Average wind direction in degrees magnetic notation | +| forcastDay(0-5)(Day\|Night) | windDirectionCardinal | String | Average wind direction in cardinal notation | +| forcastDay(0-5)(Day\|Night) | windPhrase | String | A phrase that describes the wind direction and speed | +| forcastDay(0-5)(Day\|Night) | precipitationChance | Number:Dimensionless | Maximum probability of precipitation | +| forcastDay(0-5)(Day\|Night) | precipitationType | String | Type of precipitation to display (e.g. rain, snow) | +| forcastDay(0-5)(Day\|Night) | precipitationRain | Number:Length | The forecasted measurable liquid precipitation | +| forcastDay(0-5)(Day\|Night) | precipitationSnow | Number:Length | The forecasted measurable precipitation as snow | +| forcastDay(0-5)(Day\|Night) | snowRange | String | Snow accumulation amount for the forecast period | +| forcastDay(0-5)(Day\|Night) | thunderCategory | String | The description of probability of thunderstorm activity | +| forcastDay(0-5)(Day\|Night) | thunderIndex | Number | An enumeration of thunderstorm probability | +| forcastDay(0-5)(Day\|Night) | uvDescription | String | Level of risk of skin damage due to exposure | +| forcastDay(0-5)(Day\|Night) | uvIndex | Number | Maximum UV index for the forecast period | +| forcastDay(0-5)(Day\|Night) | iconCode | Number | Key to the weather icon lookup | +| forcastDay(0-5)(Day\|Night) | iconCodeExtend | String | Code representing full set sensible weather | +| forcastDay(0-5)(Day\|Night) | iconImage | Image | Image representing forecast condition | +| forcastDay(0-5)(Day\|Night) | qualifierPhrase | String | Describes special weather criteria | +| forcastDay(0-5)(Day\|Night) | qualifierCode | String | Code for special weather criteria | + +### Local Language Support + +The following channels will be translated to local language based on the language setting in the thing configuration. + +- dayOfWeek +- daypartName +- narrative +- qualifierPhrase +- uvDescription +- windDirectionCardinal +- windPhrase +- wxPhraseLong + + +## Full Example + +### Thing Example + +``` +Bridge weathercompany:account:bridge [ apiKey="734982347982374" ] { + Thing weathercompany:weather-forecast:forecast "Local Forecast" @ "Home" [locationType="postalCode",postalCode="10001:US",language="en_US",refreshInterval=30] + Thing weathercompany:weather-forecast:chitown "Chicago Forecast" @ "Ohare Airport" [apiKey="734982347982374",locationType="iataCode",iataCode="ORD",language="en_US",refreshInterval=30] + Thing weathercompany:weather-forecast:miami "Miami Weather" @ "South Beach" [locationType="postalCode",postalCode="33139:US",language="es_US",refreshInterval=30] + Thing weathercompany:weather-observations:observations "Local Observations" @ "Home" [pwsStationId="KFLMIAMI208",refreshInterval=30] + Thing weathercompany:weather-observations:patagonia "Torres del Paine Weather" @ "Patagonia" [pwsStationId="IPUNTAAR4",refreshInterval=30] +} +``` + +### Items Example + +``` +// PWS Current Observations +Number:Temperature WC_PWS_Temperature "Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-observations:observations:currentTemperature" } +Number:Temperature WC_PWS_TemperatureDewPoint "Dew Point Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-observations:observations:currentTemperatureDewPoint" } +Number:Temperature WC_PWS_TemperatureHeatIndex "Heat Index Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-observations:observations:currentTemperatureHeatIndex" } +Number:Temperature WC_PWS_TemperatureWindChill "Wind Chill Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-observations:observations:currentTemperatureWindChill" } +Number:Dimensionless WC_PWS_RelativeHumidity "Relative Humidity [%.1f %unit%]" <humidity> { channel="weathercompany:weather-observations:observations:currentHumidity" } +Number:Pressure WC_PWS_Pressure "Pressure [%.2f %unit%]" <pressure> { channel="weathercompany:weather-observations:observations:currentPressure" } +// Use this for SI units +Number:Speed WC_PWS_PrecipitationRate "Precipitation Rate [%.1f mm/h]" <rain> { channel="weathercompany:weather-observations:observations:currentPrecipitationRate" } +// Use this for Imperial units +//Number:Speed WC_PWS_PrecipitationRate "Precipitation Rate [%.2f in/h]" <rain> { channel="weathercompany:weather-observations:observations:currentPrecipitationRate" } +Number:Length WC_PWS_PrecipitationTotal "Precipitation Total [%.1f %unit%]" <rain> { channel="weathercompany:weather-observations:observations:currentPrecipitationTotal" } +Number:Intensity WC_PWS_SolarRadiation "Solar Radiation [%.1f %unit%]" <sun> { channel="weathercompany:weather-observations:observations:currentSolarRadiation" } +Number WC_PWS_UV "UV Index [%.0f]" <sun> { channel="weathercompany:weather-observations:observations:currentUv" } +Number:Angle WC_PWS_WindDirection "Wind Direction [%.0f %unit%]" <wind> { channel="weathercompany:weather-observations:observations:currentWindDirection" } +Number:Speed WC_PWS_WindSpeed "Wind Speed [%.0f %unit%]" <wind> { channel="weathercompany:weather-observations:observations:currentWindSpeed" } +Number:Speed WC_PWS_WindSpeedGust "Wind Speed Gust [%.0f %unit%]" <wind> { channel="weathercompany:weather-observations:observations:currentWindSpeedGust" } +String WC_PWS_Country "Country [%s]" <none> { channel="weathercompany:weather-observations:observations:country" } +Location WC_PWS_Location "Lat/Lon [%2$s°N, %3$s°W]" <none> { channel="weathercompany:weather-observations:observations:location" } +Number:Length WC_PWS_Elevation "Elevation [%.0f %unit%]" <none> { channel="weathercompany:weather-observations:observations:elevation" } +String WC_PWS_Neighborhood "Neighborhood [%s]" <none> { channel="weathercompany:weather-observations:observations:neighborhood" } +DateTime WC_PWS_ObservationTimeLocal "Observation Time [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" <time> { channel="weathercompany:weather-observations:observations:observationTimeLocal" } +Number WC_PWS_QcStatus "QC Status [%.0f %unit%]" <none> { channel="weathercompany:weather-observations:observations:qcStatus" } +String WC_PWS_SoftwareType "Software Type [%s]" <none> { channel="weathercompany:weather-observations:observations:softwareType" } +String WC_PWS_StationId "Station Id [%s]" <none> { channel="weathercompany:weather-observations:observations:stationId" } + +// Day 0 - Today +String WC_Day0_DayOfWeek "Day of Week [%s]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0#dayOfWeek" } +DateTime WC_Day0_ValidTimeLocal "Valid At [%1$tA, %1$tm/%1$td/%1$tY]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0#validTimeLocal" } +DateTime WC_Day0_ExpirationTimeLocal "Expires At [%1$tA, %1$tm/%1$td/%1$tY %1$tl:%1$tM %1$tp]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0#expirationTimeLocal" } +String WC_Day0_Narrative "Narrative [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0#narrative" } +Number:Temperature WC_Day0_TemperatureMin "Low Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0#temperatureMin" } +Number:Temperature WC_Day0_TemperatureMax "High Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0#temperatureMax" } +Number:Length WC_Day0_PrecipitationRain "Forecasted Rainfall Amount [%.2f %unit%]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0#precipitationRain" } +Number:Length WC_Day0_PrecipitationSnow "Forecasted Snowfall Amount [%.2f %unit%]" <snow> { channel="weathercompany:weather-forecast:forecast:forecastDay0#precipitationSnow" } + +// Day 0 Day +String WC_Day0_Day_DaypartName "Daypart Name [%s]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#daypartName" } +String WC_Day0_Day_DayOrNight "Day or Night [%s]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#dayOrNight" } +String WC_Day0_Day_Narrative "Narrative [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#narrative" } +String WC_Day0_Day_WxPhraseShort "Wx Phrase Short [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#wxPhraseShort" } +String WC_Day0_Day_WxPhraseLong "Wx Phrase Long [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#wxPhraseLong" } +String WC_Day0_Day_QualifierPhrase "Qualifier Phrase [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#qualifierPhrase" } +String WC_Day0_Day_QualifierCode "Qualifier Code [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#qualifierCode" } +Number:Temperature WC_Day0_Day_Temperature "Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#temperature" } +Number:Temperature WC_Day0_Day_TemperatureHeatIndex "Temperature Heat Index [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#temperatureHeatIndex" } +Number:Temperature WC_Day0_Day_TemperatureWindChill "Temperature Wind Chill [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#temperatureWindChill" } +Number:Dimensionless WC_Day0_Day_RelativeHumidity "Relative Humidity [%.0f %unit%]" <humidity> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#relativeHumidity" } +Number:Dimensionless WC_Day0_Day_CloudCover "Cloud Cover [%.0f %unit%]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#cloudCover" } +Number:Speed WC_Day0_Day_WindSpeed "Wind Speed [%.0f %unit%]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#windSpeed" } +Number:Angle WC_Day0_Day_WindDirection "Wind Direction [%.0f %unit%]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#windDirection" } +String WC_Day0_Day_WindDirectionCardinal "Wind Direction Cardinal [%s]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#windDirectionCardinal" } +String WC_Day0_Day_WindPhrase "Wind Phrase [%s]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#windPhrase" } +Number:Dimensionless WC_Day0_Day_PrecipitationChance "Precipitation Chance [%.0f %unit%]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#precipitationChance" } +String WC_Day0_Day_PrecipitationType "Precipitation Type [%s]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#precipitationType" } +Number:Length WC_Day0_Day_PrecipitationRain "Precipitation Rain [%.2f %unit%]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#precipitationRain" } +Number:Length WC_Day0_Day_PrecipitationSnow "Precipitation Snow [%.2f %unit%]" <snow> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#precipitationSnow" } +String WC_Day0_Day_SnowRange "Snow Range [%s]" <snow> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#snowRange" } +String WC_Day0_Day_ThunderCategory "Thunder Category [%s]" <c_thunder> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#thunderCategory" } +Number WC_Day0_Day_ThunderIndex "Thunder Index [%.0f %unit%]" <c_thunder> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#thunderIndex" } +String WC_Day0_Day_UVDescription "UV Description [%s]" <sun> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#uvDescription" } +Number WC_Day0_Day_UVIndex "UV Index [%.0f %unit%]" <sun> { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#uvIndex" } +Number WC_Day0_Day_IconCode "Icon Code [%.0f %unit%]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#iconCode" } +Number WC_Day0_Day_IconCodeExtend "Icon Code Extend [%.0f %unit%]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#iconCodeExtend" } +Image WC_Day0_Day_IconImage "Icon Image [%s]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Day#iconImage" } + +// Day 0 Night +String WC_Day0_Night_DaypartName "Daypart Name [%s]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#daypartName" } +String WC_Day0_Night_DayOrNight "Day or Night [%s]" <time> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#dayOrNight" } +String WC_Day0_Night_Narrative "Narrative [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#narrative" } +String WC_Day0_Night_WxPhraseShort "Wx Phrase Short [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#wxPhraseShort" } +String WC_Day0_Night_WxPhraseLong "Wx Phrase Long [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#wxPhraseLong" } +String WC_Day0_Night_QualifierPhrase "Qualifier Phrase [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#qualifierPhrase" } +String WC_Day0_Night_QualifierCode "Qualifier Code [%s]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#qualifierCode" } +Number:Temperature WC_Day0_Night_Temperature "Temperature [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#temperature" } +Number:Temperature WC_Day0_Night_TemperatureHeatIndex "Temperature Heat Index [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#temperatureHeatIndex" } +Number:Temperature WC_Day0_Night_TemperatureWindChill "Temperature Wind Chill [%.1f %unit%]" <temperature> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#temperatureWindChill" } +Number:Dimensionless WC_Day0_Night_RelativeHumidity "Relative Humidity [%.0f %unit%]" <humidity> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#relativeHumidity" } +Number:Dimensionless WC_Day0_Night_CloudCover "Cloud Cover [%.0f %unit%]" <sun_clouds> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#cloudCover" } +Number:Speed WC_Day0_Night_WindSpeed "Wind Speed [%.0f %unit%]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#windSpeed" } +Number:Angle WC_Day0_Night_WindDirection "Wind Direction [%.0f %unit%]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#windDirection" } +String WC_Day0_Night_WindDirectionCardinal "Wind Direction Cardinal [%s]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#windDirectionCardinal" } +String WC_Day0_Night_WindPhrase "Wind Phrase [%s]" <wind> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#windPhrase" } +Number:Dimensionless WC_Day0_Night_PrecipitationChance "Precipitation Chance [%.0f %unit%]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#precipitationChance" } +String WC_Day0_Night_PrecipitationType "Precipitation Type [%s]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#precipitationType" } +Number:Length WC_Day0_Night_PrecipitationRain "Precipitation Rain [%.2f %unit%]" <rain> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#precipitationRain" } +Number:Length WC_Day0_Night_PrecipitationSnow "Precipitation Snow [%.2f %unit%]" <snow> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#precipitationSnow" } +String WC_Day0_Night_SnowRange "Snow Range [%s]" <snow> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#snowRange" } +String WC_Day0_Night_ThunderCategory "Thunder Category [%s]" <c_thunder> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#thunderCategory" } +Number WC_Day0_Night_ThunderIndex "Thunder Index [%.0f %unit%]" <c_thunder> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#thunderIndex" } +String WC_Day0_Night_UVDescription "UV Description [%s]" <sun> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#uvDescription" } +Number WC_Day0_Night_UVIndex "UV Index [%.0f %unit%]" <sun> { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#uvIndex" } +Number WC_Day0_Night_IconCode "Icon Code [%.0f %unit%]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#iconCode" } +Number WC_Day0_Night_IconCodeExtend "Icon Code Extend [%.0f %unit%]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#iconCodeExtend" } +Image WC_Day0_Night_IconImage "Icon Image [%s]" { channel="weathercompany:weather-forecast:forecast:forecastDay0Night#iconImage" } +``` + +### Sitemap Example + +``` +Frame { + Text label="The Weather Company Forecast" { + Frame label="PWS Current Conditions" { + Text item=WC_PWS_Neighborhood + Text item=WC_PWS_ObservationTimeLocal + Text item=WC_PWS_Temperature + Text item=WC_PWS_TemperatureDewPoint + Text item=WC_PWS_TemperatureHeatIndex + Text item=WC_PWS_TemperatureWindChill + Text item=WC_PWS_RelativeHumidity + Text item=WC_PWS_Pressure + Text item=WC_PWS_PrecipitationRate + Text item=WC_PWS_PrecipitationTotal + Text item=WC_PWS_SolarRadiation + Text item=WC_PWS_UV + Text item=WC_PWS_WindDirection + Text item=WC_PWS_WindSpeed + Text item=WC_PWS_WindSpeedGust + Text item=WC_PWS_StationId + Text item=WC_PWS_Country + Text item=WC_PWS_Location + Text item=WC_PWS_Elevation + Text item=WC_PWS_QcStatus + Text item=WC_PWS_SoftwareType + } + Frame label="Day 0 (Today)" { + Text item=WC_Day0_DayOfWeek + Text item=WC_Day0_Narrative + Text item=WC_Day0_TemperatureMin + Text item=WC_Day0_TemperatureMax + Text item=WC_Day0_PrecipitationRain + Text item=WC_Day0_PrecipitationSnow + Text item=WC_Day0_ValidTimeLocal + Text item=WC_Day0_ExpirationTimeLocal + } + Frame { + Text item=WC_Day0_Day_DaypartName + Text item=WC_Day0_Day_Narrative + Text item=WC_Day0_Day_WxPhraseShort + Text item=WC_Day0_Day_WxPhraseLong + Text item=WC_Day0_Day_QualifierCode + Text item=WC_Day0_Day_QualifierPhrase + Text item=WC_Day0_Day_Temperature + Text item=WC_Day0_Day_TemperatureHeatIndex + Text item=WC_Day0_Day_TemperatureWindChill + Text item=WC_Day0_Day_RelativeHumidity + Text item=WC_Day0_Day_PrecipitationChance + Text item=WC_Day0_Day_PrecipitationType + Text item=WC_Day0_Day_PrecipitationRain + Text item=WC_Day0_Day_PrecipitationSnow + Text item=WC_Day0_Day_SnowRange + Text item=WC_Day0_Day_CloudCover + Text item=WC_Day0_Day_WindSpeed + Text item=WC_Day0_Day_WindDirection + Text item=WC_Day0_Day_WindDirectionCardinal + Text item=WC_Day0_Day_WindSpeed + Text item=WC_Day0_Day_ThunderCategory + Text item=WC_Day0_Day_ThunderIndex + Text item=WC_Day0_Day_UVDescription + Text item=WC_Day0_Day_UVIndex + Image item=WC_Day0_Day_IconImage + } + Frame { + Text item=WC_Day0_Night_DaypartName + Text item=WC_Day0_Night_Narrative + Text item=WC_Day0_Night_WxPhraseShort + Text item=WC_Day0_Night_WxPhraseLong + Text item=WC_Day0_Night_QualifierCode + Text item=WC_Day0_Night_QualifierPhrase + Text item=WC_Day0_Night_Temperature + Text item=WC_Day0_Night_TemperatureHeatIndex + Text item=WC_Day0_Night_TemperatureWindChill + Text item=WC_Day0_Night_RelativeHumidity + Text item=WC_Day0_Night_PrecipitationChance + Text item=WC_Day0_Night_PrecipitationType + Text item=WC_Day0_Night_PrecipitationRain + Text item=WC_Day0_Night_PrecipitationSnow + Text item=WC_Day0_Night_SnowRange + Text item=WC_Day0_Night_CloudCover + Text item=WC_Day0_Night_WindSpeed + Text item=WC_Day0_Night_WindDirection + Text item=WC_Day0_Night_WindDirectionCardinal + Text item=WC_Day0_Night_WindSpeed + Text item=WC_Day0_Night_ThunderCategory + Text item=WC_Day0_Night_ThunderIndex + Text item=WC_Day0_Night_UVDescription + Text item=WC_Day0_Night_UVIndex + Image item=WC_Day0_Night_IconImage + } + } +``` diff --git a/bundles/org.openhab.binding.weathercompany/pom.xml b/bundles/org.openhab.binding.weathercompany/pom.xml new file mode 100644 index 0000000000000..bedf518db59a4 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/pom.xml @@ -0,0 +1,15 @@ +<?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/maven-v4_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.2-SNAPSHOT</version> + </parent> + + <artifactId>org.openhab.binding.weathercompany</artifactId> + + <name>openHAB Add-ons :: Bundles :: WeatherCompany Binding</name> + +</project> diff --git a/bundles/org.openhab.binding.weathercompany/src/main/feature/feature.xml b/bundles/org.openhab.binding.weathercompany/src/main/feature/feature.xml new file mode 100644 index 0000000000000..38376c528c84d --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/feature/feature.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<features name="org.openhab.binding.weathercompany-${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-weathercompany" description="Weather Company Binding" version="${project.version}"> + <feature>openhab-runtime-base</feature> + <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.weathercompany/${project.version}</bundle> + </feature> +</features> diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyBindingConstants.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyBindingConstants.java new file mode 100644 index 0000000000000..3e73207b77720 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyBindingConstants.java @@ -0,0 +1,137 @@ +/** + * 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.weathercompany.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 {@link WeatherCompanyBindingConstants} class defines common constants, which are + * used across the whole binding. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyBindingConstants { + private static final String BINDING_ID = "weathercompany"; + + // Bridge + public static final String THING_TYPE_BRIDGE = "account"; + public static final ThingTypeUID UID_BRIDGE = new ThingTypeUID(BINDING_ID, THING_TYPE_BRIDGE); + public static final Set<ThingTypeUID> SUPPORTED_BRIDGE_THING_TYPES_UIDS = Collections + .unmodifiableSet(Stream.of(UID_BRIDGE).collect(Collectors.toSet())); + + // Thing Types + public static final ThingTypeUID THING_TYPE_WEATHER_OBSERVATIONS = new ThingTypeUID(BINDING_ID, + "weather-observations"); + public static final ThingTypeUID THING_TYPE_WEATHER_FORECAST = new ThingTypeUID(BINDING_ID, "weather-forecast"); + + // Collection of weather station thing types + public static final Set<ThingTypeUID> SUPPORTED_WEATHER_THING_TYPES_UIDS = Collections.unmodifiableSet( + Stream.of(THING_TYPE_WEATHER_OBSERVATIONS, THING_TYPE_WEATHER_FORECAST).collect(Collectors.toSet())); + + // Collection of all supported thing types + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.unmodifiableSet( + Stream.concat(SUPPORTED_BRIDGE_THING_TYPES_UIDS.stream(), SUPPORTED_WEATHER_THING_TYPES_UIDS.stream()) + .collect(Collectors.toSet())); + + // Thing configuration + public static final String CONFIG_LOCATION_TYPE = "locationType"; + public static final String CONFIG_LOCATION_TYPE_GEOCODE = "geocode"; + public static final String CONFIG_LOCATION_TYPE_POSTAL_CODE = "postalCode"; + public static final String CONFIG_LOCATION_TYPE_IATA_CODE = "iataCode"; + public static final String CONFIG_GEOCODE = "geocode"; + public static final String CONFIG_POSTAL_CODE = "postalCode"; + public static final String CONFIG_IATA_CODE = "iataCode"; + public static final String CONFIG_LANGUAGE = "language"; + public static final String CONFIG_LANGUAGE_DEFAULT = "en-US"; + public static final String CONFIG_PWS_STATION_ID = "pwsStationId"; + + // Used to sanitize the API key in the URL in debug log messages + public static final String REPLACE_API_KEY = "XXXXXXXXXXXXXXXXXXXXX"; + + // List of pwsObservations channel IDs + public static final String CH_PWS_HUMIDITY = "currentHumidity"; + public static final String CH_PWS_PRECIPTATION_RATE = "currentPrecipitationRate"; + public static final String CH_PWS_PRECIPITATION_TOTAL = "currentPrecipitationTotal"; + public static final String CH_PWS_PRESSURE = "currentPressure"; + public static final String CH_PWS_SOLAR_RADIATION = "currentSolarRadiation"; + public static final String CH_PWS_TEMP = "currentTemperature"; + public static final String CH_PWS_TEMP_DEW_POINT = "currentTemperatureDewPoint"; + public static final String CH_PWS_TEMP_HEAT_INDEX = "currentTemperatureHeatIndex"; + public static final String CH_PWS_TEMP_WIND_CHILL = "currentTemperatureWindChill"; + public static final String CH_PWS_UV = "currentUv"; + public static final String CH_PWS_WIND_DIRECTION = "currentWindDirection"; + public static final String CH_PWS_WIND_SPEED = "currentWindSpeed"; + public static final String CH_PWS_WIND_GUST = "currentWindSpeedGust"; + public static final String CH_PWS_COUNTRY = "country"; + public static final String CH_PWS_LOCATION = "location"; + public static final String CH_PWS_ELEVATION = "elevation"; + public static final String CH_PWS_NEIGHBORHOOD = "neighborhood"; + public static final String CH_PWS_OBSERVATION_TIME_LOCAL = "observationTimeLocal"; + public static final String CH_PWS_QC_STATUS = "qcStatus"; + public static final String CH_PWS_SOFTWARE_TYPE = "softwareType"; + public static final String CH_PWS_STATION_ID = "stationId"; + + // Channel group forecastDay + public static final String CH_GROUP_FORECAST_DAY = "forecastDay"; + + // List of forecastDay channel IDs + public static final String CH_DAY_OF_WEEK = "dayOfWeek"; + public static final String CH_VALID_TIME_LOCAL = "validTimeLocal"; + public static final String CH_EXPIRATION_TIME_LOCAL = "expirationTimeLocal"; + public static final String CH_NARRATIVE = "narrative"; + public static final String CH_TEMP_MIN = "temperatureMin"; + public static final String CH_TEMP_MAX = "temperatureMax"; + public static final String CH_PRECIP_RAIN = "precipitationRain"; + public static final String CH_PRECIP_SNOW = "precipitationSnow"; + + // Channel group forecastDaypart + public static final String CH_GROUP_FORECAST_DAYPART_DAY = "Day"; + public static final String CH_GROUP_FORECAST_DAYPART_NIGHT = "Night"; + + // List of forecastDaypart channel IDs + public static final String CH_DP_NAME = "daypartName"; + public static final String CH_DP_DAY_OR_NIGHT = "dayOrNight"; + public static final String CH_DP_NARRATIVE = "narrative"; + public static final String CH_DP_WX_PHRASE_SHORT = "wxPhraseShort"; + public static final String CH_DP_WX_PHRASE_LONG = "wxPhraseLong"; + public static final String CH_DP_TEMP = "temperature"; + public static final String CH_DP_TEMP_HEAT_INDEX = "temperatureHeatIndex"; + public static final String CH_DP_TEMP_WIND_CHILL = "temperatureWindChill"; + public static final String CH_DP_HUMIDITY = "relativeHumidity"; + public static final String CH_DP_CLOUD_COVER = "cloudCover"; + public static final String CH_DP_WIND_SPEED = "windSpeed"; + public static final String CH_DP_WIND_DIR = "windDirection"; + public static final String CH_DP_WIND_DIR_CARDINAL = "windDirectionCardinal"; + public static final String CH_DP_WIND_PHRASE = "WindPhrase"; + public static final String CH_DP_PRECIP_CHANCE = "precipitationChance"; + public static final String CH_DP_PRECIP_TYPE = "precipitationType"; + public static final String CH_DP_PRECIP_RAIN = "precipitationRain"; + public static final String CH_DP_PRECIP_SNOW = "precipitationSnow"; + public static final String CH_DP_SNOW_RANGE = "snowRange"; + public static final String CH_DP_THUNDER_CATEGORY = "thunderCategory"; + public static final String CH_DP_THUNDER_INDEX = "thunderIndex"; + public static final String CH_DP_UV_DESCRIPTION = "uvDescription"; + public static final String CH_DP_UV_INDEX = "uvIndex"; + public static final String CH_DP_ICON_CODE = "iconCode"; + public static final String CH_DP_ICON_CODE_EXTEND = "iconCodeExtend"; + public static final String CH_DP_ICON_IMAGE = "iconImage"; + public static final String CH_DP_QUALIFIER_PHRASE = "qualifierPhrase"; + public static final String CH_DP_QUALIFIER_CODE = "qualifierCode"; +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyHandlerFactory.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyHandlerFactory.java new file mode 100644 index 0000000000000..22ad115feb5b5 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/WeatherCompanyHandlerFactory.java @@ -0,0 +1,123 @@ +/** + * 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.weathercompany.internal; + +import static org.openhab.binding.weathercompany.internal.WeatherCompanyBindingConstants.*; + +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.config.discovery.DiscoveryService; +import org.eclipse.smarthome.core.i18n.LocaleProvider; +import org.eclipse.smarthome.core.i18n.LocationProvider; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.i18n.UnitProvider; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; +import org.eclipse.smarthome.io.net.http.HttpClientFactory; +import org.openhab.binding.weathercompany.internal.discovery.WeatherCompanyDiscoveryService; +import org.openhab.binding.weathercompany.internal.handler.WeatherCompanyBridgeHandler; +import org.openhab.binding.weathercompany.internal.handler.WeatherCompanyForecastHandler; +import org.openhab.binding.weathercompany.internal.handler.WeatherCompanyObservationsHandler; +import org.osgi.framework.ServiceRegistration; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + +/** + * The {@link WeatherCompanyHandlerFactory} is responsible for creating thing handlers. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +@Component(configurationPid = "binding.weathercompany", service = ThingHandlerFactory.class) +public class WeatherCompanyHandlerFactory extends BaseThingHandlerFactory { + private final Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + + private TimeZoneProvider timeZoneProvider; + private UnitProvider unitProvider; + private HttpClient httpClient; + private LocationProvider locationProvider; + private LocaleProvider localeProvider; + + @Activate + public WeatherCompanyHandlerFactory(@Reference TimeZoneProvider timeZoneProvider, + @Reference UnitProvider unitProvider, @Reference HttpClientFactory httpClientFactory, + @Reference LocationProvider locationProvider, @Reference LocaleProvider localeProvider) { + this.timeZoneProvider = timeZoneProvider; + this.unitProvider = unitProvider; + this.httpClient = httpClientFactory.getCommonHttpClient(); + this.locationProvider = locationProvider; + this.localeProvider = localeProvider; + } + + @Override + public boolean supportsThingType(ThingTypeUID thingTypeUID) { + return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID); + } + + @Override + protected @Nullable ThingHandler createHandler(Thing thing) { + ThingTypeUID thingTypeUID = thing.getThingTypeUID(); + + if (THING_TYPE_WEATHER_FORECAST.equals(thingTypeUID)) { + return new WeatherCompanyForecastHandler(thing, timeZoneProvider, httpClient, unitProvider, localeProvider); + } else if (THING_TYPE_WEATHER_OBSERVATIONS.equals(thingTypeUID)) { + return new WeatherCompanyObservationsHandler(thing, timeZoneProvider, httpClient, unitProvider, + localeProvider); + } else if (SUPPORTED_BRIDGE_THING_TYPES_UIDS.contains(thingTypeUID)) { + WeatherCompanyBridgeHandler handler = new WeatherCompanyBridgeHandler((Bridge) thing); + registerDeviceDiscoveryService(handler); + return handler; + } + return null; + } + + @Override + protected synchronized void removeHandler(ThingHandler thingHandler) { + if (thingHandler instanceof WeatherCompanyBridgeHandler) { + ThingUID thingUID = thingHandler.getThing().getUID(); + unregisterDeviceDiscoveryService(thingUID); + } + super.removeHandler(thingHandler); + } + + private synchronized void registerDeviceDiscoveryService(WeatherCompanyBridgeHandler bridgeHandler) { + WeatherCompanyDiscoveryService discoveryService = new WeatherCompanyDiscoveryService(bridgeHandler, + locationProvider, localeProvider); + discoveryService.activate(null); + this.discoveryServiceRegs.put(bridgeHandler.getThing().getUID(), + bundleContext.registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<>())); + } + + private void unregisterDeviceDiscoveryService(ThingUID bridgeUID) { + ServiceRegistration<?> serviceReg = discoveryServiceRegs.remove(bridgeUID); + if (serviceReg != null) { + WeatherCompanyDiscoveryService discoveryService = (WeatherCompanyDiscoveryService) bundleContext + .getService(serviceReg.getReference()); + serviceReg.unregister(); + if (discoveryService != null) { + discoveryService.deactivate(); + } + } + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyBridgeConfig.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyBridgeConfig.java new file mode 100644 index 0000000000000..6b35833979997 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyBridgeConfig.java @@ -0,0 +1,29 @@ +/** + * 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.weathercompany.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link WeatherCompanyBridgeConfig} class contains fields mapping thing configuration parameters. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyBridgeConfig { + /** + * API key + */ + public @Nullable String apiKey; +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyForecastConfig.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyForecastConfig.java new file mode 100644 index 0000000000000..286cfddea91ff --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyForecastConfig.java @@ -0,0 +1,61 @@ +/** + * 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.weathercompany.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link WeatherCompanyForecastConfig} class contains fields mapping thing configuration parameters. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyForecastConfig { + /** + * Type of location (postal, geocode, etc.) + */ + public @Nullable String locationType; + + /** + * Postal code + */ + public @Nullable String postalCode; + + /** + * Geocode + */ + public @Nullable String geocode; + + /** + * IATA code + */ + public @Nullable String iataCode; + + /** + * Language + */ + public @Nullable String language; + + /** + * Interval with which forecast will be updated. + */ + public int refreshInterval; + + @Override + public String toString() { + return "WeatherCompanyConfig: { locationType=" + locationType + ", postalCode=" + postalCode + ", geocode=" + + geocode + ", iataCode=" + iataCode + ", language=" + language + ", refreshInterval=" + refreshInterval + + " }"; + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyObservationsConfig.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyObservationsConfig.java new file mode 100644 index 0000000000000..8d1a9b0c9c9f9 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/config/WeatherCompanyObservationsConfig.java @@ -0,0 +1,39 @@ +/** + * 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.weathercompany.internal.config; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + +/** + * The {@link WeatherCompanyObservationsConfig} class contains fields mapping thing configuration parameters. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyObservationsConfig { + /** + * Personal Weather Station Id + */ + public @Nullable String pwsStationId; + + /** + * Interval with which forecast will be updated. + */ + public int refreshInterval; + + @Override + public String toString() { + return "WeatherCompanyConfig: { pwsStationId=" + pwsStationId + ", refreshInterval=" + refreshInterval + " }"; + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/discovery/WeatherCompanyDiscoveryService.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/discovery/WeatherCompanyDiscoveryService.java new file mode 100644 index 0000000000000..858530229e1a0 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/discovery/WeatherCompanyDiscoveryService.java @@ -0,0 +1,124 @@ +/** + * 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.weathercompany.internal.discovery; + +import static org.openhab.binding.weathercompany.internal.WeatherCompanyBindingConstants.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; +import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.core.i18n.LocaleProvider; +import org.eclipse.smarthome.core.i18n.LocationProvider; +import org.eclipse.smarthome.core.library.types.PointType; +import org.eclipse.smarthome.core.thing.ThingUID; +import org.openhab.binding.weathercompany.internal.handler.WeatherCompanyAbstractHandler; +import org.openhab.binding.weathercompany.internal.handler.WeatherCompanyBridgeHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link WeatherCompanyDiscoveryService} creates things based on the location + * configured in openHAB + * + * @author Mark Hilbush - Initial Contribution + */ +@NonNullByDefault +public class WeatherCompanyDiscoveryService extends AbstractDiscoveryService { + // Thing for local weather created during discovery + private static final String LOCAL = "local"; + private static final String LOCAL_WEATHER = "Weather Company Local Forecast"; + + private static final int DISCOVER_TIMEOUT_SECONDS = 4; + private static final int DISCOVERY_INTERVAL_SECONDS = 1200; + + private final Logger logger = LoggerFactory.getLogger(WeatherCompanyDiscoveryService.class); + + private final LocationProvider locationProvider; + private final LocaleProvider localeProvider; + private final WeatherCompanyBridgeHandler bridgeHandler; + + private @Nullable ScheduledFuture<?> discoveryJob; + + /** + * Creates a WeatherCompanyDiscoveryService with discovery enabled + */ + public WeatherCompanyDiscoveryService(WeatherCompanyBridgeHandler bridgeHandler, LocationProvider locationProvider, + LocaleProvider localeProvider) { + super(SUPPORTED_THING_TYPES_UIDS, DISCOVER_TIMEOUT_SECONDS, true); + this.bridgeHandler = bridgeHandler; + this.locationProvider = locationProvider; + this.localeProvider = localeProvider; + } + + @Override + public void activate(@Nullable Map<String, @Nullable Object> configProperties) { + super.activate(configProperties); + logger.debug("Discovery: Activating discovery service for {}", bridgeHandler.getThing().getUID()); + } + + @Override + public void deactivate() { + super.deactivate(); + logger.debug("Discovery: Deactivating discovery service for {}", bridgeHandler.getThing().getUID()); + } + + @Override + protected void startScan() { + logger.debug("Discovery: Starting Weather Company discovery scan"); + createDiscoveryResult(); + stopScan(); + } + + @Override + protected void startBackgroundDiscovery() { + ScheduledFuture<?> job = discoveryJob; + if (job == null || job.isCancelled()) { + job = scheduler.scheduleWithFixedDelay(() -> { + createDiscoveryResult(); + }, 15, DISCOVERY_INTERVAL_SECONDS, TimeUnit.SECONDS); + logger.debug("Discovery: Scheduled Weather Company discovery job to run every {} seconds", + DISCOVERY_INTERVAL_SECONDS); + } + } + + @Override + protected void stopBackgroundDiscovery() { + ScheduledFuture<?> job = discoveryJob; + if (job != null && !job.isCancelled()) { + job.cancel(true); + discoveryJob = null; + logger.debug("Discovery: Stopped Weather Company device background discovery"); + } + } + + private void createDiscoveryResult() { + PointType location = locationProvider.getLocation(); + if (location == null) { + logger.debug("Discovery: Can't create discovery result because location is not set in openHAB"); + return; + } + Map<String, Object> properties = new HashMap<>(3); + properties.put(CONFIG_LOCATION_TYPE, CONFIG_LOCATION_TYPE_GEOCODE); + properties.put(CONFIG_GEOCODE, String.format("%s,%s", location.getLatitude(), location.getLongitude())); + properties.put(CONFIG_LANGUAGE, WeatherCompanyAbstractHandler.lookupLanguage(localeProvider.getLocale())); + ThingUID localWeatherThing = new ThingUID(THING_TYPE_WEATHER_FORECAST, LOCAL); + thingDiscovered(DiscoveryResultBuilder.create(localWeatherThing).withBridge(bridgeHandler.getThing().getUID()) + .withLabel(LOCAL_WEATHER).withProperties(properties).build()); + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyAbstractHandler.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyAbstractHandler.java new file mode 100644 index 0000000000000..5c217aac46ae1 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyAbstractHandler.java @@ -0,0 +1,395 @@ +/** + * 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.weathercompany.internal.handler; + +import static org.eclipse.smarthome.core.library.unit.MetricPrefix.MILLI; +import static org.openhab.binding.weathercompany.internal.WeatherCompanyBindingConstants.CONFIG_LANGUAGE_DEFAULT; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import javax.measure.Unit; +import javax.measure.spi.SystemOfUnits; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.api.ContentResponse; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.http.HttpStatus; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.i18n.UnitProvider; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.PointType; +import org.eclipse.smarthome.core.library.types.QuantityType; +import org.eclipse.smarthome.core.library.types.StringType; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.eclipse.smarthome.core.library.unit.SIUnits; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingStatusInfo; +import org.eclipse.smarthome.core.thing.binding.BaseThingHandler; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +/** + * The {@link WeatherCompanyAbstractHandler} contains common utilities used by + * handlers. + * + * Weather Company API documentation is located here + * - https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/edit + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public abstract class WeatherCompanyAbstractHandler extends BaseThingHandler { + protected static final int WEATHER_COMPANY_API_TIMEOUT_SECONDS = 15; + protected static final int REFRESH_JOB_INITIAL_DELAY_SECONDS = 6; + + private final Logger logger = LoggerFactory.getLogger(WeatherCompanyAbstractHandler.class); + + protected final Gson gson = new GsonBuilder().serializeNulls().create(); + + protected final Map<String, State> weatherDataCache = Collections.synchronizedMap(new HashMap<>()); + + // Provided by handler factory + private final TimeZoneProvider timeZoneProvider; + private final HttpClient httpClient; + private final SystemOfUnits systemOfUnits; + + public WeatherCompanyAbstractHandler(Thing thing, TimeZoneProvider timeZoneProvider, HttpClient httpClient, + UnitProvider unitProvider) { + super(thing); + this.timeZoneProvider = timeZoneProvider; + this.httpClient = httpClient; + this.systemOfUnits = unitProvider.getMeasurementSystem(); + } + + @Override + public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { + if (bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } else { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); + } + } + + protected boolean isBridgeOnline() { + boolean bridgeStatus = false; + Bridge bridge = getBridge(); + if (bridge != null && bridge.getStatus() == ThingStatus.ONLINE) { + bridgeStatus = true; + } + return bridgeStatus; + } + + protected String getApiKey() { + String apiKey = "unknown"; + Bridge bridge = getBridge(); + if (bridge != null && bridge.getStatus() == ThingStatus.ONLINE) { + WeatherCompanyBridgeHandler handler = (WeatherCompanyBridgeHandler) bridge.getHandler(); + if (handler != null) { + String key = handler.getApiKey(); + if (key != null) { + apiKey = key; + } + } + } + return apiKey; + } + + /* + * Set either Imperial or Metric SI for the API call + */ + protected String getUnitsQueryString() { + return isImperial() ? "e" : "s"; + } + + /* + * Determine the units configured in the system + */ + protected boolean isImperial() { + return systemOfUnits instanceof ImperialUnits ? true : false; + } + + protected void updateChannel(String channelId, State state) { + // Only update channel if it's linked + if (isLinked(channelId)) { + updateState(channelId, state); + weatherDataCache.put(channelId, state); + } + } + + /* + * Set the state to the passed value. If value is null, set the state to UNDEF + */ + protected State undefOrString(@Nullable String value) { + return value == null ? UnDefType.UNDEF : new StringType(value); + } + + protected State undefOrDate(@Nullable Integer value) { + return value == null ? UnDefType.UNDEF : getLocalDateTimeType(value); + } + + protected State undefOrDate(@Nullable String value) { + return value == null ? UnDefType.UNDEF : getLocalDateTimeType(value); + } + + protected State undefOrDecimal(@Nullable Number value) { + return value == null ? UnDefType.UNDEF : new DecimalType(value.doubleValue()); + } + + protected State undefOrQuantity(@Nullable Number value, Unit<?> unit) { + return value == null ? UnDefType.UNDEF : new QuantityType<>(value, unit); + } + + protected State undefOrPoint(@Nullable Number lat, @Nullable Number lon) { + return lat != null && lon != null + ? new PointType(new DecimalType(lat.doubleValue()), new DecimalType(lon.doubleValue())) + : UnDefType.UNDEF; + } + + /* + * The API will request units based on openHAB's SystemOfUnits setting. Therefore, + * when setting the QuantityType state, make sure we use the proper unit. + */ + protected Unit<?> getTempUnit() { + return isImperial() ? ImperialUnits.FAHRENHEIT : SIUnits.CELSIUS; + } + + protected Unit<?> getSpeedUnit() { + return isImperial() ? ImperialUnits.MILES_PER_HOUR : SIUnits.KILOMETRE_PER_HOUR; + } + + protected Unit<?> getLengthUnit() { + return isImperial() ? ImperialUnits.INCH : MILLI(SIUnits.METRE); + } + + /* + * Execute the The Weather Channel API request + */ + protected @Nullable String executeApiRequest(@Nullable String url) { + if (url == null) { + logger.debug("Handler: Can't execute request because url is null"); + return null; + } + Request request = httpClient.newRequest(url); + request.timeout(WEATHER_COMPANY_API_TIMEOUT_SECONDS, TimeUnit.SECONDS); + request.method(HttpMethod.GET); + request.header(HttpHeader.ACCEPT, "application/json"); + request.header(HttpHeader.ACCEPT_ENCODING, "gzip"); + + String errorMsg; + try { + ContentResponse contentResponse = request.send(); + switch (contentResponse.getStatus()) { + case HttpStatus.OK_200: + String response = contentResponse.getContentAsString(); + String cacheControl = contentResponse.getHeaders().get(HttpHeader.CACHE_CONTROL); + logger.debug("Cache-Control header is {}", cacheControl); + return response; + case HttpStatus.NO_CONTENT_204: + errorMsg = "HTTP response 400: No content. Check configuration"; + break; + case HttpStatus.BAD_REQUEST_400: + errorMsg = "HTTP response 400: Bad request"; + break; + case HttpStatus.UNAUTHORIZED_401: + errorMsg = "HTTP response 401: Unauthorized"; + break; + case HttpStatus.FORBIDDEN_403: + errorMsg = "HTTP response 403: Invalid API key"; + break; + case HttpStatus.NOT_FOUND_404: + errorMsg = "HTTP response 404: Endpoint not found"; + break; + case HttpStatus.METHOD_NOT_ALLOWED_405: + errorMsg = "HTTP response 405: Method not allowed"; + break; + case HttpStatus.NOT_ACCEPTABLE_406: + errorMsg = "HTTP response 406: Not acceptable"; + break; + case HttpStatus.REQUEST_TIMEOUT_408: + errorMsg = "HTTP response 408: Request timeout"; + break; + case HttpStatus.INTERNAL_SERVER_ERROR_500: + errorMsg = "HTTP response 500: Internal server error"; + break; + case HttpStatus.BAD_GATEWAY_502: + case HttpStatus.SERVICE_UNAVAILABLE_503: + case HttpStatus.GATEWAY_TIMEOUT_504: + errorMsg = String.format("HTTP response %d: Service unavailable or gateway issue", + contentResponse.getStatus()); + break; + default: + errorMsg = String.format("HTTP GET failed: %d, %s", contentResponse.getStatus(), + contentResponse.getReason()); + break; + } + } catch (TimeoutException e) { + errorMsg = "TimeoutException: Call to Weather Company API timed out"; + } catch (ExecutionException e) { + errorMsg = String.format("ExecutionException: %s", e.getMessage()); + } catch (InterruptedException e) { + errorMsg = String.format("InterruptedException: %s", e.getMessage()); + } + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, errorMsg); + logger.debug("{}", errorMsg); + return null; + } + + /* + * Convert UTC Unix epoch seconds to local time + */ + protected DateTimeType getLocalDateTimeType(long epochSeconds) { + Instant instant = Instant.ofEpochSecond(epochSeconds); + ZonedDateTime localDateTime = instant.atZone(getZoneId()); + DateTimeType dateTimeType = new DateTimeType(localDateTime); + return dateTimeType; + } + + /* + * Convert UTC time string to local time + * Input string is of form 2018-12-02T10:47:00.000Z + */ + protected State getLocalDateTimeType(String dateTimeString) { + State dateTimeType; + try { + Instant instant = Instant.parse(dateTimeString); + ZonedDateTime localDateTime = instant.atZone(getZoneId()); + dateTimeType = new DateTimeType(localDateTime); + } catch (DateTimeParseException e) { + logger.debug("Error parsing date/time string: {}", e.getMessage()); + dateTimeType = UnDefType.UNDEF; + } + return dateTimeType; + } + + private ZoneId getZoneId() { + return timeZoneProvider.getTimeZone(); + } + + /* + * Called by discovery service to get TWC language based on + * the locale configured in openHAB + */ + public static String lookupLanguage(Locale locale) { + String ohLanguage = locale.getLanguage() + "-" + locale.getCountry(); + for (String language : WEATHER_CHANNEL_LANGUAGES) { + if (language.equals(ohLanguage)) { + return language; + } + } + return CONFIG_LANGUAGE_DEFAULT; + } + + //@formatter:off + private static final String[] WEATHER_CHANNEL_LANGUAGES = { + "ar-AE", + "az-AZ", + "bg-BG", + "bn-BD", + "bn-IN", + "bs-BA", + "ca-ES", + "cs-CZ", + "da-DK", + "de-DE", + "el-GR", + "en-GB", + "en-IN", + "en-US", + "es-AR", + "es-ES", + "es-LA", + "es-MX", + "es-UN", + "es-US", + "et-EE", + "fa-IR", + "fi-FI", + "fr-CA", + "fr-FR", + "gu-IN", + "he-IL", + "hi-IN", + "hr-HR", + "hu-HU", + "in-ID", + "is-IS", + "it-IT", + "iw-IL", + "ja-JP", + "jv-ID", + "ka-GE", + "kk-KZ", + "kn-IN", + "ko-KR", + "lt-LT", + "lv-LV", + "mk-MK", + "mn-MN", + "ms-MY", + "nl-NL", + "no-NO", + "pl-PL", + "pt-BR", + "pt-PT", + "ro-RO", + "ru-RU", + "si-LK", + "sk-SK", + "sl-SI", + "sq-AL", + "sr-BA", + "sr-ME", + "sr-RS", + "sv-SE", + "sw-KE", + "ta-IN", + "ta-LK", + "te-IN", + "tg-TJ", + "th-TH", + "tk-TM", + "tl-PH", + "tr-TR", + "uk-UA", + "ur-PK", + "uz-UZ", + "vi-VN", + "zh-CN", + "zh-HK", + "zh-TW" + }; + //@formatter:on +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyBridgeHandler.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyBridgeHandler.java new file mode 100644 index 0000000000000..3b02079c7d6f8 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyBridgeHandler.java @@ -0,0 +1,111 @@ +/** + * 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.weathercompany.internal.handler; + +import java.io.IOException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.exception.ExceptionUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpResponseException; +import org.eclipse.smarthome.core.thing.Bridge; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.io.net.http.HttpUtil; +import org.openhab.binding.weathercompany.internal.config.WeatherCompanyBridgeConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link WeatherCompanyBridgeHandler} is responsible for validating the API key + * used to access the Weather Company API. + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyBridgeHandler extends BaseBridgeHandler { + private static final long KEY_VALIDATION_FREQ_SECONDS = 120L; + private static final String BASE_URL = "https://api.weather.com/v3/location/search?query=chicago&locationType=locid&language=en-US&format=json&apiKey="; + + private final Logger logger = LoggerFactory.getLogger(WeatherCompanyBridgeHandler.class); + + private @Nullable Future<?> validateApiKeyJob; + + private final Runnable validateApiKeyRunnable = new Runnable() { + @Override + public void run() { + logger.debug("Bridge: Attempting to validate API key"); + try { + String url = BASE_URL + getConfigAs(WeatherCompanyBridgeConfig.class).apiKey; + String response = HttpUtil.executeUrl("GET", url, 10000); + // If we get a response, we know the API key is valid + logger.debug("Bridge: Got a successful response to key validation: '{}'", response); + updateStatus(ThingStatus.ONLINE); + cancelValidateApiKeyJob(); + } catch (IOException e) { + Throwable rootcause = ExceptionUtils.getRootCause(e); + if (rootcause instanceof HttpResponseException + && rootcause.getMessage().contains("Authentication challenge without")) { + logger.debug("Bridge: HttpResponseException: API key is not valid"); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "API key is invalid"); + } else { + logger.debug("Bridge: IOException trying to validate Api key: {}", e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, e.getMessage()); + } + } + } + }; + + public WeatherCompanyBridgeHandler(Bridge thing) { + super(thing); + } + + @Override + public void initialize() { + scheduleValidateApiKeyJob(); + } + + @Override + public void dispose() { + cancelValidateApiKeyJob(); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + // Bridge doesn't handle any commands + } + + public @Nullable String getApiKey() { + return getConfigAs(WeatherCompanyBridgeConfig.class).apiKey; + } + + private void scheduleValidateApiKeyJob() { + cancelValidateApiKeyJob(); + validateApiKeyJob = scheduler.scheduleWithFixedDelay(validateApiKeyRunnable, 0L, KEY_VALIDATION_FREQ_SECONDS, + TimeUnit.SECONDS); + logger.debug("Bridge: Scheduling job to validate API key"); + } + + private void cancelValidateApiKeyJob() { + if (validateApiKeyJob != null) { + validateApiKeyJob.cancel(true); + validateApiKeyJob = null; + logger.debug("Bridge: Canceling job to validate API key"); + } + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyForecastHandler.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyForecastHandler.java new file mode 100644 index 0000000000000..5f5fa9b7014c2 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyForecastHandler.java @@ -0,0 +1,351 @@ +/** + * 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.weathercompany.internal.handler; + +import static org.openhab.binding.weathercompany.internal.WeatherCompanyBindingConstants.*; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import javax.imageio.ImageIO; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.i18n.LocaleProvider; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.i18n.UnitProvider; +import org.eclipse.smarthome.core.library.types.RawType; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.core.types.UnDefType; +import org.openhab.binding.weathercompany.internal.config.WeatherCompanyForecastConfig; +import org.openhab.binding.weathercompany.internal.model.DayPart; +import org.openhab.binding.weathercompany.internal.model.Forecast; +import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonSyntaxException; + +/** + * The {@link WeatherCompanyForecastHandler} is responsible for pulling weather forecast + * information from the Weather Company API. + * + * API documentation is located here + * - https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/edit + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyForecastHandler extends WeatherCompanyAbstractHandler { + private static final String BASE_FORECAST_URL = "https://api.weather.com/v3/wx/forecast/daily/5day"; + + private final Logger logger = LoggerFactory.getLogger(WeatherCompanyForecastHandler.class); + + private final LocaleProvider localeProvider; + + private int refreshIntervalSeconds; + private String locationQueryString = ""; + private String languageQueryString = ""; + + private @Nullable Future<?> refreshForecastJob; + + private final Runnable refreshRunnable = new Runnable() { + @Override + public void run() { + refreshForecast(); + } + }; + + public WeatherCompanyForecastHandler(Thing thing, TimeZoneProvider timeZoneProvider, HttpClient httpClient, + UnitProvider unitProvider, LocaleProvider localeProvider) { + super(thing, timeZoneProvider, httpClient, unitProvider); + this.localeProvider = localeProvider; + } + + @Override + public void initialize() { + logger.debug("Forecast handler initializing with configuration: {}", + getConfigAs(WeatherCompanyForecastConfig.class).toString()); + + refreshIntervalSeconds = getConfigAs(WeatherCompanyForecastConfig.class).refreshInterval * 60; + if (isValidLocation()) { + weatherDataCache.clear(); + setLanguage(); + scheduleRefreshJob(); + updateStatus(isBridgeOnline() ? ThingStatus.ONLINE : ThingStatus.OFFLINE); + } + } + + @Override + public void dispose() { + cancelRefreshJob(); + updateStatus(ThingStatus.OFFLINE); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + if (command.equals(RefreshType.REFRESH)) { + State state = weatherDataCache.get(channelUID.getId()); + if (state != null) { + updateChannel(channelUID.getId(), state); + } + } + } + + private boolean isValidLocation() { + boolean validLocation = false; + String locationType = getConfigAs(WeatherCompanyForecastConfig.class).locationType; + if (locationType == null) { + return validLocation; + } + switch (locationType) { + case CONFIG_LOCATION_TYPE_POSTAL_CODE: + String postalCode = StringUtils.trimToNull(getConfigAs(WeatherCompanyForecastConfig.class).postalCode); + if (postalCode == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Postal code is not set"); + } else { + locationQueryString = "&postalKey=" + postalCode.replace(" ", ""); + validLocation = true; + } + break; + case CONFIG_LOCATION_TYPE_GEOCODE: + String geocode = StringUtils.trimToNull(getConfigAs(WeatherCompanyForecastConfig.class).geocode); + if (geocode == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Geocode is not set"); + } else { + locationQueryString = "&geocode=" + geocode.replace(" ", ""); + validLocation = true; + } + break; + case CONFIG_LOCATION_TYPE_IATA_CODE: + String iataCode = StringUtils.trimToNull(getConfigAs(WeatherCompanyForecastConfig.class).iataCode); + if (iataCode == null) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "IATA code is not set"); + } else { + locationQueryString = "&iataCode=" + iataCode.replace(" ", "").toUpperCase(); + validLocation = true; + } + break; + default: + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Location Type is not set"); + break; + } + return validLocation; + } + + private void setLanguage() { + String language = StringUtils.trimToNull(getConfigAs(WeatherCompanyForecastConfig.class).language); + if (language == null) { + // Nothing in the thing config, so try to get a match from the openHAB locale + String derivedLanguage = WeatherCompanyAbstractHandler.lookupLanguage(localeProvider.getLocale()); + languageQueryString = "&language=" + derivedLanguage; + logger.debug("Language not set in thing config, using {}", derivedLanguage); + } else { + // Use what is set in the thing config + languageQueryString = "&language=" + language; + } + } + + /* + * Build the URL for requesting the 5-day forecast. It's important to request + * the desired language AND units so that the forecast narrative contains + * the consistent language and units (e.g. wind gusts to 30 mph). + */ + private String buildForecastUrl() { + String apiKey = getApiKey(); + StringBuilder sb = new StringBuilder(BASE_FORECAST_URL); + // Set response type as JSON + sb.append("?format=json"); + // Set language from config + sb.append(languageQueryString); + // Set API key from config + sb.append("&apiKey=").append(apiKey); + // Set the units to Imperial or Metric + sb.append("&units=").append(getUnitsQueryString()); + // Set the location from config + sb.append(locationQueryString); + String url = sb.toString(); + logger.debug("Forecast URL is {}", url.replace(apiKey, REPLACE_API_KEY)); + return url.toString(); + } + + private synchronized void refreshForecast() { + if (!isBridgeOnline()) { + // If bridge is not online, API has not been validated yet + logger.debug("Handler: Can't refresh forecast because bridge is not online"); + return; + } + logger.debug("Handler: Requesting forecast from The Weather Company API"); + String response = executeApiRequest(buildForecastUrl()); + if (response == null) { + return; + } + try { + logger.trace("Handler: Parsing forecast response: {}", response); + Forecast forecast = gson.fromJson(response, Forecast.class); + logger.debug("Handler: Successfully parsed daily forecast response object"); + updateStatus(ThingStatus.ONLINE); + updateDailyForecast(forecast); + updateDaypartForecast(forecast.daypart); + } catch (JsonSyntaxException e) { + logger.debug("Handler: Error parsing daily forecast response object", e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error parsing daily forecast"); + return; + } + } + + private void updateDailyForecast(Forecast forecast) { + for (int day = 0; day < forecast.dayOfWeek.length; day++) { + logger.debug("Processing daily forecast for '{}'", forecast.dayOfWeek[day]); + updateDaily(day, CH_DAY_OF_WEEK, undefOrString(forecast.dayOfWeek[day])); + updateDaily(day, CH_NARRATIVE, undefOrString(forecast.narrative[day])); + updateDaily(day, CH_VALID_TIME_LOCAL, undefOrDate(forecast.validTimeUtc[day])); + updateDaily(day, CH_EXPIRATION_TIME_LOCAL, undefOrDate(forecast.expirationTimeUtc[day])); + updateDaily(day, CH_TEMP_MAX, undefOrQuantity(forecast.temperatureMax[day], getTempUnit())); + updateDaily(day, CH_TEMP_MIN, undefOrQuantity(forecast.temperatureMin[day], getTempUnit())); + updateDaily(day, CH_PRECIP_RAIN, undefOrQuantity(forecast.qpf[day], getLengthUnit())); + updateDaily(day, CH_PRECIP_SNOW, undefOrQuantity(forecast.qpfSnow[day], getLengthUnit())); + } + } + + private void updateDaypartForecast(Object daypartObject) { + DayPart[] dayparts; + try { + String innerJson = gson.toJson(daypartObject); + logger.debug("Parsing daypartsObject: {}", innerJson); + dayparts = gson.fromJson(innerJson.toString(), DayPart[].class); + logger.debug("Handler: Successfully parsed daypart forecast object"); + } catch (JsonSyntaxException e) { + logger.debug("Handler: Error parsing daypart forecast object: {}", e.getMessage(), e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error parsing daypart forecast"); + return; + } + logger.debug("There are {} daypart forecast entries", dayparts.length); + if (dayparts.length == 0) { + logger.debug("There is no daypart forecast object in this message"); + return; + } + logger.debug("There are {} daypartName entries in this forecast", dayparts[0].daypartName.length); + for (int i = 0; i < dayparts[0].daypartName.length; i++) { + // Note: All dayparts[0] (i.e. today day) values are null after 3 pm local time + DayPart dp = dayparts[0]; + // Even daypart indexes are Day (D); odd daypart indexes are Night (N) + String dOrN = dp.dayOrNight[i] == null ? (i % 2 == 0 ? "D" : "N") : dp.dayOrNight[i]; + logger.debug("Processing daypart forecast for '{}'", dp.daypartName[i]); + updateDaypart(i, dOrN, CH_DP_NAME, undefOrString(dp.daypartName[i])); + updateDaypart(i, dOrN, CH_DP_DAY_OR_NIGHT, undefOrString(dayparts[0].dayOrNight[i])); + updateDaypart(i, dOrN, CH_DP_NARRATIVE, undefOrString(dayparts[0].narrative[i])); + updateDaypart(i, dOrN, CH_DP_WX_PHRASE_SHORT, undefOrString(dayparts[0].wxPhraseShort[i])); + updateDaypart(i, dOrN, CH_DP_WX_PHRASE_LONG, undefOrString(dayparts[0].wxPhraseLong[i])); + updateDaypart(i, dOrN, CH_DP_QUALIFIER_PHRASE, undefOrString(dayparts[0].qualifierPhrase[i])); + updateDaypart(i, dOrN, CH_DP_QUALIFIER_CODE, undefOrString(dayparts[0].qualifierCode[i])); + updateDaypart(i, dOrN, CH_DP_TEMP, undefOrQuantity(dp.temperature[i], getTempUnit())); + updateDaypart(i, dOrN, CH_DP_TEMP_HEAT_INDEX, undefOrQuantity(dp.temperatureHeatIndex[i], getTempUnit())); + updateDaypart(i, dOrN, CH_DP_TEMP_WIND_CHILL, undefOrQuantity(dp.temperatureWindChill[i], getTempUnit())); + updateDaypart(i, dOrN, CH_DP_HUMIDITY, undefOrQuantity(dp.relativeHumidity[i], SmartHomeUnits.PERCENT)); + updateDaypart(i, dOrN, CH_DP_CLOUD_COVER, undefOrQuantity(dp.cloudCover[i], SmartHomeUnits.PERCENT)); + updateDaypart(i, dOrN, CH_DP_PRECIP_CHANCE, undefOrQuantity(dp.precipChance[i], SmartHomeUnits.PERCENT)); + updateDaypart(i, dOrN, CH_DP_PRECIP_TYPE, undefOrString(dp.precipType[i])); + updateDaypart(i, dOrN, CH_DP_PRECIP_RAIN, undefOrQuantity(dp.qpf[i], getLengthUnit())); + updateDaypart(i, dOrN, CH_DP_PRECIP_SNOW, undefOrQuantity(dp.qpfSnow[i], getLengthUnit())); + updateDaypart(i, dOrN, CH_DP_SNOW_RANGE, undefOrString(dp.snowRange[i])); + updateDaypart(i, dOrN, CH_DP_WIND_SPEED, undefOrQuantity(dp.windSpeed[i], getSpeedUnit())); + updateDaypart(i, dOrN, CH_DP_WIND_DIR_CARDINAL, undefOrString(dp.windDirectionCardinal[i])); + updateDaypart(i, dOrN, CH_DP_WIND_PHRASE, undefOrString(dp.windPhrase[i])); + updateDaypart(i, dOrN, CH_DP_WIND_DIR, undefOrQuantity(dp.windDirection[i], SmartHomeUnits.DEGREE_ANGLE)); + updateDaypart(i, dOrN, CH_DP_THUNDER_CATEGORY, undefOrString(dp.thunderCategory[i])); + updateDaypart(i, dOrN, CH_DP_THUNDER_INDEX, undefOrDecimal(dp.thunderIndex[i])); + updateDaypart(i, dOrN, CH_DP_UV_DESCRIPTION, undefOrString(dp.uvDescription[i])); + updateDaypart(i, dOrN, CH_DP_UV_INDEX, undefOrDecimal(dp.uvIndex[i])); + updateDaypart(i, dOrN, CH_DP_ICON_CODE, undefOrDecimal(dp.iconCode[i])); + updateDaypart(i, dOrN, CH_DP_ICON_CODE_EXTEND, undefOrDecimal(dp.iconCodeExtend[i])); + updateDaypart(i, dOrN, CH_DP_ICON_IMAGE, getIconImage(dp.iconCode[i])); + } + } + + private State getIconImage(Integer iconCode) { + // First try to get the image associated with the icon code + byte[] image = getImage("icons" + File.separator + String.format("%02d", iconCode) + ".png"); + if (image != null) { + return new RawType(image, "image/png"); + } + // Next try to get the N/A image + image = getImage("icons" + File.separator + "na.png"); + if (image != null) { + return new RawType(image, "image/png"); + } + // Couldn't get any icon image, so set to UNDEF + return UnDefType.UNDEF; + } + + private byte @Nullable [] getImage(String iconPath) { + byte[] data = null; + URL url = FrameworkUtil.getBundle(getClass()).getResource(iconPath); + logger.trace("Path to icon image resource is: {}", url); + if (url != null) { + try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { + InputStream is = url.openStream(); + BufferedImage image = ImageIO.read(is); + ImageIO.write(image, "png", out); + out.flush(); + data = out.toByteArray(); + } catch (IOException e) { + logger.debug("I/O exception occurred getting image data: {}", e.getMessage(), e); + } + } + return data; + } + + private void updateDaily(int day, String channelId, State state) { + updateChannel(CH_GROUP_FORECAST_DAY + String.valueOf(day) + "#" + channelId, state); + } + + private void updateDaypart(int daypartIndex, String dayOrNight, String channelId, State state) { + int day = daypartIndex / 2; + String dON = dayOrNight.equals("D") ? CH_GROUP_FORECAST_DAYPART_DAY : CH_GROUP_FORECAST_DAYPART_NIGHT; + updateChannel(CH_GROUP_FORECAST_DAY + String.valueOf(day) + dON + "#" + channelId, state); + } + + /* + * The refresh job updates the daily forecast on the + * refresh interval set in the thing config + */ + private void scheduleRefreshJob() { + logger.debug("Handler: Scheduling forecast refresh job in {} seconds", REFRESH_JOB_INITIAL_DELAY_SECONDS); + cancelRefreshJob(); + refreshForecastJob = scheduler.scheduleWithFixedDelay(refreshRunnable, REFRESH_JOB_INITIAL_DELAY_SECONDS, + refreshIntervalSeconds, TimeUnit.SECONDS); + } + + private void cancelRefreshJob() { + if (refreshForecastJob != null) { + refreshForecastJob.cancel(true); + logger.debug("Handler: Canceling forecast refresh job"); + } + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyObservationsHandler.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyObservationsHandler.java new file mode 100644 index 0000000000000..3608687e8dc6f --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/handler/WeatherCompanyObservationsHandler.java @@ -0,0 +1,196 @@ +/** + * 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.weathercompany.internal.handler; + +import static org.openhab.binding.weathercompany.internal.WeatherCompanyBindingConstants.*; + +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.HttpClient; +import org.eclipse.smarthome.core.i18n.LocaleProvider; +import org.eclipse.smarthome.core.i18n.TimeZoneProvider; +import org.eclipse.smarthome.core.i18n.UnitProvider; +import org.eclipse.smarthome.core.library.unit.ImperialUnits; +import org.eclipse.smarthome.core.library.unit.SmartHomeUnits; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.openhab.binding.weathercompany.internal.config.WeatherCompanyObservationsConfig; +import org.openhab.binding.weathercompany.internal.model.PwsObservations; +import org.openhab.binding.weathercompany.internal.model.PwsObservations.Observations; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.JsonSyntaxException; + +/** + * The {@link WeatherCompanyObservationsHandler} is responsible for pulling Personal + * Weather Station (PWS) observations from the Weather Company API. + * + * API documentation is located here + * - https://docs.google.com/document/d/1eKCnKXI9xnoMGRRzOL1xPCBihNV2rOet08qpE_gArAY/edit + * + * @author Mark Hilbush - Initial contribution + */ +@NonNullByDefault +public class WeatherCompanyObservationsHandler extends WeatherCompanyAbstractHandler { + private static final String BASE_PWS_URL = "https://api.weather.com/v2/pws/observations/current"; + + private final Logger logger = LoggerFactory.getLogger(WeatherCompanyObservationsHandler.class); + + private int refreshIntervalSeconds; + + private @Nullable Future<?> refreshObservationsJob; + + private final Runnable refreshRunnable = new Runnable() { + @Override + public void run() { + refreshPwsObservations(); + } + }; + + public WeatherCompanyObservationsHandler(Thing thing, TimeZoneProvider timeZoneProvider, HttpClient httpClient, + UnitProvider unitProvider, LocaleProvider localeProvider) { + super(thing, timeZoneProvider, httpClient, unitProvider); + } + + @Override + public void initialize() { + logger.debug("Initializing observations handler with configuration: {}", + getConfigAs(WeatherCompanyObservationsConfig.class).toString()); + + refreshIntervalSeconds = getConfigAs(WeatherCompanyObservationsConfig.class).refreshInterval * 60; + weatherDataCache.clear(); + scheduleRefreshJob(); + updateStatus(isBridgeOnline() ? ThingStatus.ONLINE : ThingStatus.OFFLINE); + } + + @Override + public void dispose() { + cancelRefreshJob(); + updateStatus(ThingStatus.OFFLINE); + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + if (command.equals(RefreshType.REFRESH)) { + State state = weatherDataCache.get(channelUID.getId()); + if (state != null) { + updateChannel(channelUID.getId(), state); + } + } + } + + /* + * Build the URL for requesting the PWS current observations + */ + private @Nullable String buildPwsUrl() { + if (StringUtils.isEmpty(getConfigAs(WeatherCompanyObservationsConfig.class).pwsStationId)) { + return null; + } + String apiKey = getApiKey(); + StringBuilder sb = new StringBuilder(BASE_PWS_URL); + // Set to use Imperial units. UoM will convert to the other units + sb.append("?units=e"); + // Set response type as JSON + sb.append("&format=json"); + // Set PWS station Id from config + sb.append("&stationId=").append(getConfigAs(WeatherCompanyObservationsConfig.class).pwsStationId); + // Set API key from config + sb.append("&apiKey=").append(apiKey); + String url = sb.toString(); + logger.debug("PWS observations URL is {}", url.replace(apiKey, REPLACE_API_KEY)); + return url; + } + + private synchronized void refreshPwsObservations() { + if (!isBridgeOnline()) { + // If bridge is not online, API has not been validated yet + logger.debug("Handler: Can't refresh PWS observations because bridge is not online"); + return; + } + logger.debug("Handler: Requesting PWS observations from The Weather Company API"); + String response = executeApiRequest(buildPwsUrl()); + if (response == null) { + return; + } + try { + logger.debug("Handler: Parsing PWS observations response: {}", response); + PwsObservations pwsObservations = gson.fromJson(response, PwsObservations.class); + logger.debug("Handler: Successfully parsed PWS observations response object"); + updateStatus(ThingStatus.ONLINE); + updatePwsObservations(pwsObservations); + } catch (JsonSyntaxException e) { + logger.debug("Handler: Error parsing pws observations response object: {}", e.getMessage(), e); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error parsing PWS observations"); + return; + } + } + + private void updatePwsObservations(PwsObservations pwsObservations) { + if (pwsObservations.observations.length == 0) { + logger.debug("Handler: PWS observation object contains no observations!"); + return; + } + Observations obs = pwsObservations.observations[0]; + logger.debug("Handler: Processing observations from station {} at {}", obs.stationID, obs.obsTimeLocal); + updateChannel(CH_PWS_TEMP, undefOrQuantity(obs.imperial.temp, ImperialUnits.FAHRENHEIT)); + updateChannel(CH_PWS_TEMP_HEAT_INDEX, undefOrQuantity(obs.imperial.heatIndex, ImperialUnits.FAHRENHEIT)); + updateChannel(CH_PWS_TEMP_WIND_CHILL, undefOrQuantity(obs.imperial.windChill, ImperialUnits.FAHRENHEIT)); + updateChannel(CH_PWS_TEMP_DEW_POINT, undefOrQuantity(obs.imperial.dewpt, ImperialUnits.FAHRENHEIT)); + updateChannel(CH_PWS_HUMIDITY, undefOrQuantity(obs.humidity, SmartHomeUnits.PERCENT)); + updateChannel(CH_PWS_PRESSURE, undefOrQuantity(obs.imperial.pressure, ImperialUnits.INCH_OF_MERCURY)); + updateChannel(CH_PWS_PRECIPTATION_RATE, + undefOrQuantity(obs.imperial.precipRate, SmartHomeUnits.INCHES_PER_HOUR)); + updateChannel(CH_PWS_PRECIPITATION_TOTAL, undefOrQuantity(obs.imperial.precipTotal, ImperialUnits.INCH)); + updateChannel(CH_PWS_WIND_SPEED, undefOrQuantity(obs.imperial.windSpeed, ImperialUnits.MILES_PER_HOUR)); + updateChannel(CH_PWS_WIND_GUST, undefOrQuantity(obs.imperial.windGust, ImperialUnits.MILES_PER_HOUR)); + updateChannel(CH_PWS_WIND_DIRECTION, undefOrQuantity(obs.winddir, SmartHomeUnits.DEGREE_ANGLE)); + updateChannel(CH_PWS_SOLAR_RADIATION, undefOrQuantity(obs.solarRadiation, SmartHomeUnits.IRRADIANCE)); + updateChannel(CH_PWS_UV, undefOrDecimal(obs.uv)); + updateChannel(CH_PWS_OBSERVATION_TIME_LOCAL, undefOrDate(obs.obsTimeUtc)); + updateChannel(CH_PWS_NEIGHBORHOOD, undefOrString(obs.neighborhood)); + updateChannel(CH_PWS_STATION_ID, undefOrString(obs.stationID)); + updateChannel(CH_PWS_COUNTRY, undefOrString(obs.country)); + updateChannel(CH_PWS_LOCATION, undefOrPoint(obs.lat, obs.lon)); + updateChannel(CH_PWS_ELEVATION, undefOrQuantity(obs.imperial.elev, ImperialUnits.FOOT)); + updateChannel(CH_PWS_QC_STATUS, undefOrDecimal(obs.qcStatus)); + updateChannel(CH_PWS_SOFTWARE_TYPE, undefOrString(obs.softwareType)); + } + + /* + * The refresh job updates the PWS current observations + * on the refresh interval set in the thing config + */ + private void scheduleRefreshJob() { + logger.debug("Handler: Scheduling observations refresh job in {} seconds", REFRESH_JOB_INITIAL_DELAY_SECONDS); + cancelRefreshJob(); + refreshObservationsJob = scheduler.scheduleWithFixedDelay(refreshRunnable, REFRESH_JOB_INITIAL_DELAY_SECONDS, + refreshIntervalSeconds, TimeUnit.SECONDS); + } + + private void cancelRefreshJob() { + if (refreshObservationsJob != null) { + refreshObservationsJob.cancel(true); + logger.debug("Handler: Canceling observations refresh job"); + } + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/DayPart.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/DayPart.java new file mode 100644 index 0000000000000..3a01b35446212 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/DayPart.java @@ -0,0 +1,187 @@ +/** + * 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.weathercompany.internal.model; + +/** + * The {@link DayPart} is the JSON object that contains the n-day forecast. + * + * The daypart object as well as the temperatureMax field will + * appear as null in the API after 3:00 pm Local Apparent Time. + * + * @author Mark Hilbush - Initial contribution + */ +public class DayPart { + /* + * The name of a 12 hour daypart not including day names in the + * first 48 hours (Today, Tonight) + */ + public String[] daypartName; + + /* + * Day or night indicator (D, N) + */ + public String[] dayOrNight; + + /* + * The narrative forecast for the daypart period + */ + public String[] narrative; + + /* + * Sensible weather phrase + */ + public String[] wxPhraseLong; + + /* + * Sensible weather phrase + */ + public String[] wxPhraseShort; + + /* + * The maximum temperature between 7am and 7pm for daytime temperature and the minimum temperature + * between 7pm and 7am for night-time temperature. Minimum temperature also + */ + public Double[] temperature; + + /* + * Maximum heat index. + * An apparent temperature. It represents what the air temperature “feels like†on exposed human skin + * due to the combined effect of warm temperatures and high humidity. + * When the temperature is 70°F or higher, the Feels Like value represents the computed Heat Index. + * For temperatures between 40°F and 70°F, the Feels Like value and Temperature are the same, + * regardless of wind speed and humidity, so use the Temperature value + */ + public Double[] temperatureHeatIndex; + + /* + * Minimum wind chill. + * An apparent temperature. It represents what the air temperature “feels like†on exposed human skin + * due to the combined effect of the cold temperatures and wind speed. + * When the temperature is 61°F or lower the Feels Like value represents the computed Wind Chill so display the + * Wind Chill value. + * For temperatures between 61°F and 75°F, the Feels Like value and Temperature are the same, regardless + * of wind speed and humidity, so display the Temperature value. + */ + public Double[] temperatureWindChill; + + /* + * The relative humidity of the air, which is defined as the ratio of the amount of water vapor + * in the air to the amount of vapor required to bring the air to saturation at a constant + * temperature. Relative humidity is always expressed as a percentage + */ + public Integer[] relativeHumidity; + + /* + * Daytime average cloud cover expressed as a percentage + */ + public Integer[] cloudCover; + + /* + * The maximum forecasted wind speed. + * The wind is treated as a vector; hence, winds must have direction and magnitude (speed). + * The wind information reported in the hourly current conditions corresponds to a 10-minute average + * called the sustained wind speed. Sudden or brief variations in the wind speed are known + * as “wind gusts†and are reported in a separate data field. Wind directions are always expressed + * as "from whence the wind blows" meaning that a North wind blows from North to South. If you face + * North in a North wind the wind is at your face. Face southward and the North wind is at your back + */ + public Integer[] windSpeed; + + /* + * Average wind direction in magnetic notation + */ + public Integer[] windDirection; + + /* + * Average wind direction in cardinal notation + * N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, CALM, VAR + */ + public String[] windDirectionCardinal; + + /* + * The phrase that describes the wind direction and speed for a 12 hour daypart + */ + public String[] windPhrase; + + /* + * Maximum probability of precipitation + */ + public Integer[] precipChance; + + /* + * Type of precipitation to display with the probability of precipitation + * data element. (rain, snow, precip) + */ + public String[] precipType; + + /* + * The description of probability thunderstorm activity in an area for 12 hour daypart + * 0 = "No thunder"; 1 = "Thunder possible"; 2 = "Thunder expected"; 3 = "Severe thunderstorms possible"; + * 4 = "Severe thunderstorms likely"; 5 = "High risk of severe thunderstorms" + */ + public String[] thunderCategory; + + /* + * The enumeration of thunderstorm probability within an area for a 12 hour daypart + */ + public Integer[] thunderIndex; + + /* + * The forecasted measurable precipitation (liquid or liquid equivalent) during 12 or 24 hour period + */ + public Double[] qpf; + + /* + * The forecasted measurable precipitation as snow during the 12 or 24 hour forecast period + */ + public Double[] qpfSnow; + + /* + * A phrase associated to the qualifier code describing special weather criteria + */ + public String[] qualifierPhrase; + + /* + * ???? + */ + public String[] qualifierCode; + + /* + * Snow accumulation amount for the 12 hour forecast period + */ + public String[] snowRange; + + /* + * The UV Index Description which complements the UV Index value by providing an associated + * level of risk of skin damage due to exposure. + * -2 = Not Available, -1 = No Report, 0 to 2 = Low, 3 to 5 = Moderate, + * 6 to 7 = High, 8 to 10 = Very High, 11 to 16 = Extreme + */ + public String[] uvDescription; + + /* + * Maximum UV index for the 12 hour forecast period + */ + public Integer[] uvIndex; + + /* + * This number is the key to the weather icon lookup. The data field shows the icon + * number that is matched to represent the observed weather conditions + */ + public Integer[] iconCode; + + /* + * Code representing full set sensible weather + */ + public Integer[] iconCodeExtend; +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/Forecast.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/Forecast.java new file mode 100644 index 0000000000000..9d1d4a4948617 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/Forecast.java @@ -0,0 +1,153 @@ +/** + * 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.weathercompany.internal.model; + +/** + * The {@link Forecast} is the JSON object that contains the n-day forecast. + * + * The daypart object as well as the temperatureMax field OUTSIDE of the daypart object will + * appear as null in the API after 3:00pm Local Apparent Time. + * + * Standard HTTP Cache-Control headers are used to define caching length. The TTL value is + * provided in the HTTP Header as an absolute time value using the “Expires†parameter. + * Example: “Expires: Fri, 12 Jul 2013 12:00:00 GMTâ€. The response provides a data element + * expirationTimeUtc, this should be used to expire and remove a record from your system + * + * Translated fields: + * - dayOfWeek + * - daypartName + * - moonPhase + * - narrative + * - qualifierPhrase + * - uvDescription + * - windDirectionCardinal + * - windPhrase + * - wxPhraseLong + * + * @author Mark Hilbush - Initial contribution + */ +public class Forecast { + /* + * Day of week + */ + public String[] dayOfWeek; + + /* + * For the purposes of this product day(D) = 7am to 7pm and night(N) = 7pm to 7am + */ + public Object daypart; + + /* + * The narrative forecast for the 24-hour period. + */ + public String[] narrative; + + /* + * Daily maximum temperature + */ + public Double[] temperatureMax; + + /* + * Daily minimum temperature + */ + public Double[] temperatureMin; + + /* + * The forecasted measurable precipitation (liquid or liquid equivalent) during 12 or 24 hour period. + */ + public Double[] qpf; + + /* + * The forecasted measurable precipitation as snow during the 12 or 24 hour forecast period. + */ + public Double[] qpfSnow; + + /* + * Time forecast is valid in local apparent time. + * ISO 8601 - YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset + */ + public String[] validTimeLocal; + + /* + * Time forecast is valid in UNIX seconds + */ + public Integer[] validTimeUtc; + + /* + * Expiration time in UNIX seconds + */ + public Integer[] expirationTimeUtc; + + /* + * The local time of the sunrise. It reflects any local daylight savings conventions. + * For a few Arctic and Antarctic regions, the Sunrise and Sunset data values may be the + * same (each with a value of 12:01am) to reflect conditions where a sunrise or sunset does not occur. + * ISO 8601 - YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset + */ + public String[] sunriseTimeLocal; + + /* + * Sunrise time in UNIX epoch value + */ + public Integer[] sunriseTimeUtc; + + /* + * The local time of the sunset. It reflects any local daylight savings conventions. + * For a few Arctic and Antarctic regions, the Sunrise and Sunset data values may be the + * same (each with a value of 12:01am) to reflect conditions where a sunrise or sunset does not occur. + * ISO 8601 - YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset + */ + public String[] sunsetTimeLocal; + + /* + * Sunset time in UNIX epoch value + */ + public Integer[] sunsetTimeUtc; + + /* + * Description phrase for the current lunar phase + */ + public String[] moonPhase; + + /* + * 3 character short code for lunar phases WNG, WXC, FQ, WNC, LQ, F, WXG, N() + */ + public String[] moonPhaseCode; + + /* + * Day number within monthly lunar cycle + */ + public Integer[] moonPhaseDay; + + /* + * First moonrise in local time. It reflects daylight savings time conventions + * ISO 8601 - YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset + */ + public String[] moonriseTimeLocal; + + /* + * Moonrise time in UNIX epoch value + */ + public Integer[] moonriseTimeUtc; + + /* + * First Moonset in local time. It reflects daylight savings time conventions + * ISO 8601 - YYYY-MM-DDTHH:MM:SS-NNNN; NNNN=GMT offset + */ + public String[] moonSetTimeLocal; + + /* + * Moonset time in UNIX epoch value + */ + public Integer[] moonsetTimeUtc; +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/PwsObservations.java b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/PwsObservations.java new file mode 100644 index 0000000000000..03ace9c887414 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/java/org/openhab/binding/weathercompany/internal/model/PwsObservations.java @@ -0,0 +1,174 @@ +/** + * 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.weathercompany.internal.model; + +/** + * The {@link PwsObservations} contains the most recent weather condition + * observations from the Personl Weather Station (PWS). + * + * @author Mark Hilbush - Initial contribution + */ +public class PwsObservations { + /* + * An array of length 1 of observations that represent the + * most recent PWS observations + */ + public Observations[] observations; + + public class Observations { + /* + * Object containing fields that use a defined unit of measure. + * The object label is dependent on the units parameter assigned + * in the request + */ + public Imperial imperial; + + /* + * Two-character country code + */ + public String country; + + /* + * Time in UNIX seconds + */ + public long epoch; + + /* + * The relative humidity of the air + */ + public Integer humidity; + + /* + * Latitude of the PWS + */ + public Double lat; + + /* + * Longitude of the PWS + */ + public Double lon; + + /* + * Neighborhood associated with the PWS location + */ + public String neighborhood; + + /* + * Time observation is valid in local apparent time by timezone - tz + * Format "2019-03-06 17:44:44" + */ + public String obsTimeLocal; + + /* + * GMT (UTC) time + * Format ISO 8601 - yyyy-MM-dd'T'HH:mm:ssZZ + */ + public String obsTimeUtc; + + /* + * Quality control indicator: + * -1: No quality control check performed + * 0: This observation was marked as possibly incorrect by our quality control algorithm + * 1: This observation passed quality control checks + */ + public Integer qcStatus; + + /* + * Frequency of data report updates in minutes + */ + public Object realtimeFrequency; + + /* + * Software type of the PWS + */ + public String softwareType; + + /* + * Solar radiation in Watts/meter2 + */ + public Double solarRadiation; + + /* + * ID as registered by wunderground.com + */ + public String stationID; + + /* + * UV reading of the intensity of solar radiation + */ + public Double uv; + + /* + * Wind direction in degrees + */ + public Integer winddir; + } + + public class Imperial { + /* + * The temperature which air must be cooled at constant pressure to reach saturation + */ + public Double dewpt; + + /* + * Elevation of the PWS in feet + */ + public Integer elev; + + /* + * An apparent temperature. It represents what the air + * temperature “feels like†on exposed human skin due to the combined effect + * of warm temperatures and high humidity. + */ + public Double heatIndex; + + /* + * Instantaneous precipitation rate. How much rain would fall if the + * precipitation intensity did not change for one hour + */ + public Double precipRate; + + /* + * Accumulated precipitation for today from midnight to present. + */ + public Double precipTotal; + + /* + * Mean Sea Level Pressure, the equivalent pressure reading at sea level recorded at this station + */ + public Double pressure; + + /* + * Temperature + */ + public Double temp; + + /* + * An apparent temperature. It represents what the air temperature “feels like†on exposed human + * skin due to the combined effect of the cold temperatures and wind speed. + */ + public Double windChill; + + /* + * Sudden and temporary variations of the average Wind Speed. + */ + public Integer windGust; + + /* + * The wind is treated as a vector; hence, winds must have direction and magnitude (speed). + * The wind information reported in the hourly current conditions corresponds to + * a 10-minute average called the sustained wind speed + */ + public Integer windSpeed; + } +} diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/binding/binding.xml new file mode 100644 index 0000000000000..c2659a9fff368 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/binding/binding.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<binding:binding id="weathercompany" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> + + <name>WeatherCompany Binding</name> + <description>This is the binding for the WeatherCompany weather forecast API.</description> + <author>Mark Hilbush</author> + +</binding:binding> diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/config/config.xml new file mode 100644 index 0000000000000..890615e545d74 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/config/config.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8"?> +<config-description:config-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/config-description/v1.0.0 https://openhab.org/schemas/config-description-1.0.0.xsd"> + + <config-description uri="thing-type:weathercompany:account"> + <parameter name="apiKey" type="text" required="true"> + <label>API Key</label> + <description>Enter the API key</description> + <context>password</context> + </parameter> + </config-description> + + <config-description uri="thing-type:weathercompany:weather-observations"> + <parameter name="pwsStationId" type="text" required="true"> + <label>PWS Station ID</label> + <description>ID of your Personal Weather Station (e.g. KILCHICA52)</description> + </parameter> + <parameter name="refreshInterval" type="integer" min="2" required="false" unit="min"> + <label>Refresh interval</label> + <description>Specifies the refresh interval in minutes</description> + <default>30</default> + </parameter> + </config-description> + + <config-description uri="thing-type:weathercompany:weather-forecast"> + <parameter name="locationType" type="text" required="true"> + <label>Location Type</label> + <description>Location type (Postal Code, Geocode)</description> + <default>postal</default> + <options> + <option value="postalCode">Postal Code</option> + <option value="geocode">Geocode</option> + <option value="iataCode">IATA Code</option> + </options> + </parameter> + <parameter name="postalCode" type="text" required="false"> + <label>Postal code</label> + <description>Postal code of form postal:country (e.g. 10001:US)</description> + </parameter> + <parameter name="geocode" type="text" required="false"> + <context>location</context> + <label>Location</label> + <description><![CDATA[ +<p>The location of this weather forecast.</p> +<p>Coordinates as <latitude>,<longitude>[<altitude>]</p> +<p>Example: "52.5200066,13.4049540" (Berlin)</p> +]]> + </description> + </parameter> + <parameter name="iataCode" type="text" required="false"> + <label>IATA Code</label> + <description>IATA airport code (e.g. BWI)</description> + </parameter> + <parameter name="refreshInterval" type="integer" min="2" required="false" unit="min"> + <label>Refresh interval</label> + <description>Specifies the refresh interval in minutes</description> + <default>30</default> + </parameter> + <parameter name="language" type="text" required="false"> + <label>Language</label> + <description>Language to be used by the Weather Company service</description> + <options> + <option value="sq-AL">Albanian - (Albania)</option> + <option value="ar-AE">Arabic - (United Arab Emirates)</option> + <option value="az-AZ">Azerbaijani - (Azerbaijan)</option> + <option value="bn-BD">Bengali, Bangla - (Bangladesh)</option> + <option value="bn-IN">Bengali, Bangla - (India)</option> + <option value="bs-BA">Bosnian - (Bosnia and Herzegovina)</option> + <option value="bg-BG">Bulgarian - (Bulgaria)</option> + <option value="ca-ES">Catalan - (Spain)</option> + <option value="zh-CN">Chinese - (China)</option> + <option value="zh-HK">Chinese - (Hong Kong)</option> + <option value="zh-TW">Chinese - (Taiwan)</option> + <option value="hr-HR">Croatian - (Croatia)</option> + <option value="cs-CZ">Czech - (Czechia)</option> + <option value="da-DK">Danish - (Denmark)</option> + <option value="nl-NL">Dutch - (Netherlands)</option> + <option value="en-GB">English (Great Britain)</option> + <option value="en-IN">English - (India)</option> + <option value="en-US">English - (United States of America)</option> + <option value="et-EE">Estonian - (Estonia)</option> + <option value="fi-FI">Finnish - (Finland)</option> + <option value="fr-CA">French - (Canada)</option> + <option value="fr-FR">French - (France)</option> + <option value="ka-GE">Georgian - (Georgia)</option> + <option value="de-DE">German - (Germany)</option> + <option value="el-GR">Greek (modern) - (Greece)</option> + <option value="gu-IN">Gujarati - (India)</option> + <option value="he-IL">Hebrew (modern) - (Israel)</option> + <option value="iw-IL">Hebrew - (Israel)</option> + <option value="hi-IN">Hindi - (India)</option> + <option value="hu-HU">Hungarian - (Hungary)</option> + <option value="is-IS">Icelandic - (Iceland)</option> + <option value="in-ID">Indonesian - (Indonesia)</option> + <option value="it-IT">Italian - (Italy)</option> + <option value="ja-JP">Japanese - (Japan)</option> + <option value="jv-ID">Javanese - (Indonesia)</option> + <option value="kn-IN">Kannada - (India)</option> + <option value="kk-KZ">Kazakh - (Kazakhstan)</option> + <option value="ko-KR">Korean - (South Korea)</option> + <option value="lv-LV">Latvian - (Latvia)</option> + <option value="lt-LT">Lithuanian - (Lithuania)</option> + <option value="mk-MK">Macedonian - (Macedonia)</option> + <option value="ms-MY">Malay - (Malaysia)</option> + <option value="mn-MN">Mongolian - (Mongolia)</option> + <option value="no-NO">Norwegian - (Norway)</option> + <option value="fa-IR">Persian (Farsi) - (Iran)</option> + <option value="pl-PL">Polish - (Poland)</option> + <option value="pt-BR">Portuguese - (Brazil)</option> + <option value="pt-PT">Portuguese - (Portugal)</option> + <option value="ro-RO">Romanian - (Romania)</option> + <option value="ru-RU">Russian - (Russia)</option> + <option value="sr-BA">Serbian - (Bosnia and Herzegovina)</option> + <option value="sr-ME">Serbian - (Montenegro)</option> + <option value="sr-RS">Serbian - (Serbia)</option> + <option value="si-LK">Sinhalese, Sinhala - (Sri Lanka)</option> + <option value="sk-SK">Slovak - (Slovakia)</option> + <option value="sl-SI">Slovenian - (Slovenia)</option> + <option value="es-AR">Spanish - (Argentina)</option> + <option value="es-ES">Spanish - (Spain)</option> + <option value="es-LA">Spanish - (Latin America)</option> + <option value="es-MX">Spanish - (Mexico)</option> + <option value="es-UN">Spanish - (International)</option> + <option value="es-US">Spanish - (United States of America)</option> + <option value="sw-KE">Swahili - (Kenya)</option> + <option value="sv-SE">Swedish - (Sweden)</option> + <option value="tl-PH">Tagalog - (Philippines)</option> + <option value="tg-TJ">Tajik - (Tajikistan)</option> + <option value="ta-IN">Tamil - (India)</option> + <option value="ta-LK">Tamil - (Sri Lanka)</option> + <option value="te-IN">Telugu - (India)</option> + <option value="th-TH">Thai - (Thailand)</option> + <option value="tr-TR">Turkish - (Turkey)</option> + <option value="tk-TM">Turkmen - (Turkmenistan)</option> + <option value="uk-UA">Ukrainian - (Ukraine)</option> + <option value="ur-PK">Urdu - (Pakistan)</option> + <option value="uz-UZ">Uzbek - (Uzbekistan)</option> + <option value="vi-VN">Vietnamese - (Viet Nam)</option> + </options> + </parameter> + </config-description> + +</config-description:config-descriptions> diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/i18n/weathercompany.properties b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/i18n/weathercompany.properties new file mode 100644 index 0000000000000..24e6a19f399d0 --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/i18n/weathercompany.properties @@ -0,0 +1,7 @@ +# binding +binding.weathercompany.name = Weather Company Binding +binding.weathercompany.description = Weather forecast from The Weather Company + +# thing types +thing-type.weathercompany.weather.label = Weather +thing-type.weathercompany.weather.description = Weather forecast from The Weather Company diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/thing/thing-types.xml new file mode 100644 index 0000000000000..7c67b6cf0533b --- /dev/null +++ b/bundles/org.openhab.binding.weathercompany/src/main/resources/ESH-INF/thing/thing-types.xml @@ -0,0 +1,511 @@ +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="weathercompany" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <bridge-type id="account"> + <label>Weather Company Account</label> + <description>Represents an account at the Weather Company service</description> + <config-description-ref uri="thing-type:weathercompany:account" /> + </bridge-type> + + <thing-type id="weather-observations"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Weather Company Observations</label> + <description>Current observations from Personal Weather Station</description> + <channels> + <channel id="neighborhood" typeId="neighborhood" /> + <channel id="observationTimeLocal" typeId="observationTimeLocal" /> + <channel id="currentTemperature" typeId="temperature"> + <label>Current Temperature</label> + </channel> + <channel id="currentTemperatureDewPoint" typeId="temperature"> + <label>Dew Point Temperature</label> + </channel> + <channel id="currentTemperatureHeatIndex" typeId="temperature"> + <label>Heat Index Temperature</label> + </channel> + <channel id="currentTemperatureWindChill" typeId="temperature"> + <label>Wind Chill Temperature</label> + </channel> + <channel id="currentHumidity" typeId="relativeHumidity"> + <label>Current Humidity</label> + </channel> + <channel id="currentPressure" typeId="pressure"> + <label>Current Pressure</label> + </channel> + <channel id="currentPrecipitationRate" typeId="precipitationRate"> + <label>Current Precipitation Rate</label> + </channel> + <channel id="currentPrecipitationTotal" typeId="precipitationTotal"> + <label>Current Precipitation Total</label> + </channel> + <channel id="currentSolarRadiation" typeId="solarRadiation"> + <label>Current Solar Radiation</label> + </channel> + <channel id="currentUv" typeId="uvIndex"> + <label>Current UV Index</label> + </channel> + <channel id="currentWindDirection" typeId="windDirection"> + <label>Current Wind Direction</label> + </channel> + <channel id="currentWindSpeed" typeId="windSpeed"> + <label>Current Wind Speed</label> + </channel> + <channel id="currentWindSpeedGust" typeId="windSpeed"> + <label>Current Wind Gust Speed</label> + </channel> + <channel id="stationId" typeId="stationId" /> + <channel id="country" typeId="country" /> + <channel id="location" typeId="location" /> + <channel id="elevation" typeId="elevation" /> + <channel id="qcStatus" typeId="qcStatus" /> + <channel id="softwareType" typeId="softwareType" /> + </channels> + <config-description-ref uri="thing-type:weathercompany:weather-observations" /> + </thing-type> + + <thing-type id="weather-forecast"> + <supported-bridge-type-refs> + <bridge-type-ref id="account" /> + </supported-bridge-type-refs> + + <label>Weather Company Forecast</label> + <description>Weather Company weather forecast</description> + <channel-groups> + <!-- Daily forecasts --> + <channel-group id="forecastDay0" typeId="forecastDay"> + <label>Weather Forecast Today</label> + <description>This is the weather forecast for today</description> + </channel-group> + <channel-group id="forecastDay1" typeId="forecastDay"> + <label>Weather Forecast Tomorrow</label> + <description>This is the weather forecast for tomorrow</description> + </channel-group> + <channel-group id="forecastDay2" typeId="forecastDay"> + <label>Weather Forecast Day 2</label> + <description>This is the weather forecast in two days</description> + </channel-group> + <channel-group id="forecastDay3" typeId="forecastDay"> + <label>Weather Forecast Day 3</label> + <description>This is the weather forecast in three days</description> + </channel-group> + <channel-group id="forecastDay4" typeId="forecastDay"> + <label>Weather Forecast Day 4</label> + <description>This is the weather forecast in four days</description> + </channel-group> + <channel-group id="forecastDay5" typeId="forecastDay"> + <label>Weather Forecast Day 5</label> + <description>This is the weather forecast in five days</description> + </channel-group> + + <!-- Daytime and night-time forecasts --> + <channel-group id="forecastDay0Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast for Today</label> + <description>This is the daytime weather forecast for today</description> + </channel-group> + <channel-group id="forecastDay0Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast for Tonight</label> + <description>This is the night-time weather forecast for tonight</description> + </channel-group> + <channel-group id="forecastDay1Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast for Tomorrow</label> + <description>This is the daytime weather forecast for tomorrow</description> + </channel-group> + <channel-group id="forecastDay1Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast for Tomorrow</label> + <description>This is the night-time weather forecast for tomorrow night</description> + </channel-group> + <channel-group id="forecastDay2Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast Day 2</label> + <description>This is the daytime weather forecast in 2 days</description> + </channel-group> + <channel-group id="forecastDay2Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast Day 2</label> + <description>This is the night-time weather forecast in 2 days</description> + </channel-group> + <channel-group id="forecastDay3Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast Day 3</label> + <description>This is the daytime weather forecast in 3 days</description> + </channel-group> + <channel-group id="forecastDay3Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast Day 3</label> + <description>This is the night-time weather forecast in 3 days</description> + </channel-group> + <channel-group id="forecastDay4Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast Day 3</label> + <description>This is the daytime weather forecast in 4 days</description> + </channel-group> + <channel-group id="forecastDay4Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast Day 4</label> + <description>This is the night-time weather forecast in 4 days</description> + </channel-group> + <channel-group id="forecastDay5Day" typeId="forecastDaypart"> + <label>Daytime Weather Forecast Day 5</label> + <description>This is the daytime weather forecast in 5 days</description> + </channel-group> + <channel-group id="forecastDay5Night" typeId="forecastDaypart"> + <label>Night-time Weather Forecast Day 5</label> + <description>This is the night-time weather forecast in 5 days</description> + </channel-group> + </channel-groups> + <config-description-ref uri="thing-type:weathercompany:weather-forecast" /> + </thing-type> + + <channel-group-type id="forecastDay"> + <label>Weather Forecast Day</label> + <description>This is the weather forecast</description> + <channels> + <channel id="dayOfWeek" typeId="dayOfWeek" /> + <channel id="narrative" typeId="narrative" /> + <channel id="temperatureMax" typeId="temperature"> + <label>Maximum Temperature</label> + </channel> + <channel id="temperatureMin" typeId="temperature"> + <label>Minimum Temperature</label> + </channel> + <channel id="precipitationRain" typeId="precipitationRain" /> + <channel id="precipitationSnow" typeId="precipitationSnow" /> + <channel id="validTimeLocal" typeId="validTimeLocal" /> + <channel id="expirationTimeLocal" typeId="expirationTimeLocal" /> + </channels> + </channel-group-type> + + <channel-group-type id="forecastDaypart"> + <label>Weather Forecast Day and Night</label> + <description>This is the weather forecast for day and night</description> + <channels> + <channel id="daypartName" typeId="daypartName" /> + <channel id="dayOrNight" typeId="dayOrNight" /> + <channel id="narrative" typeId="narrative" /> + <channel id="qualifierCode" typeId="qualifierCode" /> + <channel id="qualifierPhrase" typeId="qualifierPhrase" /> + <channel id="wxPhraseShort" typeId="wxPhraseShort" /> + <channel id="wxPhraseLong" typeId="wxPhraseLong" /> + <channel id="temperature" typeId="temperature"> + <label>Temperature</label> + </channel> + <channel id="temperatureHeatIndex" typeId="temperature"> + <label>Heat Index</label> + </channel> + <channel id="temperatureWindChill" typeId="temperature"> + <label>Wind Chill</label> + </channel> + <channel id="relativeHumidity" typeId="relativeHumidity" /> + <channel id="windSpeed" typeId="windSpeed" /> + <channel id="windDirection" typeId="windDirection" /> + <channel id="windDirectionCardinal" typeId="windDirectionCardinal" /> + <channel id="windPhrase" typeId="windPhrase" /> + <channel id="cloudCover" typeId="cloudCover" /> + <channel id="precipitationChance" typeId="precipitationChance" /> + <channel id="precipitationType" typeId="precipitationType" /> + <channel id="precipitationRain" typeId="precipitationRain" /> + <channel id="precipitationSnow" typeId="precipitationSnow" /> + <channel id="snowRange" typeId="snowRange" /> + <channel id="uvDescription" typeId="uvDescription" /> + <channel id="uvIndex" typeId="uvIndex" /> + <channel id="thunderCategory" typeId="thunderCategory" /> + <channel id="thunderIndex" typeId="thunderIndex" /> + <channel id="iconCode" typeId="iconCode" /> + <channel id="iconCodeExtend" typeId="iconCodeExtend" /> + <channel id="iconImage" typeId="iconImage" /> + </channels> + </channel-group-type> + + <channel-type id="cloudCover"> + <item-type>Number:Dimensionless</item-type> + <label>Cloud Cover</label> + <description>Cloud cover</description> + <state readOnly="true" pattern="%.0f %unit%"></state> + </channel-type> + + <channel-type id="country" advanced="true"> + <item-type>String</item-type> + <label>Country</label> + <description>Country where PWS is located</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="dayOfWeek"> + <item-type>String</item-type> + <label>Day of Week</label> + <description>Day of week</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="dayOrNight" advanced="true"> + <item-type>String</item-type> + <label>Day or Night Name</label> + <description>Day or night</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="daypartName"> + <item-type>String</item-type> + <label>Daypart Name</label> + <description>Daypart name</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="expirationTimeLocal" advanced="true"> + <item-type>DateTime</item-type> + <label>Expiration Time</label> + <description>Expiration time</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="iconCode" advanced="true"> + <item-type>Number</item-type> + <label>Icon Code</label> + <description>Icon code</description> + <state readOnly="true" pattern="%.0f"></state> + </channel-type> + + <channel-type id="iconCodeExtend" advanced="true"> + <item-type>Number</item-type> + <label>Icon Code Extend</label> + <description>Icon code extend</description> + <state readOnly="true" pattern="%.0f"></state> + </channel-type> + + <channel-type id="iconImage"> + <item-type>Image</item-type> + <label>Icon Image</label> + <description>Icon image</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="location" advanced="true"> + <item-type>Location</item-type> + <label>Weather Station Location</label> + <description>Latitude and longitude of weather station</description> + <state readOnly="true" pattern="%2$s°N, %3$s°W" /> + </channel-type> + + <channel-type id="elevation" advanced="true"> + <item-type>Number:Length</item-type> + <label>Weather Station Elevation</label> + <description>Elevation above ground of weather station</description> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="narrative"> + <item-type>String</item-type> + <label>Narrative</label> + <description>The narrative forecast for the 24-hour period</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="neighborhood"> + <item-type>String</item-type> + <label>Neighborhood</label> + <description>Neighborhood</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="observationTimeLocal" advanced="true"> + <item-type>DateTime</item-type> + <label>Observation Time</label> + <description>Local time when conditions were observed</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="precipitationChance"> + <item-type>Number:Dimensionless</item-type> + <label>Precipitation Chance</label> + <description>Chance of precipitation</description> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="precipitationRain"> + <item-type>Number:Length</item-type> + <label>Precipitation Rain</label> + <description>Forecasted measurable liquid precipitation during 24 hour period</description> + <category>Rain</category> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="precipitationRate"> + <item-type>Number:Speed</item-type> + <label>Precipitation Rate</label> + <description>Precipitation rate</description> + <category>Rain</category> + <state readOnly="true" pattern="%.7f %unit%" /> + </channel-type> + + <channel-type id="precipitationSnow"> + <item-type>Number:Length</item-type> + <label>Precipitation Snow</label> + <description>Forecasted measurable snow precipitation during 24 hour period</description> + <category>Rain</category> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="precipitationTotal"> + <item-type>Number:Length</item-type> + <label>Precipitation Total</label> + <description>Precipitation total</description> + <category>Rain</category> + <state readOnly="true" pattern="%.1f %unit%" /> + </channel-type> + + <channel-type id="precipitationType"> + <item-type>String</item-type> + <label>Precipitation Type</label> + <description>Precipitation type</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="pressure"> + <item-type>Number:Pressure</item-type> + <label>Barometric Pressure</label> + <description>Barometric Pressure</description> + <category>Pressure</category> + <state readOnly="true" pattern="%.2f %unit%" /> + </channel-type> + + <channel-type id="qcStatus" advanced="true"> + <item-type>Number</item-type> + <label>QC Status</label> + <description>QC status</description> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="qualifierPhrase" advanced="true"> + <item-type>String</item-type> + <label>Qualifier Phrase</label> + <description>Qualifier phrase</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="qualifierCode" advanced="true"> + <item-type>String</item-type> + <label>Qualifier Code</label> + <description>Qualifier code</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="relativeHumidity"> + <item-type>Number:Dimensionless</item-type> + <label>Relative Humidity</label> + <description>Forecasted relative humidity</description> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="snowRange"> + <item-type>String</item-type> + <label>Snow Range</label> + <description>Snow range</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="softwareType" advanced="true"> + <item-type>String</item-type> + <label>Software Type</label> + <description>Software type</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="solarRadiation"> + <item-type>Number:Intensity</item-type> + <label>Solar Radiation</label> + <description>Solar radiation</description> + <state readOnly="true" pattern="%.2f %unit%" /> + </channel-type> + + <channel-type id="stationId"> + <item-type>String</item-type> + <label>Station Id</label> + <description>Station Id</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="temperature"> + <item-type>Number:Temperature</item-type> + <label>Temperature</label> + <description>Forecasted temperature</description> + <category>Temperature</category> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="thunderCategory" advanced="true"> + <item-type>String</item-type> + <label>Thunder Category</label> + <description>Thunder category</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="thunderIndex" advanced="true"> + <item-type>Number</item-type> + <label>Thunder Index</label> + <description>Thunder index</description> + <state readOnly="true" pattern="%.0f"></state> + </channel-type> + + <channel-type id="uvDescription"> + <item-type>String</item-type> + <label>UV Description</label> + <description>UV description</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="uvIndex" advanced="true"> + <item-type>Number</item-type> + <label>UV Index</label> + <description>UV index</description> + <state readOnly="true" pattern="%.0f"></state> + </channel-type> + + <channel-type id="validTimeLocal" advanced="true"> + <item-type>DateTime</item-type> + <label>Valid Time</label> + <description>Time forecast is valid in local apparent time</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="windDirection" advanced="true"> + <item-type>Number:Angle</item-type> + <label>Wind Direction</label> + <description>Wind direction</description> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="windDirectionCardinal"> + <item-type>String</item-type> + <label>Wind Direction Cardinal</label> + <description>Wind direction cardinal</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="windPhrase"> + <item-type>String</item-type> + <label>Wind Phrase</label> + <description>Wind phrase</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="windSpeed"> + <item-type>Number:Speed</item-type> + <label>Wind Speed</label> + <description>Wind speed</description> + <state readOnly="true" pattern="%.0f %unit%" /> + </channel-type> + + <channel-type id="wxPhraseLong"> + <item-type>String</item-type> + <label>Wx Phrase Long</label> + <description>Wx phrase long</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + + <channel-type id="wxPhraseShort" advanced="true"> + <item-type>String</item-type> + <label>Wx Phrase Short</label> + <description>Wx phrase short</description> + <state readOnly="true" pattern="%s"></state> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/00.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/00.png new file mode 100644 index 0000000000000..991ca0c5f308d Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/00.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/01.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/01.png new file mode 100644 index 0000000000000..1129ba7107211 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/01.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/02.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/02.png new file mode 100644 index 0000000000000..1129ba7107211 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/02.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/03.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/03.png new file mode 100644 index 0000000000000..501c80f41fe6f Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/03.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/04.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/04.png new file mode 100644 index 0000000000000..501c80f41fe6f Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/04.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/05.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/05.png new file mode 100644 index 0000000000000..7fb036c1f048a Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/05.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/06.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/06.png new file mode 100644 index 0000000000000..4e9607044ac36 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/06.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/07.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/07.png new file mode 100644 index 0000000000000..7fb036c1f048a Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/07.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/08.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/08.png new file mode 100644 index 0000000000000..549b9f29fffa4 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/08.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/09.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/09.png new file mode 100644 index 0000000000000..7fffd6ec21cb5 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/09.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/10.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/10.png new file mode 100644 index 0000000000000..4e9607044ac36 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/10.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/11.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/11.png new file mode 100644 index 0000000000000..7fffd6ec21cb5 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/11.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/12.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/12.png new file mode 100644 index 0000000000000..3249ddf46d1bf Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/12.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/13.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/13.png new file mode 100644 index 0000000000000..61363a597bb48 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/13.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/14.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/14.png new file mode 100644 index 0000000000000..87b023d20f887 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/14.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/15.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/15.png new file mode 100644 index 0000000000000..ef167a79eb0ec Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/15.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/16.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/16.png new file mode 100644 index 0000000000000..87b023d20f887 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/16.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/17.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/17.png new file mode 100644 index 0000000000000..d0e457229ae2d Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/17.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/18.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/18.png new file mode 100644 index 0000000000000..d0e457229ae2d Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/18.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/19.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/19.png new file mode 100644 index 0000000000000..9363b69f1141e Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/19.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/20.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/20.png new file mode 100644 index 0000000000000..9363b69f1141e Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/20.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/21.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/21.png new file mode 100644 index 0000000000000..9363b69f1141e Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/21.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/22.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/22.png new file mode 100644 index 0000000000000..9363b69f1141e Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/22.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/23.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/23.png new file mode 100644 index 0000000000000..034613c963663 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/23.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/24.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/24.png new file mode 100644 index 0000000000000..034613c963663 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/24.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/25.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/25.png new file mode 100644 index 0000000000000..ef167a79eb0ec Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/25.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/26.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/26.png new file mode 100644 index 0000000000000..6fd0edfb16b93 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/26.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/27.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/27.png new file mode 100644 index 0000000000000..3ac0084219a41 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/27.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/28.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/28.png new file mode 100644 index 0000000000000..da28b87cc147c Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/28.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/29.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/29.png new file mode 100644 index 0000000000000..1f86e1fd83e30 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/29.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/30.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/30.png new file mode 100644 index 0000000000000..75e3024948bf6 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/30.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/31.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/31.png new file mode 100644 index 0000000000000..72a6fbaae7387 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/31.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/32.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/32.png new file mode 100644 index 0000000000000..cf6c72c6d72f8 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/32.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/33.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/33.png new file mode 100644 index 0000000000000..2bd500cd765ae Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/33.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/34.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/34.png new file mode 100644 index 0000000000000..cd4ff91da0a49 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/34.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/35.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/35.png new file mode 100644 index 0000000000000..4e9607044ac36 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/35.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/36.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/36.png new file mode 100644 index 0000000000000..cf6c72c6d72f8 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/36.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/37.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/37.png new file mode 100644 index 0000000000000..53f9a017a74dc Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/37.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/38.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/38.png new file mode 100644 index 0000000000000..73d8746fc369a Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/38.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/39.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/39.png new file mode 100644 index 0000000000000..7fffd6ec21cb5 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/39.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/40.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/40.png new file mode 100644 index 0000000000000..a07b18ada046d Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/40.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/41.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/41.png new file mode 100644 index 0000000000000..3ddb81d87cf46 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/41.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/42.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/42.png new file mode 100644 index 0000000000000..0973cd620c9ec Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/42.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/43.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/43.png new file mode 100644 index 0000000000000..0973cd620c9ec Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/43.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/44.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/44.png new file mode 100644 index 0000000000000..a5263281b0d16 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/44.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/45.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/45.png new file mode 100644 index 0000000000000..ee46f55b5de67 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/45.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/46.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/46.png new file mode 100644 index 0000000000000..058d68626b0db Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/46.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/47.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/47.png new file mode 100644 index 0000000000000..0849477ce7313 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/47.png differ diff --git a/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/na.png b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/na.png new file mode 100644 index 0000000000000..a5263281b0d16 Binary files /dev/null and b/bundles/org.openhab.binding.weathercompany/src/main/resources/icons/na.png differ diff --git a/bundles/org.openhab.binding.weatherunderground/NOTICE b/bundles/org.openhab.binding.weatherunderground/NOTICE index c5346ebe77b44..4ac61a6e85f86 100644 --- a/bundles/org.openhab.binding.weatherunderground/NOTICE +++ b/bundles/org.openhab.binding.weatherunderground/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third Party Dependencies diff --git a/bundles/org.openhab.binding.weatherunderground/pom.xml b/bundles/org.openhab.binding.weatherunderground/pom.xml index 2b36faefdc821..e23a1264e40e9 100644 --- a/bundles/org.openhab.binding.weatherunderground/pom.xml +++ b/bundles/org.openhab.binding.weatherunderground/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.weatherunderground</artifactId> diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/feature/feature.xml b/bundles/org.openhab.binding.weatherunderground/src/main/feature/feature.xml index 0c08a5ab88d51..0e963584ae5ce 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.weatherunderground/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.weatherunderground-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-weatherunderground" description="WeatherUnderground Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundBindingConstants.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundBindingConstants.java index 9ded1ea41745c..98a1737917000 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundBindingConstants.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundHandlerFactory.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundHandlerFactory.java index 74d2cc25ec703..17bb8c74ee657 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundHandlerFactory.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/WeatherUndergroundHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/config/WeatherUndergroundConfiguration.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/config/WeatherUndergroundConfiguration.java index 3bbd1f2c9865b..483c73bbeb866 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/config/WeatherUndergroundConfiguration.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/config/WeatherUndergroundConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/discovery/WeatherUndergroundDiscoveryService.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/discovery/WeatherUndergroundDiscoveryService.java index 5a46c52ace1e9..102de24ed2597 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/discovery/WeatherUndergroundDiscoveryService.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/discovery/WeatherUndergroundDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundBridgeHandler.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundBridgeHandler.java index 00af272d69598..19cb5ff9765ce 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundBridgeHandler.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundHandler.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundHandler.java index 88b9f208117e5..8aac0f57bb4fc 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundHandler.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/handler/WeatherUndergroundHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonCurrent.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonCurrent.java index 1706fd2592128..c2193587f00cf 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonCurrent.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonCurrent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonData.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonData.java index 339addd64e9a7..b8ec0fd9a9113 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonData.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonData.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonError.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonError.java index e8502f194e9f2..629b2a532188f 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonError.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonError.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecast.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecast.java index c89b477c5b83e..1d24e8540fcd6 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecast.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecast.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecastDay.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecastDay.java index 5346e894f2778..eaad1a7747251 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecastDay.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonForecastDay.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonLocation.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonLocation.java index cddcf4662a502..e92defffed44e 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonLocation.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonLocation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonResponse.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonResponse.java index c707ae9a66246..a641d1221aec9 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonResponse.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonSimpleForecast.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonSimpleForecast.java index 9d1d3ba1f2fdb..b9e23be361c7d 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonSimpleForecast.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonSimpleForecast.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonUtils.java b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonUtils.java index 0921febaeba1e..cf4dc5f5294f2 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonUtils.java +++ b/bundles/org.openhab.binding.weatherunderground/src/main/java/org/openhab/binding/weatherunderground/internal/json/WeatherUndergroundJsonUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.weatherunderground/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.weatherunderground/src/main/resources/ESH-INF/thing/thing-types.xml index a6bd0d261bd92..c9866619b9448 100644 --- a/bundles/org.openhab.binding.weatherunderground/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.weatherunderground/src/main/resources/ESH-INF/thing/thing-types.xml @@ -150,7 +150,7 @@ </options> </parameter> <parameter name="refresh" type="integer" min="5" required="false" unit="min"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in minutes.</description> <default>30</default> </parameter> @@ -446,13 +446,13 @@ <channel-type id="icon" advanced="true"> <item-type>Image</item-type> - <label>Weather icon</label> + <label>Weather Icon</label> <description>Icon representing the weather conditions</description> </channel-type> <channel-type id="iconKey" advanced="true"> <item-type>String</item-type> - <label>Weather icon key</label> + <label>Weather Icon Key</label> <description>Key used in the icon URL</description> </channel-type> diff --git a/bundles/org.openhab.binding.wemo/NOTICE b/bundles/org.openhab.binding.wemo/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.wemo/NOTICE +++ b/bundles/org.openhab.binding.wemo/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.wemo/README.md b/bundles/org.openhab.binding.wemo/README.md old mode 100755 new mode 100644 index 1c8de5e78752e..643751af33176 --- a/bundles/org.openhab.binding.wemo/README.md +++ b/bundles/org.openhab.binding.wemo/README.md @@ -1,11 +1,11 @@ # Belkin Wemo Binding -This binding integrates the [Belkin WeMo Family](http://www.belkin.com/us/Products/c/home-automation/). +This binding integrates the [Belkin WeMo Family](https://www.belkin.com/us/Products/c/home-automation/). The integration happens either through the WeMo-Link bridge, which acts as an IP gateway to the ZigBee devices or through WiFi connection to standalone devices. ## Supported Things -The WeMo Binding supports the Socket, Insight, Lightswitch, Motion and Maker devices, as well as the WeMo-Link bridge with WeMo LED bulbs. +The WeMo Binding supports the Socket, Insight, Lightswitch, Motion, Dimmer, Coffemaker and Maker devices, as well as the WeMo-Link bridge with WeMo LED bulbs. ## Discovery @@ -13,7 +13,7 @@ The WeMo devices are discovered through UPnP discovery service in the network. D ## Binding Configuration -The binding does not need any special configuration +The binding does not need any configuration. ## Thing Configuration @@ -39,23 +39,40 @@ MZ100 94103EA2B278xxxx [ deviceID="94103EA2B278xxxx" ] Devices support some of the following channels: -| Channel Type ID | Item Type | Description | -| ------------------ | --------- | ------------------------------------------------------------ | -| motionDetection | Switch | On if motion is detected, off otherwise. (Motion Sensor only) | -| lastMotionDetected | DateTime | Representing the Date and Time when the last motion was detected. (Motion Sensor only) | -| state | Switch | This channel controls the actual binary State of a Device or represents Motion Detection. | -| lastChangedAt | DateTime | Representing the Date and Time the device was last turned on or of. | -| lastOnFor | Number | Time in seconds an Insight device was last turned on for. | -| onToday | Number | Time in seconds an Insight device has been switched on today. | -| onTotal | Number | Time in seconds an Insight device has been switched on totally. | -| timespan | Number | Time in seconds over which onTotal applies. Typically 2 weeks except first used. | -| averagePower | Number | Average power consumption in Watts. | -| currentPower | Number | Current power consumption of an Insight device. 0 if switched off. | -| energyToday | Number | Energy in Wh used today. | -| energyTotal | Number | Energy in Wh used in total. | -| standbyLimit | Number | Minimum energy draw in W to register device as switched on (default 8W, configurable via WeMo App). | -| onStandBy | Switch | Read-only indication of whether or not the device plugged in to the insight switch is drwawing more than the standby limit. | -| brightness | Number | Brightness of a WeMo LED. | +| Channel Type | Item Type | Description | Available on Thing | +|---------------------|-----------|---------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| motionDetection | Switch | On if motion is detected, off otherwise. (Motion Sensor only) | Motion | +| lastMotionDetected | DateTime | Date and Time when the last motion was detected. (Motion Sensor only) | Motion | +| state | Switch | This channel controls the actual binary State of a Device or represents Motion Detection. | All but Dimmer | +| lastChangedAt | DateTime | Date and Time the device was last turned on or of. | Insight | +| lastOnFor | Number | Time in seconds an Insight device was last turned on for. | Insight | +| onToday | Number | Time in seconds an Insight device has been switched on today. | Insight | +| onTotal | Number | Time in seconds an Insight device has been switched on totally. | Insight | +| timespan | Number | Time in seconds over which onTotal applies. Typically 2 weeks except first used. | Insight | +| averagePower | Number | Average power consumption in Watts. | Insight | +| currentPower | Number | Current power consumption of an Insight device. 0 if switched off. | Insight | +| energyToday | Number | Energy in Wh used today. | Insight | +| energyTotal | Number | Energy in Wh used in total. | Insight | +| standbyLimit | Number | Minimum energy draw in W to register device as switched on (default 8W, configurable via WeMo App). | Insight | +| onStandBy | Switch | Read-only indication of whether or not the device plugged in to the insight switch is drawing more than the standby limit. | Insight | +| relay | Switch | Switches the integrated relay contact close/open | Maker | +| sensor | Switch | Shows the state of the integrated sensor | Maker | +| coffeeMode | String | Operation mode of a WeMo Coffee Maker | CoffeeMaker | +| modeTime | Number | Current amount of time, in minutes, that the Coffee Maker has been in the current mode | CoffeeMaker | +| timeRemaining | Number | Remaining brewing time of a WeMo Coffee Maker | CoffeeMaker | +| waterLevelReached | Switch | Indicates if the WeMo Coffee Maker needs to be refilled | CoffeeMaker | +| cleanAdvise | Switch | Indicates if a WeMo Coffee Maker needs to be cleaned | CoffeeMaker | +| filterAdvise | Switch | Indicates if a WeMo Coffee Maker needs to have the filter changed | CoffeeMaker | +| brewed | DateTime | Date/time the coffee maker last completed brewing coffee | CoffeeMaker | +| lastCleaned | DateTime | Date/time the coffee maker last completed cleaning | CoffeeMaker | +| brightness | Number | Brightness of a WeMo LED od Dimmwer. | LED, DimmerSwitch | +| faderCountDownTime | Number | Dimmer fading duration time in minutes | DimmerSwitch | +| faderEnabled | Switch | Switch the fader ON/OFF | DimmerSwitch | +| timerStart | Switch | Switch the fading timer ON/OFF | DimmerSwitch | +| nightMode | Switch | Switch the nightMode ON/OFF | DimmerSwitch | +| startTime | DateTime | Time when the nightMode starts | DimmerSwitch | +| endTime | DateTime | Time when the nightMode ends | DimmerSwitch | +| nightModeBrightness | Number | Brightness used in nightMode | DimmerSwitch | ## Full Example @@ -63,29 +80,63 @@ Devices support some of the following channels: demo.things: ``` -wemo:socket:Switch1 [udn="Socket-1_0-221242K11xxxxx"] -wemo:motion:Sensor1 [udn="Sensor-1_0-221337L11xxxxx"] +wemo:socket:Switch1 "DemoSwitch" @ "Office" [udn="Socket-1_0-221242K11xxxxx"] +wemo:motion:Sensor1 "MotionSensor" @ "Entrance" [udn="Sensor-1_0-221337L11xxxxx"] + Bridge wemo:bridge:Bridge-1_0-231445B010xxxx [udn="Bridge-1_0-231445B010xxxx"] { -MZ100 94103EA2B278xxxx [ deviceID="94103EA2B278xxxx" ] -MZ100 94103EA2B278xxxx [ deviceID="94103EA2B278xxxx" ] +MZ100 94103EA2B278xxxx "DemoLight1" @ "Living" [ deviceID="94103EA2B278xxxx" ] +MZ100 94103EA2B278xxxx "DemoLoght2" @ "Living" [ deviceID="94103EA2B278xxxx" ] } ``` demo.items: ``` -Switch DemoSwitch { channel="wemo:socket:Switch1:state" } -Switch LightSwitch { channel="wemo:lightswitch:Lightswitch1:state" } -Switch MotionSensor { channel="wemo:Motion:Sensor1:motionDetection" } -Switch MotionDetected { channel="wemo:Motion:Sensor1:lastMotionDetected" } -Number InsightPower { channel="wemo:insight:Insight1:currentPower" } -Number InsightLastOn { channel="wemo:insight:Insight1:lastOnFor" } -Number InsightToday { channel="wemo:insight:Insight1:onToday" } -Number InsightTotal { channel="wemo:insight:Insight1:onTotal" } -Switch LED1 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:state" } -Dimmer dLED1 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } -Switch LED2 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:state" } -Dimmer dLED2 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } +// Switch +Switch DemoSwitch { channel="wemo:socket:Switch1:state" } + +// Lightswitch +Switch LightSwitch { channel="wemo:lightswitch:Lightswitch1:state" } + +// Motion +Switch MotionSensor { channel="wemo:Motion:Sensor1:motionDetection" } +DateTime MotionDetected { channel="wemo:Motion:Sensor1:lastMotionDetected" } + +// Insight +Switch InsightSwitch { channel="wemo:insight:Insight-1_0-xxxxxxxxxxxxxx:state" } +Number InsightPower { channel="wemo:insight:Insight-1_0-xxxxxxxxxxxxxx:currentPower" } +Number InsightLastOn { channel="wemo:insight:Insight-1_0-xxxxxxxxxxxxxx:lastOnFor" } +Number InsightToday { channel="wemo:insight:Insight-1_0-xxxxxxxxxxxxxx:onToday" } +Number InsightTotal { channel="wemo:insight:Insight-1_0-xxxxxxxxxxxxxx:onTotal" } + +// LED Bulbs +Switch LED1 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } +Dimmer dLED1 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } +Switch LED2 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } +Dimmer dLED2 { channel="wemo:MZ100:Bridge-1_0-231445B010xxxx:94103EA2B278xxxx:brightness" } + +// DimmerSwitch +Switch DimmerSwitch { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:brightness" } +Dimmer dDimmerSwitch { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:brightness" } +Number DimmerSwitchFaderTime { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:faderCountDownTime" } +Switch DimmerSwitchFaderOn { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:faderEnabled" } +Switch DimmerSwitchTimer { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:timerStart" } +Switch DimmerNightMode { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:nightMode" } +Dimmer NightModeBrightness { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:nightModeBrightness" } +DateTime NightModeStart { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:startTime" } +DateTime NightModeEnd { channel="wemo:dimmer:Dimmer-1_0-231445B010xxxx:endTime" } + +// CoffeMaker +Switch CoffeSwitch { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:state" } +String CoffeMode { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:coffeeMode" } +Number CoffeModeTime { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:modeTime" } +Number CoffeModeRemaining { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:timeRemaining" } +Switch CoffeWater { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:waterLevelReached" } +Switch CoffeCleanAdvicse { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:cleanAdvise" } +Switch CoffeFilterAdvicse { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:filterAdvise" } +DateTime CoffeLastCleaned { channel="wemo:coffee:Coffee-1_0-231445B010xxxx:lastCleaned" } + + ``` demo.sitemap: @@ -93,18 +144,51 @@ demo.sitemap: ``` sitemap demo label="Main Menu" { - Frame label="WeMo" { - Switch item=DemoSwitch - Switch item=LightSwitch - Switch item=MotionSensor - Number item=InsightPower - Number item=InsightLastOn - Number item=InsightToday - Number item=InsightTotal - Switch item=LED1 - Slider item=dLED1 - Switch item=LED2 - Slider item=dLED2 - } + Frame { + // Switch + Switch item=DemoSwitch + + // LightSwitch + Switch item=LightSwitch + + // Motion + Switch item=MotionSensor + Text item=MotionSensorLastChanged icon="clock" + + // Insight + Switch item=InsightSwitch + Number item=InsightPower + Number item=InsightLastOn + Number item=InsightToday + Number item=InsightTotal + + // LED Bulb + Switch item=LED1 + Slider item=dLED1 + Switch item=LED2 + Slider item=dLED2 + + //DimmerSwitch + Switch item=DimmerSwitch + Slider item=dDimmerSwitch + Number item=DimmerSwitchFaderTime + Switch item=DimmerSwitchFaderOn + Switch item=DimmerSwitchTimer + Switch item=DimmerNightMode + Slider item=NightModeBrightness + Text item=NightModeStart + Text item=NightModeEnd + + // CoffeMaker + Switch item=CoffeSwitch + Text item=CoffeMode + Number item=CoffeModeTime + Number item=CoffeModeRemaining + Switch item=CoffeWater + Switch item=CoffeCleanAdvicse + Switch item=CoffeFilterAdvicse + DateTime item=CoffeLastCleaned + + } } ``` diff --git a/bundles/org.openhab.binding.wemo/pom.xml b/bundles/org.openhab.binding.wemo/pom.xml index b9908f9c7f113..a34b8c9449e64 100644 --- a/bundles/org.openhab.binding.wemo/pom.xml +++ b/bundles/org.openhab.binding.wemo/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.wemo</artifactId> diff --git a/bundles/org.openhab.binding.wemo/src/main/feature/feature.xml b/bundles/org.openhab.binding.wemo/src/main/feature/feature.xml index f82f7ad16dfce..2ca1c88e87edc 100644 --- a/bundles/org.openhab.binding.wemo/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.wemo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.wemo-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-wemo" description="Wemo Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoBindingConstants.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoBindingConstants.java index bce329f04d17b..364d4b3d0df41 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoBindingConstants.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -39,6 +39,7 @@ public class WemoBindingConstants { public static final ThingTypeUID THING_TYPE_MZ100 = new ThingTypeUID(BINDING_ID, "MZ100"); public static final ThingTypeUID THING_TYPE_MAKER = new ThingTypeUID(BINDING_ID, "Maker"); public static final ThingTypeUID THING_TYPE_COFFEE = new ThingTypeUID(BINDING_ID, "CoffeeMaker"); + public static final ThingTypeUID THING_TYPE_DIMMER = new ThingTypeUID(BINDING_ID, "dimmer"); // List of all Channel ids public static final String CHANNEL_STATE = "state"; @@ -59,7 +60,6 @@ public class WemoBindingConstants { public static final String CHANNEL_SENSOR = "sensor"; public static final String CHANNEL_ONSTANDBY = "onStandBy"; - public static final String CHANNEL_COFFEEMODE = "coffeeMode"; public static final String CHANNEL_MODETIME = "modeTime"; public static final String CHANNEL_TIMEREMAINING = "timeRemaining"; @@ -69,6 +69,14 @@ public class WemoBindingConstants { public static final String CHANNEL_BREWED = "brewed"; public static final String CHANNEL_LASTCLEANED = "lastCleaned"; + public static final String CHANNEL_FADERENABLED = "faderEnabled"; + public static final String CHANNEL_TIMERSTART = "timerStart"; + public static final String CHANNEL_FADERCOUNTDOWNTIME = "faderCountDownTime"; + public static final String CHANNEL_NIGHTMODE = "nightMode"; + public static final String CHANNEL_STARTTIME = "startTime"; + public static final String CHANNEL_ENDTIME = "endTime"; + public static final String CHANNEL_NIGHTMODEBRIGHTNESS = "nightModeBrightness"; + // List of thing configuration properties public static final String UDN = "udn"; public static final String DEVICE_ID = "deviceID"; @@ -86,10 +94,9 @@ public class WemoBindingConstants { .unmodifiableSet(Stream.of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION) .collect(Collectors.toSet())); - public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections - .unmodifiableSet(Stream - .of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION, - THING_TYPE_BRIDGE, THING_TYPE_MZ100, THING_TYPE_MAKER, THING_TYPE_COFFEE) - .collect(Collectors.toSet())); + public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.unmodifiableSet(Stream + .of(THING_TYPE_SOCKET, THING_TYPE_INSIGHT, THING_TYPE_LIGHTSWITCH, THING_TYPE_MOTION, THING_TYPE_BRIDGE, + THING_TYPE_MZ100, THING_TYPE_MAKER, THING_TYPE_COFFEE, THING_TYPE_DIMMER) + .collect(Collectors.toSet())); } diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoHandlerFactory.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoHandlerFactory.java index 94582d3008205..a38c9d9000767 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoHandlerFactory.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/WemoHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,6 +31,7 @@ import org.openhab.binding.wemo.internal.discovery.WemoLinkDiscoveryService; import org.openhab.binding.wemo.internal.handler.WemoBridgeHandler; import org.openhab.binding.wemo.internal.handler.WemoCoffeeHandler; +import org.openhab.binding.wemo.internal.handler.WemoDimmerHandler; import org.openhab.binding.wemo.internal.handler.WemoHandler; import org.openhab.binding.wemo.internal.handler.WemoLightHandler; import org.openhab.binding.wemo.internal.handler.WemoMakerHandler; @@ -64,6 +65,7 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { private final Map<ThingUID, ServiceRegistration<?>> discoveryServiceRegs = new HashMap<>(); + @SuppressWarnings({ "null", "unused" }) @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); @@ -90,6 +92,10 @@ protected ThingHandler createHandler(Thing thing) { logger.debug("Creating a WemoCoffeeHandler for thing '{}' with UDN '{}'", thing.getUID(), thing.getConfiguration().get(UDN)); return new WemoCoffeeHandler(thing, upnpIOService, wemoHttpcaller); + } else if (thingTypeUID.equals(WemoBindingConstants.THING_TYPE_DIMMER)) { + logger.debug("Creating a WemoDimmerHandler for thing '{}' with UDN '{}'", thing.getUID(), + thing.getConfiguration().get("udn")); + return new WemoDimmerHandler(thing, upnpIOService, wemoHttpcaller); } else if (thingTypeUID.equals(WemoBindingConstants.THING_TYPE_MZ100)) { return new WemoLightHandler(thing, upnpIOService, wemoHttpcaller); } else { diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryParticipant.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryParticipant.java index 047fa9266ea6c..da1e6d2459a30 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,9 +18,11 @@ import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; import org.eclipse.smarthome.config.discovery.upnp.UpnpDiscoveryParticipant; +import org.eclipse.smarthome.config.discovery.upnp.internal.UpnpDiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; import org.jupnp.model.meta.RemoteDevice; @@ -73,7 +75,7 @@ public DiscoveryResult createResult(RemoteDevice device) { } @Override - public ThingUID getThingUID(RemoteDevice device) { + public ThingUID getThingUID(@Nullable RemoteDevice device) { if (device != null) { if (device.getDetails().getManufacturerDetails().getManufacturer() != null) { if (device.getDetails().getManufacturerDetails().getManufacturer().toUpperCase().contains("BELKIN")) { @@ -121,6 +123,11 @@ public ThingUID getThingUID(RemoteDevice device) { device.getIdentity().getUdn().getIdentifierString()); return new ThingUID(THING_TYPE_COFFEE, device.getIdentity().getUdn().getIdentifierString()); } + if (device.getDetails().getModelDetails().getModelName().toLowerCase().startsWith("dimmer")) { + logger.debug("Discovered a WeMo Dimmer Switch thing with UDN '{}'", + device.getIdentity().getUdn().getIdentifierString()); + return new ThingUID(THING_TYPE_DIMMER, device.getIdentity().getUdn().getIdentifierString()); + } } } } diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryService.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryService.java old mode 100755 new mode 100644 index 38dccabf4a616..3683b3fa3e73a --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryService.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoLinkDiscoveryService.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoLinkDiscoveryService.java index 32a5a4e37e8bf..ad40b0af1ee6f 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoLinkDiscoveryService.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/discovery/WemoLinkDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/AbstractWemoHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/AbstractWemoHandler.java index 6074982fab2a7..1f5d4b0178ae2 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/AbstractWemoHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/AbstractWemoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoBridgeHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoBridgeHandler.java index 2a7b71179ae39..626612858ee2e 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoBridgeHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoCoffeeHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoCoffeeHandler.java index e68fc78df473e..43b2e84394ffd 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoCoffeeHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoCoffeeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -96,7 +96,7 @@ public void run() { updateWemoState(); onSubscription(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } @@ -150,7 +150,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { try { updateWemoState(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); } } else if (channelUID.getId().equals(CHANNEL_STATE)) { if (command instanceof OnOffType) { @@ -423,6 +423,7 @@ protected void updateWemoState() { } } + @SuppressWarnings("null") public State getDateTimeState(String attributeValue) { if (attributeValue != null) { long value = 0; diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoDimmerHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoDimmerHandler.java new file mode 100644 index 0000000000000..3be37311944c6 --- /dev/null +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoDimmerHandler.java @@ -0,0 +1,614 @@ +/** + * 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.wemo.internal.handler; + +import static org.openhab.binding.wemo.internal.WemoBindingConstants.*; + +import java.math.BigDecimal; +import java.net.URL; +import java.time.Instant; +import java.time.ZonedDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.TimeZone; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.lang.StringUtils; +import org.eclipse.smarthome.config.core.Configuration; +import org.eclipse.smarthome.core.library.types.DateTimeType; +import org.eclipse.smarthome.core.library.types.DecimalType; +import org.eclipse.smarthome.core.library.types.IncreaseDecreaseType; +import org.eclipse.smarthome.core.library.types.OnOffType; +import org.eclipse.smarthome.core.library.types.PercentType; +import org.eclipse.smarthome.core.thing.ChannelUID; +import org.eclipse.smarthome.core.thing.Thing; +import org.eclipse.smarthome.core.thing.ThingStatus; +import org.eclipse.smarthome.core.thing.ThingStatusDetail; +import org.eclipse.smarthome.core.thing.ThingTypeUID; +import org.eclipse.smarthome.core.types.Command; +import org.eclipse.smarthome.core.types.RefreshType; +import org.eclipse.smarthome.core.types.State; +import org.eclipse.smarthome.io.transport.upnp.UpnpIOParticipant; +import org.eclipse.smarthome.io.transport.upnp.UpnpIOService; +import org.openhab.binding.wemo.internal.http.WemoHttpCall; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The {@link WemoDimmerHandler} is responsible for handling commands, which are + * sent to one of the channels and to update their states. + * + * @author Hans-Jörg Merk - Initial contribution + */ + +public class WemoDimmerHandler extends AbstractWemoHandler implements UpnpIOParticipant { + + private final Logger logger = LoggerFactory.getLogger(WemoDimmerHandler.class); + public final static Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_DIMMER); + private Map<String, Boolean> subscriptionState = new HashMap<String, Boolean>(); + private Map<String, String> stateMap = Collections.synchronizedMap(new HashMap<String, String>()); + protected final static int SUBSCRIPTION_DURATION = 600; + private UpnpIOService service; + private int currentBrightness; + private int currentNightModeBrightness; + private String currentNightModeState = null; + /** + * Set dimming stepsize to 5% + */ + private static final int DIM_STEPSIZE = 5; + /** + * The default refresh interval in Seconds. + */ + private int DEFAULT_REFRESH_INTERVAL = 60; + private ScheduledFuture<?> refreshJob; + private Runnable refreshRunnable = new Runnable() { + + @Override + public void run() { + try { + if (!isUpnpDeviceRegistered()) { + logger.debug("WeMo UPnP device {} not yet registered", getUDN()); + } + updateWemoState(); + onSubscription(); + } catch (Exception e) { + logger.debug("Exception during poll : {}", e.getMessage(), e); + } + } + }; + + public WemoDimmerHandler(Thing thing, UpnpIOService upnpIOService, WemoHttpCall wemohttpCaller) { + super(thing); + this.wemoHttpCaller = wemohttpCaller; + logger.debug("Creating a WemoDimmerHandler for thing '{}'", getThing().getUID()); + if (upnpIOService != null) { + this.service = upnpIOService; + } else { + logger.debug("upnpIOService not set."); + } + } + + @Override + public void initialize() { + Configuration configuration = getConfig(); + if (configuration.get("udn") != null) { + logger.debug("Initializing WemoDimmerHandler for UDN '{}'", configuration.get("udn")); + service.registerParticipant(this); + onSubscription(); + onUpdate(); + } else { + logger.debug("Cannot initalize WemoDimmerHandler. UDN not set."); + } + } + + @Override + public void dispose() { + logger.debug("WeMoDimmerHandler disposed."); + removeSubscription(); + if (refreshJob != null && !refreshJob.isCancelled()) { + refreshJob.cancel(true); + refreshJob = null; + } + } + + @Override + public void handleCommand(ChannelUID channelUID, Command command) { + logger.trace("Command '{}' received for channel '{}'", command, channelUID); + if (command instanceof RefreshType) { + try { + updateWemoState(); + } catch (Exception e) { + logger.debug("Exception during poll", e); + } + } else { + String action = "SetBinaryState"; + String argument = "BinaryState"; + String value = "0"; + String timeStamp = null; + switch (channelUID.getId()) { + case CHANNEL_BRIGHTNESS: + if (command instanceof OnOffType) { + value = command.equals(OnOffType.OFF) ? "0" : "1"; + setBinaryState(action, argument, value); + if (command.equals(OnOffType.OFF)) { + State brightnessState = new PercentType("0"); + updateState(CHANNEL_BRIGHTNESS, brightnessState); + updateState(CHANNEL_TIMERSTART, OnOffType.OFF); + } else { + State brightnessState = new PercentType(currentBrightness); + updateState(CHANNEL_BRIGHTNESS, brightnessState); + } + } else if (command instanceof PercentType) { + int newBrightness = ((PercentType) command).intValue(); + value = String.valueOf(newBrightness); + currentBrightness = newBrightness; + argument = "brightness"; + if (value.equals("0")) { + value = "1"; + argument = "brightness"; + setBinaryState(action, argument, "1"); + value = "0"; + argument = "BinaryState"; + setBinaryState(action, argument, "0"); + } else if (this.stateMap.get("BinaryState").equals("0")) { + argument = "BinaryState"; + setBinaryState(action, argument, "1"); + } + argument = "brightness"; + setBinaryState(action, argument, value); + } else if (command instanceof IncreaseDecreaseType) { + int newBrightness; + switch (command.toString()) { + case "INCREASE": + newBrightness = currentBrightness + DIM_STEPSIZE; + if (newBrightness > 100) { + newBrightness = 100; + } + value = String.valueOf(newBrightness); + currentBrightness = newBrightness; + break; + case "DECREASE": + newBrightness = currentBrightness - DIM_STEPSIZE; + if (newBrightness < 0) { + newBrightness = 0; + } + value = String.valueOf(newBrightness); + currentBrightness = newBrightness; + break; + } + argument = "brightness"; + if (value.equals("0")) { + value = "1"; + argument = "brightness"; + setBinaryState(action, argument, "1"); + value = "0"; + argument = "BinaryState"; + setBinaryState(action, argument, "0"); + } else if (this.stateMap.get("BinaryState").equals("0")) { + argument = "BinaryState"; + setBinaryState(action, argument, "1"); + } + argument = "brightness"; + setBinaryState(action, argument, value); + } + break; + case CHANNEL_FADERCOUNTDOWNTIME: + argument = "Fader"; + if (command instanceof DecimalType) { + int commandValue = Integer.valueOf(String.valueOf(command)); + commandValue = commandValue * 60; + String commandString = String.valueOf(commandValue); + value = "<BinaryState></BinaryState>" + "<Duration></Duration>" + "<EndAction></EndAction>" + + "<brightness></brightness>" + "<fader>" + commandString + ":-1:1:0:0</fader>" + + "<UDN></UDN>"; + setBinaryState(action, argument, value); + } + break; + case CHANNEL_FADERENABLED: + argument = "Fader"; + if (command.equals(OnOffType.ON)) { + value = "<BinaryState></BinaryState>" + "<Duration></Duration>" + "<EndAction></EndAction>" + + "<brightness></brightness>" + "<fader>600:-1:1:0:0</fader>" + "<UDN></UDN>"; + } else if (command.equals(OnOffType.OFF)) { + value = "<BinaryState></BinaryState>" + "<Duration></Duration>" + "<EndAction></EndAction>" + + "<brightness></brightness>" + "<fader>600:-1:0:0:0</fader>" + "<UDN></UDN>"; + } + setBinaryState(action, argument, value); + break; + case CHANNEL_TIMERSTART: + argument = "Fader"; + long ts = System.currentTimeMillis() / 1000; + timeStamp = String.valueOf(ts); + logger.info("timestamp '{}' created", timeStamp); + String faderSeconds = null; + String faderEnabled = null; + String[] splitFader = this.stateMap.get("fader").split(":"); + if (splitFader[0] != null) { + faderSeconds = splitFader[0]; + } + if (splitFader[0] != null) { + faderEnabled = splitFader[2]; + } + if (faderSeconds != null && faderEnabled != null) { + if (command.equals(OnOffType.ON)) { + value = "<BinaryState></BinaryState>" + "<Duration></Duration>" + "<EndAction></EndAction>" + + "<brightness></brightness>" + "<fader>" + faderSeconds + ":" + timeStamp + ":" + + faderEnabled + ":0:0</fader>" + "<UDN></UDN>"; + updateState(CHANNEL_STATE, OnOffType.ON); + } else if (command.equals(OnOffType.OFF)) { + value = "<BinaryState></BinaryState>" + "<Duration></Duration>" + "<EndAction></EndAction>" + + "<brightness></brightness>" + "<fader>" + faderSeconds + ":-1:" + faderEnabled + + ":0:0</fader>" + "<UDN></UDN>"; + } + } + setBinaryState(action, argument, value); + break; + case CHANNEL_NIGHTMODE: + action = "ConfigureNightMode"; + argument = "NightModeConfiguration"; + String nightModeBrightness = String.valueOf(currentNightModeBrightness); + if (command.equals(OnOffType.ON)) { + value = "<startTime>0</startTime> \\n<nightMode>1</nightMode> \\n<endTime>23400</endTime> \\n<nightModeBrightness>" + + nightModeBrightness + "</nightModeBrightness> \\n"; + } else if (command.equals(OnOffType.OFF)) { + value = "<startTime>0</startTime> \\n<nightMode>0</nightMode> \\n<endTime>23400</endTime> \\n<nightModeBrightness>" + + nightModeBrightness + "</nightModeBrightness> \\n"; + } + setBinaryState(action, argument, value); + break; + case CHANNEL_NIGHTMODEBRIGHTNESS: + action = "ConfigureNightMode"; + argument = "NightModeConfiguration"; + if (command instanceof PercentType) { + int newBrightness = ((PercentType) command).intValue(); + String newNightModeBrightness = String.valueOf(newBrightness); + value = "<startTime>0</startTime> \\n<nightMode>" + currentNightModeState + + "</nightMode> \\n<endTime>23400</endTime> \\n<nightModeBrightness>" + + newNightModeBrightness + "</nightModeBrightness> \\n"; + currentNightModeBrightness = newBrightness; + } else if (command instanceof IncreaseDecreaseType) { + int newBrightness; + String newNightModeBrightness = null; + switch (command.toString()) { + case "INCREASE": + newBrightness = currentNightModeBrightness + DIM_STEPSIZE; + if (newBrightness > 100) { + newBrightness = 100; + } + newNightModeBrightness = String.valueOf(newBrightness); + currentBrightness = newBrightness; + break; + case "DECREASE": + newBrightness = currentNightModeBrightness - DIM_STEPSIZE; + if (newBrightness < 0) { + newBrightness = 0; + } + newNightModeBrightness = String.valueOf(newBrightness); + currentNightModeBrightness = newBrightness; + break; + } + value = "<startTime>0</startTime> \\n<nightMode>" + currentNightModeState + + "</nightMode> \\n<endTime>23400</endTime> \\n<nightModeBrightness>" + + newNightModeBrightness + "</nightModeBrightness> \\n"; + } + setBinaryState(action, argument, value); + break; + } + } + } + + @Override + public void onServiceSubscribed(String service, boolean succeeded) { + logger.debug("WeMo {}: Subscription to service {} {}", getUDN(), service, succeeded ? "succeeded" : "failed"); + subscriptionState.put(service, succeeded); + } + + @Override + public void onValueReceived(String variable, String value, String service) { + logger.debug("Received pair '{}':'{}' (service '{}') for thing '{}'", + new Object[] { variable, value, service, this.getThing().getUID() }); + updateStatus(ThingStatus.ONLINE); + this.stateMap.put(variable, value); + switch (variable) { + case "BinaryState": + State state = value.equals("0") ? OnOffType.OFF : OnOffType.ON; + logger.debug("State '{}' for device '{}' received", state, getThing().getUID()); + updateState(CHANNEL_BRIGHTNESS, state); + if (state.equals(OnOffType.OFF)) { + updateState(CHANNEL_TIMERSTART, OnOffType.OFF); + } + break; + case "brightness": + logger.debug("brightness '{}' for device '{}' received", value, getThing().getUID()); + int newBrightnessValue = Integer.valueOf(value); + State newBrightnessState = new PercentType(newBrightnessValue); + if (this.stateMap.get("BinaryState").equals("1")) { + updateState(CHANNEL_BRIGHTNESS, newBrightnessState); + } + currentBrightness = newBrightnessValue; + break; + case "fader": + logger.debug("fader '{}' for device '{}' received", value, getThing().getUID()); + String[] splitFader = value.split(":"); + if (splitFader[0] != null) { + int faderSeconds = Integer.valueOf(splitFader[0]); + State faderMinutes = new DecimalType(faderSeconds / 60); + logger.debug("faderTime '{} minutes' for device '{}' received", faderMinutes, getThing().getUID()); + updateState(CHANNEL_FADERCOUNTDOWNTIME, faderMinutes); + } + if (splitFader[1] != null) { + State isTimerRunning = splitFader[1].equals("-1") ? OnOffType.OFF : OnOffType.ON; + logger.debug("isTimerRunning '{}' for device '{}' received", isTimerRunning, getThing().getUID()); + updateState(CHANNEL_TIMERSTART, isTimerRunning); + if (isTimerRunning.equals(OnOffType.ON)) { + updateState(CHANNEL_STATE, OnOffType.ON); + } + } + if (splitFader[2] != null) { + State isFaderEnabled = splitFader[1].equals("0") ? OnOffType.OFF : OnOffType.ON; + logger.debug("isFaderEnabled '{}' for device '{}' received", isFaderEnabled, getThing().getUID()); + updateState(CHANNEL_FADERENABLED, isFaderEnabled); + } + break; + case "nightMode": + State nightModeState = value.equals("0") ? OnOffType.OFF : OnOffType.ON; + currentNightModeState = value; + logger.debug("nightModeState '{}' for device '{}' received", nightModeState, getThing().getUID()); + updateState(CHANNEL_NIGHTMODE, nightModeState); + break; + case "startTime": + State startTimeState = getDateTimeState(value); + logger.debug("startTimeState '{}' for device '{}' received", startTimeState, getThing().getUID()); + updateState(CHANNEL_STARTTIME, startTimeState); + break; + case "endTime": + State endTimeState = getDateTimeState(value); + logger.debug("endTimeState '{}' for device '{}' received", endTimeState, getThing().getUID()); + updateState(CHANNEL_ENDTIME, endTimeState); + break; + case "nightModeBrightness": + int nightModeBrightnessValue = Integer.valueOf(value); + currentNightModeBrightness = nightModeBrightnessValue; + State nightModeBrightnessState = new PercentType(nightModeBrightnessValue); + logger.debug("nightModeBrightnessState '{}' for device '{}' received", nightModeBrightnessState, + getThing().getUID()); + updateState(CHANNEL_NIGHTMODEBRIGHTNESS, nightModeBrightnessState); + break; + } + } + + private synchronized void onSubscription() { + if (service.isRegistered(this)) { + logger.debug("Checking WeMo GENA subscription for '{}'", this); + String subscription = "basicevent1"; + if ((subscriptionState.get(subscription) == null) || !subscriptionState.get(subscription).booleanValue()) { + logger.debug("Setting up GENA subscription {}: Subscribing to service {}...", getUDN(), subscription); + service.addSubscription(this, subscription, SUBSCRIPTION_DURATION); + subscriptionState.put(subscription, true); + } + } else { + logger.debug("Setting up WeMo GENA subscription for '{}' FAILED - service.isRegistered(this) is FALSE", + this); + } + } + + private synchronized void removeSubscription() { + logger.debug("Removing WeMo GENA subscription for '{}'", this); + if (service.isRegistered(this)) { + String subscription = "basicevent1"; + if ((subscriptionState.get(subscription) != null) && subscriptionState.get(subscription).booleanValue()) { + logger.debug("WeMo {}: Unsubscribing from service {}...", getUDN(), subscription); + service.removeSubscription(this, subscription); + } + subscriptionState = new HashMap<String, Boolean>(); + service.unregisterParticipant(this); + } + } + + private synchronized void onUpdate() { + if (refreshJob == null || refreshJob.isCancelled()) { + Configuration config = getThing().getConfiguration(); + int refreshInterval = DEFAULT_REFRESH_INTERVAL; + Object refreshConfig = config.get("refresh"); + if (refreshConfig != null) { + refreshInterval = ((BigDecimal) refreshConfig).intValue(); + } + refreshJob = scheduler.scheduleWithFixedDelay(refreshRunnable, 10, refreshInterval, TimeUnit.SECONDS); + } + } + + private boolean isUpnpDeviceRegistered() { + return service.isRegistered(this); + } + + @Override + public String getUDN() { + return (String) this.getThing().getConfiguration().get(UDN); + } + + /** + * The {@link updateWemoState} polls the actual state of a WeMo device and + * calls {@link onValueReceived} to update the statemap and channels.. + * + */ + protected void updateWemoState() { + String action = "GetBinaryState"; + String variable = null; + String actionService = "basicevent"; + String value = null; + String soapHeader = "\"urn:Belkin:service:" + actionService + ":1#" + action + "\""; + String content = "<?xml version=\"1.0\"?>" + + "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + + "<s:Body>" + "<u:" + action + " xmlns:u=\"urn:Belkin:service:" + actionService + ":1\">" + "</u:" + + action + ">" + "</s:Body>" + "</s:Envelope>"; + try { + String wemoURL = getWemoURL(actionService); + if (wemoURL != null) { + String wemoCallResponse = wemoHttpCaller.executeCall(wemoURL, soapHeader, content); + if (wemoCallResponse != null) { + logger.trace("State response '{}' for device '{}' received", wemoCallResponse, getThing().getUID()); + value = StringUtils.substringBetween(wemoCallResponse, "<BinaryState>", "</BinaryState>"); + if (value != null) { + variable = "BinaryState"; + logger.trace("New state '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + value = StringUtils.substringBetween(wemoCallResponse, "<brightness>", "</brightness>"); + if (value != null) { + variable = "brightness"; + logger.trace("New brightness '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + value = StringUtils.substringBetween(wemoCallResponse, "<fader>", "</fader>"); + if (value != null) { + variable = "fader"; + logger.trace("New fader value '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + } + } + } catch (Exception e) { + logger.debug("Failed to get actual state for device '{}': {}", getThing().getUID(), e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + updateStatus(ThingStatus.ONLINE); + action = "GetNightModeConfiguration"; + variable = null; + value = null; + soapHeader = "\"urn:Belkin:service:" + actionService + ":1#" + action + "\""; + content = "<?xml version=\"1.0\"?>" + + "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + + "<s:Body>" + "<u:" + action + " xmlns:u=\"urn:Belkin:service:" + actionService + ":1\">" + "</u:" + + action + ">" + "</s:Body>" + "</s:Envelope>"; + try { + String wemoURL = getWemoURL(actionService); + if (wemoURL != null) { + String wemoCallResponse = wemoHttpCaller.executeCall(wemoURL, soapHeader, content); + if (wemoCallResponse != null) { + logger.trace("GetNightModeConfiguration response '{}' for device '{}' received", wemoCallResponse, + getThing().getUID()); + value = StringUtils.substringBetween(wemoCallResponse, "<startTime>", "</startTime>"); + if (value != null) { + variable = "startTime"; + logger.trace("New startTime '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + value = StringUtils.substringBetween(wemoCallResponse, "<endTime>", "</endTime>"); + if (value != null) { + variable = "endTime"; + logger.trace("New endTime '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + value = StringUtils.substringBetween(wemoCallResponse, "<nightMode>", "</nightMode>"); + if (value != null) { + variable = "nightMode"; + logger.trace("New nightMode state '{}' for device '{}' received", value, getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + value = StringUtils.substringBetween(wemoCallResponse, "<nightModeBrightness>", + "</nightModeBrightness>"); + if (value != null) { + variable = "nightModeBrightness"; + logger.trace("New nightModeBrightness '{}' for device '{}' received", value, + getThing().getUID()); + this.onValueReceived(variable, value, actionService + "1"); + } + } + } + } catch (Exception e) { + logger.debug("Failed to get actual NightMode state for device '{}': {}", getThing().getUID(), + e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + updateStatus(ThingStatus.ONLINE); + } + + public String getWemoURL(String actionService) { + URL descriptorURL = service.getDescriptorURL(this); + String wemoURL = null; + if (descriptorURL != null) { + String deviceURL = StringUtils.substringBefore(descriptorURL.toString(), "/setup.xml"); + wemoURL = deviceURL + "/upnp/control/" + actionService + "1"; + return wemoURL; + } + return null; + } + + @SuppressWarnings("null") + public State getDateTimeState(String attributeValue) { + if (attributeValue != null) { + long value = 0; + try { + value = Long.parseLong(attributeValue) * 1000; // convert s to ms + } catch (NumberFormatException e) { + logger.warn("Unable to parse attributeValue '{}' for device '{}'; expected long", attributeValue, + getThing().getUID()); + return null; + } + ZonedDateTime zoned = ZonedDateTime.ofInstant(Instant.ofEpochMilli(value), + TimeZone.getDefault().toZoneId()); + State dateTimeState = new DateTimeType(zoned); + if (dateTimeState != null) { + logger.trace("New attribute '{}' received", dateTimeState); + return dateTimeState; + } + } + return null; + } + + public void setBinaryState(String action, String argument, String value) { + try { + String soapHeader = "\"urn:Belkin:service:basicevent:1#SetBinaryState\""; + String content = "<?xml version=\"1.0\"?>" + + "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + + "<s:Body>" + "<u:" + action + " xmlns:u=\"urn:Belkin:service:basicevent:1\">" + "<" + argument + + ">" + value + "</" + argument + ">" + "</u:" + action + ">" + "</s:Body>" + "</s:Envelope>"; + String wemoURL = getWemoURL("basicevent"); + if (wemoURL != null) { + logger.trace("About to send content to Dimmer {}", content); + wemoHttpCaller.executeCall(wemoURL, soapHeader, content); + } + } catch (Exception e) { + logger.debug("Failed to set binaryState '{}' for device '{}': {}", value, getThing().getUID(), + e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + + public void setTimerStart(String action, String argument, String value) { + try { + String soapHeader = "\"urn:Belkin:service:basicevent:1#SetBinaryState\""; + String content = "<?xml version=\"1.0\"?>" + + "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">" + + "<s:Body>" + "<u:SetBinaryState xmlns:u=\"urn:Belkin:service:basicevent:1\">" + value + + "</u:SetBinaryState>" + "</s:Body>" + "</s:Envelope>"; + String wemoURL = getWemoURL("basicevent"); + if (wemoURL != null) { + logger.trace("About to send content to Dimmer {}", content); + wemoHttpCaller.executeCall(wemoURL, soapHeader, content); + } + } catch (Exception e) { + logger.debug("Failed to set binaryState '{}' for device '{}': {}", value, getThing().getUID(), + e.getMessage()); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); + } + } + + @Override + public void onStatusChanged(boolean status) { + } + +} diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoHandler.java index 427c1b017e1e8..40bdbf028dec2 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,8 +14,15 @@ import static org.openhab.binding.wemo.internal.WemoBindingConstants.*; +import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; +import java.net.ConnectException; +import java.net.InetSocketAddress; +import java.net.NoRouteToHostException; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketTimeoutException; import java.net.URL; import java.time.Instant; import java.time.ZonedDateTime; @@ -94,7 +101,7 @@ public void run() { updateWemoState(); onSubscription(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } @@ -120,6 +127,7 @@ public void initialize() { if (configuration.get("udn") != null) { logger.debug("Initializing WemoHandler for UDN '{}'", configuration.get("udn")); + service.registerParticipant(this); onSubscription(); onUpdate(); updateStatus(ThingStatus.ONLINE); @@ -148,7 +156,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { try { updateWemoState(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); } } else if (channelUID.getId().equals(CHANNEL_STATE)) { if (command instanceof OnOffType) { @@ -190,6 +198,7 @@ public void onServiceSubscribed(String service, boolean succeeded) { subscriptionState.put(service, succeeded); } + @SuppressWarnings("null") @Override public void onValueReceived(String variable, String value, String service) { logger.debug("Received pair '{}':'{}' (service '{}') for thing '{}'", @@ -304,10 +313,10 @@ public void onValueReceived(String variable, String value, String service) { getThing().getUID()); updateState(CHANNEL_STANDBYLIMIT, standByLimit); } - if (currentMW.divide(new BigDecimal(1000), RoundingMode.HALF_UP).intValue() > standByLimitMW.divide(new BigDecimal(1000), RoundingMode.HALF_UP).intValue()){ + if (currentMW.divide(new BigDecimal(1000), RoundingMode.HALF_UP).intValue() > standByLimitMW + .divide(new BigDecimal(1000), RoundingMode.HALF_UP).intValue()) { updateState(CHANNEL_ONSTANDBY, OnOffType.OFF); - } - else{ + } else { updateState(CHANNEL_ONSTANDBY, OnOffType.ON); } } @@ -452,13 +461,39 @@ protected void updateWemoState() { public String getWemoURL(String actionService) { URL descriptorURL = service.getDescriptorURL(this); + int portCheckStart = 49151; + int portCheckStop = 49157; String wemoURL = null; + String host = null; + String port = null; if (descriptorURL != null) { - String deviceURL = StringUtils.substringBefore(descriptorURL.toString(), "/setup.xml"); - wemoURL = deviceURL + "/upnp/control/" + actionService + "1"; + host = StringUtils.substringBetween(descriptorURL.toString(), "://", ":"); + for (int i = portCheckStart; i < portCheckStop; i++) { + try { + boolean portFound = servicePing(host, i); + if (portFound) { + logger.trace("WeMo device {} responded at Port {}", getUDN(), i); + port = String.valueOf(i); + break; + } + } catch (Exception e) { + } + } + wemoURL = "http://" + host + ":" + port + "/upnp/control/" + actionService + "1"; return wemoURL; } - return null; + return wemoURL; + } + + public boolean servicePing(String host, int port) throws IOException { + SocketAddress socketAddress = new InetSocketAddress(host, port); + try (Socket socket = new Socket()) { + logger.trace("Ping WeMo device at '{}'", socketAddress); + socket.connect(socketAddress, 250); + return true; + } catch (ConnectException | SocketTimeoutException | NoRouteToHostException ignored) { + return false; + } } @Override diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoLightHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoLightHandler.java index f7bc61166ed25..2d65be0431362 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoLightHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoLightHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -96,7 +96,7 @@ public void run() { getDeviceState(); onSubscription(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } @@ -185,7 +185,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { try { getDeviceState(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); } } else { Configuration configuration = getConfig(); @@ -271,12 +271,10 @@ public void handleCommand(ChannelUID channelUID, Command command) { if (wemoURL != null && capability != null && value != null) { String wemoCallResponse = wemoHttpCaller.executeCall(wemoURL, soapHeader, content); if (wemoCallResponse != null) { - if (capability != null && capability.equals("10008") && value != null) { + if (capability.equals("10008")) { OnOffType binaryState = null; binaryState = value.equals("0") ? OnOffType.OFF : OnOffType.ON; - if (binaryState != null) { - updateState(CHANNEL_STATE, binaryState); - } + updateState(CHANNEL_STATE, binaryState); } } } @@ -322,9 +320,7 @@ public void getDeviceState() { if (splitResponse[0] != null) { OnOffType binaryState = null; binaryState = splitResponse[0].equals("0") ? OnOffType.OFF : OnOffType.ON; - if (binaryState != null) { - updateState(CHANNEL_STATE, binaryState); - } + updateState(CHANNEL_STATE, binaryState); } if (splitResponse[1] != null) { String splitBrightness[] = splitResponse[1].split(":"); @@ -358,9 +354,7 @@ public void onValueReceived(String variable, String value, String service) { case "10006": OnOffType binaryState = null; binaryState = newValue.equals("0") ? OnOffType.OFF : OnOffType.ON; - if (binaryState != null) { - updateState(CHANNEL_STATE, binaryState); - } + updateState(CHANNEL_STATE, binaryState); break; case "10008": String splitValue[] = newValue.split(":"); diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoMakerHandler.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoMakerHandler.java index ee56471297b66..9f9910e4065c0 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoMakerHandler.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/handler/WemoMakerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -78,7 +78,7 @@ public void run() { try { updateWemoState(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); } } @@ -129,7 +129,7 @@ public void handleCommand(ChannelUID channelUID, Command command) { try { updateWemoState(); } catch (Exception e) { - logger.debug("Exception during poll : {}", e); + logger.debug("Exception during poll", e); } } else if (channelUID.getId().equals(CHANNEL_RELAY)) { if (command instanceof OnOffType) { @@ -193,6 +193,7 @@ public String getUDN() { /** * The {@link updateWemoState} polls the actual state of a WeMo Maker. */ + @SuppressWarnings("null") protected void updateWemoState() { String action = "GetAttributes"; String actionService = "deviceevent"; diff --git a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/http/WemoHttpCall.java b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/http/WemoHttpCall.java index b2bb54dbd3eae..60d756b7c6fe9 100644 --- a/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/http/WemoHttpCall.java +++ b/bundles/org.openhab.binding.wemo/src/main/java/org/openhab/binding/wemo/internal/http/WemoHttpCall.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -15,7 +15,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Properties; import org.eclipse.smarthome.io.net.http.HttpUtil; @@ -39,7 +39,7 @@ public String executeCall(String wemoURL, String soapHeader, String content) { wemoHeaders.setProperty("CONTENT-TYPE", WemoBindingConstants.HTTP_CALL_CONTENT_HEADER); wemoHeaders.put("SOAPACTION", soapHeader); - InputStream wemoContent = new ByteArrayInputStream(content.getBytes(Charset.forName("UTF-8"))); + InputStream wemoContent = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); String wemoCallResponse = HttpUtil.executeUrl("POST", wemoURL, wemoHeaders, wemoContent, null, 2000); return wemoCallResponse; diff --git a/bundles/org.openhab.binding.wemo/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.wemo/src/main/resources/ESH-INF/thing/thing-types.xml index 4bae609d78395..56aad15bda04a 100644 --- a/bundles/org.openhab.binding.wemo/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.wemo/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,357 +1,429 @@ -<?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="wemo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" - xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - - <thing-type id="socket"> - <label>WeMo Switch</label> - <description>This is a standard WeMo Switch</description> - - <channels> - <channel id="state" typeId="state" /> - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - - </config-description> - </thing-type> - - <thing-type id="insight"> - <label>WeMo Insight Switch</label> - <description>This is a WeMo Insight Switch with energy measurement</description> - - <channels> - <channel id="state" typeId="state" /> - <channel id="lastChangedAt" typeId="lastChangedAt" /> - <channel id="lastOnFor" typeId="lastOnFor" /> - <channel id="onToday" typeId="onToday" /> - <channel id="onTotal" typeId="onTotal" /> - <channel id="timespan" typeId="timespan" /> - <channel id="averagePower" typeId="averagePower" /> - <channel id="currentPower" typeId="currentPower" /> - <channel id="energyToday" typeId="energyToday" /> - <channel id="energyTotal" typeId="energyTotal" /> - <channel id="standByLimit" typeId="standByLimit" /> - <channel id="onStandBy" typeId="onStandBy" /> - - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - </config-description> - </thing-type> - - <thing-type id="lightswitch"> - <label>WeMo Light Switch</label> - <description>This is a WeMo LightSwitch</description> - - <channels> - <channel id="state" typeId="state" /> - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - </config-description> - </thing-type> - - <thing-type id="motion"> - <label>WeMo Motion</label> - <description>This is a WeMo MotionSensor</description> - - <channels> - <channel id="motionDetection" typeId="motionDetection" /> - <channel id="lastMotionDetected" typeId="lastMotionDetected" /> - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - </config-description> - </thing-type> - - <!-- Standard WeMo Bulb with E27 socket --> - <thing-type id="MZ100"> - <supported-bridge-type-refs> - <bridge-type-ref id="bridge" /> - </supported-bridge-type-refs> - - <label>WeMo LED Light</label> - <description>This is a standard WeMo light bulb with E27 socket </description> - - <channels> - <channel id="state" typeId="state" /> - <channel id="brightness" typeId="brightness" /> - </channels> - - <properties> - <property name="vendor">MRVL</property> - <property name="modelId">MZ100</property> - </properties> - - <config-description> - <parameter name="deviceID" type="text"> - <label>Device ID</label> - <description>The device ID identifies one certain WeMo light.</description> - <required>true</required> - </parameter> - </config-description> - </thing-type> - - <thing-type id="Maker"> - <label>WeMo Maker</label> - <description>This is a WeMo Maker</description> - - <channels> - <channel id="relay" typeId="relay" /> - <channel id="sensor" typeId="sensor" /> - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - </config-description> - </thing-type> - - <thing-type id="CoffeeMaker"> - <label>Mr. Coffee WeMo Enabled Coffeemaker</label> - <description>This is a WeMo enabled coffee maker</description> - - <channels> - <channel id="state" typeId="state" /> - <channel id="coffeeMode" typeId="coffeeMode" /> - <channel id="modeTime" typeId="modeTime" /> - <channel id="timeRemaining" typeId="timeRemaining" /> - <channel id="waterLevelReached" typeId="waterLevelReached" /> - <channel id="cleanAdvise" typeId="cleanAdvise" /> - <channel id="filterAdvise" typeId="filterAdvise" /> - <channel id="brewed" typeId="brewed" /> - <channel id="lastCleaned" typeId="lastCleaned" /> - </channels> - - <config-description> - <parameter name="udn" type="text"> - <label>Unique Device Name</label> - <description>The UDN identifies the WeMo Device</description> - <required>true</required> - </parameter> - <parameter name="pollingInterval" type="integer" required="false" min="15" max="180"> - <label>Polling Interval</label> - <description>Interval polling the WeMo Coffee Maker. - </description> - <default>60</default> - </parameter> - </config-description> - </thing-type> - - <channel-type id="state"> - <item-type>Switch</item-type> - <label>Switch</label> - <description>Turns the power on or off</description> - <category>Switch</category> - </channel-type> - - <channel-type id="motionDetection"> - <item-type>Switch</item-type> - <label>Motion Status</label> - <description>Indicates whether motion is detected or not</description> - <category>Switch</category> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="lastMotionDetected" advanced="true"> - <item-type>DateTime</item-type> - <label>Last Activity (Date/Time)</label> - <description>Date/time when last motion was detected</description> - </channel-type> - - <channel-type id="lastChangedAt" advanced="true"> - <item-type>DateTime</item-type> - <label>Last Activity (Date/Time)</label> - <description>Date/time when the state last changed</description> - </channel-type> - - <channel-type id="lastOnFor" advanced="true"> - <item-type>Number</item-type> - <label>Last Activity (s)</label> - <description>Duration the device has been switched on for</description> - <state pattern="%.1f s" /> - </channel-type> - - <channel-type id="onToday" advanced="true"> - <item-type>Number</item-type> - <label>Today's Activity (s)</label> - <description>How long has the device been switched on today</description> - <state pattern="%.1f s" /> - </channel-type> - - <channel-type id="onTotal" advanced="true"> - <item-type>Number</item-type> - <label>Total Activity (s)</label> - <description>How long has the device been switched on totally</description> - <state pattern="%.1f s" /> - </channel-type> - - <channel-type id="timespan" advanced="true"> - <item-type>Number</item-type> - <label>Usage timespan (s)</label> - <description>Time used to measure average usage</description> - <state pattern="%.1f s" /> - </channel-type> - - <channel-type id="averagePower" advanced="true"> - <item-type>Number</item-type> - <label>Average Power</label> - <description>The average power consumption</description> - <category>Energy</category> - <state pattern="%.1f W" /> - </channel-type> - - <channel-type id="currentPower"> - <item-type>Number</item-type> - <label>Power</label> - <description>The current power consumption</description> - <category>Energy</category> - <state pattern="%.1f W" /> - </channel-type> - - <channel-type id="energyToday" advanced="true"> - <item-type>Number</item-type> - <label>Energy Today</label> - <description>Todays power consumption</description> - <category>Energy</category> - <state pattern="%.1f Wh" /> - </channel-type> - - <channel-type id="energyTotal" advanced="true"> - <item-type>Number</item-type> - <label>Energy Total</label> - <description>Total power consumption</description> - <category>Energy</category> - <state pattern="%.1f Wh" /> - </channel-type> - - <channel-type id="standByLimit" advanced="true"> - <item-type>Number</item-type> - <label>StandBy Limit</label> - <description>Total power consumption</description> - <category>Energy</category> - <state pattern="%.1f W" /> - </channel-type> - - <channel-type id="onStandBy" advanced="true"> - <item-type>Switch</item-type> - <label>On Standby</label> - <description>Appliance on standby</description> - <category>Energy</category> - <state readOnly="true"/> - - </channel-type> - - <!-- Brightness Channel --> - <channel-type id="brightness"> - <item-type>Dimmer</item-type> - <label>Brightness</label> - <description>The brightness channel allows to control the brightness of a light. - It is also possible to switch the light on and off. - </description> - <category>DimmableLight</category> - </channel-type> - - <channel-type id="relay"> - <item-type>Switch</item-type> - <label>Relay</label> - <description>Switches the integrated relay contact close/open</description> - <category>Switch</category> - </channel-type> - - <channel-type id="sensor"> - <item-type>Switch</item-type> - <label>Sensor</label> - <description>Shows the state of the integrated sensor</description> - <category>Switch</category> - </channel-type> - - <channel-type id="coffeeMode"> - <item-type>String</item-type> - <label>Mode</label> - <description>Shows the operation mode of a WeMo Coffee Maker</description> - <state readOnly="true"> - <options> - <option value="Refill">Not Ready: Refill Water and Replace Carafe</option> - <option value="PlaceCarafe">Not Ready: Replace Carafe</option> - <option value="RefillWater">Not Ready: Refill Water</option> - <option value="Ready">Ready</option> - <option value="Brewing">Brewing</option> - <option value="Brewed">Brewing Finished</option> - <option value="CleaningBrewing">Cleaning Coffee Maker</option> - <option value="CleaningSoaking">Cleaning Filter</option> - <option value="BrewFailCarafeRemoved">Brewing Failed: Carafe Removed</option> - </options> - </state> - </channel-type> - - <channel-type id="modeTime"> - <item-type>Number</item-type> - <label>ModeTime</label> - <description>Shows the current amount of time, in minutes, that the Coffee Maker has been in the current mode</description> - </channel-type> - - <channel-type id="timeRemaining"> - <item-type>Number</item-type> - <label>TimeRemaining</label> - <description>Shows the remaining brewing time of a WeMo Coffee Maker</description> - </channel-type> - - <channel-type id="waterLevelReached" advanced="true"> - <item-type>Switch</item-type> - <label>WaterLevelReached</label> - <description>Indicates if the WeMo Coffee Maker needs to be refilled</description> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="cleanAdvise" advanced="true"> - <item-type>Switch</item-type> - <label>CleanAdvise</label> - <description>Indicates if a WeMo Coffee Maker needs to be cleaned</description> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="filterAdvise" advanced="true"> - <item-type>Switch</item-type> - <label>FilterAdvise</label> - <description>Indicates if a WeMo Coffee Maker needs to have the filter changed</description> - <state readOnly="true"></state> - </channel-type> - - <channel-type id="brewed" advanced="true"> - <item-type>DateTime</item-type> - <label>Brewed</label> - <description>Date/time the coffee maker last completed brewing coffee</description> - </channel-type> - - <channel-type id="lastCleaned" advanced="true"> - <item-type>DateTime</item-type> - <label>LastCleaned</label> - <description>Date/time the coffee maker last completed cleaning</description> - </channel-type> - -</thing:thing-descriptions> +<?xml version="1.0" encoding="UTF-8"?> +<thing:thing-descriptions bindingId="wemo" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> + + <thing-type id="socket"> + <label>WeMo Switch</label> + <description>This is a standard WeMo Switch</description> + + <channels> + <channel id="state" typeId="state" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + + </config-description> + </thing-type> + + <thing-type id="insight"> + <label>WeMo Insight Switch</label> + <description>This is a WeMo Insight Switch with energy measurement</description> + + <channels> + <channel id="state" typeId="state" /> + <channel id="lastChangedAt" typeId="lastChangedAt" /> + <channel id="lastOnFor" typeId="lastOnFor" /> + <channel id="onToday" typeId="onToday" /> + <channel id="onTotal" typeId="onTotal" /> + <channel id="timespan" typeId="timespan" /> + <channel id="averagePower" typeId="averagePower" /> + <channel id="currentPower" typeId="currentPower" /> + <channel id="energyToday" typeId="energyToday" /> + <channel id="energyTotal" typeId="energyTotal" /> + <channel id="standByLimit" typeId="standByLimit" /> + <channel id="onStandBy" typeId="onStandBy" /> + + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + </config-description> + </thing-type> + + <thing-type id="lightswitch"> + <label>WeMo Light Switch</label> + <description>This is a WeMo LightSwitch</description> + + <channels> + <channel id="state" typeId="state" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + </config-description> + </thing-type> + + <thing-type id="motion"> + <label>WeMo Motion</label> + <description>This is a WeMo MotionSensor</description> + + <channels> + <channel id="motionDetection" typeId="motionDetection" /> + <channel id="lastMotionDetected" typeId="lastMotionDetected" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + </config-description> + </thing-type> + + <!-- Standard WeMo Bulb with E27 socket --> + <thing-type id="MZ100"> + <supported-bridge-type-refs> + <bridge-type-ref id="bridge" /> + </supported-bridge-type-refs> + + <label>WeMo LED Light</label> + <description>This is a standard WeMo light bulb with E27 socket </description> + + <channels> + <channel id="state" typeId="state" /> + <channel id="brightness" typeId="brightness" /> + </channels> + + <properties> + <property name="vendor">MRVL</property> + <property name="modelId">MZ100</property> + </properties> + + <config-description> + <parameter name="deviceID" type="text"> + <label>Device ID</label> + <description>The device ID identifies one certain WeMo light.</description> + <required>true</required> + </parameter> + </config-description> + </thing-type> + + <thing-type id="Maker"> + <label>WeMo Maker</label> + <description>This is a WeMo Maker</description> + + <channels> + <channel id="relay" typeId="relay" /> + <channel id="sensor" typeId="sensor" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + </config-description> + </thing-type> + + <thing-type id="CoffeeMaker"> + <label>Mr. Coffee WeMo Enabled Coffeemaker</label> + <description>This is a WeMo enabled coffee maker</description> + + <channels> + <channel id="state" typeId="state" /> + <channel id="coffeeMode" typeId="coffeeMode" /> + <channel id="modeTime" typeId="modeTime" /> + <channel id="timeRemaining" typeId="timeRemaining" /> + <channel id="waterLevelReached" typeId="waterLevelReached" /> + <channel id="cleanAdvise" typeId="cleanAdvise" /> + <channel id="filterAdvise" typeId="filterAdvise" /> + <channel id="brewed" typeId="brewed" /> + <channel id="lastCleaned" typeId="lastCleaned" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + <parameter name="pollingInterval" type="integer" required="false" min="15" max="180"> + <label>Polling Interval</label> + <description>Interval polling the WeMo Coffee Maker. + </description> + <default>60</default> + </parameter> + </config-description> + </thing-type> + + <thing-type id="dimmer"> + <label>WeMo DimmerSwitch</label> + <description>This is a WeMo DimmerSwitch</description> + + <channels> + <channel id="brightness" typeId="brightness" /> + <channel id="faderCountDownTime" typeId="faderCountDownTime" /> + <channel id="faderEnabled" typeId="faderEnabled" /> + <channel id="timerStart" typeId="timerStart" /> + <channel id="nightMode" typeId="nightMode" /> + <channel id="startTime" typeId="startTime" /> + <channel id="endTime" typeId="endTime" /> + <channel id="nightModeBrightness" typeId="nightModeBrightness" /> + </channels> + + <config-description> + <parameter name="udn" type="text"> + <label>Unique Device Name</label> + <description>The UDN identifies the WeMo Device</description> + <required>true</required> + </parameter> + + </config-description> + </thing-type> + + <channel-type id="state"> + <item-type>Switch</item-type> + <label>Switch</label> + <description>Turns the power on or off</description> + <category>Switch</category> + </channel-type> + + <channel-type id="motionDetection"> + <item-type>Switch</item-type> + <label>Motion Status</label> + <description>Indicates whether motion is detected or not</description> + <category>Switch</category> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="lastMotionDetected" advanced="true"> + <item-type>DateTime</item-type> + <label>Last Activity (Date/Time)</label> + <description>Date/time when last motion was detected</description> + </channel-type> + + <channel-type id="lastChangedAt" advanced="true"> + <item-type>DateTime</item-type> + <label>Last Activity (Date/Time)</label> + <description>Date/time when the state last changed</description> + </channel-type> + + <channel-type id="lastOnFor" advanced="true"> + <item-type>Number</item-type> + <label>Last Activity (s)</label> + <description>Duration the device has been switched on for</description> + <state pattern="%.1f s" /> + </channel-type> + + <channel-type id="onToday" advanced="true"> + <item-type>Number</item-type> + <label>Today's Activity (s)</label> + <description>How long has the device been switched on today</description> + <state pattern="%.1f s" /> + </channel-type> + + <channel-type id="onTotal" advanced="true"> + <item-type>Number</item-type> + <label>Total Activity (s)</label> + <description>How long has the device been switched on totally</description> + <state pattern="%.1f s" /> + </channel-type> + + <channel-type id="timespan" advanced="true"> + <item-type>Number</item-type> + <label>Usage Timespan (s)</label> + <description>Time used to measure average usage</description> + <state pattern="%.1f s" /> + </channel-type> + + <channel-type id="averagePower" advanced="true"> + <item-type>Number</item-type> + <label>Average Power</label> + <description>The average power consumption</description> + <category>Energy</category> + <state pattern="%.1f W" /> + </channel-type> + + <channel-type id="currentPower"> + <item-type>Number</item-type> + <label>Power</label> + <description>The current power consumption</description> + <category>Energy</category> + <state pattern="%.1f W" /> + </channel-type> + + <channel-type id="energyToday" advanced="true"> + <item-type>Number</item-type> + <label>Energy Today</label> + <description>Todays power consumption</description> + <category>Energy</category> + <state pattern="%.1f Wh" /> + </channel-type> + + <channel-type id="energyTotal" advanced="true"> + <item-type>Number</item-type> + <label>Energy Total</label> + <description>Total power consumption</description> + <category>Energy</category> + <state pattern="%.1f Wh" /> + </channel-type> + + <channel-type id="standByLimit" advanced="true"> + <item-type>Number</item-type> + <label>StandBy Limit</label> + <description>Total power consumption</description> + <category>Energy</category> + <state pattern="%.1f W" /> + </channel-type> + + <channel-type id="onStandBy" advanced="true"> + <item-type>Switch</item-type> + <label>On Standby</label> + <description>Appliance on standby</description> + <category>Energy</category> + <state readOnly="true" /> + + </channel-type> + + <!-- Brightness Channel --> + <channel-type id="brightness"> + <item-type>Dimmer</item-type> + <label>Brightness</label> + <description>The brightness channel allows to control the brightness of a light. + It is also possible to switch the light on and off. + </description> + <category>DimmableLight</category> + </channel-type> + + <channel-type id="relay"> + <item-type>Switch</item-type> + <label>Relay</label> + <description>Switches the integrated relay contact close/open</description> + <category>Switch</category> + </channel-type> + + <channel-type id="sensor"> + <item-type>Switch</item-type> + <label>Sensor</label> + <description>Shows the state of the integrated sensor</description> + <category>Switch</category> + </channel-type> + + <channel-type id="coffeeMode"> + <item-type>String</item-type> + <label>Mode</label> + <description>Shows the operation mode of a WeMo Coffee Maker</description> + <state readOnly="true"> + <options> + <option value="Refill">Not Ready: Refill Water and Replace Carafe</option> + <option value="PlaceCarafe">Not Ready: Replace Carafe</option> + <option value="RefillWater">Not Ready: Refill Water</option> + <option value="Ready">Ready</option> + <option value="Brewing">Brewing</option> + <option value="Brewed">Brewing Finished</option> + <option value="CleaningBrewing">Cleaning Coffee Maker</option> + <option value="CleaningSoaking">Cleaning Filter</option> + <option value="BrewFailCarafeRemoved">Brewing Failed: Carafe Removed</option> + </options> + </state> + </channel-type> + + <channel-type id="modeTime"> + <item-type>Number</item-type> + <label>ModeTime</label> + <description>Shows the current amount of time, in minutes, that the Coffee Maker has been in the current mode</description> + </channel-type> + + <channel-type id="timeRemaining"> + <item-type>Number</item-type> + <label>TimeRemaining</label> + <description>Shows the remaining brewing time of a WeMo Coffee Maker</description> + </channel-type> + + <channel-type id="waterLevelReached" advanced="true"> + <item-type>Switch</item-type> + <label>WaterLevelReached</label> + <description>Indicates if the WeMo Coffee Maker needs to be refilled</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="cleanAdvise" advanced="true"> + <item-type>Switch</item-type> + <label>CleanAdvise</label> + <description>Indicates if a WeMo Coffee Maker needs to be cleaned</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="filterAdvise" advanced="true"> + <item-type>Switch</item-type> + <label>FilterAdvise</label> + <description>Indicates if a WeMo Coffee Maker needs to have the filter changed</description> + <state readOnly="true"></state> + </channel-type> + + <channel-type id="brewed" advanced="true"> + <item-type>DateTime</item-type> + <label>Brewed</label> + <description>Date/time the coffee maker last completed brewing coffee</description> + </channel-type> + + <channel-type id="lastCleaned" advanced="true"> + <item-type>DateTime</item-type> + <label>LastCleaned</label> + <description>Date/time the coffee maker last completed cleaning</description> + </channel-type> + + <channel-type id="faderCountDownTime" advanced="true"> + <item-type>Number</item-type> + <label>Fader CountDown Time</label> + <description>The fading duration time in minutes</description> + <state min="1" max="30" step="1.0" pattern="%d min" readOnly="false" /> + </channel-type> + + <channel-type id="faderEnabled" advanced="true"> + <item-type>Switch</item-type> + <label>Fader OFF/ON</label> + <description>Allows to switch the fader ON/OFF</description> + </channel-type> + + <channel-type id="timerStart" advanced="true"> + <item-type>Switch</item-type> + <label>Timer OFF/ON</label> + <description>Allows to switch the timer ON/OFF</description> + </channel-type> + + + <channel-type id="nightMode" advanced="true"> + <item-type>Switch</item-type> + <label>NightMode OFF/ON</label> + <description>Allows to switch the nightMode ON/OFF</description> + </channel-type> + + <channel-type id="startTime" advanced="true"> + <item-type>DateTime</item-type> + <label>NightMode Start Time</label> + <description>Time when the Night Mode starts</description> + <state pattern="%1$tR" readOnly="true" /> + </channel-type> + + <channel-type id="endTime" advanced="true"> + <item-type>DateTime</item-type> + <label>NightMode End Time</label> + <description>Time when the Night Mode ends</description> + <state pattern="%1$tR" readOnly="true" /> + </channel-type> + + <channel-type id="nightModeBrightness" advanced="true"> + <item-type>Dimmer</item-type> + <label>Night Mode Brightness</label> + <description>Allows setting the brightness of Night Mode</description> + </channel-type> + +</thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.wifiled/NOTICE b/bundles/org.openhab.binding.wifiled/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.wifiled/NOTICE +++ b/bundles/org.openhab.binding.wifiled/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.wifiled/pom.xml b/bundles/org.openhab.binding.wifiled/pom.xml index 145974dcfdf64..37295815ba257 100644 --- a/bundles/org.openhab.binding.wifiled/pom.xml +++ b/bundles/org.openhab.binding.wifiled/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.wifiled</artifactId> diff --git a/bundles/org.openhab.binding.wifiled/src/main/feature/feature.xml b/bundles/org.openhab.binding.wifiled/src/main/feature/feature.xml index 1094bb8bbd2e5..f2283dce9e2cb 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.wifiled/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.wifiled-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-wifiled" description="WiFi LED Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDBindingConstants.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDBindingConstants.java index 133b14dc547b9..83c3858b33a9f 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDBindingConstants.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDHandlerFactory.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDHandlerFactory.java index c6511a9dcd162..e52718197dde5 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDHandlerFactory.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/WiFiLEDHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/configuration/WiFiLEDConfig.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/configuration/WiFiLEDConfig.java index d725f11b52cda..195fe13387ff1 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/configuration/WiFiLEDConfig.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/configuration/WiFiLEDConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/discovery/WiFiLEDDiscoveryService.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/discovery/WiFiLEDDiscoveryService.java index f8d56f7a0c4b7..85ccc76ae10fc 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/discovery/WiFiLEDDiscoveryService.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/discovery/WiFiLEDDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -73,7 +73,7 @@ public void startScan() { private synchronized void discover() { logger.debug("Try to discover all WiFi LED devices"); - try (DatagramSocket socket = new DatagramSocket()) { + try (DatagramSocket socket = new DatagramSocket(DEFAULT_BROADCAST_PORT)) { socket.setBroadcast(true); socket.setSoTimeout(5000); diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java index 2064b1e014774..73022a6c228eb 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/AbstractWiFiLEDDriver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java index 5c79b11b2a0bb..17cd49b2ba8e6 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/ClassicWiFiLEDDriver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java index ef33078eb691a..4d3f8d4d6a725 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/FadingWiFiLEDDriver.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/InternalLedState.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/InternalLedState.java index d9898dc90e822..58c8810f8c911 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/InternalLedState.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/InternalLedState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDState.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDState.java index 01f1002166042..c4c87b07cf958 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDState.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTO.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTO.java index 0f0763eba4753..9c7707915bf6f 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTO.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTO.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java index ffe0e310ecb3c..d790538f684fc 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java +++ b/bundles/org.openhab.binding.wifiled/src/main/java/org/openhab/binding/wifiled/internal/handler/WiFiLEDHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/resources/ESH-INF/thing/wifiled.xml b/bundles/org.openhab.binding.wifiled/src/main/resources/ESH-INF/thing/wifiled.xml index 31ae03d8d6c53..0257fddc0de9e 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/resources/ESH-INF/thing/wifiled.xml +++ b/bundles/org.openhab.binding.wifiled/src/main/resources/ESH-INF/thing/wifiled.xml @@ -30,13 +30,13 @@ <advanced>true</advanced> </parameter> <parameter name="pollingPeriod" type="integer" required="false"> - <label>Polling period</label> + <label>Polling Period</label> <description>Polling period for refreshing the data in s</description> <default>30</default> <advanced>true</advanced> </parameter> <parameter name="protocol" type="text" required="false"> - <label>Device protocol</label> + <label>Device Protocol</label> <description>The protocol used for communication with the device</description> <default>LD382A</default> <options> @@ -47,7 +47,7 @@ <advanced>true</advanced> </parameter> <parameter name="driver" type="text" required="false"> - <label>Device driver</label> + <label>Device Driver</label> <description>The driver used to control the device</description> <default>CLASSIC</default> <options> @@ -57,13 +57,13 @@ <advanced>true</advanced> </parameter> <parameter name="fadeDurationInMs" type="integer" required="false" min="0" max="10000"> - <label>Fading duration</label> + <label>Fading Duration</label> <description>The duration for the color fading in milliseconds</description> <default>1000</default> <advanced>true</advanced> </parameter> <parameter name="fadeSteps" type="integer" required="false" min="1" max="256"> - <label>Fading steps</label> + <label>Fading Steps</label> <description>The number of steps used to fade over to the new color</description> <default>100</default> <advanced>true</advanced> @@ -120,7 +120,7 @@ </channel-type> <channel-type id="programSpeed" advanced="true"> <item-type>Dimmer</item-type> - <label>Program speed</label> + <label>Program Speed</label> </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/discovery/WiFiLEDDiscoveryServiceTestApp.java b/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/discovery/WiFiLEDDiscoveryServiceTestApp.java index fa63a2d04a61d..72506bf418d75 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/discovery/WiFiLEDDiscoveryServiceTestApp.java +++ b/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/discovery/WiFiLEDDiscoveryServiceTestApp.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/handler/WiFiLEDHandlerTestApp.java b/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/handler/WiFiLEDHandlerTestApp.java index 3abefd9282679..e4fa127c46914 100644 --- a/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/handler/WiFiLEDHandlerTestApp.java +++ b/bundles/org.openhab.binding.wifiled/src/main/test/java/org/openhab/binding/wifiled/handler/WiFiLEDHandlerTestApp.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java b/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java index cff057c8e161c..3fde8a1ee98ad 100644 --- a/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java +++ b/bundles/org.openhab.binding.wifiled/src/test/java/org/openhab/binding/wifiled/internal/handler/LEDStateDTOTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.windcentrale/NOTICE b/bundles/org.openhab.binding.windcentrale/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.windcentrale/NOTICE +++ b/bundles/org.openhab.binding.windcentrale/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.windcentrale/pom.xml b/bundles/org.openhab.binding.windcentrale/pom.xml index 857cbdf53693f..c5bc578161eaf 100644 --- a/bundles/org.openhab.binding.windcentrale/pom.xml +++ b/bundles/org.openhab.binding.windcentrale/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.windcentrale</artifactId> diff --git a/bundles/org.openhab.binding.windcentrale/src/main/feature/feature.xml b/bundles/org.openhab.binding.windcentrale/src/main/feature/feature.xml index 0fdc331519820..6c5ad248f539c 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.windcentrale/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.windcentrale-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-windcentrale" description="Windcentrale Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleBindingConstants.java b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleBindingConstants.java index 5a70001aa40a5..031b284eff30c 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleBindingConstants.java +++ b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleHandlerFactory.java b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleHandlerFactory.java index e959cfdd13332..a7c643c825793 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleHandlerFactory.java +++ b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/WindcentraleHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/config/MillConfig.java b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/config/MillConfig.java index e4e8246c7eda3..81338a8e33622 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/config/MillConfig.java +++ b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/config/MillConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/handler/WindcentraleHandler.java b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/handler/WindcentraleHandler.java index 30b6fedde0a22..7c548043ad1a0 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/handler/WindcentraleHandler.java +++ b/bundles/org.openhab.binding.windcentrale/src/main/java/org/openhab/binding/windcentrale/internal/handler/WindcentraleHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/binding/binding.xml index a04d0dac8fb84..41837cd55f749 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/binding/binding.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<binding:binding id="windcentrale" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" +<binding:binding id="windcentrale" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>Windcentrale Binding</name> diff --git a/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/thing/millThing.xml b/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/thing/millThing.xml index 1caaf50f67906..9ba4cce01dd26 100644 --- a/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/thing/millThing.xml +++ b/bundles/org.openhab.binding.windcentrale/src/main/resources/ESH-INF/thing/millThing.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<thing:thing-descriptions bindingId="windcentrale" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<thing:thing-descriptions bindingId="windcentrale" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <thing-type id="mill"> - <label>Windcentrale windmill</label> + <label>Windcentrale Windmill</label> <channels> <channel id="windSpeed" typeId="windSpeed" /> @@ -41,12 +42,12 @@ <default>131</default> </parameter> <parameter name="wd" type="integer" required="false"> - <label>Wind shares</label> + <label>Wind Shares</label> <description>Number of wind shares ("Winddelen")</description> <default>1</default> </parameter> <parameter name="refreshInterval" type="integer" min="1" max="9999" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval for refreshing the data in seconds</description> <default>30</default> <advanced>true</advanced> @@ -56,43 +57,43 @@ <channel-type id="windSpeed"> <item-type>Number</item-type> - <label>Wind speed</label> + <label>Wind Speed</label> <category>Wind</category> <state pattern="%d Bft" readOnly="true" /> </channel-type> <channel-type id="windDirection"> <item-type>String</item-type> - <label>Wind direction</label> + <label>Wind Direction</label> <state pattern="%s" readOnly="true" /> </channel-type> <channel-type id="powerRel"> <item-type>Number:Dimensionless</item-type> - <label>Relative power</label> + <label>Relative Power</label> <category>Energy</category> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> <channel-type id="runPercentage"> <item-type>Number:Dimensionless</item-type> - <label>Run percentage</label> + <label>Run Percentage</label> <description>Run percentage this year</description> <category>Energy</category> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> <channel-type id="runTime"> <item-type>Number:Time</item-type> - <label>Run time</label> + <label>Run Time</label> <description>Run time this year</description> <state pattern="%.0f %unit%" readOnly="true" /> </channel-type> <channel-type id="powerAbsWd"> <item-type>Number:Power</item-type> - <label>Wind shares power</label> + <label>Wind Shares Power</label> <category>Energy</category> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> <channel-type id="powerAbsTot"> <item-type>Number:Power</item-type> - <label>Total power</label> + <label>Total Power</label> <category>Energy</category> <state pattern="%.1f %unit%" readOnly="true" /> </channel-type> @@ -104,13 +105,13 @@ </channel-type> <channel-type id="kwhForecast"> <item-type>Number:Energy</item-type> - <label>Energy forecast</label> + <label>Energy Forecast</label> <category>Energy</category> <state pattern="%.0f %unit%" readOnly="true" /> </channel-type> <channel-type id="timestamp"> <item-type>DateTime</item-type> - <label>Last updated</label> + <label>Last Updated</label> <state readOnly="true" /> </channel-type> </thing:thing-descriptions> diff --git a/bundles/org.openhab.binding.xmltv/NOTICE b/bundles/org.openhab.binding.xmltv/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.xmltv/NOTICE +++ b/bundles/org.openhab.binding.xmltv/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.xmltv/README.md b/bundles/org.openhab.binding.xmltv/README.md index ddbfd8b5dc64d..eb6dce58b3f1e 100644 --- a/bundles/org.openhab.binding.xmltv/README.md +++ b/bundles/org.openhab.binding.xmltv/README.md @@ -11,9 +11,9 @@ Some websites provides updated XMLTV files than can be directly downloaded. Here is a sample for France : https://www.xmltv.fr/ This binding takes an XMLTV file as input and creates a thing for each channel contained in it. -XmlTV channels are called Media Channels in this binding in order to avoid messing with ESH Channels. +XmlTV channels are called Media Channels in this binding in order to avoid messing with openHAB Channels. -For each thing, you'll be able to get information regarding the current program and the next to come. +For each thing, you will be able to get information regarding the current program and the next to come. ## Supported Things diff --git a/bundles/org.openhab.binding.xmltv/pom.xml b/bundles/org.openhab.binding.xmltv/pom.xml index 1e6bc7aead721..5a78355617b70 100644 --- a/bundles/org.openhab.binding.xmltv/pom.xml +++ b/bundles/org.openhab.binding.xmltv/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.xmltv</artifactId> diff --git a/bundles/org.openhab.binding.xmltv/src/main/feature/feature.xml b/bundles/org.openhab.binding.xmltv/src/main/feature/feature.xml index a2fba0781aac9..85e2535ffbd87 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.xmltv/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.xmltv-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-xmltv" description="XMLTV Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVBindingConstants.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVBindingConstants.java index e080c0eef29eb..9251072e6be87 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVBindingConstants.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVHandlerFactory.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVHandlerFactory.java index 43b51d70655e7..011f6a3d846d3 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVHandlerFactory.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/XmlTVHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlChannelConfiguration.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlChannelConfiguration.java index 5b703eec565ee..b9fe33f0af006 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlChannelConfiguration.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlChannelConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlTVConfiguration.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlTVConfiguration.java index 84252c968b9d2..70fab93fa1e32 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlTVConfiguration.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/configuration/XmlTVConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/discovery/XmlTVDiscoveryService.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/discovery/XmlTVDiscoveryService.java index a156f036b8af5..2d4ec2669a092 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/discovery/XmlTVDiscoveryService.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/discovery/XmlTVDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/ChannelHandler.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/ChannelHandler.java index 18cc6a28def88..5dd0431b8f37c 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/ChannelHandler.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/ChannelHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/XmlTVHandler.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/XmlTVHandler.java index 6c9397e9814a2..cba68d89fe091 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/XmlTVHandler.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/handler/XmlTVHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Icon.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Icon.java index 2a0449abd92d7..8678352e56814 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Icon.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Icon.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/MediaChannel.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/MediaChannel.java index 9d4eb64bedfb8..701de668a9775 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/MediaChannel.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/MediaChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/ObjectFactory.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/ObjectFactory.java index 1b1bf7f317dab..cc086c1d93334 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/ObjectFactory.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/ObjectFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Programme.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Programme.java index b156ccd92fd92..d2b882358738a 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Programme.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Programme.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Tv.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Tv.java index b93e2c70d45f6..7b3c7deb9255d 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Tv.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/Tv.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/WithLangType.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/WithLangType.java index 6169683ee0a84..21f006da2bf21 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/WithLangType.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/WithLangType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/package-info.java b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/package-info.java index 4196cbe2595c4..655e601a14a83 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/package-info.java +++ b/bundles/org.openhab.binding.xmltv/src/main/java/org/openhab/binding/xmltv/internal/jaxb/package-info.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/binding/binding.xml b/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/binding/binding.xml index 0c40146ad7e8e..0d792d6b8a349 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/binding/binding.xml +++ b/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/binding/binding.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <binding:binding id="xmltv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd"> + xmlns:binding="https://openhab.org/schemas/binding/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/binding/v1.0.0 https://openhab.org/schemas/binding-1.0.0.xsd"> <name>XmlTV Binding</name> <description>This is the binding for reading and parsing XmlTV files</description> diff --git a/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/thing/thing-types.xml index 05671afd6953d..4df990990d269 100644 --- a/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.xmltv/src/main/resources/ESH-INF/thing/thing-types.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="xmltv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" - xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> + xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <bridge-type id="xmltvfile"> <label>XmlTVFile</label> @@ -10,11 +10,11 @@ <config-description> <parameter name="filePath" type="text" required="true"> - <label>XmlTV file path</label> + <label>XmlTV File Path</label> <description>Path to an XmlTV file.</description> </parameter> <parameter name="refresh" type="integer" unit="h"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the XMLTV file reload interval in hours</description> <default>24</default> </parameter> @@ -47,7 +47,7 @@ </parameter> <parameter name="refresh" type="integer" unit="s"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Specifies the refresh interval in seconds</description> <default>60</default> </parameter> @@ -57,7 +57,7 @@ </thing-type> <channel-group-type id="channelprops"> - <label>Channel properties</label> + <label>Channel Properties</label> <description>Properties of the current channel</description> <channels> <channel id="iconUrl" typeId="iconUrl" /> diff --git a/bundles/org.openhab.binding.xmppclient/NOTICE b/bundles/org.openhab.binding.xmppclient/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.xmppclient/NOTICE +++ b/bundles/org.openhab.binding.xmppclient/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.xmppclient/noEmbedDependencies.profile b/bundles/org.openhab.binding.xmppclient/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.binding.xmppclient/pom.xml b/bundles/org.openhab.binding.xmppclient/pom.xml index adc074b46a9ea..b393e34235fa1 100644 --- a/bundles/org.openhab.binding.xmppclient/pom.xml +++ b/bundles/org.openhab.binding.xmppclient/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.xmppclient</artifactId> @@ -22,31 +21,31 @@ <groupId>org.igniterealtime.smack</groupId> <artifactId>smack-java7</artifactId> <version>${smack.version}</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.igniterealtime.smack</groupId> <artifactId>smack-extensions</artifactId> <version>${smack.version}</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.igniterealtime.smack</groupId> <artifactId>smack-im</artifactId> <version>${smack.version}</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.igniterealtime.smack</groupId> <artifactId>smack-tcp</artifactId> <version>${smack.version}</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> <dependency> <groupId>org.minidns</groupId> <artifactId>minidns-core</artifactId> <version>0.3.3</version> - <scope>provided</scope> + <scope>compile</scope> </dependency> </dependencies> diff --git a/bundles/org.openhab.binding.xmppclient/src/main/feature/feature.xml b/bundles/org.openhab.binding.xmppclient/src/main/feature/feature.xml index d6fc0ab5158a7..efc53852539bc 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.xmppclient/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.xmppclient-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-xmppclient" description="XMPP Client Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/XMPPClientBindingConstants.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/XMPPClientBindingConstants.java index ad34f918ae9d0..9d394cea8ac91 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/XMPPClientBindingConstants.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/XMPPClientBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/action/XMPPActions.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/action/XMPPActions.java index 4a33a0de190b0..40c3979f30d5d 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/action/XMPPActions.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/action/XMPPActions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannel.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannel.java index 6ac547448ad55..3344f35f42f52 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannel.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannelConfig.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannelConfig.java index 7e17e541f7c84..b5c937a49e618 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannelConfig.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/PublishTriggerChannelConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientConfiguration.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientConfiguration.java index 643a55808ce07..5e99bef6ab704 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientConfiguration.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientHandler.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientHandler.java index f9ce3d6e34057..db04332938f0a 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientHandler.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientMessageSubscriber.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientMessageSubscriber.java index cc7b8bc8d4838..c55629058168b 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientMessageSubscriber.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/handler/XMPPClientMessageSubscriber.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClient.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClient.java index b2cd8ae3e2ef3..07553aba4c300 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClient.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClientHandlerFactory.java b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClientHandlerFactory.java index eef605958e798..e193f95e5cc06 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClientHandlerFactory.java +++ b/bundles/org.openhab.binding.xmppclient/src/main/java/org/openhab/binding/xmppclient/internal/XMPPClientHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.xmppclient/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.xmppclient/src/main/resources/ESH-INF/thing/thing-types.xml index f2fe001c79c11..84d9d7d0ee19f 100644 --- a/bundles/org.openhab.binding.xmppclient/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.xmppclient/src/main/resources/ESH-INF/thing/thing-types.xml @@ -28,7 +28,7 @@ <context>network-address</context> </parameter> <parameter name="port" type="integer"> - <label>XMPP server Port</label> + <label>XMPP Server Port</label> <description>The default port is 5222.</description> </parameter> </config-description> @@ -41,11 +41,11 @@ <event></event> <config-description> <parameter name="payload" type="text" required="false"> - <label>Payload condition</label> + <label>Payload Condition</label> <description>An optional condition on the value</description> </parameter> <parameter name="separator" type="text" required="false"> - <label>Separator character</label> + <label>Separator Character</label> <description>The trigger channel payload usually only contains the received text. If you define a separator character, for example '#', the sender UID and received text will be in the trigger channel payload. For example: pavel@example.com#My Message Text.</description> </parameter> </config-description> diff --git a/bundles/org.openhab.binding.yamahareceiver/NOTICE b/bundles/org.openhab.binding.yamahareceiver/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.yamahareceiver/NOTICE +++ b/bundles/org.openhab.binding.yamahareceiver/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.yamahareceiver/README.md b/bundles/org.openhab.binding.yamahareceiver/README.md index 7c5a28cdf86a4..891ee8397ad94 100644 --- a/bundles/org.openhab.binding.yamahareceiver/README.md +++ b/bundles/org.openhab.binding.yamahareceiver/README.md @@ -1,6 +1,6 @@ # Yamaha Receiver Binding -This binding connects openHAB with Yamaha Receivers of product line CX-A5000, RX-A30xx, RX-A20xx, RX-A10xx, RX-Vxxx, RX-Z7, DSP-Z7, RX-S600, RX-S601D, HTR-xxxx. +This binding connects openHAB with Yamaha Receivers of product line CX-A5000, RX-A860, RX-A30xx, RX-A20xx, RX-A10xx, RX-Vxxx, RX-Z7, DSP-Z7, RX-S600, RX-S601D, HTR-xxxx. If your hardware is on the list but still does not work, please fill a bug report! @@ -71,12 +71,12 @@ Zone control channels are: |-----------------------------------------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `zone_channels#power` | `Switch` | Switches the zone ON or OFF. Your receiver has to be in network standby for this to work. | | `zone_channels#mute` | `Switch` | Mute or Unmute the receiver. | -| `zone_channels#volume` | `Dimmer` | Set's the receivers volume as percentage. | -| `zone_channels#volumeDB` | `Number` | Set's the receivers volume in dB. | -| `zone_channels#input` | `String` | Set's the input selection, depends on your receiver's real inputs. Examples: HDMI1, HDMI2, AV4, TUNER, NET RADIO, etc. | -| `zone_channels#surroundProgram` | `String` | Set's the surround mode. Examples: `2ch Stereo`, `7ch Stereo`, `Hall in Munic`, `Straight`, `Surround Decoder`. | +| `zone_channels#volume` | `Dimmer` | Sets the receivers volume as percentage. | +| `zone_channels#volumeDB` | `Number` | Sets the receivers volume in dB. | +| `zone_channels#input` | `String` | Sets the input selection, depends on your receiver's real inputs. Examples: HDMI1, HDMI2, AV4, TUNER, NET RADIO, etc. | +| `zone_channels#surroundProgram` | `String` | Sets the surround mode. Examples: `2ch Stereo`, `7ch Stereo`, `Hall in Munic`, `Straight`, `Surround Decoder`. | | `zone_channels#scene` | `String` | Sets the scene. Examples: `Scene 1`, `Scene 2`, `Scene 3`, `Scene 4`. Write only (state updates are not available). May not be supported on all models (e.g. RX-V3900). | -| `zone_channels#dialogueLevel` | `Number` | Set's the receivers dialogue level. May not be supported on all models. | +| `zone_channels#dialogueLevel` | `Number` | Sets the receivers dialogue level. May not be supported on all models. | | `playback_channels#preset` | `Number` | Set a preset. Not supported by `Spotify` input. For `NET RADIO` input there is no way to get current preset (tested on RX-S601D, RX-V3900), so the preset is write only. For RX-V3900 the presets are alphanumeric `A1`,`A2`,`B1`,`B2` thus you need to use numbers grater than 100 that represent these presets as follows: 101, 102, 201, 202. | | `playback_channels#playback` | `String` | Set a play mode or get the current play mode. Values supported: `Previous`, `Play`, `Pause`, `Stop`, `Next`. Applies for inputs which support playback (`Spotify`, `SERVER`, `NET RADIO`, `Bluetooth`). Note that some values may not be supported on certain input type and AVR model combination. For `Spotify` and `Bluetooth` all values work, but for `NET RADIO` input only `Play` and `Stop` are supported (tested on RX-S601D). | | `playback_channels#playback_station` | `String` | Get the current played station (radio). Applies to `TUNER` and `NET RADIO` inputs only. | @@ -103,7 +103,7 @@ Navigation is not supported by Spotify input. ##### For auto linking with Paper UI -Link the items to the channels of your preferred zone (here `Main_Zone`) in PaperUI after you've saved your items file. +Link the items to the channels of your preferred zone (here `Main_Zone`) in Paper UI after you have saved your items file. Items: @@ -119,7 +119,7 @@ Number Yamaha_Dialogue_Level "Dialogue Level [%d]" <soundvolume> ##### For manually linking -Replace the UPNP UDN (here: `96a40ba9`) with the real UDN provided by your UPNP discovery. +Replace the UPnP UDN (here: `96a40ba9`) with the real UDN provided by your UPnP discovery. Also replace the zone name with your preferred zone (here `Main_Zone`). Items: @@ -256,7 +256,7 @@ On top of that some AVR models during status updates report different value than To account for all variations a Yamaha thing setting got introduced: `Input mapping`. This allows to map the input value reported by the AVR after status update to the desired canonical value. -Use the PaperUI to customize the setting for your particular AVR: `PaperUI > Configuration > Things > Edit > Yamaha Receiver XXX > Input mapping`. +Use the Paper UI to customize the setting for your particular AVR: `Paper UI > Configuration > Things > Edit > Yamaha Receiver XXX > Input mapping`. For example, if your AVR returns `HDMI_1` for command `HDMI1` you can create such mapping list: `HDMI_1=HDMI1,HDMI 1=HDMI1,HDMI_2=HDMI2,HDMI 2=HDMI2` @@ -293,7 +293,7 @@ If you unsure what mapping to apply, enable trace logging (see section earlier) ``` -Note: User defined mappings have as per user defined mapping and the rest comes is the existing addon mapping logic. +Note: User defined mappings have as per user defined mapping and the rest comes is the existing add-on mapping logic. After switching to `HDMI1` you should see this: diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/README.md b/bundles/org.openhab.binding.yamahareceiver/docs/README.md index 0384cebd1bd0c..0ba68b428ec5c 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/README.md +++ b/bundles/org.openhab.binding.yamahareceiver/docs/README.md @@ -162,7 +162,7 @@ http://<Your_Yamaha_ID>/YamahaRemoteControl/UnitDesc.xml ``` As Yamaha introduces new models there may be variations between XML structure. -In an attempt to improve the addon maintenance and troubleshooting selected model's `desc.xml`' has been collected from community users: +In an attempt to improve the add-on maintenance and troubleshooting selected model's `desc.xml`' has been collected from community users: * [HTR-4069](desc_HTR-4069.xml) * [RX-A2000](desc_RX-A2000.xml) @@ -180,4 +180,4 @@ In an attempt to improve the addon maintenance and troubleshooting selected mode | Volume | RX-V3900 | Volume command uses `Vol` element, while other models have `Volume`. There is no `Feature_Existence` element on system status. | | Zone B | HTR-4069 | `Zone_2` feature does not exist, but instead there is `Zone_B` commands under `Main_Zone` with only power, mute and volume control. | | Preset | RX-V3900 | The preset values on this model are strings `A1`, `A2`, `B1`, `B2` instead of numbers. | -| Party Mode | RX-A2000 | Has party mode support, although its XML descriptor does not mention it. | \ No newline at end of file +| Party Mode | RX-A2000 | Has party mode support, although its XML descriptor does not mention it. | diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_HTR-4069.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_HTR-4069.xml index 53cd5731fc772..9db45bae3751b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_HTR-4069.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_HTR-4069.xml @@ -3256,4 +3256,4 @@ <Define ID="G4">JUKE,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A2000.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A2000.xml index b5ddcd5e86cca..c009210dec05a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A2000.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A2000.xml @@ -3522,4 +3522,4 @@ <Define ID="G4">Pandora,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A3070.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A3070.xml index 4d140d82cda5b..71c36d3ce06f8 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A3070.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-A3070.xml @@ -4478,4 +4478,4 @@ <Define ID="G3">Deezer,Config</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-S601D.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-S601D.xml index be3fb1b80b71a..cad1204575403 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-S601D.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-S601D.xml @@ -3270,4 +3270,4 @@ <Define ID="G4">JUKE,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V3900.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V3900.xml index 8539156a92db7..5da41e9ff2338 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V3900.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V3900.xml @@ -1456,4 +1456,4 @@ <Define ID="G4">NET_USB,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V479.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V479.xml index 59ca4ba0aef59..0ac541bbcecc6 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V479.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V479.xml @@ -2961,4 +2961,4 @@ <Define ID="G4">JUKE,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V583.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V583.xml index 93ed3e6236394..231a359a7d70f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V583.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V583.xml @@ -3334,4 +3334,4 @@ <Define ID="G3">Deezer,Config</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V675.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V675.xml index 7a6097603a5c5..5a68ed6487015 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V675.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V675.xml @@ -3438,4 +3438,4 @@ <Define ID="G4">Pandora,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V775.xml b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V775.xml index 248d4d53ebde8..74d3e9ac7ab03 100644 --- a/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V775.xml +++ b/bundles/org.openhab.binding.yamahareceiver/docs/desc_RX-V775.xml @@ -2947,4 +2947,4 @@ <Define ID="G4">Napster,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/pom.xml b/bundles/org.openhab.binding.yamahareceiver/pom.xml index 41b879a5a39c6..7922514529fe5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/pom.xml +++ b/bundles/org.openhab.binding.yamahareceiver/pom.xml @@ -1,12 +1,11 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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/maven-v4_0_0.xsd"> +<?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.0-SNAPSHOT</version> + <version>2.5.2-SNAPSHOT</version> </parent> <artifactId>org.openhab.binding.yamahareceiver</artifactId> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/feature/feature.xml b/bundles/org.openhab.binding.yamahareceiver/src/main/feature/feature.xml index 25a7bdeb67568..86572608dbfb3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/feature/feature.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <features name="org.openhab.binding.yamahareceiver-${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/${project.version}/xml/features</repository> + <repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository> <feature name="openhab-binding-yamahareceiver" description="Yamaha Receiver Binding" version="${project.version}"> <feature>openhab-runtime-base</feature> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java index 01221558f0e43..8b4184c5d8ac2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderAvailableInputs.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -26,8 +26,6 @@ import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; -import org.eclipse.smarthome.core.thing.type.ChannelGroupType; -import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; @@ -49,7 +47,7 @@ public class ChannelsTypeProviderAvailableInputs implements ChannelTypeProvider, private @NonNullByDefault({}) YamahaZoneThingHandler handler; @Override - public @Nullable Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { + public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { return Collections.singleton(channelType); } @@ -62,17 +60,6 @@ public class ChannelsTypeProviderAvailableInputs implements ChannelTypeProvider, } } - @Override - public @Nullable ChannelGroupType getChannelGroupType(ChannelGroupTypeUID channelGroupTypeUID, - @Nullable Locale locale) { - return null; - } - - @Override - public @Nullable Collection<ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { - return null; - } - public ChannelTypeUID getChannelTypeUID() { return channelTypeUID; } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java index a190f828eb88b..bc987d4f7868b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/ChannelsTypeProviderPreset.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -25,8 +25,6 @@ import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; -import org.eclipse.smarthome.core.thing.type.ChannelGroupType; -import org.eclipse.smarthome.core.thing.type.ChannelGroupTypeUID; import org.eclipse.smarthome.core.thing.type.ChannelType; import org.eclipse.smarthome.core.thing.type.ChannelTypeBuilder; import org.eclipse.smarthome.core.thing.type.ChannelTypeProvider; @@ -49,7 +47,7 @@ public class ChannelsTypeProviderPreset implements ChannelTypeProvider, ThingHan private @NonNullByDefault({}) YamahaZoneThingHandler handler; @Override - public @Nullable Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { + public Collection<ChannelType> getChannelTypes(@Nullable Locale locale) { return Collections.singleton(channelType); } @@ -62,17 +60,6 @@ public class ChannelsTypeProviderPreset implements ChannelTypeProvider, ThingHan } } - @Override - public @Nullable ChannelGroupType getChannelGroupType(ChannelGroupTypeUID channelGroupTypeUID, - @Nullable Locale locale) { - return null; - } - - @Override - public @Nullable Collection<ChannelGroupType> getChannelGroupTypes(@Nullable Locale locale) { - return null; - } - public ChannelTypeUID getChannelTypeUID() { return channelTypeUID; } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverBindingConstants.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverBindingConstants.java index fc8238b29b418..b73a087a724e4 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverBindingConstants.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerFactory.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerFactory.java index bfa89a851dad4..0783a806db905 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerFactory.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaBridgeConfig.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaBridgeConfig.java index bb2e8d14b240f..5fe6d53afda8e 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaBridgeConfig.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaBridgeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaUtils.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaUtils.java index 1e870a758ccc6..d00e7cc14463f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaUtils.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaZoneConfig.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaZoneConfig.java index 57bfc628b9f77..69cdf3620d337 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaZoneConfig.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/config/YamahaZoneConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/YamahaDiscoveryParticipant.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/YamahaDiscoveryParticipant.java index e92697630b0f9..0e7075f363744 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/YamahaDiscoveryParticipant.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/YamahaDiscoveryParticipant.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/ZoneDiscoveryService.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/ZoneDiscoveryService.java index 0dcc8fb341337..6393fdf2120f2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/ZoneDiscoveryService.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/discovery/ZoneDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaBridgeHandler.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaBridgeHandler.java index 55412329630c7..7156d6d8c7be4 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaBridgeHandler.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -236,6 +236,11 @@ void updateAllZoneInformation() { return; } + if (!ensureConnectionInitialized()) { + // The initialization did not yet happen and the device is still offline (or not reachable) + return; + } + logger.trace("updateAllZoneInformation"); try { // Set power = true before calling systemControl.update(), @@ -260,8 +265,8 @@ void updateAllZoneInformation() { } } } catch (IOException e) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); systemControlState.invalidate(); + onConnectivityError(e); return; } catch (ReceivedMessageParseException e) { updateProperty(PROPERTY_MENU_ERROR, e.getMessage()); @@ -272,20 +277,8 @@ void updateAllZoneInformation() { } } - private void updateDeviceInformation() throws IOException, ReceivedMessageParseException { - logger.trace("updateDeviceInformation"); - - DeviceInformation deviceInformation = protocolFactory.DeviceInformation(connection, deviceInformationState); - deviceInformation.update(); - - updateProperty(PROPERTY_VERSION, deviceInformationState.version); - updateProperty(PROPERTY_ASSIGNED_NAME, deviceInformationState.name); - - zoneDiscoveryService.publishZones(deviceInformationState, thing.getUID()); - } - /** - * We handle the update ourself to avoid a costly dispose/initialize + * We handle the update ourselves to avoid a costly dispose/initialize */ @Override public void handleConfigurationUpdate(Map<String, Object> configurationParameters) { @@ -311,7 +304,7 @@ public void handleConfigurationUpdate(Map<String, Object> configurationParameter Optional<String> host = bridgeConfig.getHostWithPort(); if (host.isPresent()) { connection.setHost(host.get()); - connectionEstablished(connection); + onConnectionCreated(connection); } inputConverter = protocolFactory.InputConverter(connection, bridgeConfig.getInputMapping()); @@ -355,40 +348,62 @@ public void initialize() { return; } - if (this.zoneDiscoveryService == null) { + if (zoneDiscoveryService == null) { logger.warn("Zone discovery service not ready!"); return; } protocolFactory.createConnection(host.get(), this); - inputConverter = protocolFactory.InputConverter(connection, bridgeConfig.getInputMapping()); } @Override - public void connectionFailed(String host, Throwable throwable) { - if (throwable != null) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, throwable.getMessage()); - } else { - updateStatus(ThingStatus.OFFLINE); + public void onConnectionCreated(AbstractConnection connection) { + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_PENDING, "Waiting for connection with Yamaha device"); + + this.connection = connection; + this.systemControl = null; + + if (!ensureConnectionInitialized()) { + logger.warn("Communication error. Please review your Yamaha thing configuration."); } - this.connection = null; + + setupRefreshTimer(0); } - @Override - public void connectionEstablished(AbstractConnection connection) { - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_PENDING, "Waiting for data"); + /** + * Attempts to perform a one-time initialization after a connection is created. + * @return true if initialization was successful + */ + private boolean ensureConnectionInitialized() { + if (systemControl != null) { + return true; + } + + logger.trace("Initializing connection"); - this.connection = connection; try { - updateDeviceInformation(); + DeviceInformation deviceInformation = protocolFactory.DeviceInformation(connection, deviceInformationState); + deviceInformation.update(); + + updateProperty(PROPERTY_VERSION, deviceInformationState.version); + updateProperty(PROPERTY_ASSIGNED_NAME, deviceInformationState.name); + + zoneDiscoveryService.publishZones(deviceInformationState, thing.getUID()); + systemControl = protocolFactory.SystemControl(connection, this, deviceInformationState); + inputConverter = protocolFactory.InputConverter(connection, bridgeConfig.getInputMapping()); } catch (IOException | ReceivedMessageParseException e) { - logger.warn("Communication error. Please review your Yamaha thing configuration.", e); deviceInformationState.invalidate(); - updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getMessage()); - return; + onConnectivityError(e); + return false; } - setupRefreshTimer(0); + return true; + } + + private void onConnectivityError(Exception e) { + String description = e.getMessage(); + logger.debug("Communication error. Either the Yamaha thing configuration is invalid or the device is offline. Details: {}", description); + updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, description); } @Override diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaZoneThingHandler.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaZoneThingHandler.java index 9c182bf499b49..01c207503d8d9 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaZoneThingHandler.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/handler/YamahaZoneThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/AbstractConnection.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/AbstractConnection.java index ad6825d721e2e..37728d62a33b0 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/AbstractConnection.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/AbstractConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ConnectionStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ConnectionStateListener.java index b8a08bee6f2cc..e59e612bc879a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ConnectionStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ConnectionStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,5 @@ * @author David Graeff - Initial contribution */ public interface ConnectionStateListener { - void connectionFailed(String host, Throwable throwable); - - void connectionEstablished(AbstractConnection connection); + void onConnectionCreated(AbstractConnection connection); } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/DeviceInformation.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/DeviceInformation.java index 8c473fc2d6f62..544bbf23c1b8a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/DeviceInformation.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/DeviceInformation.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/IStateUpdatable.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/IStateUpdatable.java index 88abf5c5a6d8d..0cf072f5ceb6f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/IStateUpdatable.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/IStateUpdatable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputConverter.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputConverter.java index 1c96dd60bf7b1..15e89c1040a3a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputConverter.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithNavigationControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithNavigationControl.java index 23500b29c4f05..f8e3a96067ef2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithNavigationControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithNavigationControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPlayControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPlayControl.java index b51939462ae86..e1dbe861ddd48 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPlayControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPlayControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPresetControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPresetControl.java index 17d5d4615c95c..8e527d308462b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPresetControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithPresetControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithTunerBandControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithTunerBandControl.java index 17959db54882a..745dcffd2b60e 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithTunerBandControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/InputWithTunerBandControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ProtocolFactory.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ProtocolFactory.java index 2715a3b7b1e2d..a5f53887e1f09 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ProtocolFactory.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ProtocolFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ReceivedMessageParseException.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ReceivedMessageParseException.java index 6e0b47313ff58..44af05b04f00a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ReceivedMessageParseException.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ReceivedMessageParseException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/SystemControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/SystemControl.java index c629308fd501c..1e66027a57ac6 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/SystemControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/SystemControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneAvailableInputs.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneAvailableInputs.java index f0ef97ad627be..0f3f7e5c250c5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneAvailableInputs.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneAvailableInputs.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneControl.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneControl.java index 974969dd225c5..8c0c9102682ac 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneControl.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/ZoneControl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractInputControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractInputControlXML.java index f048552514e7b..8d0344f952fe6 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractInputControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractInputControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/CommandTemplate.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/CommandTemplate.java index fc92ff8b29190..edd10d8013348 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/CommandTemplate.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/CommandTemplate.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXML.java index 981a3a949fe7d..f1b4684b34915 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java index b28fd803e3972..06b9c2e18862b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXML.java index be9bc8abee0b9..c19237f11049d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithNavigationControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithNavigationControlXML.java index fa47cf72e96a9..7c0765f3c9532 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithNavigationControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithNavigationControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXML.java index 83c89877fc01d..01b376283460b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java index 90afaba8cb242..189bf97ab05ac 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java index 7c2b6501ac48f..c89008468ff70 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithTunerDABControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXML.java index 9e9a4d5662c87..52716c523091f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java index 2d56413c8bb41..bfb494b1e02b1 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -59,7 +59,7 @@ public interface CheckedConsumer<T, R> { private <T> T postMessage(String prefix, String message, String suffix, CheckedConsumer<HttpURLConnection, T> responseConsumer) throws IOException { if (message.startsWith("<?xml")) { - throw new IOException("No preformatted xml allowed!"); + throw new IOException("No pre-formatted xml allowed!"); } message = prefix + message + suffix; @@ -74,6 +74,7 @@ private <T> T postMessage(String prefix, String message, String suffix, connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Length", Integer.toString(message.length())); + connection.setConnectTimeout(5); // set a timeout in case the device is not reachable (went offline) connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConstants.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConstants.java index 449b6d1206f2b..da69508d767b5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConstants.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolFactory.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolFactory.java index 5886236464326..1c0bc12757c48 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolFactory.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -47,7 +47,7 @@ public class XMLProtocolFactory implements ProtocolFactory { @Override public void createConnection(String host, ConnectionStateListener connectionStateListener) { - connectionStateListener.connectionEstablished(new XMLConnection(host)); + connectionStateListener.onConnectionCreated(new XMLConnection(host)); } @Override @@ -132,8 +132,6 @@ public DeviceInformation DeviceInformation(AbstractConnection connection, Device @Override public InputConverter InputConverter(AbstractConnection connection, String setting) { - return new InputConverterXML(connection, setting); } - } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolService.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolService.java index 837b76dad6c3c..79123aec62b1c 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolService.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLProtocolService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLUtils.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLUtils.java index 6412164373cbe..d8278971e07f2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLUtils.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/XMLUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneAvailableInputsXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneAvailableInputsXML.java index 9f1622ec13193..f26c5d183d85a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneAvailableInputsXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneAvailableInputsXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBAvailableInputsXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBAvailableInputsXML.java index 72db85cf8bd62..080107a559cf5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBAvailableInputsXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBAvailableInputsXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXML.java index bd96b0d581c7c..5d052de352dcf 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java index 628cf460aa810..aeae3b3e2d4f3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXML.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputState.java index 601e09e7bfd74..74784c3330dc3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputStateListener.java index 958e4ef6460de..df77354c06f69 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/AvailableInputStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java index 5e59a873d3c68..3667fc53486e3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java index b56d68559058d..bcc1776c2c0e2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DabBandStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DeviceInformationState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DeviceInformationState.java index 0c62fbcd45c44..13bfc7e2426d9 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DeviceInformationState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/DeviceInformationState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java index 0a0eb60ee6799..067164d0980c3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/Invalidateable.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlState.java index 94e2832640a60..1af25b09438ef 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlStateListener.java index e994d53daddbc..ea55c2970cf56 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/NavigationControlStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoState.java index 9c7b722f3d251..26b6e8a70ceeb 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoStateListener.java index 6fe3010a0eda0..158a8295549b0 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PlayInfoStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoState.java index ee39ca5037899..f085863761a8c 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoStateListener.java index 6aea8a64744d0..69e8dd56ebb78 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/PresetInfoStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlState.java index e642a78070729..b164c0fcdc949 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlStateListener.java index 1f384faef7d66..7603381b9885f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/SystemControlStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlState.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlState.java index 7470c6fc3bb69..2ef0fd4bec83c 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlState.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlStateListener.java b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlStateListener.java index d790e7a50102a..70f232199abfd 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlStateListener.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/java/org/openhab/binding/yamahareceiver/internal/state/ZoneControlStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/main/resources/ESH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.yamahareceiver/src/main/resources/ESH-INF/thing/thing-types.xml index 76d2607be0baa..1473b13479651 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/main/resources/ESH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/main/resources/ESH-INF/thing/thing-types.xml @@ -37,7 +37,7 @@ <advanced>true</advanced> </parameter> <parameter name="refreshInterval" type="integer" required="false"> - <label>Refresh interval</label> + <label>Refresh Interval</label> <description>Refresh interval in seconds.</description> <default>60</default> <advanced>true</advanced> @@ -54,7 +54,7 @@ <advanced>true</advanced> </parameter> <parameter name="inputMapping" type="text" required="false"> - <label>Input mapping</label> + <label>Input Mapping</label> <description> Some Yamaha models return different input values on status update than required in the change input commands. For example: HDMI1 command may be reported as HDMI_1 after status update. @@ -91,29 +91,31 @@ <description>The zone can be Main_Zone, ZONE_2, ZONE_3, ZONE_4 depending on your device.</description> </parameter> <parameter name="volumeRelativeChangeFactor" type="decimal" required="false"> - <label>Relative volume change</label> + <label>Relative Volume Change</label> <description>Relative volume change in percent.</description> <default>2.0</default> <advanced>true</advanced> </parameter> <parameter name="volumeDbMin" type="decimal" required="false"> - <label>Minimum volume in dB</label> + <label>Minimum Volume</label> <description>Lowest volume in dB.</description> <default>-80</default> <advanced>true</advanced> + <unitLabel>dB</unitLabel> </parameter> <parameter name="volumeDbMax" type="decimal" required="false"> - <label>Maximum volume in dB</label> + <label>Maximum Volume</label> <description>Highest volume in dB.</description> <default>12</default> <advanced>true</advanced> + <unitLabel>dB</unitLabel> </parameter> </config-description> </thing-type> <channel-group-type id="zone_channels"> - <label>Zone control</label> + <label>Zone Control</label> <description>Control the zone</description> <channels> <channel id="power" typeId="power" /> @@ -139,28 +141,28 @@ <channel-type id="party_mode"> <item-type>Switch</item-type> - <label>Party mode</label> + <label>Party Mode</label> <description>Party mode ON/OFF</description> <category>switch</category> </channel-type> <channel-type id="party_mode_volume"> <item-type>Dimmer</item-type> - <label>Party mode volume Up/Down</label> + <label>Party Mode Volume Up/Down</label> <description>Increase or decrease of party mode volume</description> <category>SoundVolume</category> </channel-type> <channel-type id="party_mode_mute"> <item-type>Switch</item-type> - <label>Party mode mute</label> + <label>Party Mode Mute</label> <description>Mute when party mode</description> <category>SoundVolume</category> </channel-type> <channel-type id="surroundProgram"> <item-type>String</item-type> - <label>Surround program</label> + <label>Surround Program</label> <description>Select the surround program of the AVR</description> <state pattern="%s"> <options> @@ -220,7 +222,7 @@ <channel-type id="dialogueLevel"> <item-type>Number</item-type> - <label>Dialogue level</label> + <label>Dialogue Level</label> <description>Set the dialogue level</description> <category>SoundVolume</category> <state min="0" max="2" step="1" pattern="%d" /> @@ -242,7 +244,7 @@ </channel-type> <channel-group-type id="playback_channels"> - <label>Playback control</label> + <label>Playback Control</label> <description>Control the playback for the current zone and allow to select preset channels</description> <channels> <channel id="preset" typeId="defaultpreset" /> @@ -286,7 +288,7 @@ <channel-type id="playback_song_image_url"> <item-type>String</item-type> - <label>Track picture URL</label> + <label>Track Picture URL</label> <description>Track picture URL</description> <state readOnly="true" /> </channel-type> @@ -356,7 +358,7 @@ <channel-type id="playback"> <item-type>String</item-type> - <label>Playback control</label> + <label>Playback Control</label> <description>Control the playback of the current input. Can also be used as Play/Pause and Next/Previous Type </description> <state pattern="%s"> @@ -373,7 +375,7 @@ </channel-type> <channel-group-type id="navigation_channels"> - <label>Navigation control</label> + <label>Navigation Control</label> <description>Allow to navigate for inputs like USB, iPOD, NET_RADIO</description> <channels> <channel id="navigation_menu" typeId="navigation_menu" /> @@ -417,7 +419,7 @@ <channel-type id="navigation_level"> <item-type>Number</item-type> - <label>Menu depth</label> + <label>Menu Depth</label> <description>Hierarchical level</description> <category>Navigation</category> <state readOnly="true" /> @@ -453,7 +455,7 @@ <channel-type id="navigation_backtoroot"> <kind>trigger</kind> - <label>Back to root</label> + <label>Back to Root</label> <description>Go back to the root menu</description> <category>Navigation</category> </channel-type> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/ResponseLoader.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/ResponseLoader.java index 61a0f188f8f53..12b8caf726f64 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/ResponseLoader.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/ResponseLoader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/TestModels.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/TestModels.java index ff0ddce548309..b1ee87475994a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/TestModels.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/TestModels.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerTest.java index 145db9eb15baf..2e579e33a42a6 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/YamahaReceiverHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -95,7 +95,7 @@ protected void onSetUp() throws Exception { subject.setCallback(callback); doAnswer(a -> { - ((ConnectionStateListener) a.getArgument(1)).connectionEstablished(ctx.getConnection()); + ((ConnectionStateListener) a.getArgument(1)).onConnectionCreated(ctx.getConnection()); return null; }).when(protocolFactory).createConnection(anyString(), same(subject)); } diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/XMLProtocolFactoryTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/XMLProtocolFactoryTest.java index 3c0edcfe96ccc..acac46021c299 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/XMLProtocolFactoryTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/XMLProtocolFactoryTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractXMLProtocolTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractXMLProtocolTest.java index b34b53940f61b..e1b87a33071ba 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractXMLProtocolTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractXMLProtocolTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractZoneControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractZoneControlXMLTest.java index 16615abf335b0..04df9b52eca37 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractZoneControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/AbstractZoneControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXMLTest.java index 4139871914748..da2d5fa4b07d3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceDescriptorXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXMLTest.java index be25825aec92c..d5791f920793f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/DeviceInformationXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXMLTest.java index 4a863cfebca0e..fbf91ca471f1a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputConverterXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXMLTest.java index 0cbf63509d2cf..39871eb5335b0 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPlayControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXMLTest.java index 74caf9efc3a14..8514cb29d943e 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/InputWithPresetControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ModelContext.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ModelContext.java index 08ae3d94f4b29..41831b558adf8 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ModelContext.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ModelContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXMLTest.java index 729331196e459..07b982ab67778 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/SystemControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXMLTest.java index c890c19f12bf5..c1ca5e491ff82 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneBControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXMLTest.java b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXMLTest.java index f873d083571f4..25a329ea1afb7 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXMLTest.java +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/java/org/openhab/binding/yamahareceiver/internal/protocol/xml/ZoneControlXMLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Basic_Status.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Basic_Status.xml index aae147e3b40ae..0494ae10fb809 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Basic_Status.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Basic_Status.xml @@ -91,4 +91,4 @@ </Speaker_Preout> </Basic_Status> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Input_Input_Sel_Item.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Input_Input_Sel_Item.xml index a4510a60fb8f9..41772954aa8d9 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Input_Input_Sel_Item.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/Main_Zone_Input_Input_Sel_Item.xml @@ -237,4 +237,4 @@ </Input_Sel_Item> </Input> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/System_Config.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/System_Config.xml index d2553fd07a991..1d59627ed1b33 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/System_Config.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/System_Config.xml @@ -49,4 +49,4 @@ </Name> </Config> </System> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/desc_HTR-4069.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/desc_HTR-4069.xml index 53cd5731fc772..9db45bae3751b 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/desc_HTR-4069.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/HTR-4069/desc_HTR-4069.xml @@ -3256,4 +3256,4 @@ <Define ID="G4">JUKE,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Bluetooth_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Bluetooth_Play_Info.xml index 1632a3dd25522..8d8f3c1933b5f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Bluetooth_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Bluetooth_Play_Info.xml @@ -17,4 +17,4 @@ </Input_Logo> </Play_Info> </Bluetooth> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Basic_Status.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Basic_Status.xml index 4b021e46fa8ee..58f7d8640c556 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Basic_Status.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Basic_Status.xml @@ -72,4 +72,4 @@ </Sound_Video> </Basic_Status> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Input_Input_Sel.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Input_Input_Sel.xml index 5f5c42eb24add..2a5cbf14826c5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Input_Input_Sel.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Main_Zone_Input_Input_Sel.xml @@ -258,4 +258,4 @@ </Input_Sel_Item> </Input> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel.xml index 2a52fae56d207..5a6891c80390f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel.xml @@ -1 +1 @@ -This will cause parse error. \ No newline at end of file +This will cause parse error. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel_Item.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel_Item.xml index 11b42d26c1001..dc1e2e3117c9e 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel_Item.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Control_Preset_Preset_Sel_Item.xml @@ -17,4 +17,4 @@ </Preset> </Play_Control> </NET_RADIO> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Info.xml index f1c5212c907fe..4504d834ef41d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/NET_RADIO_Play_Info.xml @@ -18,4 +18,4 @@ </Album_ART> </Play_Info> </NET_RADIO> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Spotify_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Spotify_Play_Info.xml index 3e67eec7d1b19..81580885aebe3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Spotify_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/Spotify_Play_Info.xml @@ -20,4 +20,4 @@ </Input_Logo> </Play_Info> </Spotify> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Config.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Config.xml index a7a5f32d19880..c751d4b0f4594 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Config.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Config.xml @@ -48,4 +48,4 @@ </Name> </Config> </System> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Party_Mode_Mode.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Party_Mode_Mode.xml index 129e44b3efa1a..493214a08f3a8 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Party_Mode_Mode.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Party_Mode_Mode.xml @@ -5,4 +5,4 @@ <Mode>On</Mode> </Party_Mode> </System> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Power_Control_Power.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Power_Control_Power.xml index 38a27ea4eb870..7c3ef459346bf 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Power_Control_Power.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/System_Power_Control_Power.xml @@ -5,4 +5,4 @@ <Power>On</Power> </Power_Control> </System> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/desc_RX-S601D.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/desc_RX-S601D.xml index 347a6737b4606..33855e2ac76d2 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/desc_RX-S601D.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-S601D/desc_RX-S601D.xml @@ -3270,4 +3270,4 @@ <Define ID="G4">JUKE,Play_Control,Preset,Preset_Sel_Item</Define> </Cmd_List> </Menu> -</Unit_Description> \ No newline at end of file +</Unit_Description> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Bluetooth_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Bluetooth_Play_Info.xml index c87d249fdae7a..7304c7251a048 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Bluetooth_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Bluetooth_Play_Info.xml @@ -4,4 +4,4 @@ <Status>Not Connected</Status> </Play_Info> </Bluetooth> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Basic_Status.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Basic_Status.xml index 1f8af4dc33c0d..89a9b64212d2d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Basic_Status.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Basic_Status.xml @@ -26,4 +26,4 @@ </Surr> </Basic_Status> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Input_Input_Sel_Item.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Input_Input_Sel_Item.xml index b79ae01c69912..335d9f132e723 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Input_Input_Sel_Item.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Main_Zone_Input_Input_Sel_Item.xml @@ -203,4 +203,4 @@ </Input_Sel_Item> </Input> </Main_Zone> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel.xml index 2a52fae56d207..5a6891c80390f 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel.xml @@ -1 +1 @@ -This will cause parse error. \ No newline at end of file +This will cause parse error. diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel_Item.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel_Item.xml index 133ea2971738e..176bdbc3ba3b3 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel_Item.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Control_Preset_Preset_Sel_Item.xml @@ -37,4 +37,4 @@ </Preset> </Play_Control> </NET_USB> -</YAMAHA_AV> \ No newline at end of file +</YAMAHA_AV> diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Info.xml index 9c41999445f9f..6a4ff8f383d27 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/NET_USB_Play_Info.xml @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Config.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Config.xml index ab84b41a74e62..57c982745354d 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Config.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Config.xml @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Power_Control_Power.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Power_Control_Power.xml index 38a27ea4eb870..7c3ef459346bf 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Power_Control_Power.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/System_Power_Control_Power.xml @@ -5,4 +5,4 @@ On - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel.xml index 43a615e603de7..0e654c9c109f5 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel.xml @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel_Item.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel_Item.xml index 181c74a4098d7..09f0d019c0e9a 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel_Item.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Control_Preset_Preset_Sel_Item.xml @@ -92,4 +92,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Info.xml index 8ca967eb61192..92c1c535b170e 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/Tuner_Play_Info.xml @@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/desc_RX-V3900.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/desc_RX-V3900.xml index 8539156a92db7..5da41e9ff2338 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/desc_RX-V3900.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/desc_RX-V3900.xml @@ -1456,4 +1456,4 @@ NET_USB,Play_Control,Preset,Preset_Sel_Item - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/iPod_Play_Info.xml b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/iPod_Play_Info.xml index 5664884034832..1cb7109020dae 100644 --- a/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/iPod_Play_Info.xml +++ b/bundles/org.openhab.binding.yamahareceiver/src/test/resources/RX-V3900/iPod_Play_Info.xml @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.binding.yeelight/NOTICE b/bundles/org.openhab.binding.yeelight/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.binding.yeelight/NOTICE +++ b/bundles/org.openhab.binding.yeelight/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.binding.yeelight/pom.xml b/bundles/org.openhab.binding.yeelight/pom.xml index d79bb8de46be7..d229a33bd3b96 100644 --- a/bundles/org.openhab.binding.yeelight/pom.xml +++ b/bundles/org.openhab.binding.yeelight/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.yeelight diff --git a/bundles/org.openhab.binding.yeelight/src/main/feature/feature.xml b/bundles/org.openhab.binding.yeelight/src/main/feature/feature.xml index 78ecb81eb7c61..c2e4588f0afac 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.yeelight/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightBindingConstants.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightBindingConstants.java index b131f042fb2d7..e22a3cb64d909 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightBindingConstants.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightHandlerFactory.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightHandlerFactory.java index 2723f1caeaf78..dae7fe5fcbc66 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightHandlerFactory.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/YeelightHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/discovery/YeelightDiscoveryService.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/discovery/YeelightDiscoveryService.java index fd942731f55d4..c8d1586935d60 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/discovery/YeelightDiscoveryService.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/discovery/YeelightDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightCeilingHandler.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightCeilingHandler.java index befd5e8ec8731..624764bcad463 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightCeilingHandler.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightCeilingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightColorHandler.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightColorHandler.java index 123c47b4c717d..0061bed78fb95 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightColorHandler.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightColorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightHandlerBase.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightHandlerBase.java index 45de0c78245cf..779240749038e 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightHandlerBase.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightHandlerBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightStripeHandler.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightStripeHandler.java index 16318e6be9108..9941e43fe5dca 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightStripeHandler.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightStripeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightWhiteHandler.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightWhiteHandler.java index 77af347457499..c37a3afbbd9f1 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightWhiteHandler.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/handler/YeelightWhiteHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/CommonLogger.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/CommonLogger.java index 68cf3aa72a3c8..3ccc8751e8e3b 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/CommonLogger.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/CommonLogger.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CeilingDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CeilingDevice.java index c712259338e56..fe1f54c7a9bec 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CeilingDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CeilingDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -69,7 +69,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Problem setting values: {}", e); + logger.debug("Problem setting values", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ColorFlowItem.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ColorFlowItem.java index 060e6fb330308..51001596735a9 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ColorFlowItem.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ColorFlowItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ConnectState.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ConnectState.java index 8d1b56727f146..f80d4625171dd 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ConnectState.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/ConnectState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CtBulbDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CtBulbDevice.java index 540889cbda65f..a092185f355d9 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CtBulbDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/CtBulbDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -69,7 +69,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Problem setting values: {}", e); + logger.debug("Problem setting values", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DesklampDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DesklampDevice.java index ecdc3436061ab..91d44e62686f4 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DesklampDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DesklampDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -69,7 +69,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Problem setting values: {}", e); + logger.debug("Problem setting values", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceBase.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceBase.java index 5f11cecff9810..0ba7d3bcc74aa 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceBase.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -191,7 +191,7 @@ public void onNotify(String response) { } } } catch (Exception e) { - logger.debug("Exception: {}", e); + logger.debug("Exception", e); } } diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceFactory.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceFactory.java index 75b0a810dff82..f5a5b017b651b 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceFactory.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceMethod.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceMethod.java index b73bc8a4ae6d8..747b2e1ac1f88 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceMethod.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceMethod.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceStatus.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceStatus.java index 39a8f433cafac..4058f26d3e4b1 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceStatus.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/DeviceStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MethodFactory.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MethodFactory.java index 7ef78e57ac584..871b74e6a9a11 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MethodFactory.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MethodFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MonoDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MonoDevice.java index 9d5915610e419..610ad480ff3a1 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MonoDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/MonoDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -64,7 +64,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Exception: {}", e); + logger.debug("Exception", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/PitayaDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/PitayaDevice.java index 881dc275b6c45..ed581724d2346 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/PitayaDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/PitayaDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,7 +80,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Exception: {}", e); + logger.debug("Exception", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/WonderDevice.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/WonderDevice.java index a9db78c6cdac5..4fb073e157cc5 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/WonderDevice.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/WonderDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -80,7 +80,7 @@ public void onNotify(String msg) { } } } catch (Exception e) { - logger.debug("Exception: {}", e); + logger.debug("Exception", e); } super.onNotify(msg); diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/ConnectionBase.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/ConnectionBase.java index 3d8dd9ef17490..7e1cac5e6ce03 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/ConnectionBase.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/ConnectionBase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java index 8cf23f0c3334c..02e26125bb2d6 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -55,7 +55,7 @@ public boolean invoke(DeviceMethod method) { logger.debug("{}: Write Success!", TAG); } catch (Exception e) { logger.debug("{}: write exception, set device to disconnected!", TAG); - logger.debug("Exception: {}", e); + logger.debug("Exception", e); mDevice.setConnectionState(ConnectState.DISCONNECTED); return false; } @@ -73,7 +73,7 @@ public boolean invokeCustom(DeviceMethod method) { logger.debug("{}: Write Success!", TAG); } catch (Exception e) { logger.debug("{}: write exception, set device to disconnected!", TAG); - logger.debug("Exception: {}", e); + logger.debug("Exception", e); mDevice.setConnectionState(ConnectState.DISCONNECTED); return false; } @@ -108,14 +108,14 @@ public boolean connect() { mDevice.onNotify(value); } } catch (Exception e) { - logger.debug("Exception: {}", e); + logger.debug("Exception", e); mCmdRun = false; } } mSocket.close(); } catch (Exception e) { logger.debug("{}: connect device! ERROR! {}", TAG, e.getMessage()); - logger.debug("Exception: {}", e); + logger.debug("Exception", e); } finally { mDevice.setConnectionState(ConnectState.DISCONNECTED); mSocket = null; diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceAction.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceAction.java index d5130a90ffc7e..2622adbe5c606 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceAction.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceMode.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceMode.java index 976ea1f480f58..ef70574558d49 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceMode.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceMode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceType.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceType.java index 1b1415cc4fd94..b67ab847cfff0 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceType.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/MethodAction.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/MethodAction.java index 3b84f2baf10fd..667b34bb4786d 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/MethodAction.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/enums/MethodAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceConnectionStateListener.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceConnectionStateListener.java index 79c518858d58f..3f2a2766d1fa9 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceConnectionStateListener.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceConnectionStateListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceListener.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceListener.java index 4e917fb53e65d..b3b9f71ddcd78 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceListener.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceStatusChangeListener.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceStatusChangeListener.java index e481814b53b29..9766e6e9b0846 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceStatusChangeListener.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/listeners/DeviceStatusChangeListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java index f50ec0c50e59b..0f85928f9009a 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,7 @@ import java.net.InetAddress; import java.net.MulticastSocket; import java.net.NetworkInterface; +import java.net.SocketException; import java.net.SocketTimeoutException; import java.util.ArrayList; import java.util.Collections; @@ -26,6 +27,7 @@ import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.stream.Collectors; import org.openhab.binding.yeelight.internal.lib.device.DeviceBase; import org.openhab.binding.yeelight.internal.lib.device.DeviceFactory; @@ -46,15 +48,15 @@ public class DeviceManager { private static final String TAG = DeviceManager.class.getSimpleName(); - private static final String DISCOVERY_MSG = "M-SEARCH * HTTP/1.1\r\n" + "HOST:239.255.255.250:1982\r\n" - + "MAN:\"ssdp:discover\"\r\n" + "ST:wifi_bulb\r\n"; - private static final String MULTI_CAST_HOST = "239.255.255.250"; private static final int MULTI_CAST_PORT = 1982; + private static final String DISCOVERY_MSG = "M-SEARCH * HTTP/1.1\r\n" + "HOST:" + MULTI_CAST_HOST + ":" + + MULTI_CAST_PORT + "\r\n" + "MAN:\"ssdp:discover\"\r\n" + "ST:wifi_bulb\r\n"; + private static final int TIMEOUT = 10000; public static DeviceManager sInstance; - public boolean mSearching = false; + public volatile boolean mSearching = false; public Map mDeviceList = new HashMap<>(); public List mListeners = new ArrayList<>(); @@ -92,7 +94,7 @@ public void startDiscovery(long timeToStop) { try { Thread.sleep(timeToStop); } catch (InterruptedException e) { - logger.debug("Exception: {}", e); + logger.debug("Interrupted while sleeping", e); } finally { stopDiscovery(); } @@ -115,36 +117,42 @@ private void searchDevice() { try { final InetAddress multicastAddress = InetAddress.getByName(MULTI_CAST_HOST); - final List networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); + final List networkInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()) + .stream().filter(device -> { + try { + return device.isUp() && !device.isLoopback(); + } catch (SocketException e) { + logger.debug("Failed to get device information", e); + return false; + } + }).collect(Collectors.toList()); executorService = Executors.newFixedThreadPool(networkInterfaces.size()); mSearching = true; for (final NetworkInterface networkInterface : networkInterfaces) { - logger.debug("Starting Discovery on: {}", networkInterface.getDisplayName()); executorService.execute(() -> { - try { - MulticastSocket multiSocket = new MulticastSocket(MULTI_CAST_PORT); + try (MulticastSocket multiSocket = new MulticastSocket(MULTI_CAST_PORT)) { multiSocket.setSoTimeout(TIMEOUT); multiSocket.setNetworkInterface(networkInterface); multiSocket.joinGroup(multicastAddress); + DatagramPacket dpSend = new DatagramPacket(DISCOVERY_MSG.getBytes(), + DISCOVERY_MSG.getBytes().length, multicastAddress, MULTI_CAST_PORT); + multiSocket.send(dpSend); + while (mSearching) { byte[] buf = new byte[1024]; - DatagramPacket dpSend = new DatagramPacket(DISCOVERY_MSG.getBytes(), - DISCOVERY_MSG.getBytes().length, multicastAddress, MULTI_CAST_PORT); DatagramPacket dpRecv = new DatagramPacket(buf, buf.length); - multiSocket.send(dpSend); - try { multiSocket.receive(dpRecv); byte[] bytes = dpRecv.getData(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0; i < dpRecv.getLength(); i++) { // parse /r if (bytes[i] == 13) { @@ -152,11 +160,20 @@ private void searchDevice() { } buffer.append((char) bytes[i]); } - logger.debug("{}: got message: {}", TAG, buffer.toString()); - String[] infos = buffer.toString().split("\n"); + + String receivedMessage = buffer.toString(); + + logger.debug("{}: got message: {}", TAG, receivedMessage); + // we can skip the request because we aren't interested in our own search broadcast + // message. + if (receivedMessage.startsWith("M-SEARCH")) { + continue; + } + + String[] infos = receivedMessage.split("\n"); Map bulbInfo = new HashMap<>(); for (String info : infos) { - int index = info.indexOf(":"); + int index = info.indexOf(':'); if (index == -1) { continue; } @@ -168,11 +185,13 @@ private void searchDevice() { logger.debug("{}: got bulbInfo: {}", TAG, bulbInfo); if (bulbInfo.containsKey("model") && bulbInfo.containsKey("id")) { DeviceBase device = DeviceFactory.build(bulbInfo); - if (bulbInfo.containsKey("name")) { - device.setDeviceName(bulbInfo.get("name")); - } else { - device.setDeviceName(""); + + if (null == device) { + logger.warn("Found unsupported device."); + continue; } + device.setDeviceName(bulbInfo.getOrDefault("name", "")); + if (mDeviceList.containsKey(device.getDeviceId())) { updateDevice(mDeviceList.get(device.getDeviceId()), bulbInfo); } @@ -183,8 +202,6 @@ private void searchDevice() { } } - - multiSocket.close(); } catch (Exception e) { if (!e.getMessage().contains("No IP addresses bound to interface")) { logger.debug("Error getting ip addresses: {}", e.getMessage(), e); diff --git a/bundles/org.openhab.binding.yeelight/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.yeelight/src/main/resources/ESH-INF/thing/channels.xml index 0298e63460b44..a6d9d41f31ede 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.yeelight/src/main/resources/ESH-INF/thing/channels.xml @@ -31,7 +31,7 @@ Dimmer - + The CT channel allows to control the CT of a light. DimmableCT diff --git a/bundles/org.openhab.binding.zoneminder/.classpath b/bundles/org.openhab.binding.zoneminder/.classpath index 8d3240dab160c..be8ecc494d521 100644 --- a/bundles/org.openhab.binding.zoneminder/.classpath +++ b/bundles/org.openhab.binding.zoneminder/.classpath @@ -13,13 +13,14 @@ + - + @@ -28,6 +29,5 @@ - diff --git a/bundles/org.openhab.binding.zoneminder/NOTICE b/bundles/org.openhab.binding.zoneminder/NOTICE index e1f7f26de4ca7..e28de81b80845 100644 --- a/bundles/org.openhab.binding.zoneminder/NOTICE +++ b/bundles/org.openhab.binding.zoneminder/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.zoneminder/README.md b/bundles/org.openhab.binding.zoneminder/README.md index 7a402a60b8f2a..8fc79231c01cc 100644 --- a/bundles/org.openhab.binding.zoneminder/README.md +++ b/bundles/org.openhab.binding.zoneminder/README.md @@ -1,7 +1,7 @@ # Zoneminder Binding This binding offers integration to a ZoneMinder Server. It currently only offers to integrate to monitors (eg. cameras in ZoneMinder). -It also only offers access to a limited set of values, as well as a even more limited option to update values in ZoneMinder. +It also only offers access to a limited set of values, as well as an even more limited option to update values in ZoneMinder. It requires at least ZoneMinder 1.29 with API enabled (option 'OPT_USE_API' in ZoneMinder must be enabled). The option 'OPT_TRIGGERS' must be anabled to allow openHAB to trip the ForceAlarm in ZoneMinder. @@ -22,7 +22,7 @@ ZoneMinder things can be configured either through the online configuration util The Bridge will not be autodiscovered, this behavior is by design. That is because the ZoneMinder API can be configured to communicate on custom ports, you can even change the url from the default /zm/ to something userdefined. That makes it meaningless to scan for a ZoneMinder Server. -The Bridge must therefore be added manually, this can be done from PaperUI. +The Bridge must therefore be added manually, this can be done from Paper UI. After adding the Bridge it will go ONLINE, and after a short while and the discovery process for monitors will start. When a new monitor is discovered it will appear in the Inbox. diff --git a/bundles/org.openhab.binding.zoneminder/lib/zoneminder4j-0.9.7.jar b/bundles/org.openhab.binding.zoneminder/lib/zoneminder4j-0.9.7.jar deleted file mode 100644 index 5f202659325c0..0000000000000 Binary files a/bundles/org.openhab.binding.zoneminder/lib/zoneminder4j-0.9.7.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.zoneminder/pom.xml b/bundles/org.openhab.binding.zoneminder/pom.xml index 797e7429cc3bc..096697502ac2b 100644 --- a/bundles/org.openhab.binding.zoneminder/pom.xml +++ b/bundles/org.openhab.binding.zoneminder/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.zoneminder @@ -18,7 +17,13 @@ org.jsoup jsoup 1.10.1 - provided + compile + + + name.eskildsen + zoneminder4j + 0.9.7 + compile diff --git a/bundles/org.openhab.binding.zoneminder/src/main/feature/feature.xml b/bundles/org.openhab.binding.zoneminder/src/main/feature/feature.xml index 1aed83c2232a6..0bb8e73d7aa14 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.zoneminder/src/main/feature/feature.xml @@ -1,10 +1,9 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base - mvn:org.jsoup/jsoup/1.10.1 mvn:org.openhab.addons.bundles/org.openhab.binding.zoneminder/${project.version} diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/DataRefreshPriorityEnum.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/DataRefreshPriorityEnum.java index dceb7660f3168..c7e2cee36355b 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/DataRefreshPriorityEnum.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/DataRefreshPriorityEnum.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderConstants.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderConstants.java index a0a2e1a581332..2f86e4b9c975e 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderConstants.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderHandlerFactory.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderHandlerFactory.java index cc44d7bd0524b..fcb0c9c727a79 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderHandlerFactory.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -56,14 +56,11 @@ protected ThingHandler createHandler(Thing thing) { if (thingTypeUID.equals(ZoneMinderConstants.THING_TYPE_BRIDGE_ZONEMINDER_SERVER)) { logger.debug("[FACTORY]: creating handler for bridge thing '{}'", thing); - ZoneMinderServerBridgeHandler bridge = new ZoneMinderServerBridgeHandler((Bridge) thing); - - return bridge; + return new ZoneMinderServerBridgeHandler((Bridge) thing); } else if (thingTypeUID.equals(ZoneMinderConstants.THING_TYPE_THING_ZONEMINDER_MONITOR)) { return new ZoneMinderThingMonitorHandler(thing); } return null; } - } diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderProperties.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderProperties.java index 3bf8cbf21ea80..f50ad42daf38c 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderProperties.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/ZoneMinderProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderBridgeServerConfig.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderBridgeServerConfig.java index 94343975e5718..8ba7e99e0db33 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderBridgeServerConfig.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderBridgeServerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderConfig.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderConfig.java index 809bffe2bb8c8..a1f66f733859e 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderConfig.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingConfig.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingConfig.java index 21b6ca2ecb545..7367b3d398195 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingConfig.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingMonitorConfig.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingMonitorConfig.java index 5ab5999b705cb..fc609ae4c5f5b 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingMonitorConfig.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/config/ZoneMinderThingMonitorConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/discovery/ZoneMinderDiscoveryService.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/discovery/ZoneMinderDiscoveryService.java index a8741a07dfbe2..a80b61353d464 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/discovery/ZoneMinderDiscoveryService.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/discovery/ZoneMinderDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,13 +16,18 @@ import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; +import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.config.discovery.DiscoveryServiceCallback; import org.eclipse.smarthome.config.discovery.ExtendedDiscoveryService; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; +import org.eclipse.smarthome.core.thing.binding.ThingHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.openhab.binding.zoneminder.internal.ZoneMinderConstants; import org.openhab.binding.zoneminder.internal.handler.ZoneMinderServerBridgeHandler; import org.openhab.binding.zoneminder.internal.handler.ZoneMinderThingMonitorHandler; @@ -35,17 +40,32 @@ * * @author Martin S. Eskildsen - Initial contribution */ -public class ZoneMinderDiscoveryService extends AbstractDiscoveryService implements ExtendedDiscoveryService { +public class ZoneMinderDiscoveryService extends AbstractDiscoveryService + implements ExtendedDiscoveryService, DiscoveryService, ThingHandlerService { + private final Logger logger = LoggerFactory.getLogger(ZoneMinderDiscoveryService.class); - private ZoneMinderServerBridgeHandler serverHandler; + private @NonNullByDefault({}) ZoneMinderServerBridgeHandler serverHandler; private DiscoveryServiceCallback discoveryServiceCallback; - public ZoneMinderDiscoveryService(ZoneMinderServerBridgeHandler coordinatorHandler, int searchTime) { - super(searchTime); - this.serverHandler = coordinatorHandler; + public ZoneMinderDiscoveryService() { + super(30); + } + + @Override + public void setThingHandler(@Nullable ThingHandler handler) { + if (handler instanceof ZoneMinderServerBridgeHandler) { + this.serverHandler = (ZoneMinderServerBridgeHandler) handler; + this.serverHandler.setDiscoveryService(this); + } } + @Override + public @Nullable ThingHandler getThingHandler() { + return serverHandler; + } + + @Override public void activate() { logger.debug("[DISCOVERY]: Activating ZoneMinder discovery service for {}", serverHandler.getThing().getUID()); } diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderBaseThingHandler.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderBaseThingHandler.java index c5a2308e9d08c..539e7b54c87e0 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderBaseThingHandler.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderBaseThingHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderHandler.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderHandler.java index 1c6cefc0f3373..06c6ff4ab12d0 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderHandler.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderServerBridgeHandler.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderServerBridgeHandler.java index 308527a2db981..5b76fc32e60c8 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderServerBridgeHandler.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderServerBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,8 +16,8 @@ import java.math.BigDecimal; import java.security.GeneralSecurityException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; -import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; @@ -27,7 +27,6 @@ import javax.security.auth.login.FailedLoginException; import org.apache.commons.lang.StringUtils; -import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.library.types.DecimalType; import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.Bridge; @@ -39,6 +38,7 @@ import org.eclipse.smarthome.core.thing.ThingStatusInfo; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler; +import org.eclipse.smarthome.core.thing.binding.ThingHandlerService; import org.eclipse.smarthome.core.types.Command; import org.eclipse.smarthome.core.types.RefreshType; import org.eclipse.smarthome.core.types.State; @@ -48,7 +48,6 @@ import org.openhab.binding.zoneminder.internal.ZoneMinderProperties; import org.openhab.binding.zoneminder.internal.config.ZoneMinderBridgeServerConfig; import org.openhab.binding.zoneminder.internal.discovery.ZoneMinderDiscoveryService; -import org.osgi.framework.ServiceRegistration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,7 +82,6 @@ public class ZoneMinderServerBridgeHandler extends BaseBridgeHandler implements private final Logger logger = LoggerFactory.getLogger(getClass()); private ZoneMinderDiscoveryService discoveryService; - private ServiceRegistration discoveryRegistration; private ScheduledFuture taskWatchDog; private int refreshFrequency; @@ -264,6 +262,10 @@ public void initialize() { } } + public void setDiscoveryService(ZoneMinderDiscoveryService discoveryService) { + this.discoveryService = discoveryService; + } + /** * Method to find the lowest possible refresh rate (based on configuration) * @@ -309,11 +311,6 @@ public void dispose() { discoveryService = null; } - if (discoveryRegistration != null) { - discoveryRegistration.unregister(); - discoveryRegistration = null; - } - logger.info("{}: Stopping WatchDog task", getLogIdentifier()); stopWatchDogTask(); @@ -363,6 +360,11 @@ public ZoneMinderBaseThingHandler getZoneMinderThingHandlerFromZoneMinderId(Thin return null; } + @Override + public Collection> getServices() { + return Collections.singleton(ZoneMinderDiscoveryService.class); + } + @Override public void handleCommand(ChannelUID channelUID, Command command) { logger.debug("{}: Update '{}' with '{}'", getLogIdentifier(), channelUID.getAsString(), command.toString()); @@ -917,23 +919,6 @@ protected State getServerDiskUsageState() { public void onBridgeConnected(ZoneMinderServerBridgeHandler bridge, IZoneMinderConnectionInfo connection) { logger.info("{}: Brigde went ONLINE", getLogIdentifier()); - try { - // Start the discovery service - if (discoveryService == null) { - discoveryService = new ZoneMinderDiscoveryService(this, 30); - } - discoveryService.activate(); - - if (discoveryRegistration == null) { - // And register it as an OSGi service - discoveryRegistration = bundleContext.registerService(DiscoveryService.class.getName(), - discoveryService, new Hashtable<>()); - } - } catch (Exception e) { - logger.error("BRIDGE [{}]: Exception occurred when starting discovery service Exception='{}'", getThingId(), - e.getMessage()); - } - if (taskRefreshData == null) { // Perform first refresh manually (we want to force update of DiskUsage) boolean updateDiskUsage = (getBridgeConfig().getRefreshIntervalLowPriorityTask() > 0) ? true : false; diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingMonitorHandler.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingMonitorHandler.java index 7a7dfcdb7eee7..296c691113a2a 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingMonitorHandler.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingMonitorHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingType.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingType.java index 99d202f5d4e6c..aeba31652a8aa 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingType.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZoneMinderThingType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/monitor-channels.xml b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/monitor-channels.xml index fd11815ad514c..93eef7e18614e 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/monitor-channels.xml +++ b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/monitor-channels.xml @@ -9,8 +9,8 @@ The ID of the monitor in ZoneMinder - - + + Timeout in seconds when activating alarm. Default is 60 seconds 60 diff --git a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/zoneminderserver.xml b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/zoneminderserver.xml index 96dda4d6fc50d..12b35d276c8af 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/zoneminderserver.xml +++ b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/config/zoneminderserver.xml @@ -12,11 +12,11 @@ network - + refreshConfig - + advancedSettings @@ -37,7 +37,7 @@ - + Additional path on ZoneMinder Server to access API. In a standard installation this is' /zm' /zm @@ -50,20 +50,20 @@ Password to access the ZoneMinder Server API - + Port of the ZoneMinder Server API. If '0', then the port will be determined from the protocol 0 true - + Port to listen for events in (Telnet) 6802 true - - + + Seconds between each call to ZoneMinder Server API to refresh values in openHAB 10 true @@ -75,7 +75,7 @@ true - + If enabled new monitors on the ZoneMinder Server will automatically be added to the Inbox in openHAB true true diff --git a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/monitor-thing.xml b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/monitor-thing.xml index f6b280708daa1..34d2bb6dde6ee 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/monitor-thing.xml +++ b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/monitor-thing.xml @@ -54,14 +54,14 @@ Switch - + set to 'ON' when one of the following is true: Motion detected, Signal lost, Force Alarm pressed, External Alarm. Else set to 'OFF' Switch - + set to 'ON' when either channel monitor-alarm set to 'ON', or montior function is 'Mocord' or 'Record'. Else set to 'OFF' @@ -83,7 +83,7 @@ String - + Current Monitor Function: None, Monitor, Modect, Record, Mocord, Nodect @@ -115,21 +115,21 @@ Switch - + State of ZoneMinder Capture daemon for this monitor Switch - + State of ZoneMinder Analysis daemon for this monitor Switch - + State of ZoneMinder Frame daemon for this monitor diff --git a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/server-bridge.xml b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/server-bridge.xml index 6b58e6ceedd45..92290301849e8 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/server-bridge.xml +++ b/bundles/org.openhab.binding.zoneminder/src/main/resources/ESH-INF/thing/server-bridge.xml @@ -2,7 +2,7 @@ + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> @@ -25,7 +25,7 @@ Number - + ZoneMinder Server CPU Load diff --git a/bundles/org.openhab.binding.zway/.classpath b/bundles/org.openhab.binding.zway/.classpath index 3e3cff8e87429..615608997a6c5 100644 --- a/bundles/org.openhab.binding.zway/.classpath +++ b/bundles/org.openhab.binding.zway/.classpath @@ -28,6 +28,5 @@ - diff --git a/bundles/org.openhab.binding.zway/.gitignore b/bundles/org.openhab.binding.zway/.gitignore deleted file mode 100644 index 9f970225adb6a..0000000000000 --- a/bundles/org.openhab.binding.zway/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ \ No newline at end of file diff --git a/bundles/org.openhab.binding.zway/NOTICE b/bundles/org.openhab.binding.zway/NOTICE index ee4ef29a66f39..5c39fa4556d6f 100644 --- a/bundles/org.openhab.binding.zway/NOTICE +++ b/bundles/org.openhab.binding.zway/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.binding.zway/README.md b/bundles/org.openhab.binding.zway/README.md index c2e47e6238e61..667d27bf3bb38 100644 --- a/bundles/org.openhab.binding.zway/README.md +++ b/bundles/org.openhab.binding.zway/README.md @@ -22,7 +22,7 @@ The existing, certified Z-Way stack can be used to build, configure and control By using the REST API all devices are loaded from Z-Way and represented as openHAB elements. The sensor data and actuator states are constantly updated and commands are passed to the Z-Way system. -The Binding uses the Z-Way library for Java ([Github](https://github.com/pathec/ZWay-library-for-Java)). +The Binding uses the Z-Way library for Java ([GitHub](https://github.com/pathec/ZWay-library-for-Java)). ## Supported Things @@ -44,7 +44,7 @@ On the other hand all virtual devices are mapped to *Z-Way Virtual Devices* with A discovery service for Z-Way servers scans local network and must always be started manually. Z-Way doesn't support any discovery protocol like UPnP for this purpose. -That's why first all IP addresses in local network are checked on port 8083. +That is why first all IP addresses in local network are checked on port 8083. If the server answers, a ZAutomation request (*/ZAutomation/api/v1/status*) is performed to ensure, the found server runs Z-Way. Another discovery service provides available devices (a configured bridge is necessary). @@ -68,7 +68,7 @@ Besides the username and password all required Z-Way information are found durin | Configuration Name | Mandatory | Default | Desciption | |--------------------------|-----------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | zwayServerIpAddress | | localhost | The IP address or hostname of the Z-Way server. If Z-Way and openHAB are running on the same machine, the default value can be used. | -| zwayServerPort | | 8083 | The port of the Z-Way server (0 to 65335) | +| zwayServerPort | | 8083 | The port of the Z-Way server (1 to 65535) | | zwayServerProtocol | | http | Protocol to connect to the Z-Way server (http or https) | | zwayServerUsername | | admin | Username to access the Z-Way server. | | zwayServerPassword | X | | Password to access the Z-Way server. | @@ -131,7 +131,7 @@ Currently unsupported Z-Way probe types: ### Universial channels for the devices -The following channels represent universial channels if no further device information are available, only depending on the Z-Way device types (for available device types see [Z-Way Documentation](http://docs.zwayhomeautomation.apiary.io/#reference/devices/device)). +The following channels represent universial channels if no further device information are available, only depending on the Z-Way device types (for available device types see [Z-Way Documentation](https://zwayhomeautomation.docs.apiary.io/#reference/devices)). | Channel Type ID | Item Type | Category | Assigned for Z-Way device type | |------------------|-----------|-------------|-------------------------------------------| @@ -151,12 +151,12 @@ Unsupported Z-Way device types: Camera, SensorMultiline, Text. The integration o ### Channels for the Z-Way Server (Bridge) --| Channel Type ID | Item Type | Category | Description | --| --------------- | --------- | -------- | ----------- | --| actions | String | - | It is currently possible to update all devices. | --| secureInclusion | Switch | Switch | Change inclusion type for further inclusions. | --| inclusion | Switch | Switch | Start inclusion mode (after a timeout the inclusion will be automatically finished). | --| exclusion | Switch | Switch | Start exclusion mode (after a timeout the exclusion will be automatically finished). || +| Channel Type ID | Item Type | Category | Description | +|-----------------|-----------|----------|--------------------------------------------------------------------------------------| +| actions | String | - | It is currently possible to update all devices. | +| secureInclusion | Switch | Switch | Change inclusion type for further inclusions. | +| inclusion | Switch | Switch | Start inclusion mode (after a timeout the inclusion will be automatically finished). | +| exclusion | Switch | Switch | Start exclusion mode (after a timeout the exclusion will be automatically finished). | ## Locations @@ -189,5 +189,4 @@ Because textual configuration isn't useful, follow the instructions in the [Gett - Configuration of the Z-Wave network by the binding is currently not possible (physical device configuration) - Only polling is available. Further versions will contain other mechanisms under usage of the WebSocket implementation of Z-Way or MQTT. -
-![BMWi](./doc/BMWi_4C_Gef_en.jpg) +![BMWi](doc/BMWi_4C_Gef_en.jpg) diff --git a/bundles/org.openhab.binding.zway/doc/GETTING_STARTED.md b/bundles/org.openhab.binding.zway/doc/GETTING_STARTED.md index 5103210a45dbd..44fbc4618b191 100644 --- a/bundles/org.openhab.binding.zway/doc/GETTING_STARTED.md +++ b/bundles/org.openhab.binding.zway/doc/GETTING_STARTED.md @@ -13,7 +13,7 @@ ```shell cd /opt/openhab2/addons - sudo wget https://github.com/openhab/openhab2-addons/files/636686/org.openhab.binding.zway-2.0.0-SNAPSHOT.zip + sudo wget https://github.com/openhab/openhab-addons/files/636686/org.openhab.binding.zway-2.0.0-SNAPSHOT.zip sudo unzip org.openhab.binding.zway-2.0.0-SNAPSHOT.zip sudo rm org.openhab.binding.zway-2.0.0-SNAPSHOT.zip ``` @@ -25,7 +25,7 @@ ## Create and configure a Z-Way Bridge -Open the *PaperUI* +Open the *Paper UI* ![openHAB Home](images/getting-started/01-openHAB-Home.png) diff --git a/bundles/org.openhab.binding.zway/lib/zway-lib-0.2.9-SNAPSHOT.jar b/bundles/org.openhab.binding.zway/lib/zway-lib-0.2.9-SNAPSHOT.jar deleted file mode 100644 index a96a87b024062..0000000000000 Binary files a/bundles/org.openhab.binding.zway/lib/zway-lib-0.2.9-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.binding.zway/pom.xml b/bundles/org.openhab.binding.zway/pom.xml index 7cff31c39a2cf..50ebb4e5cfcaa 100644 --- a/bundles/org.openhab.binding.zway/pom.xml +++ b/bundles/org.openhab.binding.zway/pom.xml @@ -1,24 +1,33 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.binding.zway openHAB Add-ons :: Bundles :: ZWay Binding + + commons-lang3 + + org.apache.commons commons-lang3 3.4 - provided + compile + + + com.github.pathec + zway-lib + 0.2.9.OH + compile diff --git a/bundles/org.openhab.binding.zway/src/main/feature/feature.xml b/bundles/org.openhab.binding.zway/src/main/feature/feature.xml index c239861cc17d1..f5920d1810213 100644 --- a/bundles/org.openhab.binding.zway/src/main/feature/feature.xml +++ b/bundles/org.openhab.binding.zway/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayBindingConstants.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayBindingConstants.java index 65692e12cff56..1e3e256dfcd8f 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayBindingConstants.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayBindingConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayHandlerFactory.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayHandlerFactory.java index 1d85daf4cc605..9a464f7f0324f 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayHandlerFactory.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/ZWayHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayBridgeConfiguration.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayBridgeConfiguration.java index 3b2d8a021b040..83bcff1f79a95 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayBridgeConfiguration.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayBridgeConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZAutomationDeviceConfiguration.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZAutomationDeviceConfiguration.java index 7335e6b8110e5..b88ccd200733d 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZAutomationDeviceConfiguration.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZAutomationDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZWaveDeviceConfiguration.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZWaveDeviceConfiguration.java index 1a281319ff5e2..762e543c41033 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZWaveDeviceConfiguration.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/config/ZWayZWaveDeviceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/converter/ZWayDeviceStateConverter.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/converter/ZWayDeviceStateConverter.java index 2ec4bb9a114cc..5711c5728e85e 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/converter/ZWayDeviceStateConverter.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/converter/ZWayDeviceStateConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayBridgeDiscoveryService.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayBridgeDiscoveryService.java index cdc4e6ceebcd1..cfcbe33bfaf49 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayBridgeDiscoveryService.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayBridgeDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayDeviceDiscoveryService.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayDeviceDiscoveryService.java index ec1464cecf12e..9ba846b354d93 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayDeviceDiscoveryService.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/discovery/ZWayDeviceDiscoveryService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayBridgeHandler.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayBridgeHandler.java index 6576cf90a6eea..9dd1ce39a7964 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayBridgeHandler.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayBridgeHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayDeviceHandler.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayDeviceHandler.java index ef0e910e10cf4..1ff6e14619bfa 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayDeviceHandler.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZAutomationDeviceHandler.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZAutomationDeviceHandler.java index 741f0eaf553f4..8051b434d8d2a 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZAutomationDeviceHandler.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZAutomationDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZWaveDeviceHandler.java b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZWaveDeviceHandler.java index 7324d5920738e..ea5bec433fa5c 100644 --- a/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZWaveDeviceHandler.java +++ b/bundles/org.openhab.binding.zway/src/main/java/org/openhab/binding/zway/internal/handler/ZWayZWaveDeviceHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/config/bridge-config.xml b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/config/bridge-config.xml index a505c07020c08..cdd9bd90fa321 100644 --- a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/config/bridge-config.xml +++ b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/config/bridge-config.xml @@ -6,7 +6,7 @@ > - + The configuration of the Z-Way server. Except for the username and password all the information detected during the discovery. @@ -17,12 +17,12 @@ network-address - + The IP address or hostname of the Z-Way server. If Z-Way and openHAB are running on the same machine, the default value can be used. localhost - + The port of the Z-Way server 8083 diff --git a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/bridge.xml b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/bridge.xml index 1fbda900436b4..fc70e830ea00a 100644 --- a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/bridge.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> diff --git a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/channels.xml b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/channels.xml index 638ec8728122b..6ee4605bc6bce 100644 --- a/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/channels.xml +++ b/bundles/org.openhab.binding.zway/src/main/resources/ESH-INF/thing/channels.xml @@ -147,7 +147,7 @@ Switch - + This channel represents a universal channel if no further device information is available. Switch @@ -155,14 +155,14 @@ Number - + This channel represents a universal channel if no further device information is available. Switch - + This channel represents a universal channel if no further device information is available. Switch @@ -170,21 +170,21 @@ Dimmer - + This channel represents a universal channel if no further device information is available. Color - + This channel represents the rgbw switch device type from Z-Way. ColorLight Switch - + The channel allows the control or display of a thermostat (mode). A thermostat can have up to three states (modes): off, heating and cooling. The state of heating and cooling is alternately set at the state on. Temperature @@ -192,14 +192,14 @@ Number - + Temperature Switch - + This channel represents a universal channel if no further device information is available. Switch @@ -207,14 +207,14 @@ Number - + This channel represents a two-digit value. The first digit is the button/scene number and the second digit points to action/keyAttribute (have a look at http://z-wave.sigmadesigns.com/wp-content/uploads/2016/08/SDS12657-12-Z-Wave-Command-Class-Specification-A-M.pdf, p. 153). Number - + The channel allows the control or display of a thermostat (mode) from command class. The modes differ from device to device. Temperature @@ -235,7 +235,7 @@ Switch - + Change inclusion type for further inclusions. Switch diff --git a/bundles/org.openhab.extensionservice.marketplace.automation/NOTICE b/bundles/org.openhab.extensionservice.marketplace.automation/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.extensionservice.marketplace.automation/NOTICE +++ b/bundles/org.openhab.extensionservice.marketplace.automation/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.extensionservice.marketplace.automation/pom.xml b/bundles/org.openhab.extensionservice.marketplace.automation/pom.xml index 83d7daa0483b6..8faee8ec33d99 100644 --- a/bundles/org.openhab.extensionservice.marketplace.automation/pom.xml +++ b/bundles/org.openhab.extensionservice.marketplace.automation/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.extensionservice.marketplace.automation diff --git a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/feature/feature.xml b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/feature/feature.xml index d7e4246c93da7..2cf08539c005b 100644 --- a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/feature/feature.xml +++ b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features diff --git a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/AutomationExtensionHandler.java b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/AutomationExtensionHandler.java index 744552077d1f6..eb8df7a3b37e0 100644 --- a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/AutomationExtensionHandler.java +++ b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/AutomationExtensionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/MarketplaceRuleTemplateProvider.java b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/MarketplaceRuleTemplateProvider.java index 8ef95f2fde978..621013482c3ee 100644 --- a/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/MarketplaceRuleTemplateProvider.java +++ b/bundles/org.openhab.extensionservice.marketplace.automation/src/main/java/org/openhab/extensionservice/marketplace/automation/internal/MarketplaceRuleTemplateProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/NOTICE b/bundles/org.openhab.extensionservice.marketplace/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.extensionservice.marketplace/NOTICE +++ b/bundles/org.openhab.extensionservice.marketplace/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.extensionservice.marketplace/README.md b/bundles/org.openhab.extensionservice.marketplace/README.md index 6d4fbb85b7a9c..77f788dbb6041 100644 --- a/bundles/org.openhab.extensionservice.marketplace/README.md +++ b/bundles/org.openhab.extensionservice.marketplace/README.md @@ -33,7 +33,7 @@ The received extensions description is XML. The schema is like in the following 1487690446 1489494314 1 - http://www.openhabfoundation.org + https://www.openhabfoundation.org https://marketplace.eclipse.org/sites/default/files/styles/ds_medium/public/iot-package/logo/heating.png?itok=qMbbIXEU diff --git a/bundles/org.openhab.extensionservice.marketplace/pom.xml b/bundles/org.openhab.extensionservice.marketplace/pom.xml index 9ee57f7aab62f..3a52fc28bba2f 100644 --- a/bundles/org.openhab.extensionservice.marketplace/pom.xml +++ b/bundles/org.openhab.extensionservice.marketplace/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.extensionservice.marketplace diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/feature/feature.xml b/bundles/org.openhab.extensionservice.marketplace/src/main/feature/feature.xml index ce726ebb6218a..4d288d9946889 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/feature/feature.xml +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtension.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtension.java index 2a27932c5d377..1fcd97cd1d47a 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtension.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtension.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtensionHandler.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtensionHandler.java index bd5bba1d8d3a2..43e29157cdd1c 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtensionHandler.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceExtensionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceHandlerException.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceHandlerException.java index 8aa6351f11a37..388129f9e874a 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceHandlerException.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/MarketplaceHandlerException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/BundleExtensionHandler.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/BundleExtensionHandler.java index 3702bade7273a..921239d09942a 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/BundleExtensionHandler.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/BundleExtensionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionService.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionService.java index 9c8b071ae4ba7..76cb718f3b457 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionService.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceProxy.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceProxy.java index e5da70342aa50..cba9998a82509 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceProxy.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceProxy.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceXMLReader.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceXMLReader.java index eb6cec966db24..d3463174b76c2 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceXMLReader.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/MarketplaceXMLReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Category.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Category.java index 4ae024d2f8ebb..600f330afbb02 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Category.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Category.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Marketplace.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Marketplace.java index f012451c8a5fd..a82d700fcaac9 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Marketplace.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Marketplace.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Node.java b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Node.java index bde7e8b44c747..56eb45b28fdb6 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Node.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/main/java/org/openhab/extensionservice/marketplace/internal/model/Node.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.extensionservice.marketplace/src/test/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionServiceTest.java b/bundles/org.openhab.extensionservice.marketplace/src/test/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionServiceTest.java index 30ba97be6b238..ce79b915f7535 100644 --- a/bundles/org.openhab.extensionservice.marketplace/src/test/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionServiceTest.java +++ b/bundles/org.openhab.extensionservice.marketplace/src/test/java/org/openhab/extensionservice/marketplace/internal/MarketplaceExtensionServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,10 +23,13 @@ import org.junit.Before; import org.junit.Test; -import org.openhab.extensionservice.marketplace.internal.MarketplaceExtensionService; -import org.openhab.extensionservice.marketplace.internal.MarketplaceProxy; import org.openhab.extensionservice.marketplace.internal.model.Node; +/** + * Tests {@link MarketplaceExtensionService}. + * + * @author Kai Kreuzer - Initial contribution + */ public class MarketplaceExtensionServiceTest { private static final String BASE_PATH = "http://marketplace.eclipse.org/marketplace-client-intro"; diff --git a/bundles/org.openhab.io.azureiothub/NOTICE b/bundles/org.openhab.io.azureiothub/NOTICE deleted file mode 100644 index 8e6496b6c818f..0000000000000 --- a/bundles/org.openhab.io.azureiothub/NOTICE +++ /dev/null @@ -1,35 +0,0 @@ -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/openhab2-addons - -== Third-party Content - -azure-eventhubs -* License: MIT License -* Project: https://github.com/Azure/azure-event-hubs-java -* Source: https://github.com/Azure/azure-event-hubs-java - -iot-device-client -* License: MIT License -* Project: https://github.com/Azure/azure-iot-sdk-java/tree/master/device -* Source: https://github.com/Azure/azure-iot-sdk-java/tree/master/device - -iot-service-client -* License: MIT License -* Project: https://github.com/Azure/azure-iot-sdk-java/tree/master/service -* Source: https://github.com/Azure/azure-iot-sdk-java/tree/master/service - -jsonp -* License: EPLv2 -* Project: https://github.com/eclipse-ee4j/jsonp -* Source: https://github.com/eclipse-ee4j/jsonp diff --git a/bundles/org.openhab.io.azureiothub/README.md b/bundles/org.openhab.io.azureiothub/README.md deleted file mode 100644 index edeb3e3924230..0000000000000 --- a/bundles/org.openhab.io.azureiothub/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Azure IoT Hub Connector - -The Azure IoT Hub connector replicates your local things to a [Microsoft Azure IoT Hub](https://azure.microsoft.com/en-us/services/iot-hub/). -This IoT building block resides in the Azure cloud and allows 2 way communication with your devices and your IoT infrastructure in the cloud. -The IoT hub can be connected to other Azure services like a [database](https://azure.microsoft.com/en-us/services/hdinsight/), [stream analytics](https://azure.microsoft.com/en-us/services/stream-analytics/), [machine learning](https://azure.microsoft.com/en-us/services/machine-learning/) and [time series insights](https://azure.microsoft.com/en-us/services/time-series-insights/). - -## Pricing - -You may send up to 8000 messages a day for free. -That is 5.5 status updates every minute. -Anything more than this in the free price tier is simply neglected by the IoT Hub. -If you want to log more than this, you can switch to a paying price tier, see [pricing details](https://azure.microsoft.com/en-us/pricing/details/iot-hub/). - -[Create an Azure account here](https://azure.microsoft.com/en-us/free/) - -## Configuration - -### Connection string - -From the [Azure portal](http://portal.azure.com/), you need to create an IoT Hub. -Click on the '+' sign on the upper left, search for 'IoT Hub', click create and follow the wizard. -Once the hub is available, go to settings - Shared access policies, click `iothubowner` and copy the connection string - primary key. -When configuring your connector in openHAB, you need to provide this string as the parameter `connectionstring`. - -### Mode - -The openHAB Azure IoT Hub Connector can operate in 2 modes: -Publish (only) or publish and command. -In publish mode, openHAB will sync all its devices and its status changes to Azure. -In publish & command mode, you can also send cloud to device commands. diff --git a/bundles/org.openhab.io.azureiothub/pom.xml b/bundles/org.openhab.io.azureiothub/pom.xml deleted file mode 100644 index 586527c955477..0000000000000 --- a/bundles/org.openhab.io.azureiothub/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - - org.openhab.addons.bundles - org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT - - - org.openhab.io.azureiothub - - openHAB Add-ons :: Bundles :: IO :: Azure IoT Hub Connector - - - - org.openhab.osgiify - com.microsoft.azure.sdk.iot.iot-device-client - 1.2.27 - provided - - - org.openhab.osgiify - com.microsoft.azure.sdk.iot.iot-service-client - 1.4.20 - provided - - - org.openhab.osgiify - com.microsoft.azure.azure-eventhubs - 0.14.0 - provided - - - javax.json - javax.json-api - 1.0 - provided - - - - diff --git a/bundles/org.openhab.io.azureiothub/src/main/feature/feature.xml b/bundles/org.openhab.io.azureiothub/src/main/feature/feature.xml deleted file mode 100644 index 08e3fdf36c00e..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/feature/feature.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features - - - openhab-runtime-base - openhab-transport-mqtt - mvn:org.openhab.osgiify/com.microsoft.azure.sdk.iot.iot-device-client/1.2.27 - mvn:org.openhab.osgiify/com.microsoft.azure.sdk.iot.iot-service-client/1.4.20 - mvn:org.openhab.osgiify/com.microsoft.azure.azure-eventhubs/0.14.0 - mvn:javax.json/javax.json-api/1.0 - mvn:org.openhab.addons.bundles/org.openhab.io.azureiothub/${project.version} - - diff --git a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevice.java b/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevice.java deleted file mode 100644 index da287fd82b771..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevice.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.io.internal.azureiothub; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.time.LocalDateTime; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.microsoft.azure.sdk.iot.device.DeviceClient; -import com.microsoft.azure.sdk.iot.device.IotHubClientProtocol; -import com.microsoft.azure.sdk.iot.device.Message; -import com.microsoft.azure.sdk.iot.service.Device; -import com.microsoft.azure.sdk.iot.service.RegistryManager; - -/** - * Represents an device on the Azure IoT Hub - * - * @author Niko Tanghe - Initial contribution - * @author Kai Kreuzer - Cleaned up code - */ -public class AzureDevice { - - private static final IotHubClientProtocol PROTOCOL = IotHubClientProtocol.MQTT; - - private final Logger logger = LoggerFactory.getLogger(AzureDevice.class); - - private final DeviceClient client; - private LocalDateTime retrievedAt; - - private Device device; - - public AzureDevice(Device azureDevice, RegistryManager registryManager) throws URISyntaxException, IOException { - device = azureDevice; - retrievedAt = LocalDateTime.now(); - - String connectionstring = registryManager.getDeviceConnectionString(azureDevice); - client = new DeviceClient(connectionstring, PROTOCOL); - client.open(); - logger.debug("device {} - state {}", azureDevice.getDeviceId(), azureDevice.getConnectionState()); - } - - public LocalDateTime getRetrievedAt() { - return retrievedAt; - } - - public Device getDevice() { - return device; - } - - public void sendMessage(Message msg, AzureEventCallback callback, Object lockobj) { - try { - // keep connection open, - // according to inline comments, calling open on an already open connection does nothing. - client.open(); - } catch (IOException e) { - logger.warn("Failed to connect to Azure IoT Hub device", e); - } - client.sendEventAsync(msg, callback, lockobj); - } - - public void close() { - if (client != null) { - try { - client.closeNow(); - } catch (IOException e) { - logger.warn("Failed to close connection to Azure device", e); - } - } - } -} diff --git a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevices.java b/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevices.java deleted file mode 100644 index fa262b464826b..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureDevices.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.io.internal.azureiothub; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.security.NoSuchAlgorithmException; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.JsonSyntaxException; -import com.microsoft.azure.sdk.iot.service.Device; -import com.microsoft.azure.sdk.iot.service.RegistryManager; -import com.microsoft.azure.sdk.iot.service.exceptions.IotHubException; - -/** - * Represents an a list of devices on the Azure IoT Hub - * - * @author Niko Tanghe - Initial contribution - * @author Kai Kreuzer - removed joda-time dependency and cleaned up code - */ - -public class AzureDevices { - - private final Logger logger = LoggerFactory.getLogger(AzureDevices.class); - - private Map map = new HashMap<>(); - private String connectionstring; - private RegistryManager registryManager; - - public AzureDevices(String connectionstring) throws IOException { - this.connectionstring = connectionstring; - this.registryManager = RegistryManager.createFromConnectionString(this.connectionstring); - } - - public AzureDevice getDevice(String deviceId) throws URISyntaxException, IOException, IotHubException, - JsonSyntaxException, IllegalArgumentException, NoSuchAlgorithmException { - AzureDevice device = map.get(deviceId); - - // not created yet or cache expired - if (device == null || device.getRetrievedAt().plus(Duration.ofMinutes(30)).isBefore(LocalDateTime.now())) { - - // close connection - if (device != null) { - device.close(); - registryManager.removeDevice(deviceId); - } - - // re-create - device = new AzureDevice(getAzureDevice(deviceId), registryManager); - map.put(deviceId, device); - return device; - } - - return device; - } - - private Device getAzureDevice(String deviceId) throws IllegalArgumentException, NoSuchAlgorithmException, - IotHubException, JsonSyntaxException, IOException { - Device device = Device.createFromId(deviceId, null, null); - - try { - device = registryManager.addDevice(device); - } catch (IotHubException iote) { - // this happens if the device already exists, so let's retrieve it - device = registryManager.getDevice(deviceId); - } - - return device; - } -} diff --git a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureEventCallback.java b/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureEventCallback.java deleted file mode 100644 index 85f24b92a62ee..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/AzureEventCallback.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.io.internal.azureiothub; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.microsoft.azure.sdk.iot.device.IotHubEventCallback; -import com.microsoft.azure.sdk.iot.device.IotHubStatusCode; - -/** - * This triggered in case of cloud to device communication - * - * @author Niko Tanghe - Initial contribution - * @author Kai Kreuzer - code cleanup - */ - -public class AzureEventCallback implements IotHubEventCallback { - private final Logger logger = LoggerFactory.getLogger(AzureEventCallback.class); - - @Override - public void execute(IotHubStatusCode status, Object context) { - logger.debug("IoT Hub responded to message with status {}", status.name()); - - if (context != null) { - synchronized (context) { - context.notify(); - } - } - } -} diff --git a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudClient.java b/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudClient.java deleted file mode 100644 index e81b539a417eb..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudClient.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.io.internal.azureiothub; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.time.Instant; -import java.util.function.Consumer; - -import org.eclipse.smarthome.core.events.EventPublisher; -import org.eclipse.smarthome.core.items.events.ItemEventFactory; -import org.eclipse.smarthome.core.library.types.StringType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.microsoft.azure.eventhubs.EventData; -import com.microsoft.azure.eventhubs.EventHubClient; -import com.microsoft.azure.eventhubs.PartitionReceiver; -import com.microsoft.azure.sdk.iot.device.Message; -import com.microsoft.azure.sdk.iot.service.Device; -import com.microsoft.azure.servicebus.ServiceBusException; - -/** - * - * This class provides communication between openHAB and Azure IoT Hub. - * implementation is taken from https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-java-java-getstarted - * - * @author Niko Tanghe - Initial contribution - * @author Kai Kreuzer - Code cleanup - * - */ - -public class CloudClient { - - private static final String DATAPOINT_VALUE = "value"; - private static final String DATAPOINT_DEVICE_ID = "deviceId"; - - private final Logger logger = LoggerFactory.getLogger(CloudClient.class); - - private String connectionstring; - private boolean commandEnabled; - private EventPublisher eventPublisher; - - private AzureDevices azureDeviceStore; - private EventHubClient azureClient; - private Object lockobj = new Object(); - private Gson gson = new Gson(); - - /** - * Constructor of CloudClient - * - * @param connectionstring the connectionstring to the Azure IoT Hub - * @param eventPublisher - * @throws IOException - * @throws ServiceBusException - * - */ - public CloudClient(String connectionstring, boolean commandEnabled, EventPublisher eventPublisher) - throws IOException, ServiceBusException { - this.connectionstring = connectionstring; - this.commandEnabled = commandEnabled; - this.eventPublisher = eventPublisher; - - azureDeviceStore = new AzureDevices(this.connectionstring); - - if (this.commandEnabled) { - azureClient = receiveMessages("0"); - } - } - - public void sendItemUpdate(String deviceId, String state) { - AzureDevice device; - try { - device = azureDeviceStore.getDevice(deviceId); - } catch (Exception e) { - logger.error("Failed to obtain azure device", e); - return; - } - - setItemState(device, state); - } - - private void setItemState(AzureDevice azureDevice, String state) { - AzureEventCallback callback = new AzureEventCallback(); - - Device device = azureDevice.getDevice(); - if (device == null) { - logger.error("Invalid device connection for device, can not send item state update"); - return; - } - - JsonObject datapoint = new JsonObject(); - datapoint.addProperty(DATAPOINT_DEVICE_ID, device.getDeviceId()); - datapoint.addProperty(DATAPOINT_VALUE, state); - - Message msg = new Message(gson.toJson(datapoint)); - - azureDevice.sendMessage(msg, callback, lockobj); - - synchronized (lockobj) { - try { - lockobj.wait(); - } catch (InterruptedException e) { - // done - } - } - } - - public void shutdown() { - if (azureClient != null) { - try { - azureClient.closeSync(); - } catch (ServiceBusException e) { - logger.warn("failed to close IoT client", e); - } - } - } - - private EventHubClient receiveMessages(final String partitionId) throws ServiceBusException, IOException { - EventHubClient client = null; - client = EventHubClient.createFromConnectionStringSync(this.connectionstring); - client.createReceiver(EventHubClient.DEFAULT_CONSUMER_GROUP_NAME, partitionId, Instant.now()) - .thenAccept(new Consumer() { - @Override - public void accept(PartitionReceiver receiver) { - logger.debug("Created IOT Hub receiver on partition {}", partitionId); - try { - while (true) { - Iterable receivedEvents = receiver.receive(100).get(); - processReceivedEvents(partitionId, receivedEvents); - } - } catch (Exception e) { - logger.debug("Failed to receive messages ", e); - } - } - - }); - return client; - } - - private void processReceivedEvents(final String partitionId, Iterable receivedEvents) { - int batchSize = 0; - if (receivedEvents != null) { - for (EventData receivedEvent : receivedEvents) { - logger.debug("Offset: {}, SeqNo: {}, EnqueueTime: {}", receivedEvent.getSystemProperties().getOffset(), - receivedEvent.getSystemProperties().getSequenceNumber(), - receivedEvent.getSystemProperties().getEnqueuedTime()); - String itemName = receivedEvent.getSystemProperties().get("iothub-connection-device-id").toString(); - logger.debug("| device ID: {}", itemName); - String payload = new String(receivedEvent.getBytes(), Charset.defaultCharset()); - logger.debug("| Message Payload: {}", payload); - eventPublisher.post(ItemEventFactory.createCommandEvent(itemName, new StringType(payload))); - batchSize++; - } - } - logger.debug("Partition: {}, ReceivedBatch Size: {}", partitionId, batchSize); - } -} diff --git a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudService.java b/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudService.java deleted file mode 100644 index 877aed1413ad4..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/java/org/openhab/io/internal/azureiothub/CloudService.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Copyright (c) 2010-2019 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.io.internal.azureiothub; - -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import org.eclipse.smarthome.core.events.Event; -import org.eclipse.smarthome.core.events.EventFilter; -import org.eclipse.smarthome.core.events.EventPublisher; -import org.eclipse.smarthome.core.events.EventSubscriber; -import org.eclipse.smarthome.core.items.ItemRegistry; -import org.eclipse.smarthome.core.items.events.ItemStateEvent; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; -import org.osgi.service.component.annotations.Reference; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class starts the cloud connection service and implements interface to communicate with the cloud. - * - * @author Niko Tanghe - Initial contribution - * - */ -@Component(immediate = true, configurationPid = "org.openhab.azureiothub", property = { - "service.pid=org.openhab.azureiothub", "service.config.description.uri=io:azureiothub", - "service.config.label=Azure IoT Hub", "service.config.category=io" }) -public class CloudService implements EventSubscriber { - - private static final String CFG_MODE = "mode"; - private static final String CFG_CONNECTIONSTRING = "connectionstring"; - - private Logger logger = LoggerFactory.getLogger(CloudService.class); - - public static String clientVersion; - private CloudClient cloudClient; - - protected ItemRegistry itemRegistry; - protected EventPublisher eventPublisher; - - @Override - public Set getSubscribedEventTypes() { - return Collections.singleton(ItemStateEvent.TYPE); - } - - @Override - public EventFilter getEventFilter() { - return null; - } - - @Reference - public void setItemRegistry(ItemRegistry itemRegistry) { - this.itemRegistry = itemRegistry; - } - - public void unsetItemRegistry(ItemRegistry itemRegistry) { - this.itemRegistry = null; - } - - @Reference - public void setEventPublisher(EventPublisher eventPublisher) { - this.eventPublisher = eventPublisher; - } - - public void unsetEventPublisher(EventPublisher eventPublisher) { - this.eventPublisher = null; - } - - @Override - public void receive(Event event) { - ItemStateEvent ise = (ItemStateEvent) event; - if (cloudClient != null) { - cloudClient.sendItemUpdate(ise.getItemName(), ise.getItemState().toString()); - } - } - - @Activate - protected void activate(BundleContext context, Map config) { - String connectionstring = ""; - if (config.get(CFG_CONNECTIONSTRING) != null) { - connectionstring = (String) config.get(CFG_CONNECTIONSTRING); - } else { - logger.error("Azure IoT client not started, could not get connectionstring config setting"); - } - - boolean commandEnabled = false; - if (config.get(CFG_MODE) != null) { - commandEnabled = "remote".equals(config.get(CFG_MODE)); - } else { - logger.debug("remoteAccessEnabled is not set, keeping value '{}'", commandEnabled); - } - - if (connectionstring != null && !connectionstring.isEmpty()) { - try { - cloudClient = new CloudClient(connectionstring, commandEnabled, eventPublisher); - logger.debug("Azure IoT Hub connector activated"); - } catch (Exception e) { - logger.error("Failed to setup Azure IoT Hub client"); - } - } else { - logger.error("Azure IoT client not started, connectionstring config setting is empty"); - } - } - - @Deactivate - protected void deactivate() { - logger.debug("Azure IoT Hub connector deactivated"); - if (cloudClient != null) { - cloudClient.shutdown(); - } - } -} diff --git a/bundles/org.openhab.io.azureiothub/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.io.azureiothub/src/main/resources/ESH-INF/config/config.xml deleted file mode 100644 index 084dbf1da6d53..0000000000000 --- a/bundles/org.openhab.io.azureiothub/src/main/resources/ESH-INF/config/config.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Type of communication to be used with the Azure IoT Hub. - - - - - publishcommand - - - - The "connectionstring" for authenticating against the Azure IoT Hub. - true - false - - - \ No newline at end of file diff --git a/bundles/org.openhab.io.homekit/.classpath b/bundles/org.openhab.io.homekit/.classpath index ddccff7fe1766..a5d95095ccaaf 100644 --- a/bundles/org.openhab.io.homekit/.classpath +++ b/bundles/org.openhab.io.homekit/.classpath @@ -29,5 +29,4 @@
- diff --git a/bundles/org.openhab.io.homekit/NOTICE b/bundles/org.openhab.io.homekit/NOTICE index 2563440cb421b..f7cba479f6797 100644 --- a/bundles/org.openhab.io.homekit/NOTICE +++ b/bundles/org.openhab.io.homekit/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.io.homekit/README.md b/bundles/org.openhab.io.homekit/README.md index 6aa99d4b12fcc..c37189245e10e 100644 --- a/bundles/org.openhab.io.homekit/README.md +++ b/bundles/org.openhab.io.homekit/README.md @@ -17,7 +17,7 @@ This will be used in iOS when pairing. The pin code is in the form "###-##-###". Requirements beyond this are not clear, and Apple enforces limitations on eligible pins within iOS. At the very least, you cannot use repeating (111-11-111) or sequential (123-45-678) pin codes. If your home network is secure, a good starting point is the pin code used in most sample applications: 031-45-154. -Check for typos in the pin-code if you encounter "Bad Client Credential" errors during pairing. +Check for typos in the pin-code if you encounter "Bad Client Credential" errors during pairing. Other settings, such as using Fahrenheit temperatures, customizing the thermostat heat/cool/auto modes, and specifying the interface to advertise the HomeKit bridge (which can be edited in Paper UI standard mode) are also illustrated in the following sample: @@ -44,7 +44,7 @@ org.openhab.homekit:maximumTemperature=100 | Setting | Description | Default value | |-------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |--------------- | -| networkInterface | IP address or domain name under which the HomeKit bridge can be reached. If no value is configured, the addon uses the first network adapter address. | (none) | +| networkInterface | IP address or domain name under which the HomeKit bridge can be reached. If no value is configured, the add-on uses the first network adapter address. | (none) | | port | Port under which the HomeKit bridge can be reached. | 9123 | | pin | Pin code used for pairing with iOS devices. Apparently, pin codes are provided by Apple and represent specific device types, so they cannot be chosen freely. The pin code 031-45-154 is used in sample applications and known to work. | 031-45-154 | | useFahrenheitTemperature | Set to true to use Fahrenheit degrees, or false to use Celsius degrees. | false | @@ -107,7 +107,7 @@ If you register an IP address that isn't reachable from your phone (such as `loc HomeKit allows only a single pairing to be established with the bridge. This pairing is normally shared across devices via iCloud. -If you need to establish a new pairing, you'll need to clear the existing pairings. +If you need to establish a new pairing, you will need to clear the existing pairings. To do this, you can issue the command `smarthome:homekit clearPairings` from the [OSGi console](https://www.openhab.org/docs/administration/console.html). After doing this, you may need to remove the file `$OPENHAB_USERDATA/jsondb/homekit.json` and restart openHAB. diff --git a/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT-sources.jar b/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT-sources.jar deleted file mode 100644 index e36d6a254fbbf..0000000000000 Binary files a/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT-sources.jar and /dev/null differ diff --git a/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT.jar b/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT.jar deleted file mode 100644 index a120249f34ecc..0000000000000 Binary files a/bundles/org.openhab.io.homekit/lib/hap-1.1.5-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.io.homekit/pom.xml b/bundles/org.openhab.io.homekit/pom.xml index 50ea9eb6e734e..de74740f8f365 100644 --- a/bundles/org.openhab.io.homekit/pom.xml +++ b/bundles/org.openhab.io.homekit/pom.xml @@ -1,96 +1,106 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.homekit openHAB Add-ons :: Bundles :: IO :: Homekit + + javax.json,javax.json-api,netty-common,netty-buffer,netty-transport,netty-handler,netty-codec,netty-codec-http,netty-resolver + 4.1.42.Final + + + + io.github.hap-java + hap + 1.2.0.OH + compile + org.glassfish javax.json 1.0.4 - provided + compile javax.json javax.json-api 1.0 - provided + compile io.netty netty-common - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-buffer - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-transport - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-handler - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-codec - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-codec-http - 4.1.34.Final - provided + ${netty.version} + compile io.netty netty-resolver - 4.1.34.Final - provided + ${netty.version} + compile - org.openhab.osgiify - com.nimbusds.srp6a + com.nimbusds + srp6a 1.5.2 - provided + compile - org.openhab.osgiify - net.vrallev.ecc.ecc-25519-java + net.vrallev.ecc + ecc-25519-java 1.0.1 - provided + compile org.bouncycastle bcprov-jdk15on 1.51 - provided + compile - org.openhab.osgiify - org.zeromq.curve25519-java + org.zeromq + curve25519-java 0.1.0 - provided + compile diff --git a/bundles/org.openhab.io.homekit/src/main/feature/feature.xml b/bundles/org.openhab.io.homekit/src/main/feature/feature.xml index 978dd27def6c9..2f658a7eb71d0 100644 --- a/bundles/org.openhab.io.homekit/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.homekit/src/main/feature/feature.xml @@ -1,23 +1,13 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base openhab-transport-mdns + openhab.tp-netty mvn:org.glassfish/javax.json/1.0.4 mvn:javax.json/javax.json-api/1.0 - mvn:org.bouncycastle/bcprov-jdk15on/1.51 - mvn:io.netty/netty-common/4.1.34.Final - mvn:io.netty/netty-buffer/4.1.34.Final - mvn:io.netty/netty-transport/4.1.34.Final - mvn:io.netty/netty-handler/4.1.34.Final - mvn:io.netty/netty-codec/4.1.34.Final - mvn:io.netty/netty-codec-http/4.1.34.Final - mvn:io.netty/netty-resolver/4.1.34.Final - mvn:org.openhab.osgiify/com.nimbusds.srp6a/1.5.2 - mvn:org.openhab.osgiify/net.vrallev.ecc.ecc-25519-java/1.0.1 - mvn:org.openhab.osgiify/org.zeromq.curve25519-java/0.1.0 mvn:org.openhab.addons.bundles/org.openhab.io.homekit/${project.version} diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/Homekit.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/Homekit.java index b73506c212fef..b18205fc44a9a 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/Homekit.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/Homekit.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/Debouncer.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/Debouncer.java index 540a974f6ccf3..9f1e7a34184e7 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/Debouncer.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/Debouncer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryRegistry.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryRegistry.java index 5e100a8afc9b8..67617b2eecc19 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryRegistry.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,8 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitAccessory; -import com.beowulfe.hap.HomekitRoot; +import io.github.hapjava.HomekitAccessory; +import io.github.hapjava.HomekitRoot; /** * Stores the created HomekitAccessories. GroupedAccessories are also held here diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryType.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryType.java index afd8f1091c5a5..9b319fedda989 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryType.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryUpdater.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryUpdater.java index a4e257c9504cc..ae16eb266b615 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryUpdater.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryUpdater.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,7 +22,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; +import io.github.hapjava.HomekitCharacteristicChangeCallback; /** * Subscribes and unsubscribes from Item changes to enable notification to Homekit diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java index d764b170b1e06..841475eb328f2 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,8 +23,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitAuthInfo; -import com.beowulfe.hap.HomekitServer; +import io.github.hapjava.HomekitAuthInfo; +import io.github.hapjava.HomekitServer; /** * Provides a mechanism to store authenticated homekit client details inside the diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java index d40dc4906dcd8..c121d4e2b601f 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitChangeListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -31,7 +31,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitRoot; +import io.github.hapjava.HomekitRoot; /** * Listens for changes to the item registry. When changes are detected, check diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCharacteristicType.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCharacteristicType.java index 908d0644787f5..7a683c35523d1 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCharacteristicType.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCharacteristicType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCommandExtension.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCommandExtension.java index d99353fc23cfa..146de26b88316 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCommandExtension.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitCommandExtension.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitDeviceType.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitDeviceType.java index 0f88e181af2c7..6d337a10f9b2f 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitDeviceType.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitDeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitException.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitException.java index c9eb1825f78a7..71c722f01f26e 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitException.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java index 4da38f7de0b8f..13a4107b299a8 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,8 +36,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitRoot; -import com.beowulfe.hap.HomekitServer; +import io.github.hapjava.HomekitRoot; +import io.github.hapjava.HomekitServer; /** * Provides access to openHAB items via the Homekit API diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitSettings.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitSettings.java index a77191b0b53ea..583435aae3c77 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitSettings.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitSettings.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java index 4ee26376405ae..e481b3b9a2c0c 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -172,7 +172,7 @@ private int calculateId(Item item) { if (CREATED_ACCESSORY_IDS.containsKey(id)) { if (!CREATED_ACCESSORY_IDS.get(id).equals(item.getName())) { logger.warn( - "Could not create homekit accessory {} because its hash conflicts with {}. This is a 1:1,000,000 chance occurrence. Change one of the names and consider playing the lottery. See https://github.com/openhab/openhab2-addons/issues/257#issuecomment-125886562", + "Could not create homekit accessory {} because its hash conflicts with {}. This is a 1:1,000,000 chance occurrence. Change one of the names and consider playing the lottery. See https://github.com/openhab/openhab-addons/issues/257#issuecomment-125886562", item.getName(), CREATED_ACCESSORY_IDS.get(id)); return 0; } diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java index fdbe52e204dda..705f78e2df98b 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitAccessoryImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,7 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitAccessory; +import io.github.hapjava.HomekitAccessory; /** * Abstract class for HomekitAccessory implementations, this provides the diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitLightbulbImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitLightbulbImpl.java index cf182467f6e3e..91ae7bde43c2e 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitLightbulbImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractHomekitLightbulbImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,8 +22,8 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.Lightbulb; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.Lightbulb; /** * Abstract class implementing a Homekit Lightbulb using a SwitchItem diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractTemperatureHomekitAccessoryImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractTemperatureHomekitAccessoryImpl.java index 0312db72c1be1..32d667e095e96 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractTemperatureHomekitAccessoryImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/AbstractTemperatureHomekitAccessoryImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,8 +18,8 @@ import org.openhab.io.homekit.internal.HomekitSettings; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.accessories.TemperatureSensor; -import com.beowulfe.hap.accessories.properties.TemperatureUnit; +import io.github.hapjava.accessories.TemperatureSensor; +import io.github.hapjava.accessories.properties.TemperatureUnit; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/BooleanItemReader.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/BooleanItemReader.java index 02d5d8d267a4f..7a1edae5928fd 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/BooleanItemReader.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/BooleanItemReader.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/GroupedAccessory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/GroupedAccessory.java index 999e546cb3b4a..27f2ed7fa67ae 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/GroupedAccessory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/GroupedAccessory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -14,7 +14,7 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitAccessory; +import io.github.hapjava.HomekitAccessory; /** * An accessory that is too complex to be represented by a single item. A diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java index 6a3d1380d2dbf..91d69acfaeb97 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitAccessoryFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -30,7 +30,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitAccessory; +import io.github.hapjava.HomekitAccessory; /** * Creates a HomekitAccessory for a given HomekitTaggedItem. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonMonoxideSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonMonoxideSensorImpl.java index c7f0a45713098..4339383d25da4 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonMonoxideSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCarbonMonoxideSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,10 +23,10 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.CarbonMonoxideSensor; -import com.beowulfe.hap.accessories.properties.CarbonMonoxideDetectedState; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.CarbonMonoxideSensor; +import io.github.hapjava.accessories.properties.CarbonMonoxideDetectedState; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitColorfulLightbulbImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitColorfulLightbulbImpl.java index 0e493f0e37fc4..f2e135f12a70b 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitColorfulLightbulbImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitColorfulLightbulbImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,9 +23,9 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.ColorfulLightbulb; -import com.beowulfe.hap.accessories.DimmableLightbulb; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.ColorfulLightbulb; +import io.github.hapjava.accessories.DimmableLightbulb; /** * Implements ColorfulLightBulb using an Item that provides a On/Off and color state diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitContactSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitContactSensorImpl.java index e0b552d14da32..fd6d38072564a 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitContactSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitContactSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,10 +22,10 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.ContactSensor; -import com.beowulfe.hap.accessories.properties.ContactState; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.ContactSensor; +import io.github.hapjava.accessories.properties.ContactState; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDimmableLightbulbImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDimmableLightbulbImpl.java index 6d37c464f9f3f..97722ce1e1de0 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDimmableLightbulbImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitDimmableLightbulbImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,8 +23,8 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.DimmableLightbulb; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.DimmableLightbulb; /** * Implements DimmableLightBulb using an Item that provides a On/Off and Percent state. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHumiditySensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHumiditySensorImpl.java index 0ff54a0a4a5be..388d07eb2a741 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHumiditySensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitHumiditySensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,8 +20,8 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.HumiditySensor; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.HumiditySensor; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLeakSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLeakSensorImpl.java index 72ecec59911cc..8030fd840e64f 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLeakSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLeakSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,9 +23,9 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.LeakSensor; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.LeakSensor; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightbulbImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightbulbImpl.java index e89e742cfdff4..86a221e08037c 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightbulbImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitLightbulbImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMotionSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMotionSensorImpl.java index 25f6f5e71cc03..61f2d3cf7186c 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMotionSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitMotionSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,9 +22,9 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.MotionSensor; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.MotionSensor; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOccupancySensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOccupancySensorImpl.java index 81eab4c0a126f..aa4fb2c64dac8 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOccupancySensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitOccupancySensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,9 +22,9 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.OccupancySensor; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.OccupancySensor; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmokeSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmokeSensorImpl.java index bb6b1be6739ff..e8efb734d68cc 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmokeSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSmokeSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,10 +23,10 @@ import org.openhab.io.homekit.internal.HomekitTaggedItem; import org.openhab.io.homekit.internal.battery.BatteryStatus; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BatteryStatusAccessory; -import com.beowulfe.hap.accessories.SmokeSensor; -import com.beowulfe.hap.accessories.properties.SmokeDetectedState; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BatteryStatusAccessory; +import io.github.hapjava.accessories.SmokeSensor; +import io.github.hapjava.accessories.properties.SmokeDetectedState; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSwitchImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSwitchImpl.java index 985ee634f9145..796e552e2d25d 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSwitchImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitSwitchImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,8 +22,8 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.Switch; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.Switch; /** * Implements Switch using an Item that provides an On/Off state. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTemperatureSensorImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTemperatureSensorImpl.java index 8dd2395b1c3ca..c3e18c566fef0 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTemperatureSensorImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitTemperatureSensorImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,8 +21,8 @@ import org.openhab.io.homekit.internal.HomekitSettings; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.TemperatureSensor; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.TemperatureSensor; /** * Implements a Homekit TemperatureSensor using a NumberItem diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java index badad7d47fc97..deb64643658f4 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitThermostatImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -35,9 +35,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.properties.ThermostatMode; -import com.beowulfe.hap.accessories.thermostat.BasicThermostat; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.properties.ThermostatMode; +import io.github.hapjava.accessories.thermostat.BasicThermostat; /** * Implements Thermostat as a GroupedAccessory made up of multiple items: diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitValveImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitValveImpl.java index 9b7eaf5a98029..ca76890f1805a 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitValveImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitValveImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,9 +21,9 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.Valve; -import com.beowulfe.hap.accessories.properties.ValveType; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.Valve; +import io.github.hapjava.accessories.properties.ValveType; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowCoveringImpl.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowCoveringImpl.java index ad09ff510234e..c893f449c8784 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowCoveringImpl.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitWindowCoveringImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,9 +20,9 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitTaggedItem; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; -import com.beowulfe.hap.accessories.BasicWindowCovering; -import com.beowulfe.hap.accessories.properties.WindowCoveringPositionState; +import io.github.hapjava.HomekitCharacteristicChangeCallback; +import io.github.hapjava.accessories.BasicWindowCovering; +import io.github.hapjava.accessories.properties.WindowCoveringPositionState; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/IncompleteAccessoryException.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/IncompleteAccessoryException.java index 80c6ab3e78342..184f735d6ba2e 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/IncompleteAccessoryException.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/IncompleteAccessoryException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLevelStatus.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLevelStatus.java index 9d5c7f08d13b4..38031e5de72e5 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLevelStatus.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLevelStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ import org.eclipse.smarthome.core.library.types.DecimalType; import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; +import io.github.hapjava.HomekitCharacteristicChangeCallback; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLowStatus.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLowStatus.java index 308729ee74b48..71b5b727b7353 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLowStatus.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryLowStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,7 +18,7 @@ import org.eclipse.smarthome.core.library.types.OnOffType; import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; +import io.github.hapjava.HomekitCharacteristicChangeCallback; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryStatus.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryStatus.java index be62135ac12b9..27fb3fb5dddd0 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryStatus.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/BatteryStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,7 +22,7 @@ import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; import org.openhab.io.homekit.internal.HomekitCharacteristicType; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; +import io.github.hapjava.HomekitCharacteristicChangeCallback; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/NoBatteryStatus.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/NoBatteryStatus.java index 814d91094b006..e4bcb8b3e1aee 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/NoBatteryStatus.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/battery/NoBatteryStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,7 +16,7 @@ import org.eclipse.jdt.annotation.Nullable; import org.openhab.io.homekit.internal.HomekitAccessoryUpdater; -import com.beowulfe.hap.HomekitCharacteristicChangeCallback; +import io.github.hapjava.HomekitCharacteristicChangeCallback; /** * diff --git a/bundles/org.openhab.io.homekit/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.io.homekit/src/main/resources/ESH-INF/config/config.xml index 2e41fb4be00c0..55bd681453d39 100644 --- a/bundles/org.openhab.io.homekit/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.io.homekit/src/main/resources/ESH-INF/config/config.xml @@ -7,18 +7,18 @@ - + - + General thermostat settings - + String values used by your thermostat to set different targetHeatingCooling modes - + String values used by your thermostat to set different targetHeatingCooling modes diff --git a/bundles/org.openhab.io.hueemulation/NOTICE b/bundles/org.openhab.io.hueemulation/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.hueemulation/NOTICE +++ b/bundles/org.openhab.io.hueemulation/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.hueemulation/README.md b/bundles/org.openhab.io.hueemulation/README.md index b5c87baf26036..6671f9e7d8159 100644 --- a/bundles/org.openhab.io.hueemulation/README.md +++ b/bundles/org.openhab.io.hueemulation/README.md @@ -32,6 +32,7 @@ By default the pairing mode disables itself after 1 minute (can be configured). It is important to note that you are exposing *Items* not *Things* or *Channels*. Only Color, Dimmer, Rollershutter, Switch and Group type *Items* are supported. +Group type items require the "Huelight" tag to be exposed as devices instead of Groups. This service can emulate 3 different devices: @@ -104,7 +105,7 @@ Permanent V1 bridge emulation (no obvious reason to enable that): org.openhab.hueemulation:permanentV1bridge=false ``` -The hue emulation service will announce its existence via UPNP on every +The hue emulation service will announce its existence via UPnP on every of the openHAB configured primary addresses (IPv4 and IPv6). Usually you do not want to set this option, but change the primary address configuration of openHAB. diff --git a/bundles/org.openhab.io.hueemulation/noEmbedDependencies.profile b/bundles/org.openhab.io.hueemulation/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.io.hueemulation/pom.xml b/bundles/org.openhab.io.hueemulation/pom.xml index 8fe5b8768fd32..69d7b73d5092a 100644 --- a/bundles/org.openhab.io.hueemulation/pom.xml +++ b/bundles/org.openhab.io.hueemulation/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.hueemulation @@ -53,7 +52,7 @@ org.jupnp org.jupnp 2.5.2 - provided + compile
diff --git a/bundles/org.openhab.io.hueemulation/src/main/feature/feature.xml b/bundles/org.openhab.io.hueemulation/src/main/feature/feature.xml index 57620a4cc7001..2b3db1b14baa9 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.hueemulation/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java index c3c7df3b54cfc..ad0f0ffe1c5ad 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java index fdb0a256f4b2c..546b304d2e914 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/ConfigStore.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/DeviceType.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/DeviceType.java index 57e2e5b2c3e57..0b1451c957c99 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/DeviceType.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationConfig.java index c2cfbdd5902ab..b146b288f2b0d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java index bb500ab29e4cf..68623f35208e5 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,13 +17,17 @@ import javax.servlet.ServletException; import javax.ws.rs.ApplicationPath; +import javax.ws.rs.HttpMethod; import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerRequestFilter; import javax.ws.rs.container.ContainerResponseContext; import javax.ws.rs.container.ContainerResponseFilter; +import javax.ws.rs.container.PreMatching; import javax.ws.rs.core.Application; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.http.HttpHeader; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.server.ServerProperties; import org.glassfish.jersey.servlet.ServletContainer; @@ -83,6 +87,21 @@ public static class JerseyApplication extends Application { } + @PreMatching + public class RequestInterceptor implements ContainerRequestFilter { + @NonNullByDefault({}) + @Override + public void filter(ContainerRequestContext requestContext) { + /** + * Jetty returns 415 on any GET request if a client sends the Content-Type header. + * This is a workaround - stripping it away in the preMatching stage. + */ + if (requestContext.getMethod() == HttpMethod.GET && requestContext.getHeaders().containsKey(HttpHeader.CONTENT_TYPE.asString())){ + requestContext.getHeaders().remove(HttpHeader.CONTENT_TYPE.asString()); + } + } + } + public class LogAccessInterceptor implements ContainerResponseFilter { @NonNullByDefault({}) @Override @@ -97,6 +116,7 @@ public void filter(ContainerRequestContext requestContext, ContainerResponseCont } + private final ContainerRequestFilter requestCleaner = new RequestInterceptor(); private final Logger logger = LoggerFactory.getLogger(HueEmulationService.class); private final LogAccessInterceptor accessInterceptor = new LogAccessInterceptor(); @@ -181,7 +201,7 @@ public void handleEvent(@Nullable Event event) { resourceConfig.property(ServerProperties.PROCESSING_RESPONSE_ERRORS_ENABLED, true); resourceConfig.registerInstances(userManagement, configurationAccess, lightItems, sensors, scenes, schedules, - rules, statusResource, accessInterceptor); + rules, statusResource, accessInterceptor, requestCleaner); try { Hashtable initParams = new Hashtable<>(); diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/NetworkUtils.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/NetworkUtils.java index ffb46e93c6fb0..c451ebb64d2b0 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/NetworkUtils.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/NetworkUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/RuleUtils.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/RuleUtils.java index e25c080e1500a..ba1cbd2718f85 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/RuleUtils.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/RuleUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java index 171adaa868bf0..751b43c47f84d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/WriteConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/WriteConfig.java index bc587b546a17b..cf3ce2c44f09d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/WriteConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/WriteConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/AbsoluteDateTimeTriggerHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/AbsoluteDateTimeTriggerHandler.java index 10f2b5f1590ad..0bd41922051bf 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/AbsoluteDateTimeTriggerHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/AbsoluteDateTimeTriggerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HttpActionHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HttpActionHandler.java index 2a59b24ff2012..b67e78383f90a 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HttpActionHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HttpActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueHandlerFactory.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueHandlerFactory.java index 63156ef52ec61..42c1df143c458 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueHandlerFactory.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueRuleConditionHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueRuleConditionHandler.java index 8256739cfb08e..bc4d40cae09d3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueRuleConditionHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/HueRuleConditionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RemoveRuleActionHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RemoveRuleActionHandler.java index c7286b1bec280..4963b184cbd99 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RemoveRuleActionHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RemoveRuleActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RulesHandlerFactory.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RulesHandlerFactory.java index 3af1212bdbf07..77091edb6d729 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RulesHandlerFactory.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/RulesHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerModuleExHandlerFactory.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerModuleExHandlerFactory.java index ca9d345f88cda..ff5851149bf57 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerModuleExHandlerFactory.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerModuleExHandlerFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java index 4d56fb1e4f116..cdf748916c5a8 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/HueRuleTriggerConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/HueRuleTriggerConfig.java index 2678aeec864c6..f19c3ad6197f3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/HueRuleTriggerConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/HueRuleTriggerConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/ItemCommandActionConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/ItemCommandActionConfig.java index 5de274f9ae051..38099e9343452 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/ItemCommandActionConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/dto/ItemCommandActionConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/AbstractHueState.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/AbstractHueState.java index 5bb112d7dcf94..5754324120e59 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/AbstractHueState.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/AbstractHueState.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueAuthorizedConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueAuthorizedConfig.java index d564a3f40e977..2d25a16b18ee3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueAuthorizedConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueAuthorizedConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueCapability.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueCapability.java index d17d9b727421d..a7d6b97d583e0 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueCapability.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueCapability.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueDataStore.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueDataStore.java index 1f3e56634d9e6..f4c76dc6682da 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueDataStore.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueDataStore.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueGroupEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueGroupEntry.java index 8a2a883c521e5..c61fff225688a 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueGroupEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueGroupEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueLightEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueLightEntry.java index 95474aaf8000f..0c83ad0c7c6dc 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueLightEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueLightEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueNewLights.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueNewLights.java index 38c0e33b750e9..16fc563addc19 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueNewLights.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueNewLights.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueRuleEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueRuleEntry.java index 6a6bc558b7946..8b29101e130a0 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueRuleEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueRuleEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneEntry.java index e5a6ab78e34c9..93b99bfb94776 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneWithLightstates.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneWithLightstates.java index ae77db63784ec..990c65ea1615e 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneWithLightstates.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSceneWithLightstates.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueScheduleEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueScheduleEntry.java index b38b17e58cf54..bdc291060082f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueScheduleEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueScheduleEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSensorEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSensorEntry.java index fa9015d62c907..16d71505b040e 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSensorEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueSensorEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateBulb.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateBulb.java index 6503592048f0b..35166409a06e7 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateBulb.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateBulb.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,7 +22,7 @@ * */ public class HueStateBulb extends HueStatePlug { - // https://github.com/openhab/openhab2-addons/issues/2881 + // https://github.com/openhab/openhab-addons/issues/2881 // Apparently the maximum brightness is 254 public static int MAX_BRI = 254; public int bri = 0; diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateColorBulb.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateColorBulb.java index b313ffaed643a..eb403537d3b16 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateColorBulb.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStateColorBulb.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStatePlug.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStatePlug.java index b6b90b35c4ebf..4dbca562145b1 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStatePlug.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueStatePlug.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUnauthorizedConfig.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUnauthorizedConfig.java index 49493c1c223b7..3c9034be6c84d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUnauthorizedConfig.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUnauthorizedConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuth.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuth.java index 0b356d7352799..13207bf7349a3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuth.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuth.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuthWithSecrets.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuthWithSecrets.java index b6490beeb61ce..4fb6da4548644 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuthWithSecrets.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/HueUserAuthWithSecrets.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeRequest.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeRequest.java index bf7f5287c289a..34dc16fb84bba 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeRequest.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeSceneEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeSceneEntry.java index 0523dd0d4623a..09f3e09a6d8ee 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeSceneEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeSceneEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeScheduleEntry.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeScheduleEntry.java index 897a8ec834151..1ef8546a751c7 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeScheduleEntry.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueChangeScheduleEntry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCommand.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCommand.java index 6e1e3a67b148e..145467cbc3f9f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCommand.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCommand.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCreateUser.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCreateUser.java index 7a04b433aefd9..a1aa6538144a3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCreateUser.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueCreateUser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueStateChange.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueStateChange.java index a3018a9f21ab4..6a4330a8e545f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueStateChange.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/changerequest/HueStateChange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponse.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponse.java index 7a52ff3ece764..0ebf2521e058b 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponse.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponseSuccessSimple.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponseSuccessSimple.java index 4fb2308ecd869..eaccc29941e67 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponseSuccessSimple.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueResponseSuccessSimple.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessCreateGroup.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessCreateGroup.java index 884503cd9afb3..5cc577d876cfd 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessCreateGroup.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessCreateGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessGeneric.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessGeneric.java index a46c4ff9d292e..2ca584ac4849b 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessGeneric.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessGeneric.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponse.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponse.java index da6f29f2dfcae..a51700974818b 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponse.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseCreateUser.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseCreateUser.java index e93675b189a27..fbf02a2434d6c 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseCreateUser.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseCreateUser.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseStateChanged.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseStateChanged.java index 8e71d198f501b..97e76e0021fe7 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseStateChanged.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/dto/response/HueSuccessResponseStateChanged.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java index ac98825fdadf8..c815b4c0dbd88 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroups.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroups.java index 3aaf4f07505f8..971d63c3afb7f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroups.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroups.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -98,6 +98,7 @@ @Path("") @Produces(MediaType.APPLICATION_JSON) public class LightsAndGroups implements RegistryChangeListener { + public static final String EXPOSE_AS_DEVICE_TAG = "huelight"; private final Logger logger = LoggerFactory.getLogger(LightsAndGroups.class); private static final String ITEM_TYPE_GROUP = "Group"; private static final Set ALLOWED_ITEM_TYPES = Stream.of(CoreItemFactory.COLOR, CoreItemFactory.DIMMER, @@ -153,7 +154,7 @@ public synchronized void added(Item newElement) { String hueID = cs.mapItemUIDtoHueID(element); - if (element instanceof GroupItem) { + if (element instanceof GroupItem && !element.hasTag(EXPOSE_AS_DEVICE_TAG)) { GroupItem g = (GroupItem) element; HueGroupEntry group = new HueGroupEntry(g.getName(), g, deviceType); diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java index 6d719d67bc898..58fb1a87c3600 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java index 29c3ad4291805..63398376eac25 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java index 413e8bdb7e729..a6257f6660fd4 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Sensors.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Sensors.java index 7725b5e34cf21..3d22fec656b31 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Sensors.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Sensors.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/StatusResource.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/StatusResource.java index b7cdc3dcd76d8..cf2366d6dc95d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/StatusResource.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/StatusResource.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -262,4 +262,4 @@ public void afterShutdown() { selfTestUpnpFound = upnpStatus.service_not_registered; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/UserManagement.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/UserManagement.java index 6d122322ac872..ee44dbe5e406a 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/UserManagement.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/UserManagement.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/HueEmulationConfigWithRuntime.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/HueEmulationConfigWithRuntime.java index a2de10d0d0c6e..97d03ce22d053 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/HueEmulationConfigWithRuntime.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/HueEmulationConfigWithRuntime.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -60,10 +60,10 @@ class HueEmulationConfigWithRuntime extends Thread implements Runnable { address = InetAddress.getByName(addrString); if (address instanceof Inet6Address) { addressString = "[" + address.getHostAddress().split("%")[0] + "]"; - multicastAddress = MULTI_ADDR_IPV4; + multicastAddress = MULTI_ADDR_IPV6; } else { addressString = address.getHostAddress(); - multicastAddress = MULTI_ADDR_IPV6; + multicastAddress = MULTI_ADDR_IPV4; } port = config.discoveryHttpPort == 0 ? Integer.getInteger("org.osgi.service.http.port", 8080) @@ -79,10 +79,10 @@ class HueEmulationConfigWithRuntime extends Thread implements Runnable { address = InetAddress.getByName("localhost"); if (address instanceof Inet6Address) { addressString = "[" + address.getHostAddress().split("%")[0] + "]"; - multicastAddress = MULTI_ADDR_IPV4; + multicastAddress = MULTI_ADDR_IPV6; } else { addressString = address.getHostAddress(); - multicastAddress = MULTI_ADDR_IPV6; + multicastAddress = MULTI_ADDR_IPV4; } port = 8080; } @@ -127,4 +127,4 @@ public void dispose() { asyncIOselector = null; } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/SelfTestReport.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/SelfTestReport.java index b0cb9feab2a36..2c6126fd2de1d 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/SelfTestReport.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/SelfTestReport.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -38,4 +38,4 @@ public class SelfTestReport { public static SelfTestReport failed(String address) { return new SelfTestReport(address, false, false); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java index e43b62c3678b3..d6043aea5ad98 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -412,24 +412,23 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { boolean hasIPv4 = false; boolean hasIPv6 = false; - try ( - DatagramChannel channelV4 = DatagramChannel.open(StandardProtocolFamily.INET); - DatagramChannel channelV6 = DatagramChannel.open(StandardProtocolFamily.INET6); - Selector selector = Selector.open()) { + try ( Selector selector = Selector.open(); + DatagramChannel channelV4 = createBoundDataGramChannelOrNull(StandardProtocolFamily.INET); + DatagramChannel channelV6 = createBoundDataGramChannelOrNull(StandardProtocolFamily.INET6)) { + // Set global config to thread local config. Otherwise upnpAnnouncementThreadRunning() will report wrong results. + config = threadContext; threadContext.asyncIOselector = selector; - bind(channelV4); - bind(channelV6); for (InetAddress address : cs.getDiscoveryIps()) { NetworkInterface networkInterface = NetworkInterface.getByInetAddress(address); if (networkInterface == null) { continue; } - if (address instanceof Inet4Address) { + if (address instanceof Inet4Address && channelV4 != null) { channelV4.join(MULTI_ADDR_IPV4, networkInterface); hasIPv4 = true; - } else { + } else if (channelV6 != null){ channelV6.join(MULTI_ADDR_IPV6, networkInterface); hasIPv6 = true; } @@ -441,8 +440,6 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { return; } - - if (hasIPv4) { channelV4.configureBlocking(false); channelV4.register(selector, SelectionKey.OP_READ, new ClientRecord()); @@ -497,10 +494,16 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { } } - private void bind(DatagramChannel channel) throws IOException { - channel.setOption(StandardSocketOptions.SO_REUSEADDR, true) - .setOption(StandardSocketOptions.IP_MULTICAST_LOOP, true) - .bind(new InetSocketAddress(UPNP_PORT)); + @Nullable + private DatagramChannel createBoundDataGramChannelOrNull(StandardProtocolFamily family) throws IOException { + try { + return DatagramChannel.open(family) + .setOption(StandardSocketOptions.SO_REUSEADDR, true) + .setOption(StandardSocketOptions.IP_MULTICAST_LOOP, true) + .bind(new InetSocketAddress(UPNP_PORT)); + } catch (UnsupportedOperationException uoe) { + return null; + } } /** diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/AbsoluteDateTimeTrigger.json b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/AbsoluteDateTimeTrigger.json index 08c2e685092d5..3c2a8f6b85ac3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/AbsoluteDateTimeTrigger.json +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/AbsoluteDateTimeTrigger.json @@ -1,36 +1,36 @@ -{ - "triggers":[ - { - "uid":"timer.AbsoluteDateTimeTrigger", - "label":"Absolute date/time Trigger", - "description":"This triggers a rule based on a fixed date/time", - "visibility":"VISIBLE", - "configDescriptions":[ - { - "name":"date", - "type":"TEXT", - "context":"date", - "label":"Date", - "description":"A date with the pattern yyyy-mm-dd", - "required":false - }, - { - "name":"time", - "type":"TEXT", - "context":"time", - "label":"Time", - "description":"A time with the pattern hh:mm:ss", - "required":false - }, - { - "name":"randomizeTime", - "type":"TEXT", - "context":"time", - "label":"Randomized Time bound", - "description":"An upper time bound with the pattern hh:mm:ss. If this is given, the trigger triggers on a random time between Time and Randomized Time", - "required":false - } - ] - } - ] -} \ No newline at end of file +{ + "triggers": [ + { + "uid": "timer.AbsoluteDateTimeTrigger", + "label": "Absolute date/time Trigger", + "description": "This triggers a rule based on a fixed date/time", + "visibility": "VISIBLE", + "configDescriptions": [ + { + "name": "date", + "type": "TEXT", + "context": "date", + "label": "Date", + "description": "A date with the pattern yyyy-mm-dd", + "required": false + }, + { + "name": "time", + "type": "TEXT", + "context": "time", + "label": "Time", + "description": "A time with the pattern hh:mm:ss", + "required": false + }, + { + "name": "randomizeTime", + "type": "TEXT", + "context": "time", + "label": "Randomized Time bound", + "description": "An upper time bound with the pattern hh:mm:ss. If this is given, the trigger triggers on a random time between Time and Randomized Time", + "required": false + } + ] + } + ] +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HttpAction.json b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HttpAction.json index f02355bd6249e..394ba6dde57aa 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HttpAction.json +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HttpAction.json @@ -45,50 +45,50 @@ "description": "The url that the http request should be done on. Can be a relative one, starting with '/'. For example '/api/foo/bar'", "required": true }, - { - "name": "body", - "type": "TEXT", - "context": "body", - "label": "Data", - "description": "For post and put request you can send data with the request", - "required": false - }, - { - "name": "mimetype", - "type": "TEXT", - "context": "body", - "label": "Mimetype", - "description": "For post and put request you can send data with the request. Set the mimetype of that date here.", - "required": false, - "limitToOptions": false, - "options": [ - { - "label": "Text", - "value": "text/plain" - }, - { - "label": "Json", - "value": "application/json" - }, - { - "label": "XML", - "value": "application/xml" - }, - { - "label": "Binary", - "value": "application/octet-stream" - } - ] - }, - { - "name": "timeout", - "type": "INTEGER", - "label": "Timeout in sec", - "description": "The timeout of this request in seconds.", - "required": false, - "default": "5" - } + { + "name": "body", + "type": "TEXT", + "context": "body", + "label": "Data", + "description": "For post and put request you can send data with the request", + "required": false + }, + { + "name": "mimetype", + "type": "TEXT", + "context": "body", + "label": "Mimetype", + "description": "For post and put request you can send data with the request. Set the mimetype of that date here.", + "required": false, + "limitToOptions": false, + "options": [ + { + "label": "Text", + "value": "text/plain" + }, + { + "label": "Json", + "value": "application/json" + }, + { + "label": "XML", + "value": "application/xml" + }, + { + "label": "Binary", + "value": "application/octet-stream" + } + ] + }, + { + "name": "timeout", + "type": "INTEGER", + "label": "Timeout in sec", + "description": "The timeout of this request in seconds.", + "required": false, + "default": "5" + } ] } ] -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HueRuleCondition.json b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HueRuleCondition.json index 1853f16937e5e..c3c6e8b0ef53f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HueRuleCondition.json +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/HueRuleCondition.json @@ -26,22 +26,22 @@ "label": "Lower than", "value": "lt" }, - { - "label": "On item state change", - "value": "dx" - }, - { - "label": "On item state change, delayed", - "value": "ddx" - }, - { - "label": "Item has been updated but did not change", - "value": "stable" - }, - { - "label": "Item has been updated and has changed", - "value": "not_stable" - }, + { + "label": "On item state change", + "value": "dx" + }, + { + "label": "On item state change, delayed", + "value": "ddx" + }, + { + "label": "Item has been updated but did not change", + "value": "stable" + }, + { + "label": "Item has been updated and has changed", + "value": "not_stable" + }, { "label": "The current time is in range of the given time", "value": "in" @@ -69,4 +69,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/RemoveRuleAction.json b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/RemoveRuleAction.json index 4e956f1eb0b7b..45b0e4005e2ce 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/RemoveRuleAction.json +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/RemoveRuleAction.json @@ -1,20 +1,20 @@ -{ - "triggers":[ - { - "uid":"rules.RemoveRuleAction", - "label":"Remove rule", - "description":"Removes a rule permanently", - "visibility":"VISIBLE", - "configDescriptions":[ - { - "name":"removeuid", - "type":"TEXT", - "context":"rule", - "label":"Rule", - "description":"The rule that should be removed", - "required":true - } - ] - } - ] -} \ No newline at end of file +{ + "triggers": [ + { + "uid": "rules.RemoveRuleAction", + "label": "Remove rule", + "description": "Removes a rule permanently", + "visibility": "VISIBLE", + "configDescriptions": [ + { + "name": "removeuid", + "type": "TEXT", + "context": "rule", + "label": "Rule", + "description": "The rule that should be removed", + "required": true + } + ] + } + ] +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/TimerTrigger.json b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/TimerTrigger.json index 7772d5a002f23..92d82bbcd35fc 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/TimerTrigger.json +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/automation/moduletypes/TimerTrigger.json @@ -1,36 +1,36 @@ -{ - "triggers":[ - { - "uid":"timer.TimerTrigger", - "label":"Timer Trigger", - "description":"This triggers a rule based on a timer", - "visibility":"VISIBLE", - "configDescriptions":[ - { - "name":"time", - "type":"TEXT", - "context":"time", - "label":"Duration", - "description":"A duration before this timer expires with the pattern hh:mm:ss. The shortest duration is therefore 1 second, the longest is 99 hours.", - "required":true - }, - { - "name":"randomizeTime", - "type":"TEXT", - "context":"time", - "label":"Duration Upper Bound", - "description":"An optional upper bound duration before this timer expires with the pattern hh:mm:ss. A random duration between Duration and Duration Upper Bound will be chosen.", - "required":false - }, - { - "name":"repeat", - "type":"INTEGER", - "label":"Repeat", - "description":"You can make this timer a recurring timer by setting a value above 1. The default is 1. If you set a value below 0 like -1 this timer will be repeated indefinitely", - "default":"1", - "required":false - } - ] - } - ] -} \ No newline at end of file +{ + "triggers": [ + { + "uid": "timer.TimerTrigger", + "label": "Timer Trigger", + "description": "This triggers a rule based on a timer", + "visibility": "VISIBLE", + "configDescriptions": [ + { + "name": "time", + "type": "TEXT", + "context": "time", + "label": "Duration", + "description": "A duration before this timer expires with the pattern hh:mm:ss. The shortest duration is therefore 1 second, the longest is 99 hours.", + "required": true + }, + { + "name": "randomizeTime", + "type": "TEXT", + "context": "time", + "label": "Duration Upper Bound", + "description": "An optional upper bound duration before this timer expires with the pattern hh:mm:ss. A random duration between Duration and Duration Upper Bound will be chosen.", + "required": false + }, + { + "name": "repeat", + "type": "INTEGER", + "label": "Repeat", + "description": "You can make this timer a recurring timer by setting a value above 1. The default is 1. If you set a value below 0 like -1 this timer will be repeated indefinitely", + "default": "1", + "required": false + } + ] + } + ] +} diff --git a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/config/config.xml index 8474de87964fe..b82216a8944bd 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.io.hueemulation/src/main/resources/ESH-INF/config/config.xml @@ -11,59 +11,59 @@ false - + Pairing is automatically disabled after the given time in seconds. 60 true - + Set this option to create new users on the fly during the next pairing mode period. This helps with Amazon Echo device discovery. This option is automatically switched off after the timeout. false - - - Some Amazon Echos only support V1 bridges (round hardware bridge). This option is only active during discovery and automatically switched off after the timeout. - false - - - - There is no obvious reason to not emulate the newer bridge all the time, but here is the option if you want the old (round Hue bridge) to be emulated. - false - + + + Some Amazon Echos only support V1 bridges (round hardware bridge). This option is only active during discovery and automatically switched off after the timeout. + false + + + + There is no obvious reason to not emulate the newer bridge all the time, but here is the option if you want the old (round Hue bridge) to be emulated. + false + - + The HUE emulation can either publish Switch items if this is set to an empty string or filter items by tags. Use commas to separate multiple entries. Switchable - + The HUE emulation can either publish all Color items if this is set to an empty string or filter items by tags. Use commas to separate multiple entries. ColorLighting - + The HUE emulation can either publish all Dimmer items if this is set to an empty string or filter items by tags. Use commas to separate multiple entries. Lighting - - - All items that are tagged with the given tags are ignore by the Hue Emulation Service. Use commas to separate multiple entries. - internal - + + + All items that are tagged with the given tags are ignore by the Hue Emulation Service. Use commas to separate multiple entries. + internal + - + If your host has multiple IP addresses you may specify the IP you would like to advertise in the UPNP discovery process. You may safely leave this empty on most systems. - + Some Hue applications require a different port (80) then what openHAB runs on by default (8080). This option will only advertise a different port then what we are listening on. Useful if you have an iptables rule redirect traffic from this port to the openHAB port. true - - - Each Hue bridge has a universal unique id (UUID) assigned. This is random generated if no value has been assigned. Note on Amazon Alexa Echo devices: It might help to change the UUID after you have changed item ids. The Echos will recognize this service as a new bridge. - true - + + + Each Hue bridge has a universal unique id (UUID) assigned. This is random generated if no value has been assigned. Note on Amazon Alexa Echo devices: It might help to change the UUID after you have changed item ids. The Echos will recognize this service as a new bridge. + true + diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java index 28714d798a73a..ff738564b350b 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/CommonSetup.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/CommonSetup.java index 4fd265d296d29..393af81060c5c 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/CommonSetup.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/CommonSetup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -93,7 +93,7 @@ public Storage getStorage(String name) { if (name.equals("hueEmulationUsers")) { return (Storage) new DummyUsersStorage(); } - return null; + throw new IllegalStateException(); } }; diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ItemUIDtoHueIDMappingTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ItemUIDtoHueIDMappingTests.java index aa63db8506339..312e86d044401 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ItemUIDtoHueIDMappingTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ItemUIDtoHueIDMappingTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java index a80f9c8244eed..a9f5a29aa9141 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -126,6 +126,17 @@ public void addGroupSwitchableByTag() { assertThat(device.action, is(instanceOf(HueStatePlug.class))); } + @Test + public void addDeviceAsGroupSwitchableByTag() { + GroupItem item = new GroupItem("group1", new SwitchItem("switch1")); + item.addTag("Switchable"); + item.addTag("Huelight"); + itemRegistry.add(item); + HueLightEntry device = cs.ds.lights.get(cs.mapItemUIDtoHueID(item)); + assertThat(device.item, is(item)); + assertThat(device.state, is(instanceOf(HueStatePlug.class))); + } + @Test public void addGroupWithoutTypeByTag() { GroupItem item = new GroupItem("group1", null); diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/RulesTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/RulesTests.java index 828ef7deffb6e..c11ecf69029de 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/RulesTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/RulesTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SceneTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SceneTests.java index cefd8478e71be..2a9f6e715b9c6 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SceneTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SceneTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ScheduleTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ScheduleTests.java index d31f44960ec3f..be2e8781f3c5a 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ScheduleTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/ScheduleTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java index 7209a9bd0a933..57936ee249ef8 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java index 6d791725b9449..fbd5a245186c2 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/ConfigStoreWithoutMetadata.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/ConfigStoreWithoutMetadata.java index 4187741d660b2..6ae50d7041f3b 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/ConfigStoreWithoutMetadata.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/ConfigStoreWithoutMetadata.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -45,4 +45,4 @@ protected void determineHighestAssignedHueID() { } return item.getUID(); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java index 79981a19ab3c9..df0a264f66347 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -44,14 +44,13 @@ public Collection getAll() { return items.values(); } - @NonNullByDefault({}) @Override public Stream stream() { return items.values().stream(); } @Override - public @Nullable Item get(@Nullable String key) { + public @Nullable Item get(String key) { return items.get(key); } @@ -88,7 +87,7 @@ public Item add(Item element) { } @Override - public Item getItem(@Nullable String name) { + public Item getItem(String name) { return items.get(name); } @@ -112,19 +111,16 @@ public Collection getItems(String pattern) { return items.values(); } - @NonNullByDefault({}) @Override public Collection getItemsByTag(String... tags) { return items.values(); } - @NonNullByDefault({}) @Override public Collection getItemsByTagAndType(String type, String... tags) { return items.values(); } - @NonNullByDefault({}) @SuppressWarnings("unchecked") @Override public Collection getItemsByTag(Class typeFilter, String... tags) { @@ -140,13 +136,11 @@ public Collection getItemsByTag(Class typeFilter, String. return put; } - @NonNullByDefault({}) @Override public void addRegistryHook(RegistryHook hook) { } - @NonNullByDefault({}) @Override public void removeRegistryHook(RegistryHook hook) { diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java index ea582e256adc5..57ea98bd83f36 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java index 6e346e9701814..dff1bff8e6151 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyRuleRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyUsersStorage.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyUsersStorage.java index 3c7d95f01b841..21597ffacadd2 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyUsersStorage.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyUsersStorage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/upnp/UpnpTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/upnp/UpnpTests.java index eeacc90680b8b..668723322e246 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/upnp/UpnpTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/upnp/UpnpTests.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/NOTICE b/bundles/org.openhab.io.imperihome/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.imperihome/NOTICE +++ b/bundles/org.openhab.io.imperihome/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.imperihome/README.md b/bundles/org.openhab.io.imperihome/README.md index 58458f773dad1..1d63919ac9947 100644 --- a/bundles/org.openhab.io.imperihome/README.md +++ b/bundles/org.openhab.io.imperihome/README.md @@ -1,6 +1,6 @@ # ImperiHome integration service -This IO service exposes openHAB Items to the Evertygo [ImperiHome](http://www.evertygo.com/imperihome) dashboard app for Android and iOS. +This IO service exposes openHAB Items to the Evertygo [ImperiHome](https://imperihome.com/) dashboard app for Android and iOS. It creates a REST service at _/imperihome/iss_ that implements the [ImperiHome Standard System API](http://dev.evertygo.com/api/iss) (ISS). ## Installation @@ -66,14 +66,14 @@ For example: iss:room:Kitchen ``` -If you've defined your Items in _.items_ files, tags can be added using: +If you have defined your Items in _.items_ files, tags can be added using: ``` [ "mytag" ] ``` syntax (after the _(Groups)_ and before the _{channel}_). -If you created your items another way, e.g. using the Paper UI, [HABmin](https://github.com/openhab/org.openhab.ui.habmin) allows you to modify the tags. +If you created your items another way, e.g. using the Paper UI, [HABmin](/docs/configuration/ui/habmin/) allows you to modify the tags. ### Tag: _type_ @@ -117,7 +117,7 @@ iss:label:Kitchen light ### Tag: _mapping_ -Sets the mapping for a ImperiHome MultiSwitch device, just like an openHAB sitemap mapping does. +Sets the mapping for an ImperiHome MultiSwitch device, just like an openHAB sitemap mapping does. In the example below, 'All off', 'Relax' and 'Reading' will be visible in ImperiHome. Clicking one of the options will send a 0, 1 or 2 value command to the openHAB item. diff --git a/bundles/org.openhab.io.imperihome/pom.xml b/bundles/org.openhab.io.imperihome/pom.xml index b1e5317a03e5d..e2bb7e6f99f61 100644 --- a/bundles/org.openhab.io.imperihome/pom.xml +++ b/bundles/org.openhab.io.imperihome/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.imperihome diff --git a/bundles/org.openhab.io.imperihome/src/main/feature/feature.xml b/bundles/org.openhab.io.imperihome/src/main/feature/feature.xml index 80f89988b06db..d7b274a6dd619 100644 --- a/bundles/org.openhab.io.imperihome/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.imperihome/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java index 107f394e4175d..c110cc4b1c5a1 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeApiServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeConfig.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeConfig.java index fd19f3c42d3a5..967d04511ae82 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeConfig.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/ImperiHomeConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/Action.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/Action.java index 61e6212d9243f..f8c9b8fb3827b 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/Action.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/Action.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/ActionRegistry.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/ActionRegistry.java index 288134cba1f05..9c240aeefe240 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/ActionRegistry.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/ActionRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/LaunchSceneAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/LaunchSceneAction.java index a3729367c0113..3fa3d1ad87f4e 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/LaunchSceneAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/LaunchSceneAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetChoiceAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetChoiceAction.java index 6a97f254ca4f7..a221bf45cc8aa 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetChoiceAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetChoiceAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetColorAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetColorAction.java index a70d39648e5aa..a0568dda7b7af 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetColorAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetColorAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetLevelAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetLevelAction.java index 90a0f1e20cbfa..b37b22d38e648 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetLevelAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetLevelAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetModeAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetModeAction.java index 1732dbe6b3ca9..83fae1847f707 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetModeAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetModeAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetSetPointAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetSetPointAction.java index 9aac0a4d12745..510c2e2baa294 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetSetPointAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetSetPointAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetStatusAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetStatusAction.java index b8a2c7e095733..37a5f7385b996 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetStatusAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/SetStatusAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/StopShutterAction.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/StopShutterAction.java index b3062b36dadcc..06c88ede60011 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/StopShutterAction.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/action/StopShutterAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceActionHandler.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceActionHandler.java index e355482766f7b..51f7e6bddd394 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceActionHandler.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceActionHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceHistoryHandler.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceHistoryHandler.java index b73a7cb23937e..a8898842dd5d2 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceHistoryHandler.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DeviceHistoryHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DevicesListHandler.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DevicesListHandler.java index 8a5fffb0a48de..c03e90c611c3d 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DevicesListHandler.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/DevicesListHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/RoomListHandler.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/RoomListHandler.java index 633af1232b146..00c2775ad1491 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/RoomListHandler.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/RoomListHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/SystemHandler.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/SystemHandler.java index c45b44ddac800..aba38793e43a6 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/SystemHandler.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/handler/SystemHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceParametersSerializer.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceParametersSerializer.java index 4c935f4381329..33ecb364a2ac5 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceParametersSerializer.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceParametersSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceTypeSerializer.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceTypeSerializer.java index d98013ef7097d..5e39fd3f1f59a 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceTypeSerializer.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/DeviceTypeSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/ParamTypeSerializer.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/ParamTypeSerializer.java index cc82b60568ab3..530b2ba55bdac 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/ParamTypeSerializer.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/io/ParamTypeSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryItem.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryItem.java index a5c6800f02093..20067a92e385e 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryItem.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryList.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryList.java index b5ba80b5d82d0..eb31e243dc100 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryList.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/HistoryList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/Room.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/Room.java index 3ff0af41183b8..8985a3c89cef1 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/Room.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/Room.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/RoomList.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/RoomList.java index d7c2c9876a1e3..e36f60b5d007c 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/RoomList.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/RoomList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/System.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/System.java index 44edf35188fe9..eb81b15bb4a19 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/System.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/System.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractDevice.java index 827b66c78f01e..fa10c7ac6e32b 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractEnergyLinkDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractEnergyLinkDevice.java index 8a4df3cb8fa59..9f17253ed665d 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractEnergyLinkDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractEnergyLinkDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractNumericValueDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractNumericValueDevice.java index c135041a9ca30..5114d82e206f8 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractNumericValueDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/AbstractNumericValueDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/Co2SensorDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/Co2SensorDevice.java index 47feebb7bd5c8..bfa38f1850571 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/Co2SensorDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/Co2SensorDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceList.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceList.java index 22902e1fa52b2..85f26d555d698 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceList.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceList.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceType.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceType.java index 6eafcf705bd83..5798a6e0cf173 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceType.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DimmerDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DimmerDevice.java index 659506efdf83e..a6c80870a4859 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DimmerDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/DimmerDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ElectricityDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ElectricityDevice.java index aca36fcd0b8f4..3c3b3de4683a8 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ElectricityDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ElectricityDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/GenericSensorDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/GenericSensorDevice.java index 321d972f2c38d..9b8fc51c90077 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/GenericSensorDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/GenericSensorDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/HygrometryDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/HygrometryDevice.java index 3227758c91dbe..e7fd81a9aa7f6 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/HygrometryDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/HygrometryDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LockDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LockDevice.java index 1648e817e01e2..1099f3c502265 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LockDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LockDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LuminosityDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LuminosityDevice.java index cdc3a534a9b2f..83339336871bb 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LuminosityDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/LuminosityDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/MultiSwitchDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/MultiSwitchDevice.java index bc2444fa5a3e0..b5ef39f55ddc8 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/MultiSwitchDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/MultiSwitchDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/NoiseDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/NoiseDevice.java index ddf7376b5cc24..83eb95a8e4297 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/NoiseDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/NoiseDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/PressureDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/PressureDevice.java index 5a0d11d2557b6..bb184dc27a213 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/PressureDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/PressureDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RainDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RainDevice.java index 0413de70f8b47..1d1fa270a524a 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RainDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RainDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RgbLightDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RgbLightDevice.java index a83e79d728e03..e22fa80c2939b 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RgbLightDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/RgbLightDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SceneDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SceneDevice.java index c12df77d50926..d0ed9e7ade23d 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SceneDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SceneDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ShutterDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ShutterDevice.java index c5e1169c5c072..35c3108901c1d 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ShutterDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ShutterDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SwitchDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SwitchDevice.java index e726d95684c1c..fe6df71c68f97 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SwitchDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/SwitchDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TempHygroDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TempHygroDevice.java index 7e2da7cacceb3..cb2e85db2efa6 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TempHygroDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TempHygroDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TemperatureDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TemperatureDevice.java index 5e0b9fd41cfcc..0f29a0661875c 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TemperatureDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TemperatureDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ThermostatDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ThermostatDevice.java index c805278ee6d79..a203046e59ead 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ThermostatDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/ThermostatDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TrippableDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TrippableDevice.java index 808b4fdb5d874..caf20086a05be 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TrippableDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/TrippableDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/UvDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/UvDevice.java index 34a31df1cb3b6..e2b1dedc6adf3 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/UvDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/UvDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/WindDevice.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/WindDevice.java index 395db000be7c7..ac26c2b415d02 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/WindDevice.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/device/WindDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParam.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParam.java index 4e16fd3be934e..25128cb54053c 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParam.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParam.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParameters.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParameters.java index be40155c53b49..de259047c35da 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParameters.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/DeviceParameters.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/NumericValueParam.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/NumericValueParam.java index b44d4ad59ce3d..929a399da2659 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/NumericValueParam.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/NumericValueParam.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/ParamType.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/ParamType.java index 137b252913b1b..a07c0ad3f0f65 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/ParamType.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/model/param/ParamType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/DeviceRegistry.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/DeviceRegistry.java index 903ffdd255031..16ef248f014ea 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/DeviceRegistry.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/DeviceRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/ItemProcessor.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/ItemProcessor.java index 213dfaa72d1b4..4aa32e9be05e6 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/ItemProcessor.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/ItemProcessor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/TagType.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/TagType.java index 09646ea695dd0..2e6fdec4c807e 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/TagType.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/processor/TagType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/util/DigestUtil.java b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/util/DigestUtil.java index dc3dd7f461e6f..825afb26d5c1c 100644 --- a/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/util/DigestUtil.java +++ b/bundles/org.openhab.io.imperihome/src/main/java/org/openhab/io/imperihome/internal/util/DigestUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.javasound/NOTICE b/bundles/org.openhab.io.javasound/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.javasound/NOTICE +++ b/bundles/org.openhab.io.javasound/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.javasound/pom.xml b/bundles/org.openhab.io.javasound/pom.xml index 385915f4530fe..cd3a706cd8106 100644 --- a/bundles/org.openhab.io.javasound/pom.xml +++ b/bundles/org.openhab.io.javasound/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.javasound @@ -15,10 +14,16 @@ - org.openhab.osgiify - javazoom.jlayer + commons-collections + commons-collections + 3.2.2 + compile + + + javazoom + jlayer 1.0.1 - provided + compile diff --git a/bundles/org.openhab.io.javasound/src/main/feature/feature.xml b/bundles/org.openhab.io.javasound/src/main/feature/feature.xml index a8baf9860eced..e9c531da8cff2 100644 --- a/bundles/org.openhab.io.javasound/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.javasound/src/main/feature/feature.xml @@ -1,10 +1,10 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base - mvn:org.openhab.osgiify/javazoom.jlayer/1.0.1 + mvn:commons-collections/commons-collections/3.2.2 mvn:org.openhab.addons.bundles/org.openhab.io.javasound/${project.version} diff --git a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/AudioPlayer.java b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/AudioPlayer.java index 5a5d544638fc5..edcf8b55eacda 100644 --- a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/AudioPlayer.java +++ b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/AudioPlayer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSink.java b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSink.java index c6f4c7768bc12..3293270397fff 100644 --- a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSink.java +++ b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSource.java b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSource.java index 6cbaf4c4bcc7f..52f5358b422ec 100644 --- a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSource.java +++ b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundAudioSource.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundInputStream.java b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundInputStream.java index 1bd38c030650b..f492b844124cd 100644 --- a/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundInputStream.java +++ b/bundles/org.openhab.io.javasound/src/main/java/org/openhab/io/javasound/internal/JavaSoundInputStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.mqttembeddedbroker/NOTICE b/bundles/org.openhab.io.mqttembeddedbroker/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/NOTICE +++ b/bundles/org.openhab.io.mqttembeddedbroker/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.mqttembeddedbroker/README.md b/bundles/org.openhab.io.mqttembeddedbroker/README.md index ad174f1b8e334..52e61d117a3c2 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/README.md +++ b/bundles/org.openhab.io.mqttembeddedbroker/README.md @@ -1,6 +1,7 @@ # MQTT Broker Moquette - MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. +MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. +It was designed as an extremely lightweight publish/subscribe messaging transport. To allow MQTT capable devices to communicate with each other you need a software called MQTT Broker. @@ -16,7 +17,7 @@ All parameters are optional and can be set by file or the REST interface (user-i * __username__: The user name that clients need to provide to connect to this broker. * __password__: The password that clients need to provide to connect to this broker. * __secure__: If set, hosts a secure SSL connection on port 8883 or otherwise a non secure connection on port 1883 (if not overwritten by the port parameter). -* __persistence_file__: An optional persistence file. Retained messages are stored in this file. Can be empty to not store anything. The default is "userdata/mqttembedded.bin". If it starts with "/" on Linux/MacOS or with a drive letter and colon (eg "c:/") it will be treated as an absolute path. Be careful to select a path that you have write access to. +* __persistence_file__: An optional persistence file. Retained messages are stored in this file. Can be empty to not store anything. The default is "userdata/mqttembedded.bin". If it starts with "/" on Linux/macOS or with a drive letter and colon (eg "c:/") it will be treated as an absolute path. Be careful to select a path that you have write access to. ## TLS connections diff --git a/bundles/org.openhab.io.mqttembeddedbroker/pom.xml b/bundles/org.openhab.io.mqttembeddedbroker/pom.xml index 09a547b60482e..3963f1028a31c 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/pom.xml +++ b/bundles/org.openhab.io.mqttembeddedbroker/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.mqttembeddedbroker @@ -14,14 +13,16 @@ openHAB Add-ons :: Bundles :: IO :: MQTT Broker Moquette - 4.1.34.Final + 4.1.42.Final + com.bugsnag.*;resolution:="optional",com.codahale.metrics.*;resolution:="optional",com.librato.metrics.reporter.*;resolution:="optional",com.zaxxer.hikari.*;resolution:="optional",io.netty.channel.epoll.*;resolution:="optional",io.netty.handler.codec.http.*;resolution:="optional" + commons-codec,h2-mvstore,netty-common,netty-buffer,netty-transport,netty-codec,netty-codec-mqtt,netty-resolver,netty-handler com.github.j-n-k moquette-broker - 0.13.0.OH2 + 0.13.0.OH3 compile @@ -49,43 +50,43 @@ io.netty netty-common ${netty.version} - provided + compile io.netty netty-buffer ${netty.version} - provided + compile io.netty netty-transport ${netty.version} - provided + compile io.netty netty-codec ${netty.version} - provided + compile io.netty netty-codec-mqtt ${netty.version} - provided + compile io.netty netty-resolver ${netty.version} - provided + compile io.netty netty-handler ${netty.version} - provided + compile diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/feature/feature.xml b/bundles/org.openhab.io.mqttembeddedbroker/src/main/feature/feature.xml index f0a0c93df8711..ca21d23c24ab1 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/feature/feature.xml @@ -1,20 +1,13 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base openhab-transport-mqtt - mvn:io.netty/netty-common/4.1.34.Final - mvn:io.netty/netty-buffer/4.1.34.Final - mvn:io.netty/netty-transport/4.1.34.Final - mvn:io.netty/netty-codec/4.1.34.Final - mvn:io.netty/netty-codec-mqtt/4.1.34.Final - mvn:io.netty/netty-resolver/4.1.34.Final - mvn:io.netty/netty-handler/4.1.34.Final + openhab.tp-netty mvn:com.h2database/h2-mvstore/1.4.199 mvn:commons-codec/commons-codec/1.10 - mvn:com.github.j-n-k/moquette-broker/0.13.0.OH2 mvn:org.openhab.addons.bundles/org.openhab.io.mqttembeddedbroker/${project.version} diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/Constants.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/Constants.java index 12758c35757e2..9b888f8c6e8f6 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/Constants.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/Constants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java index 1737708d24d5a..eae17088ecfe1 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/EmbeddedBrokerService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -12,6 +12,7 @@ */ package org.openhab.io.mqttembeddedbroker.internal; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; @@ -44,10 +45,7 @@ import org.eclipse.smarthome.io.transport.mqtt.MqttServiceObserver; import org.openhab.io.mqttembeddedbroker.Constants; import org.openhab.io.mqttembeddedbroker.internal.MqttEmbeddedBrokerDetectStart.MqttEmbeddedBrokerStartedListener; -import org.osgi.service.component.annotations.Activate; -import org.osgi.service.component.annotations.Component; -import org.osgi.service.component.annotations.Deactivate; -import org.osgi.service.component.annotations.Reference; +import org.osgi.service.component.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -85,7 +83,7 @@ @NonNullByDefault public class EmbeddedBrokerService implements ConfigurableService, MqttConnectionObserver, MqttServiceObserver, MqttEmbeddedBrokerStartedListener { - private @Nullable MqttService service; + private final MqttService service; private String persistenceFilename = ""; // private NetworkServerTls networkServerTls; //TODO wait for NetworkServerTls implementation @@ -145,22 +143,19 @@ public void onUnsubscribe(InterceptUnsubscribeMessage arg0) { private @Nullable MqttBrokerConnection connection; - @Reference - public void setMqttService(MqttService service) { - this.service = service; - } - - public void unsetMqttService(MqttService service) { - this.service = service; - } - @Activate - public void activate(Map data) throws IOException { - initialize(new Configuration(data).as(ServiceConfiguration.class)); + public EmbeddedBrokerService(@Reference MqttService mqttService, Map configuration) throws IOException { + this.service = mqttService; + initialize(configuration); } - - @SuppressWarnings("null") - public void initialize(ServiceConfiguration config) throws IOException { + @Modified + public void modified(Map configuration) throws IOException { + deactivate(); + initialize(configuration); + } + + public void initialize(Map configuration) throws IOException { + ServiceConfiguration config = new Configuration(configuration).as(ServiceConfiguration.class); int port = config.port == null ? (config.port = config.secure ? 8883 : 1883) : config.port; // Create MqttBrokerConnection @@ -217,8 +212,9 @@ public void deactivate() { server.stopServer(); server = null; } - }).get(300, TimeUnit.MILLISECONDS); - } catch (InterruptedException | ExecutionException | TimeoutException ignored) { + }).get(10, TimeUnit.SECONDS); + } catch (InterruptedException | ExecutionException | TimeoutException e) { + logger.warn("Could not cleanly shutdown connection or server.", e); } connection = null; } @@ -231,7 +227,7 @@ public void brokerAdded(String brokerID, MqttBrokerConnection broker) { @Override public void brokerRemoved(String brokerID, MqttBrokerConnection broker) { // Do not allow this connection to be removed. Add it again. - if (broker == connection) { + if (broker.equals(connection)) { service.addBrokerConnection(brokerID, broker); } } @@ -302,14 +298,21 @@ public void startEmbeddedServer(@Nullable Integer portParam, boolean secure, @Nu // We may provide ACL functionality at some point as well IAuthorizatorPolicy authorizer = null; + ISslContextCreator sslContextCreator = secure ? nettySSLcontextCreator() : null; - if (secure) { - server.startServer(new MemoryConfig(properties), null, nettySSLcontextCreator(), authentificator, + try { + server.startServer(new MemoryConfig(properties), null, sslContextCreator, authentificator, authorizer); - } else { - server.startServer(new MemoryConfig(properties), null, null, authentificator, authorizer); + } catch (IllegalArgumentException e) { + if (e.getMessage().contains("Could not deserialize")) { + Path persistenceFilePath = Paths.get((new File(persistenceFilename)).getAbsolutePath()); + logger.warn("persistence corrupt: {}, deleting {}", e.getMessage(), persistenceFilePath); + Files.delete(persistenceFilePath); + // retry starting broker, if it fails again, don't catch exception + server.startServer(new MemoryConfig(properties), null, sslContextCreator, authentificator, + authorizer); + } } - this.server = server; server.addInterceptHandler(metrics); ScheduledExecutorService s = new ScheduledThreadPoolExecutor(1); diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerDetectStart.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerDetectStart.java index 26bf4be91d87a..f55b4389ac72c 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerDetectStart.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerDetectStart.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerUserAuthenticator.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerUserAuthenticator.java index 9928fc2261f48..8c9c7b0690363 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerUserAuthenticator.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerUserAuthenticator.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/ServiceConfiguration.java b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/ServiceConfiguration.java index 52e0a51e052eb..06a846e1d7c59 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/ServiceConfiguration.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/java/org/openhab/io/mqttembeddedbroker/internal/ServiceConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.io.mqttembeddedbroker/src/main/resources/ESH-INF/config/config.xml index 155a8649a535e..9b7762c220710 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/main/resources/ESH-INF/config/config.xml @@ -7,14 +7,14 @@ - + A custom broker connection port. Leave empty to use the default MQTT ports 1883 and 8883 (SSL) for secure or non-secure connections. - + If set, hosts a secure SSL connection on port 8883 or otherwise a non secure connection on port 1883 (if not overwritten by the port parameter) @@ -22,20 +22,20 @@ - + Connections need to provide this username to access the broker. - + Connections need to provide this password to access the broker. Should only be used if it is a secure connection, because the password is transferred plain over the wire. - + An optional persistence file. Retained messages are stored in this file. Can be empty to not store anything. If it starts with "/" on Linux/MacOS or with a drive letter and colon (eg diff --git a/bundles/org.openhab.io.mqttembeddedbroker/src/test/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerServiceTest.java b/bundles/org.openhab.io.mqttembeddedbroker/src/test/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerServiceTest.java index e7cdf9df2872d..bfa5531cf37f7 100644 --- a/bundles/org.openhab.io.mqttembeddedbroker/src/test/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerServiceTest.java +++ b/bundles/org.openhab.io.mqttembeddedbroker/src/test/java/org/openhab/io/mqttembeddedbroker/internal/MqttEmbeddedBrokerServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,6 +22,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.security.GeneralSecurityException; +import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Semaphore; @@ -45,8 +46,6 @@ import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.moquette.broker.RetainedMessage; import io.moquette.broker.subscriptions.Topic; @@ -58,24 +57,22 @@ * @author David Graeff - Initial contribution */ public class MqttEmbeddedBrokerServiceTest extends JavaTest { - private final Logger logger = LoggerFactory.getLogger(MqttEmbeddedBrokerServiceTest.class); private EmbeddedBrokerService subject; - private ServiceConfiguration config = new ServiceConfiguration(); + private Map config = new HashMap<>(); private @Mock MqttService service; @Before public void setUp() throws ConfigurationException, MqttException, GeneralSecurityException, IOException { MockitoAnnotations.initMocks(this); - subject = new EmbeddedBrokerService(); - subject.setMqttService(service); - config.username = "username"; - config.password = "password"; - config.port = 12345; - config.secure = false; - config.persistenceFile = ""; + config.put("username", "username"); + config.put("password", "password"); + config.put("port", 12345); + config.put("secure", false); + config.put("persistenceFile", ""); + subject = new EmbeddedBrokerService(service, config); } @After @@ -102,13 +99,10 @@ public void waitForConnectionChange(MqttBrokerConnection c, MqttConnectionState semaphore.tryAcquire(3000, TimeUnit.MILLISECONDS); c.removeConnectionObserver(mqttConnectionObserver); - } @Test public void connectUnsecureAndTestCredentials() throws InterruptedException, IOException, ExecutionException { - subject.initialize(config); - MqttBrokerConnection c = subject.getConnection(); assertNotNull(c); waitForConnectionChange(c, MqttConnectionState.CONNECTED); @@ -123,12 +117,9 @@ public void connectUnsecureAndTestCredentials() throws InterruptedException, IOE MqttBrokerConnection wrongCredentials = new MqttBrokerConnection(Protocol.TCP, c.getHost(), c.getPort(), false, "wrongCred"); wrongCredentials.setCredentials("someUser", "somePassword"); - try { - if (wrongCredentials.start().get()) { - fail("Wrong credentials accepted!"); - } - } catch (ExecutionException e) { - e.printStackTrace(); + + if (wrongCredentials.start().get()) { + fail("Wrong credentials accepted!"); } wrongCredentials.stop().get(); @@ -137,12 +128,9 @@ public void connectUnsecureAndTestCredentials() throws InterruptedException, IOE MqttBrokerConnection correctCredentials = new MqttBrokerConnection(Protocol.TCP, c.getHost(), c.getPort(), false, "correctCred"); correctCredentials.setCredentials(c.getUser(), c.getPassword()); - try { - if (!correctCredentials.start().get()) { - fail("Couldn't connect although correct credentials"); - } - } catch (ExecutionException e) { - e.printStackTrace(); + + if (!correctCredentials.start().get()) { + fail("Couldn't connect although correct credentials"); } correctCredentials.stop().get(); @@ -150,8 +138,8 @@ public void connectUnsecureAndTestCredentials() throws InterruptedException, IOE @Test public void connectSecure() throws InterruptedException, IOException { - config.secure = true; - subject.initialize(config); + config.put("secure", true); + subject.modified(config); MqttBrokerConnection c = subject.getConnection(); assertNotNull(c); @@ -167,15 +155,15 @@ public void connectSecure() throws InterruptedException, IOException { @Test public void testPersistence() throws InterruptedException, IOException, ExecutionException { - config.persistenceFile = "persist.mqtt"; + config.put("persistenceFile", "persist.mqtt"); Path path = Paths.get(ConfigConstants.getUserDataFolder()).toAbsolutePath(); - File jksFile = path.resolve(config.persistenceFile).toFile(); + File jksFile = path.resolve("persist.mqtt").toFile(); if (jksFile.exists()) { jksFile.delete(); } - subject.initialize(config); + subject.modified(config); MqttBrokerConnection c = subject.getConnection(); assertNotNull(c); diff --git a/bundles/org.openhab.io.neeo/NOTICE b/bundles/org.openhab.io.neeo/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.neeo/NOTICE +++ b/bundles/org.openhab.io.neeo/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.neeo/README.md b/bundles/org.openhab.io.neeo/README.md index 1bdf34565706f..148050f4b7203 100644 --- a/bundles/org.openhab.io.neeo/README.md +++ b/bundles/org.openhab.io.neeo/README.md @@ -97,13 +97,13 @@ You can then add OH1/OH2 items to that virtual thing and those items will be map There are two types of items supported: 1. Any valid openHAB item (OH1 or OH2). -2. Trigger channels - any trigger channel defined in an openHAB thing or any trigger channel that you add to an existing thing (regardless if it's an openHAB thing or a virtual thing). +2. Trigger channels - any trigger channel defined in an openHAB thing or any trigger channel that you add to an existing thing (regardless if it is an openHAB thing or a virtual thing). Trigger channels are useful to add to an existing thing if you want to add a button on NEEO that when pushed, can perform some rule that you have defined on a trigger. Please review [NEEO SDK](https://github.com/NEEOInc/neeo-sdk) documentation before attempting to map. This document describes some (but not all) of the requirements for NEEO things and capabilities. -The NEEO SDK document is written from the perspective of writing native plugins for NEEO but much of it's concepts apply here. +The NEEO SDK document is written from the perspective of writing native plugins for NEEO but much of its concepts apply here. Mappings consist of two parts: @@ -118,7 +118,7 @@ This screen show partially shows the setup of my Russound (whole house music sys The NEEO text label type will allow you to specify showing the label and text or just the text. To show both a label and the text on the NEEO remote, uncheck the check mark next the the associated label field and enter in the label you wish to assign to the text. -By turning off the label and specifying the format of the text field, you'll be able to create your own custom label then. +By turning off the label and specifying the format of the text field, you will be able to create your own custom label then. ##### NEEO List @@ -153,7 +153,7 @@ The following action can then be performed: 6. Press the puzzle piece icon to add new trigger channel to the device. 7. Press the SAVE icon to save the mapping for the openHAB thing. 8. Press the REFRESH icon to refresh the mapping to the last saved state (discarding any pending changes). -9. [openHAB things] Press the RESTORE icon to restore the mapping to it's original content (discarding any pending changes). +9. [openHAB things] Press the RESTORE icon to restore the mapping to its original content (discarding any pending changes). 10. [Virtual things] Press the DELETE icon to delete the thing. 11. [things with trigger channel(s)] Press the RULES icon to download an example .rules file for the triggers. 12. [NON ACCESSORIE/LIGHT] Specify device timings (see below). @@ -235,13 +235,13 @@ Please note that you can also specify a hard button in the "NEEO Label" - in whi You must specify all the hard buttons for a capability (as specified in the NEEO SDK documentation) for the button to work. Example: if you only defined VOLUME DOWN but not VOLUME UP - the button will not work on the remote. Likewise, which hard buttons are active or not additionally depends on the NEEO device type. -3. Switch - this will create a virtual switch with the text from the "NEEO Label" and will send a ON or OFF command to the associated item. +3. Switch - this will create a virtual switch with the text from the "NEEO Label" and will send an ON or OFF command to the associated item. Additionally, a switch can be bound to hard button pairs (the VOLUME keys, the POWER ON/OFF, the CHANNELS, etc). The command that is sent is dependent on the KEYS chosen (POWER ON/OFF will send ON/OFF to the underlying item, all others will send an INCREASE/DECREASE). Similar to the "Button" type - please review the NEEO SDK documentation. 4. Slider - this will create a virtual slider that will send the associated value to the item. The value sent will always be between 0 and 100. -5. ImageURL - this will create an image on the remote from the toString() of the item value (assuming it's a URL to an image). +5. ImageURL - this will create an image on the remote from the toString() of the item value (assuming it is a URL to an image). 6. Sensor - this will create a sensor (non-visual) that can be used in recipes on the brain. 7. Power - this will create a powerstate sensor on the brain that can be used to stop/start the device. NOTE: you MUST also assign a POWER OFF/POWER ON for this to work. @@ -283,8 +283,8 @@ If you are trying to bind a LIFX or HUE bulb, here are the following channels yo 5. Set the HUE/SATURATION/TEMPERATURE to a NEEO type of "Slider" (you can set the BRIGHTNESS as well - but NEEO will automatically assign that for you). Please note that NEEO will automatically combine all your "LIGHT" types into a single light on the remote (not ideal). -You'll get a single screen with all lights listed with a power toggle and slider for brightness. -You'll need to add the HUE/SATURATION/TEMPERATURE as shortcuts. +You will get a single screen with all lights listed with a power toggle and slider for brightness. +You will need to add the HUE/SATURATION/TEMPERATURE as shortcuts. ##### Power State Capability type @@ -295,7 +295,7 @@ Sending ON to the power state item will start the device (similar to POWER ON bu ##### Virtual Device Items When you press the "+" icon (on the device) to add new items to the virtual device. -You'll be presented with a screen that will allow you to: +You will be presented with a screen that will allow you to: 1. Add a new item by pressing the "Add Item" button. 2. Delete all your items by pressing the "Delete All" button. @@ -337,7 +337,7 @@ When the volumes keys are pressed, a "INCREASE" or "DECREASE" will be sent to th All data used by the integration is stored under the "userdata/neeo" directory (please note that this directory is shared with the NEEO binding). You may backup and restore these files as needed. -If you restore the directory, you'll likely need to restart openHAB for the new file contents to be applied. +If you restore the directory, you will likely need to restart openHAB for the new file contents to be applied. There are two files being stored by the integration: diff --git a/bundles/org.openhab.io.neeo/cfg/neeo.cfg b/bundles/org.openhab.io.neeo/cfg/neeo.cfg index 8f1bbdf6c97f5..cda594c63a115 100644 --- a/bundles/org.openhab.io.neeo/cfg/neeo.cfg +++ b/bundles/org.openhab.io.neeo/cfg/neeo.cfg @@ -28,4 +28,4 @@ # The interval (in seconds) to check the status of the brain to determine if the # brain is reachable or not # Default is 10 -#checkStatusInterval=10 \ No newline at end of file +#checkStatusInterval=10 diff --git a/bundles/org.openhab.io.neeo/pom.xml b/bundles/org.openhab.io.neeo/pom.xml index b5b0249e98326..b6945f2ebcf33 100644 --- a/bundles/org.openhab.io.neeo/pom.xml +++ b/bundles/org.openhab.io.neeo/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.neeo diff --git a/bundles/org.openhab.io.neeo/src/main/feature/feature.xml b/bundles/org.openhab.io.neeo/src/main/feature/feature.xml index 20479d6be5e4c..a79306941ab2c 100644 --- a/bundles/org.openhab.io.neeo/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.neeo/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/NeeoService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/NeeoService.java index 312335897a69c..c20075a8d0767 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/NeeoService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/NeeoService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/AbstractServlet.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/AbstractServlet.java index 190c9d70fc0e5..32222028afef6 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/AbstractServlet.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/AbstractServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoApi.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoApi.java index 2d6227e08971c..9bd415ca258a2 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoApi.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoApi.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoBrainServlet.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoBrainServlet.java index 595c80e5442a0..8cefd7acbe3d9 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoBrainServlet.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoBrainServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoConstants.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoConstants.java index 91a45960eecc5..b3e6286a96cd4 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoConstants.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDashboardServlet.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDashboardServlet.java index 0897f8dbae8e8..39de09d6e6808 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDashboardServlet.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDashboardServlet.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceDefinitions.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceDefinitions.java index cf5d4dbeff97e..ec908c7ddc747 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceDefinitions.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceDefinitions.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceKeys.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceKeys.java index 5616251103755..c12d5be4ee6a8 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceKeys.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceKeys.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoItemValueConverter.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoItemValueConverter.java index 0067ed128e7e3..7f881cc65257a 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoItemValueConverter.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoItemValueConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoUtil.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoUtil.java index 541d9065177f4..188c727879775 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoUtil.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoUtil.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/OpenHabToDeviceConverter.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/OpenHabToDeviceConverter.java index d31f80f87efbb..9da095fd6771c 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/OpenHabToDeviceConverter.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/OpenHabToDeviceConverter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/ServiceContext.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/ServiceContext.java index a75ed12f469de..b8a51d197ed87 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/ServiceContext.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/ServiceContext.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java index 6f0ce388aba68..5745e2e8c0257 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/TokenSearch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/AbstractBrainDiscovery.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/AbstractBrainDiscovery.java index 2627299aa16fb..b0d11b084b952 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/AbstractBrainDiscovery.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/AbstractBrainDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/BrainDiscovery.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/BrainDiscovery.java index 99aef2d145e4f..8bb09789db4e9 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/BrainDiscovery.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/BrainDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/DiscoveryListener.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/DiscoveryListener.java index 6bd1b34dd1b47..058a8d230e295 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/DiscoveryListener.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/DiscoveryListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/MdnsBrainDiscovery.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/MdnsBrainDiscovery.java index e8e42fe0a8a9f..8da012471637e 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/MdnsBrainDiscovery.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/discovery/MdnsBrainDiscovery.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/BrainStatus.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/BrainStatus.java index fac4d80533c2d..6668431e6e889 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/BrainStatus.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/BrainStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ButtonInfo.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ButtonInfo.java index 29ff69f03d859..d950d5b6eb71e 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ButtonInfo.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ButtonInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ItemSubType.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ItemSubType.java index ff9cce5c07a74..edb030acfebda 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ItemSubType.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ItemSubType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ListUiAction.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ListUiAction.java index aadae35a325f6..3df8cb9ff3773 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ListUiAction.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/ListUiAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoAdapterRegistration.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoAdapterRegistration.java index f8bf81d0a8515..060b17bb9bd60 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoAdapterRegistration.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoAdapterRegistration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoButtonGroup.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoButtonGroup.java index 6407926a31d37..f93ae0a6ebdd4 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoButtonGroup.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoButtonGroup.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoCapabilityType.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoCapabilityType.java index 982f1f904007f..dd94c95f2cba5 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoCapabilityType.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoCapabilityType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDevice.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDevice.java index 7ef9d566ec670..a9e90667e8d9c 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDevice.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDevice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannel.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannel.java index 7ed4b862e415d..bec52a4320eba 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannel.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannel.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectory.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectory.java index f169051bcd395..280bb8574a6ae 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectory.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectoryListItem.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectoryListItem.java index e3ecdf70053b5..368f1a7eed5d3 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectoryListItem.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelDirectoryListItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelKind.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelKind.java index eac2d90be46d2..7a055c3a43caf 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelKind.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelKind.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelRange.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelRange.java index 9262f0ae99312..e3c7363678f61 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelRange.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelRange.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelText.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelText.java index c7bd9dbb9284f..8c31c1bb42d8b 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelText.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceChannelText.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceTiming.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceTiming.java index d51ac72f20132..3a3be22aaeb8b 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceTiming.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceTiming.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceType.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceType.java index 0e1ede248ab19..93bdbe918b406 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceType.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDeviceType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequest.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequest.java index d45d296ea90c8..a5f5e370cf609 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequest.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -87,4 +87,4 @@ public String toString() { + browseIdentifier + "]"; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequestAction.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequestAction.java index 3a1d5baf90853..35ffc033dd2be 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequestAction.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryRequestAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResult.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResult.java index 4de91ae668483..0827bd853f4b9 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResult.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultItem.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultItem.java index 3260ddd9912cf..510e9869bee89 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultItem.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -122,4 +122,4 @@ public String toString() { + browseIdentifier + ", actionIdentifier=" + actionIdentifier + ", isQueueable=" + isQueueable + "]"; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultMeta.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultMeta.java index 036a4e6748d13..da0e7e7a4d2ab 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultMeta.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoDirectoryResultMeta.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -122,4 +122,4 @@ public String toString() { + ", current=" + current + ", previous=" + previous + ", next=" + next + "]"; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoItemValue.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoItemValue.java index 3c6802d351879..e1331b9794f04 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoItemValue.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoItemValue.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoNotification.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoNotification.java index 25d62d48a3350..eb8be22a5a5e7 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoNotification.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoNotification.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipe.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipe.java index a3bc908eddc6b..3c0e0dc40cc64 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipe.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipe.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipeUrls.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipeUrls.java index 646a06209eafb..8e1c5a20a56b6 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipeUrls.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoRecipeUrls.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSensorNotification.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSensorNotification.java index 9066e55a50529..9e8b06e27f2d8 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSensorNotification.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSensorNotification.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSystemInfo.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSystemInfo.java index 1669182ab823c..8b5de11430be6 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSystemInfo.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoSystemInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoThingUID.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoThingUID.java index f60963200876c..07b3f8efb87ed 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoThingUID.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/NeeoThingUID.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScore.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScore.java index 82a0b09bcede6..d090d86aadc21 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScore.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScore.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScoreResult.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScoreResult.java index 1403044cdeebb..bd4703f3fb86f 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScoreResult.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/models/TokenScoreResult.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpRequest.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpRequest.java index 8e57497ec3c38..030c6a8b09c7a 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpRequest.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpResponse.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpResponse.java index f2fccdea1a66c..8e47c241484a1 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpResponse.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/HttpResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/Slf4LoggingAdapter.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/Slf4LoggingAdapter.java index 2dcb24effc5c0..b1d29e441b7e3 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/Slf4LoggingAdapter.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/net/Slf4LoggingAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ChannelUIDSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ChannelUIDSerializer.java index 2a30b13a28cb1..2d67012762113 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ChannelUIDSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ChannelUIDSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ItemSubTypeSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ItemSubTypeSerializer.java index 9441b3d7bb1cd..24ba2ac4d217f 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ItemSubTypeSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ItemSubTypeSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ListUiActionSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ListUiActionSerializer.java index cce724890fc97..df461e85c247d 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ListUiActionSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/ListUiActionSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoBrainDeviceSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoBrainDeviceSerializer.java index 82e5efe5b55ca..508ea0401af2b 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoBrainDeviceSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoBrainDeviceSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoCapabilityTypeSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoCapabilityTypeSerializer.java index 96505ae38f2d4..8cd213909afdf 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoCapabilityTypeSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoCapabilityTypeSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelKindSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelKindSerializer.java index ca816b6d03abc..fd3e6e91b16d1 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelKindSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelKindSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelSerializer.java index de19949178d1e..eb397ace4b000 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceChannelSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceSerializer.java index d5be84033c178..b6324cf300306 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceTypeSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceTypeSerializer.java index 8fb611b4033b6..de404190077a2 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceTypeSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoDeviceTypeSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoThingUIDSerializer.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoThingUIDSerializer.java index 34667ebf0dcdc..aece19495e48b 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoThingUIDSerializer.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/serialization/NeeoThingUIDSerializer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/BrainDashboardService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/BrainDashboardService.java index 32c1a6a7338a7..cead06f6c6eaf 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/BrainDashboardService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/BrainDashboardService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/DefaultServletService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/DefaultServletService.java index d415673c825aa..8a80ccd1b4ae5 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/DefaultServletService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/DefaultServletService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainSearchService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainSearchService.java index 2a758826f5940..1a80cb4f78b0c 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainSearchService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainSearchService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainService.java index 25a7488f649fa..3327b14964e63 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/NeeoBrainService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ServletService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ServletService.java index 88ae58f7478f8..f0391c1d59024 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ServletService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ServletService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ThingDashboardService.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ThingDashboardService.java index 5d3d4f8514b4b..7cd80673955e2 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ThingDashboardService.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/ThingDashboardService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/BrainInfo.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/BrainInfo.java index 686f8564cd3fb..877409ca538da 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/BrainInfo.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/BrainInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/PathInfo.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/PathInfo.java index f342ce8198572..843a02694d981 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/PathInfo.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/PathInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/ReturnStatus.java b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/ReturnStatus.java index 554ac4378ed44..22b28b1262cd5 100644 --- a/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/ReturnStatus.java +++ b/bundles/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/servletservices/models/ReturnStatus.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.neeo/src/main/resources/web/index.html b/bundles/org.openhab.io.neeo/src/main/resources/web/index.html index 0966323cd8ee9..870c33c98660e 100644 --- a/bundles/org.openhab.io.neeo/src/main/resources/web/index.html +++ b/bundles/org.openhab.io.neeo/src/main/resources/web/index.html @@ -646,4 +646,4 @@ - \ No newline at end of file + diff --git a/bundles/org.openhab.io.neeo/src/main/resources/web/js/thirdparty/filesaver.js b/bundles/org.openhab.io.neeo/src/main/resources/web/js/thirdparty/filesaver.js index 096123d5f4351..da9f373cea52d 100644 --- a/bundles/org.openhab.io.neeo/src/main/resources/web/js/thirdparty/filesaver.js +++ b/bundles/org.openhab.io.neeo/src/main/resources/web/js/thirdparty/filesaver.js @@ -1,5 +1,3 @@ /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})} - - \ No newline at end of file diff --git a/bundles/org.openhab.io.openhabcloud/NOTICE b/bundles/org.openhab.io.openhabcloud/NOTICE index ee314c12de330..b490a72fbb6ce 100644 --- a/bundles/org.openhab.io.openhabcloud/NOTICE +++ b/bundles/org.openhab.io.openhabcloud/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.io.openhabcloud/README.md b/bundles/org.openhab.io.openhabcloud/README.md index 22cac3fbcb31c..094125b25b931 100644 --- a/bundles/org.openhab.io.openhabcloud/README.md +++ b/bundles/org.openhab.io.openhabcloud/README.md @@ -1,7 +1,7 @@ # openHAB Cloud Connector -The openHAB Cloud Connector allows connecting the local openHAB runtime to a remote [openHAB Cloud](https://github.com/openhab/openhab-cloud/blob/master/README.md) instance, such as [myopenHAB.org](http://www.myopenHAB.org), which is an instance of the -openHAB Cloud service hosted by the [openHAB Foundation](http://www.openhabfoundation.org/). +The openHAB Cloud Connector allows connecting the local openHAB runtime to a remote [openHAB Cloud](https://github.com/openhab/openhab-cloud/blob/master/README.md) instance, such as [myopenHAB.org](https://www.myopenHAB.org), which is an instance of the +openHAB Cloud service hosted by the [openHAB Foundation](https://www.openhabfoundation.org/). ## Features diff --git a/bundles/org.openhab.io.openhabcloud/noEmbedDependencies.profile b/bundles/org.openhab.io.openhabcloud/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.io.openhabcloud/pom.xml b/bundles/org.openhab.io.openhabcloud/pom.xml index 73b09eb541a87..0ebe61fea4e9a 100644 --- a/bundles/org.openhab.io.openhabcloud/pom.xml +++ b/bundles/org.openhab.io.openhabcloud/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.openhabcloud @@ -18,31 +17,31 @@ org.json json 20180813 - provided + compile
org.apache.servicemix.bundles org.apache.servicemix.bundles.okhttp 3.8.1_1 - provided + compile org.apache.servicemix.bundles org.apache.servicemix.bundles.okio 1.13.0_1 - provided + compile org.openhab.osgiify io.socket.socket.io-client 1.0.0 - provided + compile org.openhab.osgiify io.socket.engine.io-client 1.0.0 - provided + compile diff --git a/bundles/org.openhab.io.openhabcloud/src/main/feature/feature.xml b/bundles/org.openhab.io.openhabcloud/src/main/feature/feature.xml index 38f2948e155b0..260afcd0c4243 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.openhabcloud/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/NotificationAction.java b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/NotificationAction.java index 15338b0665b45..1a9adffba8dc1 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/NotificationAction.java +++ b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/NotificationAction.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java index b6898e36cbc35..214e466de6cdb 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java +++ b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClient.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -202,7 +202,7 @@ public void call(Object... args) { }).on(Socket.EVENT_ERROR, new Emitter.Listener() { @Override public void call(Object... args) { - logger.debug("Socket.IO error: {}", args[0]); + logger.error("Error connecting to the openHAB Cloud instance: {}", args[0]); } }).on("request", new Emitter.Listener() { @Override diff --git a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClientListener.java b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClientListener.java index 76ea7dae6f58d..fbca049806ede 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClientListener.java +++ b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudClientListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java index fd0334925890c..f398ed70a7b06 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java +++ b/bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.openhabcloud/src/main/resources/ESH-INF/config/config.xml b/bundles/org.openhab.io.openhabcloud/src/main/resources/ESH-INF/config/config.xml index c329c2e1dd77d..2146c45efe0d9 100644 --- a/bundles/org.openhab.io.openhabcloud/src/main/resources/ESH-INF/config/config.xml +++ b/bundles/org.openhab.io.openhabcloud/src/main/resources/ESH-INF/config/config.xml @@ -15,12 +15,12 @@ remote - + List of items that are made accessible to IFTTT and similar services. item - + Base URL for the openHAB Cloud server https://myopenhab.org/ diff --git a/bundles/org.openhab.io.transport.modbus/NOTICE b/bundles/org.openhab.io.transport.modbus/NOTICE index 4c20ef446c1e4..0ca708bef198a 100644 --- a/bundles/org.openhab.io.transport.modbus/NOTICE +++ b/bundles/org.openhab.io.transport.modbus/NOTICE @@ -10,4 +10,11 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content + +jsoup +* License: MIT License +* Project: https://jsoup.org/ +* Source: https://github.com/jhy/jsoup diff --git a/bundles/org.openhab.io.transport.modbus/pom.xml b/bundles/org.openhab.io.transport.modbus/pom.xml index f4ef30f594901..1c7e8c548fc13 100644 --- a/bundles/org.openhab.io.transport.modbus/pom.xml +++ b/bundles/org.openhab.io.transport.modbus/pom.xml @@ -1,30 +1,33 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.transport.modbus openHAB Add-ons :: Bundles :: IO :: Modbus Transport + + commons-pool2 + + org.apache.commons commons-pool2 2.4.3 - provided + compile - org.openhab.osgiify - net.wimpi.jamod + net.wimpi + jamod 1.2.3.OH - provided + compile diff --git a/bundles/org.openhab.io.transport.modbus/src/main/feature/feature.xml b/bundles/org.openhab.io.transport.modbus/src/main/feature/feature.xml index 6d379010e2226..540940576e548 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.transport.modbus/src/main/feature/feature.xml @@ -1,11 +1,10 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base openhab-transport-serial - mvn:org.openhab.osgiify/net.wimpi.jamod/1.2.3.OH mvn:org.apache.commons/commons-pool2/2.4.3 mvn:org.openhab.addons.bundles/org.openhab.io.transport.modbus/${project.version} diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicBitArray.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicBitArray.java index 2c842fe528857..dbf8bc17f8041 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicBitArray.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicBitArray.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusReadRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusReadRequestBlueprint.java index 87ab6fc45a692..7b3492737f1b5 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusReadRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusReadRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegister.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegister.java index 9eee4ea4386c2..c1f8d4d88ca88 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegister.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegister.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegisterArray.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegisterArray.java index eb371187fdff7..00867608d165c 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegisterArray.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusRegisterArray.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteCoilRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteCoilRequestBlueprint.java index 5e57218b8845a..c771990a38ad8 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteCoilRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteCoilRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteRegisterRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteRegisterRequestBlueprint.java index 25d9a59792bb6..bddf9baf8940a 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteRegisterRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicModbusWriteRegisterRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicPollTaskImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicPollTaskImpl.java index 624b24b3ba4f7..d7f06a0dc47dd 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicPollTaskImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicPollTaskImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicWriteTask.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicWriteTask.java index 4fec3e2a8821d..148a4d56cee7d 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicWriteTask.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BasicWriteTask.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BitArray.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BitArray.java index f94ed6abe617a..309a9c20b1420 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BitArray.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/BitArray.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusBitUtilities.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusBitUtilities.java index 1c02e9446b5bf..d870755ee51b6 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusBitUtilities.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusBitUtilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusCallback.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusCallback.java index b9f51ea538b04..072f72f120003 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusCallback.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConnectionException.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConnectionException.java index 68a4a65d0f5ce..f828b0368ee72 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConnectionException.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConnectionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConstants.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConstants.java index a7b265abeb1e0..3c7f9a144914b 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConstants.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusConstants.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManager.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManager.java index 5ad5eb2baa2af..a7767568715bd 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManager.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManagerListener.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManagerListener.java index c4bb64a013c4f..0fd454dd5b12c 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManagerListener.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusManagerListener.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadCallback.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadCallback.java index 4a01a75456b92..b4b13dc9b1f03 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadCallback.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadFunctionCode.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadFunctionCode.java index 08c46ef74f2e6..65e1dcc12ab74 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadFunctionCode.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadFunctionCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadRequestBlueprint.java index baa8557a0fc71..27cd3ccdb731b 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusReadRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegister.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegister.java index ce83f87390758..736e1f453d332 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegister.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegister.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegisterArray.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegisterArray.java index 9d5b76ad48d60..d6207072e06dd 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegisterArray.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRegisterArray.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRequestBlueprint.java index b2953e2a9e8d5..01391f6725f0d 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusResponse.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusResponse.java index 430189c093e1c..ff16114f7be65 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusResponse.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveErrorResponseException.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveErrorResponseException.java index 8d9d9747ea567..bbc4395d5e43f 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveErrorResponseException.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveErrorResponseException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveIOException.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveIOException.java index d752bd395b0e9..245da4a8684b4 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveIOException.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusSlaveIOException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusTransportException.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusTransportException.java index 14a032034123f..4b77fc7cab4be 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusTransportException.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusTransportException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusUnexpectedTransactionIdException.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusUnexpectedTransactionIdException.java index 09ce479c1c1cf..2bcb30809699a 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusUnexpectedTransactionIdException.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusUnexpectedTransactionIdException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCallback.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCallback.java index 3adfb182fa8bf..534ffd6ab844c 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCallback.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCallback.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCoilRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCoilRequestBlueprint.java index 069a75567959c..e7be48d19c1c1 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCoilRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteCoilRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteFunctionCode.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteFunctionCode.java index 68caeb4566e21..0fa99a5b75575 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteFunctionCode.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteFunctionCode.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRegisterRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRegisterRequestBlueprint.java index 71983615d58aa..19fd1e5823007 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRegisterRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRegisterRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprint.java index 13b180cc8cd84..2c310f0b14a11 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprintVisitor.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprintVisitor.java index e1f166c1230d0..02302f125cad6 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprintVisitor.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/ModbusWriteRequestBlueprintVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/PollTask.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/PollTask.java index e97dfc4527e1f..36754ad692dd1 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/PollTask.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/PollTask.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/TaskWithEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/TaskWithEndpoint.java index e122b3c8f375e..6a45658044752 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/TaskWithEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/TaskWithEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/WriteTask.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/WriteTask.java index c9ccb765bce97..05611fa390708 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/WriteTask.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/WriteTask.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/EndpointPoolConfiguration.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/EndpointPoolConfiguration.java index 3d20cb6bd11fc..843ba6d857470 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/EndpointPoolConfiguration.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/EndpointPoolConfiguration.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusIPSlaveEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusIPSlaveEndpoint.java index 7d1c0c51a3d23..a1d891c05b99b 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusIPSlaveEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusIPSlaveEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSerialSlaveEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSerialSlaveEndpoint.java index ca5c910f4e0a3..a335185911ef6 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSerialSlaveEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSerialSlaveEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpoint.java index c29715e9c301f..ab0617a377776 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpointVisitor.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpointVisitor.java index 063c3956e6d1b..759cbd3de84c7 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpointVisitor.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusSlaveEndpointVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusTCPSlaveEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusTCPSlaveEndpoint.java index 1efafff035196..b6f844bfa3c7a 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusTCPSlaveEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusTCPSlaveEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusUDPSlaveEndpoint.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusUDPSlaveEndpoint.java index dfeaa73939aa3..e8557828fcb73 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusUDPSlaveEndpoint.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/endpoint/ModbusUDPSlaveEndpoint.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/AggregateStopWatch.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/AggregateStopWatch.java index 41ed3b3b2023f..45146decf1674 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/AggregateStopWatch.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/AggregateStopWatch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/BitArrayWrappingBitVector.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/BitArrayWrappingBitVector.java index bfacde1cf21c0..ce7e2c3eadaeb 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/BitArrayWrappingBitVector.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/BitArrayWrappingBitVector.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusConnectionPool.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusConnectionPool.java index 2608768f2fdf3..aecd80d9eb42a 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusConnectionPool.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusConnectionPool.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusLibraryWrapper.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusLibraryWrapper.java index 6fef6988b6dca..20f3ceca10a73 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusLibraryWrapper.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusLibraryWrapper.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusManagerImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusManagerImpl.java index c2e8f6f4f3f45..bddb8f0820cb6 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusManagerImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusManagerImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusPoolConfig.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusPoolConfig.java index 61cde162aa765..d15c1dc3de0b9 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusPoolConfig.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusPoolConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusResponseImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusResponseImpl.java index a1e6940186ad8..7857cbccbce5b 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusResponseImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusResponseImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveErrorResponseExceptionImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveErrorResponseExceptionImpl.java index eb1d636118248..70c106ce3d3c7 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveErrorResponseExceptionImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveErrorResponseExceptionImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveIOExceptionImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveIOExceptionImpl.java index 9cf6c058cc30b..4d8cf1894f654 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveIOExceptionImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/ModbusSlaveIOExceptionImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/RegisterArrayWrappingInputRegister.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/RegisterArrayWrappingInputRegister.java index 6b88f8fba251f..1816ebe47fde9 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/RegisterArrayWrappingInputRegister.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/RegisterArrayWrappingInputRegister.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/SimpleStopWatch.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/SimpleStopWatch.java index 5c78684dc1990..0e1a95f41199c 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/SimpleStopWatch.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/SimpleStopWatch.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactory.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactory.java index 8e55e47cf68b6..1f2534529c153 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactory.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactoryImpl.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactoryImpl.java index 8cdcb038f0818..814567e1b87b2 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactoryImpl.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/internal/pooling/ModbusSlaveConnectionFactoryImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -330,7 +330,7 @@ public static long waitAtleast(@Nullable Long lastOperation, long waitMillis) th try { Thread.sleep(millisToWaitStill); } catch (InterruptedException e) { - LoggerFactory.getLogger(ModbusSlaveConnectionFactoryImpl.class).debug("wait interrupted: {}", e); + LoggerFactory.getLogger(ModbusSlaveConnectionFactoryImpl.class).debug("wait interrupted", e); throw e; } return millisToWaitStill; diff --git a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/json/WriteRequestJsonUtilities.java b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/json/WriteRequestJsonUtilities.java index 403e841c2a498..ca39ebd0d084f 100644 --- a/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/json/WriteRequestJsonUtilities.java +++ b/bundles/org.openhab.io.transport.modbus/src/main/java/org/openhab/io/transport/modbus/json/WriteRequestJsonUtilities.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/AbstractRequestComparer.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/AbstractRequestComparer.java index 77f8474ace9d1..72f7a976d4068 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/AbstractRequestComparer.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/AbstractRequestComparer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,9 @@ import org.openhab.io.transport.modbus.ModbusWriteFunctionCode; import org.openhab.io.transport.modbus.ModbusWriteRequestBlueprint; +/** + * @author Sami Salonen - Initial contribution + */ abstract class AbstractRequestComparer extends TypeSafeMatcher { private int expectedUnitId; @@ -64,4 +67,4 @@ protected boolean matchesSafely(T item) { } protected abstract boolean doMatchData(T item); -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BasicBitArrayTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BasicBitArrayTest.java index f7814080b9be2..ee97134164cfc 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BasicBitArrayTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BasicBitArrayTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -18,6 +18,9 @@ import org.junit.Test; import org.openhab.io.transport.modbus.BasicBitArray; +/** + * @author Sami Salonen - Initial contribution + */ public class BasicBitArrayTest { @Test diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesCommandToRegistersTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesCommandToRegistersTest.java index decbc0c535f14..7fc332cff6dd1 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesCommandToRegistersTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesCommandToRegistersTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -36,6 +36,9 @@ import org.openhab.io.transport.modbus.ModbusConstants.ValueType; import org.openhab.io.transport.modbus.ModbusRegisterArray; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(Parameterized.class) public class BitUtilitiesCommandToRegistersTest { diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStateFromRegistersTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStateFromRegistersTest.java index dd8df1aab35ca..40684081722f2 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStateFromRegistersTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStateFromRegistersTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -38,6 +38,9 @@ import org.openhab.io.transport.modbus.ModbusRegister; import org.openhab.io.transport.modbus.ModbusRegisterArray; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(Parameterized.class) public class BitUtilitiesExtractStateFromRegistersTest { diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStringFromRegistersTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStringFromRegistersTest.java index 0f090a6ed2ad3..47c570c403abc 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStringFromRegistersTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesExtractStringFromRegistersTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -17,6 +17,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Collections; import java.util.stream.Collectors; @@ -36,6 +37,9 @@ import org.openhab.io.transport.modbus.ModbusRegister; import org.openhab.io.transport.modbus.ModbusRegisterArray; +/** + * @author Sami Salonen - Initial contribution + */ @RunWith(Parameterized.class) public class BitUtilitiesExtractStringFromRegistersTest { @@ -69,18 +73,18 @@ private static ModbusRegisterArray shortArrayToRegisterArray(int... arr) { @Parameters public static Collection data() { return Collections.unmodifiableList(Stream.of( - new Object[] { new StringType(""), shortArrayToRegisterArray(0), 0, 0, Charset.forName("UTF-8") }, + new Object[] { new StringType(""), shortArrayToRegisterArray(0), 0, 0, StandardCharsets.UTF_8 }, new Object[] { new StringType("hello"), shortArrayToRegisterArray(0x6865, 0x6c6c, 0x6f00), 0, 5, - Charset.forName("UTF-8") }, + StandardCharsets.UTF_8 }, new Object[] { new StringType("hello "), shortArrayToRegisterArray(0, 0, 0x6865, 0x6c6c, 0x6f20, 0, 0), - 2, 6, Charset.forName("UTF-8") }, + 2, 6, StandardCharsets.UTF_8 }, new Object[] { new StringType("hello"), shortArrayToRegisterArray(0x6865, 0x6c6c, 0x6f00, 0x0000, 0x0000), 0, 10, - Charset.forName("UTF-8") }, + StandardCharsets.UTF_8 }, new Object[] { new StringType("árvíztűrő tükörfúrógép"), shortArrayToRegisterArray(0xc3a1, 0x7276, 0xc3ad, 0x7a74, 0xc5b1, 0x72c5, 0x9120, 0x74c3, 0xbc6b, 0xc3b6, 0x7266, 0xc3ba, 0x72c3, 0xb367, 0xc3a9, 0x7000), - 0, 32, Charset.forName("UTF-8") }, + 0, 32, StandardCharsets.UTF_8 }, new Object[] { new StringType("árvíztűrő tükörfúrógép"), shortArrayToRegisterArray(0xe172, 0x76ed, 0x7a74, 0xfb72, 0xf520, 0x74fc, 0x6bf6, 0x7266, 0xfa72, 0xf367, 0xe970), @@ -88,11 +92,11 @@ public static Collection data() { // Invalid values new Object[] { IllegalArgumentException.class, shortArrayToRegisterArray(0, 0), 2, 4, - Charset.forName("UTF-8") }, + StandardCharsets.UTF_8 }, new Object[] { IllegalArgumentException.class, shortArrayToRegisterArray(0, 0), 0, -1, - Charset.forName("UTF-8") }, + StandardCharsets.UTF_8 }, new Object[] { IllegalArgumentException.class, shortArrayToRegisterArray(0, 0), 0, 5, - Charset.forName("UTF-8") }) + StandardCharsets.UTF_8 }) .collect(Collectors.toList())); } diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesTranslateCommand2BooleanTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesTranslateCommand2BooleanTest.java index c4c299bfade9c..0d408e191f5ba 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesTranslateCommand2BooleanTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/BitUtilitiesTranslateCommand2BooleanTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -24,6 +24,9 @@ import org.junit.Test; import org.openhab.io.transport.modbus.ModbusBitUtilities; +/** + * @author Sami Salonen - Initial contribution + */ public class BitUtilitiesTranslateCommand2BooleanTest { @Test diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/CoilMatcher.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/CoilMatcher.java index 872a57dcc47e7..7a5bb9e330aa6 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/CoilMatcher.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/CoilMatcher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,9 @@ import org.openhab.io.transport.modbus.ModbusWriteCoilRequestBlueprint; import org.openhab.io.transport.modbus.ModbusWriteFunctionCode; +/** + * @author Sami Salonen - Initial contribution + */ class CoilMatcher extends AbstractRequestComparer { private Boolean[] expectedCoils; @@ -42,4 +45,4 @@ protected boolean doMatchData(ModbusWriteCoilRequestBlueprint item) { Object[] actual = StreamSupport.stream(item.getCoils().spliterator(), false).toArray(); return Objects.deepEquals(actual, expectedCoils); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/IntegrationTestSupport.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/IntegrationTestSupport.java index 1130f9e95db84..88de18d286b15 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/IntegrationTestSupport.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/IntegrationTestSupport.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -60,9 +60,7 @@ import net.wimpi.modbus.util.SerialParameters; /** - * - * @author Sami Salonen - * + * @author Sami Salonen - Initial contribution */ public class IntegrationTestSupport extends JavaTest { @@ -361,4 +359,4 @@ public void close() { } } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ModbusSlaveEndpointTestCase.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ModbusSlaveEndpointTestCase.java index 65c3c4f48ee98..70ea4dbfe413a 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ModbusSlaveEndpointTestCase.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ModbusSlaveEndpointTestCase.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -22,9 +22,7 @@ import net.wimpi.modbus.Modbus; /** - * - * @author Sami Salonen - * + * @author Sami Salonen - Initial contribution */ public class ModbusSlaveEndpointTestCase { diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/RegisterMatcher.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/RegisterMatcher.java index d74a7d858cb47..dee72dda3351b 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/RegisterMatcher.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/RegisterMatcher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -20,6 +20,9 @@ import org.openhab.io.transport.modbus.ModbusWriteFunctionCode; import org.openhab.io.transport.modbus.ModbusWriteRegisterRequestBlueprint; +/** + * @author Sami Salonen - Initial contribution + */ class RegisterMatcher extends AbstractRequestComparer { private Integer[] expectedRegisterValues; @@ -43,4 +46,4 @@ protected boolean doMatchData(ModbusWriteRegisterRequestBlueprint item) { .toArray(); return Objects.deepEquals(actual, expectedRegisterValues); } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ResultCaptor.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ResultCaptor.java index 07e77b8250c41..04caa7315ae75 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ResultCaptor.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/ResultCaptor.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -19,8 +19,7 @@ import org.mockito.stubbing.Answer; /** - * - * @author Sami Salonen + * @author Sami Salonen - Initial contribution * * @param */ @@ -51,4 +50,4 @@ public T answer(InvocationOnMock invocationOnMock) throws Throwable { } return result; } -} \ No newline at end of file +} diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/SmokeTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/SmokeTest.java index 03632163399e4..451fa0b30f63c 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/SmokeTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/SmokeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -56,9 +56,7 @@ import net.wimpi.modbus.procimg.SimpleRegister; /** - * - * @author Sami Salonen - * + * @author Sami Salonen - Initial contribution */ public class SmokeTest extends IntegrationTestSupport { diff --git a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/WriteRequestJsonUtilitiesTest.java b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/WriteRequestJsonUtilitiesTest.java index b2e1b3d99be18..f525a4d288e15 100644 --- a/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/WriteRequestJsonUtilitiesTest.java +++ b/bundles/org.openhab.io.transport.modbus/src/test/java/org/openhab/io/transport/modbus/test/WriteRequestJsonUtilitiesTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -21,6 +21,9 @@ import org.openhab.io.transport.modbus.ModbusWriteFunctionCode; import org.openhab.io.transport.modbus.json.WriteRequestJsonUtilities; +/** + * @author Sami Salonen - Initial contribution + */ public class WriteRequestJsonUtilitiesTest { @Test diff --git a/bundles/org.openhab.io.webaudio/NOTICE b/bundles/org.openhab.io.webaudio/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.io.webaudio/NOTICE +++ b/bundles/org.openhab.io.webaudio/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.io.webaudio/pom.xml b/bundles/org.openhab.io.webaudio/pom.xml index e19f279ea12fa..4c77bf8e24caa 100644 --- a/bundles/org.openhab.io.webaudio/pom.xml +++ b/bundles/org.openhab.io.webaudio/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.io.webaudio diff --git a/bundles/org.openhab.io.webaudio/src/main/feature/feature.xml b/bundles/org.openhab.io.webaudio/src/main/feature/feature.xml index 5d31af050ef79..d28a67a69aba3 100644 --- a/bundles/org.openhab.io.webaudio/src/main/feature/feature.xml +++ b/bundles/org.openhab.io.webaudio/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/PlayURLEvent.java b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/PlayURLEvent.java index a6fb195ed1565..82176be110707 100644 --- a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/PlayURLEvent.java +++ b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/PlayURLEvent.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioAudioSink.java b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioAudioSink.java index 595519a2896df..060eb656a0ff0 100644 --- a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioAudioSink.java +++ b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioAudioSink.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioEventFactory.java b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioEventFactory.java index f44c0dbad352d..715006037bed0 100644 --- a/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioEventFactory.java +++ b/bundles/org.openhab.io.webaudio/src/main/java/org/openhab/io/webaudio/internal/WebAudioEventFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.persistence.mapdb/NOTICE b/bundles/org.openhab.persistence.mapdb/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.persistence.mapdb/NOTICE +++ b/bundles/org.openhab.persistence.mapdb/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.persistence.mapdb/pom.xml b/bundles/org.openhab.persistence.mapdb/pom.xml index 2f6353e413493..3341245d56332 100644 --- a/bundles/org.openhab.persistence.mapdb/pom.xml +++ b/bundles/org.openhab.persistence.mapdb/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.persistence.mapdb diff --git a/bundles/org.openhab.persistence.mapdb/src/main/feature/feature.xml b/bundles/org.openhab.persistence.mapdb/src/main/feature/feature.xml index fc5f9ccb59700..bdadd65e24d64 100644 --- a/bundles/org.openhab.persistence.mapdb/src/main/feature/feature.xml +++ b/bundles/org.openhab.persistence.mapdb/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features diff --git a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbItem.java b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbItem.java index f6dcfeb714395..b9bc488da9127 100644 --- a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbItem.java +++ b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbItem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbPersistenceService.java b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbPersistenceService.java index 7417e4081ccb8..e76e922bba2d4 100644 --- a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbPersistenceService.java +++ b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/MapDbPersistenceService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java index 2a6c4f3da8eea..a06ac63200345 100644 --- a/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java +++ b/bundles/org.openhab.persistence.mapdb/src/main/java/org/openhab/persistence/mapdb/internal/StateTypeAdapter.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.persistence.mapdb/src/test/java/org/openhab/persistence/mapdb/StateTypeAdapterTest.java b/bundles/org.openhab.persistence.mapdb/src/test/java/org/openhab/persistence/mapdb/StateTypeAdapterTest.java index a389ff6620c39..db05534e96ba1 100644 --- a/bundles/org.openhab.persistence.mapdb/src/test/java/org/openhab/persistence/mapdb/StateTypeAdapterTest.java +++ b/bundles/org.openhab.persistence.mapdb/src/test/java/org/openhab/persistence/mapdb/StateTypeAdapterTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.bin2json/NOTICE b/bundles/org.openhab.transform.bin2json/NOTICE index 2c7410562c45a..1b4b5a9dcedbe 100644 --- a/bundles/org.openhab.transform.bin2json/NOTICE +++ b/bundles/org.openhab.transform.bin2json/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.transform.bin2json/README.md b/bundles/org.openhab.transform.bin2json/README.md index 636e45f3cc462..453ceb8d2c5c6 100644 --- a/bundles/org.openhab.transform.bin2json/README.md +++ b/bundles/org.openhab.transform.bin2json/README.md @@ -12,4 +12,4 @@ Binary to JSON converter will return following result `{"a":3,"b":-6,"c":255}` ## Usage as a Profile -Profiles are not supported by this transformation. \ No newline at end of file +Profiles are not supported by this transformation. diff --git a/bundles/org.openhab.transform.bin2json/pom.xml b/bundles/org.openhab.transform.bin2json/pom.xml index 1d6bb4549db6d..63c45687fc4f3 100644 --- a/bundles/org.openhab.transform.bin2json/pom.xml +++ b/bundles/org.openhab.transform.bin2json/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.bin2json @@ -15,10 +14,10 @@ - org.openhab.osgiify - com.igormaznitsa.jbbp + com.igormaznitsa + jbbp 1.4.1 - provided + compile diff --git a/bundles/org.openhab.transform.bin2json/src/main/feature/feature.xml b/bundles/org.openhab.transform.bin2json/src/main/feature/feature.xml index f3934731d3911..d2b47cabbeba0 100644 --- a/bundles/org.openhab.transform.bin2json/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.bin2json/src/main/feature/feature.xml @@ -1,10 +1,9 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base - mvn:org.openhab.osgiify/com.igormaznitsa.jbbp/1.4.1 mvn:org.openhab.addons.bundles/org.openhab.transform.bin2json/${project.version} diff --git a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2Json.java b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2Json.java index d62f9e38d1191..ed8a220846999 100644 --- a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2Json.java +++ b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2Json.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2JsonTransformationService.java b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2JsonTransformationService.java index 35996eff94a52..af5c20a9a3c4b 100644 --- a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2JsonTransformationService.java +++ b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/Bin2JsonTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/ConversionException.java b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/ConversionException.java index 505fb728b40b1..05b387134eedc 100644 --- a/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/ConversionException.java +++ b/bundles/org.openhab.transform.bin2json/src/main/java/org/openhab/transform/bin2json/internal/ConversionException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.exec/NOTICE b/bundles/org.openhab.transform.exec/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.exec/NOTICE +++ b/bundles/org.openhab.transform.exec/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.exec/README.md b/bundles/org.openhab.transform.exec/README.md index 50b30035f64b9..41b76eed8ca25 100644 --- a/bundles/org.openhab.transform.exec/README.md +++ b/bundles/org.openhab.transform.exec/README.md @@ -75,6 +75,6 @@ Please note: This profile is a one-way transformation, i.e. only values from a d # Further Reading * [Manual](http://man7.org/linux/man-pages/man1/date.1.html) and [tutorial](https://linode.com/docs/tools-reference/tools/use-the-date-command-in-linux/) for date. -* [Manual](http://man7.org/linux/man-pages/man1/numfmt.1.html) and [tutorial](http://www.pixelbeat.org/docs/numfmt.html) for numfmt. +* [Manual](http://man7.org/linux/man-pages/man1/numfmt.1.html) and [tutorial](https://www.pixelbeat.org/docs/numfmt.html) for numfmt. diff --git a/bundles/org.openhab.transform.exec/pom.xml b/bundles/org.openhab.transform.exec/pom.xml index 23ab456ca1b76..ff6f1648a36ed 100644 --- a/bundles/org.openhab.transform.exec/pom.xml +++ b/bundles/org.openhab.transform.exec/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.exec diff --git a/bundles/org.openhab.transform.exec/src/main/feature/feature.xml b/bundles/org.openhab.transform.exec/src/main/feature/feature.xml index 7227595c1fcb1..dc678a798f21b 100644 --- a/bundles/org.openhab.transform.exec/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.exec/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/ExecTransformationService.java b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/ExecTransformationService.java index d3d3ceb85858e..ed778b5d6d777 100644 --- a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/ExecTransformationService.java +++ b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/ExecTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java index 3e3f842700108..3648c769d45f3 100644 --- a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java +++ b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfileFactory.java b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfileFactory.java index fd78dff290966..ff81850b4d335 100644 --- a/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.exec/src/main/resources/readme.txt b/bundles/org.openhab.transform.exec/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.exec/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.exec/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.javascript/NOTICE b/bundles/org.openhab.transform.javascript/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.javascript/NOTICE +++ b/bundles/org.openhab.transform.javascript/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.javascript/pom.xml b/bundles/org.openhab.transform.javascript/pom.xml index 0977ad8c13754..03004b225be68 100644 --- a/bundles/org.openhab.transform.javascript/pom.xml +++ b/bundles/org.openhab.transform.javascript/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.javascript diff --git a/bundles/org.openhab.transform.javascript/src/main/feature/feature.xml b/bundles/org.openhab.transform.javascript/src/main/feature/feature.xml index 6d581fe5eb8a9..4081672ac78a1 100644 --- a/bundles/org.openhab.transform.javascript/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.javascript/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptEngineManager.java b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptEngineManager.java index bae2e000f9d44..c3e6b79b173a9 100644 --- a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptEngineManager.java +++ b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptEngineManager.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptTransformationService.java b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptTransformationService.java index 24c43b8f7a590..605374f2e5080 100644 --- a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptTransformationService.java +++ b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/JavaScriptTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/TransformationScriptWatcher.java b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/TransformationScriptWatcher.java index 53e01ee6dbe13..0d345ada7f69a 100644 --- a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/TransformationScriptWatcher.java +++ b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/TransformationScriptWatcher.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfile.java b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfile.java index 8ba6d0ae18393..9cae852b91489 100644 --- a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfile.java +++ b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfileFactory.java b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfileFactory.java index 027e753af56aa..e9f8901788eab 100644 --- a/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.javascript/src/main/java/org/openhab/transform/javascript/internal/profiles/JavascriptTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.javascript/src/main/resources/ESH-INF/config/javascriptProfile.xml b/bundles/org.openhab.transform.javascript/src/main/resources/ESH-INF/config/javascriptProfile.xml index 8ad3703bc7321..21f7df45459f4 100644 --- a/bundles/org.openhab.transform.javascript/src/main/resources/ESH-INF/config/javascriptProfile.xml +++ b/bundles/org.openhab.transform.javascript/src/main/resources/ESH-INF/config/javascriptProfile.xml @@ -6,7 +6,7 @@ - + Filename of the JavaScript in the transform folder. The state will be available in the variable \"input\". diff --git a/bundles/org.openhab.transform.javascript/src/main/resources/readme.txt b/bundles/org.openhab.transform.javascript/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.javascript/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.javascript/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.jinja/NOTICE b/bundles/org.openhab.transform.jinja/NOTICE index 9a217ab009fb6..d917b14cfa37e 100644 --- a/bundles/org.openhab.transform.jinja/NOTICE +++ b/bundles/org.openhab.transform.jinja/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.transform.jinja/noEmbedDependencies.profile b/bundles/org.openhab.transform.jinja/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.transform.jinja/pom.xml b/bundles/org.openhab.transform.jinja/pom.xml index 11b04d374a090..7e4977743287b 100644 --- a/bundles/org.openhab.transform.jinja/pom.xml +++ b/bundles/org.openhab.transform.jinja/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.jinja @@ -18,31 +17,31 @@ org.openhab.osgiify com.hubspot.jinjava.jinjava 2.5.0 - provided + compile org.jsoup jsoup 1.8.3 - provided + compile com.google.guava guava 21.0 - provided + compile org.openhab.osgiify com.google.re2j.re2j 1.2 - provided + compile org.apache.commons commons-lang3 3.4 - provided + compile diff --git a/bundles/org.openhab.transform.jinja/src/main/feature/feature.xml b/bundles/org.openhab.transform.jinja/src/main/feature/feature.xml index 01be51c124cbe..d819d8eb53c14 100644 --- a/bundles/org.openhab.transform.jinja/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.jinja/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/JinjaTransformationService.java b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/JinjaTransformationService.java index 7515104630d64..78397b290dc16 100644 --- a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/JinjaTransformationService.java +++ b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/JinjaTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfile.java b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfile.java index 2523c4dbe6ac3..10fc6bfd84faf 100644 --- a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfile.java +++ b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfileFactory.java b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfileFactory.java index 372ec693c2d79..a1807b348a0c1 100644 --- a/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.jinja/src/main/java/org/openhab/transform/jinja/internal/profiles/JinjaTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jinja/src/main/resources/ESH-INF/config/jinjaProfile.xml b/bundles/org.openhab.transform.jinja/src/main/resources/ESH-INF/config/jinjaProfile.xml index 0a94ecb109fec..c100130ec3765 100644 --- a/bundles/org.openhab.transform.jinja/src/main/resources/ESH-INF/config/jinjaProfile.xml +++ b/bundles/org.openhab.transform.jinja/src/main/resources/ESH-INF/config/jinjaProfile.xml @@ -7,7 +7,7 @@ - + Template to be evaluated. For example: {{ value_json.device.status.temperature }} diff --git a/bundles/org.openhab.transform.jinja/src/test/java/org/openhab/transform/jinja/internal/JinjaTransformationServiceTest.java b/bundles/org.openhab.transform.jinja/src/test/java/org/openhab/transform/jinja/internal/JinjaTransformationServiceTest.java index b4bd9cefe5dba..cfcf09a4f161f 100644 --- a/bundles/org.openhab.transform.jinja/src/test/java/org/openhab/transform/jinja/internal/JinjaTransformationServiceTest.java +++ b/bundles/org.openhab.transform.jinja/src/test/java/org/openhab/transform/jinja/internal/JinjaTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jsonpath/NOTICE b/bundles/org.openhab.transform.jsonpath/NOTICE index 4c20ef446c1e4..645df4efd674d 100644 --- a/bundles/org.openhab.transform.jsonpath/NOTICE +++ b/bundles/org.openhab.transform.jsonpath/NOTICE @@ -10,4 +10,22 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons + +== Third-party Content + +json-path +* License: Apache 2.0 +* Project: https://github.com/jayway/JsonPath +* Source: https://github.com/jayway/JsonPath + +json-smart, accessors-smart +* License: Apache 2.0 +* Project: https://github.com/netplex/json-smart-v2 +* Source: https://github.com/netplex/json-smart-v2 + +asm +* License: BSD +* Project: https://asm.ow2.io/index.html +* Source: https://gitlab.ow2.org/asm/asm + diff --git a/bundles/org.openhab.transform.jsonpath/pom.xml b/bundles/org.openhab.transform.jsonpath/pom.xml index 1b1cb580728c2..a1e355ea617b7 100644 --- a/bundles/org.openhab.transform.jsonpath/pom.xml +++ b/bundles/org.openhab.transform.jsonpath/pom.xml @@ -1,42 +1,45 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.jsonpath openHAB Add-ons :: Bundles :: Transformation Service :: JSonPath + + !org.apache.tapestry5.json.*,!org.codehaus.jettison.json.*,!org.json.*,!com.fasterxml.jackson.* + + com.jayway.jsonpath json-path 2.4.0 - provided + compile org.ow2.asm asm 5.0.4 - provided + compile net.minidev accessors-smart 1.2 - provided + compile net.minidev json-smart 2.3 - provided + compile diff --git a/bundles/org.openhab.transform.jsonpath/src/main/feature/feature.xml b/bundles/org.openhab.transform.jsonpath/src/main/feature/feature.xml index bb36d349c3dcd..06a1176713877 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.jsonpath/src/main/feature/feature.xml @@ -1,13 +1,9 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base - mvn:com.jayway.jsonpath/json-path/2.4.0 - mvn:org.ow2.asm/asm/5.0.4 - mvn:net.minidev/accessors-smart/1.2 - mvn:net.minidev/json-smart/2.3 mvn:org.openhab.addons.bundles/org.openhab.transform.jsonpath/${project.version} diff --git a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationService.java b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationService.java index 297a37a479c77..dc3183bf23bae 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationService.java +++ b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfile.java b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfile.java index a2235c8fe983e..6311ff1e773e9 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfile.java +++ b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfileFactory.java b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfileFactory.java index 0d79b1372467e..67f79f4dbca2f 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.jsonpath/src/main/java/org/openhab/transform/jsonpath/internal/profiles/JSonPathTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.jsonpath/src/main/resources/ESH-INF/config/jsonpathProfile.xml b/bundles/org.openhab.transform.jsonpath/src/main/resources/ESH-INF/config/jsonpathProfile.xml index 0e49db531fa5b..5dd71031d589b 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/resources/ESH-INF/config/jsonpathProfile.xml +++ b/bundles/org.openhab.transform.jsonpath/src/main/resources/ESH-INF/config/jsonpathProfile.xml @@ -6,7 +6,7 @@ - + Expression to be applied on the state. For example: $.device.status.temperature diff --git a/bundles/org.openhab.transform.jsonpath/src/main/resources/readme.txt b/bundles/org.openhab.transform.jsonpath/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.jsonpath/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.jsonpath/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.jsonpath/src/test/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationServiceTest.java b/bundles/org.openhab.transform.jsonpath/src/test/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationServiceTest.java index 3b5d2d184ae7d..377f07c0a8cd8 100644 --- a/bundles/org.openhab.transform.jsonpath/src/test/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationServiceTest.java +++ b/bundles/org.openhab.transform.jsonpath/src/test/java/org/openhab/transform/jsonpath/internal/JSonPathTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.map/NOTICE b/bundles/org.openhab.transform.map/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.map/NOTICE +++ b/bundles/org.openhab.transform.map/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.map/conf/transform/map/doorstatus_defaulted.map b/bundles/org.openhab.transform.map/conf/transform/map/doorstatus_defaulted.map index c9e36819e0e2a..b689d976f8247 100644 --- a/bundles/org.openhab.transform.map/conf/transform/map/doorstatus_defaulted.map +++ b/bundles/org.openhab.transform.map/conf/transform/map/doorstatus_defaulted.map @@ -3,4 +3,4 @@ OPEN=open -=- # Default mapping for missing keys -=Default Value \ No newline at end of file +=Default Value diff --git a/bundles/org.openhab.transform.map/pom.xml b/bundles/org.openhab.transform.map/pom.xml index b9dedf5d256da..dc0f7d319963a 100644 --- a/bundles/org.openhab.transform.map/pom.xml +++ b/bundles/org.openhab.transform.map/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.map diff --git a/bundles/org.openhab.transform.map/src/main/feature/feature.xml b/bundles/org.openhab.transform.map/src/main/feature/feature.xml index c4b6fa1ac39e1..140e669efef06 100644 --- a/bundles/org.openhab.transform.map/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.map/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java index 06aba3241f1ad..263e817b2251f 100644 --- a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java +++ b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/MapTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfile.java b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfile.java index b36fd4a5c52cf..01eb6b0e679a8 100644 --- a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfile.java +++ b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfileFactory.java b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfileFactory.java index 6fe9b349acc81..7721dfb256153 100644 --- a/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.map/src/main/java/org/openhab/transform/map/internal/profiles/MapTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.map/src/main/resources/readme.txt b/bundles/org.openhab.transform.map/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.map/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.map/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.map/src/test/java/org/openhab/transform/map/internal/MapTransformationServiceTest.java b/bundles/org.openhab.transform.map/src/test/java/org/openhab/transform/map/internal/MapTransformationServiceTest.java index c4c581229583b..f19bdc5d231c2 100644 --- a/bundles/org.openhab.transform.map/src/test/java/org/openhab/transform/map/internal/MapTransformationServiceTest.java +++ b/bundles/org.openhab.transform.map/src/test/java/org/openhab/transform/map/internal/MapTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -23,13 +23,16 @@ import java.util.concurrent.Callable; import org.apache.commons.io.FileUtils; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.openhab.transform.map.internal.MapTransformationService; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.osgi.framework.BundleContext; /** - * @author Gaël L'hopital + * @author Gaël L'hopital - Initial contribution */ public class MapTransformationServiceTest { @@ -44,28 +47,50 @@ public class MapTransformationServiceTest { private static final String CONFIG_FOLDER = BASE_FOLDER + File.separator + SRC_FOLDER; private static final String USED_FILENAME = CONFIG_FOLDER + File.separator + "transform/" + EXISTING_FILENAME_DE; - private MapTransformationService processor; + @Mock + private BundleContext bundleContext; + + private TestableMapTransformationService processor; + + private class TestableMapTransformationService extends MapTransformationService { + @Override + protected String getSourcePath() { + return BASE_FOLDER + File.separator + super.getSourcePath(); + } + + @Override + protected Locale getLocale() { + return Locale.US; + } + + @Override + public void activate(BundleContext context) { + super.activate(context); + } + + @Override + public void deactivate() { + super.deactivate(); + } + }; @Before - public void init() throws IOException { - processor = new MapTransformationService() { - @Override - protected String getSourcePath() { - return BASE_FOLDER + File.separator + super.getSourcePath(); - } + public void setUp() throws IOException { + MockitoAnnotations.initMocks(this); - @Override - protected Locale getLocale() { - return Locale.US; - } - }; - FileUtils.deleteDirectory(new File(CONFIG_FOLDER)); + processor = new TestableMapTransformationService(); + processor.activate(bundleContext); FileUtils.copyDirectory(new File(SRC_FOLDER), new File(CONFIG_FOLDER)); } + @After + public void tearDown() throws IOException { + processor.deactivate(); + FileUtils.deleteDirectory(new File(CONFIG_FOLDER)); + } + @Test public void testTransformByMap() throws Exception { - // Test that we find a translation in an existing file String transformedResponse = processor.transform(EXISTING_FILENAME_DE, SOURCE_CLOSED); Assert.assertEquals("zu", transformedResponse); diff --git a/bundles/org.openhab.transform.regex/NOTICE b/bundles/org.openhab.transform.regex/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.regex/NOTICE +++ b/bundles/org.openhab.transform.regex/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.regex/pom.xml b/bundles/org.openhab.transform.regex/pom.xml index 367157a6f0fb0..a63a16ce79391 100644 --- a/bundles/org.openhab.transform.regex/pom.xml +++ b/bundles/org.openhab.transform.regex/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.regex diff --git a/bundles/org.openhab.transform.regex/src/main/feature/feature.xml b/bundles/org.openhab.transform.regex/src/main/feature/feature.xml index a1cccfc5bb66e..abf07d2b42a3e 100644 --- a/bundles/org.openhab.transform.regex/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.regex/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/RegExTransformationService.java b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/RegExTransformationService.java index 5c19683bdbb94..079ecc42fd5a7 100644 --- a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/RegExTransformationService.java +++ b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/RegExTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfile.java b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfile.java index 51aa8de786701..a48f969b09181 100644 --- a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfile.java +++ b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfileFactory.java b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfileFactory.java index d6dc73165c191..80e19be13c91c 100644 --- a/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.regex/src/main/java/org/openhab/transform/regex/internal/profiles/RegexTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.regex/src/main/resources/ESH-INF/config/regexProfile.xml b/bundles/org.openhab.transform.regex/src/main/resources/ESH-INF/config/regexProfile.xml index 8ad98f02509af..e10cde18988a6 100644 --- a/bundles/org.openhab.transform.regex/src/main/resources/ESH-INF/config/regexProfile.xml +++ b/bundles/org.openhab.transform.regex/src/main/resources/ESH-INF/config/regexProfile.xml @@ -6,7 +6,7 @@ - + Regular expression to be applied on the state. Should contain a capture group whose outcome will be the result. For example: .*=(\\d*.\\d*).* extracts the 23.5 from temp=23.5°C diff --git a/bundles/org.openhab.transform.regex/src/main/resources/readme.txt b/bundles/org.openhab.transform.regex/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.regex/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.regex/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/AbstractTransformationServiceTest.java b/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/AbstractTransformationServiceTest.java index 6b2ab2531de1c..c34a3fa16ab04 100644 --- a/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/AbstractTransformationServiceTest.java +++ b/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/AbstractTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/RegExTransformationServiceTest.java b/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/RegExTransformationServiceTest.java index 7eb1bddcca246..0f42629e3eefd 100644 --- a/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/RegExTransformationServiceTest.java +++ b/bundles/org.openhab.transform.regex/src/test/java/org/openhab/transform/regex/internal/RegExTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.scale/NOTICE b/bundles/org.openhab.transform.scale/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.scale/NOTICE +++ b/bundles/org.openhab.transform.scale/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.scale/README.md b/bundles/org.openhab.transform.scale/README.md index 86ac428dcaeed..4c6123bedefb7 100644 --- a/bundles/org.openhab.transform.scale/README.md +++ b/bundles/org.openhab.transform.scale/README.md @@ -1,6 +1,6 @@ # Scale Transformation Service -The Scale Transformation Service is a an easy to handle tool that can help you with the discretization of number inputs. +The Scale Transformation Service is an easy to handle tool that can help you with the discretization of number inputs. It transforms a given input by matching it to specified ranges. The input string must be in numerical format. @@ -60,7 +60,7 @@ Referenced scale file `uvindex.scale` in the `transform` folder: ]3..6]=2 ]6..8]=3 ]8..10]=4 -[10..100]=5 +]10..100]=5 ``` Each value the item receives, will be categorized to one of the five given ranges. diff --git a/bundles/org.openhab.transform.scale/pom.xml b/bundles/org.openhab.transform.scale/pom.xml index 422a9095c084c..239e93efb3fed 100644 --- a/bundles/org.openhab.transform.scale/pom.xml +++ b/bundles/org.openhab.transform.scale/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.scale diff --git a/bundles/org.openhab.transform.scale/src/main/feature/feature.xml b/bundles/org.openhab.transform.scale/src/main/feature/feature.xml index 58ba671822df7..2e5b6444341c1 100644 --- a/bundles/org.openhab.transform.scale/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.scale/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/Range.java b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/Range.java index 47074f393cf2f..77599d4aeaec2 100644 --- a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/Range.java +++ b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/Range.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java index 254ca60e27f61..101b4d12f0ceb 100644 --- a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java +++ b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/ScaleTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfile.java b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfile.java index a42d981bc97a2..299ab443d68c0 100644 --- a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfile.java +++ b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfileFactory.java b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfileFactory.java index 5da348d74bd16..40af188f7605d 100644 --- a/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.scale/src/main/java/org/openhab/transform/scale/internal/profiles/ScaleTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.scale/src/main/resources/readme.txt b/bundles/org.openhab.transform.scale/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.scale/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.scale/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.scale/src/test/java/org/openhab/transform/scale/internal/ScaleTransformServiceTest.java b/bundles/org.openhab.transform.scale/src/test/java/org/openhab/transform/scale/internal/ScaleTransformServiceTest.java index e26260e31ee1a..32013550de338 100644 --- a/bundles/org.openhab.transform.scale/src/test/java/org/openhab/transform/scale/internal/ScaleTransformServiceTest.java +++ b/bundles/org.openhab.transform.scale/src/test/java/org/openhab/transform/scale/internal/ScaleTransformServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xpath/NOTICE b/bundles/org.openhab.transform.xpath/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.xpath/NOTICE +++ b/bundles/org.openhab.transform.xpath/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.xpath/README.md b/bundles/org.openhab.transform.xpath/README.md index 22030222f43e9..f0bfe7d367cce 100644 --- a/bundles/org.openhab.transform.xpath/README.md +++ b/bundles/org.openhab.transform.xpath/README.md @@ -115,5 +115,5 @@ Please note: This profile is a one-way transformation, i.e. only values from a d ## Further Reading * An [introduction](https://www.w3schools.com/xml/xpath_intro.asp) to XPath at W3School -* A informative explanation of [common mistakes](https://qxf2.com/blog/common-xpath-mistakes/). +* An informative explanation of [common mistakes](https://qxf2.com/blog/common-xpath-mistakes/). * Online validation tools like [this](https://www.freeformatter.com/xpath-tester.html) to check the syntax. diff --git a/bundles/org.openhab.transform.xpath/pom.xml b/bundles/org.openhab.transform.xpath/pom.xml index a144ddb0e2c10..ced8ffabe9c2f 100644 --- a/bundles/org.openhab.transform.xpath/pom.xml +++ b/bundles/org.openhab.transform.xpath/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.xpath diff --git a/bundles/org.openhab.transform.xpath/src/main/feature/feature.xml b/bundles/org.openhab.transform.xpath/src/main/feature/feature.xml index a8375cc2a37a1..94b64066b8c7f 100644 --- a/bundles/org.openhab.transform.xpath/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.xpath/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/XPathTransformationService.java b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/XPathTransformationService.java index 3bbbec0380ec5..dc4a886210a47 100644 --- a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/XPathTransformationService.java +++ b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/XPathTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfile.java b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfile.java index b649ebb4d6f41..ef487dd4bb249 100644 --- a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfile.java +++ b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfileFactory.java b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfileFactory.java index 0d6da20326243..8b9896c869f36 100644 --- a/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.xpath/src/main/java/org/openhab/transform/xpath/internal/profiles/XPathTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xpath/src/main/resources/ESH-INF/config/xpathProfile.xml b/bundles/org.openhab.transform.xpath/src/main/resources/ESH-INF/config/xpathProfile.xml index 589da538624c5..b25645d887d98 100644 --- a/bundles/org.openhab.transform.xpath/src/main/resources/ESH-INF/config/xpathProfile.xml +++ b/bundles/org.openhab.transform.xpath/src/main/resources/ESH-INF/config/xpathProfile.xml @@ -6,7 +6,7 @@ - + XPath expression to be applied on the state: For example: /*[name()='PTZStatus']/*[name()='AbsoluteHigh']/*[name()='azimuth']/ diff --git a/bundles/org.openhab.transform.xpath/src/main/resources/readme.txt b/bundles/org.openhab.transform.xpath/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.xpath/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.xpath/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/AbstractTransformationServiceTest.java b/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/AbstractTransformationServiceTest.java index 513204ea73428..cbf6b511d5702 100644 --- a/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/AbstractTransformationServiceTest.java +++ b/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/AbstractTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/XPathTransformationServiceTest.java b/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/XPathTransformationServiceTest.java index a8231110ae6bd..b3015b190f232 100644 --- a/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/XPathTransformationServiceTest.java +++ b/bundles/org.openhab.transform.xpath/src/test/java/org/openhab/transform/xpath/internal/XPathTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xslt/NOTICE b/bundles/org.openhab.transform.xslt/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.transform.xslt/NOTICE +++ b/bundles/org.openhab.transform.xslt/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.transform.xslt/pom.xml b/bundles/org.openhab.transform.xslt/pom.xml index 28de38e3343f8..dbc51d3821bac 100644 --- a/bundles/org.openhab.transform.xslt/pom.xml +++ b/bundles/org.openhab.transform.xslt/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.transform.xslt diff --git a/bundles/org.openhab.transform.xslt/src/main/feature/feature.xml b/bundles/org.openhab.transform.xslt/src/main/feature/feature.xml index f7e36a2a4eb75..886d7b1718097 100644 --- a/bundles/org.openhab.transform.xslt/src/main/feature/feature.xml +++ b/bundles/org.openhab.transform.xslt/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/XsltTransformationService.java b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/XsltTransformationService.java index 7493553b2a8ad..690a8e7e2151b 100644 --- a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/XsltTransformationService.java +++ b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/XsltTransformationService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfile.java b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfile.java index 7a85d778675fc..2ff906344e0f1 100644 --- a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfile.java +++ b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfile.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfileFactory.java b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfileFactory.java index b5aa7e5a327b2..fcd2fc512178a 100644 --- a/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfileFactory.java +++ b/bundles/org.openhab.transform.xslt/src/main/java/org/openhab/transform/xslt/internal/profiles/XSLTTransformationProfileFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xslt/src/main/resources/readme.txt b/bundles/org.openhab.transform.xslt/src/main/resources/readme.txt index 98698c670dc39..a2ee892dc45ba 100644 --- a/bundles/org.openhab.transform.xslt/src/main/resources/readme.txt +++ b/bundles/org.openhab.transform.xslt/src/main/resources/readme.txt @@ -1 +1 @@ -Bundle resources go in here! \ No newline at end of file +Bundle resources go in here! diff --git a/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/AbstractTransformationServiceTest.java b/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/AbstractTransformationServiceTest.java index 60b9c1e3c262d..dd3b343db2381 100644 --- a/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/AbstractTransformationServiceTest.java +++ b/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/AbstractTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/XsltTransformationServiceTest.java b/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/XsltTransformationServiceTest.java index 47caad6bd34ae..d179faa06faca 100644 --- a/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/XsltTransformationServiceTest.java +++ b/bundles/org.openhab.transform.xslt/src/test/java/org/openhab/transform/xslt/internal/XsltTransformationServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/NOTICE b/bundles/org.openhab.voice.googletts/NOTICE index 52d580437d634..b41af11d1952d 100644 --- a/bundles/org.openhab.voice.googletts/NOTICE +++ b/bundles/org.openhab.voice.googletts/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.voice.googletts/README.md b/bundles/org.openhab.voice.googletts/README.md index 37513266b8046..06ef12e5be18d 100644 --- a/bundles/org.openhab.voice.googletts/README.md +++ b/bundles/org.openhab.voice.googletts/README.md @@ -35,7 +35,7 @@ Before you can integrate this service with your Google Cloud Text-to-Speech, you ## Service Configuration -Using your favourite configuration UI (e.g. PaperUI) edit **Services/Voice/Google Cloud Text-to-Speech** settings and set +Using your favourite configuration UI (e.g. Paper UI) edit **Services/Voice/Google Cloud Text-to-Speech** settings and set * **Service Account Key** - Copy-paste the content of the downloaded key file. * **Pitch** - The pitch of selected voice, up to 20 semitones diff --git a/bundles/org.openhab.voice.googletts/noEmbedDependencies.profile b/bundles/org.openhab.voice.googletts/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.voice.googletts/pom.xml b/bundles/org.openhab.voice.googletts/pom.xml index a5c86b0271b8e..084f5b0df9d99 100644 --- a/bundles/org.openhab.voice.googletts/pom.xml +++ b/bundles/org.openhab.voice.googletts/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.googletts @@ -18,31 +17,31 @@ org.openhab.osgiify com.google.api.api-common 1.7.0 - provided + compile org.openhab.osgiify com.google.auth.google-auth-library-credentials 0.13.0 - provided + compile org.openhab.osgiify com.google.auth.google-auth-library-oauth2-http 0.13.0 - provided + compile org.openhab.osgiify com.google.api.gax 1.42.0 - provided + compile com.google.http-client google-http-client 1.27.0 - provided + compile diff --git a/bundles/org.openhab.voice.googletts/src/main/feature/feature.xml b/bundles/org.openhab.voice.googletts/src/main/feature/feature.xml index ca87e0f2022b5..f09b9d8b6482a 100644 --- a/bundles/org.openhab.voice.googletts/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.googletts/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleCloudAPI.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleCloudAPI.java index 620e187420b8c..57f9624a54a45 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleCloudAPI.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleCloudAPI.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSConfig.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSConfig.java index 54e80f26e86f2..719ba47cc557d 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSConfig.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java index 24521367a3651..fed6c5f1a225d 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java index e51c2f6fae247..97069c64810e7 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/GoogleTTSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioConfig.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioConfig.java index a8f609d9d65e6..1126f9e4f070d 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioConfig.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioEncoding.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioEncoding.java index e8838963d3120..0bfceb685acf9 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioEncoding.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/AudioEncoding.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/ListVoicesResponse.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/ListVoicesResponse.java index 8fea44982de14..9acf1d643edd0 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/ListVoicesResponse.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/ListVoicesResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SsmlVoiceGender.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SsmlVoiceGender.java index d3c80d468042d..98869fd3ef445 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SsmlVoiceGender.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SsmlVoiceGender.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesisInput.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesisInput.java index 2b9fc0cc5ff24..aa9332725ef3f 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesisInput.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesisInput.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechRequest.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechRequest.java index 580a0c7798592..0bfb00f6915e4 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechRequest.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechRequest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechResponse.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechResponse.java index 847e640fc39f6..a552b4db125d8 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechResponse.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/SynthesizeSpeechResponse.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/Voice.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/Voice.java index c14fec8e2eff1..ff7e3911f4b94 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/Voice.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/Voice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/VoiceSelectionParams.java b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/VoiceSelectionParams.java index bc104c83715e4..33481c0f55a21 100644 --- a/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/VoiceSelectionParams.java +++ b/bundles/org.openhab.voice.googletts/src/main/java/org/openhab/voice/googletts/internal/protocol/VoiceSelectionParams.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.mactts/pom.xml b/bundles/org.openhab.voice.mactts/pom.xml index a952963e308d8..568d5ecbf6858 100644 --- a/bundles/org.openhab.voice.mactts/pom.xml +++ b/bundles/org.openhab.voice.mactts/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.mactts diff --git a/bundles/org.openhab.voice.mactts/src/main/feature/feature.xml b/bundles/org.openhab.voice.mactts/src/main/feature/feature.xml index 1dfbc383d0ff2..d9ea436b913b3 100644 --- a/bundles/org.openhab.voice.mactts/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.mactts/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSAudioStream.java b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSAudioStream.java index dd49bd7e70278..2312ba1d36a64 100644 --- a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSAudioStream.java +++ b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java index 498efcd6249f3..9911343edf541 100644 --- a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java +++ b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSVoice.java b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSVoice.java index 9417a8f1a1ebb..91246f611aaf4 100644 --- a/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSVoice.java +++ b/bundles/org.openhab.voice.mactts/src/main/java/org/openhab/voice/mactts/internal/MacTTSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/MacTTSVoiceTest.java b/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/MacTTSVoiceTest.java index 8febe6a07c769..3d40103b4efd2 100644 --- a/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/MacTTSVoiceTest.java +++ b/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/MacTTSVoiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. @@ -16,21 +16,20 @@ import java.io.IOException; import java.io.InputStreamReader; +import org.apache.commons.io.IOUtils; import org.junit.Assert; import org.junit.Assume; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.apache.commons.io.IOUtils; - /** * Test MacTTSVoice * * @author Kelly Davis - Initial contribution and API */ public class MacTTSVoiceTest { - + Logger logger = LoggerFactory.getLogger(this.getClass()); /** @@ -74,7 +73,7 @@ public void getUIDTest() { } catch (IOException e) { Assert.fail("getUIDTest() failed with IOException: " + e.getMessage()); } finally { - IOUtils.closeQuietly(bufferedReader); + IOUtils.closeQuietly(bufferedReader); } } diff --git a/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/TTSServiceMacOSTest.java b/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/TTSServiceMacOSTest.java index 277a946c9e257..fa38d545716ba 100644 --- a/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/TTSServiceMacOSTest.java +++ b/bundles/org.openhab.voice.mactts/src/test/java/org/openhab/voice/mactts/internal/TTSServiceMacOSTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.marytts/.classpath b/bundles/org.openhab.voice.marytts/.classpath index 59b7c95efa144..91356226c1031 100644 --- a/bundles/org.openhab.voice.marytts/.classpath +++ b/bundles/org.openhab.voice.marytts/.classpath @@ -23,23 +23,10 @@ - - - - - - - - - - - - - - - - - - + + + + + diff --git a/bundles/org.openhab.voice.marytts/NOTICE b/bundles/org.openhab.voice.marytts/NOTICE index 669f6069135ca..a048490f94bad 100644 --- a/bundles/org.openhab.voice.marytts/NOTICE +++ b/bundles/org.openhab.voice.marytts/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.voice.marytts/README-DEV.txt b/bundles/org.openhab.voice.marytts/README-DEV.txt deleted file mode 100644 index f3b78a7da8487..0000000000000 --- a/bundles/org.openhab.voice.marytts/README-DEV.txt +++ /dev/null @@ -1,8 +0,0 @@ -In order to successfully use Mary TTS when launching the openHAB runtime from within your IDE, -you need a couple of additional libraries in the lib folder. - -The required jars are available at https://bintray.com/artifact/download/openhab/3rd/marytts -Simply copy all those jars (you can download them all as a single zip) to the "lib" folder of this bundle and you are done. - -Note that this step is automatically done during the Maven build (see the pom.xml), so if you have triggered the Maven build -at least once, everything should already be in place. \ No newline at end of file diff --git a/bundles/org.openhab.voice.marytts/README.md b/bundles/org.openhab.voice.marytts/README.md index 0030aa534d43a..2d63e1eef1fa1 100644 --- a/bundles/org.openhab.voice.marytts/README.md +++ b/bundles/org.openhab.voice.marytts/README.md @@ -4,7 +4,7 @@ The Mary Text-to-Speech (TTS) service is a pure Java implementation of a TTS service, which uses the [MaryTTS](http://mary.dfki.de/) project of DFKI. -While it provides good quality results, it must be noted that it is too heavy-weight for most embedded hardware like Raspberry Pis. When using this service, you should be running openHAB on some real server instead. +While it provides good quality results, it must be noted that it is too heavy-weight for most embedded hardware like a Raspberry Pi. When using this service, you should be running openHAB on some real server instead. ## Configuration diff --git a/bundles/org.openhab.voice.marytts/lib/.gitignore b/bundles/org.openhab.voice.marytts/lib/.gitignore deleted file mode 100644 index 359292bee3857..0000000000000 --- a/bundles/org.openhab.voice.marytts/lib/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -emotionml-checker-java-1.0-SNAPSHOT.jar -freetts-1.0.jar -freetts-de-1.0.jar -freetts-en_us-1.0.jar -jtok-core-1.9.1.jar -marytts-lang-de-5.1-SNAPSHOT.jar -marytts-lang-en-5.1-SNAPSHOT.jar -mwdumper-1.16.jar -opennlp-maxent-3.0.1-incubating.jar -opennlp-tools-1.5.1-incubating.jar -sgt-3.0.jar -voice-bits1-hsmm-5.0-SNAPSHOT.jar -voice-bits3-hsmm-5.0-SNAPSHOT.jar -voice-cmu-slt-hsmm-5.0.jar diff --git a/bundles/org.openhab.voice.marytts/lib/marytts-common-5.1-SNAPSHOT.jar b/bundles/org.openhab.voice.marytts/lib/marytts-common-5.1-SNAPSHOT.jar deleted file mode 100644 index ec28b9956562d..0000000000000 Binary files a/bundles/org.openhab.voice.marytts/lib/marytts-common-5.1-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.voice.marytts/lib/marytts-runtime-5.1-SNAPSHOT.jar b/bundles/org.openhab.voice.marytts/lib/marytts-runtime-5.1-SNAPSHOT.jar deleted file mode 100644 index de055708a2ece..0000000000000 Binary files a/bundles/org.openhab.voice.marytts/lib/marytts-runtime-5.1-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.voice.marytts/lib/marytts-server-5.1-SNAPSHOT.jar b/bundles/org.openhab.voice.marytts/lib/marytts-server-5.1-SNAPSHOT.jar deleted file mode 100644 index 5a5797e907dbf..0000000000000 Binary files a/bundles/org.openhab.voice.marytts/lib/marytts-server-5.1-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.voice.marytts/lib/marytts-signalproc-5.1-SNAPSHOT.jar b/bundles/org.openhab.voice.marytts/lib/marytts-signalproc-5.1-SNAPSHOT.jar deleted file mode 100644 index 2d58c4378a25d..0000000000000 Binary files a/bundles/org.openhab.voice.marytts/lib/marytts-signalproc-5.1-SNAPSHOT.jar and /dev/null differ diff --git a/bundles/org.openhab.voice.marytts/pom.xml b/bundles/org.openhab.voice.marytts/pom.xml index c01f80486510b..2be8e8ba6f4eb 100644 --- a/bundles/org.openhab.voice.marytts/pom.xml +++ b/bundles/org.openhab.voice.marytts/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.marytts @@ -14,193 +13,100 @@ openHAB Add-ons :: Bundles :: Voice :: Mary Text-to-Speech - com.ibm.uvm.tools;resolution:=optional,com.mysql.jdbc;resolution:=optional,com.sun.jdmk.comm;resolution:=optional,gnu.trove;resolution:=optional,javax.jms;resolution:=optional,javax.speech*;resolution:=optional,Lgov.noaa.pmel.util;resolution:=optional,net.didion.jwnl*;resolution:=optional,org.apache.http*;resolution:=optional,org.apache.xerces.impl*;resolution:=optional,org.hsqldb;resolution:=optional,org.jdesktop.layout*;resolution:=optional,org.postgresql;resolution:=optional + com.twmacinta.util;resolution:=optional,gnu.trove;resolution:=optional,Jama;resolution:=optional,Jampack;resolution:=optional,net.didion.jwnl*;resolution:=optional,org.apache.http*;resolution:=optional,org.apache.xerces.impl*;resolution:=optional,org.hsqldb;resolution:=optional,org.jdesktop.layout*;resolution:=optional - - - - - - com.savage7.maven.plugins - maven-external-dependency-plugin - 0.5 - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - com.savage7.maven.plugins - maven-external-dependency-plugin - [0.5,) - - resolve-external - - - - - - - - - - - - - - - com.savage7.maven.plugins - maven-external-dependency-plugin - - ${basedir}/lib - - - - com.sun.speech.freetts - freetts - 1.0 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/freetts-1.0.jar - true - - - - com.sun.speech.freetts - freetts-de - 1.0 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/freetts-de-1.0.jar - true - - - - com.sun.speech.freetts - freetts-en_us - 1.0 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/freetts-en_us-1.0.jar - true - - - - gov.noaa.pmel.sgt - sgt - 3.0 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/sgt-3.0.jar - true - - - - de.dfki.lt.jtok - jtok-core - 1.9.1 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/jtok-core-1.9.1.jar - true - - - - org.wikimedia - mwdumper - 1.16 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/mwdumper-1.16.jar - true - - - - emotionml-checker-java - emotionml-checker-java - 1.0-SNAPSHOT - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/emotionml-checker-java-1.0-SNAPSHOT.jar - true - - - - opennlp-maxent - opennlp-maxent - 3.0.1-incubating - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/opennlp-maxent-3.0.1-incubating.jar - true - - - - opennlp-tools - opennlp-tools - 1.5.1-incubating - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/opennlp-tools-1.5.1-incubating.jar - true - - - - marytts-lang-de - marytts-lang-de - 5.1-SNAPSHOT - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/marytts-lang-de-5.1-SNAPSHOT.jar - true - - - - marytts-lang-en - marytts-lang-en - 5.1-SNAPSHOT - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/marytts-lang-en-5.1-SNAPSHOT.jar - true - - - - voice-bits1-hsmm - voice-bits1-hsmm - 5.0-SNAPSHOT - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/voice-bits1-hsmm-5.0-SNAPSHOT.jar - true - - - - voice-bits3-hsmm - voice-bits3-hsmm - 5.0-SNAPSHOT - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/voice-bits3-hsmm-5.0-SNAPSHOT.jar - true - - - - voice-cmu-slt-hsmm - voice-cmu-slt-hsmm - 5.0 - jar - https://bintray.com/artifact/download/openhab/3rd/marytts/voice-cmu-slt-hsmm-5.0.jar - true - - - - - - - resolve-install-external-dependencies - - resolve-external - - process-resources - - - - - - + + + com.ibm.icu + icu4j + 54.1.1 + compile + + + commons-collections + commons-collections + 3.2.2 + compile + + + commons-io + commons-io + 2.5 + compile + + + de.dfki.lt.jtok + jtok-core + 1.9.3 + compile + + + de.dfki.mary + emotionml-checker-java + 1.1 + compile + + + de.dfki.mary + marytts-common + 5.2 + compile + + + de.dfki.mary + marytts-lang-de + 5.2 + compile + + + de.dfki.mary + marytts-lang-en + 5.2 + compile + + + de.dfki.mary + marytts-runtime + 5.2 + compile + + + de.dfki.mary + marytts-signalproc + 5.2 + compile + + + de.dfki.mary + voice-bits1-hsmm + 5.2 + compile + + + de.dfki.mary + voice-bits3-hsmm + 5.2 + compile + + + de.dfki.mary + voice-cmu-slt-hsmm + 5.2 + compile + + + org.apache.opennlp + opennlp-maxent + 3.0.3 + compile + + + org.apache.opennlp + opennlp-tools + 1.5.3 + compile + + diff --git a/bundles/org.openhab.voice.marytts/src/main/feature/feature.xml b/bundles/org.openhab.voice.marytts/src/main/feature/feature.xml index 4d83b741f18da..c7c64026ac2f7 100644 --- a/bundles/org.openhab.voice.marytts/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.marytts/src/main/feature/feature.xml @@ -1,9 +1,10 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base + mvn:commons-collections/commons-collections/3.2.2 mvn:org.openhab.addons.bundles/org.openhab.voice.marytts/${project.version} diff --git a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java index 8b6ef09aac42f..ff0372ab4ca21 100644 --- a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java +++ b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSService.java b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSService.java index 45bc308ff7c4e..964a4e39e4468 100644 --- a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSService.java +++ b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java index f00ecb7ae0071..5639b9c20015b 100644 --- a/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java +++ b/bundles/org.openhab.voice.marytts/src/main/java/org/openhab/voice/marytts/internal/MaryTTSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.marytts/src/main/resources/META-INF/services/marytts.config.MaryConfig b/bundles/org.openhab.voice.marytts/src/main/resources/META-INF/services/marytts.config.MaryConfig new file mode 100644 index 0000000000000..c12faf97ae211 --- /dev/null +++ b/bundles/org.openhab.voice.marytts/src/main/resources/META-INF/services/marytts.config.MaryConfig @@ -0,0 +1,6 @@ +marytts.config.MainConfig +marytts.language.de.GermanConfig +marytts.language.en.EnglishConfig +marytts.voice.Bits1Hsmm.Config +marytts.voice.Bits3Hsmm.Config +marytts.voice.CmuSltHsmm.Config diff --git a/bundles/org.openhab.voice.picotts/NOTICE b/bundles/org.openhab.voice.picotts/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.voice.picotts/NOTICE +++ b/bundles/org.openhab.voice.picotts/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.voice.picotts/README.md b/bundles/org.openhab.voice.picotts/README.md index f709d3cd61745..740e3d6c4050d 100644 --- a/bundles/org.openhab.voice.picotts/README.md +++ b/bundles/org.openhab.voice.picotts/README.md @@ -17,7 +17,7 @@ https://aur.archlinux.org/packages/svox-pico-bin/ ## Voices The following list are the only supported languages (as these are the languages supported by -pico2wave, see also [the documentation of the debian package](https://packages.debian.org/de/wheezy/libttspico-utils)): +pico2wave, see also [the documentation of the Debian package](https://packages.debian.org/de/wheezy/libttspico-utils)): ``` German (de-DE) diff --git a/bundles/org.openhab.voice.picotts/pom.xml b/bundles/org.openhab.voice.picotts/pom.xml index 5706a9d3f3b2e..71da41cc8637a 100644 --- a/bundles/org.openhab.voice.picotts/pom.xml +++ b/bundles/org.openhab.voice.picotts/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.picotts diff --git a/bundles/org.openhab.voice.picotts/src/main/feature/feature.xml b/bundles/org.openhab.voice.picotts/src/main/feature/feature.xml index c57deeffd5496..3fb597fe20aaf 100644 --- a/bundles/org.openhab.voice.picotts/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.picotts/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSAudioStream.java b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSAudioStream.java index 62516dc9a1800..fb8e895a995f0 100644 --- a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSAudioStream.java +++ b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java index 2f74686f423ce..50bf1af83f509 100644 --- a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java +++ b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSVoice.java b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSVoice.java index ae1c907cfb872..4b7e76b65bd28 100644 --- a/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSVoice.java +++ b/bundles/org.openhab.voice.picotts/src/main/java/org/openhab/voice/picotts/internal/PicoTTSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/NOTICE b/bundles/org.openhab.voice.pollytts/NOTICE index 76d5a474ce5ff..aa4f55f04db8c 100644 --- a/bundles/org.openhab.voice.pollytts/NOTICE +++ b/bundles/org.openhab.voice.pollytts/NOTICE @@ -10,7 +10,7 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons == Third-party Content diff --git a/bundles/org.openhab.voice.pollytts/README.md b/bundles/org.openhab.voice.pollytts/README.md index e9ffd041bcd0e..71249266e4842 100644 --- a/bundles/org.openhab.voice.pollytts/README.md +++ b/bundles/org.openhab.voice.pollytts/README.md @@ -14,7 +14,7 @@ You can find pricing information on the [documentation page](https://aws.amazon. When you sign up for AWS, your account is automatically signed up for all services in AWS, including Amazon Polly. -* Create an IAM User. [link](http://docs.aws.amazon.com/polly/latest/dg/setting-up.html) +* Create an IAM User. [link](https://docs.aws.amazon.com/polly/latest/dg/setting-up.html) Services in AWS, such as Amazon Polly, require that you provide credentials when you access them so that the service can determine whether you have permissions to access the resources owned by that service. Within the AWS console, you can create access keys for your AWS account to access the Polly API. diff --git a/bundles/org.openhab.voice.pollytts/noEmbedDependencies.profile b/bundles/org.openhab.voice.pollytts/noEmbedDependencies.profile new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/bundles/org.openhab.voice.pollytts/pom.xml b/bundles/org.openhab.voice.pollytts/pom.xml index 098384c5adb35..a10f49660f4ac 100644 --- a/bundles/org.openhab.voice.pollytts/pom.xml +++ b/bundles/org.openhab.voice.pollytts/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.pollytts @@ -18,13 +17,13 @@ org.openhab.osgiify com.amazonaws.aws-java-sdk-core 1.11.490 - provided + compile org.openhab.osgiify com.amazonaws.aws-java-sdk-polly 1.11.490 - provided + compile diff --git a/bundles/org.openhab.voice.pollytts/src/main/feature/feature.xml b/bundles/org.openhab.voice.pollytts/src/main/feature/feature.xml index e89e082b0ebaa..1f3f11e31e269 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.pollytts/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSAudioStream.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSAudioStream.java index 48c9f3a61ec14..8493f2cb9bc57 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSAudioStream.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java index 5e5bb1f603f30..ed4af0bdfac34 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java index c1ddca7c2d000..21331f9d2daa1 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/PollyTTSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/CachedPollyTTSCloudImpl.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/CachedPollyTTSCloudImpl.java index f6f118a185dd8..ddca4bc7e1747 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/CachedPollyTTSCloudImpl.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/CachedPollyTTSCloudImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSCloudImpl.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSCloudImpl.java index d16b02fea97ac..275d576ee31bc 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSCloudImpl.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSCloudImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSConfig.java b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSConfig.java index 73f15d1e231e9..8243233013f07 100644 --- a/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSConfig.java +++ b/bundles/org.openhab.voice.pollytts/src/main/java/org/openhab/voice/pollytts/internal/cloudapi/PollyTTSConfig.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/NOTICE b/bundles/org.openhab.voice.voicerss/NOTICE index 4c20ef446c1e4..38d625e349232 100644 --- a/bundles/org.openhab.voice.voicerss/NOTICE +++ b/bundles/org.openhab.voice.voicerss/NOTICE @@ -10,4 +10,4 @@ https://www.eclipse.org/legal/epl-2.0/. == Source Code -https://github.com/openhab/openhab2-addons +https://github.com/openhab/openhab-addons diff --git a/bundles/org.openhab.voice.voicerss/README.md b/bundles/org.openhab.voice.voicerss/README.md index 7457db46fdeca..740dbcafa33f1 100644 --- a/bundles/org.openhab.voice.voicerss/README.md +++ b/bundles/org.openhab.voice.voicerss/README.md @@ -2,7 +2,7 @@ ## Overview -VoiceRSS is an Internet based TTS service hosted at . +VoiceRSS is an Internet based TTS service hosted at . You must obtain an API Key to get access to this service. The free version allows you to make up to 350 requests per day; for more you may need a commercial subscription. diff --git a/bundles/org.openhab.voice.voicerss/pom.xml b/bundles/org.openhab.voice.voicerss/pom.xml index b187a033e53c4..122c8bcc9b872 100644 --- a/bundles/org.openhab.voice.voicerss/pom.xml +++ b/bundles/org.openhab.voice.voicerss/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.bundles org.openhab.addons.reactor.bundles - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.voice.voicerss diff --git a/bundles/org.openhab.voice.voicerss/src/main/feature/feature.xml b/bundles/org.openhab.voice.voicerss/src/main/feature/feature.xml index 5ec47bda66525..d449616c5ac0c 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/feature/feature.xml +++ b/bundles/org.openhab.voice.voicerss/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${project.version}/xml/features + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features openhab-runtime-base diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSAudioStream.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSAudioStream.java index 0a895a8037a4a..92e9738179af1 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSAudioStream.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSAudioStream.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java index 035af32bf44fe..fa63cbba41184 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSTTSService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java index e6781dfd5f6d2..784f540a052dc 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/CachedVoiceRSSCloudImpl.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/CachedVoiceRSSCloudImpl.java index 98820584caaae..d596797fe225b 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/CachedVoiceRSSCloudImpl.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/CachedVoiceRSSCloudImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudAPI.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudAPI.java index 76527f3aea1e4..c163a9d7eafa0 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudAPI.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudAPI.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudImpl.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudImpl.java index 66d41f7a3fa6a..5f843d7507cff 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudImpl.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/cloudapi/VoiceRSSCloudImpl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/tool/CreateTTSCache.java b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/tool/CreateTTSCache.java index 8a2a34bd15983..3576fad3be526 100644 --- a/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/tool/CreateTTSCache.java +++ b/bundles/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/tool/CreateTTSCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2010-2019 Contributors to the openHAB project + * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. diff --git a/bundles/pom.xml b/bundles/pom.xml index ea3f45b1206f6..0584f6f31206f 100644 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons org.openhab.addons.reactor - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.bundles @@ -17,8 +16,6 @@ - - org.openhab.io.homekit org.openhab.io.hueemulation org.openhab.io.imperihome @@ -70,6 +67,7 @@ org.openhab.binding.digitalstrom org.openhab.binding.dlinksmarthome org.openhab.binding.dmx + org.openhab.binding.doorbird org.openhab.binding.dscalarm org.openhab.binding.dsmr org.openhab.binding.dwdunwetter @@ -81,6 +79,7 @@ org.openhab.binding.feed org.openhab.binding.feican org.openhab.binding.folding + org.openhab.binding.foobot org.openhab.binding.freebox org.openhab.binding.fronius org.openhab.binding.fsinternetradio @@ -97,6 +96,7 @@ org.openhab.binding.homematic org.openhab.binding.hpprinter org.openhab.binding.hue + org.openhab.binding.hydrawise org.openhab.binding.hyperion org.openhab.binding.iaqualink org.openhab.binding.icloud @@ -113,6 +113,7 @@ org.openhab.binding.kostalinverter org.openhab.binding.lametrictime org.openhab.binding.leapmotion + org.openhab.binding.lghombot org.openhab.binding.lgtvserial org.openhab.binding.lgwebos org.openhab.binding.lifx @@ -124,11 +125,13 @@ org.openhab.binding.mail org.openhab.binding.max org.openhab.binding.mcp23017 + org.openhab.binding.melcloud org.openhab.binding.meteoblue org.openhab.binding.meteostick org.openhab.binding.miele org.openhab.binding.mihome org.openhab.binding.miio + org.openhab.binding.millheat org.openhab.binding.milight org.openhab.binding.minecraft org.openhab.binding.modbus @@ -143,8 +146,10 @@ org.openhab.binding.nest org.openhab.binding.netatmo org.openhab.binding.network + org.openhab.binding.networkupstools org.openhab.binding.nibeheatpump org.openhab.binding.nibeuplink + org.openhab.binding.nikobus org.openhab.binding.nikohomecontrol org.openhab.binding.ntp org.openhab.binding.nuki @@ -163,6 +168,7 @@ org.openhab.binding.pentair org.openhab.binding.phc org.openhab.binding.pioneeravr + org.openhab.binding.pixometer org.openhab.binding.pjlinkdevice org.openhab.binding.plclogo org.openhab.binding.plugwise @@ -181,6 +187,7 @@ org.openhab.binding.seneye org.openhab.binding.sensebox org.openhab.binding.serialbutton + org.openhab.binding.shelly org.openhab.binding.silvercrestwifisocket org.openhab.binding.siemensrds org.openhab.binding.sinope @@ -201,9 +208,9 @@ org.openhab.binding.systeminfo org.openhab.binding.tado org.openhab.binding.tankerkoenig + org.openhab.binding.telegram org.openhab.binding.tellstick org.openhab.binding.tesla - org.openhab.binding.toon org.openhab.binding.tplinksmarthome org.openhab.binding.tradfri org.openhab.binding.unifi @@ -213,6 +220,7 @@ org.openhab.binding.velbus org.openhab.binding.vitotronic org.openhab.binding.volvooncall + org.openhab.binding.weathercompany org.openhab.binding.weatherunderground org.openhab.binding.wemo org.openhab.binding.wifiled @@ -282,6 +290,10 @@ + + + + @@ -350,6 +362,7 @@ + biz.aQute.bnd @@ -371,7 +384,99 @@ org.apache.karaf.tooling karaf-maven-plugin + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + embed-dependencies + + unpack-dependencies + + + runtime + jar + javax.activation,org.apache.karaf.features + ${dep.noembedding} + ${project.build.directory}/classes + true + true + true + jar + + + + + + + + shrink-bundle + + + shrinkBundle.profile + + + + + + com.github.wvengen + proguard-maven-plugin + 2.1.1 + + + shrink-bundle + package + + proguard + + + + + false + true + ${project.build.directory} + + ${java.home}/lib/rt.jar + + + + + + + + + + + + + + + no-embed-dependencies + + + noEmbedDependencies.profile + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + embed-dependencies + none + + + + + + + + diff --git a/features/openhab-addons-external/pom.xml b/features/openhab-addons-external/pom.xml index 254fc38c3e2c3..99827de9f7b1b 100644 --- a/features/openhab-addons-external/pom.xml +++ b/features/openhab-addons-external/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.features.karaf org.openhab.addons.reactor.features.karaf - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.features.karaf.openhab-addons-external diff --git a/features/openhab-addons-external/src/main/resources/conf/cometvisu.cfg b/features/openhab-addons-external/src/main/resources/conf/cometvisu.cfg index bcda281650b33..0bc3afeede0f9 100644 --- a/features/openhab-addons-external/src/main/resources/conf/cometvisu.cfg +++ b/features/openhab-addons-external/src/main/resources/conf/cometvisu.cfg @@ -18,4 +18,4 @@ icons.mapping>boy1=scene_childs_room icons.mapping>bedroom=scene_sleeping icons.mapping>heating=sani_heating icons.mapping>temperature=temp_temperature -icons.mapping>contact=fts_window_1w \ No newline at end of file +icons.mapping>contact=fts_window_1w diff --git a/features/openhab-addons/pom.xml b/features/openhab-addons/pom.xml index ed9df10720b8d..b7aa90037c8f7 100644 --- a/features/openhab-addons/pom.xml +++ b/features/openhab-addons/pom.xml @@ -1,12 +1,11 @@ - - + 4.0.0 org.openhab.addons.features.karaf org.openhab.addons.reactor.features.karaf - 2.5.0-SNAPSHOT + 2.5.2-SNAPSHOT org.openhab.addons.features.karaf.openhab-addons @@ -42,20 +41,20 @@ -
+
- - - + + + - + - + -
+